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

From: Juri Linkov <[email-masked]>
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))