======================================= e M A C s M a c r o E d i t o r ======================================= Version 3.0 - March 21, 1992 (c) 1987-1992 by Gertjan J. Noordman (c) 1987 Daniel M. Lawrence for portions of the software (c) 1988 Apple Computer, Inc. for portions of the software eMACs is free for personal use only, and cannot be sold eMACs is written in MPW C and MPW Pascal <<<<<<<< HINT >>>>>>>> To view the next screen type ŒCOMMAND-v¹ (hold the COMMAND key and press character Œv¹) If you must exit at some point, type ŒCOMMAND-x COMMAND-c¹. ______GENERAL_____________________________________________________________ The eMACs editor is based on MicroEMACS version 3.8, (c) by Daniel M. Lawrence, but written by a lot more people (see "Acknowledgements" section). Many parts of the source code are rewritten to take advantage of the Macintosh without changing the nature and feel of the ³emacs² type editor. Parts the eMACs editor might actually feel more like ³gmacs² (Gosling¹s emacs) as it uses to run on UNIX machines. A (c)opyright is put on eMACs to avoid commercial use of this product without my knowledge. The program eMACs can be used and copied freely by anybody for non-commercial use only, as long as it is left unchanged, and kept together with the documentation and executable files. This document is not intended to be a tutorial. It is assumed that the reader is familiar with an Œemacs¹ type editor. Though, in addition to some general information the Macintosh specific features of eMACs are described. Furthermore, a complete list of command descriptions and key bindings are included in this document. eMACs commands generally involve the COMMAND or CONTROL key (labelled ³apple² or ³control²), or the ³Meta² key (generally labelled ESC) or the Œ`¹-key (backquote). Rather than write out CONTROL or ŒMeta¹ each time to prefix a character, the following abbreviations are used: ^ Hold the CONTROL key while pressing the character . Thus, ^V would be: hold the COMMAND (or CONTROL) key and press Œv¹. M- Press the ESCAPE key (or Œ`¹-key) and release it, then press the character . ______SCREEN______________________________________________________________ The eMACs window is the usual Macintosh window, with grow and zoom box, called hereafter "screen". Inside the Mac window the typical eMACs screen is used with a status line per displayed buffer. On the Mac Plus and SE the full screen is used which can display one or more buffers. The maximum number of buffers depends on the screen size. On larger screens, e.g. Mac II or large monitor, the window is up to a maximum fixed size centered on the screen. Under Multifinder, for small screens it is possible to display the eMACs window only if eMACs is the active program. Switching to another program or the Finder will remove the eMACs window from the screen, and the window is redrawn when eMACs is selected again. (This option can ste by the user with the Œ$hidewindow¹ variable.) The maximum number of characters (lines and columns) that can be displayed on the screen depends on the screen size, and the chosen character size. ______BASIC CURSOR CONTROL________________________________________________ There are several ways to move the cursor. One way is to use the commands previous, backward, forward and next. These commands which are given to eMACs as ^P, ^B, ^F, and ^N respectively move the cursor from where it currently is to a new place in the given direction. When moving by characters is too slow, moving by words is possible. M-f moves forward a word and M-b moves back a word. Two other commands for moving in the same line are ^A which moves the cursor to the beginning of the line, and ^E which moves the cursor to the end of the line. Here, in a more graphical form, are the commands: M-< Begin of file M-, Begin of window M-v Previous page ^P Previous line (up arrow) | ^B Backward char | ^F Forward char (left arrow) | (right arrow) M-b Backward word --- CURRENT CURSOR POSITION --- M-f Forward word ^A Begin of line | ^E End of line | | ^N Next line (down arrow) ^V Next page M-. End of window M-> End of file The location of the cursor within the text is also called "dot". The cursor shows on the screen where dot is located in the text and where text will be inserted, i.e. just before the character under the cursor. Like many other commands in eMACs, these commands can be given arguments which cause them to be executed repeatedly. The way you give a command a repeat count is by pressing ŒMeta¹ and then the number before you enter the command. As a special case, typing ^U multiplies the number of executions with 4, starting at 1. For instance, M-8^F moves forward eight characters, and ^U^U^F moves forward 16 characters (4 times 4). ______ABORTING COMMANDS___________________________________________________ The eMACs command used to abort any command which requests input is ^G. For example, you can use ^G to discard a numeric argument or at the beginning of a command that you don¹t want to finish. ______MESSAGE LINE________________________________________________________ The line at the bottom of the screen is referred to as the "message line", used for communication with the user. The message line is used by eMACs to display information, warnings, and errors. For color screens, information is green, warnings are yellow, and error messages are displayed in red. For B/W screen, a warning message is displayed with a beep, and an error message is also preceded with two black dots Œ€€¹. ______MODE LINE___________________________________________________________ The line at the bottom of a window is referred to as the "mode line". The mode line looks like: €= bufname == Wrap CMode == File: HDisk:Folder:filename ================ The mode line is displayed in reverse video on B/W screens, and in azure blue on color screens. The mode line contains: - The change indicator Œ€¹, indicates that changes have been made to the file that have not been saved yet. - The program¹s name ŒeMACs¹. - The name of the buffer, i.e. the name that eMACs gives to the buffer (usually related to the file name). - Any active modes. In the example the wrap around and C language mode are active. - The string following "File:" is the name of the file that is currently being edited, preceded by the name of the disk (which must be unique to avoid ambiguity) and any folder names. In case the total name does not fit in the mode line, some folder names are left out, but the colons are still shown to indicate the depth of folders. ______EDIT MODES__________________________________________________________ Edit modes are a feature of eMACs which assist in the editing of different languages, e.g. text and C. If there are no modes associated with the edit buffer, eMACs will do exactly what one thinks it will, i.e. no automatic actions. More information about the current buffer and mode status can be found by typing ^X^B. The following modes are available in eMACs: Wrap, Cmode, View, Ovwt, Exact, and Magic. Note that the default for all buffers is no modes unless global modes are set. In the normal case, long lines are not folded and the line shifts to the left to enable you to view lines longer than the number of characters that fit on the screen (e.g. 83 for a Mac SE). A Œ€¹ sign in the last column indicates the line does not fit on the screen. - Wrap: When the wrap around mode is set, eMACs tries to fold (break) lines at the currently defined right margin. The right margin can be set of interrogated with the "fill-column" command. - Cmode: This mode is automatically set if the file extension is Œ.c¹, Œ.C¹, Œ.cp¹, Œ.h¹, or Œ.H¹ and does useful things for you when you are writing programs in C (and C++), e.g. auto indent, indent back at end of block structure, shows the open-parenthesis when typing the closing-parenthesis. - View: The View mode makes the buffer read only. It prevents accidental changes to files. - Ovwt: In the overwrite mode anything that is typed overwrites the existing text in the buffer rather than inserting - Exact: The exact mode controls the manner in which string searches are done: if exact mode is set, the search is case sensitive; if it is off, the case of the target is ignored. - Magic: The magic search mode allows for regular pattern matching in search strings (see "searching"). The easiest way to activate or deactivate a mode is to use the Mode menu, and select the desired mode. A check mark in front of the mode name indicates that that mode is active. All modes can be deactivated at once by the "None of the above" menu item. Commands to deal with activation and deactivation of modes are "add-mode", "delete-mode", "add-global-mode", "delete-global-mode". The global mode commands apply to all buffers that are created after the global mode is set. The other command apply to the currently active buffer, i.e. the buffer that contains the cursor. ______INSERTING AND DELETING______________________________________________ Typing will insert text. Visible characters, such as A, 7, *, are taken by eMACs as text and are immediately inserted. Type to insert a line separator, i.e., a Œnewline¹ character. Option characters, i.e. characters with the option key pressed, are also supported. The last character typed can be deleted by typing either (backspace) or ^H. Also words or lines can be deleted. Following is a summary of the delete/kill operations: or ^H Delete the character just before the cursor ^D Delete the character under the cursor M- Kill the word immediately before the cursor M-^H Kill the word immediately before the cursor M-d Kill the word behind the cursor ^X^K Kill from the cursor position to end of line. ^K Kill from the cursor position to end of line, or if the cursor at the beginning of the line the whole line is deleted including the Œnewline¹ (if the cursor is at the end of the line, it just deletes the Œnewline¹. Whenever text is deleted that is bigger than one character, eMACs saves it in the "kill buffer". To yank it back, use ^Y. Consecutive killed text will be stored in the same kill buffer. Commands other than kill commands followed by a kill command will refresh the kill buffer, i.e. the the buffer is erased first. ______SEARCHING___________________________________________________________ eMACs can do searches for strings (these are groups of contiguous characters or words) either forward or backward through the file. Searching can also be done in incremental fashion, i.e. searching will start when the first character of the search string is typed. Search commands are: ^S Incremental search forward ^R Incremental search backward ^XS Search forward (note: capital ŒS¹) ^XR Search reverse (note: capital ŒR¹) Two modes do affect the way searching is done: ŒExact¹ and ŒMagic¹. In the exact mode upper/lower case is not ignored in searches. In the magic mode regular pattern matching characters are active (not supported for incremental searching). Following are the pattern matching characters for searching in Magic mode: Œ.¹ Matches any one character. Œ*¹ Matches any number of characters inclusive zero. Œ^¹ Pattern is searched for at at beginning of a line only (this character must be the first character in the search string). Œ$¹ Pattern is searched for at the end of a line only (this character must be the last character in the search string). Œ\¹ Quote the next character, i.e. the next character is taken literally. Œ[ ]¹ Character class enclosure, match any character in the class enclosure. Negation is possible with the Œ^¹ character, ranges with the Œ-¹ character. Examples: [ad4] Character that matches either Œa¹, Œd¹, or Œ4¹. [0-9] Any character that is not a digit. [a-zA-Z0-9] Any alphanumeric character. ______TEXT REPLACEMENT____________________________________________________ Text can be replaced with two commands Œreplace-string¹ (M-r) and Œquery-replace-string¹ (M-q). First the original string is asked ended with an ESC character, and then the replacement string ended with an ESC character. The query-replace-string command allows for several options. In essence, it shows each occurrence of the first string and asks whether or not to replace the string. Type a "?" when it asks to replace the string to list the various options for query-replace-search. For a more detailed discussion of this command refer to the eMACs command descriptions. ______FILE HANDLING_______________________________________________________ In order to make the text changes permanent, the file must be saved. As changes are made, i.e., corrections, deletions, insertions, etc., they are actually written to a "scratch" copy of the file in RAM memory and the changes to this file will not affect the "master" copy of the file until the file is saved. To find a file, type ^X^F. eMACs will then prompt with the usual file dialog. Initially, only ŒTEXT¹ files (Ascii files) are shown. Though, by toggling the menu item "Show Text Files Only", all files are shown in the dialog. Though, it might not make sense to open files of type other than TEXT. When the "Select File" is clicked in the dialog, the file is read into a (new) buffer shown on the screen, and the number of lines read is displayed in the message line. To save any changes made to the file, type ^X^S. This tells eMACs to create a new version of the file which includes the changes that were made. When the save is complete, the number of lines saved will be displayed in the message line. To create a file, typing can be started in the main window (i.e. the window that is created when the program is started without files), or by creating a new buffer with Œselect-buffer¹ (^Xb). The file can be saved with "write-file" (^X^W), in which case eMACs will ask to indicate the folder, and the file name with the usual Macintosh dialog. Then, it will create the new file and save the buffer¹s content into the file. ______EXTENDING THE COMMAND SET___________________________________________ There are many, many more eMACs commands (see command description) than could possibly be put on all the CONTROL and ŒMeta¹ characters. eMACs gets around this with the X (eXtend) command. There are two forms of this command: ^X Character eXtend. Followed by one character. M-x Named command eXtend. Followed by a command name. These are commands that are generally useful but used less than other commands. There are many ^X commands. Some of them are ^X^F Find file. ^X^S Save file. ^X^C Quit eMACs. This does not save your files automatically; however, if your files have been modified, eMACs asks if you really want to quit. The standard way to save and exit is ^X^S ^X^C. Alternatively, the menu item "Save & Quit" in the File menu save all files currently open in eMACs and then quits the program. Named eXtended commands are commands which are used even less frequently, or commands which are used only in certain modes. These commands are usually called "functions". An example is the function "insert-string", which prompts for a string to be inserted and then inserts the string at the current cursor location. When M-X is typed, eMACs prompts on the message line with ":" and expects the name of the function to be typed. In this case, "insert-string". Only the first so many unique characters need to be typed followed by a space which will cause the word in the command to be expanded. This can be repeated until the full command is specified on the message line, followed by a . For example, type Œins¹ will cause Œinsert-¹, then type Œst¹ will cause Œstring¹, so that the message line now shows Œinsert-string¹. A will cause eMACs to display ŒString to insert«Meta»:¹. eMACs asks for the string to be inserted followed by the ŒMeta¹ character (ESC). By the way, this command is useful when used together with an argument for repetitive insertion of the same string. ______GETTING HELP________________________________________________________ There is so much available in eMACs that it would be impossible to explain it all here. There are several help features in eMACs. The most basic Help feature is the "describe-key" function which is available by typing ^M-o and then a command character. eMACs prints in the message line what function is bound to that key or key sequence. The other help feature is the command "help" (M-h). It creates a 8 line window on the screen with a help file (eMACs Help). The help file consist of 18 pages with commands and their key bindings functionally grouped together. The first page gives an overview of the available pages. ______KEYBOARD____________________________________________________________ Depending on the used keyboard additional features are available to eMACs. This section describes features that depend on the type of keyboard being used. In general all keyboards are supported by eMACs, especially: - Mac Plus keyboard - Mac SE/II keyboard - Mac SE/II extended keyboard Control characters can be generated with the COMMAND key on the Mac Plus keyboard, and additionally with the CONTROL key on the Mac II keyboards. The control characters can be generated as follows: ^A - ^Z Command-³a² to Command-³z², or Control-³a² to Control-³z² ^[ Command-³[², or Control-³[² or ESCape or ²`² ^\ Command-³\², or Control-³\² ^] Command-³]², or Control-³]² ^^ Command-³6², or Control-³6² (shift not needed) ^_ Command-³-², or Control-³-² (shift not needed) ^@ Command-³Space² or Control-³Space² ^M RETURN ^J ENTER ^H DELETE or BACKSPACE The ŒMeta¹ key can be generated in several ways: - On every keyboard with the ³`² key, the Œbacktick¹ (a Œbacktick¹ can be generated by Command-³`²). - On every keyboards with Command-³[² (or Control-³[²). - On the Mac SE/II keyboards with the ESC key. Function keys can be generated in several ways: - On the Mac SE/II extended keyboards with the keyboard¹s 15 function keys as follows: keys F1 until F15 will generate FN-a to FN-o, keys Option-F1 until Option-F15 will generate FN-A to FN-O - On the Mac Plus keyboard and the Mac SE/II keyboard (without function keys) two groups of 10 function keys can be generated as follows: keys Option-1 until Option-0 on the numeric keypad will generate FN-a to FN-j, Shift-Option-1 until Shift-Option-0 on the numeric keypad will generate FN-A to FN-J. - On the PowerBook keyboard (and any other keyboard) two groups 10 function keys can be generated as follows: keys Command-Option-1 until Command-Option-0 on the numeric keypad will generate FN-a to FN-j, Shift-Command-Option-1 until Shift-Command-Option-0 on the numeric keypad will generate FN-A to FN-J. All special keys on the Mac keyboards will generate a key sequence that is treated by eMACs as a function key. Following is a list of key sequences that are generated by the special keys, and can be assigned functions to (see list of commands). Right Arrow: FN-> Home: FN-[ Del: FN-# Left Arrow: FN-< End: FN-] Clear: FN-~ Down Arrow: FN-_ Page Up: FN-{ Help: FN-? Up Arrow: FN-^ Page Down: FN-} ______CUTTING & PASTING___________________________________________________ Cutting, Copying, and Pasting between eMACs and other Macintosh programs is supported, both via the Edit menu, and also with all the commands that copy or save text to and from the eMACs Œkill buffer¹. These commands are: copy-line copy-region kill-line kill-region kill-paragraph kill-to-end-of-line delete-buffer delete-next-word delete-previous-word ______MOUSE_______________________________________________________________ The eMACs editor was not designed for use of a mouse, and that is left that way. Though, some handy features are implemented that use the mouse. Of course, the mouse can be used for Macintosh specific tasks, e.g. for menu choices and switching in Multifinder in the usual way. Furthermore, the mouse can be used for: - Activating a non-active window on the screen by clicking in it (alternative for commands Œnext-window¹ and Œprevious-window¹). - Moving the Œdot¹ (cursor) to a particular position in the active window by clicking on that character position. - Setting the Œmark¹ (end of a region) by clicking while holding the option key (alternative for command Œset-mark¹). ______MACRO LANGUAGE______________________________________________________ The eMACs editor is equipped with a functional extension language which allows to write macros. These macros can be saved, recalled and bound to keystrokes, thus allowing a high degree of customization. Macros are programs that are used to customize the editor and to perform more complicated editing tasks. They may be stored in files or buffers and may be executed using an appropriate command, or bound to a particular keystroke. Portions of the ³eMACs Startup² file are implement via macros. The Œexecute-macro-¹ editor commands cause the macros, numbered from 1 up to 40, to be executed. Macros are stored by executing files (command Œexecute-file¹) or buffers (command Œexecute-buffer¹) that contain the Œstore-macro¹ command. There are many different aspects to the macro language within eMACs. Editor commands are the various commands that manipulate text, buffers, windows, etc, within the editor. Directives are commands which control what lines get executed within a macro. Also there are various types of variables. Environmental variables both control and report on different aspects of the editor. User variables hold string values which may be changed and inspected. Buffer variables allow text to be placed into variables. Interactive variable allow the program to prompt the user for information. Functions can be used to manipulate all these variables. € Variables Variables in eMACs can be used to return values within expressions, as repeat counts to editing commands, or as text to be inserted into buffers and messages. The value of these variables is set using the command Œset¹. For example, to set the current fill column to 64 characters, the macro line ³set $fillcol 64² would be used. Or to have the contents of the variable %name inserted at the point in the current buffer, the command would be ³insert-string %name². - Environmental Variables Environmental variables are used to change different aspects of the way the editor works. Also they will return the current settings if used as part of an expression. All environmental variable names begin with a dollar sign Œ$¹. Environmental variables supported by eMACs are: $fillcol Current fill column . $pagelen Number of lines on the screen used currently. $pagewidth Number of columns on the screen used currently. $curcol Current column position of cursor. $curline Current line in buffer which contains the cursor. $cbufname Name of current buffer. $cfname Name of current file. $debug Flag to enable macro debugging (TRUE or FALSE). $status Status of the last executed command (TRUE or FALSE). $fontsize Screen font size. $hidewindow Flag indicates if window must be hidden when program not active (TRUE or FALSE) - User variables User variables can be defined by the user and allow to store strings and manipulate them. These strings can be pieces of text, numbers (in text form), or the logical values ³TRUE² and ³FALSE². These variables can be combined, tested, inserted into buffers, and otherwise used to control the way macros execute. Up to 100 user variables may be in use in one editing session. All users variable names must begin with a percent sign Œ%¹ and may contain any printing characters. Only the first 10 characters are significant. Most operators will truncate strings to a length of 128 characters. - Buffer Variables Buffer variables are special variables that can only be queried and cannot be set. Buffer variables allow to take text from a buffer and place it in a variable. A buffer variable must begin with a pound sign Œ#¹ followed by a buffer name. For example ²#bufname² is the text in the buffer Œbufname¹ starting at the dot in that buffer until the beginning of the next line. If ³#bufname² is used in a command, it will grab all text from the cursor until the beginning of the next line from buffer Œbufname¹ and pass it to the command. - Interactive variables Interactive variables are a method to prompt the user for a string. This is done by using an at sign Œ@¹ followed either with a quoted string, or a variable containing a string. The string is the placed in the message line, and eMACs waits for the user to type in a string. Then the string typed in by the user is returned as the value of the interactive variable. The following example will ask the user for a buffer name, and then attempt to select it: set %quest "What buffer? " select-buffer @%quest € Functions Functions can be used to manipulate variables in various ways. Functions can have one, two, or three arguments. These arguments will always be placed after the function on the current command line. For example, to increase the current fill column by two, using eMACs¹s command Œset¹ command one can use ³set $fillcol &add $fillcol 2². Function names always begin with the ampersand Œ&¹ character, and are only significant to the first three characters after the ampersand. Functions will normal expect one of three types of arguments, and will automatically convert types when needed. The three types are: Œnum¹ Ascii string of digits which is interpreted as a numeric value. Any string which does not start with a digit or a minus sign will be considered zero. Œstr¹ An arbitrary string of characters. Strings are limited to 128 characters in length. Some characters preced by Œ~¹ have a special meaning (Œr¹ for return, Œn¹ for newline, Œt¹ for tab, Œb¹ for backspace, and Œf¹ for formfeed). Œlog¹ Logical value consisting of the string "TRUE" or "FALSE". Numeric strings will also evaluate to "FALSE" if they are equal to zero, and "TRUE" if they are non-zero. Arbitrary text strings will have the value of "FALSE". Following is a list of the available functions: - Numeric Functions (returns Œnum¹): &ADD Œnum¹ Œnum¹ Add two numbers. &SUB Œnu1¹ Œnu2¹ Subtract number nu2 from nu1. &TIM Œnum¹ Œnum¹ Multiply two numbers. &DIV Œnu1¹ Œnu2¹ Divide number nu1 by nu2 giving an integer result. &MOD Œnum¹ Œnum¹ Return the reminder of dividing number nu1 by nu2. &NEG Œneg¹ Multiply the argument by -1. - String manipulation functions (returns Œstr¹): &CAT Œstr¹ Œstr¹ Concatenate the two strings. &LEF Œstr¹ Œnum¹ Return Œnum¹ leftmost characters from Œstr¹. &RIG Œstr¹ Œnum¹ Return Œnum¹ rightmost characters from Œstr¹. &MID Œstr¹ Œnu1¹ Œnu2¹ Starting from Œnu1¹ position in Œstr¹, return Œnu2¹ characters. - Logical Testing functions (returns Œlog¹): &NOT Œlog¹ Return the opposite logical value. &EQU Œnu1¹ Œnu2¹ If Œnu1¹ is numerically equal to Œnu2¹, return ¹TRUE¹. &LES Œnu1¹ Œnu2¹ If Œnu1¹ is less than Œnu2¹, return ŒTRUE¹. &GRE Œnu1¹ Œnu2¹ If Œnu1¹ is greater than, or equal to Œnu2¹, return ŒTRUE¹. &SEQ Œst1¹ Œst2¹ If the two strings are the same, return ŒTRUE¹. &SLE Œst1¹ Œst2¹ If Œst1¹ is less alphabetically than Œst2¹, return ŒTRUE¹. &SGR Œst1¹ Œst2¹ If Œst1¹ is alphabetically greater than or equal to Œst2¹, return ŒTRUE¹. - Special Functions: &IND Œstr¹ Indirect, i.e. evaluate Œstr¹ as a variable. This function evaluates its argument, takes the resulting string, and then uses it as a variable name. For example, the following code sequence the string "giraffe" would have been inserted at the point in the current buffer. set %one "elephant" set %two "giraffe" set %three "donkey" set %index "two" insert-string &ind %index € Directives Directives are commands which only operate within an executing macro, i.e. they do not make sense, and cannot not be used, as a single command. Used within macros, they control what lines are executed and in what order. Directives always start with the exclamation mark Œ!¹ and must be the first word placed on a line. Directives executed singly, i.e. executed via the command Œexecute-command-line¹ interactively will be ignored. - Directive Œ!endm¹ This directive is used to terminate a macro being stored. To store a macro number 26 the following lines are necessary: 26 store-macro commands... !endm - Directive Œ!force¹ If any command fails, when eMACs executes a macro, the macro is terminated at that point. If a line is preceded by a Œ!force¹ directive, execution continues whether the command succeeds or not. - Directives Œ!if¹, Œ!else¹, and Œ!endif¹ These directives allow statements only to be executed if a condition specified in the directive is met. Every line following the Œ!if¹ directive, until the first Œ!else¹ or Œ!endif¹, is only executed if the expression following the Œ!if¹ evaluates to a ŒTRUE¹ value. For example, in the following macro segment command-1 is executed is the string variable contains ²all_right², else command-2 is executed. !if $sequal %strvar "allright" command-1 !else command-2 !endif - Directive Œ!goto¹ Flow can be controlled within a macro using the Œ!goto¹ directive. It takes as an argument a label. A label consists of a line starting with an asterisk Œ*¹ and then an alphanumeric label. Only labels in the currently executing macro can be jumped to, and trying to jump to a non-existing label terminates execution of a macro. For example.. !goto LBL10 .... *LBL10 - Directive Œ!return¹ The Œ!return¹ directive causes the current macro to exit, either returning to the caller or to interactive mode. For example: ______MENU COMMANDS_______________________________________________________ € File Menu Open... Open an existing file in a new buffer. Open Read Only... Open an existing file in read only mode in a new buffer. Save Save changes in current buffer to its disk file. Save As... Save current buffer to a new disk file. Read... Reads file into current buffer, discarding the current buffer content. Insert... Insert existing file at the dot in the current buffer. Execute... Execute existing script file. Show Text Files Only Show TEXT files only, or show all files in file dialog. Save & Quit Quit eMACs. Before quiting, a ll changed buffer are saved to disk. Quit Quit eMACs. If there exist changed buffer which are not saved to disk, eMACs ask if the user is sure. € Edit Menu Undo This command is not supported in this version of eMACs. Cut Cut the region in the current buffer to the kill buffer. Same as the command Œkill-region¹. Copy Copy the region in the current buffer to the kill buffer. Same as the command Œcopy-region¹. Paste Paste the content of the kill buffer at the cursor in the current buffer. Same as the command Œyank¹. Clear Erase the region in the current buffer. Note that the text is not saved in the kill buffer. Justify Paragraph Justify the paragraph, i.e. text separated by blank lines, according to the fill-column length. Same as command Œfill-paragraph¹ Set Justify Column... Set the fill-column length for the text wrap around, and the justify paragraph command. Record Macro Record keyboard macro. When recording is started, the menu item changes to ŒStop Macro Recording¹. € Find Menu Search Forward... Search for text pattern in forward direction. User is prompted for search pattern. Same as command Œsearch-forward¹. Search Backward... Search for text pattern in backward direction. User is prompted for search pattern. Same as command Œsearch-backward¹. Next File Make next buffer in the buffer list the current buffer in the current screen window. Same as Œnext-buffer¹. Begin of File Move cursor to the beginning of the file, and scroll buffer to show the cursor in the screen window. End of File Move cursor to the end of the file, and scroll buffer to show the cursor in the screen window. Goto Line... Move cursor to line with specified line number. Same as command Œgoto-line¹. Scroll Line to Top Scroll the current screen window such that the line which contains the cursor is at the top of the screen window. Exchange Dot/Mark Exchange the position of the cursor (dot) and the mark. Same as command Œexchange-point-and-mark¹. Goto Matching Fence Move the cursor to the matching fence, i.e. Œ(¹, Œ)¹, Œ{¹, Œ}¹, Œ[¹, or Œ]¹. Same as command Œgoto-matching-fence¹. € Mode Menu This menu enables or disables an edit mode for the current buffer. See the section about Edit Modes for more information. The menu item ŒNone of the Above¹ disables all active modes for the current buffer. Same as the commands Œadd-mode¹ and Œdelete-mode¹. € Buffer Menu This menu contains the buffer list. Selecting a buffer from the menu replaces the current screen window content with the selected buffer. € Font Menu Currently eMACs support only one font type, ŒeMACs Font¹ which is based on monaco with a few modifications and additions. The lower part of this menu allows the user to select a font size. Currently sizes 6, 9, 10, and 12 are supported. Font size 6 is not very legible, but allows the user to view very long lines. € Status Menu Buffer Information Display information about the current buffer in the message line. Same as command Œstatistics¹. Count Words Displays word count statistics in the message line for the region in the current buffer. Same as command Œcount-words¹. List All Buffers Split the current window, and display information about all buffers. Same as command Œlist-buffers¹. List All Commands Split current window, and display a list of all commands available in eMACs and any keys bound to the commands. Same as command Œdescribe-bindings¹. Show Command... Show all command containing a text string. The user is prompted for a text string, the current window is split, and all commands containing the text string are displayed with their key bindings. Show Key Binding... Show the command bound to a key sequence. The user is prompted for a command key sequence, and the command bound to that key sequence is displayed. Help... The current screen window is split, and the ŒeMACs Help¹ file is loaded in the new screen window. The user can page through the window with ^V and M-V. Show Free Memory Shows the free RAM memory available for new text buffers. ______CUSTOMIZING RESOURCES_______________________________________________ The editor eMACs allows for customizing by changing several resources of the program. The user is expected to know what she or he is doing. Some of these resources are explained here. € ³EPRO² This resource contains the name of the eMACs startup file, containing custom key bindings and macros defined by the user. This file will be executed on start-up, if found using the PATH as defined in the ³PATH² resource). The current name for the startup file is ³eMACs Startup². € ³HELP² This resource contains the name for the eMACs help file. This file will be read into a buffer if Œhelp¹ is requested (Meta-h or via the Status menu). The file is searched using the PATH as defined in the ³PATH² resource. The current name for the help file is ³eMACs Help². € ³PATH² This resource contains the search path for locating the startup and help files. The path is a string containing the folders (full path, e.g. Disk:dir1:dir2), sub-folders (partial path, e.g. Œ:dir1:dir2¹). Paths are separated by semicolons. The ³PATH² resource can be changed to fit your own directories. The resource is a C-string, i.e. terminated with a NULL character. Though, if you plan on keeping the ³eMACs Folder² together with the eMACs program in the same folder, there is no need for changes. The current path is defined as ³; :eMACs Folder; System:System Folder:eMACs Folder; System:System Folder² This search will be done first in the folder eMACs was started from, then in the folder ³eMACs Folder² in the startup folder, then on the disk ³System² following the folder ³System Folder², and ³eMACs Folder². At last on the disk ³System² following the folder ³System Folder². € ³Eclr² This resource is used for the color definitions. The following items are colored as follows - Characters in buffers, dark blue (resource id. 200) - Mode line, azure (resource id. 201) - Information message, green (resource id. 202) - Error message, red (resource id. 203) - Warning message, dark yellow (resource id. 204). Colors are only displayed on color screens using a pixel width of at least 4 bits. The colors can be changed to the user¹s taste by changing the color resources (black is Œ0,0,0¹ and white is Œ65535, 65535, 65535¹). To turn off colors for eMACs when using a color screen with color active, delete all ³Eclr² resources. ______ACKNOWLEDGEMENTS____________________________________________________ The following people contributed to the MS-DOS version 3.8 of ³microEmacs², and its documentation, on which the eMACs editor is based: James Aldridge Dana Hoggat Guy Streeter Dawn Banks George Jones James Turner William W. Carlson Daniel M. Lawrence Dave Tweten Peter Chubb Oliver Sharp Linwood Varney Dave G. Conroy. Ken Shacklford Steve Wilhite Dave Forslund Sid Shapiro Mark Williams John Gamble Mike Spitzer ______eMACs COMMAND SET___________________________________________________ This sections describes all available commands in eMACs, and specifies the default key binding (changeable with command Œbind-to-key¹). € abort-command Œ^G¹ Abort any command which requests input from the user. € add-global-mode ŒM-m¹ Adds an edit mode to any new buffer. The user is prompted for the edit mode to add. See section on Edit Modes for possible modes. Hence, the modes for existing buffers do not change. € add-mode Œ^Xm¹ Adds an edit mode to the current buffer. The user is prompted for the edit mode to add. See section on Edit Modes for possible modes. € apropos ŒM-?¹ Show all command containing a text string. The user is prompted for a text string. The current window is split, and all commands containing the text string are displayed with their key bindings. € backward-character Œ^B¹ or ŒFN-<¹ The dot, and thus the cursor, moves backward by one character. Since the Œnewline¹ is a character, you can move over it just as any other character (on the screen this appears as a jump to the end of the previous line). € begin-macro ŒM-[¹ All keystrokes, commands and input are recorded as a keyboard macro until the command Œend-recording¹ is given. € beginning-of-file ŒM-<¹ or ŒFN-[¹ Moves the dot, and thus the cursor, to the beginning of the buffer, and scrolls the screen window if necessary. € beginning-of-line Œ^A¹ Moves the dot, and thus the cursor, to the beginning of the line and is between the first character on the line and the Œnewline¹ character of the previous line. € beginning-of-window ŒM-,¹ Moves the dot, and thus the cursor, to the beginning of the window, i.e. before the first character that is displayed in the current window. € bind-to-key ŒM-^B¹ Bind a command to a key sequence. The user is prompted for the named command and the key to which it is to be bound. The key(s) to which the command is to be bound are simply typed in exactly, i.e. to bind a command to, say M-d, type in the named command, a space, and then the ŒMeta¹ key and the character Œd¹. Key bindings can be undone with Œunbind-key¹. Permanent changes are done indirectly through the ³eMACs Startup² file. This is a file that eMACs reads and executes before startup and hence results in the appearance of a permanent change in the key bindings. The syntax of commands in the ³eMACs Startup² file is described under the Œexecute-file¹ command. The primary difference between the way parameters are passed to these commands in the ³eMACs Startup² file is that the keys are not typed in directly (as in the -A key when you want ^A) but symbolically using the following symbols: Œ^¹ for control keys, e.g. to indicate -A, type Œ^I¹. ŒM-¹ for the escape key, e.g. to indicate Meta--K, type ŒM-^K¹. ŒFN-¹ for function keys, e.g. to indicate F3, type ŒFN-c¹. € case-region-lower Œ^X^L¹ All of the characters in the region (between dot and mark) is changed to lower case. € case-region-upper Œ^X^U¹ All of the characters in the region (between dot and mark) is changed to upper case. € case-word-capitalize ŒM-c¹ or ŒM-C¹ The word starting at the cursor is capitalized, i.e. the first letter is changed to upper case, any following letter are changed to lower case. € case-word-lower ŒM-l¹ or ŒM-L¹ The letters of the word from the cursor to the end of the word are changed to lower case. € case-word-upper ŒM-u¹ or ŒM-U¹ The letters of the word from the cursor to the end of the word are changed to upper case. € change-screen-size ŒM-^S¹ Sets the screen length for the Macintosh window as specified by the parameter. If no parameter is specified, the size is screen set to the maximum number of lines. E.g. ŒM-12 M-^S¹ changes the screen size to fit 12 lines. € change-screen-width ŒM-^T¹ Sets the screen width for the Macintosh window as specified by the parameter. If no parameter is specified, the size size is set to the maximum number of columns. E.g. ŒM-40 M-^T¹ changes the screen size to fit 40 columns characters. € clear-and-redraw Œ^L¹ or ŒFN-~¹ The screen is blanked and redrawn. Useful if the screen is cluttered. € clear-message-line Clears the message line. Intended for usage in macros and executable files. € copy-line ŒM-k¹ Copy the text from the cursor to the end of the line into the kill buffer. € copy-region ŒM-w¹ or ŒFN-c¹ Copy text between cursor and mark into the kill buffer. € count-words ŒM-^C¹ Displays word count statistics in the message line for the text between the cursor and the mark in the current buffer. Information displayed is number of words, characters, and lines, and the average number of characters per word. € delete-blank-lines Œ^X^O¹ This function deletes blank lines around the cursor. What this command does depends if the cursor is on a blank line. If the cursor is on a blank line, this command deletes all the blank lines above and below the current line. If it is on a non blank line then it deletes all of the blank lines after that line. € delete-buffer Œ^Xk¹ Delete a buffer from the buffer list. The user is prompted for the name of a buffer. If the buffer has been changed, the user is asked to confirm the deletion since killing the buffer would eliminate all changes. To find out about all buffers, use the command Œlist-buffers¹. € delete-global-mode ŒM-^M¹ Deletes an edit mode from the modes to be added to any new buffer. The user is prompted for the edit mode to delete. See section on Edit Modes for possible modes. Hence, the modes for existing buffers do not change. € delete-mode Œ^X^M¹ Deletes an edit mode from the current buffer. The user is prompted for the edit mode to add. See section on Edit Modes for possible modes. € delete-next-character Œ^D¹ or ŒFN-#¹ Deletes the character under the cursor. At the end of the line, the Œnewline¹ character is deleted, i.e. the next line is joined with this line. € delete-next-word ŒM-d¹ or ŒM-FN-#¹ Deletes the text from the cursor to the end of the word. If the cursor does not reside in a word, up to the next word is deleted including any punctuation. € delete-other-windows Œ^X1¹ Closes all windows on the screen except the current screen window, i.e. the one the cursor is in. € delete-previous-character Œ^?¹ or Œ^H¹ Deletes the character just before the cursor. At the beginning of the line, the Œnewline¹ character of the previous line is deleted, i.e. this line is joined with the previous line. € delete-previous-word ŒM-¹ or ŒM-^H¹ Deletes the text from the cursor to the beginning of the word. If the cursor does not reside in a word, up to the previous word is deleted including any punctuation. € delete-window Œ^Xd¹ Deletes the current window from the screen. At least one window must remain on the screen. € describe-bindings ŒM-O¹ Lists all commands available in eMACs, and all existing key bindings. The current window is split, and a list of all commands with any key bindings is displayed. € describe-key ŒM-o¹ Describes a current key binding. The user is prompted for the key sequence. € end-of-file ŒM->¹ or ŒFN-]¹ Moves the dot, and thus the cursor, to the end of the buffer, and scrolls the screen window if necessary. € end-of-line Œ^E¹ Moves the dot, and thus the cursor, to the end of the line and is between the last character on the line and the Œnewline¹ character of the that line. € end-of-window ŒM-.¹ Moves the dot, and thus the cursor, to the end of the window, i.e. behind the last character that is displayed in the current window. € end-macro ŒM-]¹ Stop recording keystrokes for a keyboard macro. The macro can be executed with the command Œexecute-macro¹. € exchange-point-and-mark Œ^X^X¹ Exchanges the cursor and mark with each other. As there is only one region available at a time, moving by regions is restricted to moving from one end of the region to the other. The region is defined by the dot (cursor) at one end and the mark (set by the command Œset-mark¹) at the other. Exchanging dot and mark effectively moves from one end of the region to the other. € execute-buffer Executes the text in a buffer. The user is prompted for a buffer name. If the buffer exists, eMACs will assume that its content consists of commands to be executed by it before returning control. If any of the commands are incorrect in the buffer, eMACs aborts the command and returns control immediately. The syntax of commands in the buffer is ³[numeric argument] named-command [string argument] [string argument]² where the only required parameter is the named-command itself. Executable text may include the definition and usage of numbered macros. See the section on macro language for more information. € execute-command-line Executes a command to be specified on the message line. The user is prompted for the command. Syntax is the same as described for the command Œexecute-buffer¹. € execute-file Executes the text in a file. The user is prompted for the file name. If the file exists, eMACs will assume that its content consists of commands to be executed by it before returning control. If any of the commands are incorrect in the file, eMACs aborts the command and returns control immediately. The syntax of commands in the file is ³[numeric argument] named-command [string argument] [string argument]² where the only required parameter is the named-command itself. Executable text may include the definition and usage of numbered macros. See the section on macro language for more information. € execute-macro Œ^Xe¹ or ŒFN-f¹ Execute the current keyboard macro, i.e. the entire sequence of previously recorded keystrokes is repeated starting at the current point. The result is exactly as if the sequence was retyped all over again. A numeric argument prefixing the Execute-Macro command repeats the stored keystrokes that many times. € execute-macro-1 ... execute-macro-40 Execute a numbered macro. The macro can be defined by executing its definition with one of the Œexecute¹ command, or by defining it in the ³eMACs Startup² file. The macro is defined as follows: ³[macro number] store-macro commands... !endm² For more information, see the section on Macro Language. € execute-named-command ŒM-x¹ Executes the command to be specified. The user is prompted for the command name. The eMACs program tries to complete the command when the user hit the space bar, i.e. if the information that is typed in so far is sufficient to identify the command uniquely, eMACs finishes typing it in and then waits for the before executing the command. € exit-emacs Œ^X^C¹ Exits the eMACs editor. If there are changed buffers which have not been saved, the user will will be queried. € fill-column Œ^Xf¹ Sets the wrap margin to the given numeric argument. If the user does not precede this command with a numeric argument (with ŒMeta-¹), the current setting for the wrap margin is shown in the message line. € fill-paragraph ŒM-j¹ Fills the paragraph that the cursor is in, i.e. adjusts the right margin of all lines in the paragraph to keep the text within the wrap margin setting. See also Œfill-column¹. € find-file Œ^X^F¹ Finds an existing file to be specified. The user is prompted for the file name with the standard file dialog. First eMACs attempts to find the specified file within one of the existing buffers. If it finds the file it switches to that buffer. If it does not find the file, it will create a new buffer, read the specified file into it, and switch to the new buffer. € forward-character Œ^F¹ or ŒFN->¹ The dot, and thus the cursor, moves forward by one character. Since the Œnewline¹ is a character, you can move over it just as any other character (on the screen this appears as a jump to the beginning of the next line). € goto-line ŒM-#¹ or ŒM-FN->¹ Moves the cursor to the line specified by the numeric argument. If no argument is specified, the user is prompted for the line number. € goto-matching-fence ŒM-(¹ or ŒM-)¹ Moves the cursor to the matching fence. Recognized fences are: Œ(¹, Œ)¹, Œ{¹, Œ}¹, Œ[¹, or Œ]¹. If no matching fence could be found, eMACs beeps and the cursor remains unchanged. € grow-window Œ^Xz¹ Enlarges the current window by one line and the nearest window is shrunk by one line. € help ŒM-h¹ Show the help ³eMACs Help² file. A special buffer is created, and the help file is read into it. The current screen window is split and the buffer is shown in one part of the split window of up to 8 lines high (this is the assumed size of a page in the ³eMACs Help² file). € hunt-forward Repeats the last forward search command. Thus this is identical to command ³search-forward¹ and then defaulting the search string (by simply giving an at the prompt line). € hunt-reverse Repeats the last reverse search command. Thus this is identical to command ³search-reverse¹ and then defaulting the search string (by simply giving an at the prompt line). € incremental-search Œ^S¹ Searches incrementally in the forward direction for a text pattern, i.e. searches for the pattern while it is being typed in. In the incremental search mode the following command can be used: ^S Search in forward direction for the next occurrence. ^R Search in backward direction for the next occurrence. ^Q Quote next character, i.e. take it literally. Put Œnewline¹ in search string. Put tab in search string. or ^H Go back to previous occurrence of string, or if at the first occurrence delete last character from the search buffer. € insert-file Œ^X^I¹ Inserts an existing file at the cursor in the current buffer . The user is prompted for the file name with the standard file dialog. € insert-space Inserts a space at the cursor in the current buffer. While not particularly useful in general (since the space-bar does the same thing more easily) it is very useful when you are in "overwrite" mode. € insert-string Inserts a string at the cursor in the current buffer. The user is prompted for the string. € insert-tab Œ^I¹ Inserts a character at the cursor in the current buffer. If the tab size is a power of two, a character is inserted, otherwise the required tab distance is obtained by inserting a number of characters. The tab size can be set with command Œset-tab-size¹. € kill-line Œ^K¹ Deletes the line from the cursor until the end of the line. If the cursor is at the beginning of the line, all characters are deleted into the kill buffer from the cursor to the end of the line including the Œnewline¹ character. If the cursor is not at the beginning of the line, the command behaves the same as Œkill-to-end-of-line¹. € kill-region Œ^W¹ or ¹FN-b¹ Deletes the region (between cursor and mark) and places the deleted text in the kill buffer. See also the command Œyank¹. € kill-paragraph ŒM-^W¹ Deletes the paragraph (text between two empty lines) and places the deleted text in the kill buffer. See also the command Œyank¹. € kill-to-end-of-line Œ^X^K¹ Deletes the line from the cursor until the end of the line. All characters from point to the end of the line are deleted. The Œnewline¹ character is not deleted. See also command Œkill-line¹. € line-to-top-of-window ŒM-!¹ Scrolls the current screen window such that the line which contains the cursor moves to the top of the screen window. € list-buffers Œ^X^B¹ Lists all buffers. A new window is created into the ³List² buffer which contains details about all the buffers currently known to eMACs. The ³List² buffer indicates for every buffer if the associated file is read into memory, if the buffer is changed, the enabled edit modes, the size, the name, and the associated filename and folders. The last line shows the enabled global edit modes. € maximum-screen-size ŒM-g¹ Changes the Macintosh screen window size to the maximum size. Actual screen window size will depend upon used font size. Maximum size will be 75 lines with 150 characters, but will be limited by actual screen size. € minimum-screen-size ŒM-s¹ Changes the Macintosh window size to the minimum size. € name-buffer ŒM-^N¹ Changes the buffer name for the current buffer. The user is prompted for the new buffer name. The file name remains unchanged by the command (see command Œwrite-file¹ to change file name). € newline Œ^M¹ Inserts a Œnewline¹ character at the cursor. Note that this is a character like any other and can be deleted or inserted at any place. However it looks different because it acts like the carriage-return line feed pair. € newline-and-indent Œ^J¹ Inserts a Œnewline¹ character at the cursor, and indents to previous line's indentation. € next-buffer Œ^Xx¹ Puts the next buffer in the buffer list in the current screen window. This command cycles through the buffer list and at the last buffer, it will continue with the first buffer in the list. € next-line Œ^N¹ or ŒFN-_¹ Moves the cursor to the next line keeping the column position the same. If the next line is not long enough to keep the same column, the cursor is placed at the end of the line. However, the column the cursor was in is remembered, and the cursor moves to it when moved to the starting line or another line that contains text in that column. If the point is at the bottom line of the screen, the screen scrolls forward so that the next line of the text is centered on the new screen. € next-page Œ^V¹ or ŒFN-}¹ Scrolls up the current screen window so that the next set of lines can be shown in the window. An overlap of two lines is retained for continuity, i.e. the two bottom lines of the original screen window scroll to the top of the window. The cursor is left at the home position (top left hand corner). € next-paragraph ŒM-n¹ Moves to the end of the paragraph. A paragraph is defined as a section of text separated from other text by blank lines, or a line starting with blanks, or a line starting with a tab character. € next-window Œ^Xn¹ Moves cursor to the the next window on the screen, i.e. makes the next window on the screen the current window. This command cycles through the screen windows, i.e. at the bottom window, the top window is made the current one. € next-word ŒM-f¹ Moves the cursor from its current location to the end of the word. A word is defined to be contiguous characters separated by spaces or punctuation marks. € open-line Œ^O¹ Inserts an open line at cursor for entering text. € previous-line Œ^P¹ or ŒFN-^¹ Moves the cursor to the same column in the previous line. If there is no text in the column of the previous line, the cursor is set at the end of the line. However, the column the cursor was in is remembered, and the cursor moves to it when moved to the starting line or another line that contains text in that column. If the point is on the top line of the screen, the screen scrolls backward so that the previous line of the text is centered on the new screen. € previous-page ŒM-v¹ or ŒFN-{¹ Scrolls down the current screen window so that the previous set of lines can be shown in the window. An overlap of two lines is retained for continuity, i.e. the two top lines of the original screen window scroll to the bottom of the window. The cursor is left at the home position (top left hand corner). € previous-paragraph ŒM-p¹ Moves to the beginning of the previous paragraph. A paragraph is defined as a section of text separated from other text by blank lines, or a line starting with blanks, or a line starting with a tab character. € previous-window Œ^Xp¹ Moves cursor to the the previous window on the screen, i.e. makes the previous window on the screen the current window. This command cycles through the screen windows, i.e. at the top window, the bottom window is made the current one. € previous-word ŒM-b¹ Moves the cursor from its current location to the beginning of the word. A word is defined to be contiguous characters separated by spaces or punctuation marks. € query-replace-string ŒM-q¹ Query replaces a string with another one. Replace occurrences of the search string with the replace string from cursor to end of the buffer. When a searched string is found, the command pauses and queries the user for action. The response expected from the user and their effects are as follows: ŒY¹ or Œspace¹ Make this replacement. ŒN¹ Do not make this replacement but continue. Œ!¹ Do the rest of the replacements with no queries. Œ^G¹ Abort the replacement command. This does not undo any previous replacement that you had authorized. Œ.¹ Exactly like Œ^G¹ except that the cursor returns to the point at which the replacement command was given. Œ?¹ Shows this list of options in the message line. € quick-exit Œ^XC¹ Quickly exits eMACs. This commands saves all changed buffers under the current associated filenames. Hence this could be a very dangerous command if there are changed buffers which will overwrite files that should left unchanged. € quote-character Œ^Q¹ Inserts next typed character literally. This commands allows for inserting certain control characters to appear in your text. € read-file Œ^X^R¹ Reads an existing file into the current buffer overwriting any text already in it. If the buffer has been changed and not yet saved, the user will be asked to confirm the overwrite. The user is prompted for the file name with the standard file dialog. € replace-string ŒM-r¹ Replaces all occurrences of the search string with the replacement string from point to end of the buffer. See also the command Œquery-replace-string¹. € reverse-incremental-search Œ^R¹ Searches incrementally in the backward direction for a text pattern, i.e. searches for the pattern while it is being typed in. In the incremental search mode the following command can be used: ^S Search in forward direction for the next occurrence. ^R Search in backward direction for the next occurrence. ^Q Quote next character, i.e. take it literally. Put Œnewline¹ in search string. Put tab in search string. or ^H Go back to previous occurrence of string, or if at the first occurrence delete last character from the search buffer. € resize-window Œ^Xw¹ Resizes the current screen window to the size specified by the argument. The current window is resized to the requested size, and the other screen windows are changed in size accordingly. € restore-window Restores the window that was saved with the command Œsave-window¹ as the current window. This command is merely useful in macros. € save-file Œ^Xs¹ or Œ^X^S¹ Saves the buffer under the current file name. Saves the contents of the current buffer with the associated filename in the associated folder. This command leaves the file type unchanged as opposed to the command Œwrite-file¹. € scroll-window-down Œ^Z¹ Scrolls the current screen window down one line, i.e. the top line of the window disappears and the next line becomes visible at the bottom. € scroll-window-up ŒM-z¹ Scrolls the current screen window up one line, i.e. the bottom line of the window disappears and the previous line becomes visible at the top. € search-forward Œ^XS¹ Searches forward for a text pattern. The user is prompted for the searched string. Searches for string (or already stored string from previous search if input string is null) from the cursor towards the end of the buffer. The cursor is moved from the current location to the end of the found string. € search-reverse Œ^XR¹ Searches backward for a text pattern. The user is prompted for the searched string. Searches for string (or already stored string from previous search if input string is null) from the cursor towards the beginning of the buffer. The cursor is moved from the current location to the beginning of the found string. € save-window Saves the current window, i.e. eMACs remembers this current window when it is asked to restore it at a later time with the command Œrestore-window¹. This command is merely useful in macros. € scroll-next-window-up ŒM-^Z¹ Scrolls the screen window next to the current window up one line, i.e. the bottom line of the window disappears and the previous line becomes visible at the top. € scroll-next-window-down ŒM-^V¹ Scrolls the screen window next to the current window down one line, i.e. the top line of the window disappears and the next line becomes visible at the bottom. € select-buffer Œ^Xb¹ Selects a buffer. The user is prompted for a buffer name and will be switched to it. If the buffer does not exits, eMACs will create a buffer with that name, and make it the current buffer. The command Œlist-buffers¹ shows all existing buffers. € set Œ^Xa¹ Sets a variable to a specified value. See the section on macro language for the possible variables. € set-screen-font-size ŒM-^F¹ This command sets the screen font size to the requested value, or if no argument is specified to the default value. € set-mark Œ^@¹ or ŒM-¹ Sets the mark at the cursor location. The mark together with the cursor is used to identify the boundary of a region. € set-tab-size ŒM-^I¹ Sets the tab size to be shown on the screen. If the tab size is a power of two and larger than 1, i.e. 2, 4, 8, 16, etc., actual characters are inserted in the file. Otherwise the tab size is obtained by inserting characters. A character can be inserted with the command Œinsert-tab¹. € shrink-window Œ^X^Z¹ Shrinks the current window by one line and the nearest window is enlarged by one line. € split-current-window Œ^X2¹ Splits the current screen window into two windows, if there is enough space on the screen (a minimum of 1 line of text and 1 mode line per window are required). Thus a window can be split if its size is at least 3 lines (not counting the mode line). € statistics ŒM-=¹ Shows statistics about the current buffer in the message line. The following information is displayed: - Current line number - Total number of lines - Current column number - Number of columns in current line - Current character number from the beginning of the buffer - Total number of characters - Percentage of the buffer before the cursor - Ascii code in hexadecimal of the character under the cursor. € store-macro Stores numbered macro. The macro number is specified by the argument. See section on macro language. € transpose-characters Œ^T¹ Transposes the characters before the cursorwith eachother. This command is ignored if the cursor is in the first or second column of a line. € unbind-key ŒM-^U¹ Unbinds a key binding. This command undoes the effect of the command Œbind-to-key¹ or any built-in key bindings. The user is prompted for the key to unbind. € universal-argument Œ^U¹ Argument for repetitive execution of a command or macro. Every Œuniversal-argument¹ command will multiply the number with 4, starting at 4. € unmark-buffer ŒM-~¹ Unmarks the buffer as changed, i.e. removes the changed flag from the buffer. € update-screen Forces an immediate update of the screen (useful in macros). € view-file Œ^X^V¹ Views an existing file to be specified. The user is prompted for the file name with the standard file dialog. First eMACs attempts to find the specified file within one of the existing buffers. If it finds the file it switches to that buffer. If it does not find the file, it will create a new buffer, read the specified file into it, and switch to the new buffer. The ŒView¹ edit mode is enabled for the buffer, i.e. the buffer is made read only. See also the section on Edit Modes. € write-file Œ^X^W¹ Saves the buffer under a new file name. The user is prompted for the new file name using the standard file dialog. The buffer contents will be saved in the newly created file. If the file under that name already exists in the folder, the user is asked if overwriting is permitted. This command will create, or change in case the file already exists, an eMACs document, as opposed to the command Œsave-file¹ that leaves the file type unchanged. € write-message Writes a string in the message line. The user is prompted for the string to be displayed. Useful command for macros. € yank Œ^Y¹ or ŒFN-d¹ Inserts a copy of the kill buffer into current buffer at the cursor. See also section on Cutting & Pasting, and any of the Œkill¹ commands. .