From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#16816: 24.3.50; erroneous docstring in with-temp-buffer-window Date: Thu, 27 Feb 2014 19:44:55 +0100 Message-ID: <530F87A7.1080009@gmx.at> References: <87sire4wqw.fsf@yahoo.fr> <53074FDB.4040907@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1393526782 15898 80.91.229.3 (27 Feb 2014 18:46:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 27 Feb 2014 18:46:22 +0000 (UTC) Cc: Nicolas Richard , 16816@debbugs.gnu.org To: Juanma Barranquero Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 27 19:46:25 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WJ5yQ-0002Gg-9W for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Feb 2014 19:46:22 +0100 Original-Received: from localhost ([::1]:47436 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJ5yP-00012h-VA for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Feb 2014 13:46:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJ5yE-0000tE-Uq for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2014 13:46:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WJ5y6-00058R-I2 for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2014 13:46:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:41814) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WJ5y6-00058L-Ek for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2014 13:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WJ5y6-00088J-1v for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2014 13:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 27 Feb 2014 18:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 16816 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 16816-submit@debbugs.gnu.org id=B16816.139352671331191 (code B ref 16816); Thu, 27 Feb 2014 18:46:01 +0000 Original-Received: (at 16816) by debbugs.gnu.org; 27 Feb 2014 18:45:13 +0000 Original-Received: from localhost ([127.0.0.1]:42996 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WJ5xI-000871-PE for submit@debbugs.gnu.org; Thu, 27 Feb 2014 13:45:13 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:52203) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WJ5xG-00086r-8V for 16816@debbugs.gnu.org; Thu, 27 Feb 2014 13:45:10 -0500 Original-Received: from [62.47.47.134] ([62.47.47.134]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0LoaCE-1WtpPc2fne-00gZ3V; Thu, 27 Feb 2014 19:45:06 +0100 In-Reply-To: X-Provags-ID: V03:K0:PhWAXXrZ4xWSXCQiJn9WtxGgb80XJ7x9Vw+AWAv/iSuVn0rnx8a 93udYXfm1vpsuDqItGwfQb8fCCjaTmDmbnnkN7EiDS1omAXp+uDpqvFH+hBFCmZLaVUvA61 guyWcaBH33PF8pkUDiwErVkqigvrUMWhMl/QUW01xNZ/9eEmen8VUALrcNIiyGoCi+0lEBU aK/PBfF70dAkK80m9N+BQ== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:86315 Archived-At: > 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