GNU bug report logs - #65459
completing-read INITIAL-VALUE unaware of COLLECTION and REQUIRE-MATCH

Previous Next

Package: emacs;

Reported by: Heime <heimeborgia <at> protonmail.com>

Date: Tue, 22 Aug 2023 22:05:02 UTC

Severity: normal

Full log


Message #38 received at 65459 <at> debbugs.gnu.org (full text, mbox):

From: Gregory Heytings <gregory <at> heytings.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 65459 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>,
 Heime <heimeborgia <at> protonmail.com>
Subject: Re: bug#65459: completing-read INITIAL-VALUE unaware of COLLECTION
 and REQUIRE-MATCH
Date: Wed, 23 Aug 2023 23:06:24 +0000
>
> But at this point do you consider the behavior of
>
>    (let ((cseq '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta")))
>      (completing-read (format-prompt "Grapheme" "alpha")
>                       cseq nil t nil nil "alpha"))
>
> to be a good solution for your original problem?
>

Is this not a better solution to his original problem?

(defun my-completing-read (prompt collection start)
  (minibuffer-with-setup-hook
      (:append
       (lambda ()
         (setq-local actual-minibuffer-default-add-function
                     minibuffer-default-add-function)
         (setq-local minibuffer-default-add-function
                     '(lambda () (setq minibuffer-default-add-done nil)
                        (funcall actual-minibuffer-default-add-function)))
         (next-history-element start)
         (move-end-of-line nil)))
    (completing-read (format-prompt prompt nil) collection nil t)))

(my-completing-read "Grapheme" '("alpha" "beta" "gamma" "delta" "epsilon" "zeta" "eta") 1)





This bug report was last modified 1 year and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.