From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.devel Subject: Re: delete-file default to buffer-file-name if non-nil Date: Sun, 16 May 2010 00:10:23 +0200 Message-ID: References: <56210.128.165.0.81.1273948225.squirrel@webmail.lanl.gov> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1273961455 26733 80.91.229.12 (15 May 2010 22:10:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 May 2010 22:10:55 +0000 (UTC) Cc: Emacs-Devel devel To: herring@lanl.gov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 16 00:10:54 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 1ODPZN-0005dh-8N for ged-emacs-devel@m.gmane.org; Sun, 16 May 2010 00:10:53 +0200 Original-Received: from localhost ([127.0.0.1]:47470 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODPZM-0007fm-9Y for ged-emacs-devel@m.gmane.org; Sat, 15 May 2010 18:10:52 -0400 Original-Received: from [140.186.70.92] (port=35880 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ODPZG-0007fg-6v for emacs-devel@gnu.org; Sat, 15 May 2010 18:10:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ODPZE-0007Dq-0N for emacs-devel@gnu.org; Sat, 15 May 2010 18:10:46 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:35765) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ODPZD-0007Dj-QP for emacs-devel@gnu.org; Sat, 15 May 2010 18:10:43 -0400 Original-Received: by wyb40 with SMTP id 40so1317473wyb.0 for ; Sat, 15 May 2010 15:10:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=hChXgedW/ehxi7XBj4vco8TtWG78YHAVDZXIwRoxMxM=; b=YcEbDdv81xX8/H5rBecFetVIuan8LTXgyNhShSMgvV17G1+m+VoLJGxTJMFKGA+w7j J4B93Xu07FyNTMf9FStatz2B9VXLBhBlM0ty2kGshl2/noeicNNxYO4eptAzpQLdvK9g H0r3Z/75r1Fk6A8I+aLXMi/MQJTMzUE6PIgJ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=q0Ulwlz21yZNUt6Fxo5UG8kvCnmirvfcZM6BuLuQI+ktywEssRMbOP9XNhIoteKsg0 5dDao1CgyZskETKKzFr3eLGjGMcnMEah6SVkn+LL6qk1S8XMqrRHjW19cwJImwtpQ+jf TroUatFBgzr5mF6EyEUnaBzG0VGX8Dk03cK68= Original-Received: by 10.216.86.6 with SMTP id v6mr1955578wee.185.1273961443158; Sat, 15 May 2010 15:10:43 -0700 (PDT) Original-Received: by 10.216.67.204 with HTTP; Sat, 15 May 2010 15:10:23 -0700 (PDT) In-Reply-To: <56210.128.165.0.81.1273948225.squirrel@webmail.lanl.gov> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:124816 Archived-At: 2010/5/15 Davis Herring : >> Could we change the behavior of delete-file so that it defaults to >> buffer-file-name if non-nil, otherwise the current directory, if >> called interactively? > > Doesn't it already do that? =A0M-x delete-file RET does attempt to delete > the current buffer's file or its directory if it has no file. =A0Personal= ly, > I find this default sort of dangerous, although at least C-x C-w often > fixes it. > > Davis > It seems you are right. The prompt confused me, as it defaults to the directory which the file is in. So new suggestion... :) Either the prompt displays the file name for the current buffer OR the documentation for delete-file is updated to describe this (in my opinion) non-intuitive behavior. The info node which briefly describes delete-file says the following: `M-x delete-file' deletes the specified file, like the `rm' command in the shell. If you are deleting many files in one directory, it may be more convenient to use Dired rather than `delete-file'. *Note Dired::. What do you say? --=20 Deniz Dogan