From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Start value in minibuffer Date: Mon, 14 Nov 2005 09:36:59 -0800 Message-ID: References: <43786D55.7080300@soem.dk> 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 1131990113 10410 80.91.229.2 (14 Nov 2005 17:41:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Nov 2005 17:41:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 14 18:41:51 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EbiGc-0006vJ-UW for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 18:37:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbiGb-00048x-V3 for ged-emacs-devel@m.gmane.org; Mon, 14 Nov 2005 12:37:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EbiGQ-00048i-Sf for emacs-devel@gnu.org; Mon, 14 Nov 2005 12:37:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EbiGP-00048W-CH for emacs-devel@gnu.org; Mon, 14 Nov 2005 12:37:06 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbiGP-00048T-7W for emacs-devel@gnu.org; Mon, 14 Nov 2005 12:37:05 -0500 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EbiGP-0004u6-5N for emacs-devel@gnu.org; Mon, 14 Nov 2005 12:37:05 -0500 Original-Received: from rgmsgw300.us.oracle.com (rgmsgw300.us.oracle.com [138.1.186.49]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id jAEHb0tK025350 for ; Mon, 14 Nov 2005 10:37:01 -0700 Original-Received: from rgmsgw300.us.oracle.com (localhost [127.0.0.1]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jAEHb0Fn025299 for ; Mon, 14 Nov 2005 10:37:00 -0700 Original-Received: from dradamslap (dradams-lap.us.oracle.com [130.35.177.126]) by rgmsgw300.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jAEHaxVc025291 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 14 Nov 2005 10:36:59 -0700 Original-To: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: <43786D55.7080300@soem.dk> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:45961 Archived-At: 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))) There are actually three things we might consider making options: 1. Whether or not the default value is to be inserted in the minibuffer as an initial value. 2. If inserted, whether or not to preselect it. 3. Where to leave the cursor - at the beginning or end of the value. These could be treated independently (3 separate options) or together. The cursor position matters most for the preselection case, I think. As an example, in my library, I provide the cursor-position option only in case of preselection. So, I provide only one option, with these values: (defcustom icicle-init-value 'insert "*Non-nil means to use default value as init value when reading input. This is used by `completing-read'. When the default-value argument is non-nil and the initial-input argument is nil or \"\", the default value is inserted in the minibuffer as the initial input. This has the advantage of not requiring you to use `M-n' to retrieve the default value. It has the disadvantage of making you empty the minibuffer if you do not want to use or edit the default value. The particular non-nil value determines whether or not the value is preselected and, if preselected, where the cursor is left: at the beginning or end of the value. Possible values: nil - Do not insert default value. `insert' - Insert default value (leave cursor at end). `preselect-start' - Insert and preselect default value; leave cursor at beginning. `preselect-start' - Insert and preselect default value; leave cursor at end. Preselection can be useful in Delete Selection mode or PC Selection mode. It makes it easy to replace the value by typing characters, or delete it by hitting `C-d' or `DEL' (backspace). However, all of the initial input is lost if you type or hit `C-d' or `DEL'. That is inconvenient if you want to keep most of it and edit it only slightly." :type '(choice (const :tag "Do not insert default value as initial value" nil) (const :tag "Insert (and leave cursor at end)" insert) (const :tag "Insert, preselect, and leave cursor at beginning" preselect-start) (const :tag "Insert, preselect, and leave cursor at end" preselect-end)) :group 'icicles)