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

Previous Next

Package: emacs;

Reported by: Tom Tromey <tom <at> tromey.com>

Date: Wed, 3 Sep 2014 20:03:01 UTC

Severity: minor

Tags: notabug

Found in version 24.4.50

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Tom Tromey <tom <at> tromey.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 18399 <at> debbugs.gnu.org, tom <at> tromey.com
Subject: bug#18399: 24.4.50; nadvice :filter-args -vs- interactive
Date: Fri, 05 Sep 2014 23:40:19 -0600
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.

Tom

=== 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 ----
  @example
  (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}.





This bug report was last modified 10 years and 321 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.