From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#12443: 24.2.50; Default values in the minibuffer prompt (fix inconsisntecy) Date: Tue, 25 Aug 2020 09:45:50 -0400 Message-ID: References: <871ui48di4.fsf@mail.jurta.org> <878se2aox0.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="36094"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , Dani Moncayo , 12443@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 25 15:46:10 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 1kAZH7-0009Gb-JJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Aug 2020 15:46:09 +0200 Original-Received: from localhost ([::1]:38724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kAZH6-0003CG-Mh for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Aug 2020 09:46:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAZH0-0003C7-Uw for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 09:46:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kAZH0-0007db-LL for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 09:46:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kAZH0-0000Ux-Fh for bug-gnu-emacs@gnu.org; Tue, 25 Aug 2020 09:46:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Aug 2020 13:46: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.15983631601787 (code B ref 12443); Tue, 25 Aug 2020 13:46:02 +0000 Original-Received: (at 12443) by debbugs.gnu.org; 25 Aug 2020 13:46:00 +0000 Original-Received: from localhost ([127.0.0.1]:60808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZGx-0000SV-VR for submit@debbugs.gnu.org; Tue, 25 Aug 2020 09:46:00 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31806) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kAZGw-0000MK-K4 for 12443@debbugs.gnu.org; Tue, 25 Aug 2020 09:45:58 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 15CF4440783; Tue, 25 Aug 2020 09:45:53 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 7ABBB4406A0; Tue, 25 Aug 2020 09:45:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1598363151; bh=SswPQSUJPF1wks8Vx7MRq8j1mq0kwV280dvmg2A5omA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=E9I+YacW+Y0guwrG9JNl1XUPhzrQkpYvLIhKSJwABjTFX0sqOHp5z0QFxC7ZU3UTI sZkS24otszKjB6ZddthGELqr9EfyYqXPJ0G64ZNb9vb44SvKHBo9SHIwkDxf/UsKpP pAbcy3yUGXcHWscYov0t8DBQN2id3lqyYxJ2OERn91E+sST7z4QoScAcOGLZhoxLek aQpYqEsOhU0ypCzUQ1yLiwRraMBSyMn5UKlY1ppAcvWKSp4vSa6SE0BQJfiqhNhp2t 3o0NxXymX/8FBeaugc52zZ0JvdpjZ1+sgy0pj1t6NZZqYFvQtPp9DnouQv1UQ6MgkO g1MQY7/RXmKAw== Original-Received: from alfajor (unknown [45.72.246.108]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1966C12076C; Tue, 25 Aug 2020 09:45:51 -0400 (EDT) In-Reply-To: (Stefan Kangas's message of "Tue, 25 Aug 2020 05:55:44 -0700") 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:186288 Archived-At: >>> (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)))) Nitpick: `read-from-minibuffer` is a low-level function which you should never use directly but only within other `read-` functions. E.g. here one should probably use `read-string` instead. Please make sure that `minibuffer-electric-default-mode` pays attention to it. > 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: " LGTM, Stefan