From unknown Thu Jun 19 14:05:59 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#20718 <20718@debbugs.gnu.org> To: bug#20718 <20718@debbugs.gnu.org> Subject: Status: 25.0.50; find-function fails on advised subrs (again) Reply-To: bug#20718 <20718@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:05:59 +0000 retitle 20718 25.0.50; find-function fails on advised subrs (again) reassign 20718 emacs submitter 20718 michael_heerdegen@web.de severity 20718 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 08:49:40 2015 Received: (at submit) by debbugs.gnu.org; 2 Jun 2015 12:49:40 +0000 Received: from localhost ([127.0.0.1]:36969 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzldU-0006qZ-IH for submit@debbugs.gnu.org; Tue, 02 Jun 2015 08:49:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:50599) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YzldS-0006qM-2R for submit@debbugs.gnu.org; Tue, 02 Jun 2015 08:49:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzldL-0005Fa-RU for submit@debbugs.gnu.org; Tue, 02 Jun 2015 08:49:32 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:56070) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzldL-0005FS-Oz for submit@debbugs.gnu.org; Tue, 02 Jun 2015 08:49:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzldK-0001HJ-UV for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 08:49:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzldE-0005ET-VC for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 08:49:30 -0400 Received: from mout.web.de ([212.227.15.14]:50410) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzldE-0005EC-Ln for bug-gnu-emacs@gnu.org; Tue, 02 Jun 2015 08:49:24 -0400 Received: from drachen.dragon ([178.10.202.12]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0Lkm1c-1ZXiwJ1geq-00aSo3 for ; Tue, 02 Jun 2015 14:49:23 +0200 From: Michael Heerdegen To: bug-gnu-emacs@gnu.org Subject: 25.0.50; find-function fails on advised subrs (again) Date: Tue, 02 Jun 2015 14:49:05 +0200 Message-ID: <87wpzmnum6.fsf@web.de> MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K0:Dr9R4LRSv6jObhWPifhPC3LzwWE4D5Nb8LC/VGKHtI17CZXEBzl 0tXzzVUdAAhMR8qcUIDmdtlVgFRjFp+aiRDnuXPHHbKKizX9FXrQJ8zCnAHFqFsPwgARucK 2DSfn+ZOzTTTHV33zgOkGe0ZSeQLyXsZosCPq+RwOtAnme8GvmFbB/3TFS1IRrIhkb0QLgY ZTv3kbWN/ePUGx8MvuDWg== X-UI-Out-Filterresults: notjunk:1;V01:K0:2dDHcjDIJ6w=:k9LPATk0V1rmZF0u7+j4il PDhGiK4OaZp3eSI2sfRjFAUKod9tJlS5s9AsAT1yi1ZHjNtU5pYyOUP8cCEBIP8SSVPw1XHO6 6mpHVX6QetUpMUWs5T/gEEXqNY93/9bqzUX+G90H8A20+1e0LdL8JkQ0kxCoe/mHpMrFmDBpU wUUBe98FbbfrBUd1jJ/YDiz1V/p1W394BbkEGfEUMrarYhItLjs4vW341kFcWwl1CORlmFDhd dtY9VVUdIV3SHFkUmYTiTgkc/eWUAxhV+68nNpWHkyzmOAg85GZGVPzq56AJ4BKr9V0MY5BcE +X0/yI9150th6ONUhQYfm9DmS3v0tvS8OlMv4E7i6FO65PyCvmr9EmcDxp8P5BYnB++EYbHEM y8suNfmIgzDEBFCrCthLvV16mSsqUG7b0dFrGubGUQ0WCOBK536wZHKRIkte5MfTO66b0oApi IkRzXB6AIs9Q8taNGBgW+pacOMAQbIEHeuNrpGEvtFaslaYF8JE9H2bAJOI8Wm/s8eHnKwinP xpBepVS3gC1p2G/q8O34OPzb+4fqh7heVQdIcHnhq4obGiutkgxiRqvWl7bQZhzstqaUUGoUX g3x3tCOB0eOW9/W9tFPxJF3xolQWDHRpbc9R0Z3Z5YV0jYulnGWEocWHcASJ0zeMqMHcBeW7d jCz5LcqukTg2N0++48Bn4IHEtD5vAp3pUr0NmksahgRjYx8qD32lgA1X4/ZzPLUHeCl8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: michael_heerdegen@web.de List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) Hello, just as a random example: (advice-add 'handle-switch-frame :after #'prin1) and M-x find-function 'handle-switch-frame RET ==> find-function-search-for-symbol: Don't know where `handle-switch-frame' is defined Works without advicing. I included the word "again" in the subject because this had been fixed once in #789 in 2008. It doesn't work because `find-function-library' performs the subrp test just on the symbol function of the given function name, which is the advice, not the original subr. Thanks, Michael. In GNU Emacs 25.0.50.4 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5) of 2015-05-30 on drachen Windowing system distributor `The X.Org Foundation', version 11.0.11701000 System Description: Debian GNU/Linux testing (stretch) From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 02 11:29:19 2015 Received: (at control) by debbugs.gnu.org; 2 Jun 2015 15:29:19 +0000 Received: from localhost ([127.0.0.1]:37732 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yzo7z-0002Q8-Ah for submit@debbugs.gnu.org; Tue, 02 Jun 2015 11:29:19 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:42517 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yzo7x-0002Px-7P for control@debbugs.gnu.org; Tue, 02 Jun 2015 11:29:17 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1Yzo7w-0007vO-IC for control@debbugs.gnu.org; Tue, 02 Jun 2015 11:29:16 -0400 Date: Tue, 02 Jun 2015 11:29:16 -0400 Message-Id: Subject: control message for bug 19759 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) block 19759 by 20718 From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 03 20:10:10 2015 Received: (at 20718) by debbugs.gnu.org; 4 Jun 2015 00:10:10 +0000 Received: from localhost ([127.0.0.1]:39592 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0IjY-0001Ki-2t for submit@debbugs.gnu.org; Wed, 03 Jun 2015 20:10:09 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:33548) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0IjT-0001K8-KA for 20718@debbugs.gnu.org; Wed, 03 Jun 2015 20:10:05 -0400 Received: by wiwd19 with SMTP id d19so4481969wiw.0 for <20718@debbugs.gnu.org>; Wed, 03 Jun 2015 17:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=zEFCQP/webL+k3HbFiVdSmD56/zrpsAPD6JLpWcdpBE=; b=RH2/oIxCRGZUxPe/PIsALz8l9I4D5uTfXZLUjwC08Me6GoYNsfuhKE4PU95VD17awh Au9EIGwDIadcmsx3ZNCqA+usNiadQINIsvtaRdv+3Emy0yahLqkBX2Xa5jBUEQoUAKJr Rm8nzUC2ZfmBv9M1/SCBMdqALFtQ7g2ZtoxIXJB3S1gUZV5jVzd6BP3EU6YvSnff8Uj7 sBNyKDhU12SreMy5M4iyHKy79nHAOy2vOxji5AtCWkFdV0xJugQwzDe8VcgbmuDricI7 LZ9HgFtUOFT4ArSTQ6NcXi8/F6mR/fjQ/sRNtzhxcZSoOtTICw6QEujT+tVfCpIQgT+x 3zNQ== X-Received: by 10.194.88.38 with SMTP id bd6mr11055315wjb.153.1433376597995; Wed, 03 Jun 2015 17:09:57 -0700 (PDT) Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id m10sm3820333wib.17.2015.06.03.17.09.57 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jun 2015 17:09:57 -0700 (PDT) Subject: Re: bug#20718: 25.0.50; find-function fails on advised subrs (again) To: michael_heerdegen@web.de, 20718@debbugs.gnu.org References: <87wpzmnum6.fsf@web.de> From: Dmitry Gutov Message-ID: <556F9753.7090807@yandex.ru> Date: Thu, 4 Jun 2015 03:09:55 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: <87wpzmnum6.fsf@web.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20718 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 06/02/2015 03:49 PM, Michael Heerdegen wrote: > It doesn't work because `find-function-library' performs the subrp test > just on the symbol function of the given function name, which is the > advice, not the original subr. At a glance, the problem is in find-function-advised-original: it only supports the old-style advice, and returns nil for 'handle-switch-frame augmented with advice-add. 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). 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) From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 04 12:24:29 2015 Received: (at 20718) by debbugs.gnu.org; 4 Jun 2015 16:24:29 +0000 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 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 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) 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) Received: by lechon.iro.umontreal.ca (Postfix, from userid 20848) id AF339B416C; Thu, 4 Jun 2015 11:55:32 -0400 (EDT) From: Stefan Monnier To: Dmitry Gutov Subject: Re: bug#20718: 25.0.50; find-function fails on advised subrs (again) Message-ID: References: <87wpzmnum6.fsf@web.de> <556F9753.7090807@yandex.ru> Date: Thu, 04 Jun 2015 11:55:32 -0400 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) MIME-Version: 1.0 Content-Type: text/plain 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-Spam-Status: No X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20718 Cc: michael_heerdegen@web.de, 20718@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) > 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) From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 04 18:37:02 2015 Received: (at 20718-done) by debbugs.gnu.org; 4 Jun 2015 22:37:02 +0000 Received: from localhost ([127.0.0.1]:40906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0dkz-0005sj-Pg for submit@debbugs.gnu.org; Thu, 04 Jun 2015 18:37:01 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:33775) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0dky-0005sV-17 for 20718-done@debbugs.gnu.org; Thu, 04 Jun 2015 18:37:00 -0400 Received: by wiwd19 with SMTP id d19so3514709wiw.0 for <20718-done@debbugs.gnu.org>; Thu, 04 Jun 2015 15:36:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=PMo4nqBooMqWh+cNXH58AMoX7CXljFcpRIGDS+0ha+E=; b=KNM8ty+efi2N79E48bn5ZeE3mZsVwLVT9pGddrY9E5zOOhRSsfV+iXyLO8Dxhq+uOc SdtO2zY4tpHVRiDxxk4gfs9uHp+WfENHq6dyr0DQQBgttVlfl5MU4d0v0wKHa1JEpy0m /D+x18olbYGBqNwD0oqOYsT243Rgn1sbq/C1ni5YntLMXwg75kQFDzm3Ak0AQu6NOLgl 86FmlYA9oCQk9E9GnZyV2nvKqoijT0eeRbGBL4gUY5QzrpiSuM8/svf0zKecwYaJV/Z7 WenojUKcMO1MGndyPoG2sNNN1OtmzHiOu5OhxWAhpWGYK/swxiRZRcvMTBAqbCQMz9uS FO1A== X-Received: by 10.194.61.180 with SMTP id q20mr545854wjr.80.1433457414441; Thu, 04 Jun 2015 15:36:54 -0700 (PDT) Received: from [192.168.1.2] ([82.102.93.54]) by mx.google.com with ESMTPSA id fs9sm7720736wjc.34.2015.06.04.15.36.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jun 2015 15:36:54 -0700 (PDT) Subject: Re: bug#20718: 25.0.50; find-function fails on advised subrs (again) To: Stefan Monnier References: <87wpzmnum6.fsf@web.de> <556F9753.7090807@yandex.ru> From: Dmitry Gutov Message-ID: <5570D304.8020103@yandex.ru> Date: Fri, 5 Jun 2015 01:36:52 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 20718-done Cc: michael_heerdegen@web.de, 20718-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Version: 25.1 On 06/04/2015 06:55 PM, Stefan Monnier wrote: > So the callers will need to be adjusted. Ok, done. I seems to work now. From unknown Thu Jun 19 14:05:59 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 03 Jul 2015 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator