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: Juri Linkov <juri <at> jurta.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 12443 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>, 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 21:23:46 +0300
> However, there's things like:
>
> 	 (setq from-coding (read-coding-system
> 			    (format "Recode filename %s from (default %s): "
> 				    filename default-coding)
> 			    default-coding))
>
> These are surprisingly rare, but, uhm...  perhaps format-prompt could
> take a format string?  The function would then look like:
>
> (defun format-prompt (prompt default &rest format-args)
>   )
>
> where it would call `format' on PROMPT and FORMAT-ARGS.
>
> So that would then be:
>
> 	 (setq from-coding (read-coding-system
> 			    (format-prompt "Recode filename %s"
>                                             default-coding filename)
> 			    default-coding))

Simpler would be to format arguments separately:

	 (setq from-coding (read-coding-system
			    (format-prompt (format "Recode filename %s from"
                                                   filename)
				           default-coding)
			    default-coding))

that would allow easier replacement of 'format' with 'gettext' later:

	 (setq from-coding (read-coding-system
			    (format-prompt (gettext "Recode filename %s from"
                                                     filename)
				           default-coding)
			    default-coding))




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.