[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Brittleness of called-interactively-p
From: |
Stefan Monnier |
Subject: |
Re: Brittleness of called-interactively-p |
Date: |
Sun, 12 Jul 2015 19:26:36 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
>>> I would like to make a suggestion. All these problems can be resolved by
>>> introducing a special (dynamically bound) variable. Each call -- not only
>>> interactive -- to an interactive function would rebind it to the value
>>> providing all the necessary information about interactiveness of this call.
SM> That's pretty much what we do.
> No. Currently, called-interactively-p "returns t if the containing function
> was called by `call-interactively'." I argue that functions not having
> interactive form should not have effect on return value.
You might be able to exploit this "ignore non-interactive functions" to
make the current code more robust, indeed. It might be reasonably easy,
e.g. replace
(memq (nth 1 frame) '(interactive-p 'byte-code))
with something like (not (commandp (nth 1 frame)). But note that the
situation for advised functions is still tricky: the outer advice is called
with funcall-interactively (and it interactive) but inner advices and the
original function are always called with `apply' or `funcall' rather
than with funcall-interactively, so called-interactively-p still has to
work harder to try and figure out that "the inner function is actually,
conceptually, called interactively, even though technically it's not".
Stefan
- Brittleness of called-interactively-p, Dmitri Paduchikh, 2015/07/12
- Re: Brittleness of called-interactively-p, Stefan Monnier, 2015/07/12
- Re: Brittleness of called-interactively-p, Dmitri Paduchikh, 2015/07/12
- Re: Brittleness of called-interactively-p,
Stefan Monnier <=
- Re: Brittleness of called-interactively-p, Dmitri Paduchikh, 2015/07/13
- Re: Brittleness of called-interactively-p, Stefan Monnier, 2015/07/15
- Re: Brittleness of called-interactively-p, raman, 2015/07/16
- RE: Brittleness of called-interactively-p, Drew Adams, 2015/07/16
- RE: Brittleness of called-interactively-p, T.V Raman, 2015/07/16
- Re: Brittleness of called-interactively-p, Richard Stallman, 2015/07/16
- Re: Brittleness of called-interactively-p, Dmitri Paduchikh, 2015/07/17
- Re: Brittleness of called-interactively-p, Dmitri Paduchikh, 2015/07/17
- Message not available
- Re: Brittleness of called-interactively-p, Dmitri Paduchikh, 2015/07/18
- Re: Brittleness of called-interactively-p, raman, 2015/07/17