[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUI
From: |
Stefan Monnier |
Subject: |
bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH |
Date: |
Wed, 23 Aug 2023 12:58:40 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
>> Could you give a bit more context about why/where you'd want to do that
>> so I can better imagine how to attack the problem?
>>
>> Hopefully it would explain why you want "alpha epsilon ..." first but
>> "alpha beta .." later.
>
> In such instance one considers collection as a cyclic list for the case of
> simple cycling. But with possibility of starting from a particular index.
So the initial "alpha" is simply not considered, OK, that makes sense,
so given that the ordering of COLLECTION happens to be preserved, you
can get the above behavior if you reorder COLLECTION before the call, as
in:
(let ((cseq '("epsilon" "zeta" "eta" "alpha" "beta" "gamma" "delta")))
(completing-read "Grapheme: " cseq nil t "alpha"))
>> Also for such uses of `completing-read` we usually recommend against a
>> non-nil value for INITIAL-INPUT, so that context should try to explain
>> why you use "alpha" as INITIAL-INPUT. - Stefan
> Because using INITIAL is the only way available to pre-insert a value in
> the minibuffer.
That's a bit tautological.
What I meant is why do you need to preinsert a value?
The normal/recommended call looks like:
(let ((cseq '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta")))
(completing-read (format-prompt "Grapheme" "alpha")
cseq nil t nil nil "alpha"))
[ Yes, it's a bit cumbersome: hysterical raisins :-( ]
Stefan
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Heime, 2023/08/22
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Eli Zaretskii, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Heime, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Stefan Monnier, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Heime, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Stefan Monnier, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Heime, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH,
Stefan Monnier <=
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Heime, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Stefan Monnier, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Drew Adams, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Gregory Heytings, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Stefan Monnier, 2023/08/23
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Gregory Heytings, 2023/08/24
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Heime, 2023/08/24
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Juri Linkov, 2023/08/25
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Stefan Monnier, 2023/08/24
- bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH, Gregory Heytings, 2023/08/26