| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This section describes the two primitives for creating buffers.
get-buffer-create creates a buffer if it finds no existing buffer
with the specified name; generate-new-buffer always creates a new
buffer and gives it a unique name.
Other functions you can use to create buffers include
with-output-to-temp-buffer (see section 38.8 Temporary Displays) and
create-file-buffer (see section 25.1 Visiting Files). Starting a
subprocess can also create a buffer (see section 37. Processes).
An error is signaled if name is not a string.
(get-buffer-create "foo")
=> #<buffer foo>
|
The major mode for the new buffer is set to Fundamental mode. The
variable default-major-mode is handled at a higher level.
See section 23.1.3 How Emacs Chooses a Major Mode.
An error is signaled if name is not a string.
(generate-new-buffer "bar")
=> #<buffer bar>
(generate-new-buffer "bar")
=> #<buffer bar<2>>
(generate-new-buffer "bar")
=> #<buffer bar<3>>
|
The major mode for the new buffer is set to Fundamental mode. The
variable default-major-mode is handled at a higher level.
See section 23.1.3 How Emacs Chooses a Major Mode.
See the related function generate-new-buffer-name in 27.3 Buffer Names.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |