home *** CD-ROM | disk | FTP | other *** search
- Nntp-Posting-Host: alaska.et.byu.edu
- Lines: 26
- Path: sparky!uunet!elroy.jpl.nasa.gov!usc!sol.ctr.columbia.edu!eff!news.byu.edu!news
- Message-ID: <!3@byu.edu>
- Date: Tue, 18 Aug 92 10:05:57 MDT
- From: gritton@alaska.et.byu.edu (Jamie Gritton)
- Organization: Brigham Young University, Provo UT USA
- Newsgroups: gnu.emacs.help
- Subject: Re: delete-all-buffers?
- Reply-To: gritton@byu.edu
- References: <1992Aug18.141726.4044@bernina.ethz.ch>
-
- hetrick@amazonas.ips.id.ethz.ch ( Jim Hetrick) writes:
-
- > I often find myself at the end of some editting session doing
- > C-x k, C-x k, C-x k, C-x k,... until I just have *scratch* left.
- > Is there a command to do this or a short elisp script?
-
- Here's what I use. The code comes from the save-buffers-kill-emacs
- function with the unneeded parts removed. Its handy that the C-x C-k
- was previously unbound, because it's similar the the C-x k to kill a
- single buffer.
-
- (define-key ctl-x-map "\C-k" 'kill-buffers)
-
- (defun kill-buffers ()
- "Kill all buffers, asking permission on unmodified ones."
- (interactive)
- (let ((list (buffer-list)))
- (while list
- (let* ((buffer (car list))
- (name (buffer-name buffer)))
- (and (not (string-equal name ""))
- (kill-buffer buffer)))
- (setq list (cdr list))))
- (cd "~"))
- --
- James Gritton - gritton@byu.edu - I disclaim
-