From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58168: string-lessp glitches and inconsistencies Date: Tue, 04 Oct 2022 14:37:27 +0300 Message-ID: <831qrnx1jc.fsf@gnu.org> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58168@debbugs.gnu.org, larsi@gnus.org To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 04 13:39:59 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 1ofgHE-00063m-VX for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Oct 2022 13:39:57 +0200 Original-Received: from localhost ([::1]:45402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofgHC-0006Br-7G for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 04 Oct 2022 07:39:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35430) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofgGQ-0005pz-AV for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 07:39:10 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofgGM-0007yo-8y for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 07:39:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ofgGM-0001Bo-3v for bug-gnu-emacs@gnu.org; Tue, 04 Oct 2022 07:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 04 Oct 2022 11:39:02 +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.16648834864508 (code B ref 58168); Tue, 04 Oct 2022 11:39:02 +0000 Original-Received: (at 58168) by debbugs.gnu.org; 4 Oct 2022 11:38:06 +0000 Original-Received: from localhost ([127.0.0.1]:52734 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofgFO-0001AZ-C3 for submit@debbugs.gnu.org; Tue, 04 Oct 2022 07:38:06 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofgFJ-00019v-AF for 58168@debbugs.gnu.org; Tue, 04 Oct 2022 07:38:01 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:57368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofgFC-0007qE-Nv; Tue, 04 Oct 2022 07:37:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=D5qekY0VFkaMjMG/Hkfd310V/koKWcVIgGhKFOOxPOg=; b=rc600PMLhHbF4eoB1wqJ KqpJgxssKXiTEeFMM/Kyz4klp7iakvUUzhHUR+Aq+StMBTvLZYQiLfIziMYJ3urmZn8DcH567PJ6I daJBbvAg45/nZdpfk4DqWsPT1xl9P9bPy25YvhpGEkid/HgVlEwKjuMfNmwXIkstPcFLpYkBuljfY enaqz1lwYPSGcOTIY9xIOBF68Tksl/auKOgNYuzJIw+Pe4naS88R6Ts+Vybqg8atvFiS4jtUIuuth LrxP3mFcdjGRTqZtRuTorVeixJSZXdOLV72Drx45IiVTufDEawi9+MYEmhyBqZFTavXEHH9GIXekQ zvfqaino88DRfA==; Original-Received: from [87.69.77.57] (port=4890 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofgEu-0005Jr-Am; Tue, 04 Oct 2022 07:37:49 -0400 In-Reply-To: <017DAAA2-0383-4B47-855E-28348B2E9F06@gmail.com> (message from Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= on Mon, 3 Oct 2022 21:48:10 +0200) 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:244407 Archived-At: > From: Mattias EngdegÄrd > Date: Mon, 3 Oct 2022 21:48:10 +0200 > Cc: 58168@debbugs.gnu.org, > Eli Zaretskii > > 1 okt. 2022 kl. 15.51 skrev Eli Zaretskii : > > > I think the variable is a misnomer of sorts: the request back when it > > was introduced to display hex where we usually display octal \nnn > > escapes. And the latter happens not only for raw bytes. > > Fair enough. Maybe the documentation should reflect that, but I'm still holding out for a change to the C1 presentation in the long term, so... > > I'm not going to pursue this little digression any further except that while looking at it I found a few inaccuracies and a likely bug in redisplay-testsuite.el. I'm attaching a patch which un-muddles the test and adds a display of unprintable Unicode chars such as C1 controls, in addition to raw bytes. I'd like to adorn the commit with the correct bug number so if you remember that of the original discussion that would be useful (I never found it very easy to search debbugs). 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. (Doesn't it abort for you? or do you not build Emacs with --enable-checking?) This was a regression in Emacs 28, sigh. Looking at your patch, I don't think I understand this part: > --- a/test/manual/redisplay-testsuite.el > +++ b/test/manual/redisplay-testsuite.el > @@ -305,7 +305,7 @@ test-redisplay-5-toggle > (let ((label (if display-raw-bytes-as-hex "\\x80" "\\200"))) > (overlay-put test-redisplay-5a-expected-overlay 'display > (propertize label 'face 'escape-glyph))) > - (let ((label (if display-raw-bytes-as-hex "\\x3fffc" "\\777774"))) > + (let ((label (if display-raw-bytes-as-hex "\\xfc" "\\374"))) > (overlay-put test-redisplay-5b-expected-overlay 'display > (propertize label 'face 'escape-glyph)))) > > @@ -320,18 +320,36 @@ test-redisplay-5 > (test-insert-overlay " " 'display "\200")) > (insert "\n\n") > (insert " Expected: ") > - ;; This tests a large codepoint, to make sure the internal buffer we > - ;; use to produce the representation is large enough. > - (aset printable-chars #x3fffc nil) > (setq test-redisplay-5b-expected-overlay > (test-insert-overlay " " 'display > - (propertize "\\777774" 'face 'escape-glyph))) > + (propertize "\\374" 'face 'escape-glyph))) I could understand why you'd want to _add_ the larger values, but why replace? 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. (If you know what code is in question, it is much easier to find the bug via "git annotate", assuming the bug number was cited in the commit logs.)