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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Ryan <rct <at> thompsonclan.org>
Cc: 3984 <at> debbugs.gnu.org
Subject: Re: bug#3984: Fix for #3984
Date: Tue, 17 Sep 2013 09:10:40 -0400
> We have "ad-is-advised" which we can use to find which stack frames
> correspond to advised functions. We have "ad-get-orig-definition" which we
> can use to find the original definition of an advised function.

These are functions of advice.el, which is on the way out.  We need to
look at nadvice.el.

Thinking about it once more, I realize that your "advised
call-interactively" case might indeed be resolved by the current code,
except that it bumps into the problematic case of "deepest advice is
using :around".

Could you check if it is the case simply be doing a dummy (advice-add
'call-interactively :before #'ignore) before your defadvice?

If that works, then we can probably fix that problem in the following way:
- keep track of every function value (e.g. #<subr call-interactively> in
  our case) that is wrapped (at the deepest level) in an :around advice
  (e.g. in a hash-table).
- when walking up the stack, if we find such a function, look up the
  stack searching for the matching function symbol (just like we already
  do when encountering an internal advice element on the stack).


        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.