GNU bug report logs - #3984
23.0.96; defadvice of call-interactively defeats interactive-p

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Thu, 30 Jul 2009 22:45:04 UTC

Severity: minor

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 3984 <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 3984 <at> debbugs.gnu.org, <emacs-pretest-bug <at> gnu.org>
Subject: Re: bug#3984: 23.0.96; defadvice of call-interactively defeats interactive-p
Date: Thu, 30 Jul 2009 21:58:51 -0400
> Can someone please explain why this happens, or how to work around it?
 
Because the implementation of interactive-p (and called-interactively-p)
is brittle: it looks at the latest stack frames to see the name of the
caller, so if you add things between the call to `call-interactively'
and the corresponding function call, it gets confused.

To work around it, don't use `interactive-p' and instead add an optional
argument (call it `interactive') to your function and pass it an
explicit non-nil value from the interactive spec.


        Stefan



This bug report was last modified 11 years and 243 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.