🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #99628

Re: Killing a possibly non existent buffer

#99628
From: Kyle Jones
Date: Wed, 01 Aug 1990 12:13
19 lines
1252 bytes
Frank P. Bresz writes:
 > How can I decide if a buffer exists given it's name.

Call get-buffer with its name.

    get-buffer:
    Return the buffer named NAME (a string).
    It is found by looking up NAME in  buffer-alist.
    If there is no buffer named NAME, nil is returned.
    NAME may also be a buffer; it is returned.

 > I want to do this on several occasions i.e. if a buffer exists
 > go to it otherwise create a new buffer.

In this case use get-buffer-create:

    get-buffer-create:
    Like get-buffer but creates a buffer named NAME and returns
    it if none already exists.
Technical Details
Message-ID: <1990Aug1.121305.2859@talos.pm.com>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zephyr.ens.tek.com!uw-beaver!milton!dali.cs.montana.edu!samsung!zaphod.mps.ohio-state.edu!swrinde!ucsd!pacbell.com!decwrl!apple!rutgers!mcnc!rti!talos!kjones
References: <9007311418.AA05475@ittc>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,4c4f27f8f89c196b
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1990-08-01 05:13:05 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zephyr.ens.tek.com!uw-beaver!milton!dali.cs.montana.edu!samsung!zaphod.mps.ohio-state.edu!swrinde!ucsd!pacbell.com!decwrl!apple!rutgers!mcnc!rti!talos!kjones
From: kjones@talos.pm.com (Kyle Jones)
Newsgroups: gnu.emacs.bug
Subject: Re: Killing a possibly non existent buffer
Message-ID: <1990Aug1.121305.2859@talos.pm.com>
Date: 1 Aug 90 12:13:05 GMT
References: <9007311418.AA05475@ittc>
Lines: 19
Posted: Wed Aug  1 13:13:05 1990