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#17007: 24.3.50; describe-key/function evaluates documentation function in the wrong buffer Date: Fri, 14 Mar 2014 15:34:37 +0100 Message-ID: <5323137D.2020103@gmx.at> References: <5322E8C0.5020106@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1394807714 11256 80.91.229.3 (14 Mar 2014 14:35:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Mar 2014 14:35:14 +0000 (UTC) Cc: 17007@debbugs.gnu.org To: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 14 15:35:22 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 1WOTCj-0004pt-87 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Mar 2014 15:35:21 +0100 Original-Received: from localhost ([::1]:45061 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOTCi-0005dw-G2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Mar 2014 10:35:20 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48050) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOTCY-0005ZR-RO for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 10:35:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOTCQ-0005Gw-Kh for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 10:35:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35747) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOTCQ-0005GB-Dn for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 10:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WOTCP-0002gR-RK for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 10:35:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Mar 2014 14:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17007 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17007-submit@debbugs.gnu.org id=B17007.139480768510282 (code B ref 17007); Fri, 14 Mar 2014 14:35:01 +0000 Original-Received: (at 17007) by debbugs.gnu.org; 14 Mar 2014 14:34:45 +0000 Original-Received: from localhost ([127.0.0.1]:36929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WOTC7-0002fk-TG for submit@debbugs.gnu.org; Fri, 14 Mar 2014 10:34:44 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:61869) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WOTC5-0002fV-BF for 17007@debbugs.gnu.org; Fri, 14 Mar 2014 10:34:42 -0400 Original-Received: from [188.22.110.178] ([188.22.110.178]) by mail.gmx.com (mrgmx103) with ESMTPSA (Nemesis) id 0M3i8r-1XFCGs3SID-00rGK5; Fri, 14 Mar 2014 15:34:40 +0100 In-Reply-To: X-Provags-ID: V03:K0:7W99vvORJ2o2K2Cb/CzCxjj3zayjv6YI033nh4l7SErBxfSPMKK pPDUnQvF6AgPdoHvgXhYKMitGfvdicqdG/lAT9jzDg/OxHXOClkWlDLokdDb6+6l2OgYPtn bMLU70bXR23HtKKwm4KC0dSsjOKjtjIA5FUtGj55G83MZ7Nj+zIPNeBz1uz9yxPQ/1H1sP4 d89r6fl6WmJfFyBzKNNLQ== 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:86858 Archived-At: > 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'" Confirmed. > 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*. Indeed. > 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. Not really. The current version of `with-temp-buffer-window' and that released with Emacs 24.3 are the same. It changed only intermittently and that's what you noticed. Or can you spot a difference now? > 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? I first reacted to a bug report by Nicolas Richard http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16816 and tried to make it behave as in the doc-string. Unfortunately, this broke things as subsequently remarked by Juanma in the same thread and also broke code Thierry wrote as reported in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16882 so I decided to restore the 24.3 behavior. I'm still not fine with that but it's now some time since 24.3 is out and I'm a bit reluctant to change it back again, mostly so because I don't know how many bugs such a change might produce and how soon they'd get detected. And I'm still too silly to understand how this (apparently?) worked with 24.3 and why it's broken now. Any ideas? martin