From unknown Mon Jun 23 23:50:30 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#10191 <10191@debbugs.gnu.org> To: bug#10191 <10191@debbugs.gnu.org> Subject: Status: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 Reply-To: bug#10191 <10191@debbugs.gnu.org> Date: Tue, 24 Jun 2025 06:50:30 +0000 retitle 10191 dired-query (in dired-aux.el) fails for certain help-char's, = Emacs 23 and 24 reassign 10191 emacs submitter 10191 Christopher Genovese severity 10191 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 01:27:43 2011 Received: (at submit) by debbugs.gnu.org; 2 Dec 2011 06:27:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWMb1-0000Uu-Cv for submit@debbugs.gnu.org; Fri, 02 Dec 2011 01:27:43 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWMaz-0000Un-03 for submit@debbugs.gnu.org; Fri, 02 Dec 2011 01:27:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RWMak-0007Ay-Jq for submit@debbugs.gnu.org; Fri, 02 Dec 2011 01:27:27 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:42322) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWMak-0007Au-IE for submit@debbugs.gnu.org; Fri, 02 Dec 2011 01:27:26 -0500 Received: from eggs.gnu.org ([140.186.70.92]:33536) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWMaj-0004eI-CT for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2011 01:27:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RWMai-0007AV-1x for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2011 01:27:25 -0500 Received: from mail-qw0-f48.google.com ([209.85.216.48]:52423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWMah-0007AP-V4 for bug-gnu-emacs@gnu.org; Fri, 02 Dec 2011 01:27:24 -0500 Received: by qao25 with SMTP id 25so682338qao.0 for ; Thu, 01 Dec 2011 22:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; bh=yfCor1mha88zkRdiOndlGS6xfylPFf7DSkxixK7JxRo=; b=gq+Z7ajubI84uPd4ScDseOJGAQaKkYRfUNuYhqwKEq9PNQwqBgIjPxrIP6ZrFRgyv9 PCDHBq5UFvh2yBpaTnMIxpMho7ocYULOJfmhwNWSw8QzdmsVERoDGBaG+EJIZ0+41xMV vVDLuYZntbxnqEirKQU9Jk+f5XN8PZEavXgkU= Received: by 10.224.185.145 with SMTP id co17mr1797413qab.77.1322807243350; Thu, 01 Dec 2011 22:27:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.242.73 with HTTP; Thu, 1 Dec 2011 22:27:02 -0800 (PST) From: Christopher Genovese Date: Fri, 2 Dec 2011 01:27:02 -0500 Message-ID: Subject: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary=20cf30334dc5d8a2fc04b3160fd9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --20cf30334dc5d8a2fc04b3160fd9 Content-Type: text/plain; charset=ISO-8859-1 Whether this is a bug or a ... misunderstanding may be a matter of opinion because it goes to the nature of help-char. But the problem is easily fixed in any case. The function dired-query fails for certain settings of help-char; this occurs during the execution of other dired commands (e.g., dired-do-rename-regexp) without a clear trace of the problem for the user. For example, I set my help-char to ?\M-\C-h, which works fine in general. But despite looking like a character, ?\M-\C-h does not satisfy #'characterp, which causes the problem. Technically perhaps, help-char should be a character but from the user's point of view, both of these should qualify. While help-event-list can handle this, using help-char with such a value works in all the other cases I've seen. The failure occurs at the following sexp in dired-query (the same code in 23 and 24 despite significant differences in the functions between the two versions): ; original (if help-form (format " [Type yn!q or %s] " (key-description (char-to-string help-char))) " [Type y, n, q or !] ") When (characterp help-char) is nil, as in my case, char-to-string raises an error. Because I find it highly desirable to allow "characters" like ?\M-\C-h for help-char, I think this is a bug worth fixing. Here is a minimal fix for the offending sexp, not my first choice but an easy change: ; minimal fix (if (and help-form (characterp help-char)) (format " [Type yn!q or %s] " (key-description (char-to-string help-char))) " [Type y, n, q or !] ") Here's a simple fix for the offending sexp that gives better feedback: ; simple fix (if help-form (format " [Type yn!q or %s] " (key-description (cond ((characterp help-char) (char-to-string help-char)) ((eventp help-char) (append (event-modifiers help-char) (list (event-basic-type help-char)))) (t "your help char")))) " [Type y, n, q or !] ") Because key-description does not abbreviate symbolic forms of key modifiers, this gives output like " h". For nicer output, the following more elaborate fix could work, although this *may* be too much for the purpose. ; more (too?) elaborate fix with nicer output (if help-form (format " [Type yn!q or %s] " (cond ((characterp help-char) (key-description (char-to-string help-char))) ((eventp help-char) (let* ((modifiers (reverse (event-modifiers help-char))) (base (event-basic-type help-char)) (mod->str '((meta . "M-") (control . "C-") (shift . "S-") (super . "s-") (hyper . "H-") (alt . "A-") (double . "double-click ") (triple . "triple-click ") (drag . "drag ") (click . "click "))) (modstring (lambda (mod) (cdr (assoc mod mod->str))))) (apply 'concat (reverse (cons (if (characterp base) (key-description (char-to-string base)) (symbol-name base)) (mapcar modstring modifiers)))))) (t "your help char"))) " [Type y, n, q or !] ") Thanks, Chris --20cf30334dc5d8a2fc04b3160fd9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Whether this is a bug or a ... misunderstanding may be a matter of opinion<= br>because it goes to the nature of help-char. But the problem is easilyfixed in any case.

