GNU bug report logs - #12443
24.2.50; Default values in the minibuffer prompt (fix

Previous Next

Package: emacs;

Reported by: Dani Moncayo <dmoncayo <at> gmail.com>

Date: Fri, 14 Sep 2012 14:08:01 UTC

Severity: minor

Found in version 24.2.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Juri Linkov <juri <at> jurta.org>
Cc: 12443 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>, Dani Moncayo <dmoncayo <at> gmail.com>
Subject: bug#12443: 24.2.50; Default values in the minibuffer prompt (fix inconsisntecy)
Date: Tue, 25 Aug 2020 05:55:44 -0700
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Juri Linkov <juri <at> jurta.org> 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.)




This bug report was last modified 4 years and 123 days ago.

Previous Next


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