From: Heime via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Jean Louis <bugs@gnu.support>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, help-gnu-emacs@gnu.org
Subject: Re: Iinteractive function allowing multiple inputs
Date: Mon, 09 Dec 2024 23:39:59 +0000 [thread overview]
Message-ID: <soO86eD_Ft18E_RV4deTUHzKrEkv3O6vwPxJsnkAeP7k3pgIClZESKqo647GFH7Qv87361JW3H473EGyBVlDuDHwzWh3hfHXozGeHk7Ws4w=@protonmail.com> (raw)
In-Reply-To: <Z1d4g4gGjGfwYv08@lco2>
Sent with Proton Mail secure email.
On Tuesday, December 10th, 2024 at 11:08 AM, Jean Louis <bugs@gnu.support> wrote:
> * Stefan Monnier via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org [2024-12-10 00:24]:
>
> > > (defun my-multi-input-function (input1 input2 input3)
> > > "An example function that takes three inputs and displays them."
> > > (interactive
> > > (list
> > > (read-string "Enter the first input: ")
> > > (read-string "Enter the second input: ")
> > > (read-string "Enter the third input: ")))
> > > (message "You entered: %s, %s, %s" input1 input2 input3))
> > > [...]
> > > Me personally, I don't like that style, I like using `let' and reading
> > > what I need to read within function, while leaving (interactive) as it
> > > is.
> >
> > The difference between the two is that the above code provides both
> > a command and a function, whereas if you move the `read-string`s outside
> > of the `interactive` form, then it can't really be used as a function
> > any more.
>
>
> But I replace it with:
>
> (defun my-multi-input-function (&optional input1 input2 input3)
>
> and then it can be used as function again in the context how I think
> or guess that you mean it.
>
> Only if arguments are removed then it cannot be used as function.
>
> Am I right? - Jean Louis
Right.
prev parent reply other threads:[~2024-12-09 23:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 18:40 Iinteractive function allowing multiple inputs Heime via Users list for the GNU Emacs text editor
2024-12-09 20:43 ` Jean Louis
2024-12-09 20:48 ` Heime via Users list for the GNU Emacs text editor
2024-12-09 21:02 ` Heime via Users list for the GNU Emacs text editor
2024-12-09 21:11 ` Jean Louis
2024-12-09 21:06 ` Jean Louis
2024-12-09 21:14 ` Heime via Users list for the GNU Emacs text editor
2024-12-09 21:20 ` Jean Louis
2024-12-09 21:42 ` Heime via Users list for the GNU Emacs text editor
2024-12-09 21:46 ` Heime via Users list for the GNU Emacs text editor
2024-12-09 23:05 ` Jean Louis
2024-12-09 23:47 ` Heime via Users list for the GNU Emacs text editor
2024-12-10 7:12 ` Jean Louis
2024-12-09 21:23 ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-12-09 23:08 ` Jean Louis
2024-12-09 23:39 ` Heime via Users list for the GNU Emacs text editor [this message]
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='soO86eD_Ft18E_RV4deTUHzKrEkv3O6vwPxJsnkAeP7k3pgIClZESKqo647GFH7Qv87361JW3H473EGyBVlDuDHwzWh3hfHXozGeHk7Ws4w=@protonmail.com' \
--to=help-gnu-emacs@gnu.org \
--cc=bugs@gnu.support \
--cc=heimeborgia@protonmail.com \
--cc=monnier@iro.umontreal.ca \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).