From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kiwon Um Newsgroups: gmane.emacs.help Subject: Re: check if these is a buffer to a file Date: Sun, 15 Feb 2009 20:07:30 -0800 (PST) Organization: http://groups.google.com Message-ID: <24a61358-e3f8-4c84-bc72-f993ef5353a7@q40g2000prh.googlegroups.com> References: <6f0927c0-d5f3-42ab-b233-662207f2ed5e@x29g2000prf.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=EUC-KR Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1234759243 12935 80.91.229.12 (16 Feb 2009 04:40:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Feb 2009 04:40:43 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 16 05:41:58 2009 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 1LYvIs-0002tN-DW for geh-help-gnu-emacs@m.gmane.org; Mon, 16 Feb 2009 05:41:58 +0100 Original-Received: from localhost ([127.0.0.1]:49070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LYvHY-0006El-HD for geh-help-gnu-emacs@m.gmane.org; Sun, 15 Feb 2009 23:40:36 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!postnews.google.com!q40g2000prh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 27 Original-NNTP-Posting-Host: 163.152.71.53 Original-X-Trace: posting.google.com 1234757250 3685 127.0.0.1 (16 Feb 2009 04:07:30 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 16 Feb 2009 04:07:30 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q40g2000prh.googlegroups.com; posting-host=163.152.71.53; posting-account=6v9_LQoAAACIrmHTUxB_-iw-j364OtYr User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009012700 SUSE/3.0.6-0.1 Firefox/3.0.6,gzip(gfe),gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166831 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:62139 Archived-At: On 2=BF=F916=C0=CF, =BF=C0=C8=C412=BD=C350=BA=D0, Andy Stewart wrote: > Hi, > > Kiwon Um writes: > > Hello. I'm now writing some lisp codes. > > > I want to write some codes that kill a buffer if it is already opened > > (visited). > > Is there any predefined function to check the existence of a buffer? > > Try to use function `get-buffer'. > Below is document of function `get-buffer': > > ,---- > | (get-buffer BUFFER-OR-NAME) > | > | Return the buffer named BUFFER-OR-NAME. > | BUFFER-OR-NAME must be either a string or a buffer. If BUFFER-OR-NAME > | is a string and there is no buffer with that name, return nil. If > | BUFFER-OR-NAME is a buffer, return it as given. > `---- > > -- Andy Thanks, it works well. :) (if (get-buffer "SOMETHING") (kill-buffer "SOMETHING"))