Subject: Re: bug#11747: 24.1.50; called-interactively-p vs. advice

From: Stefan Monnier <[email-masked]>
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