Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!hao!ames!necntc!ncoast!allbery From: nwd@j.cc.purdue.edu (Daniel Lawrence) Newsgroups: comp.sources.misc Subject: MicroEmacs 3.9 Manual (6 of 6) Message-ID: <5819@ncoast.UUCP> Date: Wed, 25-Nov-87 23:18:25 EST Article-I.D.: ncoast.5819 Posted: Wed Nov 25 23:18:25 1987 Date-Received: Mon, 30-Nov-87 01:09:46 EST Sender: allbery@ncoast.UUCP Lines: 1874 Approved: allbery@ncoast.UUCP X-Archive: comp.sources.misc/8711/17 X &SLEss If is less alphabetically than X , return TRUE. X &SGReater If is alphabetically greater than X or equal to , return TRUE. X &FINd Does the named file exist? X X Special Functions: X X &INDirect Evaluate as a variable. X X This last function deserves more explanation. The &IND X function evaluates its argument, takes the resulting string, and X then uses it as a variable name. For example, given the X following code sequence: X X ; set up reference table X X set %one "elephant" X set %two "giraffe" X X X 52 X X X X X X X MicroEMACS Macros MicroEMACS Reference Manual X X X set %three "donkey" X X set %index "two" X insert-string &ind %index X X the string "giraffe" would have been inserted at the X point in the current buffer. This indirection can be safely X nested up to about 10 levels. X X X 12.4 Directives X X X Directives are commands which only operate within an X executing macro, ie they do not make sense as a single command. X As such, they cannot be called up singly or bound to keystroke. X Used within macros, they control what lines are executed and in X what order. X X Directives always start with the exclamation mark (!) X character and must be the first thing placed on a line. X Directives executed interactively (via the execute-command-line X command) will be ignored. X X X 12.4.1 !ENDM Directive X X X This directive is used to terminate a macro being stored. X For example, if a file is being executed contains the text: X X ; Read in a file in view mode, and make the window red X X 26 store-macro X find-file @"File to view: " X add-mode "view" X add-mode "red" X !endm X X write-message "[Consult macro has been loaded]" X X only the lines between the store-macro command and the X !ENDM directive are stored in macro 26. Both numbered macroes X and named procedures (via the store-procedure command) should be X terminated with this directive. X X X 12.4.2 !FORCE Directive X X X When MicroEMACS executes a macro, if any command fails, X the macro is terminated at that point. If a line is preceeded by X a !FORCE directive, execution continues weather the command X succeeds or not. For example: X X X 53 X X X X X X X MicroEMACS Reference Manual MicroEMACS Macros X X X ; Merge the top two windows X X save-window ;remember what window we are at X 1 next-window ;go to the top window X delete-window ;merge it with the second window X !force restore-window ;This will continue regardless X add-mode "red" X X X 12.4.3 !IF, !ELSE, and !ENDIF Directives X X X This directive allows statements only to be executed if a X condition specified in the directive is met. Every line X following the !IF directive, until the first !ELSE or !ENDIF X directive, is only executed if the expression following the !IF X directive evaluates to a TRUE value. For example, the following X macro segment creates the portion of a text file automatically. X (yes believe me, this will be easier to understand then that last X explanation....) X X !if &sequal %curplace "timespace vortex" X insert-string "First, rematerialize~n" X !endif X !if &sequal %planet "earth" ;If we have landed on earth... X !if &sequal %time "late 20th century" ;and we are then X write-message "Contact U.N.I.T." X !else X insert-string "Investigate the situation....~n" X insert-string "(SAY 'stay here Sara')~n" X !endif X !else X set %conditions @"Atmosphere conditions outside? " X !if &sequal %conditions "safe" X insert-string &cat "Go outside......" "~n" X insert-string "lock the door~n" X !else X insert-string "Dematerialize..try somewhen else" X newline X !endif X !endif X X X 12.4.4 !GOTO Directive X X X Flow can be controlled within a MicroEMACS macro using X the !GOTO directive. It takes as an argument a label. A label X consists of a line starting with an asterisk (*) and then an X alphanumeric label. Only labels in the currently executing macro X can be jumped to, and trying to jump to a non-existing label X terminates execution of a macro. For example.. X X ;Create a block of DATA statements for a BASIC program X X X 54 X X X X X X X MicroEMACS Macros MicroEMACS Reference Manual X X X insert-string "1000 DATA " X set %linenum 1000 X X *nxtin X update-screen ;make sure we see the changes X set %data @"Next number: " X !if &equal %data 0 X !goto finish X !endif X X !if &greater $curcol 60 X 2 delete-previous-character X newline X set %linenum &add %linenum 10 X insert-string &cat %linenum " DATA " X !endif X X insert-string &cat %data ", " X !goto nxtin X X *finish X X 2 delete-previous-character X newline X X X 12.4.5 !WHILE and !ENDWHILE Directives X X X This directive allows you to set up repetitive tasks X easily and efficiently. If a group of statements need to be X executed while a certain condition is true, enclose them with a X while loop. For example, X X !while &less $curcol 70 X insert-string &cat &cat "[" #stuff "]" X !endwhile X X places items from buffer "item" in the current line until X the cursor is at or past column 70. While loops may be nested X and can contain and be the targets of !GOTOs with no ill effects. X Using a while loop to enclose a repeated task will run much X faster than the corresponding construct using !IFs. X X X 12.4.6 !BREAK Directive X X X This directive allows the user to abort out of the X currently most inner while loop, regardless of the condition. It X is often used to abort processing for error conditions. For X example: X X ; Read in files and substitute "begining" with "beginning" X X X 55 X X X X X X X MicroEMACS Reference Manual MicroEMACS Macros X X X set %filename #list X !while ¬ &seq %filename "" X !force find-file %filename X !if &seq $status FALSE X write-message "[File read error]" X !break X !endif X beginning-of-file X replace-string "begining" "beginning" X save-file X set %filename #list X !endwhile X X This while loop will process files until the list is X exhausted or there is an error while reading a file. X X X 12.4.7 !RETURN Directive X X X The !RETURN Directive causes the current macro to exit, X either returning to the caller (if any) or to interactive mode. X For example: X X ; Check the monitor type and set %mtyp X X !if &sres "CGA" X set %mtyp 1 X !return X !else X set %mtyp 2 X !endif X X insert-string "You are on a MONOCHROME machine!~n" X X X X X X X X X X X X X X X X X X X X X X X 56 X X X X X X X MicroEMACS Command Line Switches and Startup Files MicroEMACS X Reference Manual X X X X X X X X X Appendix A X X MicroEMACS Command Line Switches and Startup Files X X X When EMACS first executes, it always searches for a file, X called .emacsrc under most UNIX systems or emacs.rc on most other X systems which it will execute as EMACS macros before it reads in X the named source files. This file normally contains EMACS macroes X to bind the function keys to useful functions and load various X usefull macros. The contents of this file will probably vary X from system to system and can be modified by the user as desired. X X When searching for this file, EMACS looks for it in this X order. First, it attempts to find a definition for "HOME" in the X environment. It will look in that directory first. Then it X searches all the directories listed in the "PATH" environment X variable. Then it looks through a list of predefined standard X directories which vary from system to system. Finally, failing X all of these, it looks in the current directory. This is also X the same method EMACS uses to look up any files to execute, and X to find it's help file EMACS.HLP. X X On computers that call up EMACS via a command line X process, such as MSDOS and UNIX, there are different things that X can be added to the command line to control the way EMACS X operates. These can be switches, which are a dash ('-') followed X by a letter, and possible other parameters, or a startup file X specifier, which is an at sign '@' followed by a file name. X X @ This causes the named file to be executed instead X of the standard emacs.rc file before emacs reads X in any other files. More than one of these can be X placed on the command line, and they will be X executed in the order that they appear. X X -A This flag causes emacs to automatically run the X startup file "error.cmd" instead of emacs.rc. This X is used by various C compilers for error X processing (for example, Mark Williams C). X X -E The following source files on the command line can X be edited (as opposed to being in VIEW mode). This X is mainly used to cancel the effects of the -v X switch used previously in the same command line. X X X X X 57 X X X X X X X MicroEMACS Reference Manual MicroEMACS Command Line Switches and X Startup Files X X X -G Upon entering EMACS, position the cursor at the X line of the first file. X X -K This key tells emacs to place the source files in X CRYPT mode and read it in using as the X encryption key. If no key is listed immediatly X after the -K switch, EMACS will prompt for a key, X and not echo it as it is typed. X X -R This places EMACS in "restricted mode" where any X commands allowing the user to read or write any X files other than the ones listed on the command X line are disabled. Also all commands allowing the X user access to the operating system are disabled. X This makes EMACS very useful as a "safe" X environment for use within other applications and X especially used as a remote editor for a BBS or X electronic bulletin board system. X X -S After EMACS is started, it automatically searches X for in the first source file. X X -V This tells EMACS that all the following sources X files on the command line should be in VIEW mode X to prevent any changes being made to them. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 58 X X X X X X X MicroEMACS commands MicroEMACS Reference Manual X X X X X X X X X Appendix B X X MicroEMACS commands X X X Below is a complete list of the commands in EMACS, the X keys normally used to do the command, and what the command does. X Remember, on some computers there may also be additional ways of X using a command (cursor keys and special function keys for X example). X X Command Binding Meaning X abort-command ^G This allows the user to abort out of any X command that is waiting for input X X add-mode ^X-M Add a mode to the current buffer X X add-global-mode M-M Add a global mode for all new buffers X X apropos M-A List out commands whose name contains X the string specified X X backward-character ^B Move one character to the left X X begin-macro ^X-( Begin recording a keyboard macro X X beginning-of-file M-< Move to the beginning of the file in X the current buffer X X beginning-of-line ^A Move to the beginning of the current line X X bind-to-key M-K Bind a key to a function X X buffer-position ^X-= List the position of the cursor in the X current window on the command line X X case-region-lower ^X-^L Make a marked region all lower case X X case-region-upper ^X-^U Make a marked region all upper case X X case-word-capitalize M-C Capitalize the following word X X case-word-lower M-L Lower case the following word X X case-word-upper M-U Upper case the following word X X change-file-name ^X-N Change the name of the file in the X current buffer X X X 59 X X X X X X X MicroEMACS Reference Manual MicroEMACS commands X X X change-screen-size M-^S Change the number of lines of the screen X currently being used X X change-screen-width M-^T Change the number of columns of the X screen currently being used X X clear-and-redraw ^L Clear the physical screen and redraw it X X clear-message-line (none) Clear the command line X X copy-region M-W Copy the currently marked region into X the kill buffer X X count-words M-^C Count how many words, lines and X characters are in the current marked region X X ctlx-prefix ^X Change the key used as the ^X prefix X X delete-blank-lines ^X-^O Delete all blank lines around the cursor X X delete-buffer ^X-K Delete a buffer which is not being X currently displayed in a window X X delete-mode ^X-^M Turn off a mode in the current buffer X X delete-global-mode M-^M Turn off a global mode X X delete-next-character ^D Delete the character following the cursor X X delete-next-word M-D Delete the word following the cursor X X delete-other-windows ^X-1 Make the current window cover the entire X screen X X delete-previous-character^H Delete the character to the left of the X cursor X X delete-previous-word M-^H Delete the word to the left of the cursor X X delete-window ^X-0 Remove the current window from the screen X X describe-bindings (none) Make a list of all legal commands X X describe-key ^X-? Describe what command is bound to a X keystroke sequence X X detab-line ^X-^D Change all tabs in a line to the X equivelant spaces X X end-macro ^X-) stop recording a keyboard macro X X end-of-file M-> Move cursor to the end of the current X buffer X X X X 60 X X X X X X X MicroEMACS commands MicroEMACS Reference Manual X X X end-of-line ^E Move to the end of the current line X X entab-line ^X-^E Change multiple spaces to tabs where X possible X X exchange-point-and-mark ^X-^X Move cursor to the last marked spot, X make the original position be marked X X execute-buffer (none) Execute a buffer as a macro X X execute-command-line (none) Execute a line typed on the command X line as a macro command X X execute-file FNB Execute a file as a macro X X execute-macro ^X-E Execute the keyboard macro (play back X the recorded keystrokes) X execute-macro- (none) Execute numbered macro where is X an integer from 1 to 40 X X execute-named-command M-X Execute a command by name X X execute-procedure M-^E Execute a procedure by name X X execute-program ^X-$ Execute a program directly (not through X an intervening shell) X X exit-emacs ^X-^C Exit EMACS. If there are unwritten, X changed buffers EMACS will ask to confirm X X fill-paragraph M-Q Fill the current paragraph X X filter-buffer ^X-# Filter the current buffer through an X external filter X X find-file ^X-^F Find a file to edit in the current window X X forward-character ^F Move cursor one character to the right X X goto-line M-G Goto a numbered line X X goto-matching-fence M-^F Goto the matching fence X X grow-window ^X-^ Make the current window larger X X handle-tab ^I Insert a tab or set tab stops X X hunt-forward FN= Hunt for the next match of the last X search string X X hunt-backward FN> Hunt for the last match of the last X search string X X help M-? Read EMACS.HLP into a buffer and display it X X X 61 X X X X X X X MicroEMACS Reference Manual MicroEMACS commands X X X i-shell ^X-C Shell up to a new command processor X X incremental-search ^X-S Search for a string, incrementally X X insert-file ^X-^I insert a file at the cursor in the X current file X X insert-space ^C Insert a space to the right of the cursor X X insert-string (none) Insert a string at the cursor X X kill-paragraph M-^W Delete the current paragraph X X kill-region ^W Delete the current marked region, moving X it to the kill buffer X X kill-to-end-of-line ^K Delete the rest of the current line X X list-buffers ^X-^B List all existing buffers X X meta-prefix Key used to precede all META commands X X move-window-down ^X-^N Move all the lines in the current window X down X X move-window-up ^X-^P Move all the lines in the current window up X X name-buffer M-^N Change the name of the current buffer X X newline ^M Insert a at the cursor X X newline-and-indent ^J Insert a at the cursor and indent X the new line the same as the preceeding X line X X next-buffer ^X-X Bring the next buffer in the list into X the current window X X next-line ^N Move the cursor down one line X X next-page ^V Move the cursor down one page X X next-paragraph M-N Move cursor to the next paragraph X X next-window ^X-O Move cursor to the next window X X next-word M-F Move cursor to the beginning of the X next word X X nop M-FNC Does nothing X X open-line ^O Open a line at the cursor X X overwrite-string (none) Overwrite a string at the cursor X X X 62 X X X X X X X MicroEMACS commands MicroEMACS Reference Manual X X X pipe-command ^X-@ Execute an external command and place X its output in a buffer X X previous-line ^P Move cursor up one line X X previous-page ^Z Move cursor up one page X X previous-paragraph M-P Move back one paragraph X X previous-window ^X-P Move the cursor to the last window X X previous-word M-B Move the cursor to the beginning of the X word to the left of the cursor X X query-replace-string M-^R Replace all of one string with another X string, interactively querying the user X X quick-exit M-Z Exit EMACS, writing out all changed buffers X X quote-character ^Q Insert the next character literally X X read-file ^X-^R Read a file into the current buffer X X redraw-display M-^L Redraw the display, centering the X current line X X resize-window ^X-W Change the number of lines in the X current window X X restore-window (none) Move cursor to the last saved window X X replace-string M-R Replace all occurences of one string X with another string from the cursor X to the end of the buffer X X reverse-incremental-search^X-R Search backwards, incrementally X X run M-^E Execute a named procedure X X save-file ^X-^S Save the current buffer if it is changed X X save-window (none) Remember current window (to restore later) X X scroll-next-up M-^Z Scroll the next window up X X scroll-next-down M-^V Scroll the next window down X X search-forward ^S Search for a string X X search-reverse ^R Search backwards for a string X X select-buffer ^X-B Select a buffer to display in the X current window X X X X 63 X X X X X X X MicroEMACS Reference Manual MicroEMACS commands X X X set ^X-A Set a variable to a value X X set-encryption-key M-E Set the encryption key of the current X buffer X X set-fill-column ^X-F Set the current fill column X X set-mark Set the mark X X shell-command ^X-! Causes an external shell to execute X a command X X shrink-window ^X-^Z Make the current window smaller X X split-current-window ^X-2 Split the current window in two X X store-macro (none) Store the following macro lines to a X numbered macro X X store-procedure (none) Store the following macro lines to a X named procedure X X transpose-characters ^T Transpose the character at the cursor X with the character to the left X X trim-line ^X-^T Trim any trailing whitespace from line X X unbind-key M-^K Unbind a key from a function X X universal-argument ^U Execute the following command 4 times X X unmark-buffer M-~ Unmark the current buffer (so it is X no longer changed) X X update-screen (none) Force a screen update during macro X execution X X view-file ^X-^V Find a file,and put it in view mode X X wrap-word M-FNW Wrap the current word, this is an X internal function X X write-file ^X-^W Write the current buffer under a new X file name X X write-message (none) Display a string on the command line X X yank ^Y yank the kill buffer into the current X buffer at the cursor X X X X X X X X 64 X X X X X X X MicroEMACS Bindings MicroEMACS Reference Manual X X X X X X X X X Appendix C X X MicroEMACS Bindings X X X Below is a complete list of the key bindings used in X MicroEMACS. This can be used as a wall chart reference for X MicroEMACS commands. X X Default Key Bindings for MicroEmacs 3.9e X X ^A Move to start of line ESC A Apropos (list some commands) X ^B Move backward by characters ESC B Backup by words X ^C Insert space ESC C Initial capitalize word X ^D Forward delete ESC D Delete forward word X ^E Goto end of line ESC E Reset Encryption Key X ^F Move forward by characters ESC F Advance by words X ^G Abort out of things ESC G Go to a line X ^H Backward delete X ^I Insert tab/Set tab stops X ^J Insert , then indent X ^K Kill forward ESC K Bind Key to function X ^L Refresh the screen ESC L Lower case word X ^M Insert ESC M Add global mode X ^N Move forward by lines ESC N Goto End paragraph X ^O Open up a blank line X ^P Move backward by lines ESC P Goto Begining of paragraph X ^Q Insert literal ESC Q Fill current paragraph X ^R Search backwards ESC R Search and replace X ^S Search forward X ^T Transpose characters X ^U Repeat command four times ESC U Upper case word X ^V Move forward by pages ESC V Move backward by pages X ^W Kill region ESC W Copy region to kill buffer X ^Y Yank back from killbuffer ESC X Execute named command X ^Z Move backward by pages ESC Z Save all buffers and exit X X ESC ^C Count words in region ESC ~ Unmark current buffer X ESC ^E Execute named procedure X ESC ^F Goto matching fence ESC ! Reposition window X ESC ^H Delete backward word ESC < Move to start of buffer X ESC ^K Unbind Key from function ESC > Move to end of buffer X ESC ^L Reposition window ESC . Set mark X ESC ^M Delete global mode ESC space Set mark X ESC ^N Rename current buffer ESC rubout Delete backward word X ESC ^R Search & replace w/query rubout Backward delete X ESC ^S Change screen rows X ESC ^T Change screen columns X X X 65 X X X X X X X MicroEMACS Reference Manual MicroEMACS Bindings X X X ESC ^V Scroll next window down X ESC ^W Delete Paragraph X ESC ^Z Scroll next window up X X ^X ? Describe a key ^X ! Run 1 command in a shell X ^X = Show the cursor position ^X @ Pipe shell command to buffer X ^X ^ Enlarge display window ^X # Filter buffer thru shell filter X ^X 0 Delete current window ^X $ Execute an external program X ^X 1 Delete other windows ^X ( Begin macro X ^X 2 Split current window ^X ) End macro X ^X A Set variable value X ^X ^B Display buffer list ^X B Switch a window to a buffer X ^X ^C Exit MicroEMACS ^X C Start a new command processor X ^X ^D Detab line ^X D Suspend MicroEMACS (BSD4.2 only) X ^X ^E Entab line ^X E Execute macro X ^X ^F Find file ^X F Set fill column X ^X ^I Insert file X ^X K Delete buffer X ^X ^L Lower case region X ^X ^M Delete Mode ^X M Add a mode X ^X ^N Move window down ^X N Rename current filename X ^X ^O Delete blank lines ^X O Move to the next window X ^X ^P Move window up ^X P Move to the previous window X ^X ^R Get a file from disk ^X R Incremental reverse search X ^X ^S Save current file ^X S Incremental forward search X ^X ^T Trim line (Incremental search X ^X ^U Upper case region not always availible) X ^X ^V View file X ^X ^W Write a file to disk ^X W resize Window X ^X ^X Swap "." and mark ^X X Use next buffer X ^X ^Z Shrink window ^X Z Enlarge display window X X Usable Modes X WRAP Lines going past right margin "wrap" to a new line X VIEW Read-Only mode where no modifications are allowed X CMODE Change behavior of some commands to work better with C X EXACT Exact case matching on search strings X OVER Overwrite typed characters instead of inserting them X CRYPT Current buffer will be encrypted on write, decrypted on read X MAGIC Use regular expression matching in searches X ASAVE Save the file every 256 inserted characters X X WHITE/CYAN/MAGENTA/YELLOW/BLUE/RED/GREEN/BLACK Sets foreground color X white/cyan/magenta/yellow/blue/red/green/black Sets background color X X X X X X X X X X X X X 66 X X X X X X X Supported machines MicroEMACS Reference Manual X X X X X X X X X Appendix D X X Supported machines X X X The following table lists all the hardware/compilers for X which I currently support MicroEMACS. This is not exclusive of X all machines which MicroEMACS will run on, but I have either run X it myself, or had a first hand report of it running. X X Hardware OS Compiler Comments X VAX 780 UNIX V5 native X UNIX V7 native X BSD 4.2 native job control supported X *VMS native only some terminals X supported X X NCR Tower UNIX V5 native X X Fortune 32:16 UNIX V7 native X X IBM-PC MSDOS LATTICE 2.15 Large CODE/Large DATA X 2.0 & 3.2 AZTEC 3.4e Small CODE/Large DATA X TURBO C v1.00 LARGE memory model X *MSC 4.0 X *MWC 86 X SCO XENIX native X X HP150 MSDOS Lattice 2.15 Function key labels X for the touch screen X X HP110 MSDOS Lattice 2.15 X Aztec 3.4e X X *Data General 10 X MSDOS Lattice 2.15 X X *Texas Instruments Professional X MSDOS Lattice 2.15 X X Amiga Intuition Lattice 3.03 no mouse or menus yet X *Aztec 3 X X ST520 TOS Mark Williams C Spawns under MSH X Lattice 3.10 (no shell commands) X X Systems to be supported (ie some code is already written:) X Macintosh Finder 5.0 Aztec X X X 67 X X X X X X X MicroEMACS Reference Manual Supported machines X X X *means that I do not own or have access to the listed compiler and/or X machine and must rely upon others to help support it. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 68 X X X X X X X Machine Dependent Notes MicroEMACS Reference Manual X X X X X X X X X Appendix E X X Machine Dependent Notes X X X This appendix lists some notes specific to individual X implementations of MicroEMACS. Every attempt has been made to X allow EMACS to be identical on all machines, but we have also X tried to take advantage of function keys, cursor keys, mice, and X special screen modes where possible. X X X E.1 IBM-PC/XT/AT and its clones X X X The IBM-PC family of computers is supported with a X variety of different display adapters. EMACS will attempt to X discover what adapter is connected and use the proper driver for X it. Below is a list of the currently supported video adapters: X X Adapter $sres Original mode used X Monochrome Graphics Adapter MONO MONO X Color Graphics Adapter CGA CGA X Enhanced Graphics Adapter EGA CGA X X EMACS also takes advantege of various function keys and X the keys on the keypad on an IBM-PC. The function keys are X initially not bound to any particular functions (except by the X emacs.rc startup file), but the keypad keys do default to the X following: X X Keypad key Function X Home beginning-of-file X CSRS UP previous-line X Pg Up previous-page X CSRS LEFT backward-character X CSRS RIGHT forward-character X End end-of-file X CSRS DOWN next-line X Pg Dn Next-page X X All these special keys are indicated in EMACS macroes by X use of the FN prefix. Below is a list of many of the keys and X the codes used to specify them. Also the codes may be gotten by X using the describe-key (^X ?) command on the suspect key. X X X X X X 69 X X X X X X X MicroEMACS Reference Manual Machine Dependent Notes X X X IBM PC function keys in MicroEmacs X X function Function ^function Alt-function X f1) FN; FNT FN^ FNh X f2) FN< FNU FN_ FNi X f3) FN= FNV FN` FNj X f4) FN> FNW FNa FNk X f5) FN? FNX FNb FNl X f6) FN@ FNY FNc FNm X f7) FNA FNZ FNd FNn X f8) FNB FN[ FNe FNo X f9) FNC FN\ FNf FNp X f10) FND FN] FNg FNq X X home) FNG FNw X CsUp) FNH X PgUp) FNI FNa(umlaut) {Alt 132} X CsLf) FNK FNs X 5 ) X CsRt) FNM FNt X End) FNO FNu X CsDn) FNP X PgDn) FNQ FNv X Ins) FNR X Del) FNS X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 70 X X X X X X X Machine Dependent Notes MicroEMACS Reference Manual X X X X X E.2 HP 150 X X X This machine from Hewlett Packard is very unusual for an X MSDOS machine. It has a touch screen and is very function key X oriented. An additional command, label-function-key allows you X to place labels on the on screen function key labels. A numeric X argument indicates which function key to label (one through X eight) and then the program prompts for a 16 character label, X which will be used as two lines of eight characters. To label X function key three with "save file" from a macro, you would use: X X 3 label-function-key "save file" X X Notice the 4 spaces after "save". This forces "file" to X begin on the second line of the label. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 71 X X X X X X X MicroEMACS Reference Manual Machine Dependent Notes X X X X X E.3 Atari 520/1040ST X X X The ATARI ST family of computers have a dual personality. X They may use either a monochrome or a color screen. EMACS X supports two screen resolutions on each monitor. X X Monitor $sres size #color $palette format X Color LOW 40x25 16 000111222333444555666777 X MEDIUM 80x25 4 000111222333 X Mono HIGH 80x25 2 000 X DENSE 80x50 2 000 X X The $palette environment variable can be used to change X what color is associated with each color name. With a color X monitor, each group of three digits indicates an octal number X specifying the RED, GREEN and BLUE levels of that color. Each X color digit can vary from 0 to 7. For example, the initial X setting of $palette in LOW resolution is: X X 000700070770007707077777 X X which broken up is: X X 000 700 070 770 007 707 077 777 X X which means: X X 000 Black X 700 Red X 070 Green X 770 Yellow X 007 Blue X 707 Magenta X 077 Cyan X 777 White X X Also the mouse generates FN prefix codes when moved, or X when one of the two buttons is pressed. Initially the movement of X the mouse is bound to movement of the cursor, and the left mouse X button generates a set-mark (M-space) command. The cursor keys X and the function keys are bound similarly to to IBM-PC. X X Files generated by EMACS on the ATARI ST have a single X return character at the end of each line, unlike the desktop X files which want to have tow returns. This makes it display files X strangly from GEM's [SHOW] option, but makes the files port to X other computers much nicer. X X Currently, when operating under the Mark Williams MSH X program, EMACS can shell out and perform external commands. This X X X X 72 X X X X X X X Machine Dependent Notes MicroEMACS Reference Manual X X X capability will be added later for the Beckmeyer shell and under X GEMDOS. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 73 X X X X X X X MicroEMACS Reference Manual Machine Dependent Notes X X X X X E.4 Amiga 1000 X X X The Commodore AMIGA 1000 version of MicroEMACS does not X have extensive support of the mouse or of pull down menus as of X yet. It does however come up in a window, and it is possible to X re-size it to run in different sized windows. The M-^S change- X screen-size takes its numeric argument as the new number of lines X for EMACS to use. The M-^T change-screen-width command allows X you to change the number of columns EMACS will use. The defaults X for these are 23 lines and 77 characters across for a full screen X window. X X Note about Compiling MicroEMACS X X If you are compiling the sources on the AMIGA X to produce an executable image, and you are using the X Lattice compiler, be sure to give the CLI command X 'STACK 40000' before compiling to make sure the X compiler has sufficient stack space to successfully X complete compiliation. X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X 74 X X X X X X X Machine Dependent Notes MicroEMACS Reference Manual X X X X X E.5 UNIX V5, V7, and BSD4.[23] X X X MicroEMACS under UNIX utilizes the TERMCAP library to X provide machine independent screen functions. Make sure that X termcap is availible and properly set on your account before X attempting to use MicroEMACS. X X Under systems which support job control, you can use the X ^X-D suspend-emacs command to place EMACS into the background. X This carries a much smaller overhead than bringing up a new shell X under EMACS. EMACS will properly redraw the screen when you X bring it back to the foreground. X X If the symbol VT100 has been set to 1 in the estruct.h X options file, EMACS will recognize the key sequence [ as the X lead in sequence for the FN function key prefix. X X With the addition of some very machine/operating system X specific code, EMACS can prevent two or more people from X modifying the same file at the same time. The upper level of a X set of functions to provide file locking exist in the source file X LOCK.C. It requires two machine specific functions written and X linked into EMACS for it to operate properly. X X char *dolock(fname) X X char *fname; X X dolock() locks a file, preventing others from modifying it. If X it succeeds, it returns NULL, otherwise it returns a pointer to X a string in the form "LOCK ERROR: explaination". X X char *undolock(fname) X X char *fname; X X undolock() unlocks a file, allowing others to modifying it. If X it succeeds, it returns NULL, otherwise it returns a pointer to X a string in the form "LOCK ERROR: explaination". X X X X X X X X X X X X X X X 75 X X X X X X X MicroEMACS Reference Manual Mode Flags X X X X X X X X X Appendix F X X Mode Flags X X X The two environment variables, $cmode and $gmode, contain X a number the corresponds to the modes set for the current buffer X and the editor as a whole. These are encoded as the sum of the X following numbers for each of the possible modes: X X WRAP 1 Word wrap X CMODE 2 C indentation and fence match X SPELL 4 Interactive spell checking (Not Implemented Yet) X EXACT 8 Exact matching for searches X VIEW 16 Read-only buffer X OVER 32 Overwrite mode X MAGIC 64 Regular expressions in search X CRYPT 128 Encrytion mode active X ASAVE 256 Auto-save mode X X So, if you wished to set the current buffer to have X CMODE, EXACT, and MAGIC on, and all the others off, you would add X up the values for those three, CMODE 2 + EXACT 8 + MAGIC 64 = X 74, and use a statement like: X X set $cmode 74 X X or, use the binary or operator to combine the different X modes: X X set $cmode &bor &bor 2 8 64 X X Internal Flags X X Some of the ways EMACS controls its internal functions X can be modified by the value in the $gflags environment variable. X Each bit in this variable will be used to control a different X function. X X GFFLAG 1 If this bit is set to zero, EMACS will not X automatically switch to the buffer of the X first file after executing the startup macros. X X X X X X X X X 76 X X X X X X X Index MicroEMACS Reference Manual X X X X X X X X X Index X X X .emacsrc 57 delete-mode 27 X 14 delete-next- X character 9 X A delete-next-word 9 X add-global-mode 27 delete-previous- X add-mode 3, 27 character 8 X ASAVE mode 27 delete-previous-word X 9 X B detab-line 38 X backward-character 4 X BBS 58 E X begin-macro 43 emacs.rc 57 X beginning-of-file 4, encryption 28 X 9 end-macro 43 X beginning-of-line 4 end-of-file 4 X buffer 5, 7, 24 end-of-line 4 X entab-lines 38 X C error parsing 57 X case-region-lower 37 EXACT mode 29 X case-word-capitalize execute-buffer 45 X 37 execute-file 45 X case-word-lower 37 execute-macro 43 X case-word-upper 37 execute-macro- 45 X change-screen-size execute-procedure 45 X 74 execute-program 40 X change-screen-width exit-emacs 9 X 74 X CMODE mode 28 F X color 27 file locking 75 X command.com 40 fill-paragraph 8, 36 X command line 18 fill column 31 X command processor 40 filter 40 X control-x 1 find-file 19, 24 X control key 1 forward-character 4 X copy-region 12 X CRYPT mode 28, 58 G X cshell 40 grow-window 20 X cursor keys 4 X H X D handle-tab 38 X default string 15 Help File 57 X delete-blank-lines 9 HOME environment X delete-buffer 25 variable 57 X delete-global-mode X 27 X X X 77 X X X X X X X MicroEMACS Reference Manual Index X X X refresh-screen 21 X I replace-string 16, X i-shell 41 30 X resize-window 20 X K restricted mode 58 X kill-region 11 run 45 X kill-to-end-of-line X 9 S X kill buffer 12 save-file 5 X screen 7 X L scroll-next-down 19 X label-function-key scroll-next-up 19 X 71 search-forward 14 X list-buffers 25, 27 search-reverse 15 X select-buffer 24 X M set-encryption-key X MAGIC mode 29 28 X mark 11 set-fill-column 36 X meta key 1 set-mark 11 X mode line 2, 7 shell 40 X modes 3, 27 shell-command 40 X move-window-down 19 shrink-window 20 X move-window-up 19 special keys 1 X split-window 18 X N startup files 57 X newline 1 store-procedure 45 X next-buffer 24 suspend-emacs 41, 75 X next-line 4 switches 57 X next-paragraph 4 X T X O tab handling 38 X open-line 8 termcap 75 X open-window 18 text window 2 X OVER mode 30 X V X P VIEW mode 31 X PATH environment X variable 57 W X pipe-command 40 window 7 X point 11 windows 2, 18 X previous-line 4 Creating 18 X previous-paragraph 4 Deleting 19 X previous-window 18 Resizing 20 X previous-word 4 wrap-word 31 X procedures 45 WRAP mode 31 X wrapping text 36 X Q write-file 5 X query-replace 16 X query-replace-string Y X 16, 30 yank 12 X X R X redraw-display 20 X X X X 78 X X X X X X X X X X X X X Table of Contents X X X X X X Chapter 1 Basic Concepts 1 X 1.1 Keys and the Keyboard . . . . . . . . . . . . 1 X 1.2 Getting Started . . . . . . . . . . . . . . . 1 X 1.3 Parts and Pieces . . . . . . . . . . . . . . 2 X 1.4 Entering Text . . . . . . . . . . . . . . . . 3 X 1.5 Basic cursor movement . . . . . . . . . . . . 3 X 1.6 Saving your text . . . . . . . . . . . . . . 5 X X Chapter 2 Basic Editing--Simple Insertions and X Deletions 7 X 2.1 A Word About Windows, Buffers, Screens, and X Modes . . . . . . . . . . . . . . . . . . . . . . 7 X 2.2 Insertions . . . . . . . . . . . . . . . . . 8 X 2.3 Deletions . . . . . . . . . . . . . . . . . . 8 X X Chapter 3 Using Regions 11 X 3.1 Defining and Deleting a Region . . . . . . 11 X 3.2 Yanking a Region . . . . . . . . . . . . . 12 X X Chapter 4 Search and Replace 14 X 4.1 Forward Search . . . . . . . . . . . . . . 14 X 4.2 Exact Searches . . . . . . . . . . . . . . 15 X 4.3 Backward Search . . . . . . . . . . . . . . 15 X 4.4 Searching and Replacing . . . . . . . . . . 15 X 4.5 Query-Replace . . . . . . . . . . . . . . . 16 X X Chapter 5 Windows 18 X 5.1 Creating Windows . . . . . . . . . . . . . 18 X 5.2 Deleting Windows . . . . . . . . . . . . . 19 X 5.3 Resizing Windows . . . . . . . . . . . . . 20 X 5.4 Repositioning within a Window . . . . . . . 20 X X Chapter 6 Buffers 24 X X Chapter 7 Modes 27 X 7.1 ASAVE mode . . . . . . . . . . . . . . . . 27 X 7.2 CMODE mode . . . . . . . . . . . . . . . . 28 X 7.3 CRYPT mode . . . . . . . . . . . . . . . . 28 X 7.4 EXACT mode . . . . . . . . . . . . . . . . 29 X 7.5 MAGIC mode . . . . . . . . . . . . . . . . 29 X 7.6 OVER mode . . . . . . . . . . . . . . . . . 30 X 7.7 WRAP mode . . . . . . . . . . . . . . . . . 31 X 7.8 VIEW mode . . . . . . . . . . . . . . . . . 31 X X X X X i X X X X X X X X X X Chapter 8 Files 33 X X Chapter 9 Screen Formatting 36 X 9.1 Wrapping Text . . . . . . . . . . . . . . . 36 X 9.2 Reformatting Paragraphs . . . . . . . . . . 36 X 9.3 Changing Case . . . . . . . . . . . . . . . 37 X 9.4 Tabs . . . . . . . . . . . . . . . . . . . 37 X X Chapter 10 Access to the Outside World 40 X X Chapter 11 Keyboard Macros 43 X X Chapter 12 MicroEMACS Macros 45 X 12.1 Constants . . . . . . . . . . . . . . . . 45 X 12.2 Variables . . . . . . . . . . . . . . . . 46 X 12.2.1 Environmental Variables . . . . . . . 47 X 12.2.2 User variables . . . . . . . . . . . 49 X 12.2.3 Buffer Variables . . . . . . . . . . 49 X 12.2.4 Interactive variables . . . . . . . . 50 X 12.3 Functions . . . . . . . . . . . . . . . . 50 X 12.4 Directives . . . . . . . . . . . . . . . . 53 X 12.4.1 !ENDM Directive . . . . . . . . . . . 53 X 12.4.2 !FORCE Directive . . . . . . . . . . 53 X 12.4.3 !IF, !ELSE, and !ENDIF Directives . . 54 X 12.4.4 !GOTO Directive . . . . . . . . . . . 54 X 12.4.5 !WHILE and !ENDWHILE Directives . . . 55 X 12.4.6 !BREAK Directive . . . . . . . . . . 55 X 12.4.7 !RETURN Directive . . . . . . . . . . 56 X X Appendix A MicroEMACS Command Line Switches and X Startup Files 57 X X Appendix B MicroEMACS commands 59 X X Appendix C MicroEMACS Bindings 65 X X Appendix D Supported machines 67 X X Appendix E Machine Dependent Notes 69 X E.1 IBM-PC/XT/AT and its clones . . . . . . . . 69 X E.2 HP 150 . . . . . . . . . . . . . . . . . . 71 X E.3 Atari 520/1040ST . . . . . . . . . . . . . 72 X E.4 Amiga 1000 . . . . . . . . . . . . . . . . 74 X E.5 UNIX V5, V7, and BSD4.[23] . . . . . . . . 75 X X Appendix F Mode Flags 76 X X X X X X X X X X X ii X X X FRIDAY_NIGHT