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

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

Re: check if these is a buffer to a file


From: Kiwon Um
Subject: Re: check if these is a buffer to a file
Date: Sun, 15 Feb 2009 20:07:30 -0800 (PST)
User-agent: G2/1.0

On 2월16일, 오후12시50분, Andy Stewart <lazycat.mana...@gmail.com> wrote:
> Hi,
>
> Kiwon Um <um.ki...@gmail.com> 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"))


reply via email to

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