The function dired-query fails for certain setti= ngs of help-char; this occurs
during the execution of other dired commands (e.g., dired-do-rename-regexp)=
without a clear trace of the problem for the user.

For example, = I set my help-char to ?\M-\C-h, which works fine in general.
But despit= e looking like a character, ?\M-\C-h does not satisfy #'characterp, whi= ch causes
the problem. Technically perhaps, help-char should be a character but from = the user's point
of view, both of these should qualify.=A0 While hel= p-event-list can handle this,
using help-char with such a value works in= all the other cases I've seen.

The failure occurs at the following sexp in dired-query (the same code = in 23 and 24
despite significant differences in the functions between th= e two versions):

; original
(if help-form=A0=A0=A0 (format " [Type yn!q or %s] "
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 (key-description
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 (char-to-string help-char)))
=A0 " [Type y, n, = q or !] ")
When (characterp help-char) is nil, as in my case, char-to-string raises a= n error.
Because I find it highly desirable to allow "characters" like ?\M= -\C-h for help-char,
I think this is a bug worth fixing.

Here is = a minimal fix for the offending sexp, not my first choice but an easy chang= e:

; minimal fix
(if (and help-form (characterp help-char))
=A0=A0=A0 (format "= ; [Type yn!q or %s] "
=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (key-description
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 (char-to-string help-char)))
=A0 " [Type y, n, q or !] ")

Here's a simple fix for the offending sexp that gives better feedba= ck:

; simple fix
(if help-form=A0=A0=A0 (format " [Type yn!q or %s] "
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 (key-description
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0 (cond
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 ((characterp help-char)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (char-to-string help-char))
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 ((eventp help-char)
=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (append (event-modifiers help-char)=
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (list (event-basic-type help-= char))))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 (t
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0 "your help char"))))
=A0 " [Type y, n, q or !] ")

Because key-description does not abbreviate symbolic forms of
key mo= difiers, this gives output like "<control> <meta> h".=
For nicer output, the following more elaborate fix could work,
although this may be too much for the purpose.

; more (too?) elabo= rate fix with nicer output
(if help-form
=A0=A0=A0 (format "= ; [Type yn!q or %s] "
=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (cond
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 ((characterp help-char)
= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (key-description (char-to-string he= lp-char)))
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 ((eventp help-char)
=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (let* ((modifiers
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (reverse (event-modifiers help-c= har)))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 (base
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (event-basic-type help-char))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (mod->str '((meta . "M-")
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= (control . "C-")
=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 (shift . "S-")
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= (super . "s-")
=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 (hyper . "H-")
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= (alt . "A-")
=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 (double . "double-click ")
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= (triple . "triple-click ")
=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 (drag . "drag ")
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= (click . "click ")))
=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (modstring=A0 (lambda (= mod)
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0 (cdr (assoc mod mod->str)))))
= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (apply 'concat
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 (reverse
=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (cons
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (if (characterp base)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0 (key-description (char-to-string base))
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 (symbol-name base))
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= (mapcar modstring modifiers))))))
=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 (t
= =A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 "your help char")))
=A0 " [Type y, n, = q or !] ")


Thanks,

=A0 Chris


