Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!hcx1!hcx2!tom From: tom@hcx2.SSD.HARRIS.COM Newsgroups: comp.emacs Subject: Re: looking for feature Message-ID: <94600021@hcx2> Date: 30 Mar 89 11:55:00 GMT References: <89@ Lines: 172 Nf-ID: #R:= buffer-select-list-index (length buffer-select-local-list)) (setq buffer-select-list-index 0) ) (insert (buffer-name (nth buffer-select-list-index buffer-select-local-list))) ) (defun buffer-select-prev () "Move to the previous buffer on the buffer-list." (interactive) (erase-buffer) (setq buffer-select-list-index (1- buffer-select-list-index)) (if (< buffer-select-list-index 0) (setq buffer-select-list-index (1- (length buffer-select-local-list))) ) (insert (buffer-name (nth buffer-select-list-index buffer-select-local-list))) ) (defun buffer-select-killit () "Kill the buffer currently appearing in the minibuffer, then move to the next buffer on the buffer-list." (interactive) (let ( (mbuf (current-buffer)) ;; Save the minibuffer because ;; kill-buffer selects a buffer (kbuf (nth buffer-select-list-index buffer-select-local-list)) ) (message "Killing buffer %s." (buffer-name kbuf)) (kill-buffer kbuf) (set-buffer mbuf) ) ;; Rebuild the buffer list, so that the killed buffer doesn't appear ;; in it. Under certain circumstances, the buffer might not have ;; gone away, such as killing "*scratch*" when it is the last buffer. (setq buffer-select-local-list (make-buffer-list (buffer-list))) ;; Fix buffer-select-list-index, in case it went off the end of ;; the list (in either direction, just to be absolutely safe). (if (< buffer-select-list-index 0) (setq buffer-select-list-index (1- (length buffer-select-local-list))) ) (if (>= buffer-select-list-index (length buffer-select-local-list)) (setq buffer-select-list-index 0) ) (erase-buffer) (insert (buffer-name (nth buffer-select-list-index buffer-select-local-list))) ) ----------------------cut here---------------------------------------------- ===================================================================== usenet: tahorsley@ssd.harris.com USMail: Tom Horsley compuserve: 76505,364 511 Kingbird Circle genie: T.HORSLEY Delray Beach, FL 33444 ======================== Aging: Just say no! ========================