emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#61505: closed ([PATCH] Handle anonymous commands in C-h K)


From: GNU bug Tracking System
Subject: bug#61505: closed ([PATCH] Handle anonymous commands in C-h K)
Date: Wed, 10 Jan 2024 22:52:01 +0000

Your message dated Wed, 10 Jan 2024 14:51:31 -0800
with message-id 
<CADwFkmmXoiTZ+HizRC+FAQWW7Y5e9i5O1HDs_fa_PTTYX7QxKA@mail.gmail.com>
and subject line Re: bug#61505: [PATCH] Handle anonymous commands in C-h K
has caused the debbugs.gnu.org bug report #61505,
regarding [PATCH] Handle anonymous commands in C-h K
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
61505: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61505
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH] Handle anonymous commands in C-h K Date: Tue, 14 Feb 2023 09:39:00 +0200
Tags: patch

Currently C-h K (Info-goto-emacs-key-command-node) throws an error when
used on anonymous commands, for example:

1. emacs -Q
2. Evaluate this form:
    (keymap-global-set "C-c m"
                       (lambda ()
                         (interactive)
                         (message "foo")))
3. Type C-h K C-c m
4. Get this error:
    Info-goto-emacs-command-node: Wrong type argument: symbolp, (closure (t) 
nil (interactive) (message "foo"))

This patch makes Info-goto-emacs-key-command-node detect and handle such
cases by printing an informative message instead of calling
Info-goto-emacs-command-node.


In GNU Emacs 30.0.50 (build 6, x86_64-apple-darwin22.2.0, NS
 appkit-2299.30 Version 13.1 (Build 22C65)) of 2023-02-11 built on
 esmac.lan
Repository revision: 838415525bd4e77a79e18af8e4f01ed004196c71
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2299
System Description:  macOS 13.1

Configured using:
 'configure --with-native-compilation --with-json --with-xwidgets
 --with-mailutils --with-imagemagick --without-dbus'

Attachment: 0001-Handle-anonymous-commands-in-C-h-K.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Re: bug#61505: [PATCH] Handle anonymous commands in C-h K Date: Wed, 10 Jan 2024 14:51:31 -0800
Version: 30.1

Eshel Yaron <me@eshelyaron.com> writes:

> Currently C-h K (Info-goto-emacs-key-command-node) throws an error when
> used on anonymous commands, for example:
>
> 1. emacs -Q
> 2. Evaluate this form:
>     (keymap-global-set "C-c m"
>                        (lambda ()
>                          (interactive)
>                          (message "foo")))
> 3. Type C-h K C-c m
> 4. Get this error:
>     Info-goto-emacs-command-node: Wrong type argument: symbolp, (closure (t) 
> nil (interactive) (message "foo"))
>
> This patch makes Info-goto-emacs-key-command-node detect and handle such
> cases by printing an informative message instead of calling
> Info-goto-emacs-command-node.

Thanks, makes sense to me, so I installed it on master (9eed00c8e5a).

I changed the message to be slightly more clear in a followup commit to
look like this:

    C-c m invokes an anonymous command defined with ‘lambda’

I also made it use `substitute-command-keys'.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]