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: Re: dired-kill-tree Date: Sun, 6 Jun 2004 16:42:30 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200406062142.i56LgUd01062@raven.dms.auburn.edu> References: <200406062119.i56LJ3E01005@raven.dms.auburn.edu> <20040606212706.GA10671@fencepost> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1086558245 27386 80.91.224.253 (6 Jun 2004 21:44:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 6 Jun 2004 21:44:05 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun Jun 06 23:44:00 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 1BX5Qu-000864-00 for ; Sun, 06 Jun 2004 23:44:00 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BX5Qu-0000GK-00 for ; Sun, 06 Jun 2004 23:44:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BX5RP-0000Wq-Nx for emacs-devel@quimby.gnus.org; Sun, 06 Jun 2004 17:44:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BX5RM-0000Wk-Pd for emacs-devel@gnu.org; Sun, 06 Jun 2004 17:44:28 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BX5RL-0000WW-9q for emacs-devel@gnu.org; Sun, 06 Jun 2004 17:44:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BX5RL-0000WT-5z for emacs-devel@gnu.org; Sun, 06 Jun 2004 17:44:27 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BX5QZ-0002ek-Qc; Sun, 06 Jun 2004 17:43:40 -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 i56LhduE022493; Sun, 6 Jun 2004 16:43:39 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id i56LgUd01062; Sun, 6 Jun 2004 16:42:30 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: miles@gnu.org In-reply-to: <20040606212706.GA10671@fencepost> (message from Miles Bader on Sun, 6 Jun 2004 17:27:06 -0400) 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:24622 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24622 Miles Bader wrote: On Sun, Jun 06, 2004 at 04:19:03PM -0500, Luc Teirlinck wrote: > 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. Is there a (reasonable) reason for this rather odd behavior? Tecnically because: (setq dirname (expand-file-name dirname)) and later: (if (and (not (string-equal dir dirname)) (then we do _not_ delete DIR). DIR is a directory name. If DIRNAME is not, then DIR and DIRNAME are not string-equal. This bug can trivially be fixed by changing: (setq dirname (expand-file-name dirname)) into: (setq dirname (file-name-as-directory (expand-file-name dirname))) That would be an obvious alternative patch. (Leaving the docstring unchanged.) Somehow, the buggy behavior turns out (at least in my usage) to be useful interactively. Sincerely, Luc.