GNU bug report logs - #61505
[PATCH] Handle anonymous commands in C-h K

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Tue, 14 Feb 2023 07:40:02 UTC

Severity: wishlist

Tags: patch

Fixed in version 30.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #12 received at 61505-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eshel Yaron <me <at> eshelyaron.com>
Cc: 61505-done <at> debbugs.gnu.org
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 <at> 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'.




This bug report was last modified 1 year and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.