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
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
On Sun, Mar 16, 2014 at 10:02 AM, martin rudalics <rudalics <at> gmx.at> wrote:
> > The 24.3 version of with-help-window used with-output-to-temp-buffer
> > AFAICT.
>
> `with-temp-buffer-window' code some checking? After all, you were the
> one who detected the inconsistency that was the root of all evil here
> and I trust that you could detect any remaining inconsistencies as well.
>
> Thanks, martin
>
Thanks, will do, as soon as I have time to make a new build.
I wonder if one could write unit tests for these scenarios...
Just a thought, not thoroughly tested, and could be brittle:
(ert-deftest help-window-describe-function-in-correct-buffer
()
"Check if `function-documentation' is eval'ed in right
buffer."
(defun help-foo ())
(defun help-foo-doc ()
(format "Does nothing, but your tab does `%s'"
(key-binding "\t")))
(put 'help-foo 'function-documentation '(foo-doc))
(let* ((selected-window-before (selected-window))
(text (describe-function 'help-foo))
(help-windows (get-buffer-window-list "*Help*")))
(unwind-protect
(progn
(should (eq selected-window-before (selected-window)))
(should (= 1 (length help-windows)))
(with-selected-window
(car help-windows)
(should-error (search-forward "forward-button"))))
(delete-other-windows))))
[Message part 2 (text/html, inline)]
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.