unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Tom Tromey <tom@tromey.com>
Cc: Michael Heerdegen <michael_heerdegen@web.de>, 18399-done@debbugs.gnu.org
Subject: bug#18399: 24.4.50; nadvice :filter-args -vs- interactive
Date: Thu, 04 Sep 2014 11:44:29 -0400	[thread overview]
Message-ID: <jwvtx4npf1m.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <87iol4baqs.fsf@tromey.com>

> 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  <monnier@iro.umontreal.ca>
+
+	* functions.texi (Core Advising Primitives): Add a note about the
+	confusing treatment of `interactive' for :filter-args (bug#18399).
+
 2014-08-19  Eli Zaretskii  <eliz@gnu.org>
 
 	* 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






  parent reply	other threads:[~2014-09-04 15:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 20:01 bug#18399: 24.4.50; nadvice :filter-args -vs- interactive Tom Tromey
2014-09-03 20:42 ` Michael Heerdegen
2014-09-03 22:27   ` Tom Tromey
2014-09-04  2:59     ` Stefan Monnier
2014-09-04 13:13       ` Stefan Monnier
2014-09-04 15:44     ` Stefan Monnier [this message]
2014-09-04 23:11       ` Michael Heerdegen
2014-09-05  1:24         ` Stefan Monnier
2014-09-05 16:29           ` Michael Heerdegen
2014-09-06  5:40         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvtx4npf1m.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18399-done@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).