all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefankangas@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Ruijie Yu <ruijie@netyu.xyz>, 62563-done@debbugs.gnu.org
Subject: bug#62563: [FR] Expose `interactive' arg handling as an Elisp function
Date: Mon, 11 Sep 2023 16:54:50 -0700	[thread overview]
Message-ID: <CADwFkm=H8Ddnz9uGr6fDX=7OViB6f7_8=9ZMFXobRPh=N1BPjg@mail.gmail.com> (raw)
In-Reply-To: <83lejd2wwi.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 31 Mar 2023 10:38:21 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Date: Fri, 31 Mar 2023 15:27:47 +0800
>> From:  Ruijie Yu via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>>
>> I find myself sometimes needing to manually write code that do the same
>> job as the string-form `interactive' would do, like "read for an
>> existing file name" (the "f" form), etc.  This happens because I want to
>> do the following conversion.
>>
>> --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---
>>
>> In short, this is useful when I need to add an interactive argument that
>> is not already covered by interactive codes, so I have to use the more
>> verbose interactive list form.
>
> I don't think I understand the rationale, so please tell more.  The
> interactive spec can be used like this:
>
>   (interactive "bBuffer to rename: \nsRename buffer %s to: ")
>
> So basically, you can prompt for anything using the 's' descriptor and
> the following prompt string with %-constructs.  In what use cases is
> this not enough, so much so that it would require exposing the guts of
> this to Lisp?

More information was requested, but none was given within 6 months, so
I'm closing this bug.  If this is still an issue, please reply to this
email (use "Reply to all" in your email client) and we can reopen the
bug report.





  reply	other threads:[~2023-09-11 23:54 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 [this message]
2023-09-17  0:50     ` Michael Heerdegen
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='CADwFkm=H8Ddnz9uGr6fDX=7OViB6f7_8=9ZMFXobRPh=N1BPjg@mail.gmail.com' \
    --to=stefankangas@gmail.com \
    --cc=62563-done@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=ruijie@netyu.xyz \
    /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.