GNU bug report logs -
#17007
24.3.50; describe-key/function evaluates documentation function in the wrong buffer
Previous Next
Reported by: joaotavora <at> gmail.com (João Távora)
Date: Thu, 13 Mar 2014 11:23:02 UTC
Severity: normal
Found in version 24.3.50
Done: Juanma Barranquero <lekktu <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 17007 <at> debbugs.gnu.org (full text, mbox):
martin rudalics <rudalics <at> gmx.at> writes:
> Sorry, I messed this up too often already. Hopefully, it's sufficient
> to add one `with-current-buffer' binding at some particular level.
> Could you please send me the calling sequence used by yasnippet, so I
> can identify the location where this is necessary?
It's simpler if I give you an emacs -Q recipe, right? In your *scratch*
buffer:
(defun foo ())
(defun foo-doc ()
(format "Foo does nothing, and by the way your tab does `%s'"
(key-binding "\t")))
(put 'foo 'function-documentation '(foo-doc))
(describe-function 'foo)
This fails on the latest Emacs, i.e. the last line returned by the last
form is
"Foo does nothing, and by the way your tab does `forward-button'"
Whereas it should report, as in Emacs 24.3
"Foo does nothing, and by the way your tab does `indent-for-tab-command'"
The trace of functions is the following:
1 -> (describe-function foo)
| 2 -> (describe-function-1 foo)
| | 3 -> (documentation foo t)
| | 3 <- documentation: "Foo does nothing, and by the way your tab does `forward-button'"
| 2 <- describe-function-1: nil
1 <- describe-function: "foo is a Lisp function.
But that doesn't show how the macro `with-temp-buffer-window', expanded
from `with-help-window', eventually wraps the latter's BODY in a
`with-current-buffer' call, making its forms be evaluated in the newly
created *Help* buffer, instead of *scratch*. One of those forms is the
call to `describe-function-1', which eventually calls `foo-doc'.
As I explained in my last email (which got sent from the wrong address
but is here
http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-03/msg00411.html)
it was the reversion of two lines in `with-temp-buffer-window' that
broke it.
But maybe it was fixing something else that I don't understand. Can you
help me understand what you were achieving with the original fix and the
reversion?
João
This bug report was last modified 11 years and 69 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.