--20cf30334dc5d8a2fc04b3160fd9-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 03:36:39 2011 Received: (at 10191) by debbugs.gnu.org; 2 Dec 2011 08:36:39 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWObn-0003aO-2j for submit@debbugs.gnu.org; Fri, 02 Dec 2011 03:36:39 -0500 Received: from mail-out.m-online.net ([212.18.0.9]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWObk-0003aG-K1 for 10191@debbugs.gnu.org; Fri, 02 Dec 2011 03:36:37 -0500 Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 1594B1C0C100; Fri, 2 Dec 2011 09:36:21 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.8.164]) by mail.m-online.net (Postfix) with ESMTP id D4C4E1C00105; Fri, 2 Dec 2011 09:36:21 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.180]) by localhost (dynscan1.mail.m-online.net [192.168.8.164]) (amavisd-new, port 10024) with ESMTP id gnNaejdTi15B; Fri, 2 Dec 2011 09:36:20 +0100 (CET) Received: from hase.home (ppp-88-217-97-43.dynamic.mnet-online.de [88.217.97.43]) by mail.mnet-online.de (Postfix) with ESMTP; Fri, 2 Dec 2011 09:36:20 +0100 (CET) From: Andreas Schwab To: Christopher Genovese Subject: Re: bug#10191: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 References: X-Yow: Youth of today! Join me in a mass rally for traditional mental attitudes! Date: Fri, 02 Dec 2011 09:36:26 +0100 In-Reply-To: (Christopher Genovese's message of "Fri, 2 Dec 2011 01:27:02 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10191 Cc: 10191@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Christopher Genovese writes: > For example, I set my help-char to ?\M-\C-h, which works fine in general. > But despite looking like a character, ?\M-\C-h does not satisfy > #'characterp, which causes > the problem. Technically perhaps, help-char should be a character but from > the user's point > of view, both of these should qualify. ?\M-\C-h isn't a character, it is a character with modifiers, and as such does not qualify. A character is something which can be inserted in a buffer or string as-is, for example. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 08:23:23 2011 Received: (at 10191) by debbugs.gnu.org; 2 Dec 2011 13:23:23 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWT5H-0005Pe-2W for submit@debbugs.gnu.org; Fri, 02 Dec 2011 08:23:23 -0500 Received: from mail-pz0-f44.google.com ([209.85.210.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWT5D-0005PU-QM for 10191@debbugs.gnu.org; Fri, 02 Dec 2011 08:23:21 -0500 Received: by dadv40 with SMTP id v40so1566954dad.3 for <10191@debbugs.gnu.org>; Fri, 02 Dec 2011 05:23:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=Rq0yMTk7614vZsEQMzG0mcGw2ZhLiv4FXfb0sIntM+s=; b=Ko9Qs1YTmEyKvWQ9z/Yn25wHjyQSK+dss/NOGDtgyhDequZkh8PmiOj9SGbNnyTDgw AaOZjz71Xlgk2RvbQZo0LxrvYyAg/Ua6SnCZQfI4p8r463N9ERNSl1MGBWBsmV6WFHpS w1S5KxT0oZ1YGCm02dcI/E/yEQoCaUvE3ieXs= Received: by 10.68.2.138 with SMTP id 10mr14404859pbu.55.1322832184338; Fri, 02 Dec 2011 05:23:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.155.7 with HTTP; Fri, 2 Dec 2011 05:22:43 -0800 (PST) In-Reply-To: References: From: Christopher Genovese Date: Fri, 2 Dec 2011 08:22:43 -0500 Message-ID: Subject: Re: bug#10191: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 To: Andreas Schwab Content-Type: multipart/alternative; boundary=bcaec521559f71ea6e04b31bde50 X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: 10191 Cc: 10191@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) --bcaec521559f71ea6e04b31bde50 Content-Type: text/plain; charset=ISO-8859-1 Hi Andreas, I understand that and tried to specifically address that point in my report. But I could have been clearer. I think that a change in this regard, even the minimal one I proposed, is worthwhile for at least two reasons. First, because setting help-char to ?\M-\C-h works in terms of its main functionality (acting as a help character), it seems unnecessary for it to break a dired operation because of the formatting of a string. Second, if the function is going to be doctrinaire about help-char's type, then it has an obligation, I think, to recognize that not everyone uses a help "char" and might use help-event-list instead. It should then still do a characterp to avoid an error in those cases, possibly using the car of help-event-list for the error message when the characterp call returns false. This is not that different from my proposed change, and I'd be happy with that. On the broader question, I would also argue that help-char should be "help-event" or "help-keyboard-event". This is an example of one of the things in emacs that are IMHO too closely tied to the default keymap. I set C-h to delete-backward-char, M-h to backward-kill-word, and C-M-h to help char. This is a quite efficient arrangement and should not cause breakage in simple services just because it deviates from the default. This is Emacs after all. (Also, from the naive user's viewpoint, there is not that much difference between specifying ?\M-\C-h and ?\C-h. They both *look* like characters.) -- Chris On Fri, Dec 2, 2011 at 03:36, Andreas Schwab wrote: > Christopher Genovese writes: > > > For example, I set my help-char to ?\M-\C-h, which works fine in general. > > But despite looking like a character, ?\M-\C-h does not satisfy > > #'characterp, which causes > > the problem. Technically perhaps, help-char should be a character but > from > > the user's point > > of view, both of these should qualify. > > ?\M-\C-h isn't a character, it is a character with modifiers, and as > such does not qualify. A character is something which can be inserted > in a buffer or string as-is, for example. > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different." > --bcaec521559f71ea6e04b31bde50 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Andreas,

