From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu Newsgroups: gmane.emacs.devel Subject: Re: How to get advised function name form inside of the advice Date: Fri, 04 Mar 2016 17:56:21 +0100 Message-ID: <878u1y89my.fsf@gmail.com> References: <87lh5ytlfa.fsf@gmail.com> <87ziuemip7.fsf@mbork.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1457110611 10797 80.91.229.3 (4 Mar 2016 16:56:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Mar 2016 16:56:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: Marcin Borkowski Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Mar 04 17:56:46 2016 Return-path: Envelope-to: ged-emacs-devel@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 1abt1w-0004JM-RC for ged-emacs-devel@m.gmane.org; Fri, 04 Mar 2016 17:56:44 +0100 Original-Received: from localhost ([::1]:42376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abt1w-0007bS-BN for ged-emacs-devel@m.gmane.org; Fri, 04 Mar 2016 11:56:44 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abt1h-0007b2-Nz for emacs-devel@gnu.org; Fri, 04 Mar 2016 11:56:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abt1c-0000E6-4F for emacs-devel@gnu.org; Fri, 04 Mar 2016 11:56:29 -0500 Original-Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:34346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abt1b-0000E2-PF for emacs-devel@gnu.org; Fri, 04 Mar 2016 11:56:24 -0500 Original-Received: by mail-wm0-x236.google.com with SMTP id p65so28316259wmp.1 for ; Fri, 04 Mar 2016 08:56:23 -0800 (PST) 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; bh=Vaqzh0IvngMXv8Ag05kUHceUSpgNaEHpmggcAi1gqy4=; b=S8VW7sdIUg5AwdYSIT3hNEyy0/CMegWju/8vJr16LHqne18Rjre2oyi8zeynyYPSWF g5Dp0mAzr9QyC6RYJg2h9lvV5fFCAdHm7TeUhiAArTZhEmCj/j8h4fxw/g+2AnxnA1fc h9aQb0jVIy0Ax20s9pDUf229fudaj7DjOpKgnEkGWeeA/dejfGDL2q7IBliFNTUtECam rqVbuHM8uCMEOewFBkNNTyJzqC5gjrvpCczz+FzmN9KqerACJL/VPRUkmrEZ0NjSCglH 1BY9JaeIVgnjlpBBCgbOCemFjjAVQxzdtgkcx/v794nhlrEWhuALVKzD91XI3zuxbbvg GAJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=Vaqzh0IvngMXv8Ag05kUHceUSpgNaEHpmggcAi1gqy4=; b=LP1uV8mAoaKOJ/xQqWRDWSdd1nrtRhlEdptRGniK9mJsgtCGkpfMy3NRUJHv30CBvR LS1Hne/xShudzcEejxT6nOO0AmYsVqKu30LxC5cXsWpRWFMTWJIyDkkEGfZhTN2llJh/ 7EjuI4nKRpmu36f1PlK7FbR0BpjvJjeFZwqaCZuaY/481JhOD8b5RPWYJG257y/9o4xN uv4OkTTow5o6IO/n+nBt/5Rce/yUhsgbqXa12SYBq4i3ac880lMlr+UgZTuqvbR9CQA+ 9lTEx3aQZh11kKQB7s3wkge3sYiLaSG8m6Kwmb6RCP5zYA24JQEjuRzPFmgzCOVv9tvC 22hw== X-Gm-Message-State: AD7BkJKCgJQ0pEahiN0aW+IjcLqOFn7nTdk7JDIjPfmjEBVRyUc/SKyDgVnYtvkTxltAkA== X-Received: by 10.28.227.134 with SMTP id a128mr6607685wmh.67.1457110582716; Fri, 04 Mar 2016 08:56:22 -0800 (PST) Original-Received: from localhost ([143.176.214.220]) by smtp.gmail.com with ESMTPSA id m6sm4209195wje.21.2016.03.04.08.56.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Mar 2016 08:56:21 -0800 (PST) In-Reply-To: <87ziuemip7.fsf@mbork.pl> (Marcin Borkowski's message of "Fri, 04 Mar 2016 15:16:52 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:200916 Archived-At: >> On Fri, Mar 04 2016 15:16, Marcin Borkowski wrote: > On 2016-03-04, at 14:36, Vitalie Spinu wrote: >> Hi, >> >> How to retrieve the name of the original function from the inside of "new" >> advice? I need to condition-case a function and show a meaningful error message >> with function name instead of an error. > It seems that you can't do that (and for good reasons). See here: > https://lists.gnu.org/archive/html/help-gnu-emacs/2016-02/msg00218.html Hm, I thought so. Thanks. What are those good reasons though? I don't see any reasons given in that thread. I think my use case is a good reason to have such a feature. Otherwise one would need a macro to define separate advice function per advice or pass a closure as an advice. Both ways are overkill for such a basic requirement. Vitalie