[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (call-interactively FN) leaks prefix arg into FN when called from wi
Re: (call-interactively FN) leaks prefix arg into FN when called from within an interactive command
Tue, 24 Apr 2018 09:21:59 -0400
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
> | (if (null arg) (call-interactively #'find-file)
> | (let (current-prefix-arg)
> | (call-interactively #'ffap))))
(let ((current-prefix-arg nil))
(call-interactively (if arg #'ffap #'find-file)))
> So the prefix argument to gk-find-file leaks to ffap,
The (interactive "P") does not *consume* the value of
current-prefix-arg, indeed. It just uses it to set the value of `arg`.
> Is this intentional, or a bug?
Neither. It's a consecuence of the design.
> But is it really the _current_ command when it's invoked by
The "current command" is defined in terms of read-eval-loop, not in
terms of `call-interactively`. For the same reason `call-interactively`
does not run pre-command-hook and post-command-hook.