=A0=A0=A0 I understand that and tried to specifically ad= dress that point in my report.
But I could have been clearer.

= =A0=A0=A0 I think that a change in this regard, even the minimal one I prop= osed, is
worthwhile for at least two reasons. First, because setting help-char to ?\= M-\C-h works
in terms of its main functionality (acting as a help chara= cter), it seems unnecessary for
it to break a dired operation because o= f the formatting of a string. Second, if the function
is going to be doctrinaire about help-char's type, then it has an oblig= ation, I think, to recognize
that not everyone uses a help "char&qu= ot; and might use help-event-list instead. It should
then still do a cha= racterp to avoid an error in those cases, possibly using the car of
help-event-list for the error message when the characterp call returns fals= e.=A0
This is not that different from my proposed change, and I'd b= e happy with that.

=A0=A0=A0=A0 On the broader question, I would als= o argue that help-char should be "help-event"
or "help-keyboard-event".=A0 This is an example of one of the thi= ngs in emacs that are
IMHO too closely tied to the default keymap.=A0 I = set C-h to delete-backward-char,
M-h to backward-kill-word, and C-M-h to= help char. This is a quite efficient arrangement
and should not cause breakage in simple services just because it deviates f= rom
the default. This is Emacs after all. (Also, from the naive user'= ;s viewpoint, there
is not that much difference between specifying ?\M-\= C-h and ?\C-h.=A0 They both *look*
like characters.)

=A0=A0=A0 -- Chris


On Fri, Dec 2, 2011 at 03:36, Andreas Schwab <<= a href=3D"mailto:schwab@linux-m68k.org">schwab@linux-m68k.org> wrote:
Christopher Genovese <genovese.cr@gmail.com> writes:

> For example, I set my help-char to ?\M-\C-h, which works fine in gener= al.
> But despite looking like a character, ?\M-\C-h does not satisfy
> #'characterp, which causes
> the problem. Technically perhaps, help-char should be a character but = from
> the user's point
> of view, both of these should qualify.

?\M-\C-h isn't a character, it is a character with modifiers, and as such does not qualify. =A0A character is something which can be inserted in a buffer or string as-is, for example.

Andreas.

--
Andreas Schwab, schwab@linux-m68k.= org
GPG Key fingerprint =3D 58CA 54C7 6D53 942B 1756 =A001D3 44D5 214B 8276 4ED= 5
"And now for something completely different."

