all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* dired-kill-tree
@ 2004-06-06 21:19 Luc Teirlinck
  2004-06-06 21:27 ` dired-kill-tree Miles Bader
  2004-06-07  7:11 ` dired-kill-tree Richard Stallman
  0 siblings, 2 replies; 7+ messages in thread
From: Luc Teirlinck @ 2004-06-06 21:19 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-06-08 23:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-06 21:19 dired-kill-tree Luc Teirlinck
2004-06-06 21:27 ` dired-kill-tree Miles Bader
2004-06-06 21:42   ` dired-kill-tree Luc Teirlinck
2004-06-07  1:08   ` dired-kill-tree Luc Teirlinck
2004-06-07  7:11 ` dired-kill-tree Richard Stallman
2004-06-08  2:39   ` dired-kill-tree Luc Teirlinck
2004-06-08 23:31     ` dired-kill-tree Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.