import -ko -b 1.1.3 XEmacs XEmacs-21_2 r21-2-35
[chise/xemacs-chise.git.1] / info / xemacs.info-4
1 This is ../info/xemacs.info, produced by makeinfo version 4.0 from
2 xemacs/xemacs.texi.
3
4 INFO-DIR-SECTION XEmacs Editor
5 START-INFO-DIR-ENTRY
6 * XEmacs: (xemacs).             XEmacs Editor.
7 END-INFO-DIR-ENTRY
8
9    This file documents the XEmacs editor.
10
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.
14
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.
18
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.
25
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.
31
32 \1f
33 File: xemacs.info,  Node: Minibuffer File,  Next: Minibuffer Edit,  Prev: Minibuffer,  Up: Minibuffer
34
35 Minibuffers for File Names
36 ==========================
37
38    Sometimes the minibuffer starts out with text in it.  For example,
39 when you are supposed to give a file name, the minibuffer starts out
40 containing the "default directory", which ends with a slash.  This is
41 to inform you which directory the file will be found in if you do not
42 specify a directory.
43
44    For example, the minibuffer might start out with these contents:
45
46      Find File: /u2/emacs/src/
47
48 where `Find File: ' is the prompt.  Typing `buffer.c' specifies the
49 file `/u2/emacs/src/buffer.c'.  To find files in nearby directories,
50 use `..'; thus, if you type `../lisp/simple.el', you will get the file
51 named `/u2/emacs/lisp/simple.el'.  Alternatively, you can kill with
52 `M-<DEL>' the directory names you don't want (*note Words::).
53
54    If you don't want any of the default, you can kill it with `C-a
55 C-k'.  But you don't need to kill the default; you can simply ignore it.
56 Insert an absolute file name, one starting with a slash or a tilde,
57 after the default directory.  For example, to specify the file
58 `/etc/termcap', just insert that name, giving these minibuffer contents:
59
60      Find File: /u2/emacs/src//etc/termcap
61
62 XEmacs gives a special meaning to a double slash (which is not normally
63 a useful thing to write): it means, "ignore everything before the
64 second slash in the pair."  Thus, `/u2/emacs/src/' is ignored in the
65 example above, and you get the file `/etc/termcap'.
66
67    If you set `insert-default-directory' to `nil', the default
68 directory is not inserted in the minibuffer.  This way, the minibuffer
69 starts out empty.  But the name you type, if relative, is still
70 interpreted with respect to the same default directory.
71
72 \1f
73 File: xemacs.info,  Node: Minibuffer Edit,  Next: Completion,  Prev: Minibuffer File,  Up: Minibuffer
74
75 Editing in the Minibuffer
76 =========================
77
78    The minibuffer is an XEmacs buffer (albeit a peculiar one), and the
79 usual XEmacs commands are available for editing the text of an argument
80 you are entering.
81
82    Since <RET> in the minibuffer is defined to exit the minibuffer, you
83 can't use it to insert a newline in the minibuffer.  To do that, type
84 `C-o' or `C-q C-j'.  (Recall that a newline is really the character
85 control-J.)
86
87    The minibuffer has its own window which always has space on the
88 screen but acts as if it were not there when the minibuffer is not in
89 use.  When the minibuffer is in use, its window is just like the
90 others; you can switch to another window with `C-x o', edit text in
91 other windows and perhaps even visit more files, before returning to the
92 minibuffer to submit the argument.  You can kill text in another window,
93 return to the minibuffer window, and then yank the text to use it in the
94 argument.  *Note Windows::.
95
96    There are some restrictions on the use of the minibuffer window,
97 however.  You cannot switch buffers in it--the minibuffer and its
98 window are permanently attached.  Also, you cannot split or kill the
99 minibuffer window. But you can make it taller in the normal fashion with
100 `C-x ^'.  If you enable Resize-Minibuffer mode, then the minibuffer
101 window expands vertically as necessary to hold the text that you put in
102 the minibuffer.  Use `M-x resize-minibuffer-mode' to enable or disable
103 this minor mode (*note Minor Modes::).
104
105    If while in the minibuffer you issue a command that displays help
106 text of any sort in another window, you can use the `C-M-v' command
107 while in the minibuffer to scroll the help text.  This lasts until you
108 exit the minibuffer.  This feature is especially useful if a completing
109 minibuffer gives you a list of possible completions.  *Note Other
110 Window::.
111
112    If the variable `minibuffer-confirm-incomplete' is `t', you are
113 asked for confirmation if there is no known completion for the text you
114 typed. For example, if you attempted to visit a non-existent file, the
115 minibuffer might read:
116              Find File: chocolate_bar.c [no completions, confirm]
117    If you press `Return' again, that confirms the filename. Otherwise,
118 you can continue editing it.
119
120    XEmacs supports recursive use of the minibuffer.  However, it is easy
121 to do this by accident (because of autorepeating keyboards, for example)
122 and get confused.  Therefore, most XEmacs commands that use the
123 minibuffer refuse to operate if the minibuffer window is selected.  If
124 the minibuffer is active but you have switched to a different window,
125 recursive use of the minibuffer is allowed--if you know enough to try
126 to do this, you probably will not get confused.
127
128    If you set the variable `enable-recursive-minibuffers' to a
129 non-`nil', recursive use of the minibuffer is always allowed.
130
131 \1f
132 File: xemacs.info,  Node: Completion,  Next: Minibuffer History,  Prev: Minibuffer Edit,  Up: Minibuffer
133
134 Completion
135 ==========
136
137    For certain kinds of arguments, you can use "completion" to enter
138 the argument value.  Completion means that you type part of the
139 argument, then XEmacs visibly fills in the rest, or as much as can be
140 determined from the part you have typed.
141
142    When completion is available, certain keys--<TAB>, <RET>, and
143 <SPC>--are rebound to complete the text present in the minibuffer into
144 a longer string that it stands for, by matching it against a set of
145 "completion alternatives" provided by the command reading the argument.
146 `?' is defined to display a list of possible completions of what you
147 have inserted.
148
149    For example, when `M-x' uses the minibuffer to read the name of a
150 command, it provides a list of all available XEmacs command names to
151 complete against.  The completion keys match the text in the minibuffer
152 against all the command names, find any additional name characters
153 implied by the ones already present in the minibuffer, and add those
154 characters to the ones you have given.  This is what makes it possible
155 to type `M-x inse <SPC> b <RET>' instead of `M-x insert-buffer <RET>'
156 (for example).
157
158    Case is normally significant in completion because it is significant
159 in most of the names that you can complete (buffer names, file names and
160 command names).  Thus, `fo' does not complete to `Foo'.  When you are
161 completing a name in which case does not matter, case may be ignored
162 for completion's sake if specified by program.
163
164    When a completion list is displayed, the completions will highlight
165 as you move the mouse over them.  Clicking the middle mouse button on
166 any highlighted completion will "select" it just as if you had typed it
167 in and hit <RET>.
168
169 * Menu:
170
171 * Example: Completion Example.
172 * Commands: Completion Commands.
173 * Strict Completion::
174 * Options: Completion Options.
175
176 \1f
177 File: xemacs.info,  Node: Completion Example,  Next: Completion Commands,  Prev: Completion,  Up: Completion
178
179 Completion Example
180 ------------------
181
182    A concrete example may help here.  If you type `M-x au <TAB>', the
183 <TAB> looks for alternatives (in this case, command names) that start
184 with `au'.  There are several, including `auto-fill-mode' and
185 `auto-save-mode'--but they are all the same as far as `auto', so the
186 `au' in the minibuffer changes to `auto'.
187
188    If you type <TAB> again immediately, there are multiple
189 possibilities for the very next character--it could be any of `c-'--so
190 no more characters are added; instead, <TAB> displays a list of all
191 possible completions in another window.
192
193    If you go on to type `-f <TAB>', this <TAB> sees `auto-f'.  The only
194 command name starting this way is `auto-fill-mode', so completion fills
195 in the rest of that.  You now have `auto-fill-mode' in the minibuffer
196 after typing just `au <TAB> f <TAB>'.  Note that <TAB> has this effect
197 because in the minibuffer it is bound to the command
198 `minibuffer-complete' when completion is available.
199
200 \1f
201 File: xemacs.info,  Node: Completion Commands,  Next: Strict Completion,  Prev: Completion Example,  Up: Completion
202
203 Completion Commands
204 -------------------
205
206    Here is a list of the completion commands defined in the minibuffer
207 when completion is available.
208
209 `<TAB>'
210      Complete the text in the minibuffer as much as possible
211      (`minibuffer-complete').
212
213 `<SPC>'
214      Complete the minibuffer text, but don't go beyond one word
215      (`minibuffer-complete-word').
216
217 `<RET>'
218      Submit the text in the minibuffer as the argument, possibly
219      completing first as described below
220      (`minibuffer-complete-and-exit').
221
222 `?'
223      Print a list of all possible completions of the text in the
224      minibuffer (`minibuffer-list-completions').
225
226 `<button2>'
227      Select the highlighted text under the mouse as a minibuffer
228      response.  When the minibuffer is being used to prompt the user
229      for a completion, any valid completions which are visible on the
230      screen will be highlighted when the mouse moves over them.
231      Clicking <button2> will select the highlighted completion and exit
232      the minibuffer.  (`minibuf-select-highlighted-completion').
233
234    <SPC> completes much like <TAB>, but never goes beyond the next
235 hyphen or space.  If you have `auto-f' in the minibuffer and type
236 <SPC>, it finds that the completion is `auto-fill-mode', but it stops
237 completing after `fill-'.  This gives `auto-fill-'.  Another <SPC> at
238 this point completes all the way to `auto-fill-mode'.  <SPC> in the
239 minibuffer when completion is available runs the command
240 `minibuffer-complete-word'.
241
242    Here are some commands you can use to choose a completion from a
243 window that displays a list of completions:
244
245 `button2up'
246      Clicking mouse button 2 on a completion in the list of possible
247      completions chooses that completion (`mouse-choose-completion').
248      You normally use this command while point is in the minibuffer;
249      but you must click in the list of completions, not in the
250      minibuffer itself.
251
252 `<PRIOR>'
253 `M-v'
254      Typing <PRIOR> or `M-v', while in the minibuffer, selects the
255      window showing the completion list buffer
256      (`switch-to-completions').  This paves the way for using the
257      commands below.  (Selecting that window in the usual ways has the
258      same effect, but this way is more convenient.)
259
260 `<RET>'
261      Typing <RET> _in the completion list buffer_ chooses the
262      completion that point is in or next to (`choose-completion').  To
263      use this command, you must first switch windows to the window that
264      shows the list of completions.
265
266 `<RIGHT>'
267 `<TAB>'
268 `C-f'
269      Typing the right-arrow key <RIGHT>, <TAB> or `C-f' _in the
270      completion list buffer_ moves point to the following completion
271      (`next-list-mode-item').
272
273 `<LEFT>'
274 `C-b'
275      Typing the left-arrow key <LEFT> or `C-b' _in the completion list
276      buffer_ moves point toward the beginning of the buffer, to the
277      previous completion (`previous-list-mode-item').
278
279 \1f
280 File: xemacs.info,  Node: Strict Completion,  Next: Completion Options,  Prev: Completion Commands,  Up: Completion
281
282 Strict Completion
283 -----------------
284
285    There are three different ways that <RET> can work in completing
286 minibuffers, depending on how the argument will be used.
287
288    * "Strict" completion is used when it is meaningless to give any
289      argument except one of the known alternatives.  For example, when
290      `C-x k' reads the name of a buffer to kill, it is meaningless to
291      give anything but the name of an existing buffer.  In strict
292      completion, <RET> refuses to exit if the text in the minibuffer
293      does not complete to an exact match.
294
295    * "Cautious" completion is similar to strict completion, except that
296      <RET> exits only if the text was an exact match already, not
297      needing completion.  If the text is not an exact match, <RET> does
298      not exit, but it does complete the text.  If it completes to an
299      exact match, a second <RET> will exit.
300
301      Cautious completion is used for reading file names for files that
302      must already exist.
303
304    * "Permissive" completion is used when any string whatever is
305      meaningful, and the list of completion alternatives is just a
306      guide.  For example, when `C-x C-f' reads the name of a file to
307      visit, any file name is allowed, in case you want to create a
308      file.  In permissive completion, <RET> takes the text in the
309      minibuffer exactly as given, without completing it.
310
311    The completion commands display a list of all possible completions in
312 a window whenever there is more than one possibility for the very next
313 character.  Also, typing `?' explicitly requests such a list.  If the
314 list of completions is long, you can scroll it with `C-M-v' (*note
315 Other Window::).
316
317 \1f
318 File: xemacs.info,  Node: Completion Options,  Prev: Strict Completion,  Up: Completion
319
320 Completion Options
321 ------------------
322
323    When completion is done on file names, certain file names are usually
324 ignored.  The variable `completion-ignored-extensions' contains a list
325 of strings; a file whose name ends in any of those strings is ignored
326 as a possible completion.  The standard value of this variable has
327 several elements including `".o"', `".elc"', `".dvi"' and `"~"'.  The
328 effect is that, for example, `foo' can complete to `foo.c' even though
329 `foo.o' exists as well.  However, if _all_ the possible completions end
330 in "ignored" strings, then they are not ignored.  Ignored extensions do
331 not apply to lists of completions--those always mention all possible
332 completions.
333
334    If a completion command finds the next character is undetermined, it
335 automatically displays a list of all possible completions.  If the
336 variable `completion-auto-help' is set to `nil', this does not happen,
337 and you must type `?' to display the possible completions.
338
339    If the variable `minibuffer-confirm-incomplete' is set to `t', then
340 in contexts where `completing-read' allows answers that are not valid
341 completions, an extra <RET> must be typed to confirm the response.
342 This is helpful for catching typos.
343
344    Icomplete mode presents a constantly-updated display that tells you
345 what completions are available for the text you've entered so far.  The
346 command to enable or disable this minor mode is `M-x icomplete-mode'.
347
348 \1f
349 File: xemacs.info,  Node: Minibuffer History,  Next: Repetition,  Prev: Completion,  Up: Minibuffer
350
351 Minibuffer History
352 ==================
353
354    Every argument that you enter with the minibuffer is saved on a
355 "minibuffer history list" so that you can use it again later in another
356 argument.  Special commands load the text of an earlier argument in the
357 minibuffer.  They discard the old minibuffer contents, so you can think
358 of them as moving through the history of previous arguments.
359
360 `<UP>'
361 `M-p'
362      Move to the next earlier argument string saved in the minibuffer
363      history (`previous-history-element').
364
365 `<DOWN>'
366 `M-n'
367      Move to the next later argument string saved in the minibuffer
368      history (`next-history-element').
369
370 `M-r REGEXP <RET>'
371      Move to an earlier saved argument in the minibuffer history that
372      has a match for REGEXP (`previous-matching-history-element').
373
374 `M-s REGEXP <RET>'
375      Move to a later saved argument in the minibuffer history that has a
376      match for REGEXP (`next-matching-history-element').
377
378    The simplest way to reuse the saved arguments in the history list is
379 to move through the history list one element at a time.  While in the
380 minibuffer, use `M-p' or up-arrow (`previous-history-element') to "move
381 to" the next earlier minibuffer input, and use `M-n' or down-arrow
382 (`next-history-element') to "move to" the next later input.
383
384    The previous input that you fetch from the history entirely replaces
385 the contents of the minibuffer.  To use it as the argument, exit the
386 minibuffer as usual with <RET>.  You can also edit the text before you
387 reuse it; this does not change the history element that you "moved" to,
388 but your new argument does go at the end of the history list in its own
389 right.
390
391    For many minibuffer arguments there is a "default" value.  In some
392 cases, the minibuffer history commands know the default value.  Then you
393 can insert the default value into the minibuffer as text by using `M-n'
394 to move "into the future" in the history.
395
396    There are also commands to search forward or backward through the
397 history; they search for history elements that match a regular
398 expression that you specify with the minibuffer.  `M-r'
399 (`previous-matching-history-element') searches older elements in the
400 history, while `M-s' (`next-matching-history-element') searches newer
401 elements.  By special dispensation, these commands can use the
402 minibuffer to read their arguments even though you are already in the
403 minibuffer when you issue them.  As with incremental searching, an
404 uppercase letter in the regular expression makes the search
405 case-sensitive (*note Search Case::).
406
407    All uses of the minibuffer record your input on a history list, but
408 there are separate history lists for different kinds of arguments.  For
409 example, there is a list for file names, used by all the commands that
410 read file names.
411
412    There are several other very specific history lists, including one
413 for command names read by `M-x', one for buffer names, one for arguments
414 of commands like `query-replace', and one for compilation commands read
415 by `compile'.  Finally, there is one "miscellaneous" history list that
416 most minibuffer arguments use.
417
418 \1f
419 File: xemacs.info,  Node: Repetition,  Prev: Minibuffer History,  Up: Minibuffer
420
421 Repeating Minibuffer Commands
422 =============================
423
424    Every command that uses the minibuffer at least once is recorded on a
425 special history list, together with the values of its arguments, so that
426 you can repeat the entire command.  In particular, every use of `M-x'
427 is recorded there, since `M-x' uses the minibuffer to read the command
428 name.
429
430 `C-x <ESC> <ESC>'
431      Re-execute a recent minibuffer command (`repeat-complex-command').
432
433 `M-p'
434      Within `C-x <ESC> <ESC>', move to previous recorded command
435      (`previous-history-element').
436
437 `M-n'
438      Within `C-x <ESC> <ESC>', move to the next (more recent) recorded
439      command (`next-history-element').
440
441 `M-x list-command-history'
442      Display the entire command history, showing all the commands `C-x
443      <ESC> <ESC>' can repeat, most recent first.
444
445    `C-x <ESC> <ESC>' is used to re-execute a recent minibuffer-using
446 command.  With no argument, it repeats the last such command.  A
447 numeric argument specifies which command to repeat; one means the last
448 one, and larger numbers specify earlier ones.
449
450    `C-x <ESC> <ESC>' works by turning the previous command into a Lisp
451 expression and then entering a minibuffer initialized with the text for
452 that expression.  If you type just <RET>, the command is repeated as
453 before.  You can also change the command by editing the Lisp
454 expression.  Whatever expression you finally submit is what will be
455 executed.  The repeated command is added to the front of the command
456 history unless it is identical to the most recently executed command
457 already there.
458
459    Even if you don't understand Lisp syntax, it will probably be obvious
460 which command is displayed for repetition.  If you do not change the
461 text, you can be sure the command will repeat exactly as before.
462
463    If you are in the minibuffer for `C-x <ESC> <ESC>' and the command
464 shown to you is not the one you want to repeat, you can move around the
465 list of previous commands using `M-n' and `M-p'.  `M-p' replaces the
466 contents of the minibuffer with the next earlier recorded command, and
467 `M-n' replaces it with the next later command.  After finding the
468 desired previous command, you can edit its expression and then resubmit
469 it by typing <RET>.  Any editing you have done on the command to be
470 repeated is lost if you use `M-n' or `M-p'.
471
472    `M-n' and `M-p' are specially defined within `C-x <ESC> <ESC>' to
473 run the commands `previous-history-element' and `next-history-element'.
474
475    The list of previous commands using the minibuffer is stored as a
476 Lisp list in the variable `command-history'.  Each element of the list
477 is a Lisp expression which describes one command and its arguments.
478 Lisp programs can reexecute a command by feeding the corresponding
479 `command-history' element to `eval'.
480
481 \1f
482 File: xemacs.info,  Node: M-x,  Next: Help,  Prev: Minibuffer,  Up: Top
483
484 Running Commands by Name
485 ************************
486
487    The Emacs commands that are used often or that must be quick to type
488 are bound to keys--short sequences of characters--for convenient use.
489 Other Emacs commands that are used more rarely are not bound to keys;
490 to run them, you must refer to them by name.
491
492    A command name consists, by convention, of one or more words,
493 separated by hyphens: for example, `auto-fill-mode' or `manual-entry'.
494 The use of English words makes the command name easier to remember than
495 a key made up of obscure characters, even though it results in more
496 characters to type.  You can run any command by name, even if it can be
497 run by keys as well.
498
499    To run a command by name, start with `M-x', then type the command
500 name, and finish with <RET>.  `M-x' uses the minibuffer to read the
501 command name.  <RET> exits the minibuffer and runs the command.
502
503    Emacs uses the minibuffer for reading input for many different
504 purposes; on this occasion, the string `M-x' is displayed at the
505 beginning of the minibuffer as a "prompt" to remind you that your input
506 should be the name of a command to be run.  *Note Minibuffer::, for
507 full information on the features of the minibuffer.
508
509    You can use completion to enter a command name.  For example, to
510 invoke the command `forward-char', type:
511
512      M-x forward-char <RET>
513    or
514      M-x fo <TAB> c <RET>
515
516 After you type in `M-x fo TAB' emacs will give you a possible list of
517 completions from which you can choose. Note that `forward-char' is the
518 same command that you invoke with the key `C-f'.  You can call any
519 command (interactively callable function) defined in Emacs by its name
520 using `M-x' regardless of whether or not any keys are bound to it.
521
522    If you type `C-g' while Emacs reads the command name, you cancel the
523 `M-x' command and get out of the minibuffer, ending up at top level.
524
525    To pass a numeric argument to a command you are invoking with `M-x',
526 specify the numeric argument before the `M-x'.  `M-x' passes the
527 argument along to the function that it calls.  The argument value
528 appears in the prompt while the command name is being read.
529
530    You can use the command `M-x interactive' to specify a way of
531 parsing arguments for interactive use of a function.  For example,
532 write:
533
534        (defun foo (arg) "Doc string" (interactive "p") ...use arg...)
535
536    to make `arg' be the prefix argument when `foo' is called as a
537 command.  The call to `interactive' is actually a declaration rather
538 than a function; it tells `call-interactively' how to read arguments to
539 pass to the function.  When actually called, `interactive' returns
540 `nil'.
541
542    The argument of INTERACTIVE is usually a string containing a code
543 letter followed by a prompt.  Some code letters do not use I/O to get
544 the argument and do not need prompts.  To prompt for multiple arguments,
545 you must provide a code letter, its prompt, a newline, and another code
546 letter, and so forth.  If the argument is not a string, it is evaluated
547 to get a list of arguments to pass to the function.  If you do not
548 provide an argument to `interactive', no arguments are passed when
549 calling interactively.
550
551    Available code letters are:
552
553 `a'
554      Function name: symbol with a function definition
555
556 `b'
557      Name of existing buffer
558
559 `B'
560      Name of buffer, possibly nonexistent
561
562 `c'
563      Character
564
565 `C'
566      Command name: symbol with interactive function definition
567
568 `d'
569      Value of point as number (does not do I/O)
570
571 `D'
572      Directory name
573
574 `e'
575      Last mouse event
576
577 `f'
578      Existing file name
579
580 `F'
581      Possibly nonexistent file name
582
583 `k'
584      Key sequence (string)
585
586 `m'
587      Value of mark as number (does not do I/O)
588
589 `n'
590      Number read using minibuffer
591
592 `N'
593      Prefix arg converted to number, or if none, do like code `n'
594
595 `p'
596      Prefix arg converted to number (does not do I/O)
597
598 `P'
599      Prefix arg in raw form (does not do I/O)
600
601 `r'
602      Region: point and mark as two numeric arguments, smallest first
603      (does not do I/O)
604
605 `s'
606      Any string
607
608 `S'
609      Any symbol
610
611 `v'
612      Variable name: symbol that is `user-variable-p'
613
614 `x'
615      Lisp expression read but not evaluated
616
617 `X'
618      Lisp expression read and evaluated
619
620    In addition, if the string begins with `*', an error is signaled if
621 the buffer is read-only.  This happens before reading any arguments.
622 If the string begins with `@', the window the mouse is over is selected
623 before anything else is done.  You may use both `@' and `*'; they are
624 processed in the order that they appear.
625
626    Normally, when describing a command that is run by name, we omit the
627 <RET> that is needed to terminate the name.  Thus we may refer to `M-x
628 auto-fill-mode' rather than `M-x auto-fill-mode' <RET>.  We mention the
629 <RET> only when it is necessary to emphasize its presence, for example,
630 when describing a sequence of input that contains a command name and
631 arguments that follow it.
632
633    `M-x' is defined to run the command `execute-extended-command',
634 which is responsible for reading the name of another command and
635 invoking it.
636
637 \1f
638 File: xemacs.info,  Node: Help,  Next: Mark,  Prev: M-x,  Up: Top
639
640 Help
641 ****
642
643    XEmacs provides extensive help features accessible through a single
644 character, `C-h'.  `C-h' is a prefix key that is used only for
645 documentation-printing commands.  The characters that you can type after
646 `C-h' are called "help options".  One help option is `C-h'; that is how
647 you ask for help about using `C-h'.  To cancel, type `C-g'.  The
648 function key <F1> is equivalent to `C-h'.
649
650    `C-h C-h' (`help-for-help') displays a list of the possible help
651 options, and then asks you to type the desired option.  It prompts with
652 the string:
653
654      A B C F I K L M N P S T V W C-c C-d C-f C-i C-k C-n C-w;  ? for more help:
655
656 You should type one of those characters.
657
658    Typing a third `C-h' displays a description of what the options mean;
659 Emacs still waits for you to type an option.  To cancel, type `C-g'.
660
661    Most help buffers use a special major mode, Help mode, which lets you
662 scroll conveniently with <SPC> and <DEL> or <BS>.
663
664 * Menu:
665
666 * Help Summary::        Brief list of all Help commands.
667 * Key Help::            Asking what a key does in XEmacs.
668 * Name Help::           Asking about a command, variable or function name.
669 * Apropos::             Asking what pertains to a given topic.
670 * Library Keywords::    Finding Lisp libraries by keywords (topics).
671 * Help Mode::           Special features of Help mode and Help buffers.
672 * Misc Help::           Other help commands.
673
674 \1f
675 File: xemacs.info,  Node: Help Summary,  Next: Key Help,  Prev: Help,  Up: Help
676
677 Help Summary
678 ============
679
680    Here is a summary of the defined help commands.
681
682 `C-h a REGEXP <RET>'
683      Display a list of functions and variables whose names match REGEXP
684      (`hyper-apropos').
685
686 `C-h A REGEXP'
687      Show all commands whose names contain matches for REGEXP
688      (`command-apropos').
689
690 `C-h b'
691      Display a table of all key bindings currently in effect, with local
692      bindings of the current major mode first, followed by all global
693      bindings (`describe-bindings').
694
695 `C-h c KEY'
696      Print the name of the command that KEY runs
697      (`describe-key-briefly').  Here `c' stands for `character'.  For
698      more extensive information on KEY, use `C-h k'.
699
700 `C-h d FUNCTION <RET>'
701 `C-h f FUNCTION <RET>'
702      Display documentation on the Lisp function named FUNCTION
703      (`describe-function').  Since commands are Lisp functions, a
704      command name may be used.
705
706 `C-h i'
707      Run Info, the program for browsing documentation files (`info').
708      The complete XEmacs manual is available online in Info.
709
710 `C-h k KEY'
711      Display the name and documentation of the command that KEY runs
712      (`describe-key').
713
714 `C-h l'
715      Display a description of the last 100 characters you typed
716      (`view-lossage').
717
718 `C-h m'
719      Display documentation of the current major mode (`describe-mode').
720
721 `C-h n'
722 `C-h C-n'
723      Display documentation of XEmacs changes, most recent first
724      (`view-emacs-news').
725
726 `C-h p'
727      Find packages by topic keyword (`finder-by-keyword').
728
729 `C-h C-p'
730      Display a table of all mouse bindings currently in effect now, with
731      local bindings of the current major mode first, followed by all
732      global bindings (`describe-pointer').
733
734 `C-h s'
735      Display current contents of the syntax table, plus an explanation
736      of what they mean (`describe-syntax').  *Note Syntax::.
737
738 `C-h t'
739      Enter the XEmacs interactive tutorial (`help-with-tutorial').
740
741 `C-h v VAR <RET>'
742      Display the documentation of the Lisp variable VAR
743      (`describe-variable').
744
745 `C-h w COMMAND <RET>'
746      Print which keys run the command named COMMAND (`where-is').
747
748 `C-h B <RET>'
749      Display info on how to deal with Beta versions of XEmacs
750      (`describe-beta').
751
752 `C-h C GROUP <RET>'
753      Select customization buffer for GROUP (`customize').
754
755 `C-h F <RET>'
756      View the local copy of the XEmacs FAQ (`xemacs-local-faq').
757
758 `C-h C-i FILE <RET>'
759      Read Info file FILE with Info browser (`Info-query').
760
761 `C-h C-c COMMAND <RET>'
762      Look up an Emacs command COMMAND in the Emacs manual in the Info
763      system (`Info-goto-emacs-command-node').
764
765 `C-h C-f FUNCTION <RET>'
766      Look up an Emacs Lisp function FUNCTION in the Elisp manual in the
767      Info system (`Info-elisp-ref').
768
769 \1f
770 File: xemacs.info,  Node: Key Help,  Next: Name Help,  Prev: Help Summary,  Up: Help
771
772 Documentation for a Key
773 =======================
774
775    The most basic `C-h' options are `C-h c' (`describe-key-briefly')
776 and `C-h k' (`describe-key').  `C-h c KEY' prints in the echo area the
777 name of the command that KEY is bound to.  For example, `C-h c C-f'
778 prints `forward-char'.  Since command names are chosen to describe what
779 the commands do, this is a good way to get a very brief description of
780 what KEY does.
781
782    `C-h k KEY' is similar to `C-h c' but gives more information.  It
783 displays the documentation string of the function KEY is bound to as
784 well as its name.  KEY is a string or vector of events.  When called
785 interactively, KEY may also be a menu selection.  This information does
786 not usually fit into the echo area, so a window is used for the display.
787
788    `C-h c' and `C-h k' work for any sort of key sequences, including
789 function keys and mouse events.
790
791 \1f
792 File: xemacs.info,  Node: Name Help,  Next: Apropos,  Prev: Key Help,  Up: Help
793
794 Help by Command or Variable Name
795 ================================
796
797    `C-h f' (`describe-function') reads the name of a Lisp function
798 using the minibuffer, then displays that function's documentation
799 string in a window.  Since commands are Lisp functions, you can use the
800 argument FUNCTION to get the documentation of a command that you know
801 by name.  For example,
802
803      C-h f auto-fill-mode <RET>
804
805 displays the documentation for `auto-fill-mode'. Using `C-h f' is the
806 only way to see the documentation of a command that is not bound to any
807 key, that is, a command you would normally call using `M-x'.  If the
808 variable `describe-function-show-arglist' is `t', `describe-function'
809 shows its arglist if the FUNCTION is not an autoload function.
810
811    `C-h f' is also useful for Lisp functions that you are planning to
812 use in a Lisp program.  For example, if you have just written the
813 expression `(make-vector len)' and want to make sure you are using
814 `make-vector' properly, type `C-h f make-vector <RET>'.  Because `C-h
815 f' allows all function names, not just command names, you may find that
816 some of your favorite abbreviations that work in `M-x' don't work in
817 `C-h f'.  An abbreviation may be unique among command names, yet fail
818 to be unique when other function names are allowed.
819
820    The function name for `C-h f' to describe has a default which is
821 used if you type <RET> leaving the minibuffer empty.  The default is
822 the function called by the innermost Lisp expression in the buffer
823 around point, _provided_ that is a valid, defined Lisp function name.
824 For example, if point is located following the text `(make-vector (car
825 x)', the innermost list containing point is the one that starts with
826 `(make-vector', so the default is to describe the function
827 `make-vector'.
828
829    `C-h f' is often useful just to verify that you have the right
830 spelling for the function name.  If `C-h f' mentions a name from the
831 buffer as the default, that name must be defined as a Lisp function.  If
832 that is all you want to know, just type `C-g' to cancel the `C-h f'
833 command, then go on editing.
834
835    `C-h w COMMAND <RET>' (`where-is') tells you what keys are bound to
836 COMMAND.  It prints a list of the keys in the echo area. Alternatively,
837 it informs you that a command is not bound to any keys, which implies
838 that you must use `M-x' to call the command.
839
840    `C-h v' (`describe-variable') is like `C-h f' but describes Lisp
841 variables instead of Lisp functions.  Its default is the Lisp symbol
842 around or before point, if that is the name of a known Lisp variable.
843 *Note Variables::.
844
845 \1f
846 File: xemacs.info,  Node: Apropos,  Next: Library Keywords,  Prev: Name Help,  Up: Help
847
848 Apropos
849 =======
850
851 `C-h A'
852      Show only symbols that are names of commands (`command-apropos').
853
854 `M-x apropos REGEXP'
855      Show all symbols whose names contain matches for REGEXP.
856
857    A more sophisticated sort of question to ask is, "What are the
858 commands for working with files?"  To ask this question, type `C-h a
859 file <RET>', which displays a list of all command names that contain
860 `file', including `copy-file', `find-file', and so on.  With each
861 command name appears a brief description of how to use the command, and
862 what keys you can currently invoke it with.  For example, it would say
863 that you can invoke `find-file' by typing `C-x C-f'.  The `A' in `C-h
864 A' stands for `Apropos'; `C-h A' runs the command `command-apropos'.
865 This command normally checks only commands (interactive functions); if
866 you specify a prefix argument, it checks noninteractive functions as
867 well.
868
869    Because `C-h A' looks only for functions whose names contain the
870 string you specify, you must use ingenuity in choosing the string.  If
871 you are looking for commands for killing backwards and `C-h a
872 kill-backwards <RET>' doesn't reveal any, don't give up.  Try just
873 `kill', or just `backwards', or just `back'.  Be persistent.  Pretend
874 you are playing Adventure.  Also note that you can use a regular
875 expression as the argument, for more flexibility (*note Regexps::).
876
877    Here is a set of arguments to give to `C-h a' that covers many
878 classes of XEmacs commands, since there are strong conventions for
879 naming the standard XEmacs commands.  By giving you a feel for the
880 naming conventions, this set should also serve to aid you in developing
881 a technique for picking `apropos' strings.
882
883      char, line, word, sentence, paragraph, region, page, sexp, list,
884      defun, rect, buffer, frame, window, face, file, dir, register,
885      mode, beginning, end, forward, backward, next, previous, up, down,
886      search, goto, kill, delete, mark, insert, yank, fill, indent,
887      case, change, set, what, list, find, view, describe, default.
888
889    To list all Lisp symbols that contain a match for a regexp, not just
890 the ones that are defined as commands, use the command `M-x apropos'
891 instead of `C-h A'.  This command does not check key bindings by
892 default; specify a numeric argument if you want it to check them.
893
894    The `apropos-documentation' command is like `apropos' except that it
895 searches documentation strings for matches for the specified regular
896 expression.
897
898    The `apropos-value' command is like `apropos' except that it
899 searches symbols' values for matches for the specified regular
900 expression.  This command does not check function definitions or
901 property lists by default; specify a numeric argument if you want it to
902 check them.
903
904    If the variable `apropos-do-all' is non-`nil', the commands above
905 all behave as if they had been given a prefix argument.
906
907    If you want more information about a function definition, variable or
908 symbol property listed in the Apropos buffer, you can click on it with
909 `Mouse-2' or move there and type <RET>.
910
911 \1f
912 File: xemacs.info,  Node: Library Keywords,  Next: Help Mode,  Prev: Apropos,  Up: Help
913
914 Keyword Search for Lisp Libraries
915 =================================
916
917    The `C-h p' command lets you search the standard Emacs Lisp
918 libraries by topic keywords.  Here is a partial list of keywords you can
919 use:
920
921      abbrev        abbreviation handling, typing shortcuts, macros
922      bib           code related to the `bib' bibliography processor
923      c             C, C++, and Objective-C language support
924      calendar      calendar and time management support
925      comm          communications, networking, remote access to files
926      data          support for editing files of data
927      docs          support for Emacs documentation
928      dumped        files preloaded into Emacs
929      emulations    emulations of other editors
930      extensions    Emacs Lisp language extensions
931      faces         support for multiple fonts
932      frames        support for Emacs frames and window systems
933      games         games, jokes and amusements
934      hardware      support for interfacing with exotic hardware
935      help          support for on-line help systems
936      hypermedia    support for links between text or other media types
937      i18n          internationalization and alternate character-set support
938      internal      code for Emacs internals, build process, defaults
939      languages     specialized modes for editing programming languages
940      lisp          Lisp support, including Emacs Lisp
941      local         code local to your site
942      maint         maintenance aids for the Emacs development group
943      mail          modes for electronic-mail handling
944      matching      various sorts of searching and matching
945      mouse         mouse support
946      mule          multi-language extensions
947      news          support for netnews reading and posting
948      oop           support for object-oriented programming
949      outlines      support for hierarchical outlining
950      processes     process, subshell, compilation, and job control support
951      terminals     support for terminal types
952      tex           code related to the TeX formatter
953      tools         programming tools
954      unix          front-ends/assistants for, or emulators of, UNIX features
955      vms           support code for vms
956      wp            word processing
957
958 \1f
959 File: xemacs.info,  Node: Help Mode,  Next: Misc Help,  Prev: Library Keywords,  Up: Help
960
961 Help Mode Commands
962 ==================
963
964    Help buffers provide the commands of View mode (*note Misc File
965 Ops::), plus a few special commands of their own.
966
967 `<SPC>'
968      Scroll forward.
969
970 `<DEL>'
971 `<BS>'
972      Scroll backward.
973
974    When a command name (*note Running Commands by Name: M-x.) or
975 variable name (*note Variables::) appears in the documentation, it
976 normally appears inside paired single-quotes.
977
978 \1f
979 File: xemacs.info,  Node: Misc Help,  Prev: Help Mode,  Up: Help
980
981 Other Help Commands
982 ===================
983
984    `C-h i' (`info') runs the Info program, which is used for browsing
985 through structured documentation files.  The entire XEmacs manual is
986 available within Info.  Eventually all the documentation of the GNU
987 system will be available.  Type `h' after entering Info to run a
988 tutorial on using Info.
989
990    If you specify a numeric argument, `C-h i' prompts for the name of a
991 documentation file.  This way, you can browse a file which doesn't have
992 an entry in the top-level Info menu.  It is also handy when you need to
993 get to the documentation quickly, and you know the exact name of the
994 file.
995
996    There are two special help commands for accessing XEmacs
997 documentation through Info.  `C-h C-f FUNCTION <RET>' enters Info and
998 goes straight to the documentation of the XEmacs function FUNCTION.
999 `C-h C-k KEY' enters Info and goes straight to the documentation of the
1000 key KEY.  These two keys run the commands `Info-elisp-ref' and
1001 `Info-goto-emacs-key-command-node'.
1002
1003    If something surprising happens, and you are not sure what commands
1004 you typed, use `C-h l' (`view-lossage').  `C-h l' prints the last 100
1005 command characters you typed in.  If you see commands that you don't
1006 know, you can use `C-h c' to find out what they do.
1007
1008    XEmacs has several major modes.  Each mode redefines a few keys and
1009 makes a few other changes in how editing works.  `C-h m'
1010 (`describe-mode') prints documentation on the current major mode, which
1011 normally describes all the commands that are changed in this mode.
1012
1013    `C-h b' (`describe-bindings') and `C-h s' (`describe-syntax')
1014 present information about the current XEmacs mode that is not covered
1015 by `C-h m'.  `C-h b' displays a list of all the key bindings currently
1016 in effect, with the local bindings of the current major mode first,
1017 followed by the global bindings (*note Key Bindings::).  `C-h s'
1018 displays the contents of the syntax table with explanations of each
1019 character's syntax (*note Syntax::).
1020
1021    You can get a similar list for a particular prefix key by typing
1022 `C-h' after the prefix key.  (There are a few prefix keys for which
1023 this does not work--those that provide their own bindings for `C-h'.
1024 One of these is <ESC>, because `<ESC> C-h' is actually `C-M-h', which
1025 marks a defun.)
1026
1027    The other `C-h' options display various files of useful information.
1028 `C-h C-w' (`describe-no-warranty') displays the full details on the
1029 complete absence of warranty for XEmacs.  `C-h n' (`view-emacs-news')
1030 displays the file `xemacs/etc/NEWS', which contains documentation on
1031 XEmacs changes arranged chronologically.  `C-h F' (`xemacs-local-faq')
1032 displays local version of the XEmacs
1033 frequentliy-answered-questions-list.  `C-h t' (`help-with-tutorial')
1034 displays the learn-by-doing XEmacs tutorial. `C-h C-c'
1035 (`describe-copying') displays the file `xemacs/etc/COPYING', which
1036 tells you the conditions you must obey in distributing copies of
1037 XEmacs.  `C-h C-d' (`describe-distribution') displays another file named
1038 `xemacs/etc/DISTRIB', which tells you how you can order a copy of the
1039 latest version of XEmacs.
1040
1041 \1f
1042 File: xemacs.info,  Node: Mark,  Next: Mouse Selection,  Prev: Help,  Up: Top
1043
1044 Selecting Text
1045 **************
1046
1047    Many Emacs commands operate on an arbitrary contiguous part of the
1048 current buffer. You can select text in two ways:
1049
1050    * You use special keys to select text by defining a region between
1051      point and the mark.
1052
1053    * If you are running XEmacs under X, you can also select text with
1054      the mouse.
1055
1056 The Mark and the Region
1057 =======================
1058
1059    To specify the text for a command to operate on, set "the mark" at
1060 one end of it, and move point to the other end.  The text between point
1061 and the mark is called "the region".  You can move point or the mark to
1062 adjust the boundaries of the region.  It doesn't matter which one is
1063 set first chronologically, or which one comes earlier in the text.
1064
1065    Once the mark has been set, it remains until it is set again at
1066 another place.  The mark remains fixed with respect to the preceding
1067 character if text is inserted or deleted in a buffer.  Each Emacs
1068 buffer has its own mark; when you return to a buffer that had been
1069 selected previously, it has the same mark it had before.
1070
1071    Many commands that insert text, such as `C-y' (`yank') and `M-x
1072 insert-buffer', position the mark at one end of the inserted text--the
1073 opposite end from where point is positioned, so that the region
1074 contains the text just inserted.
1075
1076    Aside from delimiting the region, the mark is useful for marking a
1077 spot that you may want to go back to.  To make this feature more useful,
1078 Emacs remembers 16 previous locations of the mark in the `mark ring'.
1079
1080 * Menu:
1081
1082 * Setting Mark::        Commands to set the mark.
1083 * Using Region::        Summary of ways to operate on contents of the region.
1084 * Marking Objects::     Commands to put region around textual units.
1085 * Mark Ring::           Previous mark positions saved so you can go back there.
1086
1087 \1f
1088 File: xemacs.info,  Node: Setting Mark,  Next: Using Region,  Prev: Mark,  Up: Mark
1089
1090 Setting the Mark
1091 ----------------
1092
1093    Here are some commands for setting the mark:
1094
1095 `C-<SPC>'
1096      Set the mark where point is (`set-mark-command').
1097
1098 `C-@'
1099      The same.
1100
1101 `C-x C-x'
1102      Interchange mark and point (`exchange-point-and-mark').
1103
1104 `C-<'
1105      Pushes a mark at the beginning of the buffer.
1106
1107 `C->'
1108      Pushes a mark at the end of the buffer.
1109
1110    For example, to convert part of the buffer to all upper-case, you
1111 can use the `C-x C-u' (`upcase-region') command, which operates on the
1112 text in the region.  First go to the beginning of the text you want to
1113 capitalize and type `C-<SPC>' to put the mark there, then move to the
1114 end, and then type `C-x C-u' to capitalize the selected region.  You
1115 can also set the mark at the end of the text, move to the beginning,
1116 and then type `C-x C-u'.  Most commands that operate on the text in the
1117 region have the word `region' in their names.
1118
1119    The most common way to set the mark is with the `C-<SPC>' command
1120 (`set-mark-command').  This command sets the mark where point is. You
1121 can then move point away, leaving the mark behind.  It is actually
1122 incorrect to speak of the character `C-<SPC>'; there is no such
1123 character.  When you type <SPC> while holding down <CTRL>, you get the
1124 character `C-@' on most terminals. This character is actually bound to
1125 `set-mark-command'.  But unless you are unlucky enough to have a
1126 terminal where typing `C-<SPC>' does not produce `C-@', you should
1127 think of this character as `C-<SPC>'.
1128
1129    Since terminals have only one cursor, Emacs cannot show you where the
1130 mark is located. Most people use the mark soon after they set it, before
1131 they forget where it is. But you can see where the mark is with the
1132 command `C-x C-x' (`exchange-point-and-mark') which puts the mark where
1133 point was and point where the mark was.  The extent of the region is
1134 unchanged, but the cursor and point are now at the previous location of
1135 the mark.
1136
1137    Another way to set the mark is to push the mark to the beginning of a
1138 buffer while leaving point at its original location. If you supply an
1139 argument to `C-<' (`mark-beginning-of-buffer'), the mark is pushed N/10
1140 of the way from the true beginning of the buffer. You can also set the
1141 mark at the end of a buffer with `C->' (`mark-end-of-buffer'). It
1142 pushes the mark to the end of the buffer, leaving point alone.
1143 Supplying an argument to the command pushes the mark N/10 of the way
1144 from the true end of the buffer.
1145
1146    If you are using XEmacs under the X window system, you can set the
1147 variable `zmacs-regions' to `t'. This makes the current region (defined
1148 by point and mark) highlight and makes it available as the X clipboard
1149 selection, which means you can use the menu bar items on it.  *Note
1150 Active Regions::, for more information.
1151
1152    `C-x C-x' is also useful when you are satisfied with the location of
1153 point but want to move the mark; do `C-x C-x' to put point there and
1154 then you can move it.  A second use of `C-x C-x', if necessary, puts
1155 the mark at the new location with point back at its original location.
1156
1157 \1f
1158 File: xemacs.info,  Node: Using Region,  Next: Marking Objects,  Prev: Setting Mark,  Up: Mark
1159
1160 Operating on the Region
1161 -----------------------
1162
1163    Once you have created an active region, you can do many things to
1164 the text in it:
1165    * Kill it with `C-w' (*note Killing::).
1166
1167    * Save it in a register with `C-x r s' (*note Registers::).
1168
1169    * Save it in a buffer or a file (*note Accumulating Text::).
1170
1171    * Convert case with `C-x C-l' or `C-x C-u'
1172      (*note Case::).
1173
1174    * Evaluate it as Lisp code with `M-x eval-region' (*note Lisp
1175      Eval::).
1176
1177    * Fill it as text with `M-q' (*note Filling::).
1178
1179    * Print hardcopy with `M-x print-region' (*note Hardcopy::).
1180
1181    * Indent it with `C-x <TAB>' or `C-M-\' (*note Indentation::).
1182
1183 \1f
1184 File: xemacs.info,  Node: Marking Objects,  Next: Mark Ring,  Prev: Using Region,  Up: Mark
1185
1186 Commands to Mark Textual Objects
1187 --------------------------------
1188
1189    There are commands for placing point and the mark around a textual
1190 object such as a word, list, paragraph or page.
1191
1192 `M-@'
1193      Set mark after end of next word (`mark-word').  This command and
1194      the following one do not move point.
1195
1196 `C-M-@'
1197      Set mark after end of next Lisp expression (`mark-sexp').
1198
1199 `M-h'
1200      Put region around current paragraph (`mark-paragraph').
1201
1202 `C-M-h'
1203      Put region around current Lisp defun (`mark-defun').
1204
1205 `C-x h'
1206      Put region around entire buffer (`mark-whole-buffer').
1207
1208 `C-x C-p'
1209      Put region around current page (`mark-page').
1210
1211    `M-@' (`mark-word') puts the mark at the end of the next word, while
1212 `C-M-@' (`mark-sexp') puts it at the end of the next Lisp expression.
1213 These characters sometimes save you some typing.
1214
1215    A number of commands are available that set both point and mark and
1216 thus delimit an object in the buffer.  `M-h' (`mark-paragraph') moves
1217 point to the beginning of the paragraph that surrounds or follows
1218 point, and puts the mark at the end of that paragraph (*note
1219 Paragraphs::).  You can then indent, case-convert, or kill the whole
1220 paragraph.  In the same fashion, `C-M-h' (`mark-defun') puts point
1221 before and the mark after the current or following defun (*note
1222 Defuns::).  `C-x C-p' (`mark-page') puts point before the current page
1223 (or the next or previous, depending on the argument), and mark at the
1224 end (*note Pages::).  The mark goes after the terminating page
1225 delimiter (to include it), while point goes after the preceding page
1226 delimiter (to exclude it).  Finally, `C-x h' (`mark-whole-buffer') sets
1227 up the entire buffer as the region by putting point at the beginning
1228 and the mark at the end.
1229