GNU bug report logs -
#24221
25.1.50; binding anonymous functions to keys cause help buffer navigation errors
Previous Next
Reported by: Zachary Kanfer <zkanfer <at> gmail.com>
Date: Sun, 14 Aug 2016 01:01:01 UTC
Severity: normal
Tags: fixed, patch
Found in version 25.1.50
Fixed in version 25.2
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Zachary Kanfer <zkanfer <at> 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.
This bug report was last modified 8 years and 270 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.