emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Brittleness of called-interactively-p


From: Drew Adams
Subject: RE: Brittleness of called-interactively-p
Date: Thu, 16 Jul 2015 10:36:41 -0700 (PDT)

> Speaking from the perspective of developing Emacspeak:
> 
> Emacspeak uses the "is this an interactive call" heavily  -- it provides
> spoken feedback only if the call is interactive.
> 
> I originally implemented emacspeak starting in late 1994 and used the
> test (when (interactive-p)...) in all my code.
> 
> When interactive-p was deprecated and we moved to the new
> called-interactive-p -- I was unable to get the behavior I wanted using
> (called-interactive-p 'interactive) as  the test;  --  the code ended up
> chasing its tail given the heavy use of advice.
> 
> I worked around the problem by defining my own version of the
> interactive test -- see http://github.com/tvraman/emacspeak --
> specifically the implementation of function ems-interactive-p.

You might want to say which of the many (!) files in that directory
contains the definition of `ems-interactive-p'.  And perhaps tell us
why you mention it and, in particular, what is the "behavior [you]
wanted", and why.  You mention that `called-interactively-p' doesn't
work well enough for you when advice is involved, but some more info
about `ems-interactive-p' might be helpful.

FWIW, I still use `interactive-p' in much of my code, because the code
needs to work also with older Emacs versions.  And because I have never
noticed any problem, for this code anyway, with `interactive-p'.

What's more, the doc for `interactive-p' does not really tell you how
to replace it - it just says to use `called-interactively-p', without
any mention of which argument gives you the behavior you had previously
with `interactive-p' or similar-but-somehow-improved behavior.

`interactive-p' was indeed used heavily, over decades.  And it is no
doubt still in use quite a bit.  Too bad there is next-to-no guidance
on how to use `called-interactively-p' to replace it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]