IMD 1.17: 19/01/2010 20:55:35 emacs v1.1 1of3 Tektronix 4400P32 Emacs -- Version 1.1V 12UniFLEX Backup L9&info.dat/emacs/databases  6;d;e;f 4;b2$L@ `$lߌ;t"zpdpdj2  !"#$%&'()*+,-./01234('&%$#"! Node: top Info Command Summary Up: (dir) Type "l" to resume info. Type "h" for an INFO tutorial. Type to see the next screen. ,^V next screen ,ESC-V previous screen (^H) ? visit this node (command-summary) @ menu path (enter menu items separated by spaces.) a scroll one line down b beginning of node d go to dir node (the top of the tree) e end of node f go to  /@L9//emacsV 12@@@a footnote (prompts for footnote name) g go to a node (prompts for nodespec) h help -- visit an info tutorial l return to last node (retrace your path through the tree) m go to a menu item (prompts for item name) n go to Next node in sequence p go to Previous node in sequence q quit info r, ^R search-reverse (string-search) s, ^S search-forward (string-search) u go Up to th" /L9-/emacs/databases/emacsmaclibmaclibis node's father x, ESC-X execute-extended-command z scroll one line up (most ^X commands not pertaining to file saving also work.) Pointing and clicking the mouse in the top line also visits nodes. Type "l" to return to INFO, or (^H) to see the previous screen Node: top This is the top of the tree This is the Emacs INFO structured documentation reader. Type "h" for a tutorial introduction to INFO, "?" for a list of INFO commands. Point the mouse cursor at any menu line and press the left button to visit the node described on that line. * menu: * Emacs: (emacs)Top The EMACS editor * Quick: (emacs)quick: Quick reference to Emacs commands. Node: ! Up: Commands, Next: != (! e ) MLisp function that returns not e . 1 1 Node: != Up: Commands, Previous: !, Next: % (!= e e ) MLisp function that returns true iff e != e . 1 2 1 2 Node: % Up: Commands, Previous: !=, Next:=, Next: >= (> e e ) MLisp function that returns true iff e > e . 1 2 1 2 Node: >= Up: Commands, Previous: >, Next: >> (>= e e ) MLisp function that returns true iff e >= e . 1 2 1 2 Node: >> Up: Commands, Previous: >=, Next: ^ (>> e e ) MLisp function that returns e >> e (the C shift right 1 2 1 2 operator). Node: Abbrev mode Up: Introductio & (% e e ) MLisp function that returns e % e (the C mod operator). 1 2 1 2 Node: & Up: Commands, Previous: %, Next: * (& e e ) MLisp function that returns e & e . 1 2 1 2 Node: * Up: Commands, Previous: &, Next: + (* e e ) MLisp function that returns e * e . 1 2 1 2 Node: + Up: Commands, Previous: *, Next: - (+ e e ) MLisp function that returns e + e . 1 2 n, Next: Extensibility Abbrev mode allows the user to type abbreviations into a document and have Emacs automatically expand them. If you have an abbrev called "rhp" that has been defined to expand to the string "rhinocerous party" and have turned on abbrev mode then typing the first non-alphanumeric character after having typed "rhp" causes the string "rhp" to be replaced by "rhinocerous party". The capitalization of the typed in abbreviation controls the capitalization of  1 2 Node: - Up: Commands, Previous: +, Next: / (- e e ) MLisp function that returns e - e . 1 2 1 2 Node: / Up: Commands, Previous: -, Next: < (/ e e ) MLisp function that returns e / e . 1 2 1 2 Node: < Up: Commands, Previous: /, Next: << (< e e ) MLisp function that returns true iff e < e . 1 2 1 2 Node: << Up: Commands, Previous: <, Nethe expansion: "Rhp" would expand as "Rhinocerous party" and "RHP" would expand as "Rhinocerous Party". Abbreviations are defined in abbrev tables. There is a global abbrev table which is used regardless of which buffer you are in, and a local abbrev table which is selected on a buffer by buffer basis, generally depending on the major mode of the buffer. Define-global-abbrev takes two arguments: the name of an abbreviation and the phrase that it is to expand to. The abbreviation will be xt: <= (<< e e ) MLisp function that returns e << e (the C shift left 1 2 1 2 operator). Node: <= Up: Commands, Previous: <<, Next: = (<= e e ) MLisp function that returns true iff e <= e . 1 2 1 2 Node: = Up: Commands, Previous: <=, Next: > (= e e ) MLisp function that returns true iff e = e . 1 2 1 2 Node: > Up: Commands, Previous: defined in the global abbrev table. Define-local-abbrev is like define-global-abbrev except that it defines the abbreviation in the current local abbrev table. The use-abbrev-table command is used to select (by name) which abbrev table is to be used locally in this buffer. The same abbrev table may be used in several buffers. The mode packages (like electric-c and text) all set up abbrev tables whose name matches the name of the mode. The switch abbrev-mode must be turned on before Emacs will attempt to expand abbreviations. When abbrev-mode is turned on, the string "abbrev" appears in the mode section of the mode line for the buffer. Use-abbrev-table automatically turns on abbrev-mode if either the global or new local abbrev tables are non-empty. All abbreviations currently defined can be written out to a file using the write-abbrev-file command. Such a file can be edited (if you wish) and later read back in to define the same abbreviations again. Read-es it backward one character. ^N moves dot to the same column on the next line, ^P moves it to the same column on the previous line. String searches may be used to move dot by using the ^S command to search in the forward direction and ^R to search in the reverse direction. Deletions may be performed using ^H (backspace) to delete the character to the left of dot and ^D to delete the character to the right of dot. The following table summarizes all of the motion and deletion commands. abbrev-file reads in such a file and screams if it cannot be found, quietly-read-abbrev-file doesn't complain (it is primarily for use in startups so that you can load a current-directory dependant abbrev file without worrying about the case where the file doesn't exist). People writing MLisp programs can have procedures invoked when an abbrev is triggered. Use the commands define-hooked-global-abbrev and define-hooked-local-abbrev to do this. These behave exactly as t Direction Move Delete Units of Motion Left Right Left Right Characters ^B ^F ^H ^D Words ESC-B ESC-F ESC-H ESC-D Intra line ^A ^E ^K Inter line ^P ^N Node: Buffers and Windows Up: Introduction, Previous: Getting Help, Next: Compiling Programs There are two fundamental objects in Emacs, buhe unhooked versions do except that they also associate a named command with the abbrev. When the abbrev triggers, rather than replacing the abbreviation with the expansion phrase the hook procedure is invoked. The character that trigged the abbrev will not have been inserted, but will be inserted immediately after the hook procedure returns [unless the procedure returns 0]. The abbreviation will be the word immediately to the left of dot, and the function abbrev-expansion returns thffers and windows. A buffer is a chunk of text that can be edited, it is often the body of a file. A window is a region on the screen through which a buffer may be viewed. A window looks at one buffer, but a buffer may be on view in several windows. It is often handy to have two windows looking at the same buffer so that you can be looking at two separate parts of the same file, for example, a set of declarations and a piece of code that uses those declarations. Similarly, it is often hae phrase that the abbrev would have expanded to. Node: Basic Commands Up: Introduction, Previous: Invoking Emacs, Next: Unbound Commands Normally each character you type is interpreted individually by Emacs as a command. The instant you type a character the command it represents is performed immediately. All of the normal printing characters when struck just insert themselves into the buffer at dot. To move dot there are several simple commands. ^F moves dot forward one character, ^B movndy to have two different buffers on view in two windows. The commands which deal with windows and buffers are: beginning-of-window (ESC-,), delete-other-windows (^X1), delete-region-to-buffer (ESC-^W), delete-window (^XD), end-of-window (ESC-.), enlarge-window (^XZ), line-to-top-of-window (ESC-!), list-buffers (^X^B), next-window (^XN), page-next-window (ESC-^V), previous-window (^XP), shrink-window (^X^Z), split-current-window (^X2), switch-to-buffer (^XB), use-old-buffer (^X^O) and yank-buffer (ESC-^Y). See the command description section for more details on each of these. Node: Command prefix, also known as META Up: Comm The next character typed will be interpreted as a command based on the fact that it was preceded by ESC. The name meta for the ESC character comes from funny keyboards at Stanford and MIT that have a Meta-shift key which is used to extend the ASCII character set. Lacking a Meta key, we make do with prefixing with an ESC character. You may see (yping ^X^E. - If there were errors, step through them correcting the error. - When you run out of error messages, type ^X^E to try the compilation again. - When you finally manage to get your beast to compile without any errors, type ^C to say goodbye to Emacs. Node: Extensibility Up: Introduction, Previous: Abbrev mode, Next: Searching Emacs has two extension features: macros and a built in Lisp system. Macros are used when you have something quick and simple to doand hear) commands like ESC-V referred to as Meta-V. Sometimes the ESC key is confusingly written as $, so ESC-V would be written as $V. ESC is also occasionally referred to as Altmode, from the labeling of a key on those old favorites, model 33 teletypes. Node: Compiling programs Up: Introduction, Previous: Buffers and Windows One of the most powerful features of Emacs is the facility provided for compiling programs and coping with error messages from the compilers. It essential that you un, Lisp is used when you want to build something fairly complicated like a new language dependant mode. A macro is just a piece of text that Emacs remembers in a special way. When a macro is executed the characters that make up the macro are treated as though they had been typed at the keyboard. If you have some common sequence of keystrokes you can define a macro that contains them and instead of retyping them just call the macro. There are two ways of defining macros: The eaderstand the standard program "update" (even if you don't use Emacs). This program takes a database (a makefile) that describes the relationships among files and how to regenerate (recompile) them. If you have a program that is made up of many little pieces that have to be individually compiled and carefully crafted together into a single executable file, update can make your life orders of magnitude easier; it will automatically recompile those pieces that need to be recompiledsiest is called a keyboard macro. A keyboard macro is defined by typing the start-remembering command (^X() then typing the commands which you want to have saved (which will be executed as you type them so that you can make sure that they are right) then typing the stop-remembering command (^X)). To execute the keyboard macro just type the execute-keyboard-macro command (^Xe). You can only have one keyboard macro at a time. If you define a new keyboard macro the old keyboard macro vanishes in and put them together. Emacs has a set of commands that gracefully interact with this facility. The ^X^E (execute) command writes all modified buffers and executes the update program. The output of make will be placed into a buffer called Error log which will be visible in some window on the screen. So, the general scenario for dealing with programs is: - Build an update database to describe how your program is to be compiled. - Compile your program from within Emacs by tto the mist. Named macros are slightly more complicated. They have names, just like commands and MLisp functions and can be called by name (or bound to a key). They are defined by using the define-string-macro command (which must be executed by typing ESC-Xdefine-string-macro since it isn't usually bound to a key) which asks for the name of the macro and it's body. The body is typed in as a string in the prompt area at the bottom the the screen and hence all special characters in it must be quoted by prefixing them with ^Q. A named macro may be executed by typing ESC-Xname-of-macro or by binding it to a key with bind-to-key. The current keyboard macro can be converted into a named macro by using the define-keyboard-macro command which takes a name a defines a macro by that name whose body is the current keyboard macro. The current keyboard macro ceases to exist. Emacs contains an interpreter for a language that in many respects resembles Lisp. The primary (some would xpressions: 1 The integer constant 1. "hi" A two character string constant "\^X\^F" A two character string constant """what?""" A seven character string constant (+ 2 2) An invocation of the "+" function with integer arguments 2 and 2. "+" is the usual addition function. This expression evaluates to the integer 4. (setq bert (* 4 12)) An invocation of the function setq with the variable bert say only) resemblance between Mock Lisp and any real Lisp is the general syntax of a program, which many feel is Lisp's weakest point. The differences include such things as the lack of a cons function and a rather peculiar method of passing parameters. The syntax of MLisp expressions There are four basic syntactic entities out of which MLisp expressions are built. The two simplest are integer constants (which are optionally signed strings of digits) and string constants (which are sequences o as its first argument and and expression that evaluates the product of 4 and 12 as its second argument. The evaluation of this expression assigns the integer 48 to the variable bert. (visit-file "mbox") An invocation of the function visit-file with the string "mbox" as its first argument. Normally the visit-file function is tied to the key ^X^B. When it is invoked if characters bounded by double quote [``"''] characters -- double quotes are included by doubling them: """" is a one character string. The third are names which are used to refer to things: variables or procedures. These three are all tied together by the use of procedure calls. A procedure call is written as a left parenthesis, ``('', a name which refers to the procedure, a list of whitespace separated expressions which serve as arguments, and a closing right parenthesis, ``)''. An expressnteractively, either by typing ^X^B or ESC-Xvisit-file, it will prompt in the minibuf for the name of the file. When called from MLisp it takes the file name from the parameter list. All of the keyboard-callable function behave this way. Names may contain virtually any character, except whitespace or parens and they cannot begin with a digit, ``"'' or ``-''. The evaluation of MLisp expressions Variables must be declared (boundion is simply one of these four things: an integer constant, a string constant, a name, or a call which may itself be recursivly composed of other expressions. String constants may contain the usual C excape sequences, "\n" is a newline, "\t" is a tab, "\r" is a carriage return, "\b" is a backspace, "\e" is the escape (033) character, "\nnn" is the character whose octal representation is nnn, and "^\c" is the control version of the character c. For example, the following are legal MLisp e) before they can be used. The declare-global command can be used to declare a global variable; a local is declared by listing it at the beginning of a progn or a function body (ie. immediately after the function name or the word progn and before the executable statements). For example: (defun (foo i (setq i 5) ) ) defines a rather pointless function called foo which declares a single local variable i and assigns it the value 5. Unlike real Lisp systems, the list of declared variables is not surrounded by parenthesis. Expressions evaluate to values that are either integers, strings or markers. Integers and strings are converted automaticly from one to the other type as needed: if a function requires an integer parameter you can pass it a string and the characters that make it up will be parsed as an integer; similarly passing an integer where a string is required will cause the integer to be converted. Variables may have either tis normally tied to the ^XB key, normally prompts for a buffer name and may be called from MLisp like this: (switch-to-buffer string-expression). Scope issues There are several sorts of names that may appear in MLisp programs. Procedure, buffer and abbrev table names are all global and occupy distinct name space. For variables there are three cases: 1. Global variables: these variables have a single instance and are created either by using declare-global, set-default ype and their type is decided dynamically when the assignment is made. Marker values indicate a position in a buffer. They are not a character number. As insertions and deletions are performed in a buffer, markers automatically follow along, maintaining their position. Only the functions mark and dot return markers; the user may define ones that do and may assign markers to variables. If a marker is used in a context that requires an integer value then the ordinal of the posior setq-default. Their lifetime is the entire editing session from the time they are created. 2. Local variables: these have an instance for each declaration in a procedure body or local block (progn). Their lifetime is the lifetime of the block which declares them. Local declarations nest and hide inner local or global declarations. 3. Buffer-specific variables: these have a default instance and an instance for each buffer in which they have been exption within the buffer is used; if a marker is used in a context that requires a string value then the name of the marked buffer is used. For example, if there has been assigned some marker, then (pop-to-buffer there) will pop to the marked buffer. (goto-character there) will set dot to the marked position. A procedure written in MLisp is simply an expression that is bound to a name. Invoking the name causes the associated expression to be evaluated. Invocation may be triggered either licitly given a value. They are created by using declare-buffer-specific. When a variable which has been declared to be buffer specific is assigned a value, if an instance for the current buffer hasn't been created then it will be. The value is assigned to the instance associated with the current buffer. If a buffer specific variable is referenced and an instance doesn't exist for this buffer then the default value iby the evaluation of some expression which calls the procedure, by the user typing it's name to the ESC-X command, or by striking a key to which the procedure name has been bound. All of the commands listed in section COMMAND DESCRIPTION may be called as MLisp procedures. Any parameters that they normally prompt the user for are taken as string expressions from the argument list in the same order as they are asked for interactivly. For example, the switch-to-buffer command, which s used. This default value may be set with either setq-default or set-default. If a global instance exists when a variable is declared buffer-specific then the global value becomes the default. MLisp functions An MLisp function is defined by executing the defun function. For example: (defun (silly (insert-string "Silly!") ) ) defines a function called silly which, when invoked, just inserts the string "Silly!" into the current buffer. MLisp has a rather strange (relative to other languages) parameter passing mechanism. The arg function, invoked as (arg i prompt) evaluates the i'th argument of the invoking function if the invoking function was called interactivly or, if the invoking function was not called interactivly, arg uses the prompt to ask you for the value. Consider the following function: (defun (in-parens (insert-string "(") (insert-string (arg 1 "String to insert? ")) rt of language-specific assistance. In this Emacs a mode is no more that a set of functions, variables and key-bindings. This mode package is designed to be useful when editing Scribe source files. (defun The apply-look function makes the current word "look" different by changing the font that it is printed in. It positions dot at the beginning of the word so you can see where the change will be  (insert-string ")") ) ) If you type ESC-Xin-parens to invoke in-parens interactivly then Emacs will ask in the minibuffer "String to insert? " and then insert the string typed into the current buffer surrounded by parenthesis. If in-parens is invoked from an MLisp function by (in-parens "foo") then the invocation of arg inside in-parens will evaluate the expression "foo" and the end result will be that the string "(foo)" will be inserted into the buffer. The function interactive made and reads a character from the tty. Then it inserts "@c[" (where c is the character typed) at the front of the word and "]" at the back. Apply-look gets tied to the key ESC-l so typing ESC-l i when the cursor is positioned on the word "begin" will change the word to "@i[begin]". (apply-look go-forward (save-excursion c (if (! (eolp)) (forward-character)) may be used to determine whether or not the invoking function was called interactivly. Nargs will return the number of arguments passed to the invoking function. This parameter passing mechanism may be used to do some primitive language extension. For example, if you wanted a statement that executed a statement n times, you could use the following: (defun (dotimes n (setq n (arg 1)) (while (> n 0) (setq n (- n 1)) (arg 2 (setq go-forward -1) (backward-word) (setq c (get-tty-character)) (if (> c ' ') (progn (insert-character '@') (insert-character c) (insert-character '[') (forward-word) (setq go-forward (dot)) (insert-character ']') ) ) ) (if (= go-forward (dot)) (forward-character)) ) ) (defun ) ) ) ) Given this, the expression (dotimes 10 (insert-string "<>")) will insert the string "<>" 10 times. [Note: The prompt argument may be omitted if the function can never be called interactivly] . Debugging See the section on debugging in the manual. The following piece of MLisp code is the Scribe mode package. Other implementations of Emacs, on ITS and on Multics have modes that influence the behaviour of Emacs on a file. This behaviour is usually some so This function is called to set a buffer into Scribe mode (scribe-mode (remove-all-local-bindings) If the string "LastEditDate=""" exists in the first 2000 characters of the document then the following string constant is changed to the current date. The intent of this is that you should stick at the beginning of your file a line like: ``@string(LastEditDate="Sat Jul 11 17:59:01 1981")''. This will automatically get changed each time you edit the file to reflect that last date on which the file was edited. (if (! buffer-is-modified) (save-excursion (error-occurred (goto-character 2000) (search-reverse "LastEditDate=""") (search-forward """") (set-mark)  profile is read, but before any file visits are done. This is intended to be used along with the shell alias mechanism to allow you to invoke Emacs packages from the shell. 3. If neither argv nor argc have yet been called (eg. by your startup or by the command line named package) then the list of arguments will be considered as file names and will be visited; if there are no arguments then the arguments passed to the last invocation of Emacs will  (search-forward """") (backward-character) (delete-to-killbuffer) (insert-string (current-time)) (setq buffer-is-modified 0) ) ) ) (local-bind-to-key "justify-paragraph" "\ej") (local-bind-to-key "apply-look" "\el") (setq right-margin 77) (setq mode-string "Scribe") (setq case-fold-search 1) (use-syntax-table "text-mode") (modibe used. 4. Finally, Emacs invokes it's keyboard command interpreter, and eventually terminates. Node: Getting Help Up: Introduction, Previous: Unbound Commands, Next: Buffers and Windows Emacs has many commands that let you ask Emacs for help about how to use Emacs. The simplest one is ESC-? (apropos) which asks you for a keyword and then displays a list of those commands whose full name contains the keyword as a substring. For example, to find out which commands are avafy-syntax-entry "w -'") (use-abbrev-table "text-mode") (setq left-margin 1) (novalue) ) ) (novalue) When Emacs is invoked, it does several things that are not of too much interest to the beginning user. 1. Emacs looks for a file called ``.emacs_pro'' in your home directory, if it exists then it is loaded, with the load command. This is the mechanism used for user profiles -- in your .emacs_pro file, place the commands neededilable for dealing with windows, type ESC-?, Emacs will ask "Keyword:" and you reply "window". A list like the following appears: beginning-of-window ESC-, delete-other-windows ^X1 delete-window ^XD end-of-window ESC-. enlarge-window ^XZ line-to-top-of-window ESC-! next-window ^XN page-next-window ESC-^V previous-window ^XP shrink-window ^X^ to customize Emacs to suit your taste. If a user has not set up an .emacs_pro file then Emacs will use a site-specific default file for initialization. This file is named /emacs/maclib/profile.ml 2. Emacs will then interprete its command line switches. "+l" loads the given file (only one may be named), "+e" executes the named function (again, only one may be named). +l and +e are executed in that order, after the user Z split-current-window ^X2 To get detailed information about some command, the describe-command command can be used. It asks for the name of a command, then displays the long documentation for it from the manual. For example, if you wanted more information about the shrink-window command, just type "ESC-Xdescribe-command shrink-window" and Emacs will reply: shrink-window Makes the current window one line shorter, and the win (or the one above if there is no window below) one line Can't be used if there is only one window on the screen. If you want to find out what command is bound to a particular key, describe-key will do it for you. Describe-bindings can be used to make a "wall chart" description of the key bindings in the currently running Emacs, taking into account all of the bindings you have made. Node: Input Conventions Up: Introduction, Previous: The Screen, Next: Invoking Emacs Throusponding keymap entry is examined and the indicated action is performed. If the key is bound to a function, then that function will be invoked. If the key is bound to another keymap then that keymap is used for interpreting the next keystroke. There is always a global keymap and a local keymap, as keys are read from the keyboard the two trees are traversed in parallel (you can think of keymaps as FSMs, with keystrokes triggering transitions). When either of the traversals reaches a leaf, thatghout this manual, characters which are used as commands are printed in bold face: X. They will sometimes have a control prefix which is printed as an uparrow character: ^X is control-X and is typed by holding down the control (labeled Ctrl on the top of the key) and simultaneously striking X. Some will have an escape prefix which is usually printed thus: ESC-X and typed by striking the escape key (labeled Esc) then X. And some will have a ^X prefix which is printed ^XX which is typ function is invoked and interpretation is reset to the roots of the trees. The root keymaps are selected using the use-global-map or use-local-map commands. A new empty keymap is created using the define-keymap command. The contents of a keymap can be changed by using the bind-to-key and local-bind-to-key commands. These two commands take two arguments: the name of the function to be bound and the keystroke sequence to which it is to be bound. This keystroke sequence is interpreteded by holding down the control key, striking X, releasing the control key then striking X again. For example, ESC-^J is typed by striking ESC then holding down the control key and striking J. Node: Invoking Emacs Up: Introduction, Previous: Input Conventions, Next: Basic Commands Emacs is invoked as a 4404 OS command by typing emacs files to the shell (the OS command interpreter). Emacs will start up, editing the named files. You will probably only want to name one or two files. If you don relative to the current local or global keymaps. For example, (bind-to-key "define-keymap" "\^Zd") binds the define-keymap function to the keystroke sequence `^Z' followed by `d'. A named keymap behaves just like a function, it can be bound to a key or executed within an MLisp function. When it is executed from within an MLisp function, it causes the next keystroke to be interpreted relative to that map. Node: Mode Lines Up: Introduction, Previous: Region Re't specify any names, Emacs will use the same names that it was last editing. Gory details on the invocation of Emacs can be found in that section of the manual. Node: Keymaps Up: Introduction, Previous: Searching, Next: Region Restrictions When a user is typing to Emacs the keystrokes are interpreted using a keymap. A keymap is just a table with one entry for each character in the ASCII character set. Each entry either names a function or another keymap. When the user strikes a key, the correstrictions A mode line is the line of descriptive text that appears just below a window on the screen. It usually provides a description of the state of the buffer and is usually shown in reverse video. The standard mode line shows the name of the buffer, an `*' if the buffer has been modified, the name of the file associated with the buffer, the mode of the buffer, the current position of dot within the buffer expressed as a percentage of the buffer size and and indication of the nesting within recursive-edit's which is shown by wrapping the mode line in an appropriate number of `[' `]' pairs. It is often the case that for some silly or practical reason one wants to alter the layout of the mode line, to show more, less or different information. Emacs has a fairly general facility for doing this. Each buffer has associated with it a format string that describes the layout of the mode line for that buffer whenever it appears in a window. The format string is inteinserted into the mode line by using `%m' in the format. This is it's only use by Emacs. Usually, mode packages (like `lisp-mode' or `c-mode') put some string into mode-string to indicate the mode of the buffer. It is the appearance of this piece of descriptive information that gives the mode line its name. global-mode-string This is similar to mode-string except thatrpreted in a manner much like the format argument to the C printf subroutine. Unadorned characters appear in the mode line unchanged. The `%' character and the following format designator character cause some special string to appear in the mode line in their place. The format designators are: b Inserts the name of the buffer. f Inserts the name of the file associated with the buffer. m Inserts the value of the buffer-specific variable  it is global -- the same string will be inserted into all mode lines by `%M'. It is usually used for information of global interest. For example, the time package puts the current time of day and load average there. Node: Region Restrictions Up: Introduction, Previous: Keymaps, Next: Mode Lines The portion of the buffer which Emacs considers visible when it performs editing operations may be restricted to some subregion of t mode-string. M Inserts the value of the variable global-mode-string. p Inserts the position of "dot" as a percentage. * Inserts an `*' if the buffer has been modified. [ Inserts (recursion-depth) `['s. ] Inserts (recursion-depth) `]'s. If a number n appears between the `%' and the format designator then the inserted string is constrained to be exactly n characters wide. Either by padding or truncating on the right. The defauhe whole buffer. The narrow-region command sets the restriction to encompass the region between dot and mark. Text outside this region will henceforth be totally invisible. It won't appear on the screen and it won't be manipulable by any editing commands. It will, however, be read and written by file manipulation commands like read-file and write-current-file. This can be useful, for instance, when you want to perform a replacement within a few paragraphs: just narrow down to alt mode line is built using the following format: " %[Buffer: %b%* File: %f %M (%m) %p%]" The following variables are involved in generating mode lines: mode-line-format This is the buffer specific variable that provides the format of a buffers mode line. default-mode-line-format This is the value to which mode-line-format is initialized when a buffer is created. mode-string This buffer-specific string variable can be  region enclosing the paragraphs and execute replace-string. The widen-region command sets the restriction to encompass the entire buffer. It is usually used after a narrow-region to restore Emacs's attention to the whole buffer. Save-restriction is only useful to people writing MLisp programs. It is used to save the region restriction for the current buffer (and only the region restriction) during the execution of some subexpression that presumably uses region restrictions. The value of (save-restriction expressions...) is the value of the last expression evaluated. Node: Searching Up: Introduction, Previous: Extensibility, Next: Keymaps Emacs is capable of performing two kinds of searches (Regular and Vanilla for those of you with no taste). There are two parallel sets of searching and replacement commands that differ only in the kind of search performed. The commands search-forward, search-reverse, query-replace-string and replace-string all do simp 12. A `\=' Matches at dot. 13. A nonempty string s bracketed ``[ s ]'' (or ``[^ s ]'' matches any character in (or not in) s. In s, `\' has no special meaning, and `]' may only appear as the first letter. A substring a-b, with a and b in ascending ASCII order, stands for the inclusive range of ASCII characters. 14. A `\' followed by a digit n matches a copy of the string that the bracketed regular expression beginning with the n th `\(' le searches. That is, the search string that they use is matched directly against successive substrings of the buffer. The characters of the search string have no special meaning. These search forms are the easiest to understand and are what most people will want to use. They are what is conventionally bound to ^S, ^R, ESC-Q and ESC-R. The commands re-search-forward, re-search-reverse, re-query-replace-string, re-replace-string and looking-at all do regular expression searches. The search smatched. 15. A regular expression of one of the preceeding forms followed by `*' matches a sequence of 0 or more matches of the regular expression. 16. A regular expression, x, bracketed ``\( x \)'' matches what x matches. 17. A regular expression of this or one of the preceeding forms, x, followed by a regular expression of one of the preceeding forms, y matches a match for x followed by a match for y, with the x match being as long as possible wtring is interpreted as a regular expression and matched against the buffer according to the following rules: 1. Any character except a special character matches itself. Special characters are `\' `[' `.' and sometimes `^' `*' `$'. 2. A `.' matches any character except newline. 3. A `\' followed by any character except those mentioned in the following rules matches that character. 4. A `\w' Matches any word character, as defined by the syntax tables. 5. A `\W'hile still permitting a y match. 18. A regular expression of one of the preceeding forms preceded by `^' (or followed by `$'), is constrained to matches that begin at the left (or end at the right) end of a line. 19. A sequence of regular expressions of one of the preceeding forms seperated by `\|'s matches any one of the regular expressions. 20. A regular expression of one of the preceeding forms picks out the longest amongst the leftmost matches if searchi Matches any non-word character, as defined by the syntax tables. 6. A `\b' Matches at a boundary between a word and a non-word character, as defined by the syntax tables. 7. A `\B' Matches anywhere but at a boundary between a word and a non-word character, as defined by the syntax tables. 8. A `\`' Matches at the beginning of the buffer. 9. A `\'' Matches at the end of the buffer. 10. A `\<' Matches anywhere before dot. 11. A `\>' Matches anywhere after dot.ng forward, rightmost if searching backward. 21. An empty regular expression stands for a copy of the last regular expression encountered. In addition, in the replacement commands, re-query-replace-string and re-replace-string, the characters in the replacement string are specially interpreted: - Any character except a special character is inserted unchanged. - A `\' followed by any character except a digit causes that character to be inserted unchanged.  - A `\' followed by a digit n causes the string matched by the nth bracketed expression to be inserted. - An `&' causes the string matched by the entire search string to be inserted. The following examples should clear a little of the mud: Pika Matches the simple string ``Pika''. Whiskey.*Jack Matches the string ``Whiskey'', followed by the longest possible sequence of non-newline characters, followed by the string ``Jack''. Think o When characters are inserted, they are inserted at the position where dot points; commands exist that delete characters both to the left and to the right of dot. The text on the screen always reflects they way that the text looks now. Node: Unbound Commands Up: Introduction, Previous: Basic Commands, Next: Getting Help Even though the number of characters available to use for Emacs commands is large, there are still more commands than characters. You probably wouldn't want to bif it as finding the first line that contains the string ``Whiskey'' followed eventually on the same line by the string ``Jack'' [a-z][a-z]* Matches a non-null sequence of lower case alphabetics. Using this in the re-replace-string command along with the replacement string ``(&)'' will place parenthesis around all sequences of lower case alphabetics. Guiness\|Bass Matches either the string `Guiness' or the stringnd them all to keys even if you could. Each command has a long name and by that long name may be bound to a key. For example, ^F is normally bound to the command named forward-character which moves dot forward one character. There are many commands that are not normally bound to keys. These must be executed with the ESC-X command or by binding them to a key (via the bind-to-key command). Heaven help the twit who rebinds ESC-X. The ESC-X command will print ": " on the last line of the `Bass'. \Bed\b Matches `ed' found as the suffix of a word. \bsilly\W*twit\b Matches the sequence of words `silly' and `twit' seperated by arbitrary punctuation. Node: The Screen Up: Introduction, Next: Input Conventions Emacs divides a screen into several areas called windows, at the bottom of the screen there is a one line area that is used for messages and questions from Emacs. Most people will only be using one window, at least until they become more fam display and expect you to type in the name of a command. Space and ESC characters may be struck to invoke Tenex style command completion (ie. you type in the first part of the command, hit the space bar, and Emacs will fill in the rest for you -- it will complain if it can't figure out what you're trying to say). If the command requires arguments, they will also be prompted for on the bottom line. Node: ^ Up: Commands, Previous: >>, Next: append-region-to-buffer (^ e e ) MLisp function tiliar with Emacs. A window is displayed as a set of lines, at the bottom of each window is its mode line (For more information on mode lines see the manual). The lines above the mode line contain an image of the text you are editing in the region around dot (or point). Dot is the reference around which editing takes place. Dot is a pointer which points at a position between two characters. On the screen, the cursor will be positioned on the character that immediately follows dot. hat returns e ^ e (the C XOR operator). 1 2 1 2 Node: Abbrev mode Up: Introduction, Previous: Compiling programs, Next: Extensibility Abbrev mode allows the user to type abbreviations into a document and have Emacs automatically expand them. If you have an abbrev called "rhp" that has been defined to expand to the string "rhinocerous party" and have turned on abbrev mode then typing the first non-alphanumeric character after having typed "rhp" causes the string "rhp" to be replaced by "rhinocerous party". The capitalization of the typed in abbreviation controls the capitalization of the expansion: "Rhp" would expand as "Rhinocerous party" and "RHP" would expand as "Rhinocerous Party". Abbreviations are defined in abbrev tables. There is a global abbrev table which is used regardless of which buffer you are in, and a local abbrev table which is selected on a buffer by buffer basis, generally depending on the major mode of t is triggered. Use the commands define-hooked-global-abbrev and define-hooked-local-abbrev to do this. These behave exactly as the unhooked versions do except that they also associate a named command with the abbrev. When the abbrev triggers, rather than replacing the abbreviation with the expansion phrase the hook procedure is invoked. The character that trigged the abbrev will not have been inserted, but will be inserted immediately after the hook procedure returnhe buffer. Define-global-abbrev takes two arguments: the name of an abbreviation and the phrase that it is to expand to. The abbreviation will be defined in the global abbrev table. Define-local-abbrev is like define-global-abbrev except that it defines the abbreviation in the current local abbrev table. The use-abbrev-table command is used to select (by name) which abbrev table is to be used locally in this buffer. The same abbrev table may be used in several buffers. The mode packages (like els [unless the procedure returns 0]. The abbreviation will be the word immediately to the left of dot, and the function abbrev-expansion returns the phrase that the abbrev would have expanded to. Node: abort-operation Up: Top Next: append-region-to-buffer, Previous: ^ abort-operation ^G Emacs gives up on what it is trying to do now and goes back to standard input mode. Rings the bell. Use ^G whenever Emacs is ectric-c and text) all set up abbrev tables whose name matches the name of the mode. The switch abbrev-mode must be turned on before Emacs will attempt to expand abbreviations. When abbrev-mode is turned on, the string "abbrev" appears in the mode section of the mode line for the buffer. Use-abbrev-table automatically turns on abbrev-mode if either the global or new local abbrev tables are non-empty. All abbreviations currently defined can be written out to a file using the writ in a state you don't like, for example, asking you for a string to be searched for when you decide that you don't want to search for a string. Node: append-region-to-buffer Up: Commands, Previous: ^, Next: append-to-file Appends the region between dot and mark to the named buffer. Neither the original text in the destination buffer nor the text in the region between dot and mark will be disturbed. Node: append-to-file Up: Commands, Previous: append-region-to-buffer, Next: e-abbrev-file command. Such a file can be edited (if you wish) and later read back in to define the same abbreviations again. Read-abbrev-file reads in such a file and screams if it cannot be found, quietly-read-abbrev-file doesn't complain (it is primarily for use in startups so that you can load a current-directory dependant abbrev file without worrying about the case where the file doesn't exist). People writing MLisp programs can have procedures invoked when an abbrevapropos Takes the contents of the current buffer and appends it to the named file. If the files doesn't exist, it will be created. Node: apropos Up: Commands, Previous: append-to-file, Next: arg Prompts for a keyword and then prints a list of those commands whose short description contains that keyword. For example, if you forget which commands deal with windows, just type "ESC-?windowESC". Node: arg Up: Commands, Previous: apropos, Next: argc (arg i [prompt]) evaluates to the i'th argument of the invoking function or prompts for it if called interactively [the prompt is optional, if it is omitted, the function cannot be called interactivly]. For example, (arg 1 "Enter a number: ") Evaluates to the value of the first argument of the current function, if the current function was called from MLisp. If it was called interactively then it is prompted for. As another example, given: (defun (foo (+ (arg 1 "Number to increment? ") 1))) then (foo 10) returns 11, but typing "ESsion when constructing a buffer name. If ask-about-buffer-names is true (the default) then Emacs will ask for a new buffer name to be given, or for to be typed which will overwrite the old buffer. If it is false then a buffer name will be synthesized by appending "" to the buffer name, for a unique value of n. For example, if I visit-file "makefile" then the buffer name will be "makefile"; then if I visit-file "man/makefile" the buffer name will be "makefile<2>". Node: auto-execute C-Xfoo" causes emacs to ask "Number to increment? ". Node: argc Up: Commands, Previous: arg, Next: argument-prefix Is an MLisp function that returns the number of arguments that were passed to Emacs when it was invoked from the OS shell. If either argc or argv are called early enough then Emacs's startup action of visiting the files named on the command line is suppressed. Node: argument-prefix Up: Commands, Previous: argc, Next: argv When followed by a string of digits ^U causes that stri Up: Commands, Previous: argv, Next: autoload Prompt for and remember a command name and a file name pattern. When a file is read in via visit-file or read-file whose name matches the given pattern the given command will be executed. The command is generally one which sets the mode for the buffer. Patterns must be of the form "*string" or "string*": "*string" matches any filename whose suffix is "string"; "string*" matches any filename prefixed by "string". For example, auto-execng of digits to be interpreted as a numeric argument which is generally a repetition count for the following command. For example, ^U10^N moves down 10 lines (the 10'th next). A string of n ^U's followed by a command provides an argument to n that command of 4 . For example, ^U^N moves down four lines, and ^U^U^N moves down 16. Argument-prefix should never be called from an MLisp function. Node: argv Up: Commands, Previous: argument-prefix, Next: auto-execute (argute c-mode *.c will put Emacs into C mode for all files with the extension ".c". Node: autoload Up: Commands, Previous: auto-execute, Next: backward-balanced-paren-line (autoload command file) defines the associated command to be autoloaded from the named file. When an attempt to execute the command is encountered, the file is loaded and then the execution is attempted again. the loading of the file must have redefined the command. Autoloading is useful when you have some commandv i) returns the ith argument that was passed to Emacs when it was invoked from the OS shell. If Emacs were invoked as "emacs blatto" then (argv 1) would return the string "blatto". If either argc or argv are called early enough then Emacs's startup action of visiting the files named on the command line is suppressed. Node: ask-about-buffer-names Up: Variables, Next: backup-by-copying The ask-about-buffer-names variable controls what the visit-file command does if it detects a colli written in MLisp but you don't want to have the code loaded in unless it is actually needed. For example, if you have a function named box-it in a file named box-it.ml, then the command (autoload "box-it" "box-it.ml") will define the box-it command, but won't load its definition from box-it.ml. The loading will happen when you try to execute the box-it command. Node: backup-by-copying Up: Variables, Previous: ask-about-buffer-names, Next: backup-by-copying-when-linked If true, then when a backup of a file is made (see the section on the backup-before-writing variable) then rather than doing the fancy link/unlink footwork, Emacs copies the original file onto the backup. This preserves all link and owner information & ensures that the files I-number doesn't change (you're crazy if you worry about a files I-number). Backup-by-copying incurs a fairly heafty performance penalty. See the section on the backup-by-copying-when-linked variable for a description of a  normally made by fancy footwork with links and unlinks, to achieve acceptable performance: when "foo.c" is to be rewritten, Emacs effectivly executes a "mv foo.c foo.c.BAK" and then creates foo.c a write the new copy. The file protection of foo.c is copied from the old foo.c, but old links to the file now point to the .BAK file, and the owner of the new file is the person running Emacs. If you don't like this behaviour, see the switches backup-by-copying and backup-by-copying-whecompromise. (default OFF) Node: backup-by-copying-when-linked Up: Variables, Previous: backup-by-copying, Next: backup-when-writing If true, then when a backup of a file is made (see the section on the backup-before-writing variable) then if the link count of the file is greater than 1, rather than doing the fancy link/unlink footwork, Emacs copies the original file onto the backup. If the link count is 1, then the link/unlink trick is pulled. This preserves link information when it in-linked. (default OFF) Node: backward-balanced-paren-line Up: Commands, Previous: autoload, Next: backward-character Moves dot backward until either - The beginning of the buffer is reached. - An unmatched open parenthesis, '(', is encountered. That is, unmatched between there and the starting position of dot. - The beginning of a line is encountered at "parenthesis level zero". That is, without an unmatched ')' existing between there and the starting position of dots important, but still manages reasonable performance the rest of the time. See the section on the backup-by-copying variable for a description of a how to have owner & I-number information preserved. (default OFF) Node: backup-when-writing Up: Variables, Previous: backup-by-copying-when-linked, Next: buffer-is-modified If ON Emacs will make a backup of a file just before the first time that it is overwritten. The backup will have the same name as the original, except that the string ".BAK" will be. The definitions of parenthesis and strings from the syntax table for the current buffer are used. Node: backward-character Up: Commands, Previous: backward-balanced-paren-line, Next: backward-paragraph Move dot backwards one character. Ends-of-lines and tabs each count as one character. You can't move back to before the beginning of the buffer. Node: backward-paragraph Up: Commands, Previous: backward-character, Next: backward-paren Moves to the beginning of the current or previous paragraph. B appended; unless the last name in the path has more than 10 characters, in which case it will be truncated to 10 characters. "foo.c" gets backed up on "foo.c.BAK"; "/usr/jag/foo.c" on "/usr/jag/foo.c.BAK"; and "EtherService.c" on "EtherServi.BAK". The backup will only be made the first time that the file is rewritten from within the same invocation of Emacs, so if you write out the file several times the .BAK file will contain the file as it was before Emacs was invoked. The backup islank lines, and Scribe and nroff command lines separate paragraphs and are not parts of paragraphs. Node: backward-paren Up: Commands, Previous: backward-paragraph, Next: backward-sentence Moves dot backward until an unmatched open parenthesis, '(', or the beginning of the buffer is found. This can be used to aid in skipping over Lisp S-expressions. The definitions of parenthesis and strings from the syntax table for the current buffer are used. Node: backward-sentence Up: Commands, Previous: backward-paren, Next: backward-word Move dot backward to the beginning of the preceeding sentence; if dot is in the middle of a sentence, move to the beginning of the current sentence. Sentences are seperated by a `.', `?' or `!' followed by whitespace. Node: backward-word Up: Commands, Previous: backward-sentence, Next: forward-word If in the middle of a word, go to the beginning of that word, otherwise go to the beginning of the preceding word. A word is a sequence of alphanumericnds, Previous: beginning-of-file, Next: beginning-of-window Move dot to the beginning of the line in the current buffer that contains dot; that is, to just after the preceeding end-of-line or the beginning of the buffer. Node: beginning-of-window Up: Commands, Previous: beginning-of-line, Next: bind-to-key Move dot to just in front of the first character of the first line displayed in the current window. Node: bind-to-key Up: Commands, Previous: beginning-of-window, Next: bobp Bind a nameds. Node: Basic Commands Up: Introduction, Previous: Invoking Emacs, Next: Unbound Commands Normally each character you type is interpreted individually by Emacs as a command. The instant you type a character the command it represents is performed immediately. All of the normal printing characters when struck just insert themselves into the buffer at dot. To move dot there are several simple commands. ^F moves dot forward one character, ^B moves it backward one character. ^N moves dot to  macro or procedure to a given key. All future hits on the key will cause the named macro or procedure to be called. The key may be a control key, and it may be prefixed by ^X or ESC. For example, if you want ESC-= to behave the way ESC-Xprint does, then typing ESC-Xbind-to-key print ESC-= will do it. Node: bobp Up: Commands, Previous: bind-to-key, Next: bolp (bobp) is an MLisp predicate which is true iff dot is at the beginning of the buffer. Node: bolp Up: Commands,  the same column on the next line, ^P moves it to the same column on the previous line. String searches may be used to move dot by using the ^S command to search in the forward direction and ^R to search in the reverse direction. Deletions may be performed using ^H (backspace) to delete the character to the left of dot and ^D to delete the character to the right of dot. The following table summarizes all of the motion and deletion commands. Direction Previous: bobp, Next: buffer-size (bolp) is an MLisp predicate which is true iff dot is at the beginning of a line. Node: buff Up: Packages, Next: c-mode Loading the buff package replaces the binding for ^X-^B (usually list-buffers) with one-line-buffer-list. one-line-buffer-list Gives a one-line buffer list in the mini-buffer. If the buffer list is longer than one line, it will print a line at a time and wait for a character to be  Move Delete Units of Motion Left Right Left Right Characters ^B ^F ^H ^D Words ESC-B ESC-F ESC-H ESC-D Intra line ^A ^E ^K Inter line ^P ^N Node: beginning-of-file Up: Commands, Previous: baud-rate, Next: beginning-of-line Move dot to just before the first character of the current buffer. Node: beginning-of-line Up: Commatyped before moving to the next line. Buffers that have been changed since they were last saved are prefixed with an asterisk (*), buffers with no associated file are prefixed with a hash-mark (#), and empty buffers are prefixed with an at-sign (@). Node: Buffer And File Operations, Next: Help And Helper Functions, Up: Quick * Menu: * yank-from-killbuffer:: ^Y Yank back the last thing killed (kill  and delete are different) * visit-file:: ^X-^V Get a file into a buffer for editing * read-file:: ^X-^R Read a file into current buffer, erasing old contents * insert-file:: ^X-^I Insert file at dot * to-buffer:: ^X-^O Select a different buffer (it must already exist) * switch-to-buffer:: ^X-B Select a different buffer (it need not (^W) * describe-word-in-buffer:: (^X-^D) * erase-buffer:: * execute-mlisp-buffer:: * get-tty-buffer:: * list-buffers:: (^X-^B) * pop-to-buffer:: * prepend-region-to-buffer:: * switch-to-buffer:: (^X-b) * temp-use-buffer:: * use-old-buffer:: (^X-^O) * yank-buffer:: (ESC-^Y) * yank-from-killbuffer:: (^Y) Node: Buffers and Windows Up: Introduction, Previous: Getting Help, Next: Compiling Programs There are two fundamental objects in Emacs, buffers and windows. A buffer is a chunk of text that  pre-exist) * list-buffers:: ^X-^B Display a list of available buffers * yank-buffer:: ESC-^Y Insert selected buffer at dot * beginning-of-file:: ESC-< Move to the top of the current buffer * end-of-file:: ESC-> Move to the end of the current buffer Node: buffer-is-modified Up: Variables, Previous: backup-when-writing, Next: case-fold-search Buffer-is-modified is true iff the current buffer has been modified since it was lastcan be edited, it is often the body of a file. A window is a region on the screen through which a buffer may be viewed. A window looks at one buffer, but a buffer may be on view in several windows. It is often handy to have two windows looking at the same buffer so that you can be looking at two separate parts of the same file, for example, a set of declarations and a piece of code that uses those declarations. Similarly, it is often handy to have two different buffers on view in two window written out. You may set if OFF (ie. to 0) if you want Emacs to ignore the mods that have been made to this buffer -- it doesn't get you back to the unmodified version, it just tells Emacs not to write it out with the other modified files. Emacs sets buffer-is-modified true any time the buffer is modified. Node: buffer-size Up: Commands, Previous: bolp, Next: c-mode (buffer-size) is an MLisp function that returns the number of characters in the current buffer. Node: Buffers Up: Commands A Bufs. The commands which deal with windows and buffers are: beginning-of-window (ESC-,), delete-other-windows (^X1), delete-region-to-buffer (ESC-^W), delete-window (^XD), end-of-window (ESC-.), enlarge-window (^XZ), line-to-top-of-window (ESC-!), list-buffers (^X^B), next-window (^XN), page-next-window (ESC-^V), previous-window (^XP), shrink-window (^X^Z), split-current-window (^X2), switch-to-buffer (^XB), use-old-buffer (^X^O) and yank-buffer (ESC-^Y). See the command descrfer is the basic object which Emacs deals with. It is simply a piece of text, often representing the contents of a file. The following commands are used to manipulate buffers. Other commands to manipulate characters within buffers may be found by moving "up" from this node. * menu: * append-region-to-buffer:: * buffer-size:: * compile-buffer-to-db:: * copy-region-to-buffer:: * current-buffer-name:: * define-buffer-macro:: * delete-buffer:: * delete-region-to-buffer:: (ESC-^W) * delete-to-killbuffer:: iption section for more details on each of these. Node: c-mode Up: Packages, Previous: buff, Next: dired begin-C-comment (ESC-`) Initiates the typing in of a comment. Moves the cursor over to the comment column, inserts "/* " and turns on autofill. If ESC-` is typed in the first column, the the comment begins there, otherwise it begins where ever comment-column says it should. end-C-comment (ESC-') Closes off the current comment. indent-C-procedure (ESC-j) Takes the current function (the one in which dot is) and fixes up its indentation by running it through the "indent" program. Node: c= Up: Commands, Previous: c-mode, Next: case-region-capitalize (c= e e ) MLisp function that returns true iff e is equal to e taking 1 2 1 2 into account the character translations indicated by case-fold-search. If word-ious: case-word-invert, Next: case-word-upper Change all alphabetic characters in the current word (the one above or to the left of dot) to lower case. Node: case-word-upper Up: Commands, Previous: case-word-lower, Next: change-directory Node: change-directory Up: Commands, Previous: case-word-upper, Next: char-to-string Changes the current directory (for Emacs) to the named directory. All future file write and reads (^X^S, ^X^V, etc.) will be interpreted relative to that directory. Node: chamode-search is in effect, then upper case letters are "c=" to their lower case equivalents. Node: case-fold-search Up: Variables, Previous: buffer-is-modified, Next: checkpoint-frequency If set ON all searches will ignore the case of alphabetics when doing comparisons. (default OFF) Node: case-region-capitalize Up: Commands, Previous: c=, Next: case-region-invert Capitalize all the words in the region between dot and mark by making their first characters upper case and all the rest lower caser-to-string Up: Commands, Previous: change-directory, Next: checkpoint Takes a numeric argument and returns a one character string that results from considering the number as an ascii character. Node: character moves Up: Moving around * menu: * backward-character:: (^B) * forward-character:: (^F) * goto-character:: Node: Character Operations Next: Word Operations, Up: Quick * Menu: * backward-character:: ^B Move left (Back) * forward-character:: ^F Move right (Forward) * . Node: case-region-invert Up: Commands, Previous: case-region-capitalize, Next: case-region-lower Invert the case of all alphabetic characters in the region between dot and mark. Node: case-region-lower Up: Commands, Previous: case-region-invert, Next: case-region-upper Change all alphabetic characters in the region between dot and mark to lower case. Node: case-region-upper Up: Commands, Previous: case-region-lower, Next: case-word-capitalize Change all alphabetic characters in the region bprevious-line:: ^P Move up (Previous) * next-line:: ^N Move down (Next) * delete-next-character:: ^D Delete right * delete-previous-character:: ^H or BS or DEL or RUBOUT Delete left * transpose-characters:: ^T Transpose previous 2 characters (ht_ -> th_) * quote-character:: ^Q Literally inserts (quotes) the next character typed (e.g. ^Q-^L)etween dot and mark to upper case. Node: case-word-capitalize Up: Commands, Previous: case-region-upper, Next: case-word-invert Capitalize the current word (the one above or to the left of dot) by making its first character upper case and all the rest lower case. Node: case-word-invert Up: Commands, Previous: case-word-capitalize, Next: case-word-lower Invert the case of all alphabetic characters in the current word (the one above or to the left of dot). Node: case-word-lower Up: Commands, Prev * argument-prefix:: ^U Provide a numeric argument of n to the command that follows (n defaults to 4, eg. try ^U-^N and ^U-^U-^F) * newline:: ^M or CR Newline * newline-and-indent:: ^J or NL newline followed by an indent Node: checkpoint Up: Commands, Previous: char-to-string Causes all modified buffers with an out of date checkpoint file to be checkpointed. This function is normally called  automatically every checkpoint-frequency keystrokes. Node: checkpoint-frequency Up: Variables, Previous: case-fold-search, Next: comment-column The number of keystrokes between checkpoints. Every "checkpoint-frequency" keystrokes all buffers which have been modified since they were last checkpointed are written to a file named "file.CKP". File is the file name associated with the buffer, or if that is null, the name of the buffer. Proper account is taken of the restriction on file names td-prefix Up: Commands, Next: compile-it The next character typed will be interpreted as a command based on the fact that it was preceded by ^X. Node: Commands Up: Top Here are the commands available in Emacs, grouped by function. * menu: * Windows:: how to manipulate them * Buffers:: how to manipulate them * Deleting:: deletion of characters, words, lines and regions * Inserting:: how to get text into a buffer * Moving around:: how to move from place to place within a buffer * Marks:: how to o 14 characters. (default 300) Node: Command Up: Top Next: command-prefix, Previous: char-to-string Command prefix (ESC) The next character typed will be interpreted as a command based on the fact that it was preceded by ESC. The name meta for the ESC character comes from funny keyboards at Stanford and MIT that have a Meta-shift key which is used to extend the ASCII character set. Lacking a Meta key, we make do with prefixing with amark positions in buffers * The Killbuffer:: moving and deleteing regions of text * MLisp statements:: simple control flow commands * Dealing with files:: reading and writing them to and from buffers * Abbrevs:: abbreviations for keywords * Mode Lines:: dealing with those funny lines at the bottoms of windows Node: comment-column Up: Variables, Previous: checkpoint-frequency, Next: ctlchar-with-^ The column at which comments are to start. Used by the language-dependent commenting features througn ESC character. You may see (and hear) commands like ESC- V referred to as Meta-V. Sometimes the ESC key is confusingly written as $, so ESC-V would be written as $V. ESC is also occasionally referred to as Altmode, from the labeling of a key on those old favorites, model 33 teletypes. Node: Command prefix, also known as META Up: Comm The next character typed will be interpreted as a command based on the fact that it was preceded by ESC. The name h the move-to-comment-column command. (default 33) Node: compile-it Up: Commands, Previous: command-prefix, Next: concat Update is a standard program which takes a description of how to compile a set of programs and compiles them. The output of update (and the compilers it calls) is placed in a buffer which is displayed in a window. Presumably a data base (makefile) has been set up for make that causes the files which have been edited to be compiled. ^X^E then updates the files that have been cmeta for the ESC character comes from funny keyboards at Stanford and MIT that have a Meta-shift key which is used to extend the ASCII character set. Lacking a Meta key, we make do with prefixing with an ESC character. You may see (and hear) commands like ESC-V referred to as Meta-V. Sometimes the ESC key is confusingly written as $, so ESC-V would be written as $V. ESC is also occasionally referred to as Altmode, from the labeling of a key on those old favorites, model 33 teletypes. Node: commanhanged and update does the necessary recompilations. If ^X^E is given a non-zero argument, then rather than just executing make Emacs will prompt for an OS command line to be executed. Modified buffers will still be written out, and the output will still go to the Error log buffer. Node: Compiling (Make) Operations. Next: Mail, Up: Quick * Menu: * compile-it:: ^X-^E Execute the "make" (or other) command, saving output in a buffer * execute-monitor-c ommand:: ^X-! Execute the given command, saving output in a buffer Node: concat Up: Commands, Previous: compile-it, Next: copy-region-to-buffer Takes a set of string arguments and returns their concatenation. Node: copy-region-to-buffer Up: Commands, Previous: concat, Next: current-buffer-name Copies the region between dot and mark to the named buffer. The buffer is emptied before the text is copied into it; the region between dot and mark is left undisturbed. Ne will have been stripped off. (substr (current-time) -4 4) is the current year. Node: declare-buffer-specific Up: Commands, Previous: current-time, Next: declare-global Takes a list of variables and declares them to have buffer-specific values. A buffer-specific variable has a distinct instance for each buffer in existance and a default value which is used when new buffers are created. When a buffer-specific variable is assigned a value only the instance associated with the currently selode: ctlchar-with-^ Up: Variables, Previous: comment-column, Next: files-should-end-with-newline If set ON control characters are printed as ^C (an '^' character followed by the upper case alphabetic that corresponds to the control character), otherwise they are printed according to the usual Emacs convention ('\' followed by a three digit octal number). (default OFF) Node: current-buffer-name Up: Commands, Previous: copy-region-to-buffer, Next: current-column MLisp function that returns theected buffer is affected. To set the default value for a buffer-specific variable, use setq-default or set-default. Note that if you have a global variable which is eventually declared buffer-specific then the global value becomes the default. Node: declare-global Up: Commands, Previous: declare-buffer-specific, Next: define-buffer-macro Takes a list of variables and for each that is not already bound a global binding is created. Global bindings outlive all function calls. Node: def current buffer name as a string. Node: current-column Up: Commands, Previous: current-buffer-name, Next: current-file-name (current-column) is an MLisp function that returns the printing column number of the character immediately following dot. Node: current-file-name Up: Commands, Previous: current-column, Next: current-indent MLisp function that returns the file name associated with the current buffer as a string. If there is no associated file name, the null string is returned. Node:ault profile Up: Init files, Previous: trivial example This is the profile loaded for users who don't have .emacs_pro files in their home directories. (defun (help (info))) (autoload "info" "info.ml") (autoload "dired" "dired.ml") (autoload "incremental-search" "incr-search.ml") (autoload "reverse-incremental-search" "incr-search.ml") (autoload "electric-c-mode" "electric-c.ml") (autoload "lisp-mode" "lisp.ml") (autoload "mlisp-mode" "lisp.ml") (setq quick-redisplay 1) (setq default-mode-line-format " current-indent Up: Commands, Previous: current-file-name, Next: current-time (current-indent) is an MLisp function the returns the amount of whitespace at the beginning of the line which dot is in (the printing column number of the first non-whitespace character). Node: current-time Up: Commands, Previous: current-indent, Next: declare-buffer-specific MLisp function that returns the current time of day as a string in the format described in CTIME(3), with the exception that the trailing newlin %[Buffer: %b%* File: %f %M (%m) %p%]") (setq backup-before-writing 1) (setq backup-by-copying-when-linked 1) (load "killring") (load "buffer-edit") (setq-default &kill-lines-magic 1) (auto-execute "electric-c-mode" "*.c") (auto-execute "electric-c-mode" "*.h") (auto-execute "mlisp-mode" "*.ml") (auto-execute "lisp-mode" "*.l") (auto-execute "mlisp-mode" "*.emacs_pro") Node: default-case-fold-search Up: Top Next: default-comment-column, Previous: ctlchar-with-^ default-case-fold-search De fault-case-fold-search provides the default value for case- fold-search, which is used whenever a new buffer is created. (default OFF) Node: default-comment-column Up: Top Next: default-left-margin, Previous: default-case-fold-search default-comment-column Default-comment-column provides the default value for comment- column, which is used whenever a new buffer is created. Its initial value is 33. Node: default-left-margin Up: Top Next: define-global-abbrev, Next: define-hooked-local-abbrev The commands define-hooked-global-abbrev and define-hooked-local-abbrev behave exactly as the unhooked versions do (define-global-abbrev and define-local-abbrev) except that they also associate a named command with the abbrev. When the abbrev triggers, rather than replacing the abbreviation with the expansion phrase the hook procedure is invoked. The character that trigged the abbrev will not have been inserted, but will b: default-mode-line-format, Previous: default-comment-column default-left-margin Default-left-margin provides the default value for left-margin, which is used whenever a new buffer is created. (default 1) Node: default-mode-line-format Up: Top Next: default-right-margin, Previous: default-left-margin default-mode-line-format This is the value given to mode-line-format when a buffer is created. Node: default-right-margin Up: Top Next: default-tab-size, Pre inserted immediately after the hook procedure returns [unless the procedure returns 0]. The abbreviation will be the word immediately to the left of dot, and the function abbrev-expansion returns the phrase that the abbrev would have expanded to. Node: define-hooked-local-abbrev Up: Commands, Previous: define-hooked-global-abbrev, Next: define-keyboard-macro See the description of define-hooked-global-abbrev. Node: define-keyboard-macro Up: Commands, Previous: define-hooked-local-abbrev, Next: deevious: default-mode-line-format default-right-margin Default-right-margin provides the default value for right- margin, which is used whenever a new buffer is created. Its initial value is some very large number. Node: default-tab-size Up: Top Next: files-should-end-with-newline, Previous: default-right-margin default-tab-size This is the value given to tab-size when a buffer is created. (default 8). Node: define-buffer-macro Up: Commafine-keymap Give a name to the current keyboard macro. A keyboard macro is defined by using the ^X( and ^X) command; define-keyboard-macro takes the current keyboard macro, squirrels it away in a safe place, gives it a name, and erases the keyboard macro. define-string-macro is another way to define a macro. Node: define-keymap Up: Commands, Previous: define-keyboard-macro, Next: define-local-abbrev (define-keymap "mapname") defines a new, empty, keymap with the given name. See the section nds, Previous: declare-global, Next: define-global-abbrev Take the contents of the current buffer and define it as a macro whose name is associated with the buffer. This is how one redefines a macro that has been edited using edit-macro. Node: define-global-abbrev Up: Commands, Previous: define-buffer-macro, Next: define-hooked-global-abbrev Define (or redefine) an abbrev with the given name for the given phrase in the global abbreviation table. Node: define-hooked-global-abbrev Up: Commands, Previouson keymaps, for more information. Node: define-local-abbrev Up: Commands, Previous: define-keymap, Next: define-string-macro Define (or redefine) an abbrev with the given name for the given phrase in the local abbreviation table. A local abbrev table must have already been set up with use-abbrev-table. Node: define-string-macro Up: Commands, Previous: define-local-abbrev, Next: defun Define a macro given a name and a body as a string entered in the minibuffer. Note: to get a control charac ter into the body of the macro it must be quoted with ^Q. define-keyboard-macro is another way to define a macro. Node: defun Up: Commands, Previous: define-string-macro, Next: delete-buffer (defun (name expressions... )... ) is an MLisp function that defines a new MLisp function with the given name and a body composed of the given expressions. The value of the function is the value of the last expression. For example: (defun (indent-line ; this functNode: delete-previous-word Up: Commands, Previous: delete-previous-character, Next: delete-region-to-buffer If not in the middle of a word, delete characters backwards (to the left) until a word is found. Then delete the word to the left of dot. A word is a sequence of alphanumerics. Node: delete-region-to-buffer Up: Commands, Previous: delete-previous-word, Next: delete-to-killbuffer Wipe (kill, delete) all characters between dot and the mark. The deleted text is moved to a buffer whose name is ion just sticks a tab a (save-excursion ; the beginning of the current line (beginning-of-line) ; without moving dot. (insert-string " ") ) ) ) Node: delete-buffer Up: Commands, Previous: defun, Next: delete-macro Deletes the named buffer. Node: delete-macro Up: Commands, Previous: delete-buffer, Next: delete-next-character Delete the named macro. Node: delete-next-character Up: Commands, Previous: delete-macro, Next: dele prompted for, which is emptied first. Node: delete-to-killbuffer Up: Commands, Previous: delete-region-to-buffer, Next: delete-white-space Wipe (kill, delete) all characters between dot and the mark. The deleted text is moved to the kill buffer, which is emptied first. Node: delete-white-space Up: Commands, Previous: delete-to-killbuffer, Next: delete-window Deletes all whitespace characters (spaces and tabs) on either side of dot. Node: delete-window Up: Commands, Previous: delete-white-spacete-next-word Delete the character immediately following dot; that is, the character on which the terminals cursor sits. Lines may be merged by deleting newlines. Node: delete-next-word Up: Commands, Previous: delete-next-character, Next: delete-other-windows Delete characters forward from dot until the next end of a word. If dot is currently not in a word, all punctuation up to the beginning of the word is deleted as well as the word. Node: delete-other-windows Up: Commands, Previous: delete-next-, Next: describe-bindings Removes the current window from the screen and gives it's space to it's neighbour below (or above) and makes the current window and buffer those of the neighbour. Node: Deleting Up: Commands * menu: * delete-buffer:: * delete-next-character:: (^D) * delete-next-word:: (ESC-d) * delete-other-windows:: (^X-1) * delete-previous-character:: (^H, ^?) * delete-previous-word:: (ESC-h) * delete-region-to-buffer:: (ESC-^W) * delete-to-killbuffer:: (^W) * delete-white-spaceword, Next: delete-previous-character Go back to one-window mode. Generally useful when Emacs has spontaneously generated a window (as for ESC-? or ^X^B) and you want to get rid of it. Node: delete-previous-character Up: Commands, Previous: delete-previous-character, Next: delete-previous-word Delete the character immediately preceding dot; that is, the character to the left of the terminals cursor. If you've just typed a character, RUBOUT will delete it. Lines may be merged by deleting newlines. :: (ESC-k) * delete-window:: (^X-d) Node: describe-bindings Up: Commands, Previous: delete-window, Next: describe-command Places in the Help window a list of all the keys and the name of the procedure that they are bound to. This listing is suitable for printing and making you own quick-reference card for your own customized version of Emacs. Node: describe-command Up: Commands, Previous: describe-bindings, Next: describe-key Uses the Info system to describe some named command. You wi ll be prompted in the minibuf for the name of a command and then Info will be invoked to show you the manual entry describing it. You can then use Info to browse around, or simply type ^C to resume editing. Node: describe-key Up: Commands, Previous: describe-command, Next: describe-variable Describe the given key. ESC-Xdescribe-key ESC-X will print a short descrition of the ESC-X key. It tells you the name of the command to which the key is bound. To find out more about the  file, it just marks it. The deletion will be performed when dired is exited. It also makes the next file be the current one. u Removes the deletion mark from the current file. This is the command to use if you change your mind about deleting a file. It also makes the next file be the current one. RUBOUT Removes the deletion mark from the line preceeding the current one. If you mark a file command, use describe-command. Node: describe-variable Up: Commands, Previous: describe-key, Next: describe-word-in-buffer Uses the Info system to describe some named variable. You will be prompted in the minibuf for the name of a variable and then Info will be invoked to show you the manual entry describing it. You can then use Info to browse around, or simply type ^C to resume editing. Node: describe-word-in-buffer Up: Commands, Previous: describe-variable, Next: dot Takes the word nearest t for deletion with `d' the current file will be advanced to the next line. RUBOUT undoes both the advancing and the marking for deletion. e, v Examine a file put putting it in another window and doing a recursive-edit on it. To resume dired type ^C. r Removes the current file from the directory listing. It doesn't delete the file, it just gets rid of the directory listing entry. Use it he cursor and looks it up in a data base and prints the information found. This data base contains short one-line descriptions of all of the 4404 standard procedures and Franz Lisp standard functions. The idea is that if you've just typed in the name of some procedure and can't quite remember which arguments go where, just type ^X^D and Emacs will try to tell you. Node: dired Up: Packages, Previous: c-mode, Next: electric-c The dired package implements the dired command which provides some to remove some of the clutter on your screen. q, ^C Exits dired. For each file that has been marked for deletion you will be asked for confirmation. If you answer `y' the file will be deleted, otherwise not. n, ^N Moves to the next entry in the directory listing. p, ^P Moves to the previous entry in the directory listing. ^V Moves to the next page in the directory listing. ESC-v Moves to the prsimple convenient directory editing facilities. When you run dired it will ask for the name of a directory, displays a listing of it in a buffer, and processes commands to examine files and possibly mark them for deletion. When you're through with dired it actually deletes the marked files, after asking for confirmation. The commands it recognizes are: d Marks the current file for deletion. A `D' will appear at the left margin. It does not actually delete theevious page in the directory listing. ESC-< Moves to the beginning of the directory listing. ESC-> Moves to the end of the directory listing. Node: dot Up: Commands, Previous: digit, Next: dump-syntax-table (dot) is an MLisp function that returns the number of characters to the left of dot plus 1 (ie. if dot is at the beginning of the buffer, (dot) returns 1). The value of the function is an object of type "marker" -- if it is assigned to a variable then as changes are m ade to the buffer the variable's value continues to indicate the same position in the buffer. Node: dump-syntax-table Up: Commands, Previous: dot, Next: edit-macro Dumps a readable listing of a syntax table into a buffer and makes that buffer visible. Node: edit-macro Up: Commands, Previous: dump-syntax-table, Next: emacs-version Take the body of the named macro and place it in a buffer called Macro edit. The name of the macro is associated with the buffer and appears in the informatiopredicate that is true iff dot is at the end of a line. Node: erase-buffer Up: Commands, Previous: eolp, Next: erase-region Deletes all text from the current buffer. Doesn't ask to make sure if you really want to do it. Node: erase-region Up: Commands, Previous: erase-buffer, Next: error-message Erases the region between dot and mark. It is like delete-to-killbuffer except that it doesn't move the text to the kill buffer. Node: error-message Up: Commands, Previous: erase-region, Next: error-ocn bar at the bottom of the window. The buffer may be edited just like any other buffer (this is, in fact, the intent). After the macro body has been edited it may be redefined using define-buffer-macro. Node: el-lisp Up: Packages, Previous: electric-c, Next: goto Node: electric-c Up: Packages, Previous: dired, Next: el-lisp C assistance package. See the manual for information. Node: emacs-version Up: Commands, Previous: edit-macro, Next: end-of-file Returns a string that describes the current cured (error-message "string-expressions") Sends the string-expressions to the screen as an error message where it will appear at the bottom of the screen. Emacs will return to keyboard level, unless caught by error-occured. Node: error-occured Up: Commands, Previous: error-message, Next: exchange-dot-and-mark (error-occured expressions...) executes the given expressions and ignores their values. If all executed successfully, error-occured returns false. Otherwise it returEmacs version. Node: end-of-file Up: Commands, Previous: emacs-version, Next: end-of-line Move dot to just after the last character of the buffer. Node: end-of-line Up: Commands, Previous: end-of-file, Next: end-of-window Move dot to the end of the line in the current buffer that contains dot; that is, to just after the following end-of-line or the end of the buffer. Node: end-of-window Up: Commands, Previous: end-of-line, Next: enlarge-window Move dot to just after the last character visible inns true and all expressions after the one which encountered the error will not be executed. Node: exchange-dot-and-mark Up: Commands, Previous: error-occured, Next: execute-extended-command Sets dot to the currently marked position and marks the old position of dot. Useful for bouncing back and forth between two points in a file; particularly useful when the two points delimit a region of text that is going to be operated on by some command like ^W (erase region). Node: execute-extend the window. Node: enlarge-window Up: Commands, Previous: end-of-window, Next: eobp Makes the current window one line taller, and the window below (or the one above if there is no window below) one line shorter. Can't be used if there is only one window on the screen. Node: eobp Up: Commands, Previous: enlarge-window, Next: eolp (eobp) is an MLisp predicate that is true iff dot is at the end of the buffer. Node: eolp Up: Commands, Previous: eobp, Next: erase-buffer (eolp) is an MLisp ed-command Up: Commands, Previous: exchange-dot-and-mark, Next: execute-keyboard-macro Emacs will prompt in the minibuffer (the line at the bottom of the screen) for a command from the extended set. These deal with rarely used features. Commands are parsed using a Twenex style command interpreter: you can type ESC or space to invoke command completion, or '?' for help with what you're allowed to type at that point. This doesn't work if it's asking for a key or macro name. Node: execute-keyboard-macro  Up: Commands, Previous: execute-extended-command, Next: execute-mlisp-buffer Takes the keystrokes remembered with ^X( and ^X) and treats them as though they had been typed again. This is a cheap and easy macro facility. For more power, see the define-string-macro, define-keyboard-macro and bind-to-key commands. Node: execute-mlisp-buffer Up: Commands, Previous: execute-keyboard-macro, Next: execute-mlisp-line Parse the current buffer as as a single MLisp expression and execute it. Thisul to bind it to a key for easy access. Node: expand-mlisp-word Up: Commands, Previous: expand-mlisp-variable, Next: extend-database-search-list Prompt for the name of a command then insert the name as text into the current buffer. This is very handly for typing in MLisp functions. It's also fairly useful to bind it to a key for easy access. Node: extend-database-search-list Up: Commands, Previous: expand-mlisp-word, Next: fetch-database-entry (extend-database-search-list dbname filename) adds  is what is generally used for testing out new functions: stick your functions in a buffer wrapped in a defun and use execute-mlisp-buffer to define them. Node: execute-mlisp-line Up: Commands, Previous: execute-mlisp-buffer, Next: execute-monitor-command Prompt for a string, parse it as an MLisp expression and execute it. Node: execute-monitor-command Up: Commands, Previous: execute-mlisp-line, Next: exit-emacs Prompt for an OS command then execute it, placing its output into a buffer called Comthe given data base file to the data base search list (dbname). If the database is already in the search list then it is left, otherwise the new database is added at the beginning of the list of databases. Node: Extensibility Up: Introduction, Prev: Abbrev mode, Next: Searching Emacs has two extension features: macros and a built in Lisp system. Macros are used when you have something quick and simple to do, Lisp is used when you want to build something fairlymand execution and making that buffer visible in a window. The command will not be able to read from its standard input (it will be connected to /dev/null). For now, there is no way to execute an interactive subprocess. Node: exit-emacs Up: Commands, Previous: exit-emacs, Next: expand-file-name Exit Emacs. Will ask if you're sure if there are any buffers that have been modified but not written out. Node: expand-file-name Up: Commands, Previous: exit-emacs, Next: expand-mlisp- complicated like a new language dependant mode. A macro is just a piece of text that Emacs remembers in a special way. When a macro is executed the characters that make up the macro are treated as though they had been typed at the keyboard. If you have some common sequence of keystrokes you can define a macro that contains them and instead of retyping them just call the macro. There are two ways of defining macros: The easiest is called a keyboard macro. A keyboard macro is variable Takes a string representing a file name and expands it into an absolute pathname. For example, if the current directory is "/emacs/maclib" then (expand-file-name "../databases") will return "/emacs/databases". Node: expand-mlisp-variable Up: Commands, Previous: expand-file-name, Next: expand-mlisp-word Prompts for the name of a declared variable then inserts the name as text into the current buffer. This is very handly for typing in MLisp functions. It's also fairly usefdefined by typing the start-remembering command (^X() then typing the commands which you want to have saved (which will be executed as you type them so that you can make sure that they are right) then typing the stop-remembering command (^X)). To execute the keyboard macro just type the execute-keyboard-macro command (^Xe). You can only have one keyboard macro at a time. If you define a new keyboard macro the old keyboard macro vanishes into the mist. Named macros are slightly more complicated.   They have names, just like commands and MLisp functions and can be called by name (or bound to a key). They are defined by using the define-string-macro command (which must be executed by typing ESC-Xdefine-string-macro since it isn't usually bound to a key) which asks for the name of the macro and it's body. The body is typed in as a string in the prompt area at the bottom the the screen and hence all special characters in it must be quoted by prefixing them with ^Q. A named macro gs: an integer constant, a string constant, a name, or a call which may itself be recursivly composed of other expressions. String constants may contain the usual C excape sequences, "\n" is a newline, "\t" is a tab, "\r" is a carriage return, "\b" is a backspace, "\e" is the escape (033) character, "\nnn" is the character whose octal representation is nnn, and "^\c" is the control version of the character c. For example, the following are legal MLisp expressions: 1 The integmay be executed by typing ESC-Xname-of-macro or by binding it to a key with bind-to-key. The current keyboard macro can be converted into a named macro by using the define-keyboard-macro command which takes a name a defines a macro by that name whose body is the current keyboard macro. The current keyboard macro ceases to exist. MLisp ----- Emacs contains an interpreter for a language that in many respects resembles Lisp. The primary (some would say only) resemblance between Mocker constant 1. "hi" A two character string constant "\^X\^F" A two character string constant """what?""" A seven character string constant (+ 2 2) An invocation of the "+" function with integer arguments 2 and 2. "+" is the usual addition function. This expression evaluates to the integer 4. (setq bert (* 4 12)) An invocation of the function setq with the variable bert as its first argument and  Lisp and any real Lisp is the general syntax of a program, which many feel is Lisp's weakest point. The differences include such things as the lack of a cons function and a rather peculiar method of passing parameters. The syntax of MLisp expressions There are four basic syntactic entities out of which MLisp expressions are built. The two simplest are integer constants (which are optionally signed strings of digits) and string constants (which are sequences of characters bounded by double quote and expression that evaluates the product of 4 and 12 as its second argument. The evaluation of this expression assigns the integer 48 to the variable bert. (visit-file "mbox") An invocation of the function visit-file with the string "mbox" as its first argument. Normally the visit-file function is tied to the key ^X^B. When it is invoked interactively, either by typing ^X^B or[``"''] characters -- double quotes are included by doubling them: """" is a one character string. The third are names which are used to refer to things: variables or procedures. These three are all tied together by the use of procedure calls. A procedure call is written as a left parenthesis, ``('', a name which refers to the procedure, a list of whitespace separated expressions which serve as arguments, and a closing right parenthesis, ``)''. An expression is simply one of these four thin ESC-Xvisit-file, it will prompt in the minibuf for the name of the file. When called from MLisp it takes the file name from the parameter list. All of the keyboard-callable function behave this way. Names may contain virtually any character, except whitespace or parens and they cannot begin with a digit, ``"'' or ``-''. The evaluation of MLisp expressions Variables must be declared (bound) before they can be used. The  declare-global command can be used to declare a global variable; a local is declared by listing it at the beginning of a progn or a function body (ie. immediately after the function name or the word progn and before the executable statements). For example: (defun (foo i (setq i 5) ) ) defines a rather pointless function called foo which declares a single local variable i and assigns it the value 5. Unlike real Lisp systems, the list of declared variablehich calls the procedure, by the user typing it's name to the ESC-X command, or by striking a key to which the procedure name has been bound. All of the commands listed in the section COMMAND DESCRIPTION of the manual may be called as MLisp procedures. Any parameters that they normally prompt the user for are taken as string expressions from the argument list in the same order as they are asked for interactivly. For example, the switch-to-buffer command, which is normally tied to thes is not surrounded by parenthesis. Expressions evaluate to values that are either integers, strings or markers. Integers and strings are converted automaticly from one to the other type as needed: if a function requires an integer parameter you can pass it a string and the characters that make it up will be parsed as an integer; similarly passing an integer where a string is required will cause the integer to be converted. Variables may have either type and their type is decided dynamica ^XB key, normally prompts for a buffer name and may be called from MLisp like this: (switch-to-buffer string-expression). Scope issues There are several sorts of names that may appear in MLisp programs. Procedure, buffer and abbrev table names are all global and occupy distinct name space. For variables there are three cases: 1. Global variables: these variables have a single instance and are created either by using declare-global, set-default or setq-default. Thlly when the assignment is made. Marker values indicate a position in a buffer. They are not a character number. As insertions and deletions are performed in a buffer, markers automatically follow along, maintaining their position. Only the functions mark and dot return markers; the user may define ones that do and may assign markers to variables. If a marker is used in a context that requires an integer value then the ordinal of the position within the buffer is used; if eir lifetime is the entire editing session from the time they are created. 2. Local variables: these have an instance for each declaration in a procedure body or local block (progn). Their lifetime is the lifetime of the block which declares them. Local declarations nest and hide inner local or global declarations. 3. Buffer-specific variables: these have a default instance and an instance for each buffer in which they have been explicitly given a  a marker is used in a context that requires a string value then the name of the marked buffer is used. For example, if there has been assigned some marker, then (pop-to-buffer there) will pop to the marked buffer. (goto-character there) will set dot to the marked position. A procedure written in MLisp is simply an expression that is bound to a name. Invoking the name causes the associated expression to be evaluated. Invocation may be triggered either by the evaluation of some expression w value. They are created by using declare-buffer-specific. When a variable which has been declared to be buffer specific is assigned a value, if an instance for the current buffer hasn't been created then it will be. The value is assigned to the instance associated with the current buffer. If a buffer specific variable is referenced and an instance doesn't exist for this buffer then the default value is used. This default valu e may be set with either setq-default or set-default. If a global instance exists when a variable is declared buffer-specific then the global value becomes the default. MLisp functions An MLisp function is defined by executing the defun function. For example: (defun (silly (insert-string "Silly!") ) ) defines a function called silly which, when invoked, just inserts the string "Silly!" into the current buffer. MLisp has a rather ) Given this, the expression (dotimes 10 (insert-string "<>")) will insert the string "<>" 10 times. [Note: The prompt argument may be omitted if the function can never be called interactivly] . Debugging See the section on debugging in the manual. The following piece of MLisp code is the Scribe mode package. Other implementations of Emacs, on ITS and on Multics have modes that influence the behaviour of Emacs on a file. This behaviour is usually some sort of language-specific  strange (relative to other languages) parameter passing mechanism. The arg function, invoked as (arg i prompt) evaluates the i'th argument of the invoking function if the invoking function was called interactivly or, if the invoking function was not called interactivly, arg uses the prompt to ask you for the value. Consider the following function: (defun (in-parens (insert-string "(") (insert-string (arg 1 "String to insert? ")) (insert-string ")")assistance. In this Emacs a mode is no more that a set of functions, variables and key-bindings. This mode package is designed to be useful when editing Scribe source files. (defun The apply-look function makes the current word "look" different by changing the font that it is printed in. It positions dot at the beginning of the word so you can see where the change will be made and reads a c ) ) If you type ESC-Xin-parens to invoke in-parens interactivly then Emacs will ask in the minibuffer "String to insert? " and then insert the string typed into the current buffer surrounded by parenthesis. If in-parens is invoked from an MLisp function by (in-parens "foo") then the invocation of arg inside in-parens will evaluate the expression "foo" and the end result will be that the string "(foo)" will be inserted into the buffer. The function interactive may be used to determineharacter from the tty. Then it inserts "@c[" (where c is the character typed) at the front of the word and "]" at the back. Apply-look gets tied to the key ESC-l so typing ESC-l i when the cursor is positioned on the word "begin" will change the word to "@i[begin]". (apply-look go-forward (save-excursion c (if (! (eolp)) (forward-character)) (setq go-for whether or not the invoking function was called interactivly. Nargs will return the number of arguments passed to the invoking function. This parameter passing mechanism may be used to do some primitive language extension. For example, if you wanted a statement that executed a statement n times, you could use the following: (defun (dotimes n (setq n (arg 1)) (while (> n 0) (setq n (- n 1)) (arg 2) ) ) ward -1) (backward-word) (setq c (get-tty-character)) (if (> c ' ') (progn (insert-character '@') (insert-character c) (insert-character '[') (forward-word) (setq go-forward (dot)) (insert-character ']') ) ) ) (if (= go-forward (dot)) (forward-character)) ) ) (defun This function is called to set a buffer into Scribe mode (scribe-mode (remove-all-local-bindings) If the string "LastEditDate=""" exists in the first 2000 characters of the document then the following string constant is changed to the current date. The intent of this is that you should stick at the beginning of your file a line like: ``@string(LastEditDate="Sa to suit your taste. If a user has not set up an .emacs_pro file then Emacs will use a site-specific default file for initialization. This file is named /emacs/maclib/profile.ml 2. Emacs will then interprete its command line switches. "+l" loads the given file (only one may be named), "+e" executes the named function (again, only one may be named). +l and +e are executed in that order, after the user profile is read, t Jul 11 17:59:01 1981")''. This will automatically get changed each time you edit the file to reflect that last date on which the file was edited. (if (! buffer-is-modified) (save-excursion (error-occurred (goto-character 2000) (search-reverse "LastEditDate=""") (search-forward """") (set-mark) (search-forwarbut before and file visits are done. This is intended to be used along with the alias mechanism to allow you to invoke Emacs packages from the shell. 3. If neither argv nor argc have yet been called (eg. by your startup or by the command line named package) then the list of arguments will be considered as file names and will be visited; if there are no arguments then the arguments passed to the last invocation of Emacs will be used. 4. Finally, Emacd """") (backward-character) (delete-to-killbuffer) (insert-string (current-time)) (setq buffer-is-modified 0) ) ) ) (local-bind-to-key "justify-paragraph" "\ej") (local-bind-to-key "apply-look" "\el") (setq right-margin 77) (setq mode-string "Scribe") (setq case-fold-search 1) (use-syntax-table "text-mode") (modify-syntax-entry "w -'"s invokes it's keyboard command interpreter, and eventually terminates. Node: fetch-database-entry Up: Commands, Previous: extend-database-search-list, Next: file-exists (fetch-database-entry dbname key) takes the entry in the data base corresponding to the given key and inserts it into the current buffer. Node: file-exists Up: Commands, Previous: fetch-database-entry, Next: filter-region (file-exists fn) returns 1 if the file named by fn exists and is writable, 0 if it does not exi) (use-abbrev-table "text-mode") (setq left-margin 1) (novalue) ) ) (novalue) When Emacs is invoked, it does several things that are not of too much interest to the beginning user. 1. Emacs looks for a file called ``.emacs_pro'' in your home directory, if it exists then it is loaded, with the load command. This is the mechanism used for user profiles -- in your .emacs_pro file, place the commands needed to customize Emacsst, and -1 if it exists and is readable but not writable. Node: files-should-end-with-newline Up: Variables, Previous: ctlchar-with-^, Next: global-mode-string Indicates that when a buffer is written to a file, and the buffer doesn't end in a newline, then the user should be asked if they want to have a newline appended. It used to be that this was the default action, but some people objected to the question being asked. (default ON) Node: filter-region Up: Commands, Previous: file-exists, Next: following-char Take the region between dot and mark and pass it as the standard input to the given command line. Its standard output replaces the region between dot and mark. Use this to run a region through a filter command. Node: following-char Up: Commands, Previous: filter-region, Next: forward-balanced-paren-line (following-char) is an MLisp function that returns the character immediately following dot. The null character (0) is returned if dot is at the end of the buffer. Remembeence Up: Commands, Previous: forward-paren, Next: forward-word Move dot forward to the beginning of the next sentence. Sentences are seperated by a `.', `?' or `!' followed by whitespace. Node: forward-word Up: Commands, Previous: forward-sentence, Next: get-tty-buffer Move dot forward to the end of a word. If not currently in the middle of a word, skip all intervening punctuation. Then skip over the word, leaving dot positioned after the last character of the word. A word is a sequence ofr that dot is not `at' some character, it is between two characters. Node: forward-balanced-paren-line Up: Commands, Previous: following-char, Next: forward-character Moves dot forward until either - The end of the buffer is reached. - An unmatched close parenthesis, ')', is encountered. That is, unmatched between there and the starting position of dot. - The beginning of a line is encountered at "parenthesis level zero". That is, without an unmatched '(' existing betwee alphanumerics. Node: get-tty-buffer Up: Commands, Previous: forward-word, Next: get-tty-character Given a prompt string it reads the name of a buffer from the tty using the minibuf and providing command completion. Node: get-tty-character Up: Commands, Previous: get-tty-buffer, Next: get-tty-command Reads a single character from the terminal and returns it as an integer. The cursor is not moved to the message area, it is left in the text window. This is useful when writing things like query-rn there and the starting position of dot. The definitions of parenthesis and strings from the syntax table for the current buffer are used. Node: forward-character Up: Commands, Previous: forward-balanced-paren-line, Next: forward-paragraph Move dot forwards one character. Ends-of-lines and tabs each count as one character. You can't move forward to after the end of the buffer. Node: forward-paragraph Up: Commands, Previous: forward-character, Next: forward-paren Moves to the end of the cueplace and incremental search. Node: get-tty-command Up: Commands, Previous: get-tty-character, Next: get-tty-string (get-tty-command prompt) prompts for the name of a declared function (using command completion & providing help) and returns the name of the function as a string. For example, the expand-mlisp-word function is simply (insert-string (get-tty-command ": expand-mlisp-word ")). Node: get-tty-string Up: Commands, Previous: get-tty-command, Next: get-tty-variable Reads a stringrrent or following paragraph. Blank lines, and Scribe and nroff command lines separate paragraphs and are not parts of paragraphs. Node: forward-paren Up: Commands, Previous: forward-paragraph, Next: forward-sentence Moves dot forward until an unmatched close parenthesis, ')', or the end of the buffer is found. This can be used to aid in skipping over Lisp S-expressions. The definitions of parenthesis and strings from the syntax table for the current buffer are used. Node: forward-sent from the terminal using its single string parameter for a prompt. Generally used inside MLisp programs to ask questions. Node: get-tty-variable Up: Commands, Previous: get-tty-string, Next: getenv (get-tty-variable prompt) prompts for the name of a declared variable (using command completion & providing help) and returns the name of the variable as a string. For example, the expand-mlisp-variable function is simply (insert-string (get-tty-variable ": expand-mlisp-variable ")). Node: getenv Up: Commands, Previous: get-tty-variable, Next: global-binding-of (getenv "varname") returns the named shell environment variable. for example, (getenv "HOME") will return a string which names your home directory. Node: Getting Help Up: Introduction, Previous: Unbound Commands, Next: Buffers and Windows Emacs has many commands that let you ask Emacs for help about how to use Emacs. The simplest one is ESC-? (apropos) which asks you for a keyword and then displays a list ofof the bindings you have made. Node: Getting Out Next: Screen And Screen Operations, Up: Quick * Menu: * write-current-file:: ^X-^S Save the file being worked on * write-named-file:: ^X-^W Write the current buffer into a file with a different name * write-modified-files:: ^X-^M Write out all modified files * write-file-exit:: ^X-^F Write out all modified files and exit * exit-emacs:: ^C or ESC-^C or ^X-^C Finish by exiting to the shell *  those commands whose full name contains the keyword as a substring. For example, to find out which commands are available for dealing with windows, type ESC-?, Emacs will ask "Keyword:" and you reply "window". A list like the following appears: beginning-of-window ESC-, delete-other-windows ^X1 delete-window ^XD end-of-window ESC-. enlarge-window ^XZ line-to-top-of-window ESC-! next-window return-to-monitor:: ^_ Recursively push (escape) to a new shell Node: global-binding-of Up: Commands, Previous: getenv, Next: goto-character Returns the name of the procedure to which a keystroke sequence is bound in the global keymap. "nothing" is returned if the sequence is unbound. The procedure local-binding-of performs a similar function for the local keymap. Node: global-mode-string Up: Variables, Previous: files-should-end-with-newline Global-mode-string is a global variable  ^XN page-next-window ESC-^V previous-window ^XP shrink-window ^X^Z split-current-window ^X2 To get detailed information about some command, the describe-command command can be used. It asks for the name of a command, then displays the long documentation for it from the manual. For example, if you wanted more information about the shrink-window command, just type "ESC-Xdescribe-command shrink-window" and Emused in the construction of mode lines see section , page 21 for more information. Node: goto Up: Packages, Previous: el-lisp, Next: incr-search goto-line Moves the cursor to beginning of the indicated line. The line number is taken from the prefix argument if it is provided, it is prompted for otherwise. Line numbering starts at 1. goto-percent Moves dot to the indicated percentage of the buffer. The percentageacs will reply: shrink-window Makes the current window one line shorter, and the win (or the one above if there is no window below) one line Can't be used if there is only one window on the screen. If you want to find out what command is bound to a particular key, describe-key will do it for you. Describe-bindings can be used to make a "wall chart" description of the key bindings in the currently running Emacs, taking into account all  is taken from the prefix argument if it is provided, it is prompted for otherwise. (goto-percent n) goes to the character that is n% from the beginning of the buffer. Node: goto-character Up: Commands, Previous: global-binding-of, Next: if Goes to the given character-position. (goto-character 5) goes to character position 5. Node: Help And Helper Functions Next: Search, Up: Quick * Menu: * illegal-operation:: ^G Abort anything at any time. * apropos:: ESC-? Show every command containing string (try ESC-? para) * info:: ESC-X info Browse through the Emacs manual. Node: help-on-command-completion-error Up: Variab If ON Emacs will print a list of possibilities when an ambiguous command is given, otherwise it just rings the bell and waits for you to type more. (default ON) Node: if Up: Commands, Previous: goto-character, Next: illegal-operation (if test then "O", the cursor is after the first "FOO" after the place where you started the search. At the same time, the "FOO" has echoed at the bottom of the screen. If you type a mistaken character, you can rub it out. After the FOO, typing a rubout makes the "O" disappear from the bottom of the screen, leaving only "FO". The cursor moves back to the "FO". Rubbing out the "O" and "F" moves the cursor back to where you started the search. When you are satisfied with the place you have reacclause elseclause) is an MLisp function that executes and returns the value of thenclause iff test is true; otherwise it executes elseclause if it is present. For example: (if (eolp) (to-col 33) ) will tab over to column 33 if dot is currently at the end of a line. Node: illegal-operation Up: Commands, Previous: if, Next: indent-C-procedure Illegal-operation is bound to those keys that do not have a defined interpretation. Executing illegal-operation is an error. Moshed, you can type an ESC, which stops searching, leaving the cursor where the search brought it. Also, any command not specially meaningful in searches stops the searching and is then executed. Thus, typing ^A would exit the search and then move to the beginning of the line. ESC is necessary only if the next command you want to type is a printing character, Rubout, ESC or another search command, since those are the characters that would not exit the search. Sometimes you search for "FOO" and fint notably, ^G, ESC-^G, ^X^G are bound to illegal-opetation by default, so that typing ^G will always get you out of whatever strange state you are in. Node: incr-search Up: Packages, Previous: goto, Next: info ITS Emacs has a the search command that is unusual in that it is "incremental"; it begins to search before you have finished typing the search string. As you type in the search string, Emacs shows you where it would be found. When you have typed enough characters to identid it, but not the one you expected to find. There was a second FOO that you forgot about, before the one you were looking for. Then type another ^S and the cursor will find the next FOO. This can be done any number of times. If you overshoot, you can rub out the ^S's. You can also repeat the search after exiting it, if the first thing you type after entering another search (when the argument is still empty) is a ^S. If your string is not found at all, the echo area says "Failing I-Searfy the place you want, you can stop. The incr-search package perfectly emulates this in 4404 Emacs. Typically one binds incremental-search to ^S and reverse-incremental-search to ^R. The command to search is ^S (incremental-search). ^S reads in characters and positions the cursor at the first occurrence of the characters that you have typed. If you type ^S and then F, the cursor moves right after the first "F". Type an "O", and see the cursor move to after the first "FO". After anotherch". The cursor is after the place where Emacs found as much of your string as it could. Thus, if you search for FOOT, and there is no FOOT, you might see the cursor after the FOO in FOOL. At this point there are several things you can do. If your string was mistyped, you can rub some of it out and correct it. If you like the place you have found, you can type ESC or some other Emacs command to "accept what the search offered". Or you can type ^G, which throws away the characters that could not be found (the "T" in "FOOT"), leaving those that were found (the "FOO" in "FOOT"). A second ^G at that point undoes the search entirely. The ^G "quit" command does special things during searches; just what, depends on the status of the search. If the search has found what you specified and is waiting for input, ^G cancels the entire search. The cursor moves back to where you started the search. If ^G is typed while the search is actually searching for something or updating tndent-C-procedure Up: Commands, Previous: illegal-operation, Next: insert-character Take the current C procedure and reformat it using the indent program, a fairly sophisticated pretty printer. Indent-C-procedure is God's gift to those who don't like to fiddle about getting their formatting right. Indent-C-procedure is usually bound to ESC-J. When switching from mode to mode, ESC-J will be bound to procedures appropriate to that mode. For example, in text mode ESC-J is bound to justifhe display, or after search failed to find some of your input (having searched all the way to the end of the file), then only the characters which have not been found are discarded. Having discarded them, the search is now successful and waiting for more input, so a second ^G will cancel the entire search. Make sure you wait for the first ^G to ding the bell before typing the second one; if typed too soon, the second ^G may be confused with the first and effectively lost. You can also type ^R ay-paragraph. Node: info Up: Packages, Previous: incr-search, Next: lisp-mode Info is a system which lets you browse through the documentation for various systems. In particular, all the Emacs documentation is available online through it. Both the describe-command and describe-variable functions use it. Rather than document Info extensivly here, I suggest that you run Info and use it to describe itself. Node: init files Up: top When EMACS starts up, it looks for a file called t any time to start searching backwards. If a search fails because the place you started was too late in the file, you should do this. Repeated ^R's keep looking for more occurrences backwards. A ^S starts going forwards again. ^R's can be rubbed out just like anything else. If you know that you want to search backwards, you can use ^R instead of ^S to start the search, because ^R is also a command (reverse-incremental-search) to search backward. Node: indent-C-procedure U".emacs_pro" on your login directory. If it finds one, it loads it. .emacs_pro files are used to customize key bindings, pre-load libraries you use frequently, and define personal functions that don't rate a library of their own. They are written as a series of MLisp expressions that are executed as they are read. * menu: * trivial example:: * default profile:: This is the profile that is used if you don't define one yourself. * Extensibility:: How to write MLisp functions (not for the faint op: Commands, Previous: illegal-operation, Next: insert-character Take the current C procedure and reformat it using the indent program, a fairly sophisticated pretty printer. Indent-C-procedure is God's gift to those who don't like to fiddle about getting their formatting right. Indent-C-procedure is usually bound to ESC-J. When switching from mode to mode, ESC-J will be bound to procedures appropriate to that mode. For example, in text mode ESC-J is bound to justify-paragraph. Node: if heart!) Node: Input Conventions Up: Introduction, Previous: The Screen, Next: Invoking Emacs Throughout this manual, characters which are used as commands are printed in bold face: X. They will sometimes have a control prefix which is printed as an uparrow character: ^X is control-X and is typed by holding down the control (labeled Ctrl on the top of the key) and simultaneously striking X. Some will have an escape (sometimes called meta) prefix which is usually printed thus: ESC-X and typed by striking the escape key (labeled Esc) then X. And some will have a ^X prefix which is printed ^XX which is typed by holding down the control key, striking X, releasing the control key then striking X again. For example, ESC-^J is typed by striking ESC then holding down the control key and striking J. Node: insert-character Up: Commands, Previous: indent-C-procedure, Next: insert-file Inserts its numeric argument into the buffer as a single character. (insert-rev mode:: * Extensibility:: * Searching:: * Keymaps:: * Region Restrictions:: * Mode Lines:: Node: Invoking Emacs Up: Introduction, Previous: Input Conventions, Next: Basic Commands Emacs is invoked as a 4404 OS command by typing emacs files to the shell (the OS command interpreter). Emacs will start up, editing the named files. You will probably only want to name one file. If you don't specify any names, Emacs will use the same names that it was given the last time that it was invokedcharacter '0') inserts the character '0' into the buffer. Node: insert-file Up: Commands, Previous: insert-character, Next: insert-string Prompt for the name of a file and insert its contents at dot in the current buffer. Node: insert-string Up: Commands, Previous: insert-file, Next: interactive (insert-string stringexpressions) is an MLisp function that inserts the strings that result from evaluating the given stringexpressions and inserts them into the current buffer just before dot. Node: Inser. Gory details on the invocation of Emacs can be found in that section of the manual. Node: is-bound Up: Commands, Previous: interactive, Next: justify-paragraph an MLisp predicate that is true iff all of its variable name arguments are bound. Node: justify-paragraph Up: Commands, Previous: is-bound, Next: kill-to-end-of-line Take the current paragraph (bounded by blank lines or Scribe control lines) and pipe it through the "fmt" command which does paragraph justification. justify-paragraph is ting Up: Commands Normally, to insert text into a buffer you just type them in. When you hit the 'a' key, an 'a' will be inserted. That is because all of the simple keys are bound to "self-insert". The other commands in the following list perform more complicated forms of insertion. * menu: * insert-character:: * insert-file:: (^X-^I) * insert-string:: * self-insert:: (^I, ..,, .../, :..~) * yank-buffer:: (ESC-^Y) * yank-from-killbuffer:: (^Y) Node: interactive Up: Commands, Previous: usually bound to ESC-J when in text mode. Node: Keymaps Up: Introduction, Previous: Searching, Next: Region Restrictions When a user is typing to Emacs the keystrokes are interpreted using a keymap. A keymap is just a table with one entry for each character in the ASCII character set. Each entry either names a function or another keymap. When the user strikes a key, the corresponding keymap entry is examined and the indicated action is performed. If the key is bound to a function, then that fuinsert-string, Next: is-bound An MLisp function which is true iff the invoking MLisp function was invoked interactively (ie. bound to a key or by ESC-X). Node: Introduction Up: Top This information is similar to what is in your Emacs manual. The information in the manual is guaranteed to be more up-to-date and correct that this. * menu: * The Screen:: * Input Conventions:: * Invoking Emacs:: * Basic Commands:: * Unbound Commands:: * Getting Help:: * Buffers and Windows:: * Compiling programs:: * Abbnction will be invoked. If the key is bound to another keymap then that keymap is used for interpreting the next keystroke. There is always a global keymap and a local keymap, as keys are read from the keyboard the two trees are traversed in parallel (you can think of keymaps as FSMs, with keystrokes triggering transitions). When either of the traversals reaches a leaf, that function is invoked and interpretation is reset to the roots of the trees. The root keymaps are selected using the use-global-map or use-local-map commands. A new empty keymap is created using the define-keymap command. The contents of a keymap can be changed by using the bind-to-key and local-bind-to-key commands. These two commands take two arguments: the name of the function to be bound and the keystroke sequence to which it is to be bound. This keystroke sequence is interpreted relative to the current local or global keymaps. For example, (bind-to-key "define-keyeymap "vi-command-mode") (define-keymap "vi-insertion-mode") (use-global-map "vi-insertion-mode"); Setup the insertion mode map (bind-to-key "execute-extended-command" "\^X") (progn i (setq i ' ') (while (< i 0177) (bind-to-key "self-insert" i) (setq i (+ i 1)))) (bind-to-key "self-insert" "\011") (bind-to-key "newline" "\015") (bind-to-key "self-insert" "\012") (bind-to-key "delete-previous-character" "\010") (bind-to-key "delete-previous-character" "\177") (bind-to-key "exit-insermap" "\^Zd") binds the define-keymap function to the keystroke sequence `^Z' followed by `d'. A named keymap behaves just like a function, it can be bound to a key or executed within an MLisp function. When it is executed from within an MLisp function, it causes the next keystroke to be interpreted relative to that map. The following sample uses the keymap to partially simulate the vi editor. Different keymaps are used to simulate the different modes in vi: command mode and insertion mode.tion" "\033") (use-global-map "vi-command-mode"); Setup the command mode map (bind-to-key "execute-extended-command" "\^X") (bind-to-key "next-line" "\^n") (bind-to-key "previous-line" "\^p") (bind-to-key "forward-word" "w") (bind-to-key "backward-word" "b") (bind-to-key "search-forward" "/") (bind-to-key "search-reverse" "?") (bind-to-key "beginning-of-line" "0") (bind-to-key "end-of-line" "$") (bind-to-key "forward-character" " ") (bind-to-key "backward-character" "\^h") (bind-to-key "backward-character" (defun (insert-before ; Enter insertion mode (use-global-map "vi-insertion-mode")) (insert-after ; Also enter insertion mode, but after ; the current character (forward-character) (use-global-map "vi-insertion-mode")) (exit-insertion ; Exit insertion mode and return to ; command mode (use-global-map "vi-command-mode")) (replace-one (insert-charac "h") (bind-to-key "insert-after" "a") (bind-to-key "insert-before" "i") (bind-to-key "replace-one" "r") (bind-to-key "next-skip" "+") (bind-to-key "next-skip" "\^m") (bind-to-key "prev-skip" "-") (use-global-map "default-global-keymap") Node: kill-to-end-of-line Up: Commands, Previous: justify-paragraph, Next: last-key-struck Deletes characters forward from dot to the immediately following end-of-line (or end of buffer if there isn't an end of line). If dot is positioned at the end of a line then theter (get-tty-character)) (delete-next-character)) (next-skip (beginning-of-line) (next-line) (skip-white-space)) (prev-skip (beginning-of-line) (previous-line) (skip-white-space)) (skip-white-space (while (& (! (eolp)) (| (= (following-char) ' ') (= (following- (forward-character))) (vi ; Start behaving like vi (use-global-map "vi-command-mode")) ) ; setup vi mode tables (define-k end-of-line character is deleted. Text deleted by the ^K command is placed into the Kill buffer (which really is a buffer that you can look at). A ^K command normally erases the contents of the kill buffer first; subsequent ^K's in an unbroken sequence append to the kill buffer. Node: last-key-struck Up: Commands, Previous: kill-to-end-of-line, Next: length The last command character struck. If you have a function bound to many keys the function may use last-key-struck to tell which key was used to invoke it. (insert-character (last-key-struck)) does the obvious thing. Node: left-margin Up: Variables, Next: mode-line-format The left margin for automatic text justification. After an automatically generated newline the new line will be indented to the left margin. Node: length Up: Commands, Previous: last-key-struck, Next: line-to-top-of-window Returns the length of its string parameter. (length "time") => 4. Node: line moves Up: Moving around * menu: * beginning-of-line:: and buffer-specific variable assignments and key bindings. Load is usually used to load macro libraries and is used to load ".emacs_pro" from your home directory when Emacs starts up. For example, loading this file: (setq right-margin 75) (defun (my-linefeed (end-of-line) (newline-and-indent) ) ) (bind-to-key "my-linefeed" 10) sets the right-margin to 75 and defines a function called my-linefeed and binds it to the linefeed key (which is t (^A) * end-of-line:: (^E) * goto-line:: * next-line:: (^N) * previous-line:: (^P) Node: Line Operations Next: Paragraph Operations, Up: Quick * Menu: * beginning-of-line:: ^A Move to the beginning of the line * end-of-line:: ^E Move to the end of the line * newline-and-backup:: ^O Open up a line for typing * kill-to-end-of-line:: ^K Kill from dot to end of line (^Y yanks it back at dot) Node: line-to-top-of-window he ascii character 10 (decimal)). Node: local-bind-to-key Up: Commands, Previous: load, Next: local-binding-of Prompt for the name of a command and a key and bind that command to the given key but unlike bind-to-key the binding only has effect in the current buffer. This is generally used for mode specific bindings that will generally differ from buffer to buffer. Node: local-binding-of Up: Commands, Previous: local-bind-to-key, Next: looking-at Returns the name of the procedure to which Up: Commands, Previous: length, Next: list-buffers What more can I say? This one is handy if you've just searched for the declaration of a procedure, and want to see the whole body (or as much of it as possible). Node: lisp-mode Up: Packages, Previous: info, Next: occur See the manual for information. Node: list-buffers Up: Commands, Previous: line-to-top-of-window, Next: list-databases Produces a listing of all existing buffers giving their names, the name of the associated file (if there a keystroke sequence is bound in the local keymap. "nothing" is returned if the sequence is unbound. The procedure global-binding-of performs a similar function for the global keymap. Node: looking-at Up: Commands, Previous: local-binding-of, Next: mark (looking-at "SearchString") is true iff the given regular expression search string matches the text immediately following dot. This is for use in packages that want to do a limited sort of parsing. For example, if dot is at the beginninis one), the number of characters in the buffer and an indication of whether or not the buffer has been modified since it was read or written from the associated file. Node: list-databases Up: Commands, Previous: list-buffers, Next: load (list-databases) lists all data base search lists. Node: load Up: Commands, Previous: list-databases, Next: local-bind-to-key Read the named file as a series of MLisp expressions and execute them. Typically a loaded file consists primarily of defun's g of a line then (looking-at "[ \t]*else]) will be true if the line starts with an "else". See the manual for more information on regular expressions. Node: Macro Operations Next: Compiling (Make) Operations., Up: Quick * Menu: * start-remembering:: ^X-( Start remembering keystrokes, ie. start defining a keyboard macro * stop-remembering:: ^X-) Stop remembering keystrokes, ie. end the definition * execute-keyboard-macro:: ^X-e Execute remembered keystrokes, ie. execute the keyboard macro Node: mark Up: Commands, Previous: looking-at, Next: message An MLisp function that returns the position of the marker in the current buffer. An error is signaled if the marker isn't set. The value of the function is an object of type "marker" -- if it is assigned to a variable then as changes are made to the buffer the variable's value continues to indicate the same position Commands There are several MLisp statements that deal with control flow in MLisp programs: * menu: * while:: For loops * if:: For conditionals * progn:: For block structuring * save-excursion:: Execute a block of statements in a protected environment. * save-window-excursion:: Like save excursion * error-occurred:: Error trap Node: Mode Lines Up: Introduction, Previous: Region Restrictions A mode line is the line of descriptive text that appears just below a window on the screen. I in the buffer. Node: Marks Up: Commands A "marker" exists for each buffer. It is much like "dot" in that it points to a position in the buffer, but it must be set explicitly with the set-mark command. The mark and dot cooperate to define the bounds of a region of text which is manipulated by many commands. * menu: * exchange-dot-and-mark:: (^X-^X) * mark:: * set-mark:: (^@) Node: message Up: Commands, Previous: mark, Next: modify-syntax-entry (message stringexpressions) is an MLisp functiont usually provides a description of the state of the buffer and is usually shown in reverse video. The standard mode line shows the name of the buffer, an `*' if the buffer has been modified, the name of the file associated with the buffer, the mode of the buffer, the current position of dot within the buffer expressed as a percentage of the buffer size and and indication of the nesting within recursive-edit's which is shown by wrapping the mode line in an appropriate number of `[' `]' pair that places the strings that result from the evaluation of the given stringexpressions into the message region on the display (the line at the bottom). Node: Mice Up: Top Emacs now supports the 4404 mouse. When using the tablet you will see two cursors on the screen: one being the arrow associated with the mouse, and the other being the standard Emacs cursor (usually a flashing underscore). Whenever you press a mouse button, an escape sequence is sent to the Emacs (as if it were typed) which s. It is often the case that for some silly or practical reason one wants to alter the layout of the mode line, to show more, less or different information. Emacs has a fairly general facility for doing this. Each buffer has associated with it a format string that describes the layout of the mode line for that buffer whenever it appears in a window. The format string is interpreted in a manner much like the format argument to the C printf subroutine. Unadorned characters appear in tincludes information as to which character is being pointed at and which button is pressed. Normally the buttons are interpreted as: Left: Move dot to just before the character being pointed at. Shift-Left: Move mark to just before the character being pointed at. See the manual for more information, or read the comments in the file /emacs/maclib/tek4404.ml * menu: * move-dot-to-x-y:: Documentation for the MLisp function that makes mouse support possible. Node: MLisp statements Up:he mode line unchanged. The `%' character and the following format designator character cause some special string to appear in the mode line in their place. The format designators are: b Inserts the name of the buffer. f Inserts the name of the file associated with the buffer. m Inserts the value of the buffer-specific variable mode-string. M Inserts the value of the variable global-mode-string. p Inserts the position of "dot" as a percentage. * Inserts an `*' if the buffer has been modified. [ Inserts (recursion-depth) `['s. ] Inserts (recursion-depth) `]'s. If a number n appears between the `%' and the format designator then the inserted string is constrained to be exactly n characters wide. Either by padding or truncating on the right. The default mode line is built using the following format: " %[Buffer: %b%* File: %f %M (%m) %p%]" The followicific variable used in the construction of mode lines see the manual for more information. Node: modify-syntax-entry Up: Commands, Previous: message, Next: move-dot-to-x-y Modify-syntax-entry is used to modify a set of entries in the syntax table associated with the current buffer. Syntax tables are associated with buffers by using the use-syntax-table command. Syntax tables are used by commands like forward-paren to do a limited form of parsing for language dependent routines. They define ng variables are involved in generating mode lines: mode-line-format This is the buffer specific variable that provides the format of a buffers mode line. default-mode-line-format This is the value to which mode-line-format is initialized when a buffer is created. mode-string This buffer-specific string variable can be inserted into the mode line by using `%m' in the format. This is it's only such things as which characters are parts of words, which quote strings and which delimit comments (currently, nothing uses the comment specification). To see the contents of a syntax table, use the dump-syntax-table command. The parameter to modify-syntax-entry is a string whose first five characters specify the interpretation of the sixth and following characters. The first character specifies the type. It may be one of the following: 'w' A word character,  use by Emacs. Usually, mode packages (like `lisp-mode' or `c-mode') put some string into mode-string to indicate the mode of the buffer. It is the appearance of this piece of descriptive information that gives the mode line its name. global-mode-string This is similar to mode-string except that it is global -- the same string will be inserted into all mode lines by `%M'. as used by such commands as forward-word and case-word-capitalize. space A character with no special interpretation. '(' A left parenthesis. Typical candidates for this type are the characters '(', '[' and '{'. Characters of this type also have a matching right parenthesis specified (')', ']' and '}' for example) which appears as the second character of the parameter to modify-syntax-entry. ')'  It is usually used for information of global interest. For example, the time package puts the current time of day and load average there. Node: mode-line-format Up: Variables, Previous: left-margin, Next: mode-string mode-line-format is a buffer specific variable used to specify the format of a mode line. See the manual for more information. Node: mode-string Up: Variables, Previous: mode-line-format, Next: needs-checkpointing Mode-string is a buffer spe A right parenthesis. Typical candidates for this type are the characters ')', ']' and '}'. Characters of this type also have a matching left parenthesis specified ('(', '[' and '{' for example) which appears as the second character of the parameter to modify-syntax-entry. '"' A quote character. The C string delimiters " and ' are usually given this class, as is the Lisp |. '\' A prefix character, like \ in C or / in MacLisp. The second character of the parameter is the matching parenthesis if the character is of the left or right parenthesis type. If you specify that '(' is a right parenthesis matched by ')', then you should also specify that ')' is a left parenthesis matched by '('. The third character, if equal to '{', says that the character described by this syntax entry can begin a comment; the forth character, if equal to '}' says that the character described by thiso-x-y, Next: nargs If the cursor is not at the beginning of a line, ESC-C moves the cursor to the column specified by the comment-column variable by inserting tabs and spaces as needed. In any case, it the sets the right margin to the column finally reached. This is usually used in macros for language-specific comments. Node: Moving around Up: Commands All of the motion commands move the cursor up, down, left or right in terms of some basic unit. * menu: * character moves:: * word moves::  syntax entry can end a comment. If either the beginning or ending comment sequence is two characters long, then the fifth character provides the second character of the comment sequence. The sixth and following characters specify which characters are described by this entry; a range of characters can be specified by putting a '-' between them, a '-' can be described if it appears as the sixth character. A few examples, to help clear up my muddy exposition: (modify-syntax-entry "w * line moves:: * sentence moves:: * paragraph moves:: * window moves:: * parenthesised moves:: * summary table:: Node: nargs Up: Commands, Previous: move-to-comment-column, Next: narrow-region An MLisp function which returns the number of arguments passed to the invoking MLisp function. For example, within the execution of foo invoked by (foo x y) the value of nargs will be 2. Node: narrow-region Up: Commands, Previous: nargs, Next: newline The narrow-region command sets the restriction -") ; makes '-' behave as a normal word ; character (ESC-F will consider ; one as part of a word) (modify-syntax-entry "(] [") ; makes '[' behave as a left parent ; which is matched by ']' (modify-syntax-entry ")[ ]") ; makes ']' behave as a right paren ; which is matched by '[' Node: move-dot-to-x-y Up: Commands, Previous: modify-syntax-entry, Nexto encompass the region between dot and mark. Text outside this region will henceforth be totally invisible. It won't appear on the screen and it won't be manipulable by any editing commands. This can be useful, for instance, when you want to perform a replacement within a few paragraphs: just narrow down to a region enclosing the paragraphs and execute replace-string. Node: needs-checkpointing Up: Variables, Previous: mode-string, Next: pop-up-windows A buffer-specific variable which if ON indit: move-to-comment-column (move-dot-to-x-y x y) switches to the buffer and sets dot to the positon of the character that was displayed at screen coordinates x,y. If x and y don't point to a valid character (eg. if they are out of bounds or point to a mode line) an error is flagged. This function is intended for use supporting the mouse. See the manual, the info section on mice, or the file /emacs/maclib/tek4404.ml for more information. Node: move-to-comment-column Up: Commands, Previous: move-dot-tcates that the buffer should be checkpointed periodically. If it is OFF, then no checkpoints will be done. (default ON) Node: newline Up: Commands, Previous: narrow-region, Next: newline-and-backup Just inserts a newline character into the buffer -- this is what the RETURN (^M) key is generally bound to. Node: newline-and-backup Up: Commands, Previous: newline, Next: newline-and-indent Insert an end-of-line immediately after dot, effectivly opening up space. If dot is positioned at the beginning of a line, then ^O will create a blank line preceding the current line and position dot on that new line. Node: newline-and-indent Up: Commands, Previous: newline-and-backup, Next: next-line Insert a newline, just as typing RETURN does, but then insert enough tabs and spaces so that the newly created line has the same indentation as the old one had. This is quite useful when you're typing in a block of program text, all at the same indentation level. Node: next-line Up: Commands, Previous: nex The occur package allows one to find the occurrences of a string in a buffer. It contains one function Occurrences When invoked, prompts with "Search for all occurrences of: ". It then lists (in a new buffer) all lines contain the string you type following dot. Possible options (listed at the bottom of the screen) allow you to page through the listing buffer or abort the function. In addition, a global variable controt-error, Next: next-page Move dot to the next line. ^N and ^P attempt to keep dot at the same horizontal position as you move from line to line. Node: next-page Up: Commands, Previous: next-line, Next: next-window Reposition the current window on the current buffer so that the next page of the buffer is visible in the window (where a page is a group of lines slightly smaller than a window). In other words, it flips you forward a page in the buffer. Its inverse is ESC-V. If possible, ls the action of the function: &Occurrences-Extra-Lines is a global variable that controls how many extra surrounding lines are printed in addition to the line containing the string found. If this variable is 0 then NO additional lines are printed. If this variable is greater than 0 then it will print that many lines above and below the line on which the string was found. When printing moredot is kept where it is, otherwise it is moved to the middle of the new page. Node: next-window Up: Commands, Previous: next-page, Next: nothing Switches to the window (and associated buffer) that is below the current window. Node: nothing Up: Commands, Previous: next-window, Next: novalue Nothing evaluates the same as novalue (ie. it returns a void result) except that if it is bound to some key or attached to some hook then the key or hook behave as though no command was bound to them. For e than one line per match in this fashion, it will also print a seperator of '----------------' so you can tell where the different matches begin and end. At the end of the buffer it prints '<<>>'. Node: Packages Up: Top All of the following packages are a standard part of the Emacs library. To gain access to any of the commands that they define, just load them in using the 'load' commane (*Note:: load) * menu: * c-mode::xample, if you want to remove the binding of a single key, just bind it to "nothing". Node: novalue Up: Commands, Previous: nothing, Next: page-next-window Does nothing. (novalue) is a complete no-op, it performs no action and returns no value. Generally the value of a function is the value of the last expression evaluated in it's body, but this value may not be desired, so (novalue) is provided so that you can throw it away. Node: occur Up: Packages, Previous: lisp-mode, Next: newcompile C program assistance * dired:: a simple directory editor * electric-c:: slightly more assistance with C programs * undo:: undo the effects of previous commands * info:: the info system that you're using now * lisp-mode:: another lisp assist package * tags:: finds routines from a collection of modules * text-mode:: assistance for writing simple text * time:: time and load stats for the mode line * writeregion:: write a region to a file * goto:: a goto-line function * occur:: find all occurrences of a string Node: page-next-window Up: Commands, Previous: novalue, Next: parse-error-messages-in-region Repositions the window below the current one (or the top one if the current window is the lowest one on the screen) on the displayed buffer so that the next page of the buffer is visible in the window (where a page is a group of lines slightly smaller than a window). In other words, it flips you forward a page in the buffer of the other window. If ESC-^V is given an argument it will flip the ry to use some window other than the current one when it spontaneously generates a buffer that it wants you to see or when you visit a file (it may split the current window). If OFF the current window is always used. (default ON) Node: preceding-char Up: Commands, Previous: pop-to-buffer, Next: prefix-argument-loop (preceding-char) is an MLisp function that returns the character immediately preceding dot. The null character (0) is returned if dot is at the beginning of the buffer. Remembbuffer backwards a page, rather than forwards. So ESC-^V is roughly equivalent to ^V and ^UESC-^V is roughly equivalent to ESC-V except that they deal with the other window. Node: paragraph moves Up: Moving around * menu: * backward-paragraph:: (ESC-[) * forward-paragraph:: (ESC-]) Node: Paragraph Operations Next: Getting Out, Up: Quick * Menu: * backward-paragraph:: ESC-[ Move to beginning of the paragraph * forward-paragraph:: ESC-] Move to end of the paragraph * indent-C-proer that dot is not `at' some character, it is between two characters. Node: prefix-argument Up: Variables, Previous: pop-up-windows, Next: prefix-argument-provided Every function invocation is always prefixed by a numeric argument, either explicitly with ^Un or provide-prefix-argument. The value of the variable prefix-argument is the argument prefixed to the invocation of the current MLisp function. For example, if the following function: (defun (show-it (message (concat "cedure:: ESC-j Justify the current paragraph Node: parenthesised moves Up: Moving around * menu: * backward-balanced-paren-line:: * backward-paren:: * forward-balanced-paren-line:: * forward-paren:: Node: parse-error-messages-in-region Up: Commands, Previous: page-next-window, Next: pop-to-buffer Parses the region between dot and mark for error messages (as in the compile-it (^X^E) command) and sets up for subsequent invocations of next-error (^X^N). See the description of thThe prefix argument is " prefix-argument) ) ) were bound to the key ^A then typing ^U^A would cause the message ``The prefix argument is 4'' to be printed, and ^U13^A would print ``The prefix argument is 13''. See also the commands prefix-argument-loop and provide-prefix-argument. Node: prefix-argument-loop Up: Commands, Previous: preceding-char, Next: prepend-region-to-buffer (prefix-argument-loop ) executes prefix-argument times. Every function ie compile-it command, and section (page 18). Node: pop-to-buffer Up: Commands, Previous: pause-emacs, Next: preceding-char Switches to a buffer whose name is provided and ties that buffer to a popped-up window. Pop-to-buffer is exactly the same as switch-to-buffer except that switch-to-buffer ties the buffer to the current window, pop-to-buffer finds a new window to tie it to. Node: pop-up-windows Up: Variables, Previous: needs-checkpointing, Next: prefix-argument If ON Emacs will tnvocation is always prefixed by some argument, usually by the user typing ^Un. If no prefix argument has been provided, 1 is assumed. See also the command provide-prefix-argument and the variable prefix-argument. Node: prefix-argument-provided Up: Variables, Previous: prefix-argument, Next: prefix-string True iff the execution of the current function was prefixed by a numeric argument. Use prefix-argument to get it's value. Node: prefix-string Up: Variables, Previous: prefix-argument-provided, Next: prepend-extension The string that is inserted after an automatic newline has been generated in response to going past the right margin. This is generally used by the language-dependent commenting features. (default "") Node: prepend-extension Up: Variables, Previous: prefix-string, Next: quick-redisplay If this variable is ON then backup and checkpoint file names are created by prepending the prefixes .# and .##, respectively. If OFF, the backup and checkpoint names are created by appendin ^P attempt to keep dot at the same horizontal position as you move from line to line. Node: previous-page Up: Commands, Previous: previous-line, Next: previous-window Repositions the current window on the current buffer so that the previous page of the buffer is visible in the window (where a page is a group of lines slightly smaller than a window). In other words, it flips you backward a page in the buffer. Its inverse is ^V. If possible, dot is kept where it is, otherwise it is mg the suffixes .BAK and .CKP, respectively. Node: prepend-region-to-buffer Up: Commands, Previous: prefix-argument-loop, Next: previous-command Prepends the region between dot and mark to the named buffer. Neither the original text in the destination buffer nor the text in the region between dot and mark will be disturbed. Node: previous-command Up: Commands, Previous: prepend-region-to-buffer, Next: previous-line (previous-command) usually returns the character value of the keystroke that invooved to the middle of the new page. Node: previous-window Up: Commands, Previous: previous-page, Next: print Switches to the window (and associated buffer) that is above the current window. Node: print Up: Commands, Previous: previous-window, Next: progn Print the value of the named variable. This is the command you use when you want to inquire about the setting of some switch or parameter. Node: progn Up: Commands, Previous: progn, Next: provide-prefix-argument (progn expressions...) is aked the previous command. In is something like last-key-struck, which returns the keystroke that invoked the current command. However, a function may set the variable this-command to some value, which will be the value of previous-command after the next command invocation. This rather bizarre command/variable pair is intended to be used in the implementation of MLisp functions which behave differently when chained together (ie. executed one after the other). A good example is ^K, kill-to-enn MLisp function that evaluates the expressions and returns the value of the last expression evaluated. Progn is roughly equivalent to a compound statement (begin-end block) in more conventional languages and is used where you want to execute several expressions when there is space for only one (eg. the then or else parts of an if expression). Node: provide-prefix-argument Up: Commands, Previous: progn, Next: push-back-character (provide-prefix-argument ) provides td-of-line which appends the text from chained kills to the killbuffer. To use this technique for a set of commands which are to exhibit a chaining behaviour, first pick a magic number. -84, say. Then each command in this set which is chainable should (setq this-command -84). Then to tell if a command is being chained, it suffices to check to see if (previous-command) returns -84. Node: previous-line Up: Commands, Previous: previous-command, Next: previous-page Move dot to the previous line. ^N andhe prefix argument to the . For example, the most efficient way to skip forward 5 words is: (provide-prefix-argument 5 (forward-word)) See also the command prefix-argument-loop and the variable prefix-argument. Node: push-back-character Up: Commands, Previous: provide-prefix-argument, Next: put-database-entry Takes the character provided as its argument and causes it to be used as the next character read from the keyboard. It is generally only useful in MLisp functions which read characters from the keyboard, and upon finding one that they don't understand, terminate and behave as though the key had been struck to the Emacs keyboard command interpreter. For example, ITS style incremental search. Node: put-database-entry Up: Commands, Previous: push-back-character, Next: query-replace-string (put-database-entry dbname key) takes the current buffer and stores it into the named database under the given key. Node: pwd Up: Packages path or pwd Prints the curredon't do any more replaces. ? (or anything else) Print a short list of the query/replace options. Node: quick Up: (dir)top Next: Some Necessary Notation This is a quick reference to the Emacs commands that most people are likely to use. Either look at the section that interests you or read through it all sequentially using the info 'n' command. * Menu: * Some Necessary Notation:: * Character Operations:: * Word Operations:: * Line Operations:: nt working directory in the mode line, just like the shell command ``path''. chd or cd Changes the current working directory, just like the shell command ``chd''. You should beware that chd only changes the current directory for Emacs and has no effect on the shell from which Emacs was called. Node: query-replace-string Up: Commands, Previous: put-database-entry, Next: quietly-read-abbrev-file Replace all occurrences of one str* Paragraph Operations:: * Getting Out:: * Screen And Screen Operations:: * Buffer And File Operations:: * Help And Helper Functions:: * Search:: * Replace:: * Region Operations:: * Macro Operations:: * Compiling (Make) Operations.:: * Mice:: how to use the mouse with Emacs Node: quick-redisplay Up: Variables, Previous: prefix-string, Next: replace-case If ON Emacs won't worry so much about the case where you have the same buffer on view in several windows -- it may let the other windows be ing with another, starting at dot and ending at the end of the buffer. Emacs prompts for an old and a new string in the minibuffer (the line at the bottom of the screen). See the section on searching, section page 20 for more information on search strings. For each occurrence of the old string, Emacs requests that the user type in a character to tell it what to do (dot will be positioned just after the found string). The possible replies are: Change this occurrence and continaccurate for a short while (but they will eventually be fixed up). Turning this ON speeds up Emacs substantially when the same buffer is on view in several windows. When it is OFF, all windows are always accurate. (default OFF) Node: quietly-read-abbrev-file Up: Commands, Previous: query-replace-string, Next: quote Read in and define abbrevs appearing in a named file. This file should have been written using write-abbrev-file. Unlike read-abbrev-file, an error message is not printeinue to the next. n Don't change this occurrence, but continue to the next r Enter a recursive-edit. This allows you to make some local changes, then continue the query-replace-string by typing ^C. ! Change this occurrence and all the rest of the occurrences without bothering to ask. . Change this one and stop: don't do any more replaces. ^G Don't change this occurrence and stop: d if the file cannot be found. Node: quote Up: Commands, Previous: quietly-read-abbrev-file, Next: quote-character Takes a string and inserts quote characters so that any characters which would have been treated specially by the reqular expression search command will be treated as plain characters. For example, (quote "a.b") returns "a\.b". Node: quote-character Up: Commands, Previous: quote, Next: re-query-replace-string Insert into the buffer the next character typed without interpreting it as a command. This is how you insert funny characters. For example, to insert a ^L (form feed or page break character) type ^Q^L. This is the only situation where ^G isn't interpreted as an abort character. Node: re-query-replace-string Up: Commands, Previous: quote-character, Next: re-replace-string re-query-replace-string is identical to query-replace-string except that the search string is a regular expression rather than an uninterpreted sequence of characters. See the section me with the buffer. Dot is set to the beginning of the buffer. Node: recursion-depth Up: Commands, Previous: read-file, Next: recursive-edit Returns the depth of nesting within recursive-edit's. It returns 0 at the outermost level. Node: recursive-edit Up: Commands, Previous: recursion-depth, Next: redraw-display The recursive-edit function is a call on the keyboard read/interpret/execute routine. After recursive-edit is called the user can enter commands from the keyboaron searching in the manual for more information. Node: re-replace-string Up: Commands, Previous: re-query-replace-string, Next: re-search-forward re-replace-string is identical to replace-string except that the search string is a regular expression rather than an uninterpreted sequence of characters. See the section on searching in the manual for more information. Node: re-search-forward Up: Commands, Previous: re-replace-string, Next: re-search-reverse re-search-forward is id as usual, except that when he exits Emacs by calling exit-emacs (typing ^C) it actually returns from the call to recursive-edit. This function is handy for packages that want to pop into some state, let the user do some editing, then when they're done perform some cleanup and let the user resume. Node: redraw-display Up: Commands, Previous: recursive-edit, Next: region-around-match Clear the screen and rewrite it. This is useful if some transmission glitch has messed up the screendentical to search-forward except that the search string is a regular expression rather than an uninterpreted sequence of characters. See the section on searching in the manual for more information. Node: re-search-reverse Up: Commands, Previous: re-search-forward, Next: read-abbrev-file re-search-reverse is identical to search-reverse except that the search string is a regular expression rather than an uninterpreted sequence of characters. See the section on searching i. Node: Region Operations Next: Macro Operations, Up: Quick * Menu: * set-mark:: ^@ Set the mark * exchange-dot-and-mark:: ^X-^X Interchange dot and mark (i.e. go to the other end of the region) * delete-to-killbuffer:: ^W Kill region (^Y yanks it back at dot) Node: Region Restrictions Up: Introduction, Previous: Keymaps, Next: Mode Lines The portion of the buffer which Emacs considers visible when it performs editing operations may be n the manual for more information. Node: read-abbrev-file Up: Commands, Previous: re-search-reverse, Next: read-file Read in and define abbrevs appearing in a named file. This file should have been written using write-abbrev-file. An error message is printed if the file cannot be found. Node: read-file Up: Commands, Previous: read-abbrev-file, Next: recursion-depth Prompt for the name of a file; erase the contents of the current buffer; read the file into the buffer and associate the narestricted to some subregion of the whole buffer. The narrow-region command sets the restriction to encompass the region between dot and mark. Text outside this region will henceforth be totally invisible. It won't appear on the screen and it won't be manipulable by any editing commands. It will, however, be read and written by file manipulation commands like read-file and write-current-file. This can be useful, for instance, when you want to perform a replacement within a few paragraphs: just narrow down to a region enclosing the paragraphs and execute replace-string. The widen-region command sets the restriction to encompass the entire buffer. It is usually used after a narrow-region to restore Emacs's attention to the whole buffer. Save-restriction is only useful to people writing MLisp programs. It is used to save the region restriction for the current buffer (and only the region restriction) during the execution of some subexpression that presext: remove-local-binding Removes the global binding of the given key. Actually, it just rebinds the key to illegal-operation. Node: remove-local-binding Up: Commands, Previous: remove-binding, Next: replace-string Removes the local binding of the given key. The global binding will subsequently be used when interpreting the key. Bug: there really should be some way of saving the current binding of a key, then restoring it later. Node: Replace Next: Region Operations, Up: Quick * Menumably uses region restrictions. The value of (save-restriction expressions...) is the value of the last expression evaluated. Node: region-around-match Up: Commands, Previous: redraw-display, Next: region-to-string Region-around-match sets dot and mark around the region matched by the last search. An argument of n puts dot and mark around the n'th subpattern matched by `\(' and `\)'. This can then be used in conjuction with region-to-string to extract fields matched by a patter.u: * replace-string:: ESC-r Replace one string with another * query-replace-string:: ESC-q Query Replace, one string with another Node: replace-case Up: Variables, Previous: quick-redisplay, Next: right-margin If ON Emacs will alter the case of strings substituted with replace-string or query-replace-string to match the case of the original string. For example, replacing "which" by "that" in the string "Which is silly" results in "That is silly"; in the string "the car which is red"  For example, consider the following fragment that extracts user names and host names from mail addresses: (re-search-forward "\\([a-z][a-z]*\\) *@ *\\([a-z][a-z]*\\)") (region-around-match 1) (setq username (region-to-string)) (region-around-match 2) (setq host (region-to-string)) Applying this MLisp code to the text "send it to jag@vlsi" would set the variable `username' to "jag" and `host' to "vlsi". Node: region-to-string Up: Commands, Previous: region-around-match, Ne results in "the car that is red"; and in the string "WHICH THING?" results in "THAT THING?". Node: replace-string Up: Commands, Previous: remove-local-binding, Next: return-prefix-argument Replace all occurrences of one string for another, starting at dot and ending and the end of the buffer. Emacs prompts for an old and a new string in the minibuffer (the line at the bottom of the screen). Unlike query-replace-string Emacs doesn't ask any questions about particular occurxt: remove-all-local-bindings Returns the region between dot and mark as a string. Please be kind to the storage allocator, don't use huge strings. Node: remove-all-local-bindings Up: Commands, Previous: region-to-string, Next: remove-binding Perform a remove-local-binding for all possible keys; effectively undoes all local bindings. Mode packages should execute this to initialize the local binding table to a clean state. Node: remove-binding Up: Commands, Previous: remove-all-local-bindings, Nrences, it just changes them. Dot will be left after the last changed string. See the section on searching in the manual for more information on search strings. Node: return-prefix-argument Up: Commands, Previous: replace-string, Next: return-to-monitor (return-prefix-argument n) sets the numeric prefix argument to be used by the next function invocation to n. The next function may be either the next function in the normal flow of MLisp execution or the next function invoked from a keystroke. Return-prefix-argument is to be used by functions that are to be bound to keys and which are to provide a prefix argument for the next keyboard command. Node: return-to-monitor Up: Commands, Previous: return-prefix-argument, Next: save-excursion Recursivly invokes a new shell, allowing the user to enter normal shell commands and run other programs. Return to Emacs by exiting the shell; ie. by typing "exit". Node: right-margin Up: Variables, Previous: replace-case, Next: scroll-stepe region restriction for the current buffer (and only the region restriction) during the execution of some subexpression that presumably uses region restrictions. The value of (save-excursion expressions...) is the value of the last expression evaluated. Node: save-window-excursion Up: Commands, Previous: save-restriction, Next: scroll-one-line-down save-window-excursion is identical to save-excursion except that it also saves (in a rough sort of way) the state of the windows The right margin for automatic text justification. If a character is inserted at the end of a line and to the right of the right margin Emacs will automatically insert at the beginning of the preceding word a newline, tabs and spaces to indent to the left margin, and the prefix string. With the right margin set to something like (for eg.) 72 you can type in a document without worrying about when to hit the return key, Emacs will automatically do it for you at exactly the right place. That is, (save-window-excursion expressions...) saves the current dot, mark, buffer and window state, executes the expressions, restores the saved information and returns the value of the last expression evaluated. When the window state is saved Emacs remembers which buffers were visible. When it is restored, Emacs makes sure that exactly those buffers are visible. Emacs does not save and restore the exact layout of the windows: this is a feature, not a bug. Node: Screen And Screen Oper. Node: save-excursion Up: Commands, Previous: return-to-monitor, Next: save-restriction (save-excursion expressions...) is an MLisp function that evaluates the given expressions and returns the value of the last expression evaluated. It is much like progn except that before any expressions are executed dot and the current buffer are "marked" (via the marker mechanism) then after the last expression is executed dot and the current buffer are reset to the marked values. This properly takes inations, Next: Buffer And File Operations, Up: Quick * Menu: * menu: * next-page:: ^V Show next screen page * previous-page:: ESC-V Show previous screen page * redraw-display:: ^L Redisplay screen * scroll-one-line-up:: ^Z Scroll screen up * scroll-one-line-down:: ESC-Z Scroll screen down * line-to-top-of-window:: ESC-! Move the line dot is on to top of the screen * beginning-of-window:: ESC-, Move cursor toto account all movements of dot and insertions and deletions that occur. Save-excursion is useful in MLisp functions where you want to go do something somewhere else in this or some other buffer but want to return to the same place when you're done; for example, inserting a tab at the beginning of the current line. Node: save-restriction Up: Commands, Previous: save-excursion, Next: save-window-excursion Save-restriction is only useful to people writing MLisp programs. It is used to save th beginning of window * end-of-window:: ESC-. Move cursor to end of window * split-current-window:: ^X-2 Split the current window in two windows (same buffer shown in each) * delete-other-windows:: ^X-1 Resume single window (using current buffer) * delete-window:: ^X-d Delete the current window, giving space to window below * next-window:: ^X-n Move cursor to next window * previous-window:: ^X-p Move cursor to previous window * page-next-window:: ESC-^V Display the next screen page in the other window * shrink-window:: ^X-^Z Shrink window * enlarge-window:: ^X-z Enlarge window Node: scroll-one-line-down Up: Commands, Previous: save-window-excursion, Next: scroll-one-line-up Repositions the current window on the current buffer so that the line which is currently the second to Next: self-insert Prompt for a string and search for a match in the current buffer, moving backwards from dot, stopping at the beginning of the buffer. Dot is left at the beginning of the matched string if a match is found, or is unmoved if not. See the section on searching in the manual for more information. Node: Searching Up: Introduction, Previous: Extensibility, Next: Keymaps Emacs is capable of performing two kinds of searches (Regular and Vanilla for those of you with no taste). The the last line in the window becomes the last -- effectivly it moves the buffer down one line in the window. ^Z is its inverse. Node: scroll-one-line-up Up: Commands, Previous: scroll-one-line-down, Next: search-forward Repositions the current window on the current buffer so that the line which is currently the second line in the window becomes the first -- effectivly it moves the buffer up one line in the window. ESC-Z is its inverse. Node: scroll-step Up: Variables, Previous: right-margin, Nere are two parallel sets of searching and replacement commands that differ only in the kind of search performed. The commands search-forward, search-reverse, query-replace-string and replace-string all do simple searches. That is, the search string that they use is matched directly against successive substrings of the buffer. The characters of the search string have no special meaning. These search forms are the easiest to understand and are what most people will want to use. They arext: stack-trace-on-error The number of lines by which windows are scrolled if dot moves outside the window. If dot has moved more than scroll-step lines outside of the window or scroll-step is zero then dot is centered in the window. Otherwise the window is moved up or down scroll-step lines. Setting scroll-step to 1 will cause the window to scroll by 1 line if you're typing at the end of the window and hit RETURN. Node: Search Next: Replace, Up: Quick * Menu: * re-search-forward::  what is conventionally bound to ^S, ^R, ESC-Q and ESC-R. The commands re-search-forward, re-search-reverse, re-query-replace-string, re-replace-string and looking-at all do regular expression searches. The search string is interpreted as a regular expression and matched against the buffer according to the following rules: 1. Any character except a special character matches itself. Special characters are `\' `[' `.' and sometimes `^' `*' `$'. 2. A `.' matches any character except newlin ^S Search forward * re-search-reverse:: ^R Search backward Node: search-forward Up: Commands, Previous: scroll-one-line-up, Next: search-reverse Prompt for a string and search for a match in the current buffer, moving forwards from dot, stopping at the end of the buffer. Dot is left at the end of the matched string if a match is found, or is unmoved if not. See the section on searching in the manual for more information. Node: search-reverse Up: Commands, Previous: search-forward,e. 3. A `\' followed by any character except those mentioned in the following rules matches that character. 4. A `\w' Matches any word character, as defined by the syntax tables. 5. A `\W' Matches any non-word character, as defined by the syntax tables. 6. A `\b' Matches at a boundary between a word and a non-word character, as defined by the syntax tables. 7. A `\B' Matches anywhere but at a boundary between a word and a non-word character, as defined by the syntax tables. 8. A `\`' Matches at the beginning of the buffer. 9. A `\'' Matches at the end of the buffer. 10. A `\<' Matches anywhere before dot. 11. A `\>' Matches anywhere after dot. 12. A `\=' Matches at dot. 13. A nonempty string s bracketed ``[ s ]'' (or ``[^ s ]'' matches any character in (or not in) s. In s, `\' has no special meaning, and `]' may only appear as the first letter. A substring a-b, with a and b in ascending string are specially interpreted: - Any character except a special character is inserted unchanged. - A `\' followed by any character except a digit causes that character to be inserted unchanged. - A `\' followed by a digit n causes the string matched by the nth bracketed expression to be inserted. - An `&' causes the string matched by the entire search string to be inserted. The following examples should clear a little of the mud: Pika Matches the siASCII order, stands for the inclusive range of ASCII characters. 14. A `\' followed by a digit n matches a copy of the string that the bracketed regular expression beginning with the n th `\(' matched. 15. A regular expression of one of the preceeding forms followed by `*' matches a sequence of 0 or more matches of the regular expression. 16. A regular expression, x, bracketed ``\( x \)'' matches what x matches. 17. A regular expression of thimple string ``Pika''. Whiskey.*Jack Matches the string ``Whiskey'', followed by the longest possible sequence of non-newline characters, followed by the string ``Jack''. Think of it as finding the first line that contains the string ``Whiskey'' followed eventually on the same line by the string ``Jack'' [a-z][a-z]* Matches a non-null sequence of lower case alphabetics. Using this in the re-replace-string cos or one of the preceeding forms, x, followed by a regular expression of one of the preceeding forms, y matches a match for x followed by a match for y, with the x match being as long as possible while still permitting a y match. 18. A regular expression of one of the preceeding forms preceded by `^' (or followed by `$'), is constrained to matches that begin at the left (or end at the right) end of a line. 19. A sequence of regular expressions of one of mmand along with the replacement string ``(&)'' will place parenthesis around all sequences of lower case alphabetics. Guiness\|Bass Matches either the string `Guiness' or the string `Bass'. \Bed\b Matches `ed' found as the suffix of a word. \bsilly\W*twit\b Matches the sequence of words `silly' and `twit' seperated by arbitrary punctuation. Node: self-insert Up: Commands, Previous: search-reverse, Next: send-string-to-termthe preceeding forms seperated by `\|'s matches any one of the regular expressions. 20. A regular expression of one of the preceeding forms picks out the longest amongst the leftmost matches if searching forward, rightmost if searching backward. 21. An empty regular expression stands for a copy of the last regular expression encountered. In addition, in the replacement commands, re-query-replace-string and re-replace-string, the characters in the replacement inal This is tied to those keys which are supposed to self-insert. It is roughly the same as (insert-character (last-key-struck)) with the exception that it doesn't work unless it is bound to a key. Node: send-string-to-terminal Up: Commands, Previous: self-insert, Next: set (send-string-to-terminal "string") sends the string argumetn out to the terminal with no conversion or interpretation. This should only be used for such applications as loading function keys when Emacs starts up. If you screw up the screen, Emacs won't know about it and won't fix it up automatically for you -- you'll have to type ^L. Node: sentence moves Up: Moving around * menu: * backward-sentence:: (ESC-a) * forward-sentence:: (ESC-e) Node: set Up: Commands, Previous: send-string-to-terminal, Next: set-auto-fill-hook Set the value of some variable internal to Emacs. Emacs will ask for the name of a variable and a value to set it to. The variables control such things as margins, display lawhere dot is now, and leaves it there. As text is inserted or deleted around the mark, the mark will remain in place. Use ^X^X to move to the currently marked position. Node: setq Up: Commands, Previous: set-mark, Next: setq-default Assigns a new value to a variable. Variables may have either string or integer values. (setq i 5) sets i to 5; (setq s (concat "a" "b")) sets s to "ab". Node: setq-default Up: Commands, Previous: setq, Next: shrink-window Setq-default is used to set the defyout options, the behavior of search commands, and much more. The available variables and switches are described elsewhere. Note that if set is used from MLisp the variable name must be a string: (set "left-margin" 77). Node: set-auto-fill-hook Up: Commands, Previous: set, Next: set-default set-auto-fill-hook associates a command with the current buffer. When the right margin is passed by the attempt to insert some character the hook procedure for that buffer is invoked. The character ault value of some variable. It can be a global parameter, a buffer-specific variable or a system variable. It makes no matter, setq-default will set the default. Setq-default is the command to use from within some MLisp program, like your start up profile (".Emacs pro"). For example, (setq-default right-margin 60) will set the default right margin for newly created buffers to 60. In previous versions of Emacs certain system variables had default versions from which default values were takthat triggered the hook will not have been inserted, but will be inserted immediately after the hook procedure returns [unless the procedure returns 0]. The hook procedure is responsible for maintaining the position of dot. last-key-struck may be usually used to determine which character triggered the hook. If no hook procedure is associated with a buffer then the old action (break the line and indent) will be taken. This procedure may be used for such things as automaten. So, to set the default value of right-margin one would assign a value to default-right-margin -- but no more. Use setq-default (or set-default instead. The precise semantics of setq-default are: - If the variable being assigned to has not yet been declared, then declare it as a global variable. - If it is a global variable (whether or not the declaration was implicit) then assign the value to it just as the setq command would have done. - Otherwise, if the variabically putting boxes around paragraph comments as they are typed. Node: set-default Up: Commands, Previous: set-auto-fill-hook, Next: set-mark This commands bears the same relationship to setq-default that set does to setq. It is the command that you use from the keyboard to set the default value of some variable. See the description of setq-default for more detailed information. Node: set-mark Up: Commands, Previous: set-default, Next: setq Puts the marker for this buffer at the place le is buffer specific then set the default value for the variable. This will be used in all buffers where the variable hasn't been explicitly assigned a value. Note that if you have a global variable which is eventually declared buffer-specific then the global value becomes the default. The intent of this is that users should be able to put setq-default's in their .emacs_pro's without concerning themselves over whether the variable will eventually be  a simple global or buffer-specific. Node: shrink-window Up: Commands, Previous: setq-default, Next: sit-for Makes the current window one line shorter, and the window below (or the one above if there is no window below) one line taller. Can't be used if there is only one window on the screen. Node: sit-for Up: Commands, Previous: shrink-window, Next: split-current-window Updates the display and pauses for n/10 seconds. (sit-for 10) waits for one second. This is useful in such thingslits it into two windows, dividing the space on the screen equally between the two windows. An arbitrary number of windows can be created -- the only limit is on the amount of space available on the screen, which, sigh, is only 24 lines on most terminals available these days (with the notable exception of the Ann Arbor Ambassador which has 60). Node: stack-trace-on-error Up: Variables, Previous: scroll-step, Next: tab-size If ON Emacs will write a MLisp stack trace to the "Stack trace" buffer wh as a Lisp auto-paren balencer. Node: Some Necessary Notation Next: Character Operations, Up: Quick Any ordinary character goes into the buffer (no insert command needed). Commands are all control characters or other characters prefixed by Escape or a control-X. ^ A control character. ^Fenever an error is encountered from within an MLisp function (even inside an error-occured). This is all there is in the way of a debugging facility. (default OFF) Node: start-remembering Up: Commands, Previous: split-current-window, Next: stop-remembering All following keystrokes will be remembered by Emacs. Node: stop-remembering Up: Commands, Previous: start-remembering, Next: string-to-char Stops remembering keystrokes, as initiated by ^X(. The remembered keystrokes are not for means "control F". ESC A two-character command sequence where the first character is Escape. ESC-F means "ESCAPE then F". ESC-X string A command designated "by hand". "ESC-x read-file" means: type "Escape", then "x", then "read-file", then . dot gotten and may be re-executed with ^XE. Node: string-to-char Up: Commands, Previous: stop-remembering, Next: substr Returns the integer value of the first character of its string argument. (string-to-char "0") = '0'. Node: substr Up: Commands, Previous: string-to-char, Next: switch-to-buffer (substr str pos n) returns the substring of string str starting at position pos (numbering from 1) and running for n characters. If pos is less than 0, then length of the string is added to it; the same  EMACS term for cursor position in current buffer. mark An invisible set position in the buffer used by region commands. region The area of the buffer between the dot and mark. Node: split-current-window Up: Commands, Previous: sit-for, Next: start-remembering Enter two-window mode. Actually, it takes the current window and sp is done for n. (substr "kzin" 2 2) = "zi"; (substr "blotto.c" -2 2) = ".c". Node: summary table Up: Moving around This table summarises the Emacs commands for moving the cursor. It's laid out so that the symmetry of the commands should be apparent. ^P Previous line | <-- ESC-A <-- ^A <-- ESC-B <-- ^B + ^F --> ESC-F --> ^E --> ESC-E --> Beginning Backward | Forward End Sentence Line Words Characters Words Line Sentence | ^N Next line Node: switch-to-buffer Up: Commands, Previous: substr, Next: system-name Prompt for the name of the buffer and associate it with the current window. The old buffer associated with this window merely loses that association: it is not erased or changed in any way. If the new buffer does not exist, it will be created, in contrast with ^X^O. Node: system-name Up: Commands, Previous: swihen rather than asking for a new string it will use the old string and search for the next occurrence of that string in the tagfile. This is used for stepping through a set of tags that contain the same string. This is the most commonly used command in the tag package so it is often bound to a key: Twenex Emacs binds it to ESC-., but this tag package doesn't bind it to antch-to-buffer, Next: temp-use-buffer Is an MLisp function that returns the name of the system on which Emacs is being run. This should return "Tek4404". Node: tab-size Up: Variables, Previous: stack-trace-on-error, Next: this-command A buffer-specific variable which specifies the number of characters between tab stops. It's not clear that user specifiable tabs are a good idea, since most operating systems have the magic number 8 so deeply wired into them. (default 8) Node: tags Up: Packagesything, it presumes that the user will bind it. make-tag-table Takes a list of file names (with wildcards allowed) and builds a tagfile for all the functions in all of the files. It determines the language of the contents of the file from the extension. This command may take a while on large directories, be prepared to wait. A common use is to type "make-tag-table *.c". recompute-all-tags Goes  The tags package closely resembles the tags package found in Twenex Emacs. The database used by the tag package (called a tagfile) correlates function definitions to the file in which the definitions appear. The primary function of the tag package is to allow the user to specify the name of a function, and then have Emacs locate the definition of that function. The commands implemented are: add-tag Adds the current line (it should be the definition line for some functi through your current tag file and for each file mentioned refinds all of the tags. This is used to rebuild an entire tag file if you've made very extensive changes to the files mentioned and the tag package is no longer able to find functions. The tagfile contains hints to help the system locate the tagged function, as you make changes to the various files the hints become out of date. on) to the current tagfile. goto-tag goto-tag takes a single string argument which is usually the name of a function and visits the file containing that function with the first line of the function at the top of the window. The string may actually be a substring of the function name (actually, any substring of the first line of the function definition). If goto-tag is given a numeric argument t Periodically (no too often!) you should recompute the tagfile. visit-function Takes the function name at or before dot, does a goto-tag on that name, then puts you into a recursive-edit to look at the function definition. To get back to where you were, just type ^C. This is used when you're editing something, have dot positioned at some function invocation, then want to look at the function. visit-tag-table Normally the name of the tagfile is ".tags" in the current directory. If you want to use some other tagfile, visit-tag-table lets you do that. Node: temp-use-buffer Up: Commands, Previous: system-name, Next: to-col Switch to a named buffer without changing window associations. The commands pop-to-buffer and switch-to-buffer both cause a window to be tied to the selected buffer, temp-use-buffer does not. There are a couplyed as a set of lines, at the bottom of each window is its mode line (For more information on mode lines see the manual). The lines above the mode line contain an image of the text you are editing in the region around dot (or point). Dot is the reference around which editing takes place. Dot is a pointer which points at a position between two characters. On the screen, the cursor will be positioned on the character that immediately follows dot. When characters are inserted, they are inse of problems that you must beware when using this command: The keyboard command driver insists that the buffer tied to the current window be the current buffer, if it sees a difference then it changes the current buffer to be the one tied to the current window. This means that temp-use-buffer will be ineffective from the keyboard, switch-to-buffer should be used instead. The other problem is that "dot" is really a rather funny concept. There is a value of "dot" associated with eaerted at the position where dot points; commands exist that delete characters both to the left and to the right of dot. The text on the screen always reflects they way that the text looks now. Node: this-command Up: Variables, Previous: tab-size, Next: track-eol-on-^N-^P The meaning of the variable this-command is tightly intertwined with the meaning of the function previous-command. Look at its documentation for a description of this-command. Node: to-col Up: Commands, Previous: tech window, not with each buffer. This is done so that there is a valid interpretation to having the same buffer visible in several windows. There is also a value of "dot" associated with the current buffer. When you switch to a buffer with temp-use-buffer, this "transient dot" is what gets used. So, if you switch to another buffer, then use temp-use-buffer to get back, "dot" will have been set to 1. You can use save-excursion to remember your position. Node: text-mode Up: Packages, Prevmp-use-buffer, Next: transpose-characters (to-col n) is an MLisp function that insert tabs and spaces to move the following character to printing column n. Node: Top Next: Introduction, Up: (dir) Emacs is an extensible display editor. This Info tree attempts to describe how to use it. Start with the introduction if you're new to Emacs, look in the commands section if you're just looking for some particular command (or better yet, you should have used the Emacs "describe-command" command). * menuious: tags, Next: time Implements the text-mode command which ties ESC-j to justify-paragraph and sets up autofill with a left margin of 1 and a right margin of 77. Node: The Screen Up: Introduction, Next: Input Conventions Emacs divides a screen into several areas called windows, at the bottom of the screen there is a one line area that is used for messages and questions from Emacs. Most people will only be using one window, at least until they become more familiar with Emacs. A window is displa: * Introduction:: an introduction page to Emacs * Commands:: the Emacs commands grouped by function * Variables:: the various that can be set to customize Emacs to the users taste. * Init files:: all about emacs profile files * Extensibility:: how to deal with MLisp, the Emacs extension language. * Packages:: the various packages that are available * Mice:: how to use the mouse with Emacs * Searching:: how to construct search strings Node: track-eol-on-^N-^P Up: Variables, Previous: this-command, Next: unlink-checkpoint-files If ON then ^N and ^P will "stick" to the end of a line if they are started there. If OFF ^N and ^P will try to stay in the same column as you move up and down even if you started at the end of a line. (default ON) Node: track-eol-on-^N-^P Up: Variables, Previous: this-command, Next: unlink-checkpoint-files If ON then ^N and ^P will "stick" to the end of a line if they are started there. If OFF ^N and ^P will try to stay in the same column as you move up and down even the ESC-X command or by binding them to a key (via the bind-to-key command). Heaven help the poor soul who rebinds ESC-X. The ESC-X command will print ": " on the last line of the display and expect you to type in the name of a command. Space and ESC characters may be struck to invoke Tenex style command completion (ie. you type in the first part of the command, hit the space bar, and Emacs will fill in the rest for you -- it will complain if it can't figure out what you're trying to if you started at the end of a line. (default ON) Node: transpose-characters Up: Commands, Previous: to-col, Next: undo Take the two characters preceding dot and exchange them. One of the most common errors for typists to make is transposing two letters, typing "hte" when "the" is meant. ^T makes correcting these errors easy, especially if you can develop a "^T reflex". Node: trivial example Up: Init files, Next: default profile A profile is simply a file containing a bunch of MLisp statementssay). If the command requires arguments, they will also be prompted for on the bottom line. Node: undo Up: Packages, Previous: time, Next: writeregion The new-undo command, which is usually bound to ^X^U allows the user to interactively undo the effects of previous commands. Typing ^X^U undoes the effects of the last command typed. It will then ask ``Hit to undo more'', each that you then hit will undo one more command. Typing anything but space will terminate undoing.  that get executed when Emacs starts up. The following profile just causes long lines to wrap around on the display and the "time" command to be automatically loaded from "time.ml" if it is executed: (autoload "time" "time.ml") (setq wrap-long-lines 1) * menu: * autoload:: explaination of the autoload function * setq:: the assignment function * load:: profiles are really "loaded" into Emacs, this explains what "load" means. Node: Unbound Commands Up: Introduction, Previous: Basic Commands, Next If it is terminated with anything other than the termination character will be executed just as though it were a normal command. new-undo is an undoable command, just like the others, so if you find that you've undone too much just type ^X^U again to undo the undo's. Node: undo-boundary Up: Commands, Previous: undo, Next: undo-more undo-boundary lays down the boundary between two undoable commands. When commands are undone, a `command' is considered to be the series of oper: Getting Help Even though the number of characters available to use for Emacs commands is large, there are still more commands than characters. You probably wouldn't want to bind them all to keys even if you could. Each command has a long name and by that long name may be bound to a key. For example, ^F is normally bound to the command named forward-character which moves dot forward one character. There are many commands that are not normally bound to keys. These must be executed with ations between undo boundaries. Normally, they are laid down between keystrokes but MLisp functions may choose to lay down more. See the section on undoing in the manual. Node: undo-more Up: Commands, Previous: undo-boundary, Next: unlink-file Undoes one more command from what was last undone. undo-more must be preceeded by either an undo or an undo-more. This is usually used by first invoking undo to undo a command, then invoking undo-more repeatedly to undo more and more commands, until you've retreated to the state you want to be back to. See the section on undoing in the manual. Node: unlink-checkpoint-files Up: Variables, Previous: track-eol-on-^N-^P, Next: visible-bell If ON Emacs will unlink the corresponding checkpoint file after the master copy is written -- this avoids having a lot of .CKP files lying around but it does compromise safety a little. For example, as you're editing a file called "foo.c" Emacs will be periodically be writing a checkpoint file called "ore information. Node: use-old-buffer Up: Commands, Previous: use-local-map, Next: use-syntax-table Prompt for the name of the buffer and associate it with the current window. The old buffer associated with this window merely loses that association: it is not erased or changed in any way. The buffer must already exist, in contrast with ^XB. Node: use-syntax-table Up: Commands, Previous: use-old-buffer, Next: users-full-name Associates the named syntax table with the current buffer. See thfoo.c.CKP" that contains all of your recent changes. When you rewrite the file (with ^X^F or ^X^S for example) if unlink-checkpoint-files is ON then the .CKP file will be unlinked, otherwise it will be left. (default OFF) Node: unlink-file Up: Commands, Previous: undo-more, Next: use-abbrev-table (unlink-file fn) attempts to unlink (remove) the file named fn. It returns true if the unlink failed. Node: use-abbrev-table Up: Commands, Previous: unlink-file, Next: use-global-map Sets the curre description of the modify-syntax-entry command for more information on syntax tables. Node: users-full-name Up: Commands, Previous: use-syntax-table, Next: users-login-name MLisp function that returns the users login name as a string. (Returns the login name since this system does not store full names.) Node: users-login-name Up: Commands, Previous: users-full-name, Next: visit-file MLisp function that returns the users login name as a string. Node: variables, Up: Top, Next: Commandent local abbrev table to the one with the given name. Local abbrev tables are buffer specific and are usually set depending on the major mode. Several buffers may have the same local abbrev table. If either the selected abbrev table or the global abbrev table have had some abbrevs defined in them, abbrev-mode is turned on for the current buffer. Node: use-global-map Up: Commands, Previous: use-abbrev-table, Next: use-local-map (use-global-map "mapname") uses the named map to be used s The following variables may be set from within Emacs to control the way that it behaves: * menu: * ask-about-buffer-names:: * backup-by-copying:: * backup-by-copying-when-linked:: * backup-when-writing:: * buffer-is-modified:: * case-fold-search:: * checkpoint-frequency:: * comment-column:: * ctlchar-with-^:: * files-should-end-with-newline:: * global-mode-string:: * help-on-command-completion:: * left-margin:: * mode-line-format:: * mode-string:: * needs-checkpointing:: * pop-up-windows:: * prefix-argufor the global interpretation of all key strokes. use-local-map is used to change the local interpretation of key strokes. See the section on keymaps, page 21, for more information. Node: use-local-map Up: Commands, Previous: use-global-map, Next: use-old-buffer (use-local-map "mapname") uses the named map to be used for the local interpretation of all key strokes. use-global-map is used to change the global interpretation of key strokes. See the section on keymaps, page 21, for mment:: * prefix-argument-provided:: * prepend-extension:: * prefix-string:: * quick-redisplay:: * replace-case:: * right-margin:: * scroll-step:: * stack-trace-on-error:: * tab-size:: * this-command:: * track-eol-on-^N-^P:: * unlink-checkpoint-files:: * visible-bell:: * wrap-long-lines:: Node: visible-bell Up: Variables, Previous: unlink-checkpoint-files, Next: wrap-long-lines If ON Emacs will attempt to use a visible bell, usually a horrendous flashing of the screen, instead of the audible bell, when it is notifying you of some error. This is a more "socially acceptable" technique when people are working in a crowded terminal room. (default OFF) Node: visit-file Up: Commands, Previous: users-login-name, Next: while Visit-file asks for the name of a file and switches to a buffer that contains it. The file name is expanded to it's full absolute form (that is, it will start with a '/'). If no buffer contains the file already then Emacs will switch to a new buffer and read the gion on the screen through which a buffer is viewed. The following commands may be used to move around relative to them and to manipulate them. * menu: * beginning-of-window:: (ESC-,) * delete-other-windows:: (^X-1) * delete-window:: (^X-d) * end-of-window:: (ESC-.) * enlarge-window:: (^X-z) * line-to-top-of-window:: (ESC-!) * next-window:: (^X-n) * page-next-window:: (ESC-^V) * previous-window:: (^X-p) * save-window-excursion:: * shrink-window:: (^X-^Z) * split-current-window:: (^X-2)file into it. The name of this new buffer will be just the last component of the file name (everything after the last '/' in the name). If there is already a buffer by that name, and it contains some other file, then Emacs will ask "Enter a new buffer name or to overwrite the old buffer". For example, if my current directory is "/jag/emacs" and I do a ^X^V and give Emacs the file name "../.emacs_pro"then the name of the new buffer will be ".emacs_pro" and the file name  Node: word moves Up: Moving around * menu: * backward-word:: (ESC-b) * forward-word:: (ESC-f) Node: Word Operations Next: Line Operations, Up: Quick * Menu: * backward-word:: ESC-b Move left (Back) * forward-word:: ESC-f Move right (Forward) * delete-next-word:: ESC-d Delete word right * delete-previous-word:: ESC-h Delete word left * case-word-capitalize:: ESC-c Capitalize word * case-word-lower:: ESC-l Lowercase word * case-word-upper:: will be "/jag/.emacs_pro". ^X^V is the approved way of switching from one file to another within an invocation of Emacs. Node: while Up: Commands, Previous: visit-file, Next: widen-region (while test expressions...) is an MLisp function that executes the given expressions while the test is true. Node: widen-region Up: Commands, Previous: while, Next: window-height The widen-region command sets the restriction to encompass the entire buffer. It is usualy used after a narrow-region  ESC-u Uppercase word * case-word-invert:: ESC-^ Invert case of word Node: working-directory Up: Commands, Previous: window-height, Next: write-abbrev-file Returns the pathname of the current working directory. Node: wrap-long-lines Up: Variables, Previous: visible-bell If ON Emacs will display long lines by "wrapping" their continuation onto the next line (the first line will be terminated with a '\'). If OFF long lines get truncated at the right edge of the screen and a '$' is display toto restore Emacs's attention to the whole buffer. Node: window moves Up: Moving around * menu: * beginning-of-window:: (ESC-,) * end-of-window:: (ESC-.) * line-to-top-of-window:: (ESC-!) * next-window:: (^X-n) * page-next-window:: (ESC-^V) * previous-window:: (^X-p) Node: window-height Up: Commands, Previous: widen-region, Next: working-directory Returns the number of text lines of a window that are visible on the screen. Node: Windows Up: Commands A window in Emacs is a re indicate that this has happened. (default OFF) Node: write-abbrev-file Up: Commands, Previous: working-directory, Next: write-current-file Write all defined abbrevs to a named file. This file is suitable for reading back with read-abbrev-file. Node: write-current-file Up: Commands, Previous: write-abbrev-file, Next: write-file-exit Write the contents of the current buffer to the file whose name is associated with the buffer. Node: write-file-exit Up: Commands, Previous: write-current-file, Next: write-modified-files Write all modified buffers to their associated files and if all goes well, Emacs will exit. Node: write-modified-files Up: Commands, Previous: write-file-exit, Next: write-named-file Write each modified buffer (as indicated by ^X^B) onto the file whose name is associated with the buffer. Emacs will complain if a modified buffer does not have an associated file. Node: write-named-file Up: Commands, Previous: write-modified-files, Next: yank-buffer Prompt for a non to the Next node, named "Help-P". >> Type "N" to move there. Node: help-^l Next: Help-M Previous: Help-P Space, Backspace, B and ^L commands. This node's header tells you that you are now at node "Help-^L", and that "P" would get you back to "Help-P". The line starting "Space," is a "Title", saying what the node is about (most nodes have one). This is a big node and it doesn't all fit on your display screen. You can tell that there is more that isn't visible because of the "--MORE--" that appearsame; write the contents of the current buffer to the named file. Node: writeregion Up: Packages, Previous: undo This package only implements one function, write-region-to-file, which takes the region between dot and mark and writes it to the named file. Node: yank-buffer Up: Commands, Previous: write-named-file, Next: yank-from-killbuffer Take the contents of the buffer whose name is prompted for and insert it at dot in the current buffer. Dot is left after the inserted text. Node: yank-from- on a line near the bottom of the screen. The Space, Backspace and B commands exist to allow you to "move around" in a node that doesn't all fit at once. Space moves forward, to show what was below the bottom of the screen. Backspace moves backward, to show what was above the top of the screen (there isn't anything above the top until you have typed some spaces). >> Now try typing a Space (afterward, type a Backspace to return here). When you type the space, the two lines that were at the bottom of thkillbuffer Up: Commands, Previous: yank-buffer, Next: | Take the contents of the kill buffer and inserts it at dot in the current buffer. Dot is left after the inserted text. Node: | Up: Commands, Previous: yank-from-killbuffer (| e e ) MLisp function that returns e | e . 1 2 1 2 Node: help Next: Help-P You are talking to a program INFO, for reading documentation. Right now you are looking at one "Node" of information. A node contains text describing a se screen appear at the top, followed by more lines. Backspace takes the two lines from the top and moves them to the bottom, USUALLY, but if there are not a full screen's worth of lines above them they may not make it all the way to the bottom. If you type a Space when there is no more to see, it will do nothing. The same goes for a Backspace when the Header of the node is visible. Two more commands, A and Z, let you position the text on the screen exactly as you want it: "A" scrolls the screen onepecific topic at a specific level of detail. This node's topic is "how to use INFO". The top line of a node is its "Header". This node's header (look at it now) says that it is the node named "Help" in the file "INFO". It says that the Next node after this one is the node called "Help-P". An advanced INFO command lets you go to any node whose name you know. Besides a "Next", a node can have a "Previous" or an "Up". But this node doesn't have either of those, as you can see. Now it's time to move  line down, letting you see the line just above the one visible at the top of the screen. "Z" scrolls one line up, letting you see the line below the lowest visible line. If you're already at the top (bottom) of a node, A (Z) does nothing. >> Type a few A's and Z's now. If your screen is ever garbaged, you can tell INFO to print it out again by typing a ^L (Control-L, that is - hold down "Control" and type an "L"). >> Type a ^L now. To move back to the beginning of the node you are on, you can type a lot of Backspaces. You can also type simply "B" for beginning. >> Try that now. (I have put in enough verbiage to make sure you are not on the first screenful now). Then come back, with Spaces. You have just learned a considerable number of commands. If you want to use one but have trouble remembering which, you should type a "?" which will print out a brief list of commands. (This list is really just a regular node.) When you are finished looking at the list, type "l" to make it go away and get bou will see a footnote-pointer. Footnote pointers look like this: *Note ftnt: Help-Ft. That is a real, live footnote pointer which is named "Ftnt" and points at the node named "Help-Ft". If you wish to look at a footnote, you must use the "F" command. The "F" must be followed by the footnote name (in this case, "Ftnt"). You can use Rubout and ^L to edit the footnote name, and if you change your mind about looking at any footnote you can use a lot of Rubouts to cancel the command. >> Type "F", followed ack where you were. >> Type a "?" now. After it finishes, type "l". From now on, you will encounter large nodes without warning, and will be expected to know how to use Space and Backspace to move around in them without being told. Since not all terminals have the same size screen, it would be impossible to warn you anyway. >> Now type "N" to see the description of the "M" command. Node: help-adv Next: Help-Q Previous: Help-M Some advanced INFO commands The course is almost over, so please stick by "Ftnt", and a CR. >> Now type "N" to see the last node of the course. Node: help-foo Up: Help-M The U command Congratulations! This is Help-FOO. Unlike the other nodes you have seen, this one has an "Up". It is "Help-M", the node you just came from via the "M" command. That is the usual convention - a node's subnodes have "Up"'s pointing back at it. Menus move Down in the tree, and Up moves Up. Previous, on the other hand, is usually used to "stay on the same level but go backwards". You cawith it to the end. If you have been moving around to different nodes and wish to retrace your steps, the "L" command ("L" for "Last") will do that, one node at a time. If you have been following directions, an "L" command now will get you back to Help-M. Another L command would undo the U and get you back to FOO-Node. Another L would undo the M and get you back to Help-M. >> Try typing three L's, pausing in between to see what each L does. Then follow directions again and you will end up back here. n go back to the node Help-M by typing the command "U" for "Up". That will put you at the FRONT of the node - to get back to where you were reading you will have to type some Spaces. >> Now type "U" to move back up to Help-M. Node: help-ft This is the node reached by the footnote "Ftnt". While this node is specifically intended to be a footnote, many footnotes are simply cross-references to other places in the structure of nodes. So you can't expect the footnote to have a Next, Previous or Up point Note the difference between L and P: L moves to where YOU last were, whereas P always moves to the node which the Header says is the "Previous" node (from this node, to Help-M). The "D" command gets you instantly to the Directory node. This node, which is the first one you saw when you entered INFO, has a menu which leads (directly, or indirectly through other menus), to all the nodes that exist. >> Try doing a "D", then do an L to return here (yes, DO return). Sometimes, in INFO documentation, ying back to where you came from. In general, the "L" command is the only way to get back there. >> Type "L" to return to where the footnote was. Node: help-m Next: Help-Adv Previous: Help-^L Menus and the M command With only the "N" and "P" commands for moving between nodes, nodes are restricted to a linear sequence. Menus allow a branching structure. A menu is a list of other nodes you can move to. It is actually just part of the text of the node formatted specially so that INFO can interpret it. The beginning of a menu is always identified by a line which starts with "* Menu:". A node contains a menu if and only if it has a line in it which starts that way. The only menu you can use at any moment is the one in the node you are in. To use a menu in any other node, you must move to that node first. After the start of the menu, each line that starts with a "*" identifies one subtopic. The line will usually contain a brief name for the subtopic (followed by a ":"), the name of the node that talt to that node somehow. The command to go to one of the subnodes is "M" - but DON'T DO IT YET! Before you use "M", you must understand the difference between commands and arguments. So far, you have learned several commands that do not need arguments. When you type one, INFO processes it and is instantly ready for another command. The "M" command is different: it is incomplete without the NAME OF THE SUBTOPIC. Once you have typed "M", INFO tries to read the name. INFO tells you when it wants to rks about that subtopic, and optionally some further description of the subtopic. Lines in the menu that don't start with a "*" have no special meaning - they are only for the human reader's benefit and do not define additional subtopics. Here is an example: * Foo: FOO's Node This tells about FOO The subtopic name is Foo, and the node describing it is "FOO's Node". The rest of the line is just for the reader's information. When you use a menu to go to another node (in a way that will be described ead an argument by prompting at the bottom of the screen. (For example, when you type "M" (DON'T DO IT YET), you will see "Menu item: " appear at the bottom of the screen.) At such times, commands won't work, because INFO will try to use them as the argument. You must either type the argument and finish the command you started, or type Control-G to cancel the command. When you have done one of those things, the prompt at the bottom of the screen will disappear. An alternate way to select a menu item issoon), what you specify is the subtopic name, the first thing in the menu line. INFO uses it to find the menu line, extracts the node name from it, and goes to that node. The reason that there is both a subtopic name and a node name is that the node name must be meaningful to the computer and may therefore have to be ugly looking. The subtopic name can be chosen just to be convenient for the user to specify. Often the node name is convenient for the user to specify and so both it and the subtopic name ar to point the mouse cursor at the line containing the name of the node you wish to visit and pressing the left button. You will then visit that node directly. The command to go to a subnode via a menu is "M". When you type an "M", the top of the menu will appear on the screen if it wasn't already visible. If the menu doesn't all fit on the screen, you can use Space and Backspace as usual to move around in it. When you have decided which subtopic to look at, type the subtopic's name, ended by a CR (Cae the same. There is an abbreviation for this: * Foo:: This tells about FOO This means that the subtopic name and node name are the same; they are both "Foo". >> Now use Spaces to find the menu in this node, then come back to the front with a "B". As you see, a menu is actually visible in its node. If you can't find a menu in a node by looking at it, then the node doesn't have a menu. The only menu you can use is the one (if any) in the current node. To use a menu in another node, you must first gerriage-Return). You can abbreviate the topic name. If the abbreviation is not unique, the first matching topic is chosen. Some menus will put the shortest possible abbreviation for each topic name in capital letters, so you can see how much you need to type. You should not put any spaces at the end, or inside of the item name, except for one space where a space appears in the item in the menu. Here is a menu to give you a chance to practice. * Menu: The menu starts here. Type a space if you need to. This menu givs you three ways of going to one place, Help-FOO. * Foo: Help-FOO A node you can visit for fun * Bar: Help-FOO Strange! two ways to get to the same place. * Help-FOO:: And yet another! >> Now type just an "M" and see what happens: Now you are "inside" an "M" command. Commands can't be used now; the next thing you will type must be the name of a subtopic. Notice how the prompt "Menu item: " has appeared at the bottom of the screen to tell you what INFO expects next. You can chevious: Help-Adv Up: Top To get out of Info, back to Emacs, type "Q" for "Quit". This is the end of the course on using INFO. There are some other commands that are not essential or meant for experienced users; they are useful, and you can find them by looking in the directory for documentation on INFO. Finding them will be a good exercise in using INFO in the usual manner. >> Go to the directory with "D", type "MInfo" and Return to get to the node about INFO and see what is available. w:: (^X-2)ange your mind about doing the "M" by typing a Rubout. >> Try that now; notice the "Menu item: " disappear. >> Then type another "M". >> Now type "Foo", the item name. Don't type CR yet. While you are typing the item name, you can use the Rubout character to cancel one character at a time if you make a mistake. >> Type one to cancel the last "O". You could type another "O" to replace it. You don't have to, since "FO" is a valid abbreviation. >> Now you are ready to go. Type a CR. After visiting  L9&info.dir/emacs/databases  6;d;e;f 4;b2$L@ `$lߌ;r"zHelp-FOO, you should return here. >> Now try visiting the same node again, only this time do it by pointing >> at the menu line for Help-FOO and pressing the left mouse button. >> Type "N" to see more commands. Node: help-p Next: Help-^L Previous: Help This node is called "Help-P". The "Previous" node, as you see, is "Help", which is the one you just came from using the "N" command. Another "N" command now would take you to the Next node, "Help-^L". >> But don't do that yet. First, try the "P" command, which takes you to the Previous node. When you get there, you can do an "N" again to return here. This all probably seems insultingly simple so far, but DON'T be led into skimming. Things will get more complicated soon. Also, don't try a new command until you are told it's time to. Otherwise, you may make INFO skip past an important warning that was coming up. ">>" in the margin means it is really time to try a command. >> Now do an "N" to get to the node "Help-^L" and learn more. Node: help-q Pr?Z @L9(info.pag/emacs/databases  6;d;e;f 4;b2$L@ `$lߌ;g"zWlR; hJ, ] ;  o W > "  h M /   } i R 6   _ @ " rK4`G' entry8vemacs:marks1Bemacs:local-binding-of,|emacs:list-databases*_emacs:lisp-mode'!emacs:length&Vemacs:left-margin"3emacs:kill-to-end-of-lineWemacs:is-bound emacs:interactiveemacs:insert-stringemacs:goto-characterVemacs:goto|yemacs:get-tty-variable̊demacs:forward-parenVemacs:following-charBemacs:files-should-end-with-newlineyMemacs:execute-monitor-commandwJWemacs:execute-mlisp-buffern8emacs:erase-buffermemacs:eobpl  emacs:enlarge-windowjemacs:end-of-lineixemacs:electric-cQemacs:delete-windowO#emacs:delete-region-to-bufferN#emacs:delete-previous-wordLDemacs:delete-previous-characterKemacs:delete-other-windows;emacs:define-buffer-macro9Aemacs:default-right-margin5x*emacs:default-case-fold-search1emacs:default profile*"emacs:current-column&emacs:copy-region-to-buffer&hemacs:concatemacsP]emacs:users-full-nameO^emacs:use-syntax-tableIemacs:use-abbrev-table;emacs:unbound commands9~9emacs:trivial example59emacs:track-eol-on-^N-^Pemacs:system-nameemacs:start-remembering Femacs:some necessary notation6emacs:sit-foremacs:setq-default_emacs:set-auto-fill-hooksemacs:character movesemacs:char-to-string emacs:case-word-invert_emacs:case-fold-searchemacs:bind-to-keyeemacs:backward-paragraphzemacs:backup-by-copyingS'emacs:autoloadOemacs:ask-about-buffer-names8Oemacs:argcřemacs:argemacs:Unbound Commandsfiemacs:Searchingpo4emacs:Getting Help/'AHemacs:Extensibility) emacs:Compiling programs1Aemacs:Basic Commands|emacs:>= emacs:-vemacs:&yemacs:!:sentence movesemacs:send-string-to-terminalBiemacs:searchingemacs:remove-all-local-bindings.emacs:read-fileWemacs:re-query-replace-stringDemacs:quoteemacs:put-database-entryemacs:prognemacs:printYemacs:previous-pageJ;emacs:previous-commandBemacs:prepend-extension8emacs:prefix-argument-loop}[emacs:pop-up-windows|.demacs:pop-to-bufferlXfemacs:novaluegemacs:next-lineN\ \emacs:modify-syntax-bjN4zX; y W 4  { ] J +  r T 5  f N /  v Y 5  gA"t[J1vXA.acs:line operations^emacs:invoking emacs Jemacs:input conventionsYemacs:init filesEemacs:help and helper functions+emacs:getting out4emacs:getting help!wemacs:get-tty-commandemacs:forward-sentenceˌemacs:forward-paragraph+emacs:filter-region~(emacs:replace-stringNemacs:re-search-reverse,emacs:prepend-region-to-buffer0emacs:prefix-string~Zemacs:preceding-charv emacs:page-next-windowsemacs:packagesmXemacs:occure77emacs:newline-and-backupdyemacs:newlineaemacs:narrow-region]emacs:move-to-comment-column[emacs:move-dot-to-x-y=vemacs:mlisp statements:Bemacs:mice4emacs:macro operations2emacs:looking-at+<uemacs:list-buffers(\emm{c9~Z8  v \ 7  f G " ~ b N /  g R 5 #  v U / ~X;eP6{`D) yW;# vbO<)acs:mode lines9emacs:message6uemacs:mark%"4emacs:last-key-struck*emacs:keymaps.emacs:justify-paragraph:emacs:insert-fileTemacs:insert-character emacs:infoemacs:indent-c-procedureemacs:indent-C-procedureemacs:global-mode-stringJ <emacs:= emacs:/emacs:%,cmds:top'emacs:read-abbrev-file5Uemacs:re-replace-stringc{emacs:quote-character-emacs:quietly-read-abbrev-fileemacs:quick-redisplayv'emacs:query-replace-stringemacs:pwdemacs:push-back-characternemacs:provide-prefix-argumentemacs:previous-lineemacs:prefix-argument-providedz3emacs:parenthesised movesjpemacs:nothinghemacs:next-pagefndemacs:newline-and-indentc}emacs:needs-checkpointing`qemacs:nargs?X _emZxY8kK2 ~ b L 4  z i N 3  | c :  w ] E "  i G sR6tY4fH9$ocal-bind-to-key--emacs:load)emacs:line-to-top-of-window'emacs:line moves emacs:introduction emacs:insertingLemacs:incr-search$uemacs:illegal-operationemacs:ifemacs:help-on-command-completion-erroremacs:get-tty-bufferKemacs:forward-wordHMemacs:forward-balanced-paren-lineIemacs:file-existsRemacs:fetch-database-entrydqemacs:extend-database-search-list|Aemacs:expand-mlisp-variablesemacs:execute-extended-commandrdemacs:exchange-dot-and-markpjemacs:error-occuredk{emacs:end-of-windowdemacs:dotRfemacs:deletingP+emacs:delete-to-killbufferCDemacs:define-keymapAemacs:define-hooked-local-abbrev;emacs:default-tab-size)emacs:current-buffer-name"4emacs:compile-itemacs:commandsemacs:command-prefix emacs:case-word-lower nemacs:case-region-upper emacs:case-region-lower emacs:case-region-invertyinfo:help-advjemacs:|gemacs:write-named-filefemacs:write-modified-fileseemacs:write-file-exiteemacs:write-current-filed1emacs:write-abbrev-filebSemacs:wrap-long-linesU!emacs:visible-bellHemacs:unlink-fileFgemacs:unlink-checkpoint-filesCemacs:undo-boundary@_emacs:undo,&emacs:the screen emacs:tagsqemacs:substr`Nemacs:stack-trace-on-erroremacs:setq5Remacs:c=2emacs:c-mode`emacs:buffers;emacs:buffer-sizeGemacs:buffer-is-modifiedenemacs:backward-parenemacs:backup-by-copying-when-linked˱emacs:argvɇ*emacs:argument-prefixąemacs:aproposªemacs:append-region-to-bufferemacs:abort-operation'?emacs:Region Restrictionsw!emacs:Input Conventions&iemacs:Command prefix, also known as META Temacs:Abbrev mode emacs:>> emacs:<= emacs:+0emacs:!=emacs:scroll-one-line-downEemacs:save-excursionemacs:remove-bindingH?emacs:region restrictionsFemacs:region operationsAemacs:recursion-depthOemacs:re-search-forwardwemacs:quick$emacs:previous-windowGemacs:prefix-argumentz\emacs:parse-error-messages-in-regiony* emacs:paragraph operationsxvemacs:paragraph movesjNemacs:next-window_N#emacs:moving aroundMemacs:mode-stringLemacs:mode-line-format0#\emacs:l5D[ 5EL9*quickinfo.dat/emacs/databases  6;d;e;f 4;b2$L@ `$lߌ;t"z (* 'n_arg) (*array 's_name 's_type 'x_dim1 ... x_dimn) (*break 'g_pred 'g_message) (*catch 'ls_tag g_exp) (*throw 's_tag 'g_val) (+ 'n_arg) (- 'n_arg) (/ 'n_arg1 'n_arg2) (1+ 'n_arg) (1- 'n_arg) (< 'n_arg1 'n_arg2) (= 'g_arg1 'g_arg2) (> 'n_arg1 'n_arg2) (Divide 'i_dividend 'i_divisor) (Emuldiv 'x_fact1 'x_fact2 'x_addn 'x_divisor) long _atoh(str) char *str; long _atoo(str) char *str; short _atos(str) char *str; void _crypt(crypw, pw) char *crypw; char *pw; void _exit(code) int code; char *_ftoa(fp) double ak [g_message ['g_pred]]) int brk(addr) char *addr; (c..r 'l_arg) char *calloc(num, size) unsigned num; unsigned size; (catch g_exp [ls_tag]) int cdata(addr) char *addr; double ceil(x) double x; (cfasl 'st_file 'st_entry 's_funcname ['st_library]) (chdir 's_path) int chmod(path, perms) char *path; int perms; int chown(path, uid) char *path; int uid; int chtim(path, time) char *path; long time; int clearerr(stream) FILE *stream; (close 'p_port) void closedir(pdir) DIR *pdir; (comment [g_arg ...]) (concat ['sfp; void _ierrmsg() char *_itostr(i, base, digits, psign) int i; int base; char *digits; int *psign; void _l2tos(sp, cp, n) short *sp; char *cp; int n; void _l4tol(lp, cp, n) long *lp; char *cp; int n; void _ltol4(cp, lp, n) char *cp; long *lp; int n; char *_ltostr(i, base, digits, psign) long i; int base; char *digits; int *psign; void _stol2(cp, sp, n) char *cp; short *sp; int n; int _strtoi(str, ptr, base) char *str; char **ptr; int base; int _tolower(c) int c; int _toupper(c) int c; void abort(); (abs '_arg1 ... ]) (cond [l_clause1 ...]) (cons 'g_arg1 'g_arg2) (cont) (copy 'g_arg) (copysymbol 's_arg 'g_pred) (cos 'fx_angle) double cosh(x) double x; (cpy1 'xvt_arg) int creat(path, perms) char *path; int perms; char *ctime(pclock) long *pclock; extern int daylight; (declare [g_arg ...]) (def s_name (s_type l_argl g_exp1 ...)) (defprop s_atm g_val g_ind) (defun s_name [s_mtype] ls_argl g_exp1 ...) (delete 'g_val 'l_list ['x_count]) (delq 'g_val 'l_list ['x_count]) (diff ['n_arg1 ... ]) (difference ['n_arg1 .n_arg) (absval 'n_arg) int access(path, perms) char *path; int perms; int acct(path) char *path; (acos 'fx_arg) (add ['n_arg1 ...]) (add1 'n-arg) (aexplode 's_arg) (aexplodec 's_arg) (aexploden 's_arg) unsigned int alarm(sec) unsigned int sec; (allocate 's_type 'x_pages) (alphalessp 's_arg1 's_arg2) (and [g_arg1 ...]) (append 'l_arg1 'l_arg2) (append1 'l_arg1 'g_arg2) (apply 'u_func 'l_args) (arg ['x_numb]) (argv 'x_argnumb) (array s_name s_type x_dim1 ... x_dimi) (arraycall 's_type 'a_array 'x_ind1 ...) (a..]) char *dirname(path) charr *path; (do s_name g_init g_repeat g_test g_exp1 ...) (drain ['p_port]) (dtpr 'g_arg) (sstatus dumpcore g_val) (dumplisp s_name) (sstatus dumpmode x_val) int dup(fildes) int fildes; int dup2(src, dest) int src; int dest; char *ecvt(fp, count, pexp, psign) double fp; int count; int *pexp; int *psign; extern int edata; extern int end; void endpwent(); void endutent(); (eq 'g_arg1 'g_arg2) (equal 'g_arg1 'g_arg2) (err ???) extern int errno; (errset ???) extern int etext; (eval 'g_rraydims 's_name) (arrayp 'g_arg) (arrayref 's_name 'x_ind) (ascii x_charnum) char *asctime(dttm) struct tm *dttm; (asin 'fx_arg) (assoc 'g_arg1 'l_arg2) (assq 'g_arg1 'l_arg2) (atan 'fx_arg1 'fx_arg2) double atan2(x, y) double x; double y; double atof(str) char *str; int atoi(str) char *str; long atol(str) char *str; (atom 'g_arg) (baktrace) char *basename(path, suffix) char *path; char *suffix; (bcdad 's_funcname) (bcdp 'g_arg) (bigp 'g_arg) (bindstack) (boole 'x_key 'x_v1 'x_v2 ...) (boundp 's_name) (breval) (eval-when l_time g_exp1 ...) (exec) int execl(path, [arg0, [arg1, ...,[ argn,]]] nullp) char *path; char *arg0, *arg1, ..., argn; char *nullp; int execlp(path, [arg0, [arg1, ...,[ argn,]]] nullp) char *path; char *arg0, *arg1, ..., argn; char *nullp; int execv(path, argv) char *path; char *argv[]; int execvp(path, argv) char *path; char *argv[]; (exit ['x_code]) (exp 'fx_arg) (explode 'g_arg) (explodec 'g_val) (exploden 'g_val) (expt 'n_base 'n_power) double fabs(x) double x; (fact 'x_arg) (fake 'x_ad dr) (fasl 'st_name ['st_mapf ['g_warn]]) int fclose(stream) FILE *stream; char *fcvt(fp, pos, pexp, psign) double fp; int pos; int *pexp; int *psign; FILE *fdopen(fildes, mode) int fildes; char *mode; (status feature g_val) (status features) int feof(stream) FILE *stream; int ferror(stream) FILE *stream; (ffasl 'st_file 'st_entry 'st_funcname) int fflush(stream) FILE *stream; int fgetc(stream) FILE *stream; char *fgets(ptr, count, stream) char *ptr; int count; FILE *stream; int fileno(stream) FILE *stream; etpass(prompt) char *prompt; int getpid() int getpw(uid, ptr) int uid; char *ptr; struct passwd *getpwent(); struct passwd *getpwnam(name) char *name; struct passwd *getpwuid(uid) int uid; char *gets(ptr) char *ptr; int getuid() struct utmp *getutent(); struct utmp *getutline(line) char *line; int getw(stream) FILE *stream; struct tm *gmtime(pclock) long *pclock; (go g_labexp) (greaterp ['n_arg1 ...]) int gtty(fildes, buf) int fildes; struct sgttyb *buf; (haipart bx_number x_bits) (hashtabstat) (haulong bx_(fillarray 's_array 'l_itms) (fix 'n_arg) (fixp 'g_arg) (flatc 'g_form ['x_max]) (flatsize 'g_form ['x_max]) (float 'n_arg) (floatp 'g_arg) double floor(x) double x; double fmod(x, y) double x; double y; FILE *fopen(pathnam, mode) char *pathnam; char *mode; int fork() int fprintf(stream, format [,arglist]) FILE *stream; char *format; int fputc(c, stream) char c; FILE *stream; int fputs(s, stream) char *s; FILE *stream; int fread(ptr, size, count, stream) char *ptr; int size; int count; FILE *stream; void frnumber) (implode 'l_arg) (include s_filename) char *index(s, c) char *s; char c; (infile 's_filename) (intern 's_arg) int isalnum(c) int c; int isalpha(c) int c; int isascii(c) int c; int iscntrl(c) int c; int isdigit(c) int c; int isgraph(c) int c; int islower(c) int c; int isprint(c) int c; int ispunct(c) int c; int isspace(c) int c; int isupper(c) int c; int isxdigit(c) int c; int kill(taskid, signum) int taskid; int signum; void l3tol(lp, cp, n) long *lp; char *cp; int n; (last 'l_arg) double ldexp(fp, ee(ptr) char *ptr; FILE *freopen(pathnam, mode, stream) char *pathnam; char *mode; FILE *stream; double frexp(fp, iptr) double fp; int *iptr; int fscanf(stream, format [, addrlist]) FILE *stream; char *format; (fseek 'p_port 'x_offset 'x_flag) int fstat(fildes, bufad) int fildes; struct stat *bufad; long ftell(stream) FILE *stream; int ftime(tbufaddr) struct timeb *tbufaddr; char *fullname(path) char *path; (funcall 'u_func ['g_arg1 ...]) (function u_func) int fwrite(ptr, size, count, stream) char *ptr; intexp) double fp; int exp; (length 'l_arg) (lessp ['n_arg1 ...]) int link(path, newlink) char *path; char *newlink; (list ['g_arg1 ... ]) (load 's_filename) struct tm *localtime(pclock) long *pclock; int lock(flag) int flag; (log 'fx_arg) double log10(x) double x; void longjmp(env, val) jmp_buf env; int val; int lrec(fildes, count) int fildes; int count; long lseek(fildes, offset, type) int fildes; long offset; int type; void ltol3(cp, lp, n) char *cp; long *lp; int n; (makereadtable ['s_flag]) (maknam 'l_arg size; int count; FILE *stream; (status g_code) (sstatus g_type g_val) (gc) (gcafter s_type) char *gcvt(fp, precn, buf) double fp; int precn; char *buf; (gensym 's_leader) (get 's_name 'g_ind) (get_pname 's_arg) (getaccess 'a_array) (getaux 'a_array) int getc(stream) FILE *stream; (getchar 's_arg 'x_index) (getcharn 's_arg 'x_index) char *getcwd(ptr, size) char *ptr; int size; (getd 's_arg) (getdelta 'a_array) (getdisc 't_func) (getentry 'y_funchd) (getenv 's_name) int geteuid() (getlength 'a_array) char *g) (makunbound 's_arg) char *malloc(nbytes) unsigned nbytes; (map 'u_func 'l_arg1 ...) (mapc 'u_func 'l_arg1 ...) (mapcan 'u_func 'l_arg1 ...) (mapcar 'u_func 'l_arg1 ...) (mapcon 'u_func 'l_arg1 ...) (maplist 'u_func 'l_arg1 ...) (marray 'g_data 's_access 'g_aux 'x_length 'x_delta) int matherr(ptr) struct exception *ptr; (max 'n_arg1 ...) (member 'g_arg1 'l_arg2) char *memccpy(ptr1, ptr2, c, n) char *ptr1; char *ptr2; int c; int n; char *memchr(ptr, c, n) char *ptr; int c; int n; int memcmp(ptr1, ptr2, n) c!har *ptr1; char *ptr2; int n; char *memcpy(ptr1, ptr2, n) char *ptr1; char *ptr2; int n; int memman(fcn, loaddr, hiaddr) int fcn; char *loaddr; char *hiaddr; (memq 'g_arg1 'l_arg2) char *memset(ptr, c, n) char *ptr; int c; int n; (mfunction entry 's_disc) (min 'n_arg1 ...) (minus 'n_arg) (minusp 'g_arg) int mknod(path, desc, devnum) char *path; short desc; short devnum; char *mktemp(template) char *template; (mod 'i_dividend 'i_divisor) double modf(fp, dptr) double fp; double *dptr; int mount(spcnam, dirnam unsigned int width; int (*compar)(); (quote g_arg) (quotient ['n_arg1 ...]) int rand(); (random ['x_limit]) (ratom ['p_port]) (read ['p_port]) (readc ['p_port]) struct direct *readdir(pdir) DIR *pdir; (readlist 'l_arg) char *realloc(buf, size) char *buf; unsigned int size; (remainder 'i_dividend 'i_divisor) (rematom 's_symb) (remob) (remprop 's_name 'g_ind) (replace 'g_arg1 'g_arg2) (reset) (resetio) (retbrk ['x_level]) (return ['g_val]) (reverse 'l_arg) int rewind(stream) FILE *stream; void rewinddir(pdir, rwflag) char *spcnam; char *dirnam; int rwflag; (namestack) (nconc 'l_arg1 'l_arg2) (ncons 'g_arg) int nice(incr) int incr; (sstatus nofeature g_val) (not 'g_arg) (nreverse 'l_arg) (nthelem 'n_arg1 'l_arg2) (null 'g_arg) (numberp 'g_arg) (numbp 'g_arg) (nwritn ['p_port]) (oblist) (onep 'g_arg) int open(pathnam, mode) char *pathnam; int mode; DIR *opendir(path) char *path; (opval 's_arg ['g_newval]) (or [g_arg1 ... ]) (outfile 's_filename) (patom 'g_exp ['p_port]) int pause() void perror(ptr) char *ptr; vo) DIR *pdir; char *rindex(s, c) char *s; char c; (rplaca 'l_arg1 'g_arg2) (rplacd 'l_arg1 'g_arg2) void rrand(seed); (sassoc 'g_arg1 'l_arg2 'sl_func) (sassq 'g_arg1 'l_arg2 'sl_func) char *sbrk(incr) int incr; int scanf(format [, addrlist]) char *format; void seekdir(pdir, pos) DIR *pdir; long pos; (segment 's_type 'x_size) (set 's_arg1 'g_arg2) int set_ftm(pathnam, ptime) char *pathnam; long *ptime; (setarg 'x_argnum 'g_val) void setbuf(stream, buf) FILE *stream; char *buf; int setjmp(env) jmp_buf env; (sid pffinit(); char *phys(code) int code; int pipe(fds) int (*fds)[2]; (plist 's_name) (plus ['n_arg ...]) (plusp 'n_arg) (pntlen 'xfs_arg) (portp 'g_arg) double pow(x, y) double x; double y; (princ 'g_arg ['p_port]) (print 'g_arg ['p_port]) int printf(format [,arglist]) char *format; (process s_pgrm [s_frompipe s_topipe]) (product ['n_arg1 ... ]) int profil(bufad, bufsiz, scale, lowpc) char *bufad; int bufsiz; int scale; int lowpc; (prog l_vrbls g_exp1 ...) (prog2 g_exp1 g_exp2 [g_exp3 ...]) (progn g_exp1 [etplist 's_atm 'l_plist) void setpwent(); (setq s_atm1 'g_val1 [ s_atm2 'g_val2 ... ... ]) (setsyntax 's_symbol 'x_code) int setuid(uid) int uid; void setutent(); (shell) (showstack) (signal 'x_signum 's_name) (sin 'fx_angle) double sinh(x) double x; (sizeof 'g_arg) unsigned int sleep(time) unsigned int time; int sprintf(string, format [,arglist]) char *string; char *format; (sqrt 'fx_arg) void srand(seed) int seed; int sscanf(string, format [, addrlist]) char *string; char *format; int stack(nbytes) int nbg_exp2 ...]) (progv 'l_locv 'l_initv g_exp1 ...) (ptime) (putaccess 'a_array 's_func) (putaux 'a_array 'g_aux) int putc(c, stream) char c; FILE *stream; int putchar(c) char c; (putd 's_name 'u_func) (putdelta 'a_array 'x_delta) (putdisc 'y_func 's_discipline) (putlength 'a_array 'x_length) (putprop 's_name 'g_val 'g_ind) int putpwent(ptr, stream) struct passwd *ptr; FILE *stream; int puts(s) char *s; int putw(wd, stream) int wd; FILE *stream; int qsort(base, nel, width, compar) char *base; unsigned int nel;ytes; int stat(pathnam, bufad) char *pathnam; struct stat *bufad; FILE *stderr; FILE *stdin; FILE *stdout; int stime(ptime) long *ptime; char *strcat(s1, s2) char *s1; char *s2; char *strchr(s, c) char *s; char c; int strcmp(s1, s2) char *s1; char *s2; char *strcpy(s1, s2) char *s1; char *s2; int strcspn(s1, s2) char *s1; char *s2; (stringp 'g_arg) int strlen(s) char *s; char *strncat(s1, s2, n) char *s1; char *s2; int n; int strncmp(s1, s2, n) char *s1; char *s2; int n; char *strncpy(s1, s2, n) char *s1; c!har *s2; int n; char *strpbrk(s1, s2) char *s1; char *s2; char *strrchr(s, c) char *s; char c; int strspn(s1, s2) char *s1; char *s2; char *strtok(s1, s2) char *s1; char *s2; long strtol(str, ptr, base) char *str; char **ptr; int base; int stty(fildes, buf) int fildes; struct sgttyb *buf; (sub1 'n_arg) (sum ['n_arg1 ...]) (symbolp 'g_arg) int sync() (status syntax s_char) extern char *sys_errlist[]; extern int sys_nerr; (syscall) double tan(r) double r; double tanh(x) double x; long telldir(pdir) DIR *pdir; (terpr ['p_port]) (terpri ['p_port]) (throw 'g_val [s_tag]) long time(ptime) long *ptime; (times ['n_arg1 ... ]) extern long timezone; int toascii(c) int c; int tolower(c) int c; (top-level) int toupper(c) int c; int truncf(fildes) int fildes; char *ttyname(fildes) int fildes; int ttyslot() (tyi ['p_port]) (tyipeek ['p_port]) (tyo 'x_char ['p_port]) (type 'g_arg) (typep 'g_arg) extern char *tzname[2]; void tzset() (uconcat ['s_arg1 ... ]) int umask(perms) int perms; int umount(pathnam) char *pathnam; int ungetc(c, stream) int c; FILE *stream; int unlink(pathnam) char *pathnam; int urec(fildes) int fildes; int utime(pathnam, ptime) char *pathnam; long *ptime; (valuep 'g_arg) int vfork() int wait(ptaskid) int *ptaskid; (what 'g_arg) int write(fildes, bufad, nbytes) int fildes; char *bufad; int nbytes; (zapline) (zerop 'g_arg) \ L9+quickinfo.dir/emacs/databases  6;d;e;f 4;b2$L@ `$lߌ;r"z"]  L9,quickinfo.pag/emacs/databases  6;d;e;f 4;b2$L@ `$lߌ;g"zwiZJ:/!uh[OC7& y n b U H 9 *    x l [ N A 3 '  u e W K > 1 $  r d U G 7 '  q b S F : -   tfZOA6* {naRF9.!qdWK>/ |l\PC5& qfZK?2#4Fwrite4what4Iurec4&#unlink3 tzset3~tzname3atype35tyipeek3%tyi2"ttyname2truncf2toascii2[times2=time1telldir1tanh1tan1 syscall1sys_nerr10sum1"sub10_'strspn0:%strrchr0*strpbrk/2strncmp/v4strncat/_strlen.)strcpy.P stdin-zsqrt-7Csprintf,signal,shell,*1setq,setpwent+setplist+setjmp+2setbuf+-seekdir*-scanf*sbrk*!sassq*crrand*1rplaca* $rindex)re"verse)retbrk)reset)Premprop((readdir(mratom(M rand(&quote'gqsort'Cnconc"2 namestack!Jmount!/modf!mod!u'mktemp!min memq YEmemman9memcmp1memchrnFmemccpyCmax(matherrmaplistmapconmapcar<mapcDlseekloglockloadlength*ldexplast1l3tolRisupper<isspaceislowerisgraphisdigitiscntrlisasciivisalnumQinfileimplode6gttyngoueVH:-"znbVJ>. ~ r b W I 7 (    | p d V G ; -   } s d X G 6 *  v h X I 6 '  ~ q b V I 4 &  {nbQB3& }q`TH8*zl^OD5'seXJ<.ueVE6''getw)getutlinegetsm*getpwnamRgetpwent getpidgeteuidgetenvgetdiscgetauxgetgensym g_codeSfwritez!fullname-!ftell9fstatDfscanfNfreopenfreeRfread{,fputsP+fputc6fopen&fmod|floatpQflatsize*fixp fixfillarray!filenoDfgetsZ!fflushfeaturesJLfcvt)!fclosefabs56zerop5, zapline4 wait4 vfork4valuep4f6utime3+ungetc3#umount3umaskexplodenexplodecsexpbexit11execvp0execv*kexecleval-when eval errset errno err equal ~endutent ]end Pecvt 'dup2 dup dumpmode fdtpr diff !delq d,defun Hdefprop declare "ctime .creat cpy1 lcos Pcopysymbol $cons cond concat #clearerr `-chtim 6*chownchdir5cfaslcda3uconcat3otypep3Ityo3ttyslot2toupper2 top-level2tolower2rtimezone2&throw2terpri2terpr1wsys_errlist1`syntax1U sync1Dsymbolp06stty0=strtol0)strtok/4strncpy/Nstringp/&(strcspn.'strcmp.$strchr.)strcat.kstime.]stdout.Bstderr.= 1-j*throwS*catch7*break ,*array$phys#perror#)1open"numbp"numberp"nthelem"~nofeature"enice"Vncons!1Dmknod!!minusp!minus mfunction 1memset ;memcpyUmember5marrayqmapcanVmapc&mallocmakunboundmaknammakereadtable1ltol34/lrec-longjmplog10+localtimerlist?3link)lessp1killhisxdigit&ispunctisprintisalphaG^ GL9/tutorial.txt/emacs/databases  6;d;e;f 4;b2$L@ `$lߌ;t"zfintern.#indexincludehaulonghashtabstathaipart|greaterpF(gmtimegetutent getuid&getpwuid*(getpw$getpassgetlengthgetentrygetdelta|getdO-getcwd4getcharngetchargetcgetaccessget_pname] means hold the CONTROL key while typing the character Thus, ^F would be: hold the CONTROL key and type F ESC- means type , release it, then type the character **************float8flatc{ fgetc2(ffasl!ferrorfeoffeature3fdopen%faslfakefactexptexplodelexeclp#exec etext eq mendpwent Kedata dumplisp tdumpcore Tdrain &.do !dirname difference #delete (def daylight |cosh Bcopy ;cont comment closedir close .chmodceilwcatchB5callocbr****************** Important note: if you must exit at some point, type ^C. ******************************** The characters ">>" at the left margin indicate directions for you to try using a command. For instance: >> Now type ^V (View next screen) to move to the next screen. (go ahead, do it by depressing the control key and V together). From now on, you'll be expected to do this whenever you finish reading the screen. Note that there is an overlap when going from screen to screen; this p#rovides some continuity when moving through the file. The first thing that you need to know is how to move around from place to place in the file. You already know how to move forward a screen, with ^V. To move backwards a screen, type ESC-v. >> Try typing ESC-v and then ^V to move back and forth a few times. NOTE: In Emacs, ESC-v and ESC-V are two different commands. They may do the same thing, or they may not. All of the commands listed in this tutorial use the lower case form of the command. SUMMARhe beginning of a line. Do a few more ^B's. Then do ^F's back to the end of the line and beyond. When you go off the top or bottom of the screen, the text beyond the edge is shifted onto the screen sobe carried out while keeping the cursor on the screen. >> Try to move the cursor off the bottom of the screen with ^N and see what happens. If moving by characters is too slow, you can also move by words. ESC-f moves forward a word and ESC-b moves back a word. >> Type a few ESC-f's and ESC-b's. IntersY ------- The following commands are useful for viewing screenfuls: ^V Move forward one screenful ESC-v Move backward one screenful ^L Clear screen and redisplay everything. >> Find the cursor and remember what text is near it. Then type a ^L. Find the cursor again and see what text is near it notice that it is the same as before. BASIC CURSOR CONTROL -------------------- Getting from screenful to screenful is useful, but how do you reposition yourself within a given screen to a specific placeperse them with ^F's and ^B's. Notice the parallel between ^F and ^B on the one hand, and ESC-f and ESC-b on the other hand. Very often Escape characters are used for operations related to English text whereas Control characters operate on the basic textualts that are independent of what you are editing (characters, lines, etc). There is a similar parallel between lines and sentences: ^A and ^E move to the beginning or end of a line, and ESC-a and ESC-e move to the beginning or end of a sentence. >> Try a? There are several ways you can do this. One way (not the best, but the most basic) is to use the comr forward and next. As you can imagine, 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. Here, in a more graphical form are the commands: Previous line, ^P : : Backward, ^B .... Current cursor position .... Forward, ^F : : Next line, ^N You'll probably find it  couple of ^A's, and then a couple of ^E's. Try a couple of ESC-a's, and then a couple of ESC-e's. See how repeated ^A's do nothing, but repeated ESC-a's keep moving farther. Do you think that this is right? Two other simple cursor motion commands are ESC-< (Escape Less-than), moves to the beginning of the file, and ESC-> (Escape Greater-than), which moves to the end of the file. You probably don't need to try them, since finding this spot again will be boring. If you need the shift key to type a "<", easy to think of these by letter: P for previous, N for next, B for backward and F for forward. These are the basic cursor positioning commands and you'll be using them ALL the time so it would be of great benefit if you learn them now. >> Do a few ^N's to bring the cursor down to this line. >> Move into the line with ^F's and then notice what ^P does when the cursor is in the middle of the line. Lines are separated by a single Linefeed character, which is what Unix calls a Newline. >> Try to ^B at tthen you must also use the shift key to type ESC-<. Otherwise, you would be typing ESC-,. The location of the cursor in the text is also called "point" or "dot". To paraphrase, the cursor shows on the screen where point is located in the text. Here is a summary of simple moving operations including the word and sentence moving commands: ^F Move forward a character ^B Movard a character ESC-f Move forward a word ESC-b Move backward a word ^N Move to next line ^P Move to previous line ^A Move to $beginning of line ^E Move to end of line ESC-a Move back to beginning of sentence ESC-e Move forward to end of sentence ^Z Scroll window back, showing previous line ESC-z Scroll window forward, showing next line ESC-, Go to beginning of window ESC-. Go to end of window ESC-< Go to beginning of file ESC-> Go to end of file >> Try all of these commands now a few times for practice. Since the last two will take you away from this screen, you can come back here with ESC-v's and ^V's. These aisplay an informative error message in a separate window. To get rid of the other window, type the command ^X 1. INSERTING AND DELETING ---------------------- If you want to type text, just do it. Characters which you can see, such as A, 7, *, etc. are taken by EMACS as text and inserted immediately. is a key on the keyboard which may be labeled "Rubout" instead of "Delete" on some terminals. The may also be typed as a ^H. More generally, and deletes the charactre the most often used commands. Like all 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 typing a ^U or an ESC and then the dfore you type the command. Typing ^U without any digits will give a multiple of 4. That is, one ^U gives an argument of 4, two ^U's gives an argument of 16, etc. For instance, ^U 8 ^F moves forward eight characters, while ^U ^U ^F moves forward sixteen characters. >> Try er immediately before the current cursor position. >> Do this now, type a few characters and then delete them by typing a few times. Don't worry about this file being changed; you won't affect the master tutorial. This is just a copy of it. >> Now start typing text until you reach the right margin, and keep typing. When a line of text gets too big for one line on the screen, the line of text is "continued" onto a second screen line. The backslash at the right margin indicatesgiving a suitable argument to ^N or ^P to come as close as you can to this line in one jump. QUITTING FROM COMMANDS ---------------------- The character used in EMACS to quit out of all commands which request input is ^G. (The break key may also be used.) For example, you can use ^G to discard a numeric argument or the beginning of a command that you don't want to finish. >> Type ^U 100 to make a numeric arg of 100, then type ^G. Now type ^F. How many characters does it move? If you have typed  a line which has been continued. >> Use 's to delete the text until the line fits on one screen line again. The continuation line goes away. >> Move the cursor to the beginning of a line and type . This deletes the line separator before the line and merges the line onto the previous line. The resulting line may be too long to fit, in which case it has a continuation line. >> Type to insert the separator again. Remember that most EMACS commands can be given an by mistake, you can get rid of it with a ^G. If you type ESC-, you get into something known as a "minibuffer". That is an advanced feature of EMACS. We mention it now only to say that you can get out of it with one or two ^G's if you get into it by accident. ERRORS ------ Sometimes you may do something which EMACS doesn't allow. If it is something simple, such as typing a control key sequence whichnot associated with any command, EMACS will just beep at you. Otherwise, EMACS will also da repeat count; Note that this includes characters which insert themselves. >> now -- type ^U 8 * and see what happens. If you want to create a blank line in between two lines, move to the second of the two lines and type ^O. >> Try moving to a line and typing ^O now. You've now learned the most basic way of typing something in EMACS and correcting errors. You can delete by words or lines as well. Here is a summary of the delete operations: ^H () delete the character just before the cursor ^$D delete the next character after the cursor ESC-h kill the word immediately before the cursor ESC-d kill the next word after the cursor ^K kill from the cursor position to end of line Notice that ^H and ^D vs. ESC-h and ESC-d extend the parallel started by ^F and ESC-f. Now suppose you kill something, and then you decide that you want to get it back? Well, whenever you kill something with ^K or ^W, EMACS saves it for you. To yank it back, use ^Y. Note that you don't have to bou can have control to avoid leaving a half-changed file around when you don't want to. Even then, EMACS really makes a new version of the file and doesn't change the old version at all (so that you can verify or throw away your changes later if you like). If you look near the botton of the screen you will see a line that looks like "Buffer: emacs-tutorial (Normal) 55% *". The "emacs-tutorial" refers to the name of your own temporary copy of the text of the EMACS tutorial; the file you are now visiting. e in the same place to do ^Y; This is a good way to move text around. Also note that the difference between "Killing" and "Deleting" something is that "Killed" things can be yanked back, and "Deleted" things cannot. For instance, type ^N a couple times to postion the cursor at some line on this screen. >> Do this now, move the cursor and kill that line with ^K. Note that a single ^K kills the contents of the line, and a second ^K kills the line itself, and make all the other lines move. The text that haWhatever file you visit, that file's name will appear in that precise spot. The word "buffer" is to remind you that a file is actually copied into a temporary buffer before you startur changes. The commands for visiting and saving files are unlike the other commands you have learned in that they start with a different character. They both start with the character Control-X. There is a whole series of commands that start with Control-X; many of them have to do with files, buffers, and related things, and als just disappeared is saved so that you can retrieve it. To retrieve the last killed text and put it where the cursor currently is, type ^Y. >> Try it; type ^Y to yank the text back. Think of ^Y as if you were yanking something back that someone took away from you. Notice that if you do several ^K's in a row the text that is killed is all saved together so that one ^Y will yank all of the lines. >> Do this now, type ^K several times. Now to retrieve that killed text: >> Type ^Y. Then move the cursor dol of them consist of Control-X followed by some other character. Another thing about the command for visiting a file is that you have to say what file name you want. We say the command "reads an argument from the terminal" (in this case, the argument is the name of the file). After you type the command ^X ^V Visit a file EMACS will ask you for the file name. You should end the name with the Return key. After this command, you will see the contents of the file in your EMACS. You can edit the contents. wn a few lines and type ^Y again. You now see how to copy some text. FILES ----- In order to make the text you edit permanent, you must put it in a file. Otherwise, it will go away when your invocation of EMACS goes away. You put your editing in a file by "visiting" the file. What visiting means is that you see the contents of the file in your EMACS; and, loosely speaking, what you are editing is the file itself. However, the changes still don't become permanent until you "save" the file. This is so yWhen you wish to make the changes permanent, issue the command ^X ^S Save the file A new version of the file will be created. When the operation is finished, EMACS prints the name saved. If you forget to save a file, then visit a different file, EMACS will not throw away the changes you have made to the first file. EXTENDING THE COMMAND SET ------------------------- There are many, many more EMACS commands than could possibly be put on all the control and meta characters. EMACS gets around this wit%h the X (eXtend) command. This comes in two flavors: ^X Character eXtend. Followed by one character. ESC-x Named command eXtend. Followed by a long name. These are commands that are generally useful but used less than the commands you have already learned about. You have already seen two of them: the file commands ^X ^V to Visit and ^X ^S to Save. Named eXtend commands are commands which are used even less frequently, or commands which are used only in certain modes. These commands are usually called "iately above them is called the MODE LINE. The mode line says something like: Buffer: teach.emacs (Normal) nn% * This is a very useful "information" line. What the "nn%" means is that nn percent of the file is above the current line. The star means that you have made changes to the text. Right after you visit or save a file, there is no star. The part of the mode line inside the parentheses is to tell you what modes you are in. The default mode is Normal which is what you are in now. There are sefunctions" or "macros". An example is the function Replace String which globally replaces one string with another. When you type ESC-x, EMACS prompts you at the bottom of the screen with ":" and you should type the name of the function you wish to call; in this case, "Replace String". Just type "rep" and EMACS will complete the name. Then you type the string that you want to replace, a Return, the string you want to replace it with, and another Return. >> Move the cursor to the blank line two lines veral modes in EMACS for editing different languages and text, such as Lisp mode, Text mode, etc. At any time one and only one major mode is active, and its name can always be found in the mode line just where "Normal" is now. Each major mode makes a few commands behave differently. For example, there commands for creating comments in a program, and since each programming language has a different idea of what a comment should look like, each major mode has to insert comments differently. Each major mode is below this one. Then type ESC-x repchangealtered. Notice how this line has altered: you've replaced the word c-h-a-n-g-e-d with "changed" wherever it occurs after the cursor. The more customary command for replacing strings is the Query Replace command, which has many options. GETTING OUT AND QUITTING ------- --- --- -------- The command to tell EMACS that you'd like to stop editing is ^C. The variations of ESC ^C and ^X ^C also work. This does not save your files autthe name of an extended command, which is how you get into the mode. For example, "ESC-x normal" is how to get into Normal mode. GETTING HELP ------- ---- The most basic HELP feature is ESC-x describe-key. Type "ESC-x describe-key" and a command character, and EMACS prints a description of the command. >> Type "ESC-x describe-key ^F". The message should be something like ^F is globally bound to the wired procedure called "forward-character" The "name of the function" is important for people who aromatically. If any of your files have been modified, EMACS will ask if you really want to leave. If you just like to go into Unix temporarily to issue a shell command, use the command ^_ (control underscore). This will give you an entirely new shell. When you are done issuing shell commands, remember to type control-D to return to emacs. MODE LINE --------- At the bottom of the screen is an area called the echo area or mini-buffer. The echo area contains the bottommost line of the screen. The line immede customizing EMACS. It is what appears in the EMACS CHART as the documentation for the command character. Multi-character commands such as ^X ^C and ESC-v are also allowed after ESC-x describe-key. Here are some other useful commands:u ESC-x describe-command Describe a command. You type in the name of the function. To see your whole file again when it is done, type a ^X 1. >> Try typing ESC-x describe-command replace-string. Then type a ^X 1 when you are finished reading it. % ESC-? or ESC-x apropos Type in a keyword and EMACS will list all the functions containing that keyword. For some functions it will also list a one or two character command which has the same effect. >> Type ESC-? file. You will see a list of all functions (ESC-x commands) with "file" in their names. You will also see commands like ^X ^V and ^X ^S, listed under the corresponding function names. Type a ^X 1 when you are finished reading it. CONCLUSION ---------- Remember, to exit ; prompts for an abbreviation for the word containing the dot. (defun (abbreviate-word w (save-excursion (forward-character) (provide-prefix-argument prefix-argument (backward-word)) (set-mark) (provide-prefix-argument prefix-argument (forward-word)) (setq w (region-to-string))) (define-local-abbrev (get-tty-string (concat ": abbreviate-word \"" w "\" by: ")) w) (novalue) )) The "name of the function" is important for people who aruse ^C. This tutorial is meant to be understandable to all new users, so if you found something unclear, don't sit and blame yourself - complain! You'll probably find that if you use EMACS for a few days you won't be able to give it up. Initially it may give you trouble. But remember that this is the case with any editor, especially one that can do many, many things. An EMACS can do practically everything. to screenful is useful, but how do you reposition yourself within a given screen to a specific placeSa TL91abbrev.mo/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;o"zH_ / L;/emacs/maclibtutorial.txtRdefun:abbreviate-wordw<save-excursion$forward-characterlprovide-prefix-argument"prefix-argument  backward-wordset-mark,|  forward-wordBsetq$region-to-stringdefine-local-abbrevget-tty-string`concat&` L90abbrev.ml/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;l"z: abbreviate-word "," by:  novaluethe command character. Multi-character commands such as ^X ^C and ESC-v are also allowed after ESC-x describe-key. Here are some other useful commands:u ESC-x describe-command Describe a command. You type in the name of the function. To see your whole file again when it is done, type a ^X 1. >> Try typing ESC-x describe-command replace-string. Then type a ^X 1 when you are finished reading it. &,b -L91auto-arg.ml/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;l"zk L91auto-arg.mo/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;o"z; Numbers and the hyphen are automatically interpreted as prefix ; arguments. You can avoid this by prefixing them with a CTRL-Q. (declare-global is-neg) (setq is-neg 0) (defun (neg-arg (setq is-neg 1) (message "Arg: -") (return-prefix-argument 0) )) (defun (auto-arg-insert (if prefix-argument-provided (insert-string prefix-argument)) (self-insert) )) (defun (n-digit n (if (! prefix-argument-provided) (setq is-neg 0)) (<declare-globalis-neg&setqdefunneg-arg4messageArg: -2return-prefix-argumentXauto-arg-insertif,prefix-argument-providedB insert-string"prefix-argument self-insertn-digitif is-neg (setq n (- (* (if prefix-argument-provided prefix-argument 0) 10) (% (last-key-struck) 16))) (setq n (+ (* (if prefix-argument-provided prefix-argument 0) 10) (% (last-key-struck) 16))) ) (message (concat "Arg: " n)) (return-prefix-argument n) )) (progn i (setq i ' ') (while (< i 0177) (bind-to-key "auto-arg-insert" i) (setq i (+ i 1))) (setq i '0') (while (<= i '9') (bind-to-key "n-digit" i) (setq i n4.!*-6* >%"last-key-struck\`P+(p4D ~>p8concatArg:  f|Fprogni while"<(+ i 1))) (bind-to-key "neg-arg" "-") ) and EMACS will list all the functions containing that keyword. For some functions it will also list a one or two character command which has the same effect. >> Type ESC-? file. You will see a list of all functions (ESC-x commands) with "file" in their names. You will also see commands like ^X ^V and ^X ^S, listed under the corresponding function names. Type a ^X 1 when you are finished reading it. CONCLUSION ---------- Remember, to exit * bind-to-key~ rfR0\l$<=(9|T JJ >> Type ESC-? file. You will see a list of all functions (ESC-x commands) with "file" in their names. You will also see commands like ^X ^V and ^X ^S, listed under the corresponding function names. Type a ^X 1 when you are finished reading it. CONCLUSION ---------- Remember, to exit &Qd RL92block-comm.ml/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;l"ze L92block-comm.mo/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;o"z(defun (begin-block-comment (beginning-of-line) (insert-string "\n/**************************************************************************\n") (setq right-margin 77) (setq left-margin 1) ) (end-block-comment (if (! (bolp)) (newline)) (insert-string "**************************************************************************/\n") ) (justify-block-comment (save-excursion (search-reverse "/*****") (end-of-line) (newline) (forward-character) (set-ma4defun6begin-block-comment$beginning-of-line insert-string`M /************************************************************************** @setq  right-marginM, left-marginend-block-comment\if,!bolpnewlinef`L************************rk) (search-forward "******/") (beginning-of-line) (backward-character) (newline) (backward-character) (backward-character) (justify-paragraph) (search-reverse "/*****") (end-of-line) (delete-next-character) (search-forward "******/") (beginning-of-line) (delete-previous-character) ) ) ) (local-bind-to-key "begin-block-comment" "\e{") (local-bind-to-key "end-block-comment" "\e}") (local-bind-to-**************************************************/ justify-block-commentsave-excursion<search-reverse/***** end-of-line$forward-characterset-mark<search-forward******/&backward-character2$justify-paragraph (delete-next-character ,key "justify-block-comment" "\ej") (setq prefix-string "block comment") (novalue) R0\l$<=(9|T JJ >> Type ESC-? file. You will see a list of all functions (ESC-x commands) with "file" in their names. You will also see commands like ^X ^V and ^X ^S, listed under the corresponding function names. Type a ^X 1 when you are finished reading it. CONCLUSION ---------- Remember, to exit H@,delete-previous-character@local-bind-to-key{"}"jF.  prefix-string  block commentnovalue commands) with "file" in their names. You will also see commands like ^X ^V and ^X ^S, listed under the corresponding function names. Type a ^X 1 when you are finished reading it. CONCLUSION ---------- Remember, to exit '5f 6L93buff.ml/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;l"z (list-buffers) ; generate buffer listings (temp-use-buffer "Buffer list") (beginning-of-file) (kill-to-end-of-line) ; for loops needed!!!! (kill-to-end-of-line) (kill-to-end-of-line) (kill-to-end-of-line) (beginning-of-file) ; Flag all the modified buffers... (while (! (eobp)) (beginning-of-line) ; back to top of buffer (while (! (= 15 (current-column))) (forward-character)) (if (= (following-char) 'M') (progn (delete-next-charact; This code written at CMU, on or about Sun Jan 25 07:32:39 1981 ; by Doug Philips. ; ; Modified: ; 10-Sept-81 Jeffrey Mogul @ Stanford ; - now self-contained (no external functions needed) ; ; Mlisp code for doing a one-line buffer listing in the mini-buffer. ; If buffer list is longer than one line, it will print a line at a time ; and wait for a character to be input before moving on to the next line... ; Note: buffers that have been changed since they were last saved are ; prefixed with an Asterisk(*).er) (forward-character) (insert-character '*'))) (next-line)) (beginning-of-file) ; eliminate Non-file(Scratch?) buffers... (while (! (error-occurred (search-forward " Scr "))) (beginning-of-line) (kill-to-end-of-line) (kill-to-end-of-line) ) (beginning-of-file) ; start at top again (while (! (eobp)) ; and wipe out the first - (setq empty (is-zero?)) ; (remember if buffer is empty) (beginning-of-line) (delete-white-space) ; - two columns of.. and buffers that have no file associated ; with them are prefixed with a hash-mark(#) and empty buffers are flagged ; with a AtSign(@). ; Note: "load"ing this file binds 'one-line-buffer-list' to ^X^B. ; Note: since buffers with no file associated with them are considered ; scratch buffers, the hashmark (#) never is used, and new buffers not ; yet associated with files are invisible. (defun (first-non-blank ; a useful function (beginning-of-line) (while (| (= (following-cha the buffer (delete-next-word) ; listing which are the size (delete-white-space) ; and type columns... (delete-next-word) (delete-white-space) (if empty (progn (beginning-of-line) (insert-string "@") (beginning-of-line) ) ) (next-line) ) (beginning-of-file) ; back at the beginning again ; Flag all the unnamed buffers... (while (! (error-occurred (search-forward "[none]"))) (beginning-of-line) (insert-character '#') (next-lir) 32) ; space (= (following-char) 9)) ; tab (forward-character) ) (current-column) ; returned for convenience ) (skip-forward-matching char ; originally in electric-lisp (setq char (following-char)) (forward-character) (while (!= (following-char) char) (forward-character) ) (forward-character) ) (one-line-buffer-list msg puw empty (setq puw pop-up-windows) ; save value for later (setq pop-up-windows 0) ; re-use current window. (save-excursion ne) ) (beginning-of-file) ; back to the top! (while (! (eobp)) ; hack out all but buffer name (while (& (!= (following-char) ' '); space or (!= (following-char) 9)); tab! (forward-character) ) (kill-to-end-of-line) (next-line) (beginning-of-line) ) (end-of-file) (delete-previous-character) ; kill trailing crlf (beginning-of-file) ; go back and change (error-occurred (replace-string "\n" ", ")) ; newlines to /, /s (beginning-'of-file) (set-mark) (end-of-file) ; suck in buffer contents (setq msg (concat "Buffers: " (region-to-string))) ) (setq pop-up-windows puw) ; restore to previous value (if (> (length msg) 76) ; attempt to get string on one (setq msg (substr msg 10 -9)); line ) (while (> (length msg) 76) ; multi-line mode (message (concat (substr msg 1 76) "$")); print nth line (setq msg (substr msg 77 10000000)); hack it off, and (get-tty-character) ; wait for more puwempty.:"pop-up-windows jsave-excursion  list-buffers@temp-use-buffer Buffer list$beginning-of-file&kill-to-end-of-line,!eobp&`6ifMrprogn( ) (message msg) ; print out final line ) (is-zero? (first-non-blank) (if (= (following-char) '0') (progn (forward-character) (if (| (= (following-char) 32) (= (following-char) 9)) 1 0 ) ) 0 ) ) ) (bind-to-key "one-line-buffer-list" "\^X\^B") (novalue) he file, and ESC-> (Escape Greater-than), which moves to the end of the file. You probably don't need to try them, since finding this spot again will be boring. If you need the shift key to type a "<", delete-next-character,insert-character* next-line|d^error-occurred<search-forward Scr f:4 r ft(dis-zero?&delete-white-space$delete-next-wordR(FF4 insert-string@frLx,l&  g  L94buff.mo/emacs/maclibRRR .dRSSS,<.dS<TTT\l.dTUUߌ;o"z[none]"# l& (H<&.4   P end-of-file,delete-previous-characterRLreplace-string , set-mark@ftZconcat Buffers: $region-to-string^~< defun first-non-blank$beginning-of-linewhilef|>="following-char  $forward-character"current-columnskip-forward-matchingchar$setq"Z."!=,&pone-line-buffer-listmsg> lengthL<:0substr  rLPmessage6>L$(XM$get-tty-character h~rxLZ0PDR. .   : bind-to-keynova