Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!ucivax!megatek!hollen From: hollen@megatek (Dion Hollenbeck) Newsgroups: comp.emacs Subject: Re: Dired gadget (+ general suggestion) Message-ID: Date: 19 Nov 90 22:05:45 GMT References: <6967@lifia.imag.fr> <2914@exodus.Eng.Sun.COM> Sender: news@megatek.UUCP Followup-To: comp.emacs Organization: Megatek Corporation, San Diego, California Lines: 45 In-reply-to: rock@warp.Eng.Sun.COM's message of 16 Nov 90 00:17:59 GMT In article <2914@exodus.Eng.Sun.COM> rock@warp.Eng.Sun.COM (Bill Petro) writes: > > On a more specific level, is there a way in dired of deleting a whole > directory, without having to go into the directory and deleting each > file first? Here is some code which I did for buffer list which you should be able to adapt to dired mode. It was created to mark all buffers in the buffer list for deletion. ---------------------------------------------------------------------------- ;; ;; Modifications to buffer-menu-mode ;; ;; Dion Hollenbeck 8/28/90 ;; ;; Add key to buffer menu mode (defun buffer-menu-mode-hook-fun () "Add key mapping for Buffer-menu-mark-all-delete function" (define-key Buffer-menu-mode-map "a" 'Buffer-menu-mark-all-delete) (use-local-map Buffer-menu-mode-map) ) (setq buffer-menu-mode-hook 'buffer-menu-mode-hook-fun) ;; Define additional function for buffer menu mode (defun Buffer-menu-mark-all-delete () "Mark all buffers to be deleted by \\[Buffer-menu-execute] command. Move to the end of the buffer menu." (interactive) (goto-char (point-min)) (while (looking-at " [-M]") (forward-line 1)) (while (looking-at "[ .]") (Buffer-menu-delete) ) ) -- Dion Hollenbeck (619) 455-5590 x2814 Megatek Corporation, 9645 Scranton Road, San Diego, CA 92121 uunet!megatek!hollen or hollen@megatek.uucp