home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!usc!elroy.jpl.nasa.gov!news.claremont.edu!ucivax!megatek!hollen
- From: hollen@megatek.UUCP (Dion Hollenbeck)
- Newsgroups: gnu.emacs.help
- Subject: Re: delete-all-buffers?
- Message-ID: <HOLLEN.92Aug18120152@peg.megatek.UUCP>
- Date: 18 Aug 92 20:01:52 GMT
- References: <1992Aug18.141726.4044@bernina.ethz.ch>
- Sender: hollen@megatek.uucp (Dion Hollenbeck)
- Organization: Megatek Corporation, San Diego, California
- Lines: 53
- In-Reply-To: hetrick@amazonas.ips.id.ethz.ch's message of Tue, 18 Aug 1992 14: 17:26 GMT
-
- >>>>> On Tue, 18 Aug 1992 14:17:26 GMT, hetrick@amazonas.ips.id.ethz.ch ( Jim Hetrick) said:
-
- Jim> I often find myself at the end of some editting session doing
- Jim> C-x k, C-x k, C-x k, C-x k,... until I just have *scratch* left.
- Jim> Is there a command to do this or a short elisp script? I'm just
- Jim> beginning to begin to learn lisp so an example of such would be
- Jim> nice to see.
-
- First, there is really no reason to need to kill all buffers. Just
- C-x C-c and if you have no buffers which need saving, you are exited.
-
- However, if you insist on killing all buffers, then I wrote the
- following code to clean up after doing massive tags searches.
-
-
- ;;
- ;; 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)
-
- ;; Change C-x C-b to be buffer-menu
- (define-key ctl-x-map "\C-b" 'buffer-menu)
-
- ;; 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)
- )
- )
-
-
- This will mark all buffers for deletion and then you type "x" which
- will delete all the buffers. Hope this is helpful.
-
- --
- Dion Hollenbeck UUCP: {uunet, ucsd, sun}!megatek!hollen
- INTERNET: hollen@megatek.com
- Megatek Corporation 9645 Scranton Rd. San Diego, Ca. 92121
-