GNU bug report logs -
#16816
24.3.50; erroneous docstring in with-temp-buffer-window
Previous Next
Full log
View this message in rfc822 format
> This breaks with-help-window. Try
>
> emacs -Q
> C-x C-h
>
> the help output is inserted in the current buffer (*scratch*, in this case).
Yes. A lousy bug. I introduced it last year relying on the misfeature
that `with-temp-buffer-window' makes the help buffer current. Does the
following patch fix it?
=== modified file 'lisp/help.el'
--- lisp/help.el 2014-02-10 01:34:22 +0000
+++ lisp/help.el 2014-02-27 18:31:30 +0000
@@ -498,7 +498,8 @@
then we display only bindings that start with that prefix."
(let ((buf (current-buffer)))
(with-help-window (help-buffer)
- (describe-buffer-bindings buf prefix menus))))
+ (with-current-buffer (help-buffer)
+ (describe-buffer-bindings buf prefix menus)))))
(defun where-is (definition &optional insert)
"Print message listing key sequences that invoke the command DEFINITION.
> This patch fixes it.
>
> === modified file 'lisp/help.el'
> --- lisp/help.el 2014-02-10 01:34:22 +0000
> +++ lisp/help.el 2014-02-27 15:29:05 +0000
> @@ -1207,7 +1207,8 @@
> (temp-buffer-window-show-hook
> (cons 'help-mode-finish temp-buffer-window-show-hook)))
> (with-temp-buffer-window
> - ,buffer-name nil 'help-window-setup (progn ,@body)))))
> + ,buffer-name nil 'help-window-setup
> + (with-current-buffer ,buffer-name ,@body)))))
>
> ;; Called from C, on encountering `help-char' when reading a char.
> ;; Don't print to *Help*; that would clobber Help history.
>
This would restore what we had till now: BODY would get evaluated in the
help buffer and not in the original buffer. I doubt this could have any
serious consequences (Emacs 24.3 runs this already for quite some time)
but it's inherently disturbing.
martin
This bug report was last modified 11 years and 67 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.