XEmacs 21.2.27 "Hera".
[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    Emacs provides extensive help features which revolve around a single
533 character, `C-h'.  `C-h' is a prefix key that is used only for
534 documentation-printing commands.  The characters you can type after
535 `C-h' are called "help options".  One help option is `C-h'; you use it
536 to ask for help about using `C-h'.
537
538    `C-h C-h' prints a list of the possible help options, and then asks
539 you to type the desired option.  It prompts with the string:
540
541      A, B, C, F, I, K, L, M, N, S, T, V, W, C-c, C-d, C-n, C-w or C-h for more help:
542
543 You should type one of those characters.
544
545    Typing a third `C-h' displays a description of what the options mean;
546 Emacs still waits for you to type an option.  To cancel, type `C-g'.
547
548    Here is a summary of the defined help commands.
549
550 `C-h a STRING <RET>'
551      Display a list of commands whose names contain STRING (`command-
552      apropos').
553
554 `C-h b'
555      Display a table of all key bindings currently in effect, with
556      local bindings of the current major mode first, followed by all
557      global bindings (`describe-bindings').
558
559 `C-h c KEY'
560      Print the name of the command that KEY runs (`describe-key-
561      briefly').  `c' is for `character'.  For more extensive
562      information on KEY, use `C-h k'.
563
564 `C-h f FUNCTION <RET>'
565      Display documentation on the Lisp function named FUNCTION
566      (`describe-function').  Note that commands are Lisp functions, so
567      a command name may be used.
568
569 `C-h i'
570      Run Info, the program for browsing documentation files (`info').
571      The complete Emacs manual is available online in Info.
572
573 `C-h k KEY'
574      Display name and documentation of the command KEY runs
575      (`describe-key').
576
577 `C-h l'
578      Display a description of the last 100 characters you typed
579      (`view-lossage').
580
581 `C-h m'
582      Display documentation of the current major mode (`describe-mode').
583
584 `C-h n'
585      Display documentation of Emacs changes, most recent first
586      (`view-emacs-news').
587
588 `C-h p'
589      Display a table of all mouse bindings currently in effect now, with
590      local bindings of the current major mode first, followed by all
591      global bindings (`describe-pointer').
592
593 `C-h s'
594      Display current contents of the syntax table, plus an explanation
595      of what they mean (`describe-syntax').
596
597 `C-h t'
598      Display the Emacs tutorial (`help-with-tutorial').
599
600 `C-h v VAR <RET>'
601      Display the documentation of the Lisp variable VAR (`describe-
602      variable').
603
604 `C-h w COMMAND <RET>'
605      Print which keys run the command named COMMAND (`where-is').
606
607 `M-x apropos REGEXP'
608      Show all symbols whose names contain matches for REGEXP.
609
610 Documentation for a Key
611 =======================
612
613    The most basic `C-h' options are `C-h c' (`describe-key-briefly')
614 and `C-h k'
615 (`describe-key').  `C-h c KEY' prints the name of the command that KEY
616 is bound to in the echo area.  For example, `C-h c C-f' prints
617 `forward-char'.  Since command names are chosen to describe what the
618 command does, using this option is a good way to get a somewhat cryptic
619 description of what KEY does.
620
621    `C-h k KEY' is similar to `C-h c' but gives more information.  It
622 displays the documentation string of the function KEY is bound to as
623 well as its name.  KEY is a string or vector of events.  When called
624 interactively, KEY may also be a menu selection.  This information does
625 not usually fit into the echo area, so a window is used for the display.
626
627 Help by Command or Variable Name
628 ================================
629
630    `C-h f' (`describe-function') reads the name of a Lisp function
631 using the minibuffer, then displays that function's documentation
632 string in a window.  Since commands are Lisp functions, you can use the
633 argument FUNCTION to get the documentation of a command that you know
634 by name.  For example,
635
636      C-h f auto-fill-mode <RET>
637
638 displays the documentation for `auto-fill-mode'. Using `C-h f' is the
639 only way to see the documentation of a command that is not bound to any
640 key, that is, a command you would normally call using `M-x'.  If the
641 variable `describe-function-show-arglist' is `t', `describe-function'
642 shows its arglist if the FUNCTION is not an autoload function.
643
644    `C-h f' is also useful for Lisp functions you are planning to use in
645 a Lisp program.  For example, if you have just written the code
646 `(make-vector len)' and want to make sure you are using `make-vector'
647 properly, type `C-h f make-vector <RET>'.  Because `C-h f' allows all
648 function names, not just command names, you may find that some of your
649 favorite abbreviations that work in `M-x' don't work in `C-h f'.  An
650 abbreviation may be unique among command names, yet fail to be unique
651 when other function names are allowed.
652
653    If you type <RET>, leaving the minibuffer empty, `C-h f' by default
654 describes the function called by the innermost Lisp expression in the
655 buffer around point, provided that that is a valid, defined Lisp
656 function name.  For example, if point is located following the text
657 `(make-vector (car x)', the innermost list containing point is the one
658 starting with `(make-vector', so the default is to describe the
659 function `make-vector'.
660
661    `C-h f' is often useful just to verify that you have the right
662 spelling for the function name.  If `C-h f' mentions a default in the
663 prompt, you have typed the name of a defined Lisp function.  If that is
664 what you wanted to know, just type `C-g' to cancel the `C-h f' command
665 and continue editing.
666
667    `C-h w COMMAND <RET>' (`where-s') tells you what keys are bound to
668 COMMAND.  It prints a list of the keys in the echo area. Alternatively,
669 it informs you that a command is not bound to any keys, which implies
670 that you must use `M-x' to call the command.
671
672    `C-h v' (`describe-variable') is like `C-h f' but describes Lisp
673 variables instead of Lisp functions.  Its default is the Lisp symbol
674 around or before point, if that is the name of a known Lisp variable.
675 *Note Variables::.
676
677 Apropos
678 =======
679
680 `C-h a'
681      Show only symbols that are names of commands (`command-apropos').
682
683 `M-x apropos REGEXP'
684      Show all symbols whose names comtain matches for REGEXP.
685
686    It is possible to ask a question like, "What are the commands for
687 working with files?"  To do this, type `C-h a file <RET>', which
688 displays a list of all command names that contain `file', such as
689 `copy-file', `find-file', and so on.  With each command name a brief
690 description of its use and information on the keys you can use to
691 invoke it is displayed.  For example, you would be informed that you
692 can invoke `find-file' by typing `C-x C-f'.  The `a' in `C-h a' stands
693 for `Apropos'; `C-h a' runs the Lisp function `command-apropos'.
694
695    Because `C-h a' looks only for functions whose names contain the
696 string you specify, you must use ingenuity in choosing the string.  If
697 you are looking for commands for killing backwards and `C-h a
698 kill-backwards <RET>' doesn't reveal any commands, don't give up.  Try
699 just `kill', or just `backwards', or just `back'.  Be persistent.
700 Pretend you are playing Adventure.  Also note that you can use a
701 regular expression as the argument (*note Regexps::).
702
703    Here is a set of arguments to give to `C-h a' that covers many
704 classes of Emacs commands, since there are strong conventions for naming
705 standard Emacs commands.  By giving you a feeling for the naming
706 conventions, this set of arguments can also help you develop a
707 technique for picking `apropos' strings.
708
709      char, line, word, sentence, paragraph, region, page, sexp, list,
710      defun, buffer, frame, window, file, dir, register, mode,
711      beginning, end, forward, backward, next, previous, up, down,
712      search, goto, kill, delete, mark, insert, yank, fill, indent, case,
713      change, set, what, list, find, view, describe.
714
715    To list all Lisp symbols that contain a match for a regexp, not just
716 the ones that are defined as commands, use the command `M-x apropos'
717 instead of `C-h a'.
718
719 Other Help Commands
720 ===================
721
722    `C-h i' (`info') runs the Info program, which is used for browsing
723 through structured documentation files.  The entire Emacs manual is
724 available within Info.  Eventually all the documentation of the GNU
725 system will be available.  Type `h' after entering Info to run a
726 tutorial on using Info.
727
728    If something surprising happens, and you are not sure what commands
729 you typed, use `C-h l' (`view-lossage').  `C-h l' prints the last 100
730 command characters you typed.  If you see commands you don't know, use
731 `C-h c' to find out what they do.
732
733    Emacs has several major modes. Each mode redefines a few keys and
734 makes a few other changes in how editing works.  `C-h m'
735 (`describe-mode') prints documentation on the current major mode, which
736 normally describes all the commands that are changed in this mode.
737
738    `C-h b' (`describe-bindings') and `C-h s' (`describe-syntax')
739 present information about the current Emacs mode that is not covered by
740 `C-h m'.  `C-h b' displays a list of all key bindings currently in
741 effect, with the local bindings of the current major mode first,
742 followed by the global bindings (*note Key Bindings::).  `C-h s'
743 displays the contents of the syntax table with explanations of each
744 character's syntax (*note Syntax::).
745
746    The other `C-h' options display various files of useful information.
747 `C-h C-w' (`describe-no-warranty') displays details on the complete
748 absence of warranty for XEmacs.  `C-h n' (`view-emacs-news') displays
749 the file `emacs/etc/NEWS', which contains documentation on Emacs
750 changes arranged chronologically.  `C-h t' (`help-with-tutorial')
751 displays the learn-by-doing Emacs tutorial. `C-h C-c'
752 (`describe-copying') displays the file `emacs/etc/COPYING', which tells
753 you the conditions you must obey in distributing copies of Emacs.  `C-h
754 C-d' (`describe-distribution') displays another file named
755 `emacs/etc/DISTRIB', which tells you how you can order a copy of the
756 latest version of Emacs.
757
758 \1f
759 File: xemacs.info,  Node: Mark,  Next: Mouse Selection,  Prev: Help,  Up: Top
760
761 Selecting Text
762 **************
763
764    Many Emacs commands operate on an arbitrary contiguous part of the
765 current buffer. You can select text in two ways:
766
767    * You use special keys to select text by defining a region between
768      point and the mark.
769
770    * If you are running XEmacs under X, you can also select text with
771      the mouse.
772
773 The Mark and the Region
774 =======================
775
776    To specify the text for a command to operate on, set "the mark" at
777 one end of it, and move point to the other end.  The text between point
778 and the mark is called "the region".  You can move point or the mark to
779 adjust the boundaries of the region.  It doesn't matter which one is
780 set first chronologically, or which one comes earlier in the text.
781
782    Once the mark has been set, it remains until it is set again at
783 another place.  The mark remains fixed with respect to the preceding
784 character if text is inserted or deleted in a buffer.  Each Emacs
785 buffer has its own mark; when you return to a buffer that had been
786 selected previously, it has the same mark it had before.
787
788    Many commands that insert text, such as `C-y' (`yank') and `M-x
789 insert-buffer', position the mark at one end of the inserted text--the
790 opposite end from where point is positioned, so that the region
791 contains the text just inserted.
792
793    Aside from delimiting the region, the mark is useful for marking a
794 spot that you may want to go back to.  To make this feature more useful,
795 Emacs remembers 16 previous locations of the mark in the `mark ring'.
796
797 * Menu:
798
799 * Setting Mark::        Commands to set the mark.
800 * Using Region::        Summary of ways to operate on contents of the region.
801 * Marking Objects::     Commands to put region around textual units.
802 * Mark Ring::           Previous mark positions saved so you can go back there.
803
804 \1f
805 File: xemacs.info,  Node: Setting Mark,  Next: Using Region,  Prev: Mark,  Up: Mark
806
807 Setting the Mark
808 ----------------
809
810    Here are some commands for setting the mark:
811
812 `C-<SPC>'
813      Set the mark where point is (`set-mark-command').
814
815 `C-@'
816      The same.
817
818 `C-x C-x'
819      Interchange mark and point (`exchange-point-and-mark').
820
821 `C-<'
822      Pushes a mark at the beginning of the buffer.
823
824 `C->'
825      Pushes a mark at the end of the buffer.
826
827    For example, to convert part of the buffer to all upper-case, you
828 can use the `C-x C-u' (`upcase-region') command, which operates on the
829 text in the region.  First go to the beginning of the text you want to
830 capitalize and type `C-<SPC>' to put the mark there, then move to the
831 end, and then type `C-x C-u' to capitalize the selected region.  You
832 can also set the mark at the end of the text, move to the beginning,
833 and then type `C-x C-u'.  Most commands that operate on the text in the
834 region have the word `region' in their names.
835
836    The most common way to set the mark is with the `C-<SPC>' command
837 (`set-mark-command').  This command sets the mark where point is. You
838 can then move point away, leaving the mark behind.  It is actually
839 incorrect to speak of the character `C-<SPC>'; there is no such
840 character.  When you type <SPC> while holding down <CTRL>, you get the
841 character `C-@' on most terminals. This character is actually bound to
842 `set-mark-command'.  But unless you are unlucky enough to have a
843 terminal where typing `C-<SPC>' does not produce `C-@', you should
844 think of this character as `C-<SPC>'.
845
846    Since terminals have only one cursor, Emacs cannot show you where the
847 mark is located. Most people use the mark soon after they set it, before
848 they forget where it is. But you can see where the mark is with the
849 command `C-x C-x' (`exchange-point-and-mark') which puts the mark where
850 point was and point where the mark was.  The extent of the region is
851 unchanged, but the cursor and point are now at the previous location of
852 the mark.
853
854    Another way to set the mark is to push the mark to the beginning of a
855 buffer while leaving point at its original location. If you supply an
856 argument to `C-<' (`mark-beginning-of-buffer'), the mark is pushed N/10
857 of the way from the true beginning of the buffer. You can also set the
858 mark at the end of a buffer with `C->' (`mark-end-of-buffer'). It
859 pushes the mark to the end of the buffer, leaving point alone.
860 Supplying an argument to the command pushes the mark N/10 of the way
861 from the true end of the buffer.
862
863    If you are using XEmacs under the X window system, you can set the
864 variable `zmacs-regions' to `t'. This makes the current region (defined
865 by point and mark) highlight and makes it available as the X clipboard
866 selection, which means you can use the menu bar items on it.  *Note
867 Active Regions::, for more information.
868
869    `C-x C-x' is also useful when you are satisfied with the location of
870 point but want to move the mark; do `C-x C-x' to put point there and
871 then you can move it.  A second use of `C-x C-x', if necessary, puts
872 the mark at the new location with point back at its original location.
873
874 \1f
875 File: xemacs.info,  Node: Using Region,  Next: Marking Objects,  Prev: Setting Mark,  Up: Mark
876
877 Operating on the Region
878 -----------------------
879
880    Once you have created an active region, you can do many things to
881 the text in it:
882    * Kill it with `C-w' (*note Killing::).
883
884    * Save it in a register with `C-x r s' (*note Registers::).
885
886    * Save it in a buffer or a file (*note Accumulating Text::).
887
888    * Convert case with `C-x C-l' or `C-x C-u'
889      (*note Case::).
890
891    * Evaluate it as Lisp code with `M-x eval-region' (*note Lisp
892      Eval::).
893
894    * Fill it as text with `M-q' (*note Filling::).
895
896    * Print hardcopy with `M-x print-region' (*note Hardcopy::).
897
898    * Indent it with `C-x <TAB>' or `C-M-\' (*note Indentation::).
899
900 \1f
901 File: xemacs.info,  Node: Marking Objects,  Next: Mark Ring,  Prev: Using Region,  Up: Mark
902
903 Commands to Mark Textual Objects
904 --------------------------------
905
906    There are commands for placing point and the mark around a textual
907 object such as a word, list, paragraph or page.
908
909 `M-@'
910      Set mark after end of next word (`mark-word').  This command and
911      the following one do not move point.
912
913 `C-M-@'
914      Set mark after end of next Lisp expression (`mark-sexp').
915
916 `M-h'
917      Put region around current paragraph (`mark-paragraph').
918
919 `C-M-h'
920      Put region around current Lisp defun (`mark-defun').
921
922 `C-x h'
923      Put region around entire buffer (`mark-whole-buffer').
924
925 `C-x C-p'
926      Put region around current page (`mark-page').
927
928    `M-@' (`mark-word') puts the mark at the end of the next word, while
929 `C-M-@' (`mark-sexp') puts it at the end of the next Lisp expression.
930 These characters sometimes save you some typing.
931
932    A number of commands are available that set both point and mark and
933 thus delimit an object in the buffer.  `M-h' (`mark-paragraph') moves
934 point to the beginning of the paragraph that surrounds or follows
935 point, and puts the mark at the end of that paragraph (*note
936 Paragraphs::).  You can then indent, case-convert, or kill the whole
937 paragraph.  In the same fashion, `C-M-h' (`mark-defun') puts point
938 before and the mark after the current or following defun (*note
939 Defuns::).  `C-x C-p' (`mark-page') puts point before the current page
940 (or the next or previous, depending on the argument), and mark at the
941 end (*note Pages::).  The mark goes after the terminating page
942 delimiter (to include it), while point goes after the preceding page
943 delimiter (to exclude it).  Finally, `C-x h' (`mark-whole-buffer') sets
944 up the entire buffer as the region by putting point at the beginning
945 and the mark at the end.
946
947 \1f
948 File: xemacs.info,  Node: Mark Ring,  Prev: Marking Objects,  Up: Mark
949
950 The Mark Ring
951 -------------
952
953    Aside from delimiting the region, the mark is also useful for marking
954 a spot that you may want to go back to.  To make this feature more
955 useful, Emacs remembers 16 previous locations of the mark in the "mark
956 ring".  Most commands that set the mark push the old mark onto this
957 ring.  To return to a marked location, use `C-u C-<SPC>' (or `C-u
958 C-@'); this is the command `set-mark-command' given a numeric argument.
959 The command moves point to where the mark was, and restores the mark
960 from the ring of former marks. Repeated use of this command moves point
961 to all the old marks on the ring, one by one.  The marks you have seen
962 go to the end of the ring, so no marks are lost.
963
964    Each buffer has its own mark ring.  All editing commands use the
965 current buffer's mark ring.  In particular, `C-u C-<SPC>' always stays
966 in the same buffer.
967
968    Many commands that can move long distances, such as `M-<'
969 (`beginning-of-buffer'), start by setting the mark and saving the old
970 mark on the mark ring.  This makes it easier for you to move back
971 later.  Searches set the mark, unless they do not actually move point.
972 When a command sets the mark, `Mark Set' is printed in the echo area.
973
974    The variable `mark-ring-max' is the maximum number of entries to
975 keep in the mark ring.  If that many entries exist and another entry is
976 added, the last entry in the list is discarded.  Repeating `C-u
977 C-<SPC>' circulates through the entries that are currently in the ring.
978
979    The variable `mark-ring' holds the mark ring itself, as a list of
980 marker objects in the order most recent first.  This variable is local
981 in every buffer.
982
983 \1f
984 File: xemacs.info,  Node: Mouse Selection,  Next: Additional Mouse Operations,  Prev: Mark,  Up: Top
985
986 Selecting Text with the Mouse
987 =============================
988
989    If you are using XEmacs under X, you can use the mouse pointer to
990 select text. (The normal mouse pointer is an I-beam, the same pointer
991 that `xterm' uses.)
992
993    The glyph variable `text-pointer-glyph' controls the shape of the
994 mouse pointer when over text.  You can also control the shape of the
995 mouse pointer when over nontext using `nontext-pointer-glyph', and the
996 shape of the mouse pointer when over the modeline using
997 `modeline-pointer-glyph'. (Remember, you should use `set-glyph-image',
998 not `setq', to set one of these variables.)
999
1000    If you want to get fancy, you can set the foreground and background
1001 colors of the mouse pointer by setting the `pointer' face.
1002
1003    There are two ways to select a region of text with the mouse:
1004
1005    To select a word in text, double-click with the left mouse button
1006 while the mouse cursor is over the word.  The word is highlighted when
1007 selected. On monochrome monitors, a stippled background indicates that a
1008 region of text has been highlighted. On color monitors, a color
1009 background indicates highlighted text. You can triple-click to select
1010 whole lines.
1011
1012    To select an arbitrary region of text:
1013
1014   1. Move the mouse cursor over the character at the beginning of the
1015      region of text you want to select.
1016
1017   2. Press and hold the left mouse button.
1018
1019   3. While holding the left mouse button down, drag the cursor to the
1020      character at the end of the region of text you want to select.
1021
1022   4. Release the left mouse button.
1023         The selected region of text is highlighted.
1024
1025    Once a region of text is selected, it becomes the primary X selection
1026 (*note Using X Selections::) as well as the Emacs selected region. You
1027 can paste it into other X applications and use the options from the
1028 Edit pull-down menu on it.  Since it is also the Emacs region, you can
1029 use Emacs region commands on it.
1030
1031 \1f
1032 File: xemacs.info,  Node: Additional Mouse Operations,  Next: Killing,  Prev: Mouse Selection,  Up: Top
1033
1034 Additional Mouse Operations
1035 ===========================
1036
1037    XEmacs also provides the following mouse functions.  Most of these
1038 are not bound to mouse gestures by default, but they are provided for
1039 your customization pleasure.  For example, if you wanted `shift-left'
1040 (that is, holding down the <Shift> key and clicking the left mouse
1041 button) to delete the character at which you are pointing, then you
1042 could do this:
1043
1044      (global-set-key '(shift button1) 'mouse-del-char)
1045
1046 `mouse-del-char'
1047      Delete the character pointed to by the mouse.
1048
1049 `mouse-delete-window'
1050      Delete the Emacs window that the mouse is on.
1051
1052 `mouse-keep-one-window'
1053      Select the Emacs window that the mouse is on, then delete all other
1054      windows on this frame.
1055
1056 `mouse-kill-line'
1057      Kill the line pointed to by the mouse.
1058
1059 `mouse-line-length'
1060      Print the length of the line indicated by the pointer.
1061
1062 `mouse-scroll'
1063      Scroll point to the mouse position.
1064
1065 `mouse-select'
1066      Select the Emacs window the mouse is on.
1067
1068 `mouse-select-and-split'
1069      Select the Emacs window mouse is on, then split it vertically in
1070      half.
1071
1072 `mouse-set-mark'
1073      Select the Emacs window the mouse is on and set the mark at the
1074      mouse position.  Display the cursor at that position for a second.
1075
1076 `mouse-set-point'
1077      Select the Emacs window that the mouse is on and move point to the
1078      mouse position.
1079
1080 `mouse-track'
1081      Make a selection with the mouse.   This is the default binding of
1082      the left mouse button (<button1>).
1083
1084 `mouse-track-adjust'
1085      Extend the existing selection.  This is the default binding of
1086      <Shift-button1>.
1087
1088 `mouse-track-and-copy-to-cutbuffer'
1089      Make a selection like `mouse-track', but also copy it to the cut
1090      buffer.
1091
1092 `mouse-track-delete-and-insert'
1093      Make a selection with the mouse and insert it at point.  This is
1094      the default binding of <control-shift-button1>.
1095
1096 `mouse-track-insert'
1097      Make a selection with the mouse and insert it at point.  This is
1098      the default binding of <control-button1>.
1099
1100 `mouse-window-to-region'
1101      Narrow a window to the region between the cursor and the mouse
1102      pointer.
1103
1104    The `M-x mouse-track' command should be bound to a mouse button.  If
1105 you click-and-drag, the selection is set to the region between the
1106 point of the initial click and the point at which you release the
1107 button.  These positions do not need to be ordered.
1108
1109    If you click-and-release without moving the mouse, the point is
1110 moved, and the selection is disowned (there will be no selection
1111 owner.)  The mark will be set to the previous position of point.
1112
1113    If you double-click, the selection will extend by symbols instead of
1114 by characters.  If you triple-click, the selection will extend by lines.
1115
1116    If you drag the mouse off the top or bottom of the window, you can
1117 select pieces of text that are larger than the visible part of the
1118 buffer; the buffer will scroll as necessary.
1119
1120    The selected text becomes the current X selection, and is also
1121 copied to the top of the kill ring.  Point will be left at the position
1122 at which you released the button and the mark will be left at the
1123 initial click position.  Bind a mouse click to
1124 `mouse-track-and-copy-to-cutbuffer' to copy selections to the cut
1125 buffer.  (See also the `mouse-track-adjust' command, on
1126 `Shift-button1'.)
1127
1128    The `M-x mouse-track-adjust' command should be bound to a mouse
1129 button.  The selection will be enlarged or shrunk so that the point of
1130 the mouse click is one of its endpoints.  This is only meaningful after
1131 the `mouse-track' command (<button1>) has been executed.
1132
1133    The `M-x mouse-track-delete-and-insert' command is exactly the same
1134 as the `mouse-track' command on <button1>, except that point is not
1135 moved; the selected text is immediately inserted after being selected;
1136 and the text of the selection is deleted.
1137
1138    The `M-x mouse-track-insert' command is exactly the same as the
1139 `mouse-track' command on <button1>, except that point is not moved; the
1140 selected text is immediately inserted after being selected; and the
1141 selection is immediately disowned afterwards.
1142