&key :modes :modeline-fields :delete-hook ¶make-buffer creates and returns a buffer with the given name. If a
buffer named name already exists, nil is returned. Modes is a list of
modes which should be in effect in the buffer, major mode first, followed by
any minor modes. If this is omitted then the buffer is created with the list
of modes contained in Default Modes. Modeline-fields is a list
of modeline-field objects (see section modelines) which may be nil.
delete-hook is a list of delete hooks specific to this buffer, and
delete-buffer invokes these along with Delete Buffer Hook.
Buffers created with make-buffer are entered into the list
buffer-list, and their names are inserted into the
string-table buffer-names. When a buffer is created the hook
Make Buffer Hook is invoked with the new buffer.
Returns t if buffer is a buffer object, otherwise nil.
buffer-name returns the name, which is a string, of the given buffer.
The corresponding setf method invokes Buffer Name Hook with
buffer and the new name and then sets the buffer’s name. When the user
supplies a name for which a buffer already exists, the setf method signals
an error.
Returns the buffer’s region. This can be set with setf. Note, this
returns the region that contains all the text in a buffer, not the
current-region.
buffer-pathname returns the pathname of the file associated with
the given buffer, or nil if it has no associated file. This is
the truename of the file as of the most recent time it was read or
written. There is a setf form to change the pathname. When the
pathname is changed the hook Buffer Pathname Hook is invoked
with the buffer and new value.
Returns the write date for the file associated with the buffer in universal
time format. When this the buffer-pathname is set, use setf to set
this to the corresponding write date, or to nil if the date is unknown or
there is no file.
Returns the mark which is the current location within buffer. To
move the point, use move-mark or move-to-position rather
than setting buffer-point with setf.
This function returns the top of buffer’s mark stack. There always is at least one mark at the beginning of buffer’s region, and all marks returned are right-inserting.
These functions return the start and end marks of buffer’s region:
(buffer-start-mark buffer) <==> (region-start (buffer-region buffer)) and (buffer-end-mark buffer) <==> (region-end (buffer-region buffer))
This function returns t if you can modify the buffer, nil if you
cannot. If a buffer is not writable, then any attempt to alter text in the
buffer results in an error. There is a setf method to change this value.
The setf method invokes the functions in Buffer Writable Hook on the
buffer and new value before storing the new value.
buffer-modified returns t if the buffer has been modified, nil if
it hasn’t. This attribute is set whenever a text-altering operation is
performed on a buffer. There is a setf method to change this value.
The setf method invokes the functions in Buffer Modified Hook with
the buffer whenever the value of the modified flag changes.
&rest forms ¶This macro executes forms with buffer’s writable status set. After forms execute, this resets the buffer’s writable and modified status.
This function returns an arbitrary number which reflects the buffer’s current
signature. The result is eql to a previous result if and only if the
buffer has not been modified between the calls.
This function returns a string-table (page string-tables) containing the names of the buffer’s local variables. See chapter variables.
This function returns the list of the names of the modes active in buffer. The major mode is first, followed by any minor modes. See chapter modes.
This function returns the list of all the windows in which the buffer may be displayed. This list may include windows which are not currently visible. See page windows for a discussion of windows.
This function returns the list of buffer specific functions delete-buffer
invokes when deleting a buffer. This is setf’able.
delete-buffer removes buffer from buffer-list and its name
from buffer-names. Before buffer is deleted, this invokes the
functions on buffer returned by buffer-delete-hook and those found in
Delete Buffer Hook. If buffer is the current-buffer, or if it is
displayed in any windows, then this function signals an error.
This uses delete-buffer to delete buffer if at all possible. If
buffer is the current-buffer, then this sets the current-buffer to
the first distinct buffer in buffer-history. If buffer is displayed in
any windows, then this makes each window display the same distinct buffer.