summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-01-04 00:10:30 +0000
committerRichard M. Stallman <rms@gnu.org>1997-01-04 00:10:30 +0000
commit84d3f6e87870ed7eb646658a2d963675900d6bad (patch)
treea5e2ff668a2b0b66d7aa31acda707b6699b876e7
parentf374777d3c5c33b3c19f4c8f8505e09dee2ccc09 (diff)
downloademacs-84d3f6e87870ed7eb646658a2d963675900d6bad.tar.gz
(dired-garbage-files-regexp): New variable.
(dired-flag-garbage-files): New command. (dired-mode-map): Put dired-flag-garbage-files on & and in menu.
-rw-r--r--lisp/dired.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 34526f4490b..ffb6bd22831 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -769,6 +769,7 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
(define-key map "#" 'dired-flag-auto-save-files)
(define-key map "." 'dired-clean-directory)
(define-key map "~" 'dired-flag-backup-files)
+ (define-key map "&" 'dired-flag-garbage-files)
;; Upper case keys (except !) for operating on the marked files
(define-key map "A" 'dired-do-search)
(define-key map "C" 'dired-do-copy)
@@ -958,6 +959,8 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
'("Mark Old Backups" . dired-clean-directory))
(define-key map [menu-bar mark executables]
'("Mark Executables" . dired-mark-executables))
+ (define-key map [menu-bar mark garbage-files]
+ '("Flag Garbage Files" . dired-flag-garbage-files))
(define-key map [menu-bar mark backup-files]
'("Flag Backup Files" . dired-flag-backup-files))
(define-key map [menu-bar mark auto-save-files]
@@ -2068,6 +2071,15 @@ A prefix argument says to unflag those files instead."
(file-name-nondirectory fn)))))
"auto save file")))
+(defvar dired-garbage-files-regexp
+ "\\.log$\\|\\.toc$\\|.dvi$|\\.bak$\\|\\.orig$\\|\\.rej$"
+ "*Regular expression to match \"garbage\" files for `dired-flag-garbage-files'.")
+
+(defun dired-flag-garbage-files ()
+ (interactive)
+ "Flag for deletion all files that match `dired-garbage-files-regexp'."
+ (dired-flag-files-regexp dired-garbage-files-regexp))
+
(defun dired-flag-backup-files (&optional unflag-p)
"Flag all backup files (names ending with `~') for deletion.
With prefix argument, unflag these files."