From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matt Price Newsgroups: gmane.emacs.help Subject: check to see if a buffer with a certain name exists? Date: Thu, 13 Nov 2008 10:39:35 -0500 Organization: History Department, University of Toronto Message-ID: <1226590775.8767.2137.camel@localhost> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1226594347 5909 80.91.229.12 (13 Nov 2008 16:39:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Nov 2008 16:39:07 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Nov 13 17:40:08 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L0fEe-0004fP-Es for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 17:40:00 +0100 Original-Received: from localhost ([127.0.0.1]:48864 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0fDW-0008Q1-CZ for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Nov 2008 11:38:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0eIG-00058D-K6 for help-gnu-emacs@gnu.org; Thu, 13 Nov 2008 10:39:40 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0eIF-00057B-JA for help-gnu-emacs@gnu.org; Thu, 13 Nov 2008 10:39:40 -0500 Original-Received: from [199.232.76.173] (port=51809 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0eIF-00056n-6y for help-gnu-emacs@gnu.org; Thu, 13 Nov 2008 10:39:39 -0500 Original-Received: from bureau60.ns.utoronto.ca ([128.100.132.147]:48014) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L0eIF-0001lq-3S for help-gnu-emacs@gnu.org; Thu, 13 Nov 2008 10:39:39 -0500 Original-Received: from anarres.mercey.org (CPE001d7e1d5798-CM0014f8cd1c4c.cpe.net.cable.rogers.com [173.32.83.31]) (authenticated bits=0) by bureau60.ns.utoronto.ca (8.13.8/8.13.8) with ESMTP id mADFdaXt001858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 13 Nov 2008 10:39:37 -0500 Original-Received: by anarres.mercey.org (Postfix, from userid 1000) id 455BF120352; Thu, 13 Nov 2008 10:39:36 -0500 (EST) X-Mailer: Evolution 2.24.1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Mailman-Approved-At: Thu, 13 Nov 2008 11:28:18 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:59743 Archived-At: 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