unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: peder@klingenberg.no (Peder O. Klingenberg)
To: Zachary Kanfer <zkanfer@gmail.com>
Cc: 24221@debbugs.gnu.org
Subject: bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors
Date: Sun, 28 Aug 2016 22:07:57 +0200	[thread overview]
Message-ID: <m137losllu.fsf@klingenberg.no> (raw)
In-Reply-To: <CAFXT+RMk4=bCcHi2JHUJfQq+Awy3QpmixP7o2YQpFcBrFp9WAQ@mail.gmail.com> (Zachary Kanfer's message of "Sat, 13 Aug 2016 20:59:37 -0400")

Zachary Kanfer <zkanfer@gmail.com> writes:

> emacs -Q
>
> Evaluate this code:
>
> (global-set-key (kbd "C-c l") (lambda () (interactive) (insert "This
> messes up the help buffer somehow.")))
>
> Then open up a help buffer for that function:
>
> C-h k C-c l
>
> And a help buffer for something else:
>
> C-h k a
>
> Then, in the help buffer, go to the bottom, and try to select the
> "[back]" link. I get an error: "user-error: You didn’t specify a function
> symbol". If I try again, I get a different error: "apply: Symbol’s
> function definition is void: nil". These errors happen whether I've
> select the link with pressing Enter on the keyboard or by clicking the
> mouse.

I can confirm this.  Here's what I think is happening:

`describe-key' (C-h k) finds your lambda expression when it calls
`key-binding'.  It then pushes this lambda on the help-xref-stack as an
argument to `describe-function'.  But `describe-function' doesn't know
what to do with a lamda expression, and gives you that "You didn't
specify a function symbol" message when the xref stack is popped and
`describe-function' is called.

I don't know what the best fix would be - fix the xref setup in
`describe-key' or teach `describe-function' to do something useful with
a lambda expression.





  reply	other threads:[~2016-08-28 20:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-14  0:59 bug#24221: 25.1.50; binding anonymous functions to keys cause help buffer navigation errors Zachary Kanfer
2016-08-28 20:07 ` Peder O. Klingenberg [this message]
2016-08-28 21:56   ` Drew Adams
2016-09-16 17:43     ` Drew Adams
2016-09-17 18:28       ` Drew Adams
2016-10-03 23:33       ` npostavs
2016-10-22  2:48         ` npostavs

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=m137losllu.fsf@klingenberg.no \
    --to=peder@klingenberg.no \
    --cc=24221@debbugs.gnu.org \
    --cc=zkanfer@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 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).