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


5.9 Buffer

And when you gaze long into an abyss the abyss also gazes into you.

Beyond Good and Evil, Friedrich Nietzsche

A buffer in Emacs represents text, including its mode, local variables, etc. A Emacsy buffer is not necessarily text. It can be extended to hold whatever the host application is interested in. Emacs’ concepts of buffer, window, and mode are directly analogous to the model, view, and controller respectively—the MVC pattern.

Macro: with-buffer

A convenience macro to work with a given buffer.

Macro: save-excursion

A convenience macro to do some work

Class: <buffer>
Variable: before-buffer-change-hook
Variable: after-buffer-change-hook
Variable: buffer-stack
Variable: last-buffer
Variable: aux-buffer
Scheme Procedure: buffer-name

Buffer’s have a name, and there is always a current buffer or it’s false. Note that methods do not work as easily with optional arguments. It seems best to define each method with a different number of arguments as shown below.

Scheme Procedure: buffer-name (buffer <buffer>)
Scheme Procedure: set-buffer-name! name
Scheme Procedure: set-buffer-name! name (buffer <buffer>)
Scheme Procedure: buffer-modified?
Scheme Procedure: buffer-modified-tick
Scheme Procedure: write (obj <buffer>) port
Scheme Procedure: current-local-map
Scheme Procedure: use-local-map keymap
Scheme Procedure: buffer-list
Scheme Procedure: current-buffer
Scheme Procedure: add-buffer! buffer
Scheme Procedure: remove-buffer! buffer
Interactive Procedure: next-buffer #:optional (incr 1)
Interactive Procedure: prev-buffer #:optional (incr 1)
Scheme Procedure: set-buffer! buffer

This is scary, we will override it when we have <text-buffer>.

Scheme Procedure: other-buffer! #:optional (incr 1)
Variable: switch-to-buffer
Scheme Procedure: local-var-ref symbol
Scheme Procedure: local-var-set! symbol value
Variable: local-var
Scheme Procedure: emacsy-mode-line

method


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