[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dired-kill-tree

From: Luc Teirlinck
Subject: Re: dired-kill-tree
Date: Sun, 6 Jun 2004 16:42:30 -0500 (CDT)

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))


  (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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]