[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#24221: 25.1.50; binding anonymous functions to keys cause help buffe
From: |
Peder O. Klingenberg |
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 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (darwin) |
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.