all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: 62563@debbugs.gnu.org
Cc: ruijie@netyu.xyz, stefankangas@gmail.com
Subject: bug#62563: [FR] Expose `interactive' arg handling as an Elisp function
Date: Sun, 17 Sep 2023 02:50:12 +0200	[thread overview]
Message-ID: <87bke1d3nf.fsf@web.de> (raw)
In-Reply-To: <CADwFkm=H8Ddnz9uGr6fDX=7OViB6f7_8=9ZMFXobRPh=N1BPjg@mail.gmail.com> (Stefan Kangas's message of "Mon, 11 Sep 2023 16:54:50 -0700")

Stefan Kangas <stefankangas@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?

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.

Michael.





  reply	other threads:[~2023-09-17  0:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  7:27 bug#62563: [FR] Expose `interactive' arg handling as an Elisp function Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-31  7:38 ` Eli Zaretskii
2023-09-11 23:54   ` Stefan Kangas
2023-09-17  0:50     ` Michael Heerdegen [this message]
2023-09-17 11:31       ` Stefan Kangas
2023-09-18  4:28         ` Michael Heerdegen
2023-09-19 10:21         ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bke1d3nf.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=62563@debbugs.gnu.org \
    --cc=ruijie@netyu.xyz \
    --cc=stefankangas@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.