help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: defadvice and called-interactively-p


From: Frank Fischer
Subject: Re: defadvice and called-interactively-p
Date: Wed, 6 Jun 2012 08:11:38 +0000 (UTC)
User-agent: slrn/0.9.9p1 (Linux)

On 2012-06-06, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
> Yup, it was just a guess. Another thing you're probably already
> perfectly aware of: the docstring for called-interactively-p says,
>
> "This function is meant for implementing advice and other
> function-modifying features."
>
> If called-interactively-p is meant to go in the advice, not the
> original functions, the behavior you're seeing is probably the whole
> point of how it works.

Yes I know this docstring. On the other hand the elisp manual says in 21.4

   The above method with the additional argument is usually best,
   because it allows callers to say "treat this call as interactive."
   But you can also do the job by testing `called-interactively-p'.
   
So even if using `called-interactively-p' is not the "recommended"
way, it sounds to me as if it is a completely valid one. Bug there's
nothing that suggests using `called-interactively-p' is dangerous when
used in an advised function (at least I did not find something in the
whole manual).

But the problem is that I cannot change/redefine the command that uses
`called-interactively-p' (that's the whole point of using an advice at
all), so changing this function is not an option. Of course, the
question arises if a function using `called-interactively-p' should be
considered being broken ... ?

Thanks for you comments,
Frank




reply via email to

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