1 This is ../info/xemacs.info, produced by makeinfo version 4.0 from
4 INFO-DIR-SECTION XEmacs Editor
6 * XEmacs: (xemacs). XEmacs Editor.
9 This file documents the XEmacs editor.
11 Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation.
15 Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
19 Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
22 General Public License" are included exactly as in the original, and
23 provided that the entire resulting derived work is distributed under the
24 terms of a permission notice identical to this one.
26 Permission is granted to copy and distribute translations of this
27 manual into another language, under the above conditions for modified
28 versions, except that the sections entitled "The GNU Manifesto",
29 "Distribution" and "GNU General Public License" may be included in a
30 translation approved by the author instead of in the original English.
33 File: xemacs.info, Node: Exiting, Next: Command Switches, Prev: Entering Emacs, Up: Top
38 There are two commands for exiting Emacs because there are two kinds
39 of exiting: "suspending" Emacs and "killing" Emacs. "Suspending" means
40 stopping Emacs temporarily and returning control to its superior
41 (usually the shell), allowing you to resume editing later in the same
42 Emacs job, with the same files, same kill ring, same undo history, and
43 so on. This is the usual way to exit. "Killing" Emacs means
44 destroying the Emacs job. You can run Emacs again later, but you will
45 get a fresh Emacs; there is no way to resume the same editing session
46 after it has been killed.
49 Suspend Emacs (`suspend-emacs'). If used under the X window
50 system, shrink the X window containing the Emacs frame to an icon
54 Kill Emacs (`save-buffers-kill-emacs').
56 If you use XEmacs under the X window system, `C-z' shrinks the X
57 window containing the Emacs frame to an icon. The Emacs process is
58 stopped temporarily, and control is returned to the window manager. If
59 more than one frame is associated with the Emacs process, only the
60 frame from which you used `C-z' is retained. The X windows containing
61 the other Emacs frames are closed.
63 To activate the "suspended" Emacs, use the appropriate window manager
64 mouse gestures. Usually left-clicking on the icon reactivates and
65 reopens the X window containing the Emacs frame, but the window manager
66 you use determines what exactly happens. To actually kill the Emacs
67 process, use `C-x C-c' or the Exit Emacs item on the File menu.
69 On systems that do not permit programs to be suspended, `C-z' runs
70 an inferior shell that communicates directly with the terminal, and
71 Emacs waits until you exit the subshell. On these systems, the only way
72 to return to the shell from which Emacs was started (to log out, for
73 example) is to kill Emacs. `C-d' or `exit' are typical commands to
76 To kill Emacs, type `C-x C-c' (`save-buffers-kill-emacs'). A
77 two-character key is used for this to make it harder to type. In
78 XEmacs, selecting the Exit Emacs option of the File menu is an
79 alternate way of issuing the command.
81 Unless a numeric argument is used, this command first offers to save
82 any modified buffers. If you do not save all buffers, you are asked for
83 reconfirmation with `yes' before killing Emacs, since any changes not
84 saved will be lost. If any subprocesses are still running, `C-x C-c'
85 asks you to confirm killing them, since killing Emacs kills the
86 subprocesses simultaneously.
88 In most programs running on Unix, certain characters may instantly
89 suspend or kill the program. (In Berkeley Unix these characters are
90 normally `C-z' and `C-c'.) This Unix feature is turned off while you
91 are in Emacs. The meanings of `C-z' and `C-x C-c' as keys in Emacs were
92 inspired by the standard Berkeley Unix meanings of `C-z' and `C-c', but
93 that is their only relationship with Unix. You could customize these
94 keys to do anything (*note Keymaps::).
97 File: xemacs.info, Node: Command Switches, Next: Startup Paths, Prev: Exiting, Up: Top
99 Command Line Switches and Arguments
100 ===================================
102 XEmacs supports command line arguments you can use to request
103 various actions when invoking Emacs. The commands are for compatibility
104 with other editors and for sophisticated activities. If you are using
105 XEmacs under the X window system, you can also use a number of standard
106 Xt command line arguments. Command line arguments are not usually
107 needed for editing with Emacs; new users can skip this section.
109 Many editors are designed to be started afresh each time you want to
110 edit. You start the editor to edit one file; then exit the editor. The
111 next time you want to edit either another file or the same one, you
112 start the editor again. Under these circumstances, it makes sense to
113 use a command line argument to say which file to edit.
115 The recommended way to use XEmacs is to start it only once, just
116 after you log in, and do all your editing in the same Emacs process.
117 Each time you want to edit a file, you visit it using the existing
118 Emacs. Emacs creates a new buffer for each file, and (unless you kill
119 some of the buffers) Emacs eventually has many files in it ready for
120 editing. Usually you do not kill the Emacs process until you are about
121 to log out. Since you usually read files by typing commands to Emacs,
122 command line arguments for specifying a file when Emacs is started are
125 Emacs accepts command-line arguments that specify files to visit,
126 functions to call, and other activities and operating modes. If you are
127 running XEmacs under the X window system, a number of standard Xt
128 command line arguments are available as well.
130 The following subsections list:
131 * Command line arguments that you can always use
133 * Command line arguments that have to appear at the beginning of the
136 * Command line arguments that are only relevant if you are running
139 Command Line Arguments for Any Position
140 ---------------------------------------
142 Command line arguments are processed in the order they appear on the
143 command line; however, certain arguments (the ones in the second table)
144 must be at the front of the list if they are used.
146 Here are the arguments allowed:
149 Visit FILE using `find-file'. *Note Visiting::.
152 Visit FILE using `find-file', then go to line number LINENUM in it.
156 Load a file FILE of Lisp code with the function `load'. *Note
161 Call Lisp function FUNCTION with no arguments.
164 Interpret the next argument as a Lisp expression, and evaluate it.
165 You must be very careful of the shell quoting here.
169 Insert the contents of FILE into the current buffer. This is like
170 what `M-x insert-buffer' does; *Note Misc File Ops::.
173 Exit from Emacs without asking for confirmation.
177 Prints version information. This implies `-batch'.
180 XEmacs 19.13 of Mon Aug 21 1995 on willow (usg-unix-v) [formerly Lucid Emacs]
183 Prints a summary of command-line options and then exits.
185 Command Line Arguments (Beginning of Line Only)
186 -----------------------------------------------
188 The following arguments are recognized only at the beginning of the
189 command line. If more than one of them appears, they must appear in the
190 order in which they appear in this table.
193 Use FILE instead of the terminal for input and output. This
194 implies the `-nw' option, documented below.
197 Run Emacs in "batch mode", which means that the text being edited
198 is not displayed and the standard Unix interrupt characters such as
199 `C-z' and `C-c' continue to have their normal effect. Emacs in
200 batch mode outputs to `stderr' only what would normally be printed
201 in the echo area under program control.
203 Batch mode is used for running programs written in Emacs Lisp from
204 shell scripts, makefiles, and so on. Normally the `-l' switch or
205 `-f' switch will be used as well, to invoke a Lisp program to do
206 the batch processing.
208 `-batch' implies `-q' (do not load an init file). It also causes
209 Emacs to kill itself after all command switches have been
210 processed. In addition, auto-saving is not done except in buffers
211 for which it has been explicitly requested.
214 Start up XEmacs in TTY mode (using the TTY XEmacs was started
215 from), rather than trying to connect to an X display. Note that
216 this happens automatically if the `DISPLAY' environment variable
220 Enter the debugger if an error in the init file occurs.
223 Displays information on how XEmacs constructs the various paths
224 into its hierarchy on startup. (See also *note Startup Paths::.)
227 Do not map the initial frame. This is useful if you want to start
228 up XEmacs as a server (e.g. for gnuserv screens or external client
233 Do not load your Emacs init file `~/.emacs'.
236 Do not load the site-specific init file `lisp/site-start.el'.
239 Do not load global symbol files (`auto-autoloads') at startup.
240 This implies `-vanilla'.
243 Do not process early packages. (For more information on startup
244 issues concerning the package system, *Note Startup Paths::.)
247 This is equivalent to `-q -no-site-file -no-early-packages'.
249 `-user-init-file FILE'
250 Load FILE as your Emacs init file instead of `~/.emacs'.
252 `-user-init-directory DIRECTORY'
253 Use DIRECTORY as the location of your early package hierarchies
254 and the various user-specific initialization files.
258 Equivalent to `-user-init-file ~USER/.emacs -user-init-directory
261 Note that the init file can get access to the command line argument
262 values as the elements of a list in the variable `command-line-args'.
263 (The arguments in the second table above will already have been
264 processed and will not be in the list.) The init file can override the
265 normal processing of the other arguments by setting this variable.
267 One way to use command switches is to visit many files automatically:
271 passes each `.c' file as a separate argument to Emacs, so that Emacs
272 visits each file (*note Visiting::).
274 Here is an advanced example that assumes you have a Lisp program file
275 called `hack-c-program.el' which, when loaded, performs some useful
276 operation on the current buffer, expected to be a C program.
278 xemacs -batch foo.c -l hack-c-program -f save-buffer -kill > log
280 Here Emacs is told to visit `foo.c', load `hack-c-program.el' (which
281 makes changes in the visited file), save `foo.c' (note that
282 `save-buffer' is the function that `C-x C-s' is bound to), and then
283 exit to the shell from which the command was executed. `-batch'
284 guarantees there will be no problem redirecting output to `log',
285 because Emacs will not assume that it has a display terminal to work
288 Command Line Arguments (for XEmacs Under X)
289 -------------------------------------------
291 If you are running XEmacs under X, a number of options are available
292 to control color, border, and window title and icon name:
297 Use TITLE as the window title. This sets the `frame-title-format'
298 variable, which controls the title of the X window corresponding
299 to the selected frame. This is the same format as
304 Use TITLE as the icon name. This sets the
305 `frame-icon-title-format' variable, which controls the title of
306 the icon corresponding to the selected frame.
309 Use COLOR as the mouse color.
312 Use COLOR as the text-cursor foreground color.
315 Install a private colormap for XEmacs.
317 In addition, XEmacs allows you to use a number of standard Xt
318 command line arguments.
322 Use COLOR as the background color.
326 Use COLOR as the border color.
330 Use WIDTH as the border width.
334 When running under the X window system, create the window
335 containing the Emacs frame on the display named DISPLAY.
339 Use COLOR as the foreground color.
343 Use NAME as the default font.
348 Use the geometry (window size and/or position) specified by SPEC.
354 Bring up Emacs in reverse video.
357 Use the resource manager resources specified by NAME. The default
358 is to use the name of the program (`argv[0]') as the resource
362 Read something into the resource database for this invocation of
366 File: xemacs.info, Node: Startup Paths, Next: Basic, Prev: Command Switches, Up: Top
368 How XEmacs finds Directories and Files
369 ======================================
371 XEmacs deals with a multitude of files during operation. These files
372 are spread over many directories, and XEmacs determines the location of
373 most of these directories at startup and organizes them into various
374 paths. (A "path", for the purposes of this section, is simply a list
375 of directories which XEmacs searches successively in order to locate a
378 XEmacs Directory Hierarchies
379 ----------------------------
381 Many of the files XEmacs looks for are located within the XEmacs
382 installation itself. However, there are several views of what actually
383 constitutes the "XEmacs installation": XEmacs may be run from the
384 compilation directory, it may be installed into arbitrary directories,
385 spread over several directories unrelated to each other. Moreover, it
386 may subsequently be moved to a different place. (This last case is not
387 as uncommon as it sounds. Binary kits work this way.) Consequently,
388 XEmacs has quite complex procedures in place to find directories, no
389 matter where they may be hidden.
391 XEmacs will always respect directory options passed to `configure'.
392 However, if it cannot locate a directory at the configured place, it
393 will initiate a search for the directory in any of a number of
394 "hierarchies" rooted under a directory which XEmacs assumes contain
395 parts of the XEmacs installation; it may locate several such hierarchies
396 and search across them. (Typically, there are just one or two
397 hierarchies: the hierarchy where XEmacs was or will be installed, and
398 the one where it is being built.) Such a directory containing a
399 hierarchy is called a "root". Whenever this section refers to a
400 directory using the shorthand `<root>', it means that XEmacs searches
401 for it under all hierarchies under all hierarchies XEmacs was able to
402 scrounge up. In a running XEmacs, the hierarchy roots are stored in
403 the variable `emacs-roots'.
408 Many relevant directories and files XEmacs uses are actually not
409 part of the core installation. They are part of any of the many
410 packages usually installed on top of an XEmacs installation. (*Note
411 Packages::.) Hence, they play a prominent role in the various paths
414 XEmacs locates packages in any of a number of package hierarchies.
415 Package hierarchies fall into three groups: "early", "late", and "last",
416 according to the relative location at which they show up in the various
417 XEmacs paths. Early package hierarchies are at the very front, late
418 ones somewhere in the middle, and last hierarchies are (you guessed it)
421 By default, XEmacs expects an early package hierarchy in the a
422 subdirectory `.xemacs' of the user's home directory.
424 Moreover, XEmacs expects late hierarchies in the subdirectories
425 `site-packages', `mule-packages', and `xemacs-packages' (in that order)
426 of the `<root>/lib/xemacs' subdirectory of one of the installation
427 hierarchies. (If you run in-place, these are direct subdirectories of
428 the build directory.) Furthermore, XEmacs will also search these
429 subdirectories in the `<root>/lib/xemacs-<VERSION>' subdirectory and
430 prefer directories found there.
432 By default, XEmacs does not have a pre-configured last package
433 hierarchy. Last hierarchies are primarily for using package hierarchies
434 of outdated versions of XEmacs as a fallback option. For example, it is
435 possible to run XEmacs 21.0 with the 20.4 package hierarchy as a last
438 It is possible to specify at configure-time the location of the
439 various package hierarchies with the `--package-path' option to
440 configure. The early, late, and last components of the package path
441 are separated by double instead of single colons. If three components
442 are present, they are locate the early, late, and last package
443 hierarchies respectively. If two components are present, they locate
444 the early and late hierarchies. If only one component is present, it
445 locates the late hierarchy. At run time, the package path may also be
446 specified via the `EMACSPACKAGEPATH' environment variable.
448 An XEmacs package is laid out just like a normal installed XEmacs
449 lisp directory. It may have `lisp', `etc', `info', and `lib-src'
450 subdirectories. XEmacs adds these at appropriate places within the
451 various system-wide paths.
453 There may be any number of package hierarchy directories.
455 Directories and Paths
456 ---------------------
458 Here is a list of the various directories and paths XEmacs tries to
459 locate during startup. XEmacs distinguishes between directories and
460 paths specific to "version", "site", and "architecture" when looking
464 directories are specific to the version of XEmacs they belong to
465 and typically reside under `<root>/lib/xemacs-<VERSION>'.
468 directories are independent of the version of XEmacs they belong
469 to and typically reside under `<root>/lib/xemacs'
471 `architecture-specific'
472 directories are specific both to the version of XEmacs and the
473 architecture it runs on and typically reside under
474 `<root>/lib/xemacs-<VERSION>/<ARCHITECTURE>'.
476 During installation, all of these directories may also reside
477 directly under `<root>', because that is where they are in the XEmacs
480 If XEmacs runs with the `-debug-paths' option (*note Command
481 Switches::), it will print the values of these variables, hopefully
482 aiding in debugging any problems which come up.
485 Contains the version-specific location of the Lisp files that come
486 with the core distribution of XEmacs. XEmacs will search it
487 recursively to a depth of 1 when setting up `load-path'.
490 Is where XEmacs searches for XEmacs Lisp files with commands like
491 `load-library'. It contains the package lisp directories (see
492 further down) and the version-specific core Lisp directories. If
493 the environment variable `EMACSLOADPATH' is set at startup, its
494 directories are prepended to `load-path'.
496 `Info-directory-list'
497 Contains the location of info files. (See *Note (info)::.) It
498 contains the package info directories and the version-specific core
499 documentation. Moreover, XEmacs will add `/usr/info',
500 `/usr/local/info' as well as the directories of the environment
501 variable `INFOPATH' to `Info-directory-list'.
505 Are the site-specific locations of the lock directory and the
506 superlock file, respectively. The `lock-directory' variable may
507 also be initialized from the `EMACSLOCKDIR' environment variable.
510 Is the directory of architecture-dependent files that come with
511 XEmacs, especially executable programs intended for XEmacs to
515 Is the path for executables which XEmacs may want to start. It
516 contains the package executable paths as well as `exec-directory',
517 and the directories of the environment variables `PATH' and
521 Is the directory containing the architecture-specific `DOC' file
522 that contains documentation for XEmacs' commands.
525 Is the version-specific directory that contains core data files
526 XEmacs uses. It may be initialized from the `EMACSDATA'
527 environment variable.
529 `data-directory-list'
530 Is the path where XEmacs looks for data files. It contains
531 package data directories as well as `data-directory'.
534 File: xemacs.info, Node: Basic, Next: Undo, Prev: Startup Paths, Up: Top
536 Basic Editing Commands
537 **********************
539 We now give the basics of how to enter text, make corrections, and
540 save the text in a file. If this material is new to you, you might
541 learn it more easily by running the Emacs learn-by-doing tutorial. To
542 do this, type `Control-h t' (`help-with-tutorial').
547 To insert printing characters into the text you are editing, just
548 type them. This inserts the characters into the buffer at the cursor
549 (that is, at "point"; *note Point::). The cursor moves forward. Any
550 characters after the cursor move forward too. If the text in the buffer
551 is `FOOBAR', with the cursor before the `B', and you type `XX', the
552 result is `FOOXXBAR', with the cursor still before the `B'.
554 To "delete" text you have just inserted, use <DEL>. <DEL> deletes
555 the character BEFORE the cursor (not the one that the cursor is on top
556 of or under; that is the character AFTER the cursor). The cursor and
557 all characters after it move backwards. Therefore, if you type a
558 printing character and then type <DEL>, they cancel out.
560 To end a line and start typing a new one, type <RET>. This inserts
561 a newline character in the buffer. If point is in the middle of a
562 line, <RET> splits the line. Typing <DEL> when the cursor is at the
563 beginning of a line rubs out the newline before the line, thus joining
564 the line with the preceding line.
566 Emacs automatically splits lines when they become too long, if you
567 turn on a special mode called "Auto Fill" mode. *Note Filling::, for
568 information on using Auto Fill mode.
570 Customization information: <DEL>, in most modes, runs the command
571 `delete-backward-char'; <RET> runs the command `newline', and
572 self-inserting printing characters run the command `self-insert', which
573 inserts whatever character was typed to invoke it. Some major modes
574 rebind <DEL> to other commands.
576 Direct insertion works for printing characters and <SPC>, but other
577 characters act as editing commands and do not insert themselves. If
578 you need to insert a control character or a character whose code is
579 above 200 octal, you must "quote" it by typing the character
580 `control-q' (`quoted-insert') first. There are two ways to use `C-q':
582 * `Control-q' followed by any non-graphic character (even `C-g')
583 inserts that character.
585 * `Control-q' followed by three octal digits inserts the character
586 with the specified character code.
588 A numeric argument to `C-q' specifies how many copies of the quoted
589 character should be inserted (*note Arguments::).
591 If you prefer to have text characters replace (overwrite) existing
592 text instead of moving it to the right, you can enable Overwrite mode, a
593 minor mode. *Note Minor Modes::.
595 Changing the Location of Point
596 ==============================
598 To do more than insert characters, you have to know how to move point
599 (*note Point::). Here are a few of the available commands.
601 NOTE: Many of the following commands have two versions, one that uses
602 the function keys (e.g. <LEFT> or <END>) and one that doesn't. The
603 former versions may only be available on X terminals (i.e. not on
604 TTY's), but the latter are available on all terminals.
608 Move to the beginning of the line (`beginning-of-line').
612 Move to the end of the line (`end-of-line').
616 Move forward one character (`forward-char').
620 Move backward one character (`backward-char').
624 Move forward one word (`forward-word').
628 Move backward one word (`backward-word').
632 Move down one line, vertically (`next-line'). This command
633 attempts to keep the horizontal position unchanged, so if you
634 start in the middle of one line, you end in the middle of the
635 next. When on the last line of text, `C-n' creates a new line and
640 Move up one line, vertically (`previous-line').
644 Move down one page, vertically (`scroll-up').
648 Move up one page, vertically (`scroll-down').
651 Clear the frame and reprint everything (`recenter'). Text moves
652 on the frame to bring point to the center of the window.
655 Move point to left margin on the line halfway down the frame or
656 window (`move-to-window-line'). Text does not move on the frame.
657 A numeric argument says how many screen lines down from the top of
658 the window (zero for the top). A negative argument counts from
659 the bottom (-1 for the bottom).
662 Transpose two characters, the ones before and after the cursor
667 Move to the top of the buffer (`beginning-of-buffer'). With
668 numeric argument N, move to N/10 of the way from the top. *Note
669 Arguments::, for more information on numeric arguments.
673 Move to the end of the buffer (`end-of-buffer').
676 Read a number N and move the cursor to character number N.
677 Position 1 is the beginning of the buffer.
680 Read a number N and move cursor to line number N (`goto-line').
681 Line 1 is the beginning of the buffer.
684 Use the current column of point as the "semi-permanent goal
685 column" for `C-n' and `C-p' (`set-goal-column'). Henceforth, those
686 commands always move to this column in each line moved into, or as
687 close as possible given the contents of the line. This goal
688 column remains in effect until canceled.
691 Cancel the goal column. Henceforth, `C-n' and `C-p' once again
692 try to avoid changing the horizontal position, as usual.
694 If you set the variable `track-eol' to a non-`nil' value, `C-n' and
695 `C-p' move to the end of the line when at the end of the starting line.
696 By default, `track-eol' is `nil'.
702 Delete the character before the cursor (`delete-backward-char').
705 Delete the character after the cursor (`delete-char').
708 Kill to the end of the line (`kill-line').
711 Kill forward to the end of the next word (`kill-word').
714 Kill back to the beginning of the previous word
715 (`backward-kill-word').
717 In contrast to the <DEL> key, which deletes the character before the
718 cursor, `Control-d' deletes the character after the cursor, causing the
719 rest of the text on the line to shift left. If `Control-d' is typed at
720 the end of a line, that line and the next line are joined.
722 To erase a larger amount of text, use `Control-k', which kills a
723 line at a time. If you use `C-k' at the beginning or in the middle of
724 a line, it kills all the text up to the end of the line. If you use
725 `C-k' at the end of a line, it joins that line and the next line.
727 *Note Killing::, for more flexible ways of killing text.
732 The commands above are sufficient for creating and altering text in
733 an Emacs buffer. More advanced Emacs commands just make things easier.
734 But to keep any text permanently you must put it in a "file". Files
735 are named units of text which are stored by the operating system and
736 which you can retrieve by name. To look at or use the contents of a
737 file in any way, including editing the file with Emacs, you must
738 specify the file name.
740 Consider a file named `/usr/rms/foo.c'. To begin editing this file
743 C-x C-f /usr/rms/foo.c <RET>
745 The file name is given as an "argument" to the command `C-x C-f'
746 (`find-file'). The command uses the "minibuffer" to read the argument.
747 You have to type <RET> to terminate the argument (*note Minibuffer::).
749 You can also use the Open... menu item from the File menu, then type
750 the name of the file to the prompt.
752 Emacs obeys the command by "visiting" the file: it creates a buffer,
753 copies the contents of the file into the buffer, and then displays the
754 buffer for you to edit. You can make changes in the buffer, and then
755 "save" the file by typing `C-x C-s' (`save-buffer') or choosing Save
756 Buffer from the File menu. This makes the changes permanent by copying
757 the altered contents of the buffer back into the file `/usr/rms/foo.c'.
758 Until then, the changes are only inside your Emacs buffer, and the
759 file `foo.c' is not changed.
761 To create a file, visit the file with `C-x C-f' as if it already
762 existed or choose Open... from the File menu and provide the name for
763 the new file in the minibuffer. Emacs will create an empty buffer in
764 which you can insert the text you want to put in the file. When you
765 save the buffer with `C-x C-s', or by choosing Save Buffer from the
766 File menu, the file is created.
768 To learn more about using files, *note Files::.
773 If you forget what a key does, you can use the Help character
774 (`C-h') to find out: Type `C-h k' followed by the key you want to know
775 about. For example, `C-h k C-n' tells you what `C-n' does. `C-h' is a
776 prefix key; `C-h k' is just one of its subcommands (the command
777 `describe-key'). The other subcommands of `C-h' provide different
778 kinds of help. Type `C-h' three times to get a description of all the
779 help facilities. *Note Help::.
783 * Blank Lines:: Commands to make or delete blank lines.
784 * Continuation Lines:: Lines too wide for the frame.
785 * Position Info:: What page, line, row, or column is point on?
786 * Arguments:: Numeric arguments for repeating a command.
789 File: xemacs.info, Node: Blank Lines, Next: Continuation Lines, Prev: Basic, Up: Basic
794 Here are special commands and techniques for entering and removing
798 Insert one or more blank lines after the cursor (`open-line').
801 Delete all but one of many consecutive blank lines
802 (`delete-blank-lines').
804 When you want to insert a new line of text before an existing line,
805 you just type the new line of text, followed by <RET>. If you prefer
806 to create a blank line first and then insert the desired text, use the
807 key `C-o' (`open-line'), which inserts a newline after point but leaves
808 point in front of the newline. Then type the text into the new line.
809 `C-o F O O' has the same effect as `F O O <RET>', except for the final
812 To create several blank lines, type `C-o' several times, or give
813 `C-o' an argument indicating how many blank lines to create. *Note
814 Arguments::, for more information.
816 If you have many blank lines in a row and want to get rid of them,
817 use `C-x C-o' (`delete-blank-lines'). If point is on a blank line
818 which is adjacent to at least one other blank line, `C-x C-o' deletes
819 all but one of the blank lines. If point is on a blank line with no
820 other adjacent blank line, the sole blank line is deleted. If point is
821 on a non-blank line, `C-x C-o' deletes any blank lines following that
825 File: xemacs.info, Node: Continuation Lines, Next: Position Info, Prev: Blank Lines, Up: Basic
830 If you add too many characters to one line without breaking with a
831 <RET>, the line grows to occupy two (or more) screen lines, with a
832 curved arrow at the extreme right margin of all but the last line. The
833 curved arrow indicates that the following screen line is not really a
834 distinct line in the text, but just the "continuation" of a line too
835 long to fit the frame. You can use Auto Fill mode (*note Filling::) to
836 have Emacs insert newlines automatically when a line gets too long.
838 Instead of continuation, long lines can be displayed by "truncation".
839 This means that all the characters that do not fit in the width of the
840 frame or window do not appear at all. They remain in the buffer,
841 temporarily invisible. Three diagonal dots in the last column (instead
842 of the curved arrow inform you that truncation is in effect.
844 To turn off continuation for a particular buffer, set the variable
845 `truncate-lines' to non-`nil' in that buffer. Truncation instead of
846 continuation also happens whenever horizontal scrolling is in use, and
847 optionally whenever side-by-side windows are in use (*note Windows::).
848 Altering the value of `truncate-lines' makes it local to the current
849 buffer; until that time, the default value is in effect. The default
850 is initially `nil'. *Note Locals::.
853 File: xemacs.info, Node: Position Info, Next: Arguments, Prev: Continuation Lines, Up: Basic
855 Cursor Position Information
856 ===========================
858 If you are accustomed to other display editors, you may be surprised
859 that Emacs does not always display the page number or line number of
860 point in the mode line. In Emacs, this information is only rarely
861 needed, and a number of commands are available to compute and print it.
862 Since text is stored in a way that makes it difficult to compute the
863 information, it is not displayed all the time.
866 Print page number of point, and line number within page.
869 Print line number of point in the buffer.
872 Print number of lines and characters in the current region
873 (`count-lines-region').
876 Print character code of character after point, character position
877 of point, and column of point (`what-cursor-position').
879 There are several commands for printing line numbers:
880 * `M-x what-line' counts lines from the beginning of the file and
881 prints the line number point is on. The first line of the file is
882 line number 1. You can use these numbers as arguments to `M-x
885 * `M-x what-page' counts pages from the beginning of the file, and
886 counts lines within the page, printing both of them. *Note
887 Pages::, for the command `C-x l', which counts the lines in the
890 * `M-=' (`count-lines-region') prints the number of lines in the
891 region (*note Mark::).
893 The command `C-x =' (`what-cursor-position') provides information
894 about point and about the column the cursor is in. It prints a line in
895 the echo area that looks like this:
897 Char: x (0170) point=65986 of 563027(12%) column 44
899 (In fact, this is the output produced when point is before `column 44'
902 The two values after `Char:' describe the character following point,
903 first by showing it and second by giving its octal character code.
905 `point=' is followed by the position of point expressed as a
906 character count. The front of the buffer counts as position 1, one
907 character later as 2, and so on. The next, larger number is the total
908 number of characters in the buffer. Afterward in parentheses comes the
909 position expressed as a percentage of the total size.
911 `column' is followed by the horizontal position of point, in columns
912 from the left edge of the window.
914 If the buffer has been narrowed, making some of the text at the
915 beginning and the end temporarily invisible, `C-x =' prints additional
916 text describing the current visible range. For example, it might say:
918 Char: x (0170) point=65986 of 563025(12%) <65102 - 68533> column 44
920 where the two extra numbers give the smallest and largest character
921 position that point is allowed to assume. The characters between those
922 two positions are the visible ones. *Note Narrowing::.
924 If point is at the end of the buffer (or the end of the visible
925 part), `C-x =' omits any description of the character after point. The
928 point=563026 of 563025(100%) column 0
931 File: xemacs.info, Node: Arguments, Prev: Position Info, Up: Basic
936 Any Emacs command can be given a "numeric argument". Some commands
937 interpret the argument as a repetition count. For example, giving an
938 argument of ten to the key `C-f' (the command `forward-char', move
939 forward one character) moves forward ten characters. With these
940 commands, no argument is equivalent to an argument of one. Negative
941 arguments are allowed. Often they tell a command to move or act
944 If your keyboard has a <META> key (labelled with a diamond on
945 Sun-type keyboards and labelled `Alt' on some other keyboards), the
946 easiest way to specify a numeric argument is to type digits and/or a
947 minus sign while holding down the <META> key. For example,
950 moves down five lines. The characters `Meta-1', `Meta-2', and so on,
951 as well as `Meta--', do this because they are keys bound to commands
952 (`digit-argument' and `negative-argument') that are defined to
953 contribute to an argument for the next command.
955 Another way of specifying an argument is to use the `C-u'
956 (`universal-argument') command followed by the digits of the argument.
957 With `C-u', you can type the argument digits without holding down shift
958 keys. To type a negative argument, start with a minus sign. Just a
959 minus sign normally means -1. `C-u' works on all terminals.
961 `C-u' followed by a character which is neither a digit nor a minus
962 sign has the special meaning of "multiply by four". It multiplies the
963 argument for the next command by four. `C-u' twice multiplies it by
964 sixteen. Thus, `C-u C-u C-f' moves forward sixteen characters. This
965 is a good way to move forward "fast", since it moves about 1/5 of a line
966 in the usual size frame. Other useful combinations are `C-u C-n', `C-u
967 C-u C-n' (move down a good fraction of a frame), `C-u C-u C-o' (make "a
968 lot" of blank lines), and `C-u C-k' (kill four lines).
970 Some commands care only about whether there is an argument and not
971 about its value. For example, the command `M-q' (`fill-paragraph') with
972 no argument fills text; with an argument, it justifies the text as well.
973 (*Note Filling::, for more information on `M-q'.) Just `C-u' is a
974 handy way of providing an argument for such commands.
976 Some commands use the value of the argument as a repeat count, but do
977 something peculiar when there is no argument. For example, the command
978 `C-k' (`kill-line') with argument N kills N lines, including their
979 terminating newlines. But `C-k' with no argument is special: it kills
980 the text up to the next newline, or, if point is right at the end of
981 the line, it kills the newline itself. Thus, two `C-k' commands with
982 no arguments can kill a non-blank line, just like `C-k' with an
983 argument of one. (*Note Killing::, for more information on `C-k'.)
985 A few commands treat a plain `C-u' differently from an ordinary
986 argument. A few others may treat an argument of just a minus sign
987 differently from an argument of -1. These unusual cases will be
988 described when they come up; they are always to make the individual
989 command more convenient to use.
992 File: xemacs.info, Node: Undo, Next: Minibuffer, Prev: Basic, Up: Top
997 Emacs allows you to undo all changes you make to the text of a
998 buffer, up to a certain amount of change (8000 characters). Each
999 buffer records changes individually, and the undo command always
1000 applies to the current buffer. Usually each editing command makes a
1001 separate entry in the undo records, but some commands such as
1002 `query-replace' make many entries, and very simple commands such as
1003 self-inserting characters are often grouped to make undoing less
1007 Undo one batch of changes (usually, one command's worth) (`undo').
1012 The command `C-x u' or `C-_' allows you to undo changes. The first
1013 time you give this command, it undoes the last change. Point moves to
1014 the text affected by the undo, so you can see what was undone.
1016 Consecutive repetitions of the `C-_' or `C-x u' commands undo
1017 earlier and earlier changes, back to the limit of what has been
1018 recorded. If all recorded changes have already been undone, the undo
1019 command prints an error message and does nothing.
1021 Any command other than an undo command breaks the sequence of undo
1022 commands. Starting at this moment, the previous undo commands are
1023 considered ordinary changes that can themselves be undone. Thus, you
1024 can redo changes you have undone by typing `C-f' or any other command
1025 that have no important effect, and then using more undo commands.
1027 If you notice that a buffer has been modified accidentally, the
1028 easiest way to recover is to type `C-_' repeatedly until the stars
1029 disappear from the front of the mode line. When that happens, all the
1030 modifications you made have been canceled. If you do not remember
1031 whether you changed the buffer deliberately, type `C-_' once. When you
1032 see Emacs undo the last change you made, you probably remember why you
1033 made it. If the change was an accident, leave it undone. If it was
1034 deliberate, redo the change as described in the preceding paragraph.
1036 Whenever an undo command makes the stars disappear from the mode
1037 line, the buffer contents is the same as it was when the file was last
1040 Not all buffers record undo information. Buffers whose names start
1041 with spaces don't; these buffers are used internally by Emacs and its
1042 extensions to hold text that users don't normally look at or edit.
1043 Minibuffers, help buffers, and documentation buffers also don't record
1046 Emacs can remember at most 8000 or so characters of deleted or
1047 modified text in any one buffer for reinsertion by the undo command.
1048 There is also a limit on the number of individual insert, delete, or
1049 change actions that Emacs can remember.
1051 There are two keys to run the `undo' command, `C-x u' and `C-_',
1052 because on some keyboards, it is not obvious how to type `C-_'. `C-x u'
1053 is an alternative you can type in the same fashion on any terminal.
1056 File: xemacs.info, Node: Minibuffer, Next: M-x, Prev: Undo, Up: Top
1061 The "minibuffer" is the facility used by XEmacs commands to read
1062 arguments more complicated than a single number. Minibuffer arguments
1063 can be file names, buffer names, Lisp function names, XEmacs command
1064 names, Lisp expressions, and many other things, depending on the command
1065 reading the argument. You can use the usual XEmacs editing commands in
1066 the minibuffer to edit the argument text.
1068 When the minibuffer is in use, it appears in the echo area, and the
1069 cursor moves there. The beginning of the minibuffer line displays a
1070 "prompt" which says what kind of input you should supply and how it
1071 will be used. Often this prompt is derived from the name of the command
1072 that the argument is for. The prompt normally ends with a colon.
1074 Sometimes a "default argument" appears in parentheses after the
1075 colon; it, too, is part of the prompt. The default is used as the
1076 argument value if you enter an empty argument (e.g., by just typing
1077 <RET>). For example, commands that read buffer names always show a
1078 default, which is the name of the buffer that will be used if you type
1081 The simplest way to enter a minibuffer argument is to type the text
1082 you want, terminated by <RET> which exits the minibuffer. You can
1083 cancel the command that wants the argument, and get out of the
1084 minibuffer, by typing `C-g'.
1086 Since the minibuffer uses the screen space of the echo area, it can
1087 conflict with other ways XEmacs customarily uses the echo area. Here is
1088 how XEmacs handles such conflicts:
1090 * If a command gets an error while you are in the minibuffer, this
1091 does not cancel the minibuffer. However, the echo area is needed
1092 for the error message and therefore the minibuffer itself is
1093 hidden for a while. It comes back after a few seconds, or as soon
1094 as you type anything.
1096 * If in the minibuffer you use a command whose purpose is to print a
1097 message in the echo area, such as `C-x =', the message is printed
1098 normally, and the minibuffer is hidden for a while. It comes back
1099 after a few seconds, or as soon as you type anything.
1101 * Echoing of keystrokes does not take place while the minibuffer is
1106 * File: Minibuffer File. Entering file names with the minibuffer.
1107 * Edit: Minibuffer Edit. How to edit in the minibuffer.
1108 * Completion:: An abbreviation facility for minibuffer input.
1109 * Minibuffer History:: Reusing recent minibuffer arguments.
1110 * Repetition:: Re-executing commands that used the minibuffer.
1113 File: xemacs.info, Node: Minibuffer File, Next: Minibuffer Edit, Prev: Minibuffer, Up: Minibuffer
1115 Minibuffers for File Names
1116 ==========================
1118 Sometimes the minibuffer starts out with text in it. For example,
1119 when you are supposed to give a file name, the minibuffer starts out
1120 containing the "default directory", which ends with a slash. This is
1121 to inform you which directory the file will be found in if you do not
1122 specify a directory.
1124 For example, the minibuffer might start out with these contents:
1126 Find File: /u2/emacs/src/
1128 where `Find File: ' is the prompt. Typing `buffer.c' specifies the
1129 file `/u2/emacs/src/buffer.c'. To find files in nearby directories,
1130 use `..'; thus, if you type `../lisp/simple.el', you will get the file
1131 named `/u2/emacs/lisp/simple.el'. Alternatively, you can kill with
1132 `M-<DEL>' the directory names you don't want (*note Words::).
1134 If you don't want any of the default, you can kill it with `C-a
1135 C-k'. But you don't need to kill the default; you can simply ignore it.
1136 Insert an absolute file name, one starting with a slash or a tilde,
1137 after the default directory. For example, to specify the file
1138 `/etc/termcap', just insert that name, giving these minibuffer contents:
1140 Find File: /u2/emacs/src//etc/termcap
1142 XEmacs gives a special meaning to a double slash (which is not normally
1143 a useful thing to write): it means, "ignore everything before the
1144 second slash in the pair." Thus, `/u2/emacs/src/' is ignored in the
1145 example above, and you get the file `/etc/termcap'.
1147 If you set `insert-default-directory' to `nil', the default
1148 directory is not inserted in the minibuffer. This way, the minibuffer
1149 starts out empty. But the name you type, if relative, is still
1150 interpreted with respect to the same default directory.
1153 File: xemacs.info, Node: Minibuffer Edit, Next: Completion, Prev: Minibuffer File, Up: Minibuffer
1155 Editing in the Minibuffer
1156 =========================
1158 The minibuffer is an XEmacs buffer (albeit a peculiar one), and the
1159 usual XEmacs commands are available for editing the text of an argument
1162 Since <RET> in the minibuffer is defined to exit the minibuffer, you
1163 can't use it to insert a newline in the minibuffer. To do that, type
1164 `C-o' or `C-q C-j'. (Recall that a newline is really the character
1167 The minibuffer has its own window which always has space on the
1168 screen but acts as if it were not there when the minibuffer is not in
1169 use. When the minibuffer is in use, its window is just like the
1170 others; you can switch to another window with `C-x o', edit text in
1171 other windows and perhaps even visit more files, before returning to the
1172 minibuffer to submit the argument. You can kill text in another window,
1173 return to the minibuffer window, and then yank the text to use it in the
1174 argument. *Note Windows::.
1176 There are some restrictions on the use of the minibuffer window,
1177 however. You cannot switch buffers in it--the minibuffer and its
1178 window are permanently attached. Also, you cannot split or kill the
1179 minibuffer window. But you can make it taller in the normal fashion with
1182 If while in the minibuffer you issue a command that displays help
1183 text of any sort in another window, you can use the `C-M-v' command
1184 while in the minibuffer to scroll the help text. This lasts until you
1185 exit the minibuffer. This feature is especially useful if a completing
1186 minibuffer gives you a list of possible completions. *Note Other
1189 If the variable `minibuffer-confirm-incomplete' is `t', you are
1190 asked for confirmation if there is no known completion for the text you
1191 typed. For example, if you attempted to visit a non-existent file, the
1192 minibuffer might read:
1193 Find File: chocolate_bar.c [no completions, confirm]
1194 If you press `Return' again, that confirms the filename. Otherwise,
1195 you can continue editing it.
1197 XEmacs supports recursive use of the minibuffer. However, it is easy
1198 to do this by accident (because of autorepeating keyboards, for example)
1199 and get confused. Therefore, most XEmacs commands that use the
1200 minibuffer refuse to operate if the minibuffer window is selected. If
1201 the minibuffer is active but you have switched to a different window,
1202 recursive use of the minibuffer is allowed--if you know enough to try
1203 to do this, you probably will not get confused.
1205 If you set the variable `enable-recursive-minibuffers' to a
1206 non-`nil', recursive use of the minibuffer is always allowed.