From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#20718: 25.0.50; find-function fails on advised subrs (again) Date: Thu, 04 Jun 2015 11:55:32 -0400 Message-ID: References: <87wpzmnum6.fsf@web.de> <556F9753.7090807@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433435203 1277 80.91.229.3 (4 Jun 2015 16:26:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Jun 2015 16:26:43 +0000 (UTC) Cc: michael_heerdegen@web.de, 20718@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 04 18:26:31 2015 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 1Z0XxB-0007C8-8N for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jun 2015 18:25:13 +0200 Original-Received: from localhost ([::1]:43279 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0XxA-0005jr-MZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Jun 2015 12:25:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55225) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Xx5-0005fu-Ap for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2015 12:25:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0Xx1-00069R-AK for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2015 12:25:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58969) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Xx1-000699-5p for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2015 12:25:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z0Xx0-0002VN-Kh for bug-gnu-emacs@gnu.org; Thu, 04 Jun 2015 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Jun 2015 16:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20718 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20718-submit@debbugs.gnu.org id=B20718.14334350699580 (code B ref 20718); Thu, 04 Jun 2015 16:25:02 +0000 Original-Received: (at 20718) by debbugs.gnu.org; 4 Jun 2015 16:24:29 +0000 Original-Received: from localhost ([127.0.0.1]:40709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0XwS-0002UP-It for submit@debbugs.gnu.org; Thu, 04 Jun 2015 12:24:28 -0400 Original-Received: from mercure.iro.umontreal.ca ([132.204.24.67]:55185) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0XwP-0002U8-W3 for 20718@debbugs.gnu.org; Thu, 04 Jun 2015 12:24:26 -0400 Original-Received: from hidalgo.iro.umontreal.ca (hidalgo.iro.umontreal.ca [132.204.27.50]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 2F70A11C250; Thu, 4 Jun 2015 11:56:05 -0400 (EDT) Original-Received: from lechon.iro.umontreal.ca (lechon.iro.umontreal.ca [132.204.27.242]) by hidalgo.iro.umontreal.ca (Postfix) with ESMTP id CA8B11E5B8C; Thu, 4 Jun 2015 11:55:32 -0400 (EDT) Original-Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id AF339B416C; Thu, 4 Jun 2015 11:55:32 -0400 (EDT) In-Reply-To: <556F9753.7090807@yandex.ru> (Dmitry Gutov's message of "Thu, 4 Jun 2015 03:09:55 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-2.6, requis 5, autolearn=not spam, ALL_TRUSTED -2.82, MC_STOCKMS 0.22, MC_TSTLAST 0.00) X-DIRO-MailScanner-From: monnier@iro.umontreal.ca 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:103569 Archived-At: > Something like the patch below should fix it, but then the function > returns a # object, instead of function symbol, and several callers > seem to depend on the return value being the latter (because they want to > call symbol-function on it). Indeed, even its docstring says that it returns "the original function symbol", and that's basically meaningless in general (and in the nadvice case in particular). So the callers will need to be adjusted. Stefan > diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el > index 7ea13d4..75fdfc7 100644 > --- a/lisp/emacs-lisp/find-func.el > +++ b/lisp/emacs-lisp/find-func.el > @@ -192,9 +192,9 @@ defined in C.") > "Return the original function symbol of an advised function FUNC. > If FUNC is not the symbol of an advised function, just returns FUNC." > (or (and (symbolp func) > - (featurep 'advice) > - (let ((ofunc (cdr (assq 'origname (ad-get-advice-info func))))) > - (and (fboundp ofunc) ofunc))) > + (featurep 'nadvice) > + (let ((ofunc (advice--symbol-function func))) > + (and (advice--p ofunc) (advice--cd*r ofunc)))) > func)) > (defun find-function-C-source (fun-or-var file type)