This is Info file ../info/emacs, produced by Makeinfo-1.49 from the input file emacs.texi. This file documents the GNU Emacs editor. Copyright (C) 1985, 1986, 1988, 1992 Richard M. Stallman. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled "The GNU Manifesto", "Distribution" and "GNU General Public License" are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that the sections entitled "The GNU Manifesto", "Distribution" and "GNU General Public License" may be included in a translation approved by the author instead of in the original English. File: emacs, Node: Init Examples, Next: Terminal Init, Prev: Init Syntax, Up: Init File Init File Examples ------------------ Here are some examples of doing certain commonly desired things with Lisp expressions: * Make TAB in C mode just insert a tab if point is in the middle of a line. (setq c-tab-always-indent nil) Here we have a variable whose value is normally `t' for `true' and the alternative is `nil' for `false'. * Make searches case sensitive by default (in all buffers that do not override this). (setq-default case-fold-search nil) This sets the default value, which is effective in all buffers that do not have local values for the variable. Setting `case-fold-search' with `setq' affects only the current buffer's local value, which is not what you probably want to do in an init file. * Make Text mode the default mode for new buffers. (setq default-major-mode 'text-mode) Note that `text-mode' is used because it is the command for entering the mode we want. A single-quote is written before it to make a symbol constant; otherwise, `text-mode' would be treated as a variable name. * Turn on Auto Fill mode automatically in Text mode and related modes. (setq text-mode-hook '(lambda () (auto-fill-mode 1))) Here we have a variable whose value should be a Lisp function. The function we supply is a list starting with `lambda', and a single quote is written in front of it to make it (for the purpose of this `setq') a list constant rather than an expression. Lisp functions are not explained here, but for mode hooks it is enough to know that `(auto-fill-mode 1)' is an expression that will be executed when Text mode is entered, and you could replace it with any other expression that you like, or with several expressions in a row. (setq text-mode-hook 'turn-on-auto-fill) This is another way to accomplish the same result. `turn-on-auto-fill' is a symbol whose function definition is `(lambda () (auto-fill-mode 1))'. * Load the installed Lisp library named `foo' (actually a file `foo.elc' or `foo.el' in a standard Emacs directory). (load "foo") When the argument to `load' is a relative pathname, not starting with `/' or `~', `load' searches the directories in `load-path' (*note Loading::.). * Load the compiled Lisp file `foo.elc' from your home directory. (load "~/foo.elc") Here an absolute file name is used, so no searching is done. * Rebind the key `C-x l' to run the function `make-symbolic-link'. (global-set-key "\C-xl" 'make-symbolic-link) or (define-key global-map "\C-xl" 'make-symbolic-link) Note once again the single-quote used to refer to the symbol `make-symbolic-link' instead of its value as a variable. * Do the same thing for C mode only. (define-key c-mode-map "\C-xl" 'make-symbolic-link) * Redefine all keys which now run `next-line' in Fundamental mode so that they run `forward-line' instead. (substitute-key-definition 'next-line 'forward-line global-map) * Make `C-x C-v' undefined. (global-unset-key "\C-x\C-v") One reason to undefine a key is so that you can make it a prefix. Simply defining `C-x C-v ANYTHING' would make `C-x C-v' a prefix, but `C-x C-v' must be freed of any non-prefix definition first. * Make `$' have the syntax of punctuation in Text mode. Note the use of a character constant for `$'. (modify-syntax-entry ?\$ "." text-mode-syntax-table) * Enable the use of the command `eval-expression' without confirmation. (put 'eval-expression 'disabled nil) File: emacs, Node: Terminal Init, Next: Debugging Init, Prev: Init Examples, Up: Init File Terminal-specific Initialization -------------------------------- Each terminal type can have a Lisp library to be loaded into Emacs when it is run on that type of terminal. For a terminal type named TERMTYPE, the library is called `term/TERMTYPE' and it is found by searching the directories `load-path' as usual and trying the suffixes `.elc' and `.el'. Normally it appears in the subdirectory `term' of the directory where most Emacs libraries are kept. The usual purpose of the terminal-specific library is to define the escape sequences used by the terminal's function keys using the library `keypad.el'. See the file `term/vt100.el' for an example of how this is done. When the terminal type contains a hyphen, only the part of the name before the first hyphen is significant in choosing the library name. Thus, terminal types `aaa-48' and `aaa-30-rv' both use the library `term/aaa'. The code in the library can use `(getenv "TERM")' to find the full terminal type name. The library's name is constructed by concatenating the value of the variable `term-file-prefix' and the terminal type. Your `.emacs' file can prevent the loading of the terminal-specific library by setting `term-file-prefix' to `nil'. The value of the variable `term-setup-hook', if not `nil', is called as a function of no arguments at the end of Emacs initialization, after both your `.emacs' file and any terminal-specific library have been read in. You can set the value in the `.emacs' file to override part of any of the terminal-specific libraries and to define initializations for terminals that do not have a library. File: emacs, Node: Debugging Init, Prev: Terminal Init, Up: Init File Debugging Your `.emacs' File ---------------------------- Ordinarily, Emacs traps errors that occur while reading `.emacs'. This is convenient, most of the time, because it means you can still get an Emacs in which you can edit. But it causes inconvenience because there is no way to enter the debugger if there is an error. But you can run the `.emacs' file explicitly in an Emacs that is already set up, and debug errors at that time. M-x set-variable debug-on-error t M-x load-file ~/.emacs In Emacs 19, use the `-debug-init' option if you want errors in `.emacs' to enter the debugger. File: emacs, Node: Quitting, Next: Lossage, Prev: Customization, Up: Top Quitting and Aborting ===================== `C-g' Quit. Cancel running or partially typed command. `C-]' Abort innermost recursive editing level and cancel the command which invoked it (`abort-recursive-edit'). `M-x top-level' Abort all recursive editing levels that are currently executing. `C-x u' Cancel an already-executed command, usually (`undo'). There are two ways of cancelling commands which are not finished executing: "quitting" with `C-g', and "aborting" with `C-]' or `M-x top-level'. Quitting is cancelling a partially typed command or one which is already running. Aborting is getting out of a recursive editing level and cancelling the command that invoked the recursive edit. Quitting with `C-g' is used for getting rid of a partially typed command, or a numeric argument that you don't want. It also stops a running command in the middle in a relatively safe way, so you can use it if you accidentally give a command which takes a long time. In particular, it is safe to quit out of killing; either your text will ALL still be there, or it will ALL be in the kill ring (or maybe both). Quitting an incremental search does special things documented under searching; in general, it may take two successive `C-g' characters to get out of a search. `C-g' works by setting the variable `quit-flag' to `t' the instant `C-g' is typed; Emacs Lisp checks this variable frequently and quits if it is non-`nil'. `C-g' is only actually executed as a command if it is typed while Emacs is waiting for input. If you quit twice in a row before the first `C-g' is recognized, you activate the "emergency escape" feature and return to the shell. *Note Emergency Escape::. Aborting with `C-]' (`abort-recursive-edit') is used to get out of a recursive editing level and cancel the command which invoked it. Quitting with `C-g' does not do this, and could not do this, because it is used to cancel a partially typed command within the recursive editing level. Both operations are useful. For example, if you are in the Emacs debugger (*note Lisp Debug::.) and have typed `C-u 8' to enter a numeric argument, you can cancel that argument with `C-g' and remain in the debugger. The command `M-x top-level' is equivalent to "enough" `C-]' commands to get you out of all the levels of recursive edits that you are in. `C-]' gets you out one level at a time, but `M-x top-level' goes out all levels at once. Both `C-]' and `M-x top-level' are like all other commands, and unlike `C-g', in that they are effective only when Emacs is ready for a command. `C-]' is an ordinary key and has its meaning only because of its binding in the keymap. *Note Recursive Edit::. `C-x u' (`undo') is not strictly speaking a way of cancelling a command, but you can think of it as cancelling a command already finished executing. *Note Undo::. File: emacs, Node: Lossage, Next: Bugs, Prev: Quitting, Up: Top Dealing with Emacs Trouble ========================== This section describes various conditions in which Emacs fails to work, and how to recognize them and correct them. * Menu: * Stuck Recursive:: `[...]' in mode line around the parentheses * Screen Garbled:: Garbage on the screen * Text Garbled:: Garbage in the text * Unasked-for Search:: Spontaneous entry to incremental search * Emergency Escape:: Emergency escape-- What to do if Emacs stops responding * Total Frustration:: When you are at your wits' end. File: emacs, Node: Stuck Recursive, Next: Screen Garbled, Prev: Lossage, Up: Lossage Recursive Editing Levels ------------------------ Recursive editing levels are important and useful features of Emacs, but they can seem like malfunctions to the user who does not understand them. If the mode line has square brackets `[...]' around the parentheses that contain the names of the major and minor modes, you have entered a recursive editing level. If you did not do this on purpose, or if you don't understand what that means, you should just get out of the recursive editing level. To do so, type `M-x top-level'. This is called getting back to top level. *Note Recursive Edit::. File: emacs, Node: Screen Garbled, Next: Text Garbled, Prev: Stuck Recursive, Up: Lossage Garbage on the Screen --------------------- If the data on the screen looks wrong, the first thing to do is see whether the text is really wrong. Type `C-l', to redisplay the entire screen. If it appears correct after this, the problem was entirely in the previous screen update. Display updating problems often result from an incorrect termcap entry for the terminal you are using. The file `etc/TERMS' in the Emacs distribution gives the fixes for known problems of this sort. `INSTALL' contains general advice for these problems in one of its sections. Very likely there is simply insufficient padding for certain display operations. To investigate the possibility that you have this sort of problem, try Emacs on another terminal made by a different manufacturer. If problems happen frequently on one kind of terminal but not another kind, it is likely to be a bad termcap entry, though it could also be due to a bug in Emacs that appears for terminals that have or that lack specific features. File: emacs, Node: Text Garbled, Next: Unasked-for Search, Prev: Screen Garbled, Up: Lossage Garbage in the Text ------------------- If `C-l' shows that the text is wrong, try undoing the changes to it using `C-x u' until it gets back to a state you consider correct. Also try `C-h l' to find out what command you typed to produce the observed results. If a large portion of text appears to be missing at the beginning or end of the buffer, check for the word `Narrow' in the mode line. If it appears, the text is still present, but marked off-limits. To make it visible again, type `C-x w'. *Note Narrowing::. File: emacs, Node: Unasked-for Search, Next: Emergency Escape, Prev: Text Garbled, Up: Lossage Spontaneous Entry to Incremental Search --------------------------------------- If Emacs spontaneously displays `I-search:' at the bottom of the screen, it means that the terminal is sending `C-s' and `C-q' according to the poorly designed `xon/xoff' "flow control" protocol. You should try to prevent this by putting the terminal in a mode where it will not use flow control or giving it enough padding that it will never send a `C-s'. If that cannot be done, you must tell Emacs to expect flow control to be used, until you can get a properly designed terminal. Information on how to do these things can be found in the file `INSTALL' in the Emacs distribution. File: emacs, Node: Emergency Escape, Next: Total Frustration, Prev: Unasked-for Search, Up: Lossage Emergency Escape ---------------- Because at times there have been bugs causing Emacs to loop without checking `quit-flag', a special feature causes Emacs to be suspended immediately if you type a second `C-g' while the flag is already set, so you can always get out of GNU Emacs. Normally Emacs recognizes and clears `quit-flag' (and quits!) quickly enough to prevent this from happening. When you resume Emacs after a suspension caused by multiple `C-g', it asks two questions before going back to what it had been doing: Auto-save? (y or n) Abort (and dump core)? (y or n) Answer each one with `y' or `n' followed by RET. Saying `y' to `Auto-save?' causes immediate auto-saving of all modified buffers in which auto-saving is enabled. Saying `y' to `Abort (and dump core)?' causes an illegal instruction to be executed, dumping core. This is to enable a wizard to figure out why Emacs was failing to quit in the first place. Execution does not continue after a core dump. If you answer `n', execution does continue. With luck, GNU Emacs will ultimately check `quit-flag' and quit normally. If not, and you type another `C-g', it is suspended again. If Emacs is not really hung, just slow, you may invoke the double `C-g' feature without really meaning to. Then just resume and answer `n' to both questions, and you will arrive at your former state. Presumably the quit you requested will happen soon. The double-`C-g' feature may be turned off when Emacs is running under a window system, since the window system always enables you to kill Emacs or to create another window and run another program. File: emacs, Node: Total Frustration, Prev: Emergency Escape, Up: Lossage Help for Total Frustration -------------------------- If using Emacs (or something else) becomes terribly frustrating and none of the techniques described above solve the problem, Emacs can still help you. First, if the Emacs you are using is not responding to commands, type `C-g C-g' to get out of it and then start a new one. Second, type `M-x doctor RET'. The doctor will make you feel better. Each time you say something to the doctor, you must end it by typing RET RET. This lets the doctor know you are finished. File: emacs, Node: Bugs, Next: Version 19, Prev: Lossage, Up: Top Reporting Bugs ============== Sometimes you will encounter a bug in Emacs. Although we cannot promise we can or will fix the bug, and we might not even agree that it is a bug, we want to hear about bugs you encounter in case we do want to fix them. To make it possible for us to fix a bug, you must report it. In order to do so effectively, you must know when and how to do it. When Is There a Bug ------------------- If Emacs executes an illegal instruction, or dies with an operating system error message that indicates a problem in the program (as opposed to something like "disk full"), then it is certainly a bug. If Emacs updates the display in a way that does not correspond to what is in the buffer, then it is certainly a bug. If a command seems to do the wrong thing but the problem corrects itself if you type `C-l', it is a case of incorrect display updating. Taking forever to complete a command can be a bug, but you must make certain that it was really Emacs's fault. Some commands simply take a long time. Type `C-g' and then `C-h l' to see whether the input Emacs received was what you intended to type; if the input was such that you KNOW it should have been processed quickly, report a bug. If you don't know whether the command should take a long time, find out by looking in the manual or by asking for assistance. If a command you are familiar with causes an Emacs error message in a case where its usual definition ought to be reasonable, it is probably a If a command does the wrong thing, that is a bug. But be sure you know for certain what it ought to have done. If you aren't familiar with the command, or don't know for certain how the command is supposed to work, then it might actually be working right. Rather than jumping to conclusions, show the problem to someone who knows for certain. Finally, a command's intended definition may not be best for editing with. This is a very important sort of problem, but it is also a matter of judgment. Also, it is easy to come to such a conclusion out of ignorance of some of the existing features. It is probably best not to complain about such a problem until you have checked the documentation in the usual ways, feel confident that you understand it, and know for certain that what you want is not available. If you are not sure what the command is supposed to do after a careful reading of the manual, check the index and glossary for any terms that may be unclear. If you still do not understand, this indicates a bug in the manual. The manual's job is to make everything clear. It is just as important to report documentation bugs as program bugs. If the on-line documentation string of a function or variable disagrees with the manual, one of them must be wrong, so report the bug. How to Report a Bug ------------------- When you decide that there is a bug, it is important to report it and to report it in a way which is useful. What is most useful is an exact description of what commands you type, starting with the shell command to run Emacs, until the problem happens. Always include the version number of Emacs that you are using; type `M-x emacs-version' to print this. The most important principle in reporting a bug is to report FACTS, not hypotheses or categorizations. It is always easier to report the facts, but people seem to prefer to strain to posit explanations and report them instead. If the explanations are based on guesses about how Emacs is implemented, they will be useless; we will have to try to figure out what the facts must have been to lead to such speculations. Sometimes this is impossible. But in any case, it is unnecessary work for us. For example, suppose that you type `C-x C-f /glorp/baz.ugh RET', visiting a file which (you know) happens to be rather large, and Emacs prints out `I feel pretty today'. The best way to report the bug is with a sentence like the preceding one, because it gives all the facts and nothing but the facts. Do not assume that the problem is due to the size of the file and say, "When I visit a large file, Emacs prints out `I feel pretty today'." This is what we mean by "guessing explanations". The problem is just as likely to be due to the fact that there is a `z' in the file name. If this is so, then when we got your report, we would try out the problem with some "large file", probably with no `z' in its name, and not find anything wrong. There is no way in the world that we could guess that we should try visiting a file with a `z' in its name. Alternatively, the problem might be due to the fact that the file starts with exactly 25 spaces. For this reason, you should make sure that you inform us of the exact contents of any file that is needed to reproduce the bug. What if the problem only occurs when you have typed the `C-x C-a' command previously? This is why we ask you to give the exact sequence of characters you typed since starting to use Emacs. You should not even say "visit a file" instead of `C-x C-f' unless you know that it makes no difference which visiting command is used. Similarly, rather than saying "if I have three characters on the line," say "after I type `RET A B C' RET C-p," if that is the way you entered the text. If you are not in Fundamental mode when the problem occurs, you should say what mode you are in. If the manifestation of the bug is an Emacs error message, it is important to report not just the text of the error message but a backtrace showing how the Lisp program in Emacs arrived at the error. To make the backtrace, you must execute the Lisp expression `(setq debug-on-error t)' before the error happens (that is to say, you must execute that expression and then make the bug happen). This causes the Lisp debugger to run (*note Lisp Debug::.). The debugger's backtrace can be copied as text into the bug report. This use of the debugger is possible only if you know how to make the bug happen again. Do note the error message the first time the bug happens, so if you can't make it happen again, you can report at least that. Check whether any programs you have loaded into the Lisp world, including your `.emacs' file, set any variables that may affect the functioning of Emacs. Also, see whether the problem happens in a freshly started Emacs without loading your `.emacs' file (start Emacs with the `-q' switch to prevent loading the init file.) If the problem does NOT occur then, it is essential that we know the contents of any programs that you must load into the Lisp world in order to cause the problem to occur. If the problem does depend on an init file or other Lisp programs that are not part of the standard Emacs system, then you should make sure it is not a bug in those programs by complaining to their maintainers first. After they verify that they are using Emacs in a way that is supposed to work, they should report the bug. If you can tell us a way to cause the problem without visiting any files, please do so. This makes it much easier to debug. If you do need files, make sure you arrange for us to see their exact contents. For example, it can often matter whether there are spaces at the ends of lines, or a newline after the last line in the buffer (nothing ought to care whether the last line is terminated, but tell that to the bugs). The easy way to record the input to Emacs precisely is to write a dribble file; execute the Lisp expression (open-dribble-file "~/dribble") using `Meta-ESC' or from the `*scratch*' buffer just after starting Emacs. From then on, all Emacs input will be written in the specified dribble file until the Emacs process is killed. For possible display bugs, it is important to report the terminal type (the value of environment variable `TERM'), the complete termcap entry for the terminal from `/etc/termcap' (since that file is not identical on all machines), and the output that Emacs actually sent to the terminal. The way to collect this output is to execute the Lisp expression (open-termscript "~/termscript") using `Meta-ESC' or from the `*scratch*' buffer just after starting Emacs. From then on, all output from Emacs to the terminal will be written in the specified termscript file as well, until the Emacs process is killed. If the problem happens when Emacs starts up, put this expression into your `.emacs' file so that the termscript file will be open when Emacs displays the screen for the first time. Be warned: it is often difficult, and sometimes impossible, to fix a terminal-dependent bug without access to a terminal of the type that stimulates the bug. The address for reporting bugs is GNU Emacs Bugs Free Software Foundation 675 Mass Ave Cambridge, MA 02139 or send email either to `bug-gnu-emacs@prep.ai.mit.edu' (Internet) or to `uunet!prep.ai.mit.edu!bug-gnu-emacs' (Usenet). Once again, we do not promise to fix the bug; but if the bug is serious, or ugly, or easy to fix, chances are we will want to. File: emacs, Node: Version 19, Next: Manifesto, Prev: Bugs, Up: Top Version 19 Antenews ******************* This chapter prematurely describes new features of Emacs 19, in anticipation of its release. We have included this so that the version 18 manuals don't become obsolete as soon as Emacs 19 comes out. This list mentions only features that would belong in `The GNU Emacs Manual'; changes relevant to Emacs Lisp programming will be documented in the next revision of `The GNU Emacs Lisp Manual'. * Menu: * Basic Changes:: Changes every user must know. * New Facilities:: Changes every user will want to know. * Binding Changes:: Ordinary commands that have been moved. Important!. * Changed Commands:: Ordinary commands that have new features. Important! * M-x Changes:: Changes in commands you run with `M-x'. Important! * New Commands:: Commands that have been added that we expect many users to want to use. * Search Changes:: Changes in incremental search. Some are important. The rest of the changes you can pretty much ignore unless you are interested. * Filling Changes:: Changes in fill commands. * TeX Mode Changes:: Changes in the commands for editing TeX files and running TeX. * Shell Changes:: Major changes in all the modes that run subprograms. * Spell Changes:: These commands now use ispell instead of spell. * Tags Changes:: Changes in Tags facility. * Mail Changes:: Changes in both Sendmail mode and Rmail mode. * Info Changes:: New commands in Info. * Dired Changes:: Powerful new features in Dired. * GNUS:: An alternative news reader. * Calendar/Diary:: The calendar feature now lets you move to different dates and convert to and from other calendars. You can also display related entries from your diary file. * Version Control:: A convenient interface to RCS or SCCS. * Emerge:: A new feature for merging files interactively. * Debuggers:: Running debuggers (GDB, DBX, SDB) under Emacs. * Other New Modes:: Miscellaneous new and changed major modes. * Key Sequence Changes:: You can now bind key sequences that include function keys and mouse clicks. * Hook Changes:: Hook variables have been renamed more systematically. File: emacs, Node: Basic Changes, Next: New Facilities, Up: Version 19 Basic Changes ============= We have made changes to help Emacs use fewer resources and make it less likely to become irreparably hung. While these changes don't alter the commands of Emacs, they are important enough to be worth mentioning. You can quit with `C-g' while Emacs is waiting to read or write a file--provided the operating system will allow you to interrupt the system call that is hung. (Unfortunately, most NFS implementations won't allow interruption.) When you kill buffers, Emacs now returns memory to the operating system, thus reducing the size of the Emacs process. The space that you free up by killing buffers can now be reused for other buffers no matter what their sizes, or reused by other processes if Emacs doesn't need it. Multiple X Windows ------------------ When using X windows, you can now create more than one window at the X level. Each X window displays a "frame" which can contain one or several Emacs windows. Each frame has its own echo area and normally its own minibuffer. (To avoid confusion, we reserve the word "window" for the subdivisions that Emacs implements, and never use it to refer to a frame.) The easiest way to create additional frames is with the `C-x 5' prefix character (*note New Everyday Commands: New Commands.). Emacs windows can now have scroll bars; use the `scroll-bar-mode' command to turn scroll bars on or off. With no argument, it toggles the use of scroll bars. With an argument, it turns use of scroll bars on if and only if the argument is positive. This command applies to all frames, including frames yet to be created. (You can control scroll bars on a frame by frame basis by writing a Lisp program.) Undo Improvements ----------------- Undoing a deletion now puts the cursor position where it was just before the deletion. Auto Save Improvements ---------------------- Emacs now does garbage collection and auto saving while it is waiting for input, which often avoids the need to do these things while you are typing. The variable `auto-save-timeout' says how many seconds Emacs should wait, after you stop typing, before it does an auto save and perhaps also a garbage collection. (The actual time period varies also according to the size of the buffer--longer for longer buffers, since auto saving itself is slower for long buffers.) This way, Emacs does not interrupt or delay your typing. In Emacs 18, when auto saving detects that a buffer has shrunk greatly, it refrains from auto saving that buffer and displays a warning. In version 19, it also turns off Auto Save mode in that buffer, so that you won't get the same warning repeatedly. If you reenable Auto Save mode in that buffer, Emacs will start saving it again despite the shrinkage. In Emacs 19, `revert-buffer' no longer offers to revert from the latest auto-save file. That option hasn't been very useful since the change to keep more undo information. The command `recover-file' no longer turns off Auto Save mode. File Local Variables -------------------- The user option for controlling whether files can set local variables is called `enable-local-variables' in Emacs 19, rather than `inhibit-local-variables'. A value of `t' means local-variables lists are obeyed; `nil' means they are ignored; anything else means query the user. File: emacs, Node: New Facilities, Next: Binding Changes, Prev: Basic Changes, Up: Version 19 New Basic Facilities ==================== You can now get back recent minibuffer inputs conveniently. While in the minibuffer, type `M-p' (`previous-history-element') to fetch the next earlier minibuffer input, and use `M-n' (`next-history-element') to fetch the next later input. There are also commands to search forward or backward through the history. As of this writing, they search for history elements that match a regular expression that you specify with the minibuffer. `M-r' (`previous-matching-history-element') searches older elements in the history, while `M-s' (`next-matching-history-element') searches newer elements. By special dispensation, these commands can always use the minibuffer to read their arguments even though you are already in the minibuffer when you issue them. We may have changed the precise way these commands work by the time you use Emacs 19. Perhaps they will search for a match for the string given so far in the minibuffer; perhaps they will search for a literal match rather than a regular expression match; perhaps they will only accept matches at the beginning of a history element; perhaps they will read the string to search for incrementally like `C-s'. We want to choose an interface that is convenient, flexible and natural, and these goals are somewhat contradictory. To find out what interface is actually available, type `C-h f previous-matching-history-element'. The history feature is available for all uses of the minibuffer, but there are separate history lists for different kinds of input. For example, there is a list for file names, used by all the commands that read file names. There is a list for arguments of commands like `query-replace'. There are also very specific history lists, such as the one that `compile' uses for compilation commands. Remote File Access ------------------ You can refer to files on other machines using a special file name syntax: /HOST:FILENAME /USER@HOST:FILENAME When you do this, Emacs uses the FTP program to read and write files on the specified host. It logs in through FTP using your user name or the name USER. It may ask you for a password from time to time; this is used for logging in on HOST. Using Flow Control ------------------ There is now a convenient way to enable flow control when your terminal or your connection won't work without it. Suppose you want to do this on VT-100 and H19 terminals; put the following in your `.emacs' file: (evade-flow-control-on "vt100" "h19") When flow control is enabled, you must type `C-\' to get the effect of a `C-s', and type `C-^' to get the effect of a `C-q'. Controlling Backup File Names ----------------------------- The default setting of the Lisp variable `version-control' now comes from the environment variable `VERSION_CONTROL'. Thus, you can select a style of backup file naming for Emacs and other GNU utilities all together. File: emacs, Node: Binding Changes, Next: Changed Commands, Prev: New Facilities, Up: Version 19 Changed Key Bindings ==================== `M-{' This is the new key sequence for `backward-paragraph'. The old key sequence for this, `M-[', is now undefined by default. The reason for this change is to avoid conflict with the sequences that function keys send on most terminals. `M-}' This is the new key sequence for `forward-paragraph'. The old key sequence for this, `M-]', is now undefined by default. We changed this to go along with `M-{'. `C-x C-u' `C-x C-l' The two commands, `C-x C-u' (`upcase-region') and `C-x C-l' (`downcase-region'), are now disabled by default; these keys seem to be often hit by accident, and can be quite destructive if their effects are not noticed immediately. `C-x 3' `C-x 3' is now the key binding for `split-window-horizontally', which splits a window into two side-by-side windows. This used to be `C-x 5'. ``C-x 4 C-o'' This key now runs `display-buffer', which displays a specified buffer in another window without selecting it. `M-g' `M-g' is now undefined. It used to run the command `fill-region'. This command used to be run more often by mistake than on purpose. `C-x a' `C-x n' `C-x r' Three new prefix keys have been created to make many of the `C-x' commands more systematic: `C-x a', `C-x n' and `C-x r'. `C-x a' is used for abbreviation commands, `C-x n' for commands pertaining to narrowing, and `C-x r' for register and rectangle commands. These are the new bindings, in detail: `C-x a l' `add-mode-abbrev' (previously `C-x C-a'). `C-x a g' `add-global-abbrev' (previously `C-x +'). `C-x a i g' `inverse-add-mode-abbrev' (previously `C-x C-h'). `C-x a i l' `inverse-add-global-abbrev' (previously `C-x -'). `C-x a e' `expand-abbrev' (previously `C-x ''). `C-x n n' `narrow-to-region' (previously `C-x n'). `C-x n p' `narrow-to-page' (previously `C-x p'). `C-x n w' `widen' (previously `C-x w'). `C-x r C-SPC' `point-to-register' (previously `C-x /'). `C-x r SPC' Also `point-to-register' (previously `C-x /'). `C-x r j' `jump-to-register' (previously `C-x j'). `C-x r s' `copy-to-register' (previously `C-x x'). `C-x r i' `insert-register' (previously `C-x g'). `C-x r r' `copy-rectangle-to-register' (previously `C-x r'). `C-x r k' `kill-rectangle' (no previous key binding). `C-x r y' `yank-rectangle' (no previous key binding). `C-x r o' `open-rectangle' (no previous key binding). `C-x r f' `frame-configuration-to-register' (a new command) saves the state of all windows in all frames. Use `C-x r j' to restore the configuration. `C-x r w' `window-configuration-to-register' (a new command) saves the state of all windows in the selected frame. Use `C-x r j' to restore the configuration. The old key bindings `C-x /', `C-x j', `C-x x' and `C-x g' have not yet been removed. The other old key bindings listed have been removed. The old key binding `C-x a', which was `append-to-buffer', was removed to make way for a prefix key; now `append-to-buffer' has no keybinding. `C-x v' `C-x v' is a new prefix character, used for version control commands. *Note Version Control::. File: emacs, Node: Changed Commands, Next: M-x Changes, Prev: Binding Changes, Up: Version 19 Changed Everyday Commands ========================= `C-o' When you have a fill prefix, the command `C-o' inserts the prefix on the newly created line. `M-^' When you have a fill prefix, the command `M-^' deletes the prefix (if it occurs) after the newline that it deletes. `M-z' The `M-z' command (`zap-to-char') now kills through the target character. In version 18, it killed up to but not including the target character. `M-!' The command `M-!' (`shell-command') now runs the specified shell command asynchronously if it ends in `&', just as the shell does. `C-x 2' The `C-x 2' command (`split-window-vertically') now tries to avoid scrolling by putting point in whichever window happens to contain the screen line the cursor is already on. If you don't like this, you can turn it off by setting `split-window-keep-point' to `nil'. `C-x s' The `C-x s' command (`save-some-buffers') now gives you more options when it asks whether to save a particular buffer. The options are analogous to those of `query-replace'. Here they are: `y' Save this buffer and ask about the rest of the buffers. `n' Don't save this buffer, but ask about the rest of the buffers. `!' Save this buffer and all the rest with no more questions. `ESC' Terminate `save-some-buffers' without any more saving. `.' Save only this buffer, then exit `save-some-buffers' without even asking about other buffers. `C-r' View the buffer that you are currently being asked about. When you exit View mode, you get back to `save-some-buffers', which asks the question again. `C-h' Display a help message about these options. `C-x C-v' This command (`find-alternate-file') now inserts the entire current file name in the minibuffer. This is convenient if you made a small mistake in typing it. Point goes after the last slash, before the last file name component, so if you want to replace it entirely, you can use `C-k' right away to delete it. `C-M-f' Expression and list commands such as `C-M-f' now ignore parentheses within comments in Lisp mode. File: emacs, Node: M-x Changes, Next: New Commands, Prev: Changed Commands, Up: Version 19 Changes in Common `M-x' Commands ================================ `M-x make-symbolic-link' This command now does not expand its second argument. This lets you make a link with a target that is a relative file name. `M-x add-change-log-entry' `C-x 4 a' These commands now automatically insert the name of the file and often the name of the function that you changed. They also handle grouping of entries. There is now a special major mode for editing `ChangeLog' files. It makes filling work conveniently. Each bunch of grouped entries is one paragraph, and each collection of entries from one person on one day is considered a page. `M-x compare-windows' With a prefix argument, `compare-windows' ignores changes in whitespace. If the variable `compare-ignore-case' is non-`nil', it ignores differences in case as well. `M-x view-buffer' `M-x view-file' The View commands (such as `M-x view-buffer' and `M-x view-file') no longer use recursive edits; instead, they switch temporarily to a different major mode (View mode) specifically designed for moving around through a buffer without editing it. `M-x manual-entry' `M-x manual-entry' now uses View mode for the buffer showing the man page. `M-x compile' You can repeat any previous `compile' conveniently using the minibuffer history commands, while in the minibuffer entering the compilation command. While a compilation is going on, the string `Compiling' appears in the mode line. When this string disappears, the compilation is finished. The buffer of compiler messages is in Compilation mode. This mode provides the keys SPC and DEL to scroll by screenfuls, and `M-n' and `M-p' to move to the next or previous error message. You can also use `M-{' and `M-}' to move up or down to an error message for a different source file. Use `C-c C-c' on any error message to find the corresponding source code. Emacs 19 has a more general parser for compiler messages. For example, it can understand messages from lint, and from certain C compilers whose error message format is unusual. File: emacs, Node: New Commands, Next: Search Changes, Prev: M-x Changes, Up: Version 19 New Everyday Commands ===================== `C-z' When you are using X windows, `C-z' (`iconify-frame') now iconifies the current frame. `C-M-l' The `C-M-l' command (`reposition-window') scrolls the current window heuristically in a way designed to get useful information onto the screen. For example, in a Lisp file, this command tries to get the entire current defun onto the screen if possible. `C-M-r' The `C-M-r' key now runs the command `isearch-backward-regexp', which does reverse incremental regexp search. `C-x 5' The prefix key `C-x 5' is analogous to `C-x 4', with parallel subcommands. The difference is that `C-x 5' commands create a new frame rather than just a new window. `C-x 5 C-f' `C-x 5 b' These new commands switch to a specified file or buffer in a new frame (when using X windows). The commands' names are `find-file-other-frame' and `switch-to-buffer-other-frame'. `C-x 5 m' Start outgoing mail in another frame (`mail-other-frame'). `C-x 5 .' Find a tag in another frame (`find-tag-other-frame'). `C-x 4 r' This is now `find-file-read-only-other-window'. arrow keys The arrow keys now have default bindings to move in the appropriate directions. `C-h C-f' `C-h C-k' These new help commands enter Info and display the node for a given Emacs function name or key sequence, respectively. `M-a' `M-e' In C mode, `M-a' and `M-e' now move by complete C statements (`c-beginning-of-statement' and `c-end-of-statement'). `M-q' `M-q' in C mode now runs `c-fill-paragraph', which is designed for filling C comments. (We assume you don't want to fill the actual C code in a C program.) `M-x c-up-conditional' In C mode, `c-up-conditional' moves back to the containing preprocessor conditional, setting the mark where point was previously. A prefix argument acts as a repeat count. With a negative argument, this command moves forward to the end of the containing preprocessor conditional. When going backwards, `#elif' acts like `#else' followed by `#if'. When going forwards, `#elif' is ignored. `M-x comment-region' The `comment-region' command adds comment delimiters to the lines that start in the region, thus commenting them out. With a negative argument, it deletes comment delimiters from the lines in the region--this is the inverse of the effect of `comment-region' without an argument. With a positive argument, `comment-region' adds comment delimiters but duplicates the last character of the comment start sequence as many times as the argument specifies. This is a way of calling attention to the comment. In Lisp, you should use an argument of at least two, because the indentation convention for single semicolon comments does not leave them at the beginning of a line. `M-x super-apropos' This command is like `apropos' except that it searches for a regular expression instead of merely a substring. If you use a prefix argument (regardless of its value) with `apropos' or `super-apropos', they also search documentation strings for matches as well as symbol names. The prefix argument also controls looking up and printing the key bindings of all commands. `M-x diff' This new command compares two files, displaying the differences in an Emacs buffer. The options for the `diff' program come from the variable `diff-switches', whose value should be a string. The buffer of differences has Compilation mode as its major mode, so you can use `C-x `' to visit successive changed locations in the two source files, or you can move to a particular hunk of changes and type `C-c C-c' to move to the corresponding source. You can also use the other special commands of Compilation mode: SPC and DEL for scrolling, and `M-p' and `M-n' for cursor motion. `M-x diff-backup' The command `diff-backup' compares a specified file with its most recent backup. If you specify the name of a backup file, `diff-backup' compares it with the source file that it is a backup of. File: emacs, Node: Search Changes, Next: Filling Changes, Prev: New Commands, Up: Version 19 Changes in Incremental Search ============================= The most important change in incremental search is that RET now terminates a search, and ESC does not. The other changes are useful, but not vital to know about. * The character to terminate an incremental search is now RET. This is for compatibility with the way most other arguments are read. To search for a newline in an incremental search, type LFD (also known as `C-j'). (This change is somewhat of an experiment; it might be taken back by the time Emacs 19 is really released.) * Incremental search now maintains a ring of previous search strings. Use `M-p' and `M-n' to move through the ring to pick a search string to reuse. These commands leave the selected search ring element in the minibuffer, where you can edit it. Type RET to finish editing and search for the chosen string. * When there is an upper-case letter in the search string, then the search is case sensitive. * Incremental search is now implemented as a major mode. When you type `C-s', it switches temporarily to a different keymap which defines each key to do what it ought to do for incremental search. This has next to no effect on the user-visible behavior of searching, but makes it easier to customize that behavior. File: emacs, Node: Filling Changes, Next: TeX Mode Changes, Prev: Search Changes, Up: Version 19 Changes in Fill Commands ======================== * `fill-individual-paragraphs' now has two modes. Its default mode is that any change in indentation starts a new paragraph. The alternate mode is that only separator lines separate paragraphs; this can handle paragraphs with extra indentation on the first line. To select the alternate mode, set `fill-individual-varying-indent' to a non-`nil' value. * Filling is now partially controlled by a new minor mode, Adaptive Fill mode. When this mode is enabled (and it is enabled by default), if you use `fill-region-as-paragraph' on an indented paragraph and you don't have a fill prefix, it uses the indentation of the second line of the paragraph as the fill prefix. Adaptive Fill mode doesn't have much effect on `M-q' in most major modes, because an indented line will probably count as a paragraph starter and thus each line of an indented paragraph will be considered a paragraph of its own. * `M-q' in C mode now runs `c-fill-paragraph', which is designed for filling C comments. (We assume you don't want to fill the actual C code in a C program.)