GNU bug report logs - #11747
24.1.50; called-interactively-p vs. advice

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Tue, 19 Jun 2012 18:23:01 UTC

Severity: normal

Tags: confirmed

Merged with 13656, 15476

Found in versions 24.1.50, 24.2, 24.3

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: 11747 <at> debbugs.gnu.org
Subject: bug#11747: 24.1.50; called-interactively-p vs. advice
Date: Fri, 08 Feb 2013 17:41:50 -0500
> | This function is meant for implementing advice and other
> | function-modifying features.  Instead of using this, it is sometimes
> | cleaner to give your function an extra optional argument whose
> | `interactive' spec specifies non-nil unconditionally ("p" is a good
> | way to do this), or via (not (or executing-kbd-macro noninteractive)). 
> It seems a bit confusing - is there a "not" missing in the first
> sentence?

No, called-interactively-p is indeed specifically useful when writing
advice (i.e. for use in the advice itself, not in the function that is
advised).
For normal functions, it is usually better (and always more reliable) to
provide an appropriate argument from the `interactive' spec, but doing
that in an advice is a lot more difficult, since it requires modifying
the `interactive' spec, which defadvice does not really let you do (it
lets you override it with another spec, but not modify the existing
spec).


        Stefan




This bug report was last modified 8 years and 54 days ago.

Previous Next


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