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


5.12 Core

Now we’re going to put in place some core functionality that makes Emacsy an Emacs-like library.

Variable: global-map

We need a global keymap.

Variable: special-event-map
Variable: emacsy-quit-application?
Variable: messages
Variable: emacsy-send-mouse-movement-events?

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.

Scheme Procedure: current-active-maps
Scheme Procedure: universal-argument-ref
Scheme Procedure: universal-argument-pop!
Scheme Procedure: universal-argument-push! arg
Interactive Procedure: switch-to-buffer #:optional buffer
Scheme Procedure: emacsy-echo-area
Scheme Procedure: current-message
Scheme Procedure: emacsy-message . args
Scheme Procedure: clear-echo-area

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.

Scheme Procedure: emacsy-message-or-echo-area

These are most of the C API calls.

Scheme Procedure: emacsy-minibuffer-point
Scheme Procedure: emacsy-run-hook hook . args
Scheme Procedure: emacsy-terminate
Scheme Procedure: emacsy-tick
Scheme Procedure: emacsy-initialize interactive?
Interactive Procedure: eval-expression #:optional epression

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.

Interactive Procedure: execute-extended-command #:optional (n 1)

The second fundamental command is [[execute-extended-command]] invoked with M-x.

Interactive Procedure: quit-application
Interactive Procedure: universal-argument

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.

Interactive Procedure: load-file #:optional file-name

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.

Interactive Procedure: find-file #:optional file-name

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