Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!phoenix!eliot From: eliot@phoenix.Princeton.EDU (Eliot Handelman) Newsgroups: gnu.emacs Subject: Re: Buffer stuff Message-ID: <9034@phoenix.Princeton.EDU> Date: 17 Jun 89 22:08:02 GMT References: <10067@polya.Stanford.EDU> Reply-To: eliot@phoenix.Princeton.EDU (Eliot Handelman) Organization: Princeton University, NJ Lines: 30 In article <10067@polya.Stanford.EDU> dkeisen@Gang-of-Four.Stanford.EDU (Dave Eisen) writes: >Also, is there some way to modify the switch-to-buffer command so the >default is to run through the buffer list rather than to choose the >most recently used buffer? Here's a little function that I use for selecting lisp buffers without having to type in names. If you want to go through the list looking for something else, just modify the regexp. No doubt there are elisp hackers out there who could improve on this. (defun switch-to-lisp-buffer () "Offers to switch to any lisp buffers that are already opened." (interactive) (let ((buffers (cdr (buffer-list))) (selected nil)) (while (and buffers (not selected)) (let ((buff (buffer-name (car buffers)))) (if (string-match ".lsp$" buff) (if (y-or-n-p (format "Switch to %s? " buff)) (setq selected (car buffers)))) (setq buffers (cdr buffers)))) (cond (selected (switch-to-buffer selected) (message "")) (t (beep) (message "No more Lisp buffers")))))