all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <stephen.berman@gmx.net>
To: Mauro Aranda <maurooaranda@gmail.com>
Cc: 64046@debbugs.gnu.org
Subject: bug#64046: 30.0.50; Quoting in customize choice tags
Date: Thu, 20 Jul 2023 17:48:27 +0200	[thread overview]
Message-ID: <87v8eelh2s.fsf@gmx.net> (raw)
In-Reply-To: <8ca48b5a-1619-8da8-ae3a-6ae96351a19d@gmail.com> (Mauro Aranda's message of "Sat, 15 Jul 2023 10:20:17 -0300")

[-- Attachment #1: Type: text/plain, Size: 1909 bytes --]

On Sat, 15 Jul 2023 10:20:17 -0300 Mauro Aranda <maurooaranda@gmail.com> wrote:

> Stephen Berman <stephen.berman@gmx.net> writes:
>
>> On Thu, 22 Jun 2023 19:59:26 -0300 Mauro Aranda <maurooaranda@gmail.com>
>  wrote:
[...]
>>> Since there's no problem with widget--simplify-menu, the patch looks
>>> good to me.
>>
>> Thanks.  So Eli, should this go into master, since it's not a
>> regression, or is it ok to install this to the release branch?  It does
>> seem pretty safe, since it's only applying substitute-command-keys in a
>> few more places in widget-choose.
>>
>> Steve Berman
>
> Turns out this code introduces regressions when customizing faces.
>
> With emacs -Q:
> M-x customize-face RET default
> Action the State button and choose: "For All Kinds of Displays"
> Action the Display menu and select "specific display"
> Wrong type argument: number-or-marker-p, "        "
>
> The substitute-command-keys operation is too destructive, and messes
> with things it shouldn't be modifying, like the :offset property of
> widgets in this case.

Sorry for not responding sooner; I was travelling and only now had time
to look into this.  If I debugged it correctly, the problem is that the
value of :extra-offset, 9, satisfies char-or-string-p, so then due to my
patch substitute-command-keys turns it into a string containing a TAB.
The cases intended to be fixed by my patch are where strings with grave
quoting occur, which should be turned into strings with curve quoting.
If so, then testing for stringp suffices, and the attached patch avoids
the regression you found and gives the desired results for the other
cases discussed in this bug.  I don't know why I used char-or-string-p
instead of stringp in my original patch, and don't see a reason for it
now.  Or do you know of cases where testing for stringp is insufficient?

Steve Berman


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: widget-choose patch --]
[-- Type: text/x-patch, Size: 591 bytes --]

diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 234f3d9b74d..606093fd293 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -286,7 +286,7 @@ widget-choose
   (let ((items (mapc (lambda (x)
                        (when (consp x)
                          (dotimes (i (1- (length x)))
-                           (when (char-or-string-p (nth i x))
+                           (when (stringp (nth i x))
                              (setcar (nthcdr i x)
                                      (substitute-command-keys
                                       (car (nthcdr i x))))))))

  reply	other threads:[~2023-07-20 15:48 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-13 14:02 bug#64046: 30.0.50; Quoting in customize choice tags Stephen Berman
2023-06-13 15:56 ` Eli Zaretskii
2023-06-14 19:51   ` Mauro Aranda
2023-06-14 20:05   ` Mauro Aranda
2023-06-15 11:39     ` Stephen Berman
2023-06-22 20:07       ` Stephen Berman
2023-06-22 22:59         ` Mauro Aranda
2023-06-23 22:18           ` Stephen Berman
2023-06-24  6:37             ` Eli Zaretskii
2023-06-24  8:50               ` Stephen Berman
2023-07-15 13:20 ` Mauro Aranda
2023-07-20 15:48   ` Stephen Berman [this message]
2023-07-20 19:11     ` Mauro Aranda
2023-07-20 19:53       ` Stephen Berman
2023-08-21 12:04         ` Ola x Nilsson
2023-08-21 14:51           ` Mauro Aranda
2023-08-24 12:51             ` Stephen Berman
2023-08-24 13:19               ` Stephen Berman
2023-08-24 20:14                 ` Mauro Aranda
2023-08-24 20:54                   ` Stephen Berman
2023-08-24 21:58                     ` Mauro Aranda
2023-08-25  8:02                       ` Ola x Nilsson
2023-08-25 21:50                         ` Stephen Berman
2023-08-28  9:33                           ` Ola x Nilsson
2023-08-28 13:50                             ` Stephen Berman
2023-08-30 15:29                               ` Mauro Aranda
2023-08-30 16:29                                 ` Stephen Berman
2023-08-30 22:33                                   ` Mauro Aranda
2023-08-30 22:51                                     ` Stephen Berman
2023-08-30 22:58                                       ` Mauro Aranda
2023-08-31  5:41                                         ` Eli Zaretskii
2023-08-31  6:43                                           ` Stefan Kangas
2023-08-31 15:43                                             ` Drew Adams
2023-08-31 20:52                                               ` Stefan Kangas
2023-08-31 22:10                                                 ` Drew Adams
2023-08-31 22:59                                                   ` Stefan Kangas
2023-09-01  1:08                                                     ` Drew Adams
2023-09-01  6:34                                                       ` Eli Zaretskii
2023-09-01 16:17                                                         ` Drew Adams
2023-09-01 23:29                                                           ` Stephen Berman
2023-09-01 23:38                                                             ` Stefan Kangas
2023-09-02  9:49                                                               ` Stephen Berman
2023-09-02 18:59                                                                 ` Stefan Kangas
2023-09-02 21:25                                                                   ` Stephen Berman
2023-09-02  2:12                                                             ` Drew Adams
2023-09-01  6:16                                                     ` Eli Zaretskii
2023-09-01 16:32                                                       ` Drew Adams
2023-08-24 20:53                 ` Stefan Kangas
2023-08-24 21:10                   ` Stephen Berman
2023-08-24 21:14                     ` Stefan Kangas
2023-08-24 21:41                       ` Stephen Berman

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=87v8eelh2s.fsf@gmx.net \
    --to=stephen.berman@gmx.net \
    --cc=64046@debbugs.gnu.org \
    --cc=maurooaranda@gmail.com \
    /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.