unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Ryan <rct@thompsonclan.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 3984@debbugs.gnu.org
Subject: bug#3984:
Date: Fri, 20 Sep 2013 09:54:24 -0700	[thread overview]
Message-ID: <523C7DC0.3000403@thompsonclan.org> (raw)
In-Reply-To: <jwvpps3ftp1.fsf-monnier+emacs@gnu.org>


On 9/20/13 7:35 AM, Stefan Monnier wrote:
>> After a little more consideration, I think I know what the bug is. The goal
>> of "advice--called-interactively-skip" is to skip all the advice-related
>> stack frames of the called function, not advice-related stack frames for
>> advice on call-interactively.
> Oh, right.  How 'bout the patch below?
>
>
>          Stefan
>
>
> === modified file 'lisp/subr.el'
> --- lisp/subr.el	2013-09-18 03:50:18 +0000
> +++ lisp/subr.el	2013-09-20 14:34:03 +0000
> @@ -4246,6 +4246,8 @@
>   if those frames don't seem special and otherwise, it should return
>   the number of frames to skip (minus 1).")
>   
> +(defconst internal--call-interactively (symbol-function 'call-interactively))
> +
>   (defun called-interactively-p (&optional kind)
>     "Return t if the containing function was called by `call-interactively'.
>   If KIND is `interactive', then only return t if the call was made
> @@ -4321,7 +4323,9 @@
>           ;; Somehow, I sometimes got `command-execute' rather than
>           ;; `call-interactively' on my stacktrace !?
>           ;;(`(,_ . (t command-execute . ,_)) t)
> -        (`(,_ . (t call-interactively . ,_)) t)))))
> +        (`(,_ . (t ,(or `call-interactively
> +                        (pred (eq internal--call-interactively))) . ,_))
> +         t)))))
>   
>   (defun interactive-p ()
>     "Return t if the containing function was run directly by user input.
>
That would certainly work, assuming that subr.el is always loaded before 
nadvice.el (so call-interactively could not possibly be advised yet), 
which seems likely to be true since subr.el contains so many core functions.

Since this bug report is just about advising call-interactively, which 
we now have a fix for, should I open a separate bug about the around 
advice?





  reply	other threads:[~2013-09-20 16:54 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 22:37 bug#3984: 23.0.96; defadvice of call-interactively defeats interactive-p Drew Adams
2009-07-31  1:58 ` Stefan Monnier
2009-07-31 14:19   ` Drew Adams
2009-07-31 19:31     ` Stefan Monnier
2009-07-31 20:04       ` Drew Adams
2011-10-10  6:00 ` Kai Tetzlaff
2011-10-11 14:26   ` Drew Adams
2011-10-11 15:46     ` Stefan Monnier
2011-10-11 16:05       ` Drew Adams
2013-09-10 20:29 ` Christopher Wellons
2013-09-11  0:29   ` Stefan Monnier
2013-09-13  8:56 ` bug#3984: Fix for #3984 Ryan
2013-09-13 13:18   ` Stefan Monnier
2013-09-13 18:30     ` Ryan
2013-09-13 19:27       ` Ryan
2013-09-13 21:02         ` Stefan Monnier
2013-09-17  3:18           ` Ryan
2013-09-17 13:10             ` Stefan Monnier
2013-09-17 17:22               ` bug#3984: Ryan
2013-09-18  1:46                 ` bug#3984: Stefan Monnier
2013-09-18 23:30                   ` bug#3984: Ryan
2013-09-19  0:47                     ` bug#3984: Ryan
2013-09-19  3:38                       ` bug#3984: Stefan Monnier
2013-09-19  8:06                         ` bug#3984: Ryan
2013-09-19 19:23                           ` bug#3984: Ryan
2013-09-19 20:59                             ` bug#3984: Stefan Monnier
2013-09-19 21:59                             ` bug#3984: Ryan
2013-09-20  4:23                               ` bug#3984: Ryan
2013-09-20  4:58                                 ` bug#3984: Fix case where call-interactively is advised Ryan
2013-09-20  5:03                                   ` bug#3984: Ryan
2013-09-20 14:35                                 ` bug#3984: Stefan Monnier
2013-09-20 16:54                                   ` Ryan [this message]
2013-09-20 16:56                                     ` bug#3984: Ryan
2013-09-20 14:54                               ` bug#3984: Stefan Monnier
2013-09-20 16:50                                 ` bug#3984: Ryan
2013-09-20 19:59                                   ` bug#3984: Stefan Monnier
2013-09-13 10:24 ` bug#3984: bug#123: Potential fix Ryan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=523C7DC0.3000403@thompsonclan.org \
    --to=rct@thompsonclan.org \
    --cc=3984@debbugs.gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).