[Top][All Lists]

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

Re: completing-read depricated initial-input

From: Arash Esbati
Subject: Re: completing-read depricated initial-input
Date: Thu, 23 Jun 2022 14:12:45 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50

Michael Heerdegen <> writes:

> The purpose of `completing-read' is a bit different from `read-string'
> and `read-from-minibuffer'.  Providing INITIAL-INPUT is useful for the
> latter, but much less for `completing-read' in my opinion.  If at all
> (anybody who has a believable real-life example?).

If you have a common prefix which should be shown in the candidates
list, in (La)TeX for instance:

(let ((list '("iffalse" "iftrue" "else" "fi")))
  (completing-read "Macro: "
                   (mapcar (lambda (x) (concat "\\" x)) list)
                   nil nil "\\"))

Something like this looks odd:

(let ((list '("iffalse" "iftrue" "else" "fi")))
  (completing-read "Macro: \\" list))

Best, Arash

reply via email to

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