Subject: Re: bug#12443: 24.2.50; Default values in the minibuffer prompt (fix inconsisntecy)

From: Stefan Kangas <[email-masked]>
Date: Tue, 25 Aug 2020 05:55:44 -0700

Lars Ingebrigtsen <[email-masked]> writes:

> Juri Linkov <[email-masked]> writes:
>
>> (defcustom minibuffer-default-prompt-format " (default %s)"
>>  "Default format."
>>  :type 'string)
>>
>> Example of usage:
>>
>> (let ((default "def"))
>>   (read-from-minibuffer
>>    (format "Set bookmark%s: "
>>            (format minibuffer-default-prompt-format default))))
>>
>> Other possible values:
>>
>> (setq minibuffer-default-prompt-format " [%s]")
>> (setq minibuffer-default-prompt-format "")
>
> I think that makes a lot of sense.  Does anybody have an opinion here?

I think this sounds like a good idea; consistency is good.

How about taking it even further?   Something along the lines of:

    (format-prompt PROMPT &optional DEFAULT)

    (format-prompt "Set bookmark" default)
    => "Set bookmark [foobar]: "

    (format-prompt "Goto char")
    => "Goto char: "

(This would avoid having to always remember to use double formats like
above.)