From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#12443: 24.2.50; Default values in the minibuffer prompt (fix inconsisntecy) Date: Tue, 25 Aug 2020 21:23:46 +0300 Organization: LINKOV.NET Message-ID: <875z961u2l.fsf@mail.linkov.net> References: <871ui48di4.fsf@mail.jurta.org> <878se2aox0.fsf@gnus.org> <87imd669dh.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21316"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Dani Moncayo , Stefan Kangas , Stefan Monnier , 12443@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 25 21:10:22 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kAeKr-0005Qn-6x for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Aug 2020 21:10:21 +0200 Original-Received: from localhost ([::1]:33844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAeKq-0005VT-7Z for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Aug 2020 15:10:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAeKZ-0005TT-33 for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 15:10:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAeKY-0004F8-Oz for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 15:10:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kAeKY-00011k-C0 for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 15:10:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 19:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12443 X-GNU-PR-Package: emacs Original-Received: via spool by 12443-submit@debbugs.gnu.org id=B12443.15983825803879 (code B ref 12443); Tue, 25 Aug 2020 19:10:02 +0000 Original-Received: (at 12443) by debbugs.gnu.org; 25 Aug 2020 19:09:40 +0000 Original-Received: from localhost ([127.0.0.1]:36134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAeKB-00010V-Ph for submit@debbugs.gnu.org; Tue, 25 Aug 2020 15:09:39 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:50259) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAeK8-00010D-UB for 12443@debbugs.gnu.org; Tue, 25 Aug 2020 15:09:37 -0400 X-Originating-IP: 91.129.102.47 Original-Received: from mail.gandi.net (m91-129-102-47.cust.tele2.ee [91.129.102.47]) (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 732951C0004; Tue, 25 Aug 2020 19:09:27 +0000 (UTC) In-Reply-To: <87imd669dh.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 25 Aug 2020 17:19:38 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:186337 Archived-At: > 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))