From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#58168: string-lessp glitches and inconsistencies Date: Tue, 4 Oct 2022 16:44:17 +0200 Message-ID: References: <7824372D-8002-4639-8AEE-E80A6D5FEFC6@gmail.com> <877d1l55rn.fsf@gnus.org> <469814C2-197A-4BCA-8E2A-245577340C1E@gmail.com> <878rlzj1zv.fsf@gnus.org> <878rlzfylg.fsf@gnus.org> <017DAAA2-0383-4B47-855E-28348B2E9F06@gmail.com> <831qrnx1jc.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5259"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58168@debbugs.gnu.org, larsi@gnus.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 04 17:39:27 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ofk10-0001Fp-Ve for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Oct 2022 17:39:27 +0200 Original-Received: from localhost ([::1]:54580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofk0z-00075e-VL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Oct 2022 11:39:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofjAM-00035H-G8 for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 10:45:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofjAM-0007PF-6n for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 10:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ofjAL-0000UX-TS for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 10:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Oct 2022 14:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58168 X-GNU-PR-Package: emacs Original-Received: via spool by 58168-submit@debbugs.gnu.org id=B58168.16648946711835 (code B ref 58168); Tue, 04 Oct 2022 14:45:01 +0000 Original-Received: (at 58168) by debbugs.gnu.org; 4 Oct 2022 14:44:31 +0000 Original-Received: from localhost ([127.0.0.1]:54917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofj9q-0000TX-IQ for submit@debbugs.gnu.org; Tue, 04 Oct 2022 10:44:30 -0400 Original-Received: from mail-lj1-f177.google.com ([209.85.208.177]:41638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofj9n-0000TH-8X for 58168@debbugs.gnu.org; Tue, 04 Oct 2022 10:44:29 -0400 Original-Received: by mail-lj1-f177.google.com with SMTP id y22so1594550ljc.8 for <58168@debbugs.gnu.org>; Tue, 04 Oct 2022 07:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date; bh=RMGAaeNOcYPoKWFt1CWUk5fOK07H16S6vL9ygLq6tHM=; b=ozjCs62SfUchl4a6K+p3aVPbGdigudeII53W+zGUs23lDUVChTM3m5UsyaHIP9Sunc nY9BbWWVqdayXZEGRTtgHsRHOI5WrAh26vdugdp1eFrWa27tGpI4Bg+TkqwcoK97a+AU fObxrMrsy84wzYXa+8Kw0ZarZhughY/2W5YwiOgBwy4i2RPjUfUp/q4HtFmi6gkiTDHQ BjFLMf0QY2t0mTtB4Cl3TuTMz3VF3Md5M4BQkS0NfjIrYhLkV4yVeUIHbuLjSyCwyHL/ hrRt/EI1XoRBr3ABVqTyH9SSnBzOFSK+r+M+EjyOKywVFEBPAi/tEvArienlSoskJ6qV 4BWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date; bh=RMGAaeNOcYPoKWFt1CWUk5fOK07H16S6vL9ygLq6tHM=; b=VM1c/EDZhEX8oyf15HSlJMuM1ETz5lVMCwndZ4aSIO/5NSnESyFJljjRpFyJalH6Sq awzR5q1pEEa/dqnF8VpGZChEvpHhjPsOlUWoTG5l0CHhms19urMXxI2CRnrRpJaDgfiL ZqHCkrACREG/1XUimdo/Jx2nmz2CorZNhFIailTCjrF2XJr7Rx2bDlYZ7o4cuhLf0dfl HEFb4ZZtFqvjbQd5NOIxgt/YkXtAkLYrB1a+Nr/knHT/XtKxMRhU+W4JBWstQSsCzSv+ TR7T1mP6uGKxyg3RobmG2rPfCS6aqx5YLfkCU7v+EWO5cCOQGZOhjZ9srqMK1wpE0srO 4rIQ== X-Gm-Message-State: ACrzQf0uk85L0MbqnSwcAfIRC913BQuNAKiIT1vA0Ia/KiljmUwWPjVF Zooz7OUZxAbbj9fIF4nXdKw= X-Google-Smtp-Source: AMsMyM5YdGNj2loTxj02ov2NRwHRK7uoeohaY0Thg18zGZ43HOpdV+XXrovjVRHTpe+x6+C4uDkzNw== X-Received: by 2002:a2e:7210:0:b0:26d:94f3:23c4 with SMTP id n16-20020a2e7210000000b0026d94f323c4mr8369356ljc.192.1664894659525; Tue, 04 Oct 2022 07:44:19 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-171-209.bredband.tele2.se. [188.150.171.209]) by smtp.gmail.com with ESMTPSA id p20-20020a2eb7d4000000b0026c5dce1f9dsm1248090ljo.106.2022.10.04.07.44.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Oct 2022 07:44:18 -0700 (PDT) In-Reply-To: <831qrnx1jc.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.13) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:244446 Archived-At: 4 okt. 2022 kl. 13.37 skrev Eli Zaretskii : > 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.