[Top][All Lists]

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

Re: check if these is a buffer to a file

From: Tassilo Horn
Subject: Re: check if these is a buffer to a file
Date: Mon, 16 Feb 2009 09:03:16 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (gnu/linux)

Kiwon Um <address@hidden> writes:


> Hello. I'm now writing some lisp codes.

Have fun.

> 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?

If you find a file twice, the second time no new buffer will be opened
but it'll be switched to the existing one.  So there's no need to write
some elisp code here.

,----[ C-h f find-file RET ]
| find-file is an interactive compiled Lisp function in `files.el'.
| It is bound to <open>, C-x C-f, <menu-bar> <file> <new-file>.
| (find-file filename &optional wildcards)
| Edit file filename.
| Switch to a buffer visiting file filename,
| creating one if none already exists.
| Interactively, the default if you just type RET is the current directory,
| but the visited file name is available through the minibuffer history:
| type M-n to pull it into the minibuffer.
| You can visit files on remote machines by specifying something
| like /ssh:SOME_REMOTE_MACHINE:FILE for the file name.  You can
| also visit local files as a different user by specifying
| /sudo::FILE for the file name.
| See the Info node `(tramp)Filename Syntax' in the Tramp Info
| manual, for more about this.
| Interactively, or if wildcards is non-nil in a call from Lisp,
| expand wildcards (if any) and visit multiple files.  You can
| suppress wildcard expansion by setting `find-file-wildcards' to nil.
| To visit a file without any kind of conversion and without
| automatically choosing a major mode, use M-x find-file-literally.

          "Emacs is not a development tool but a way of life."
                - David Kastrup in alt.religion.emacs -

reply via email to

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