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: Thu, 6 Oct 2022 14:43:09 +0200 Message-ID: <4CFC3078-64FB-4EAC-A536-F6CBCEE2087D@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> <017DAAA2-0383-4B47-855E-28348B2E9F06@gmail.com> <831qrnx1jc.fsf@gnu.org> <83k05fv9nv.fsf@gnu.org> <52286A5C-D947-4279-812E-173BB44046E1@gmail.com> <83v8oxp5lk.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39581"; 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 Thu Oct 06 15:20:10 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 1ogQnJ-000AA5-SJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 15:20:09 +0200 Original-Received: from localhost ([::1]:41812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ogQnI-0002JO-NJ for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 06 Oct 2022 09:20:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ogQEM-0006qZ-Ba for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 08:44:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ogQEM-0004Ft-2G for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 08:44:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ogQEL-0001Xb-Qp for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2022 08:44: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: Thu, 06 Oct 2022 12:44: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.16650602025856 (code B ref 58168); Thu, 06 Oct 2022 12:44:01 +0000 Original-Received: (at 58168) by debbugs.gnu.org; 6 Oct 2022 12:43:22 +0000 Original-Received: from localhost ([127.0.0.1]:59322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogQDi-0001WN-19 for submit@debbugs.gnu.org; Thu, 06 Oct 2022 08:43:22 -0400 Original-Received: from mail-lj1-f173.google.com ([209.85.208.173]:44921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ogQDe-0001W7-9U for 58168@debbugs.gnu.org; Thu, 06 Oct 2022 08:43:20 -0400 Original-Received: by mail-lj1-f173.google.com with SMTP id q17so2060764lji.11 for <58168@debbugs.gnu.org>; Thu, 06 Oct 2022 05:43:18 -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=Gu4e0OWJsJRq/LM30o8iHx7tXnxrU9jfJ2JGGVfGZAs=; b=Xvt5eqNPWmV+dYvlTDAiRkcXE949Vh6dH1wb7l8unL+j3DY/bCBwWcybgWKMtftGMZ Es4Q0lsDcr2hWxocYMI4qdWFWJNBbcu3s9DsTa19CQ6gnCdxD92aAihh39CIEVy7OTQC 358fDQPDBLmufRqJ0BngibkgvpcKFHZklNwhc+kCuHtsfIcFfWcRBt3Cwsnm3Gu+qCVN X11c2YFkmHU7DsBa9xsTjMWDvDka8diKnfFCxbGo+HqZUzLI8Xkv2xidf5xaNVsl5CzU F9vQtou7Iez4h0S97Rdm9Wzh2nBcQ+O9mLrD11FfFSXArmqc0pAu59vq4ijq7WclZB0S Fl+w== 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=Gu4e0OWJsJRq/LM30o8iHx7tXnxrU9jfJ2JGGVfGZAs=; b=qi7lcYMY/3vV5C2eKhr1Eq0JzBfYX1vA+q603SukGeTYFTWQjLsrfeUmhsx+9govby LJp7tT9QnbeHkneIRdpEoxRMmRg4Q6Lxlnw/Ch+rkeHoK4t0oHolxmId99S/AJ7IzOBv 2rop1Rdei072hm9bQuS/ang1Teil+TOdMMawILrCLBfefXIq0+xQJy98f+Pbted/aUoL 2lJGm4qRVmd7O4KjlAlLaobObl4Tdy1SVVCrzdujjsnw5ij8XymcogGXNpGzmD4HNZQL BbEEqJhY2hT8uproByUTcQfPgrZZTjUx/0dq7nl+6eeJqMwaET6JqsaME5NnM/hNJCAL kP8Q== X-Gm-Message-State: ACrzQf2umumizq7UJp07CyizxC2+/CWemZ58vYKvCT98HJpRWIffyT2W 2hDIIEq1nb/JDt4nuoygYwA= X-Google-Smtp-Source: AMsMyM6mjhBY/qG0l8tbsdvlpS1JE960q6WcXpbqKdypnXdv11IfnHlw3+Ego/hp+Ob+1UvBnp6XiQ== X-Received: by 2002:a05:651c:110c:b0:26d:a099:8715 with SMTP id e12-20020a05651c110c00b0026da0998715mr1754100ljo.44.1665060192150; Thu, 06 Oct 2022 05:43: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 u19-20020ac25193000000b00499b232875dsm2686275lfi.171.2022.10.06.05.43.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Oct 2022 05:43:10 -0700 (PDT) In-Reply-To: <83v8oxp5lk.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:244661 Archived-At: 6 okt. 2022 kl. 13.13 skrev Eli Zaretskii : >> (format-message "%\345" 0) >> =3D> (error "Invalid format operation %=C3=A5") >=20 > And you want to show %\345 instead? Maybe, or (as the patch suggested) using a different wording for raw = bytes. In any case %=C3=A5 is clearly a lie since that character wasn't = in the format string. What would you rather see in such a case? > Are you sure this is not the > consequence of inserting the error message into a multibyte buffer? Quite sure. The error message is always produced as multibyte and the %c = processing done at doprnt.c:471: case 'c': { int chr =3D va_arg (ap, int); tem =3D CHAR_STRING (chr, (unsigned char *) charbuf); where CHAR_STRING renders chr (the %c argument passed to `error`) as a = multibyte char to charbuf here. >>> Who said anything about #x3fffc? The original code had #xfc, the >>> unibyte code for #x3ffffc. >>=20 >> There seems to be a misunderstanding. The original (and current) code = attempts to display char #x3fffc, which is not a raw byte. It's just a = typo for #x3ffffc -- not a big deal. >=20 > But your change replaced it with \xfc, which is what I questioned. Oh, I see -- you are looking at the hunk that changed the labels, not = the character tested. When 3fffc was changed into 3ffffc, the "expected" = string needed to change accordingly; for the latter, it's \xfc or \374 = depending on mode. > Why not test both #x3ffffc and #xfc? And the same question about > \777777 vs \374. Testing #x3ffffc inserts the raw byte #xfc so that takes care of that -- = the test already exercised inserting the unibyte raw byte #x80 and the = patch didn't change that. I don't think these two cases actually exercise different paths in = redisplay since the buffer is multibyte: (insert "\xfc") and (insert (char-to-string #x3ffffc)) should have identical effects on the buffer and hence the display, but = it doesn't hurt to have one of each. \777774 is just octal for #x3fffc which was changed into the (intended) = #x3ffffc, and \374 is octal for #xfc which is covered as above. Thus, the only case actually removed was #x3fffc since it was a typo, = and #x10abcd was put in its place.