emacs-devel
[Top][All Lists]
Advanced

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

Re: Simple defadvice's stopped working (commit daa84a03, Thu Nov 8 23:10


From: Katsumi Yamaoka
Subject: Re: Simple defadvice's stopped working (commit daa84a03, Thu Nov 8 23:10:16 2012 -0500)
Date: Fri, 16 Nov 2012 08:01:29 +0900
User-agent: Gnus/5.130006 (真 Gnus v0.6) Emacs/24.3.50 (i686-pc-cygwin)

>> Unfortunately called-interactively-p never returns non-nil while
>> performing an advised command interactively.

> Yes, called-interactively-p (and interactivep, of course) are pretty
> sensitive beasts.  The problem you mention was already present before,
> tho it probably got a bit worse (it used to "only" affect uses of
> called-interactively-p in the advised command, whereas it now also
> affects uses in the advice themselves).

Ok.  It seems hard to me to fix, so I will live with this way
(for a while?).

(defvar my-called-interactively-p nil)

(defadvice called-interactively-p (around work-for-advised-commands activate)
  "Work for advised commands."
  (or my-called-interactively-p ad-do-it))

(defadvice interactive-p (around work-for-advised-commands activate)
  "Work for advised commands."
  (or my-called-interactively-p ad-do-it))

(defadvice command (around work-interactively (arg &optional arg EXTRA-ARG)
                           activate)
  "Work interactively."
  (interactive (list bla bla t))
  (let ((my-called-interactively-p EXTRA-ARG))
    ad-do-it))



reply via email to

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