From: "Mattias Engdegård" <mattias.engdegard@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 58168@debbugs.gnu.org, larsi@gnus.org
Subject: bug#58168: string-lessp glitches and inconsistencies
Date: Tue, 4 Oct 2022 16:44:17 +0200 [thread overview]
Message-ID: <B3639DF2-95E0-459B-B718-A2779EA53B95@gmail.com> (raw)
In-Reply-To: <831qrnx1jc.fsf@gnu.org>
4 okt. 2022 kl. 13.37 skrev Eli Zaretskii <eliz@gnu.org>:
> First I needed to fix fallout from making STRING_CHAR intolerant of
> unibyte text, because redisplay-testsuite caused assertion violations
> in string_char_and_length.
Good catch! Just to satisfy my curiosity:
> error ("Invalid format operation %%%c",
> - STRING_CHAR ((unsigned char *) format - 1));
> + multibyte_format
> + ? STRING_CHAR ((unsigned char *) format - 1)
> + : *((unsigned char *) format - 1));
This treats unibyte format strings as if they were Latin-1 for the purpose of the error message. Not very important, of course, but maybe there should be a UNIBYTE_TO_CHAR in the alternative branch?
> (Doesn't it abort for you? or do you not
> build Emacs with --enable-checking?)
Oh I certainly do that occasionally, but it's mostly when I've changed something at the C level or have reason to believe that something is broken there.
> I could understand why you'd want to _add_ the larger values, but why
> replace?
Because it seemed pretty clear that the old code intended to use #x3ffffc for testing display of raw bytes but a typo turned it into #x3fffc instead which isn't a raw byte but a multibyte character. That it's an easy mistake to make (done so several times myself).
Thus the change fixes that: it now correctly tests #x3ffffc (multibyte raw byte FC) as well as a couple of undisplayable multibyte chars (one C1 control and one astral plane unicode value made undisplayable). Now everything should be described correctly, which wasn't the case before.
> As for the bug report which led to display-raw-bytes-as-hex (if that
> what you meant) and its discussion, it's bug#27122.
Thank you, but I actually meant the one where it was agreed that it was a good idea to display raw bytes and Latin-1 U+0080..009F in the same way. There isn't much of a code trail because it probably never was a conscious decision -- it just ended up being that way -- but apparently the status quo was defended/rationalised at some point.
I've now pushed the patch; the code can be improved further if necessary.
next prev parent reply other threads:[~2022-10-04 14:44 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-29 16:24 bug#58168: string-lessp glitches and inconsistencies Mattias Engdegård
2022-09-29 17:00 ` Mattias Engdegård
2022-09-29 17:11 ` Eli Zaretskii
2022-09-30 20:04 ` Mattias Engdegård
2022-10-01 5:22 ` Eli Zaretskii
2022-10-01 19:57 ` Mattias Engdegård
2022-10-02 5:36 ` Eli Zaretskii
2022-10-03 19:48 ` Mattias Engdegård
2022-10-04 5:55 ` Eli Zaretskii
2022-10-04 17:40 ` Richard Stallman
2022-10-04 18:07 ` Eli Zaretskii
2022-10-06 9:05 ` Mattias Engdegård
2022-10-06 11:06 ` Eli Zaretskii
2022-10-07 14:23 ` Mattias Engdegård
2022-10-08 7:35 ` Eli Zaretskii
2022-10-14 14:39 ` Mattias Engdegård
2022-10-14 15:31 ` Eli Zaretskii
2022-10-17 12:44 ` Mattias Engdegård
2022-09-30 13:52 ` Lars Ingebrigtsen
2022-09-30 20:12 ` Mattias Engdegård
2022-10-01 5:34 ` Eli Zaretskii
2022-10-01 11:51 ` Mattias Engdegård
2022-10-01 10:02 ` Lars Ingebrigtsen
2022-10-01 10:12 ` Eli Zaretskii
2022-10-01 13:37 ` Mattias Engdegård
2022-10-01 13:43 ` Lars Ingebrigtsen
2022-10-03 19:48 ` Mattias Engdegård
2022-10-04 10:44 ` Lars Ingebrigtsen
2022-10-04 11:37 ` Eli Zaretskii
2022-10-04 14:44 ` Mattias Engdegård [this message]
2022-10-04 16:24 ` Eli Zaretskii
2022-10-06 9:05 ` Mattias Engdegård
2022-10-06 11:13 ` Eli Zaretskii
2022-10-06 12:43 ` Mattias Engdegård
2022-10-06 14:34 ` Eli Zaretskii
2022-10-07 14:45 ` Mattias Engdegård
2022-10-07 15:33 ` Eli Zaretskii
2022-10-08 17:13 ` Mattias Engdegård
2022-10-01 13:51 ` Eli Zaretskii
2022-10-01 5:30 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=B3639DF2-95E0-459B-B718-A2779EA53B95@gmail.com \
--to=mattias.engdegard@gmail.com \
--cc=58168@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=larsi@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.