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: delete-file default to buffer-file-name if non-nil Date: Mon, 17 May 2010 07:56:59 -0700 Message-ID: <285B9320BDDE48BABD15E9BF02599CB0@us.oracle.com> References: <56210.128.165.0.81.1273948225.squirrel@webmail.lanl.gov><87vdan5stg.fsf@mail.jurta.org><09068505550E4734B4B3E6F5DCEB8A98@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1274108254 15037 80.91.229.12 (17 May 2010 14:57:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 17 May 2010 14:57:34 +0000 (UTC) Cc: 'Juri Linkov' , deniz.a.m.dogan@gmail.com, rms@gnu.org, emacs-devel@gnu.org To: "'Stefan Monnier'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 17 16:57:32 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OE1l2-0000Zo-0d for ged-emacs-devel@m.gmane.org; Mon, 17 May 2010 16:57:28 +0200 Original-Received: from localhost ([127.0.0.1]:56532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OE1l1-0005Bj-Gc for ged-emacs-devel@m.gmane.org; Mon, 17 May 2010 10:57:27 -0400 Original-Received: from [140.186.70.92] (port=34093 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OE1kr-0005AQ-4p for emacs-devel@gnu.org; Mon, 17 May 2010 10:57:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OE1kq-0006pD-0c for emacs-devel@gnu.org; Mon, 17 May 2010 10:57:17 -0400 Original-Received: from rcsinet10.oracle.com ([148.87.113.121]:19298) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OE1kj-0006oG-Hq; Mon, 17 May 2010 10:57:09 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4HEv5I5004577 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 17 May 2010 14:57:06 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o4HDjmYi023371; Mon, 17 May 2010 14:57:02 GMT Original-Received: from abhmt004.oracle.com by acsmt355.oracle.com with ESMTP id 247021961274108208; Mon, 17 May 2010 07:56:48 -0700 Original-Received: from dradamslap1 (/10.175.222.120) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 May 2010 07:56:47 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: Thread-Index: Acr1yBDxJo383xyvTe25xHw/zge2+gABImYA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-Auth-Type: Internal IP X-Source-IP: rcsinet15.oracle.com [148.87.113.117] X-CT-RefId: str=0001.0A090201.4BF15942.0175:SCFMA4539811,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:124855 Archived-At: > > A better approach is to let the user decide the behavior. > > I have this option (FWIW): > > > > | When the default value argument to functions such as > > | `completing-read', `read-file-name', `read-from-minibuffer', and > > | `read-string' is non-nil and the initial-input argument is nil or > > | "", the default value can be added to the prompt as a hint or > > | inserted into the minibuffer as the initial input. > > IIUC this is not using the initial-contents argument (more to the > point, it's only active if this arg is nil, i.e. if the > caller properly treats it a deprecated). So this is perfectly > compatible with initial-contents's obsolescence. Yes, that option is only about using the default value. But it was the general idea that it can sometimes be useful to put a value into the minibuffer that I was trying to get across. I believe that feature can be useful for the user (hence the default-value option) and in some cases it can be useful for particular commands (using INIT-VALUE). The latter cases are admittedly exceptions - I do not propose using INIT-VALUE often. `delete-file' is a case in point. IMO, if the default file name is put in the minibuffer as init value it is less likely that a user will inadvertently hit RET and end up accidentally deleting the file. You might disagree, but I think that putting the name in the minibuffer draws more attention to it than just putting it in the prompt - particularly if INIT-VALUE is seldom used. It is a good compromise between doing nothing (default in prompt only) and requiring confirmation each time. It gives a little more protection against accident than just mentioning the file in the prompt, but it adds no confirmation delay/annoyance. AFAIK, `delete-file' is not bound to any key by default. Anyone calling it interactively is doing so either via M-x, via a user-defined key, or via some other command that calls it interactively. I expect that requiring confirmation would defeat the aim of quick interaction. Remember too: `delete-file' has been around since Day One with exactly the same user interaction. That's a long time for something "dangerous" to be tolerated. How many people actually use it interactively? Of those, how many have reported problems due to the danger in question? Versus: how many of those interactive users would be annoyed by needing to confirm? I mentioned two suggestions: (1) put file name in minibuffer or (2) require confirmation. I didn't see any other suggestions mentioned. I still think #1 is better overall than #2.