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: Mon, 3 Oct 2022 21:48:10 +0200 Message-ID: <017DAAA2-0383-4B47-855E-28348B2E9F06@gmail.com> 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> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_71F96A86-5E70-4A3D-805B-3E204C4443BC" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18649"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58168@debbugs.gnu.org, Eli Zaretskii To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 03 22:33:48 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 1ofS8K-0004du-KW for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Oct 2022 22:33:48 +0200 Original-Received: from localhost ([::1]:44886 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofS8J-0001hR-5Q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 Oct 2022 16:33:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ofRR6-0002tM-Bn for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 15:49:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52684) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ofRR0-000600-Aw for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 15:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ofRR0-0001cJ-5u for bug-gnu-emacs@gnu.org; Mon, 03 Oct 2022 15:49:02 -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: Mon, 03 Oct 2022 19:49: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.16648265006153 (code B ref 58168); Mon, 03 Oct 2022 19:49:02 +0000 Original-Received: (at 58168) by debbugs.gnu.org; 3 Oct 2022 19:48:20 +0000 Original-Received: from localhost ([127.0.0.1]:51759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofRQK-0001bA-B7 for submit@debbugs.gnu.org; Mon, 03 Oct 2022 15:48:20 -0400 Original-Received: from mail-lf1-f44.google.com ([209.85.167.44]:36661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ofRQI-0001ax-Fz for 58168@debbugs.gnu.org; Mon, 03 Oct 2022 15:48:19 -0400 Original-Received: by mail-lf1-f44.google.com with SMTP id bu25so18103860lfb.3 for <58168@debbugs.gnu.org>; Mon, 03 Oct 2022 12:48:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:from:to:cc:subject:date; bh=+QfvMHPkz7KgvefOzTxOgiRMMH9lGXewvks6VHiyHac=; b=h56QuqQ/x0JSnOQCKnIhKLTVuh7iRxDBryqQgvKWQcebtpvaJabONTZB9+MnG5S1C9 c8O/r6mbcsdJIAtqCFXNdS0LDMpZmSvE/VUarYKQ3+kn4M8Mgnhbagfrbm8r1fM4gml6 NFxlZ4Ioaa04T7mXN2MHLdy+eHbPLwO0/weEjm4RMWf2oCE6QTcf/NbYqFvAQ1UeE49G mBwPspd1xfPaE6evJWGqdrc2NCflWcZkt3fS/xsi/mUDm57pWNThIPvOBVG7G0hXxlAC s9gprpg8y66YjNN61Vb61adHKtbBvbadHt073RtRiMPSEYRUbzIh2jyoSUztKONRSjho Enng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:x-gm-message-state:from:to:cc:subject:date; bh=+QfvMHPkz7KgvefOzTxOgiRMMH9lGXewvks6VHiyHac=; b=GesnTQtdO3O6/ABaiMHySHTcrujYv1qwYty7+Q/lyNE54Ta0/9iYWNtDptcLiwJpzW pBUFEtxvwPgDOMrH+HiG/z79RuwkPiPOoZNspVBvspWHJknHVUAHRq4SAMt43XfdRg/1 bgarWMBJIgjE5xGy945T+AOj9V2PKcC9xQhU60D0I3nbiHOIg9IL3mXKmo1l6H85NaUv eqjFZuqSm9ISyxHo4TpgOyotJ8ARLP1zC1nYecifGIyMoCO0GtEeo97BHT4+ywNzk/mT bNoVEue/FCKi4IguEPzU/NmWtGrgoYI5eWiLWMZXNc0OuRWKrFmdbeu4wBdHG4tmrKUL YlrA== X-Gm-Message-State: ACrzQf2fh6EdKGdKx/7jxWr44Zp8kxJ5OSBQMhGHhANZE9ivUG+v7KXp Yyf0fOgqupH2Qh51PQ5DyOY= X-Google-Smtp-Source: AMsMyM6pzNp3aIZpiJnBSXC3olu0YmstozJBg/PqUMyvdzDqkAoaR7ufrQSJD8xtU0hKRMpcZogU/A== X-Received: by 2002:a05:6512:230f:b0:499:dcd:2fd2 with SMTP id o15-20020a056512230f00b004990dcd2fd2mr8605302lfu.677.1664826492119; Mon, 03 Oct 2022 12:48:12 -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 o15-20020a05651c050f00b0026de7597bffsm116993ljp.10.2022.10.03.12.48.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Oct 2022 12:48:11 -0700 (PDT) In-Reply-To: <878rlzfylg.fsf@gnus.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:244331 Archived-At: --Apple-Mail=_71F96A86-5E70-4A3D-805B-3E204C4443BC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 1 okt. 2022 kl. 15.43 skrev Lars Ingebrigtsen : > There was a very long thread about changing this output in a bug = report > somewhere, and we decided not to, because all the alternatives were > worse than what we have. I have no wish to reopen old wounds (and it sounds as if the debate = isn't one that you are keen to revisit), but I'm a bit surprised -- it = all arises because of old code that still treats raw bytes as Latin-1, = and I know that neither of you are very fond of that either. 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). --Apple-Mail=_71F96A86-5E70-4A3D-805B-3E204C4443BC Content-Disposition: attachment; filename=redisplay-testsuite.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="redisplay-testsuite.diff" Content-Transfer-Encoding: 7bit diff --git a/test/manual/redisplay-testsuite.el b/test/manual/redisplay-testsuite.el index 01b0a895a4..5495146b87 100644 --- 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))) (insert "\n Result: ") (setq test-redisplay-5b-result-overlay - (test-insert-overlay " " 'display (char-to-string #x3fffc))) + (test-insert-overlay " " 'display (char-to-string #x3ffffc))) + (insert "\n\n") + (insert-button "Toggle between octal and hex display for raw bytes" + 'action 'test-redisplay-5-toggle) + (insert "\n\n")) + +(defun test-redisplay-6 () + (insert "Test 6: Display of unprintable Unicode chars:\n\n") + (insert " Expected: ") + (test-insert-overlay " " 'display + (propertize "\\200" 'face 'escape-glyph)) + (insert " (representing U+0100)") + (insert "\n Result: ") + (test-insert-overlay " " 'display "\u0080") (insert "\n\n") - (insert-button "Toggle between octal and hex display" - 'action 'test-redisplay-5-toggle)) + ;; This tests a large codepoint, to make sure the internal buffer we + ;; use to produce the representation is large enough. + (insert " Expected: ") + (aset printable-chars #x10abcd nil) + (test-insert-overlay " " 'display + (propertize "\\4125715" 'face 'escape-glyph)) + (insert " (representing U+0010ABCD)") + (insert "\n Result: ") + (test-insert-overlay " " 'display "\U0010ABCD") + (insert "\n\n")) (defun test-redisplay () (interactive) @@ -349,6 +367,7 @@ test-redisplay (test-redisplay-3) (test-redisplay-4) (test-redisplay-5) + (test-redisplay-6) (goto-char (point-min)))) ;;; redisplay-testsuite.el ends here --Apple-Mail=_71F96A86-5E70-4A3D-805B-3E204C4443BC--