bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec


From: Michael Heerdegen
Subject: bug#17871: 24.4.50; (elisp) `Core Advising Primitives': interactive spec as function?
Date: Sun, 04 Aug 2019 14:45:26 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Lars Ingebrigtsen <address@hidden> writes:

> (defun advice-eval-interactive-spec (spec)
>   "Evaluate the interactive spec SPEC."
>   (cond
>    ((stringp spec)
>     ;; There's no direct access to the C code (in call-interactively) that
>     ;; processes those specs, but that shouldn't stop us, should it?
>     ;; FIXME: Despite appearances, this is not faithful: SPEC and
>     ;; (advice-eval-interactive-spec SPEC) will behave subtly differently 
> w.r.t
>     ;; command-history (and maybe a few other details).
>     (call-interactively `(lambda (&rest args) (interactive ,spec) args)))
>    ;; ((functionp spec) (funcall spec))
>    (t (eval spec))))
>
> The functionp case is commented out?  This was apparently done in
> 1668ea9062e (in 2012!) by Stefan while rewriting this stuff.
>
> If nobody has missed this since 2012...  perhaps it should just be
> removed?

I guess SPEC is never functionp, at least after that change.  By
skimming over the code, the

  (interactive (lambda (old-interactive-form) ...))

case is transformed by `advice--make-interactive-form' to something else
that is not a function, and apart from this, interactive specs are never
functionp.

Michael.





reply via email to

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