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: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> jurta.org>
Cc: 12443 <at> debbugs.gnu.org, Dani Moncayo <dmoncayo <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>, Stefan Kangas <stefankangas <at> gmail.com>
Subject: bug#12443: 24.2.50; Default values in the minibuffer prompt (fix inconsisntecy)
Date: Fri, 28 Aug 2020 16:11:03 +0200
Juri Linkov <juri <at> jurta.org> writes:

> Maybe the final separator (colon) should be customizable as well.
> What if someone wants to use the same character as used in shell, i.e. '$'.
> Then moving the currently hard-coded colon to the default value
> " (default %s): " will allow the users to customize it to
> " (default %s)$ "

Good idea.  I'll adjust the variable and the code.

> Shouldn't one of these calls (namely 'describe-function') be further
> simplified with
>
> diff --git a/lisp/help-fns.el b/lisp/help-fns.el
> index d302c05283..617f6ae5e8 100644
> --- a/lisp/help-fns.el
> +++ b/lisp/help-fns.el
> @@ -151,9 +151,7 @@ describe-function
>     (let* ((fn (function-called-at-point))
>            (enable-recursive-minibuffers t)
>            (val (completing-read
> -                (if fn
> -                    (format-prompt "Describe function" fn)
> -                  "Describe function: ")
> +                (format-prompt "Describe function" fn)
>                  #'help--symbol-completion-table
>                  (lambda (f) (or (fboundp f) (get f 'function-documentation)))
>                  t nil nil
>
> But something is still wrong - with the nil default value the prompt becomes:
>
>   "Describe function (default nil): "
>
> whereas it should be
>
>   "Describe function: "

Yes, that's why you can't use format-prompt when there's no default value.

> It seems 'format-prompt' should not use 'minibuffer-default-prompt-format'
> when 'default' is nil.

nil is a perfectly valid default value in many prompts.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




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

Previous Next


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