next up previous

Appendix B Integrated Editor

CLIPS includes a fully integrated version of the full screen MicroEMACS editor. You may call the editor from CLIPS, compile full buffers or just sections of the editor (incremental compile), temporarily exit the editor back to CLIPS, or permanently exit the editor. Since the editor is full screen, portions of it are highly machine dependent. As it is currently set up, the editor will run on VAX VMS machines using VT100 or VT240compatible terminals, UNIX systems which support TERMCAP, the IBM PC, and most IBM compatibles.

The editor may be called from CLIPS with the following command:

(edit ["<file-name>"])

The file name is optional. If one is given, that file would be loaded. If no file name is given, the editor is entered without loading a file. Once in the file, all of the EMACS commands listed below are applicable. To exit the editor and clear all buffers, use <CtrlZ> or <CtrlX><CtrlC>. To temporarily exit the editor and retain the information in the buffers, use <CtrlX> Q. To compile a rules section, mark a region and type <CtrlX><CtrlT>. To compile the entire buffer, use <MetaT>. The editor can use extensive amounts of memory, and a flag is available in clips.h to remove all of the editor code.

When using the editor on multiuser machines like the VAX or many UNIX environments, be careful with the control S and control Q commands; they could conflict with terminal XON/XOFF communications. All control S commands have a work around built into the editor. The save file command, normally <CtrlX><CtrlS>, is also <Meta> Z. The forward search command, normally <CtrlS>, is also <Meta> J. The control Q command is rarely needed in a CLIPS file and, therefore, has no substitute.

Control Commands

<ctrl@> Set mark at current position.

<ctrlA> Move cursor to beginning of line.

<ctrlB> Move cursor BACK one character.

<ctrlC> Start a new interactive command shell. Be careful!

<ctrlD> DELETE character under cursor.

<ctrlE> Move cursor to END of line.

<ctrlF> Move cursor FORWARD one character.

<ctrlG> Abort any command.

<ctrlH> (backspace) delete previous character.

<ctrlI> Insert a TAB.

<ctrlJ> Insert a CRLF and indent next line.

<ctrlK> KILL (delete) to end of line.

<ctrlL> Redisplay screen.

<ctrlM> Insert a CRLF.

<ctrlN> Move cursor to NEXT line.

<ctrlO> OPEN a new line.

<ctrlP> Move to PREVIOUS line.

<ctrlQ> QUOTE the next character (insert the next character typed).

<ctrlR> Reverse SEARCH.

<ctrlS> Forward SEARCH (also <MetaJ>).

<ctrlT> TRANSPOSE characters.

<ctrlU> Enter repeat count for next command.

<ctrlV> VIEW the next screen (scroll up one screen).

<ctrlW> KILL region (all text between cursor and last mark set).

<ctrlX> Extended command prefix see below.

<ctrlY> YANK (undelete) last text killed.

<ctrlZ> Quick save of file in current buffer (only) and exit.

Extended (ControlX) Commands

<ctrlX>( Begin keyboard Macro.

<ctrlX>) End keyboard Macro.

<ctrlX>! Execute a single external command.

<ctrlX>= Show current cursor column and line number.

<ctrlX>: Go to a specific line number.

<ctrlX>1 Display current window only.

<ctrlX>2 Split the current window.

<ctrlX>B Switch to a different BUFFER.

<ctrlX>E EXECUTE keyboard Macro.

<ctrlX>F Set FILL column.

<ctrlX>K KILL a buffer (other than current buffer).

<ctrlX>M MATCH parenthesis (or {} or []).

<ctrlX>N Move to NEXT window.

<ctrlX>P Move to PREVIOUS window.

<ctrlX>R Global search and REPLACE (backwards).

<ctrlX>S Global SEARCH and replace (forwards).

<ctrlX>Z Enlarge current window by repeat count <ctrlU> lines.

<ctrlX><ctrlB> Show active BUFFERS.

<ctrlX><ctrlC> Exit without saving buffers.

<ctrlX><ctrlF> FIND file. Load if not already in buffer.

<ctrlX><ctrlN> Scroll current window up by repeat count lines.

<ctrlX><ctrlP> Scroll current window down by repeat count lines.

<ctrlX><ctrlR> RENAME file. Change file name for buffer.

<ctrlX><ctrlS> SAVE (write) current buffer into its file.

<ctrlX><ctrlV> VISIT a file. Read file and display in current window.

<ctrlX><ctrlW> WRITE buffer to file. Option to change name of file.

<ctrlX><ctrlZ> Reduce current window by repeat count lines.

Special characters

<del> Delete previous character.

(also <ctrlH> on some terminals)

<esc> Meta command prefix.

(also <ctrl[> on some terminals)

Meta Commands (Activated by <esc> or <ctrl[>)

<meta>! Move current line to repeat count lines from top of window.

<meta>> Move cursor to end of buffer.

<meta>< Move cursor to beginning of buffer.

<meta>. Set mark.

<meta>B Move cursor BACK one word.

<meta>C CAPITALIZE first letter of word.

<meta>D DELETE next word.

<meta>F Move cursor FORWARD one word.

<meta>J SEARCH forward (same as <ctrlS>).

<meta>L LOWERCASE (lowercase) next word.

<meta>R Query search and REPLACE (backwards).

<meta>S Query SEARCH and replace (forwards).

<meta>U UPPERCASE (uppercase) next word.

<meta>V VIEW the previous screen (scroll down one screen).

<meta>W COPY region into kill buffer.

<meta>Z SAVE current buffer into file (same as <ctrlX><ctrlS>).

<meta><del> DELETE previous word.




next up previous