help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

check to see if a buffer with a certain name exists?


From: Matt Price
Subject: check to see if a buffer with a certain name exists?
Date: Thu, 13 Nov 2008 10:39:35 -0500

hi folks,

first thanks to everyone who's answered my question about mail, i'm
going to be back to that in a second.  

but in the meantime:  i want to be able to check if there's a buffer
open named *Mutt* .  what's the best way to do this?  in python, for
instance, i would just say:


if "*Mutt*" in buffer-list :
        return true
else :
        return false

in lisp i'm not seeing a quick way to test for something like this.
best i can see right now is to use dolist thus:

(dolist (name (buffer-list) foundit)
  (let ((foundit 0))
    (if (string-match "*scratch*" name)
    (setq foundit 1))
)
)

which isn't quite right, i have a variabletype mismatch.  i'd love some
help -- still having trouble navigating the documentation... thanks
again,
matt




-- 
Matt Price
matt.price@utoronto.ca




reply via email to

[Prev in Thread] Current Thread [Next in Thread]