Next: Advice, Previous: Minibuffer, Up: Api [Contents][Index]
Now we’re going to put in place some core functionality that makes Emacsy an Emacs-like library.
We need a global keymap.
Sometimes we may want to track the motion events generated by a mouse. We don’t do this all the time because it seems unnecessarily taxing.
When the minibuffer is entered, we want to clear the echo-area. Because the echo-area is defined in core, it seems best to deal with it in core rather than placing echo-area handling code in minibuffer.
These are most of the C API calls.
There is one command that I consider fundamental for an Emacs-like program. Whenever I’m presented with a program that claims to be Emacs-like, I try this out M-: (+ 1 2). If it doesn’t work then it may have Emacs-like key bindings, but it’s not Emacs-like. That command is [[eval-expression]]. Let’s write it.
The second fundamental command is [[execute-extended-command]] invoked with M-x.
This [[universal-argument]] command is written using a different style than is typical for interative Emacs commands. Most Emacs commands are written with their state, keymaps, and ancillary procedures as public variables. This style has a benefit of allowing one to manipulate or extend some pieces; however, there are some benefits to having everything encapsulated in this command procedure. For instance, if the minibuffer were written in this style, one could invoke recursive minibuffers.
We want to be able to load a scheme file.
The *scratch* buffer.
Override kill-buffer; make sure the buffer list does not become empty.
Next: Advice, Previous: Minibuffer, Up: Api [Contents][Index]