From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: Can an :around advice know the name of the function it is advising? Date: Sun, 14 Feb 2016 19:47:48 +0100 Message-ID: <87h9hb2kob.fsf@mbork.pl> References: <874mdbra7r.fsf@mbork.pl> <87twlb9sn4.fsf@web.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1455475701 31639 80.91.229.3 (14 Feb 2016 18:48:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2016 18:48:21 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 14 19:48:14 2016 Return-path: Envelope-to: geh-help-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 1aV1iN-0004E2-PG for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 19:48:11 +0100 Original-Received: from localhost ([::1]:52833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV1iN-00026x-3B for geh-help-gnu-emacs@m.gmane.org; Sun, 14 Feb 2016 13:48:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50347) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV1iB-000269-6m for help-gnu-emacs@gnu.org; Sun, 14 Feb 2016 13:48:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV1i8-0003rB-1H for help-gnu-emacs@gnu.org; Sun, 14 Feb 2016 13:47:59 -0500 Original-Received: from mail.mojserwer.eu ([2a01:5e00:2:52::8]:59103) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV1i7-0003r3-Pk for help-gnu-emacs@gnu.org; Sun, 14 Feb 2016 13:47:55 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by mail.mojserwer.eu (Postfix) with ESMTP id 24F529D2002; Sun, 14 Feb 2016 19:47:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail.mojserwer.eu Original-Received: from mail.mojserwer.eu ([127.0.0.1]) by localhost (mail.mojserwer.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N5tcDnoUc7hb; Sun, 14 Feb 2016 19:47:49 +0100 (CET) Original-Received: from localhost (unknown [109.232.24.28]) by mail.mojserwer.eu (Postfix) with ESMTPSA id A23C69D2001; Sun, 14 Feb 2016 19:47:49 +0100 (CET) User-agent: mu4e 0.9.13; emacs 25.1.50.2 In-reply-to: <87twlb9sn4.fsf@web.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:5e00:2:52::8 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109168 Archived-At: On 2016-02-14, at 17:13, Michael Heerdegen wrote: > Marcin Borkowski writes: > >> I would like to be able for an :around advice to know not only the >> "original function" it is supposed to call, but also its /name/. (Yes, >> I now a function need not have /one/ name -- it may have more or less -- >> but assume that I added the advice to a command having one name in >> a usual manner.) Is it even possible? (I guess not, but I wanted to >> make sure.) > > If you know a name of the function you want to advice, you can make it > known to the piece of advice too, of course ;-) But no, there is no Yes, and as you have seen in my other message (thanks for the answer, I'll reply later) I went that route. > special mechanism for finding the name of the advised function from > within the advice code AFAIK - apart from looking at the > `backtrace-frame's or other brutal things. > > AFAICT the process of installing advises only touches functions, but > doesn't cause changes on the symbol level apart from the functions > fbound to them. Thanks. > Michael. Best, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University