[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#18399: 24.4.50; nadvice :filter-args -vs- interactive

From: Tom Tromey
Subject: bug#18399: 24.4.50; nadvice :filter-args -vs- interactive
Date: Fri, 05 Sep 2014 23:40:19 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

Michael> I myself was confused by the fact that :filter-args is the only case of
Michael> all advice types where the advice fun receives the arguments as a list.
Michael> It's a bit surprising, although the doc is clear and there are good
Michael> reasons for that "exception".  Maybe we could add a sentence to the
Michael> ‘:filter-args’ paragraph of (info "(elisp) Advice combinators") like
Michael>   "Note that FUNCTION is called with only one argument, the list of
Michael>   arguments, for this advice type".

Yeah, I had the same thought and had written the appended patch.
My reason was simply that I had been (mis-)reading the :filter-args
text, not the stuff about the (interactive) spec.


=== modified file 'doc/lispref/functions.texi'
*** doc/lispref/functions.texi  2014-06-02 00:18:22 +0000
--- doc/lispref/functions.texi  2014-09-06 05:40:02 +0000
*** 1480,1485 ****
--- 1480,1488 ----
  (lambda (&rest r) (apply @var{oldfun} (funcall @var{function} r)))
  @end example
+ Note carefully that, unlike with other combinators, in the
+ @code{:filter-args} case, the original arguments are passed as a
+ single argument to the advising function.
  @item :filter-return
  Call the old function first and pass the result to @var{function}.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]