opensubscriber
   Find in this group all groups
 
Unknown more information…

h : help-gnu-emacs@gnu.org 8 June 2012 • 8:03AM -0400

Re: defadvice and called-interactively-p
by Juanma Barranquero

REPLY TO AUTHOR
 
REPLY TO GROUP




On Wed, Jun 6, 2012 at 10:11 AM, Frank Fischer
<frank-fischer@shad...> wrote:

> 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.

As an horrible kludge, if you really need a way to make it work and
don't mind the ugliness:

(defadvice myfunc (around around-myfunc activate)
  (if (called-interactively-p 'any)
      (call-interactively (ad-get-orig-definition 'myfunc))
    ad-do-it))

    Juanma


Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.