[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Choosing invokation of list in an interactive clause
From: |
Yuri Khan |
Subject: |
Re: Choosing invokation of list in an interactive clause |
Date: |
Thu, 4 Apr 2024 22:27:11 +0700 |
On Thu, 4 Apr 2024 at 21:20, Heime <heimeborgia@protonmail.com> wrote:
> (interactive
> (let ( (csel '("Symbol" "Command"))
> (cseq '("intsl " "iintsl" "iiintsl" "ointsl")) )
> (list
> (completing-read "Grapheme: " cseq nil t nil)
> (completing-read "Selector: " csel nil t nil) )))
This calls ‘completing-read’ twice and wraps the results in a list of
two values.
> Alternative
>
> (interactive
> (list
> (let ( (csel '("Symbol" "Command"))
> (cseq '("intsl " "iintsl" "iiintsl" "ointsl")) )
>
> (completing-read "Grapheme: " cseq nil t nil)
> (completing-read "Selector: " csel nil t nil) )))
This calls ‘completing-read’ twice, discards the first result and
yields the second one as the ‘let’ result. This one gets wrapped in a
list.
If you wanted an equivalent form where ‘let’ were inside ‘list’, it
would look like this:
(interactive
(list
(let ((cseq '("intsl " "iintsl" "iiintsl" "ointsl")))
(completing-read "Grapheme: " cseq nil t nil))
(let ((csel '("Symbol" "Command")))
(completing-read "Selector: " csel nil t nil))))
However, your two bindings, ‘csel’ and ‘cseq’, are only used once
each, never reused, never modified, nor do they have useful
documenting names. You aren’t really gaining anything from them. Could
just inline them and sidestep the whole question.
(interactive
(list
(completing-read "Grapheme: " '("intsl " "iintsl" "iiintsl" "ointsl")
nil t nil)
(completing-read "Selector: " '("Symbol" "Command") nil t nil)))
- Choosing invokation of list in an interactive clause, Heime, 2024/04/04
- Re: Choosing invokation of list in an interactive clause,
Yuri Khan <=
- Re: Choosing invokation of list in an interactive clause, Michael Albinus, 2024/04/04
- Re: Choosing invokation of list in an interactive clause, Heime, 2024/04/04
- Re: Choosing invokation of list in an interactive clause, Heime, 2024/04/06
- Re: Choosing invokation of list in an interactive clause, Michael Albinus, 2024/04/06
- RE: [External] : Re: Choosing invokation of list in an interactive clause, Drew Adams, 2024/04/06
- RE: [External] : Re: Choosing invokation of list in an interactive clause, Heime, 2024/04/06
- RE: [External] : Re: Choosing invokation of list in an interactive clause, Drew Adams, 2024/04/06