unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: Nicolas Richard <theonewiththeevillook@yahoo.fr>, 16816@debbugs.gnu.org
Subject: bug#16816: 24.3.50; erroneous docstring in with-temp-buffer-window
Date: Thu, 27 Feb 2014 19:44:55 +0100	[thread overview]
Message-ID: <530F87A7.1080009@gmx.at> (raw)
In-Reply-To: <CAAeL0SQL7X6dfvDKr+GCYm32WUJvm82ZwoZ8gtMAkbm_L9NTWQ@mail.gmail.com>

 > 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





  reply	other threads:[~2014-02-27 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 21:29 bug#16816: 24.3.50; erroneous docstring in with-temp-buffer-window Nicolas Richard
2014-02-21 13:08 ` martin rudalics
2014-02-27 15:32   ` Juanma Barranquero
2014-02-27 18:44     ` martin rudalics [this message]
2014-02-27 18:55       ` Juanma Barranquero
2014-02-27 20:00         ` martin rudalics
2014-02-27 21:04           ` Drew Adams
2014-02-28 10:58         ` martin rudalics
2014-03-16 10:00     ` martin rudalics
2014-03-22  5:19       ` Juanma Barranquero
2014-02-28 10:59 ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530F87A7.1080009@gmx.at \
    --to=rudalics@gmx.at \
    --cc=16816@debbugs.gnu.org \
    --cc=lekktu@gmail.com \
    --cc=theonewiththeevillook@yahoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).