The Emacs Programming Environment


This chapter gives the standard A+ key settings and a brief summary of some Emacs functions. See an Emacs manual for more advanced Emacs functions. "The Window Manager", in "User Interactions with Displays" is also relevant to Emacs, and so is "Invoking A+".

Key Press Notation

C-x
Hold down Control, then press x.

C-x C-b
Hold down Control, then press and release x, then press b.

C-x k
Hold down Control, then press x, then release both, then press k.

Emacs Key Functions

Key SequenceFunction
BackspaceDelete the previous character.
C-/  or  UndoUndo. Used immediately after entry of an A+ expression, removes its output.
C-aMove the cursor to the beginning of the line.
C-dDelete character. Also see Delete.
C-eMove the cursor to the end of the line.
C-gCancel the partial entry in the minibuffer.
C-hHelp.
C-kKill line: delete line or part thereof and put it in the kill ring. See C-y.
C-rIncremental search backward.
C-sIncremental search forward.
C-x  C-bList information about all current buffers.
C-x  C-fGoto file: get the file (named in minibuffer) in a new buffer.
C-x  C-sSave the buffer in the file named on the status line (usually where it originally came from).
C-x  C-wSave the buffer in the file whose name is entered in the minibuffer (command line).
C-x  kKill (delete) the buffer.
C-yYank: insert the last entry of the kill ring. See C-k.
DeleteThe default is to delete the previous character (sigh), but it can be set to the command delete-char using global-set-key.
R1  or  F5Show one window in the screen.
R2  or  F6Show two windows in screen; if there are two, move the cursor to the other window.
R3(No function set.)
R4  or  F7Next buffer (cycle through buffers).
R5  or  F8Previous buffer (toggle buffers).
R6Go to (enter line number in minibuffer).
R7Top: the first line of the buffer to the top of the window.
R8  or  F11Move the cursor up one line.
R9Scroll up to earlier lines, with a two-line overlap.
R10Move the cursor backward one character.
R11Center the line with the cursor in the window.
R12Move the cursor forward one character.
R13End: move the cursor to the end of the buffer.
R14  or  F12Move the cursor down one line.
R15Scroll down to later lines, with a two-line overlap.

Emacs A+ Mode Key Functions

Key SequenceFunction
C-c  C-bLoad buffer. Like loading a script file, but without the need to save the buffer.
C-c  C-cInterrupt the A+ process. (From a shell, not Emacs, A+ is interrupted by a single C-c.)
C-c  C-kKill (terminate) the A+ process. If this doesn't work, try kill -9 pid in an XTerm.
C-c  C-m  or  C-c  EnterGet the previous input line.
C-c  C-oKill (flush) the last output, and append "γγγ output flushed γγγ" to the input that elicited it.
C-c  C-pGo to the last input line.
C-c  C-qQuit the A+ process.
C-c  C-sMove the beginning of the last output to the top of the buffer and place the cursor there.
EnterIf the cursor is on the bottom line, execute that line;  otherwise, send the current line to the bottom, for possible editing and execution.
Ignore leading asterisks and any blanks following them, presuming that they indicate suspension or unbalanced punctuation, and the prompt; not exponentiation, or asterisks and blanks within a quoted character string.
F1Help.
F2Load and execute line (in the A+ log, like Enter Enter).
In the log, but not in a script, ignore leading asterisks and any blanks following them, presuming that they indicate suspension or unbalanced punctuation, and the prompt; not exponentiation, or asterisks and blanks within a quoted character string.
F3Load the program (function or operator) in which the cursor appears, in a script or the log.   Caution: The program is read exactly as it appears, including any asterisks indicating continuation in an A+ session log, which will not be interpreted as such.

For F3, the buffer must be in a-mode. To set it, enter   Esc-x  a-major-mode.

F4Go to the buffer named "*a*" if it exists, or create one, and start up A+ if that buffer has no process. The release can be set in Emacs by Control-c a, as described at the beginning of "Invoking A+".
F5Show one window in the screen, the one the cursor is currently in.
F6Move to the other window in the screen, creating it if it doesn't already exist.
F7Next buffer (cycle through buffers).
F8Previous buffer (toggle buffers).
F9Enlarge the window.
F10Shrink the window.
F11Scroll down to later lines, with a two-line overlap.
F12Scroll up to earlier lines, with a two-line overlap.

The Meaning and Default Values of Emacs Lisp Variables

VariableMeaningDefault Value
a-hostThe name of the host machine on which to run A+. nil
a-logThe name of the log file for A+ sessions. "~/.emacs_a"
a-mbytesThe starting workspace size in megabytes.4
a-mbytes- thresholdThe largest a-mbytes value to be honored without a question.16
a-plus-rest Additional argv elements, to go after the -w parameter.  
a-prog The name of the A+ program (release) to run; see "Invoking A+", regarding the form that A+ release names take. "/usr/local/bin/a+"

To see or set the A+ mode (a-mode) Emacs variables, press Esc x when in Emacs, and enter a-options in the minibuffer following the M-x prompt. A new buffer will appear, containing a three-line paragraph for each variable and empty comment lines (two semicolons, followed by blanks) in between. "Key Definitions in a-Options Buffer" shows special key definitions in this buffer. When done, the buffer need not be saved; simply press Control-x k.

Key Definitions in a-Options Buffer

KeyDefinition
or  spaceMove to the next variable definition.
pMove to the previous variable definition.
sWhen the active line contains a variable value, move the active line to the command line (minibuffer) and prompt for a new value. Note that the quotes must be included in character values.
xToggle the value of the variable between the boolean values t and nil.
1Set the variable to boolean value t.
0Set the variable to nil.


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.