help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Iinteractive function allowing multiple inputs


From: Heime
Subject: Re: Iinteractive function allowing multiple inputs
Date: Mon, 09 Dec 2024 21:46:22 +0000





Sent with Proton Mail secure email.

On Tuesday, December 10th, 2024 at 9:42 AM, Heime via Users list for the GNU 
Emacs text editor <help-gnu-emacs@gnu.org> wrote:

> 
> 
> 
> 
> 
> Sent with Proton Mail secure email.
> 
> 
> On Tuesday, December 10th, 2024 at 9:20 AM, Jean Louis bugs@gnu.support wrote:
> 
> > * Heime heimeborgia@protonmail.com [2024-12-10 00:14]:
> > 
> > > Yes, but the values are not set automatically as one can do with a call
> > > with arguments. The code will force on you an interaction as though you
> > > are in interactive mode.
> > 
> > That is why I do like this:
> > 
> > (defun my-multi-input-function (&optional input1 input2 input3)
> > "An example function that takes three inputs and displays them."
> > (interactive)
> > (let ((input1 (or input1 (read-string "Enter the first input: ")))
> > (input2 (or input2 (read-string "Enter the second input: ")))
> > (input3 (or input3 (read-string "Enter the third input: "))))
> > (message "You entered: %s, %s, %s" input1 input2 input3)))
> > 
> > Then you can call function:
> > 
> > (my-multi-input-function input1 input2 input3)
> > 
> > or if those are nil, it will ask you. - Jean Louis
> 
> 
> Right. If passed a value, the read-string is skipped.
> I prefer the interactive declaration myself.

Could you assist me with completing-read-multiple for use with 
company-backends?  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]