changeset 16825:9ec806f8bbb7

(dired-garbage-files-regexp): New variable. (dired-flag-garbage-files): New command. (dired-mode-map): Put dired-flag-garbage-files on & and in menu.
author Richard M. Stallman <rms@gnu.org>
date Sat, 04 Jan 1997 00:10:30 +0000
parents 2a43d154b32b
children e7ad34b65d8e
files lisp/dired.el
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired.el	Fri Jan 03 23:11:30 1997 +0000
+++ b/lisp/dired.el	Sat Jan 04 00:10:30 1997 +0000
@@ -769,6 +769,7 @@
     (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 @@
       '("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 @@
 		    (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."