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: Start value in minibuffer [Was: opening /tmp//foo doesn't work.] Date: Sun, 13 Nov 2005 22:50:10 +0100 Message-ID: <4377B512.3050303@soem.dk> References: <20051112104720.GK11234@boetes.org> <20051112163852.GA11661@www.trapp.net> <874q6hlqzc.fsf@stupidchicken.com> 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 1131919088 8677 80.91.229.2 (13 Nov 2005 21:58:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 13 Nov 2005 21:58:08 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 13 22:57:57 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EbPkT-0000dE-5W for ged-emacs-devel@m.gmane.org; Sun, 13 Nov 2005 22:50:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbPkP-0003yF-C1 for ged-emacs-devel@m.gmane.org; Sun, 13 Nov 2005 16:50:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EbPjv-0003xU-Nx for emacs-devel@gnu.org; Sun, 13 Nov 2005 16:50:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EbPjt-0003wF-7u for emacs-devel@gnu.org; Sun, 13 Nov 2005 16:50:19 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EbPjt-0003w6-3f for emacs-devel@gnu.org; Sun, 13 Nov 2005 16:50:17 -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 1EbPjs-0000Uy-Li for emacs-devel@gnu.org; Sun, 13 Nov 2005 16:50:16 -0500 Original-Received: from pppoe3-ves.broadcom.dk ([212.99.255.42] helo=[10.17.1.239]) by odin.broadcom.dk with esmtp (Exim 4.24; FreeBSD) id 1EbPc0-000Ff5-Es; Sun, 13 Nov 2005 22:42:09 +0100 User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en Original-To: Chong Yidong In-Reply-To: <874q6hlqzc.fsf@stupidchicken.com> 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:45903 Archived-At: Chong Yidong wrote: >The reason is convenience. This allows you to enter a new filename >without having to erase the default offered in the minibuffer. (A >similar example: /tmp/~/foo goes to ~/foo). I use this feature all >the time. > > To me this feature seems as a rather awkward work-around the lack of a general way to handle start values in the minibuffer. I believe a good handling should allow the user to easily use the start value in any of these ways: 1. As a default value. 2. As a template. 3. Not at all. 1. If the user just hits return, the start value should be used as a default value. 2. If something similar to the start value is needed, it should be possible the edit it. This is convenient in eg. a rename command if the old name is inserted as the start value. 3. If one don't want to use the start value, it is annoying to have to delete it. In this case it should possible to simply type what one wants instead. For those of you that use pc-selection-mode, I believe there is a natural way to fulfill these requirements. Just try this: (add-hook 'minibuffer-setup-hook 'select-minibuffer-contents) (defun select-minibuffer-contents () "Select minibuffer contents." (set-mark (point-max)) (goto-char (minibuffer-prompt-end))) (defadvice next-history-element (after select-minibuffer-contents activate) "Select minibuffer contents." (set-mark (point-max)) (goto-char (minibuffer-prompt-end)) (setq deactivate-mark nil))