From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: dired-kill-tree Date: Sun, 6 Jun 2004 16:19:03 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200406062119.i56LJ3E01005@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1086556862 24693 80.91.224.253 (6 Jun 2004 21:21:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 6 Jun 2004 21:21:02 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Jun 06 23:20:37 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BX54F-0006vL-00 for ; Sun, 06 Jun 2004 23:20:35 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BX54F-0008Sv-00 for ; Sun, 06 Jun 2004 23:20:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BX54k-0003Qc-BB for emacs-devel@quimby.gnus.org; Sun, 06 Jun 2004 17:21:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BX54c-0003QN-Po for emacs-devel@gnu.org; Sun, 06 Jun 2004 17:20:58 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BX54b-0003QB-C1 for emacs-devel@gnu.org; Sun, 06 Jun 2004 17:20:58 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BX54b-0003Q8-7z for emacs-devel@gnu.org; Sun, 06 Jun 2004 17:20:57 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BX53s-0007x2-Uf for emacs-devel@gnu.org; Sun, 06 Jun 2004 17:20:13 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id i56LKCuE022396 for ; Sun, 6 Jun 2004 16:20:12 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i56LJ3E01005; Sun, 6 Jun 2004 16:19:03 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24620 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24620 The docstring of `dired-kill-tree' says: "Kill all proper subdirs of DIRNAME, excluding DIRNAME itself. But you have to understand that this assumes that DIRNAME is a directory name and not a directory file name. Otherwise, DIRNAME _is_ killed. Anybody having taken any look at the Dired Elisp code will probably have no trouble guessing this implicit assumption. But `dired-kill-tree' can be used interactively and the implicit assumption may not be obvious to most interactive users. Actually, I myself find it more often useful _in interactive usage_ to _deliberately_ pass a directory file name to kill the entire tree including DIRNAME. This saves me a step, because I nearly invariably _want_ to kill DIRNAME itself. So what about turning this bug officially into a feature, with the following change in the docstring: ===File ~/dired-aux-diff==================================== *** dired-aux.el 05 Jun 2004 21:07:07 -0500 1.119 --- dired-aux.el 06 Jun 2004 15:52:23 -0500 *************** *** 1834,1839 **** --- 1834,1844 ---- (defun dired-kill-tree (dirname &optional remember-marks) "Kill all proper subdirs of DIRNAME, excluding DIRNAME itself. + Note that DIRNAME itself is _only_ excluded if it is a directory name, + which on most systems means that it ends with a slash. If DIRNAME is + a directory file name, which on most systems means that it does not end + with a slash, then DIRNAME is killed too. The latter is sometimes useful + in interactive usage, when DIRNAME is itself a subdirectory. With optional arg REMEMBER-MARKS, return an alist of marked files." (interactive "DKill tree below directory: ") (setq dirname (expand-file-name dirname)) ============================================================