--bcaec521559f71ea6e04b31bde50-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 09:18:54 2011 Received: (at 10191-done) by debbugs.gnu.org; 2 Dec 2011 14:18:54 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWTwz-0006kF-O4 for submit@debbugs.gnu.org; Fri, 02 Dec 2011 09:18:54 -0500 Received: from pruche.dit.umontreal.ca ([132.204.246.22]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWTwx-0006k7-GP for 10191-done@debbugs.gnu.org; Fri, 02 Dec 2011 09:18:52 -0500 Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id pB2EIZ2p002285; Fri, 2 Dec 2011 09:18:35 -0500 Received: by pastel.home (Postfix, from userid 20848) id 3D26058CC3; Fri, 2 Dec 2011 09:18:35 -0500 (EST) From: Stefan Monnier To: Christopher Genovese Subject: Re: bug#10191: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 Message-ID: References: Date: Fri, 02 Dec 2011 09:18:35 -0500 In-Reply-To: (Christopher Genovese's message of "Fri, 2 Dec 2011 01:27:02 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV4058=0 X-NAI-Spam-Version: 2.2.0.9286 : core <4058> : streams <707141> : uri <1020381> X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: 10191-done Cc: 10191-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.5 (----) > ; original > (if help-form > (format " [Type yn!q or %s] " > (key-description > (char-to-string help-char))) > " [Type y, n, q or !] ") > When (characterp help-char) is nil, as in my case, char-to-string raises an > error. Thanks. I've installed the patch below which should fix your problem, Stefan === modified file 'lisp/dired-aux.el' --- lisp/dired-aux.el 2011-11-17 09:09:20 +0000 +++ lisp/dired-aux.el 2011-12-02 14:14:09 +0000 @@ -927,8 +927,7 @@ (concat (apply 'format prompt args) (if help-form (format " [Type yn!q or %s] " - (key-description - (char-to-string help-char))) + (key-description (vector help-char))) " [Type y, n, q or !] "))) (set sym (setq char (read-char-choice prompt char-choices))) (if (memq char '(?y ?\s ?!)) t))))) From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 09:33:56 2011 Received: (at 10191-done) by debbugs.gnu.org; 2 Dec 2011 14:33:56 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWUBX-000774-S1 for submit@debbugs.gnu.org; Fri, 02 Dec 2011 09:33:56 -0500 Received: from mail-pz0-f44.google.com ([209.85.210.44]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWUBU-00076t-3x for 10191-done@debbugs.gnu.org; Fri, 02 Dec 2011 09:33:54 -0500 Received: by dadv40 with SMTP id v40so1630486dad.3 for <10191-done@debbugs.gnu.org>; Fri, 02 Dec 2011 06:33:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=vPr7nPR4XxhFW7aeRW3qDzJdT6NUnfp34053VA8rMZI=; b=MOsbR1lc9acCb5yPs9Qfo7NEdkF1S+rm+5ZZA8SneGOhB2BVtEoU/7F/Z89UaMRq87 MBpPqllQXicbALGV0+AgdyqrOkHz2z+NyYIFbfKxXDiaz07VBAxi0c7LGGQuhkFnzLdH /mfZmh8ocPnog8HiLsZc6cJCyR7bYEPMnyhbs= Received: by 10.68.42.100 with SMTP id n4mr14685956pbl.38.1322836416222; Fri, 02 Dec 2011 06:33:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.155.7 with HTTP; Fri, 2 Dec 2011 06:33:15 -0800 (PST) In-Reply-To: References: From: Christopher Genovese Date: Fri, 2 Dec 2011 09:33:15 -0500 Message-ID: Subject: Re: bug#10191: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 To: Stefan Monnier Content-Type: multipart/alternative; boundary=bcaec5430626af54d904b31cdadd X-Spam-Score: -4.5 (----) X-Debbugs-Envelope-To: 10191-done Cc: 10191-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) --bcaec5430626af54d904b31cdadd Content-Type: text/plain; charset=ISO-8859-1 Ah, much better. (Silly of me to forget about the vector; not sure what I was thinking.) That's terrific, thanks. -- Chris On Fri, Dec 2, 2011 at 09:18, Stefan Monnier wrote: > > Thanks. I've installed the patch below which should fix your problem, > > > Stefan > > > === modified file 'lisp/dired-aux.el' > --- lisp/dired-aux.el 2011-11-17 09:09:20 +0000 > +++ lisp/dired-aux.el 2011-12-02 14:14:09 +0000 > @@ -927,8 +927,7 @@ > (concat (apply 'format prompt args) > (if help-form > (format " [Type yn!q or %s] " > - (key-description > - (char-to-string help-char))) > + (key-description (vector help-char))) > " [Type y, n, q or !] "))) > (set sym (setq char (read-char-choice prompt char-choices))) > (if (memq char '(?y ?\s ?!)) t))))) > > --bcaec5430626af54d904b31cdadd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ah, much better.=A0 (Silly of me to forget about the vector; not sure what = I was thinking.)

That's terrific, thanks.

=A0-- Chris
=
On Fri, Dec 2, 2011 at 09:18, Stefan Monnier= <monnier@= iro.umontreal.ca> wrote:

Thanks. =A0I've installed the patch below which should fix your problem= ,


=A0 =A0 =A0 =A0Stefan


=3D=3D=3D modified file 'lisp/dired-aux.el'
--- lisp/dired-aux.el =A0 2011-11-17 09:09:20 +0000
+++ lisp/dired-aux.el =A0 2011-12-02 14:14:09 +0000
@@ -927,8 +927,7 @@
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (concat (apply 'format prompt args) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if help-form
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (format " [Ty= pe yn!q or %s] "
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(k= ey-description
- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (= char-to-string help-char)))
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(k= ey-description (vector help-char)))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 " [Type y, n, q o= r !] ")))
=A0 =A0 =A0 =A0 =A0 (set sym (setq char (read-char-choice prompt char-choi= ces)))
=A0 =A0 =A0 =A0 =A0 (if (memq char '(?y ?\s ?!)) t)))))


--bcaec5430626af54d904b31cdadd-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 11:38:19 2011 Received: (at 10191) by debbugs.gnu.org; 2 Dec 2011 16:38:19 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWW7u-0001kg-Kw for submit@debbugs.gnu.org; Fri, 02 Dec 2011 11:38:19 -0500 Received: from mail-out.m-online.net ([212.18.0.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWW7s-0001kZ-O0 for 10191@debbugs.gnu.org; Fri, 02 Dec 2011 11:38:18 -0500 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 01692188A173; Fri, 2 Dec 2011 17:37:59 +0100 (CET) X-Auth-Info: Cyg8pH041BRWbecPYdoMLRC5GhLeGo4g+uNa94DmGt0= Received: from igel.home (ppp-88-217-97-43.dynamic.mnet-online.de [88.217.97.43]) by mail.mnet-online.de (Postfix) with ESMTPA id E34D41C0012E; Fri, 2 Dec 2011 17:37:59 +0100 (CET) Received: by igel.home (Postfix, from userid 501) id 60832CA29C; Fri, 2 Dec 2011 17:37:59 +0100 (CET) From: Andreas Schwab To: 10191@debbugs.gnu.org Subject: Re: bug#10191: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 References: X-Yow: Your CHEEKS sit like twin NECTARINES above a MOUTH that knows no BOUNDS -- Date: Fri, 02 Dec 2011 17:37:59 +0100 In-Reply-To: (Stefan Monnier's message of "Fri, 02 Dec 2011 09:18:35 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.6 (--) X-Debbugs-Envelope-To: 10191 Cc: monnier@IRO.UMontreal.CA X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) Stefan Monnier writes: >> ; original >> (if help-form >> (format " [Type yn!q or %s] " >> (key-description >> (char-to-string help-char))) >> " [Type y, n, q or !] ") > >> When (characterp help-char) is nil, as in my case, char-to-string raises an >> error. > > Thanks. I've installed the patch below which should fix your problem, If we want to support keys as values of help-char that should probably be documented. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 02 12:28:59 2011 Received: (at 10191) by debbugs.gnu.org; 2 Dec 2011 17:29:01 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWWuu-0002vM-HF for submit@debbugs.gnu.org; Fri, 02 Dec 2011 12:28:59 -0500 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RWWtD-0002si-SW for 10191@debbugs.gnu.org; Fri, 02 Dec 2011 12:27:17 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RWWsx-0006ck-0S; Fri, 02 Dec 2011 12:26:55 -0500 From: Glenn Morris To: Andreas Schwab Subject: Re: bug#10191: dired-query (in dired-aux.el) fails for certain help-char's, Emacs 23 and 24 References: X-Spook: bemd CBNRC Downing Street PET ASDIC insurgency World X-Ran: W!Lt8\jo:08Kjb"X[j]<9i*xj)^V&Ms`^X-3lIV (Andreas Schwab's message of "Fri, 02 Dec 2011 17:37:59 +0100") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-Debbugs-Envelope-To: 10191 Cc: 10191@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) Andreas Schwab wrote: > If we want to support keys as values of help-char that should probably > be documented. I agree. There are 13 other places in the Emacs sources that call (char-to-string help-char). It's only the fact that several are preloaded, so that customizing help-char has no effect, that prevents more things from breaking. Eg try loading buff-menu wih the OP's setting, or reloading help.el. If a help-char setting doesn't work in help.el, I think it's safe to say it doesn't work. From unknown Mon Jun 23 23:50:30 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 31 Dec 2011 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator