Next: , Previous: Drei Concepts, Up: Drei


18.2 External API

— Class: drei:drei

Class precedence list: drei, standard-object, slot-object, t

Slots:

The abstract Drei class that maintains standard Drei editor state. It should not be directly instantiated, a subclass implementing specific behavior (a Drei variant) should be used instead.

drei Initarg: :editable-p

Whether or not the Drei instance will be editable. If NIL, the buffer will be set to read-only (this also affects programmatic access). The default is T.

drei Initarg: :single-line

If T, the buffer created for the Drei instance will be single line, and a condition of type buffer-single-line will be signalled if an attempt is made to insert a newline character.

— Macro: drei:handling-drei-conditions &body body

Evaluate body while handling Drei user notification signals. The handling consists of displaying their meaning to the user in the minibuffer. This is the macro that ensures conditions such as motion-before-end does not land the user in the debugger.

— Macro: drei:with-bound-drei-special-variables (drei-instance &key current-buffer current-window current-mark current-point current-syntax kill-ring minibuffer command-parser partial-command-parser previous-command prompt) &body body

Evaluate body with a set of Drei special variables (*current-buffer*, *current-window*, *current-mark*, *current-point*, *current-syntax*, *kill-ring*, *minibuffer*, *command-parser*, *partial-command-parser*, *previous-command*, *extended-command-prompt*) bound to their proper values, taken from drei-instance. The keyword arguments can be used to provide forms that will be used to obtain values for the respective special variables, instead of finding their value in drei-instance. This macro binds all of the usual Drei special variables, but also some CLIM special variables needed for ESA-style command parsing.

— Macro: drei:performing-drei-operations (drei &rest args &key with-undo update-syntax redisplay) &body body

Provide various Drei maintenance services around the evaluation of body. This macro provides a convenient way to perform some operations on a Drei, and make sure that they are properly reflected in the undo tree, that the Drei is redisplayed, the syntax updated, etc. Exactly what is done can be controlled via the keyword arguments. Note that if with-undo is false, the *entire* undo history will be cleared after body has been evaluated. This macro expands into a call to invoke-performing-drei-operations.

— Generic Function: drei:invoke-performing-drei-operations drei continuation &key with-undo update-syntax redisplay

Invoke continuation, setting up and performing the operations specified by the keyword arguments for the given Drei instance.

— Macro: drei:accepting-from-user (drei) &body body

Modidfy drei and the environment so that calls to accept can be done to arbitrary streams from within body. Or, at least, make sure the Drei instance will not be a problem. When Drei calls a command, it will be wrapped in this macro, so it should be safe to use accept within Drei commands. This macro expands into a call to invoke-accepting-from-user.

— Generic Function: drei:invoke-accepting-from-user drei continuation

Set up drei and the environment so that calls to accept will behave properly. Then call continuation.

— Generic Function: drei:execute-drei-command drei command

Execute command for drei. This is the standard function for executing Drei commands - it will take care of reporting to the user if a condition is signalled, updating the syntax, setting the previous-command of drei and recording the operations performed by command for undo.