Path: utzoo!attcan!uunet!pyrdc!pyrnj!rutgers!mit-eddie!allegra.UUCP!kautz From: kautz@allegra.UUCP (Henry Kautz) Newsgroups: comp.emacs Subject: popping buffers Message-ID: <8809141850.AA24595@EDDIE.MIT.EDU> Date: 12 Sep 88 20:43:14 GMT Sender: daemon@eddie.MIT.EDU Lines: 31 After some time trying to figure out how to test if a given string is the name of a buffer, I finally hit upon the following. Note that simply using bufferp doesn't work, because bufferp does not accept a buffer name, only a buffer object. (defun buffer-exists-p (b) "return the buffer object if a buffer named B exists, otherwise nil" (condition-case nil (save-excursion (set-buffer b)) (error nil))) Then I wanted to pop-up, but not switch to, a buffer. The best I could devise is (defun pop-up-buffer (b) "pop up buffer B but don't select it" (let ((c (current-buffer))) (pop-to-buffer b) (pop-to-buffer c))) which has a couple of unfortunate features: (1) it messes up the list of recently visited buffers, and (2) it doesn't work if it's called from a function which is temporarily using a non-displayed buffer. Could someone mail me a better way to code this? ---- Henry Kautz :uucp: allegra!kautz :arpa/internet: kautz%allegra.att.com@research.att.com :csnet: kautz%allegra.att.com@RELAY.CS.NET or kautz%allegra@btl.csnet