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 #66 received at 3984 <at> debbugs.gnu.org (full text, mbox):

From: Ryan <rct <at> thompsonclan.org>
To: 3984 <at> debbugs.gnu.org
Subject: Fix for #3984
Date: Fri, 13 Sep 2013 01:56:19 -0700
Dear all,

I "fixed" this in my ido-ubiquitous package by completely reimplementing 
"called-interactively-p" and "interactive-p" in pure elisp: 
https://github.com/DarwinAwardWinner/ido-ubiquitous/commit/f0c42e289a614071e22ad2c08297a7ebd60ba1cc

Apart from simply translating the C code in elisp, I made two key 
adjustments to the logic: first, I filter out all evidence of advice 
from the call stack before checking if the caller is 
"call-interactively". Second, I relax the definition of "caller is 
call-interactively" to include any symbol with the same 
"symbol-function" as call-interactively, or any function that is the 
same as the symbol-function of call-interactively. Combined, these 
adjustments mean that defining advice on call-interactively no longer 
results in erroneous return values from these two interactivity-testing 
functions.

I have implemented this in elisp because that is the only way to 
redefine functions in a running emacs session, but there's no reason 
that the C code couldn't be adapted to use the same logic.

-Ryan




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.