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 07:35:51 +0000 (UTC)
User-agent: slrn/0.9.9p1 (Linux)

On 2012-06-06, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
> On Wed, Jun 06 2012, Frank Fischer wrote:
>
>> Hi,
>>
>> I have a problem when advising a function/command that uses
>> `called-interactively-p' but I have not been able to find a solution.
>>
>> Suppose you have a command calling `called-interactively-p'
>>
>> (defun myfunc ()
>>   (interactive)
>>   (message "MYFUNC %s" (called-interactively-p 'any)))
>>
>> Now, when executing M-x myfunc RET the message line shows "MYFUNC t"
>> as expected. But when that function is advised
>>
>> (defadvice myfunc (around around-myfunc activate)
>>   ad-do-it)
>
> While you're waiting for an answer from someone who really understand
> how all this works, I've found that I need to add an (interactive)
> statement to the defadvice form as well, in order to preserve
> interactive state. Give it a shot, anyway!

I've tried this and it does not make a difference. And according to the
elisp manual it should not do: 17.10 states 

      The interactive form is present if the original function or some
      piece of advice specifies one.  
      
Anyway, the result is the same.

Frank




reply via email to

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