unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: raman <raman@google.com>
To: bug-gnu-emacs@gnu.org
Cc: tv.raman.tv@gmail.com, emacs-devel@gnu.org
Subject: Re: 24.4.50; called-interactively-p and skip advice:
Date: Fri, 01 Aug 2014 09:12:28 -0700	[thread overview]
Message-ID: <p91a97o2npv.fsf@raman-glaptop.roam.corp.google.com> (raw)
In-Reply-To: <87a97texjg.fsf@gmail.com> (raman@google.com's message of "Mon, 28 Jul 2014 18:58:11 -0700")

Following up on this  bug with additional info:

I just confirmed that this bug was not present in emacs 24.3 --- where
interactive-p was implemented in C -- that function was declared
obsolete in 23.2.

In 24.4 when we transitioned to nadvice.el is when this appears to have
broken.

Looking at the code in 24.4;

the code for called-interactively-p  and its subsequent call through to 
advice--called-interactively-skip  --- one of the functions placed on
called-interactively-p-functions -- appears to introduce   large level
of complexity. advice--called-interactively-skip is defined in
nadvice.el 

Going back to the specific issue from the Emacspeak side:

What I really need is a way to tell if an interactive command was called
by the user pressing a key e.g. M-f for forward-word -- or M-x
forward-word -- those are the only situations in which the emacspeak
advice that speaks the "current word" should be invoked.  

Using (called-interactively-p 'interactive) for this use-case now that I
look at what that code does feels extremely tangled.

Could we perhaps introduce a C-level variable  -- say "interactivep"
that is exposed to elisp --  code in callint.c could set that variable
appropriately and clear it upon completing command execution. 

At the time nadvice.el was introduced, Stefane had me check through with
emacspeak to make sure that nothing broke -- and I had confirmed it --
admittedly, the current breakage in ruby-mode is caused by a large
number of complex recursive calls that are happening within that mode.

Note that there is only one emacspeak advice invoked even then -- the
one to backward-sexp -- but  the call stack is deep enough that
called-interactively-p gets very confused.

--Raman 



      parent reply	other threads:[~2014-08-01 16:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29  1:58 bug#18139: 24.4.50; called-interactively-p and skip advice: raman
2014-07-30  0:08 ` Glenn Morris
2014-07-30  0:40   ` raman
2014-07-30  3:59     ` Eli Zaretskii
2014-07-30 13:56       ` raman
2017-03-25 15:55         ` npostavs
2021-08-10 16:23           ` Lars Ingebrigtsen
2014-08-01 16:12 ` raman [this message]

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=p91a97o2npv.fsf@raman-glaptop.roam.corp.google.com \
    --to=raman@google.com \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tv.raman.tv@gmail.com \
    /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).