Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!oliveb!intelca!mipos3!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.emacs Subject: Re: popping buffers Message-ID: <2883@mipos3.intel.com> Date: 15 Sep 88 16:03:26 GMT References: <8809141917.AA25173@EDDIE.MIT.EDU> Sender: news@mipos3.intel.com Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 43 In-reply-to: kautz@allegra.UUCP (Henry Kautz) In article <8809141917.AA25173@EDDIE.MIT.EDU>, kautz@allegra (Henry Kautz) writes: | 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))) How about (defun buffer-exists-p (b) (and (get-buffer b) t)) [if you don't need a 't' return, just (fset 'buffer-exists-p 'get-buffer) is enough] | 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))) How about (defun pop-up-buffer (b) (display-buffer b t)) From my experience, I have found that GNU Emacs has *most* of what you want already included... it just takes a little horsin' around to find it. I'm waiting for the EMACS-Lisp manual... I hope it helps. -- Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 on contract to BiiN Technical Information Services (for now :-), in a former Intel building in Hillsboro, Oregon, USA or ...!tektronix!inteloa[!intelob]!merlyn Standard disclaimer: I *am* my employer!