From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) 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 12:08:08 +0000 Message-ID: References: <5322E8C0.5020106@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1394798949 30598 80.91.229.3 (14 Mar 2014 12:09:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Mar 2014 12:09:09 +0000 (UTC) Cc: 17007@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 14 13:09:18 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 1WOQvN-0003Db-RG for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Mar 2014 13:09:18 +0100 Original-Received: from localhost ([::1]:44311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOQvN-0000Fd-7t for geb-bug-gnu-emacs@m.gmane.org; Fri, 14 Mar 2014 08:09:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48250) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOQvD-00006X-Ti for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 08:09:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WOQv8-0001au-PS for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 08:09:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WOQv8-0001ah-KH for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 08:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WOQv7-0006gt-Ta for bug-gnu-emacs@gnu.org; Fri, 14 Mar 2014 08:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: joaotavora@gmail.com (=?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?=) Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 14 Mar 2014 12:09: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.139479889925659 (code B ref 17007); Fri, 14 Mar 2014 12:09:01 +0000 Original-Received: (at 17007) by debbugs.gnu.org; 14 Mar 2014 12:08:19 +0000 Original-Received: from localhost ([127.0.0.1]:36528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WOQuR-0006fn-3U for submit@debbugs.gnu.org; Fri, 14 Mar 2014 08:08:19 -0400 Original-Received: from mail-we0-f180.google.com ([74.125.82.180]:34102) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WOQuP-0006fe-6T for 17007@debbugs.gnu.org; Fri, 14 Mar 2014 08:08:18 -0400 Original-Received: by mail-we0-f180.google.com with SMTP id p61so1996904wes.25 for <17007@debbugs.gnu.org>; Fri, 14 Mar 2014 05:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=Zd3MBfSQ1383bvYWh24VLcBldK+uS4zaJvBssFhzIWU=; b=IXzvZLOXS6+0hYCaWaxkLpaPXqjS2svHRcd0TkRsk93f0JKEy3s75SxDshVqyKsPEB J2Frc8heADaDrLtpTzrZPHCAQdJG0U/Wh79jrT5TvTJIBL6v62A6C3XsbMK+YkbphUqf XoedO6ivcJ6SoeUSpuJiGu7Y7kGu1ENdzFAb2i60WNni8KGjndhHd3a8AfEk921j7KjO TMIqwKJzdTjz/gj8aJ25B2uvJilM16IklSpGuNtGarIJN0YVUXR107mbVhRUobzYf1qt Eok/bC33LM4hHvcHprQ/w/BoGgJjtp7KZV9QsW89nitOtbhfd1OTXz5CM3yhQH6MDjBn Er3Q== X-Received: by 10.194.48.100 with SMTP id k4mr1810045wjn.49.1394798895885; Fri, 14 Mar 2014 05:08:15 -0700 (PDT) Original-Received: from BELMONTE.yourcompany.com (a81-84-241-129.static.cpe.netcabo.pt. [81.84.241.129]) by mx.google.com with ESMTPSA id v6sm16350400wif.0.2014.03.14.05.08.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Mar 2014 05:08:15 -0700 (PDT) In-Reply-To: <5322E8C0.5020106@gmx.at> (martin rudalics's message of "Fri, 14 Mar 2014 12:32:16 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) 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:86850 Archived-At: martin rudalics writes: > Sorry, I messed this up too often already. Hopefully, it's sufficient > to add one `with-current-buffer' binding at some particular level. > Could you please send me the calling sequence used by yasnippet, so I > can identify the location where this is necessary? 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= '" 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 `fo= rward-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*. 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. 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? =20=20=20=20 Jo=E3o =20=20=20=20