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

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

Re: completing-read depricated initial-input


From: Emanuel Berg
Subject: Re: completing-read depricated initial-input
Date: Thu, 23 Jun 2022 23:06:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Arash Esbati wrote:

> 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))

Neither looks good but the second is much less complicated and
error-prone and also more clear since there isn't the two nil
arguments.

If it is just about identifying a common and thus mandatory
prefix `completing-read' could just as well do it, the
alternatives could then all retain their intended and
complete form.

It's Thursday today, not (format "Thurs%s" shared-day-suffix)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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