Next: , Previous: , Up: Buffers   [Contents][Index]


3.1 The Current Buffer

Hemlock Variable: Set Buffer Hook
Hemlock Variable: After Set Buffer Hook
Function: current-buffer

current-buffer returns the current buffer object. Usually this is the buffer that current-window is displaying. This value may be changed with setf, and the setf method invokes Set Buffer Hook before the change occurs with the new value. After the change occurs, the method invokes After Set Buffer Hook with the old value.

Function: current-point

This function returns the buffer-point of the current buffer. This is such a common idiom in commands that it is defined despite its trivial implementation.

Function: current-mark
Function: pop-buffer-mark
Function: push-buffer-mark mark &optional activate-region

current-mark returns the top of the current buffer’s mark stack. There always is at least one mark at the beginning of the buffer’s region, and all marks returned are right-inserting.

pop-buffer-mark pops the current buffer’s mark stack, returning the mark. If the stack becomes empty, this pushes a new mark on the stack pointing to the buffer’s start. This always deactivates the current region (see section active-regions).

push-buffer-mark pushes mark into the current buffer’s mark stack, ensuring that the mark is right-inserting. If mark does not point into the current buffer, this signals an error. Optionally, the current region is made active, but this never deactivates the current region (see section active-regions). Mark is returned.

Variable: *buffer-list*

This variable holds a list of all the buffer objects made with make-buffer.

Variable: *buffer-names*

This variable holds a string-table (page string-tables) of all the names of the buffers in buffer-list. The values of the entries are the corresponding buffer objects.

Variable: *buffer-history*

This is a list of buffer objects ordered from those most recently selected to those selected farthest in the past. When someone makes a buffer, an element of Make Buffer Hook adds this buffer to the end of this list. When someone deletes a buffer, an element of Delete Buffer Hook removes the buffer from this list. Each buffer occurs in this list exactly once, but it never contains the echo-area-buffer.

Function: change-to-buffer buffer

This switches to buffer in the current-window maintaining buffer-history.

Function: previous-buffer

This returns the first buffer from buffer-history that is not the current-buffer. If none can be found, then this returns nil.


Next: Buffer Functions, Previous: Buffers, Up: Buffers   [Contents][Index]