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