From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lars Hansen Newsgroups: gmane.emacs.devel Subject: Re: Start value in minibuffer Date: Mon, 14 Nov 2005 11:56:21 +0100 Message-ID: <43786D55.7080300@soem.dk> References: <87r79kxd3k.fsf@jurta.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1131971886 10788 80.91.229.2 (14 Nov 2005 12:38:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2005 12:38:06 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 14 13:37:56 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EbdaY-0007J5-VZ for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 13:37:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbdUD-0003JO-K4 for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 07:31:02 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ebc1L-0004kz-FT for emacs-devel@gnu.org; Mon, 14 Nov 2005 05:57:09 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ebc0i-0004hY-RJ for emacs-devel@gnu.org; Mon, 14 Nov 2005 05:57:04 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ebc0e-0004h6-5s for emacs-devel@gnu.org; Mon, 14 Nov 2005 05:56:25 -0500 Original-Received: from [212.99.225.245] (helo=odin.broadcom.dk) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1Ebc0e-0006ve-5n for emacs-devel@gnu.org; Mon, 14 Nov 2005 05:56:24 -0500 Original-Received: from pppoe3-ves.broadcom.dk ([212.99.255.42] helo=[10.17.1.154]) by odin.broadcom.dk with esmtp (Exim 4.24; FreeBSD) id 1Ebbsi-000Jzl-Pf; Mon, 14 Nov 2005 11:48:12 +0100 User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en Original-To: Drew Adams In-Reply-To: X-Enigmail-Version: 0.91.0.0 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:45947 Archived-At: Drew Adams wrote: >Different users will prefer different behaviors. Each approach has something >to be recommended. And, in the case where each approach is not optimal, it >still lets you get what you need with at most one keystroke: > >1. `M-n' to pull in the default, in straight Emacs - because > it's not there to begin with. > >2. `C-SPC' to deselect a preselected init value in PC-selection > mode or delete-selection mode - because you want to edit it > slightly. > >3. some keystroke (e.g. M-S-backspace) to erase the minibuffer > (in the mode I use: init value without preselection) - when I > don't want the value at all. > >That is: > >#1 makes you go through an extra step to get the default value. > >#2 makes you go through an extra step to deactivate the selection. > >#3 makes you go through an extra step to get rid of the value. > >#1 and #2 are optimal when you don't want to edit the default value (just >take it or leave it). #3 is optimal when you do want to edit it. > > I think you are right and clear! But then the most sensible thing would be to make it optional. What about something like: (defcustom minibuffer-insert-default-value nil "Insert DEFAULT-VALUE into minibuffer. If non-nil, `read-from-minibuffer' inserts DEFAULT-VALUE into the minibuffer if INITIAL-CONTENTS is nil. If the value is 'select, the minibuffer contents will be selected." :type '(choice (const :tag "Don't insert default value" nil) (const :tag "Insert default value" t) (const :tag "Insert and select default value" select))) With this option it is a good decision to use DEFAULT-VALUE rather than INITIAL-CONTENTS in calls to read-from-minibuffer. Because then the minibuffer will be empty when minibuffer-insert-default-value is nil. I suggest to add this in etc/TODO to be looked at after the release. What do people think?