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#18399: 24.4.50; nadvice :filter-args -vs- interactive Date: Thu, 04 Sep 2014 11:44:29 -0400 Message-ID: References: <87mwagbhim.fsf@tromey.com> <87zjegh1wj.fsf@web.de> <87iol4baqs.fsf@tromey.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; CHARSET=US-ASCII Content-Transfer-Encoding: 7BIT X-Trace: ger.gmane.org 1409847081 24235 80.91.229.3 (4 Sep 2014 16:11:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Sep 2014 16:11:21 +0000 (UTC) Cc: Michael Heerdegen , 18399-done@debbugs.gnu.org To: Tom Tromey Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 04 18:11:13 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 1XPZcp-0000Ke-7d for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Sep 2014 18:11:07 +0200 Original-Received: from localhost ([::1]:52375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPZco-0005HY-PX for geb-bug-gnu-emacs@m.gmane.org; Thu, 04 Sep 2014 12:11:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPZcc-0005Bm-4O for bug-gnu-emacs@gnu.org; Thu, 04 Sep 2014 12:11:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XPZcU-0005Fo-U1 for bug-gnu-emacs@gnu.org; Thu, 04 Sep 2014 12:10:54 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XPZcU-0005Fi-EV for bug-gnu-emacs@gnu.org; Thu, 04 Sep 2014 12:10:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XPZDa-0003FM-Pr for bug-gnu-emacs@gnu.org; Thu, 04 Sep 2014 11:45:02 -0400 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Thu, 04 Sep 2014 15:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 18399 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: notabug Mail-Followup-To: 18399@debbugs.gnu.org, monnier@iro.umontreal.ca, tom@tromey.com Original-Received: via spool by 18399-done@debbugs.gnu.org id=D18399.140984547912422 (code D ref 18399); Thu, 04 Sep 2014 15:45:02 +0000 Original-Received: (at 18399-done) by debbugs.gnu.org; 4 Sep 2014 15:44:39 +0000 Original-Received: from localhost ([127.0.0.1]:58931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPZDC-0003EH-HW for submit@debbugs.gnu.org; Thu, 04 Sep 2014 11:44:38 -0400 Original-Received: from relais.videotron.ca ([24.201.245.36]:51778) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPZDA-0003E5-BD for 18399-done@debbugs.gnu.org; Thu, 04 Sep 2014 11:44:37 -0400 Original-Received: from ceviche.home ([24.201.170.218]) by VL-VM-MR007.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0NBD0030OVQ6QT00@VL-VM-MR007.ip.videotron.ca> for 18399-done@debbugs.gnu.org; Thu, 04 Sep 2014 11:44:30 -0400 (EDT) Original-Received: by ceviche.home (Postfix, from userid 20848) id 28C79660C4; Thu, 04 Sep 2014 11:44:29 -0400 (EDT) In-reply-to: <87iol4baqs.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) 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:93027 Archived-At: > I looked at the docs again and I agree. Sorry about the noise. Perhaps > a note and/or a small example here would be nice for future users. If > we were both fooled by this then perhaps others will be as well. I installed the patch below, which I hope will help clear up such confusion. Stefan === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2014-08-19 18:56:29 +0000 +++ doc/lispref/ChangeLog 2014-09-04 15:42:28 +0000 @@ -1,3 +1,8 @@ +2014-09-04 Stefan Monnier + + * functions.texi (Core Advising Primitives): Add a note about the + confusing treatment of `interactive' for :filter-args (bug#18399). + 2014-08-19 Eli Zaretskii * display.texi (Bidirectional Display): Update the Emacs's class === modified file 'doc/lispref/functions.texi' --- doc/lispref/functions.texi 2014-05-27 01:09:45 +0000 +++ doc/lispref/functions.texi 2014-09-04 15:40:13 +0000 @@ -1220,15 +1220,6 @@ This macro is the handy way to add the advice @var{function} to the function stored in @var{place} (@pxref{Generalized Variables}). -If @var{function} is not interactive, then the combined function will inherit -the interactive spec, if any, of the original function. Else, the combined -function will be interactive and will use the interactive spec of -@var{function}. One exception: if the interactive spec of @var{function} -is a function (rather than an expression or a string), then the interactive -spec of the combined function will be a call to that function with as sole -argument the interactive spec of the original function. To interpret the spec -received as argument, use @code{advice-eval-interactive-spec}. - @var{where} determines how @var{function} is composed with the existing function, e.g. whether @var{function} should be called before, or after the original function. @xref{Advice combinators}, for the list of @@ -1271,6 +1262,21 @@ @code{:override} advice will override not only the original function but all other advices applied to it as well. @end table + +If @var{function} is not interactive, then the combined function will inherit +the interactive spec, if any, of the original function. Else, the combined +function will be interactive and will use the interactive spec of +@var{function}. One exception: if the interactive spec of @var{function} +is a function (rather than an expression or a string), then the interactive +spec of the combined function will be a call to that function with as sole +argument the interactive spec of the original function. To interpret the spec +received as argument, use @code{advice-eval-interactive-spec}. + +Note: The interactive spec of @var{function} will apply to the combined +function and should hence obey the calling convention of the combined function +rather than that of @var{function}. In many cases, it makes no difference +since they are identical, but it does matter for @code{:around}, +@code{:filter-args}, and @code{filter-return}, where @var{function}. @end defmac @defmac remove-function place function