GNU bug report logs - #62563
[FR] Expose `interactive' arg handling as an Elisp function

Previous Next

Package: emacs;

Reported by: Ruijie Yu <ruijie <at> netyu.xyz>

Date: Fri, 31 Mar 2023 07:29:01 UTC

Severity: wishlist

Tags: moreinfo

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Michael Heerdegen <michael_heerdegen <at> web.de>, 62563 <at> debbugs.gnu.org
Subject: bug#62563: [FR] Expose `interactive' arg handling as an Elisp function
Date: Sun, 17 Sep 2023 04:31:57 -0700
Michael Heerdegen <michael_heerdegen <at> web.de> writes:

> Stefan Kangas <stefankangas <at> gmail.com> writes:
>
>> >> --8<---------------cut here---------------start------------->8---
>> >> (defun foo (fname)
>> >>   (interactive "f")
>> >>   (ignore fname))
>> >>
>> >> (defun foo (fname bar)
>> >>   (interactive
>> >>    (list (simulate-interactive-f)
>> >>          (get-bar)))
>> >>   (ignore fname bar))
>> >> --8<---------------cut here---------------end--------------->8---
>
> Something like this can be useful if you need to read an additional
> argument in a way that involves the need to run some Lisp, where using a
> normal code letter is not enough.  Then you need to substitute the other
> code letters you still want to have been read also with Lisp code.  Is
> that understandable?

Yes, I think that explanation is clear.

> We have `advice-eval-interactive-spec' which can be used like
> (advice-eval-interactive-spec "f") - that comes very close to what is
> requested here.  Combined with `interactive-form' one can use this to
> simulate the argument reading from a given command from Lisp.
>
> `advice-eval-interactive-spec' has a FIXME:
>
> | ;; FIXME: How about renaming this to just `eval-interactive-spec'?
> | ;; It's not specific to the advice system.
>
> Any opinions whether we want to do that?  If the implementation is not
> something ugly (it probably is, a bit, though), I would vote for it.

Could you point to one (or more) examples of real code that would have
been made significantly simpler by this?  The idea sounds good in
theory, but it is important to understand if it will also be useful in
practice.  That will give us a better basis for deciding if this is
something we would want to add or not.




This bug report was last modified 1 year and 250 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.