unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Eshel Yaron <me@eshelyaron.com>
Cc: 61505-done@debbugs.gnu.org
Subject: bug#61505: [PATCH] Handle anonymous commands in C-h K
Date: Wed, 10 Jan 2024 14:51:31 -0800	[thread overview]
Message-ID: <CADwFkmmXoiTZ+HizRC+FAQWW7Y5e9i5O1HDs_fa_PTTYX7QxKA@mail.gmail.com> (raw)
In-Reply-To: <m1o7pwlmqz.fsf@esmac.lan> (Eshel Yaron's message of "Tue, 14 Feb 2023 09:39:00 +0200")

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'.





      reply	other threads:[~2024-01-10 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  7:39 bug#61505: [PATCH] Handle anonymous commands in C-h K Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-10 22:51 ` Stefan Kangas [this message]

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmmXoiTZ+HizRC+FAQWW7Y5e9i5O1HDs_fa_PTTYX7QxKA@mail.gmail.com \
    --to=stefankangas@gmail.com \
    --cc=61505-done@debbugs.gnu.org \
    --cc=me@eshelyaron.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).