Merge remote-tracking branch 'origin/master' into for-steve
[sxemacs] / info / sxemacs / help.texi
1 @node Help, Mark, M-x, Top
2 @chapter Help
3 @kindex Help
4 @cindex help
5 @cindex self-documentation
6 @findex help-command
7 @kindex C-h
8 @kindex F1
9
10   SXEmacs provides extensive help features accessible through a single
11 character, @kbd{C-h}.  @kbd{C-h} is a prefix key that is used only for
12 documentation-printing commands.  The characters that you can type after
13 @kbd{C-h} are called @dfn{help options}.  One help option is @kbd{C-h};
14 that is how you ask for help about using @kbd{C-h}.  To cancel, type
15 @kbd{C-g}.  The function key @key{F1} is equivalent to @kbd{C-h}.
16
17 @kindex C-h C-h
18 @findex help-for-help
19   @kbd{C-h C-h} (@code{help-for-help}) displays a list of the possible
20 help options, and then asks you to type the desired option.  It prompts
21 with the string:
22
23 @smallexample
24 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:
25 @end smallexample
26
27 @noindent
28 You should type one of those characters.
29
30   Typing a third @kbd{C-h} displays a description of what the options mean;
31 Emacs still waits for you to type an option.  To cancel, type @kbd{C-g}.
32
33   Most help buffers use a special major mode, Help mode, which lets you
34 scroll conveniently with @key{SPC} and @key{DEL} or @key{BS}.
35
36 @menu
37 * Help Summary::        Brief list of all Help commands.
38 * Key Help::            Asking what a key does in SXEmacs.
39 * Name Help::           Asking about a command, variable or function name.
40 * Apropos::             Asking what pertains to a given topic.
41 * Library Keywords::    Finding Lisp libraries by keywords (topics).
42 * Help Mode::           Special features of Help mode and Help buffers.
43 * Misc Help::           Other help commands.
44 @end menu
45
46 @iftex
47 @node Help Summary, Help Summary, Help, Help
48 @end iftex
49 @ifnottex
50 @node Help Summary, Key Help, Help, Help
51 @section Help Summary
52 @end ifnottex
53
54   Here is a summary of the defined help commands.
55
56 @table @kbd
57 @item C-h a @var{regexp} @key{RET}
58 Display a list of functions and variables whose names match @var{regexp}
59 (@code{hyper-apropos}).
60 @item C-h A @var{regexp}
61 Show all commands whose names contain matches for @var{regexp}
62 (@code{command-apropos}).
63 @item C-h b
64 Display a table of all key bindings currently in effect, with local
65 bindings of the current major mode first, followed by all global
66 bindings (@code{describe-bindings}).
67 @item C-h c @var{key}
68 Print the name of the command that @var{key} runs
69 (@code{describe-key-briefly}).  Here @kbd{c} stands for `character'.  For more
70 extensive information on @var{key}, use @kbd{C-h k}.
71 @item C-h d @var{function} @key{RET}
72 @itemx C-h f @var{function} @key{RET}
73 Display documentation on the Lisp function named @var{function}
74 (@code{describe-function}).  Since commands are Lisp functions,
75 a command name may be used.
76 @item C-h i
77 Run Info, the program for browsing documentation files (@code{info}).
78 The complete SXEmacs manual is available online in Info.
79 @item C-h k @var{key}
80 Display the name and documentation of the command that @var{key} runs
81 (@code{describe-key}).
82 @item C-h l
83 Display a description of the last 100 characters you typed
84 (@code{view-lossage}).
85 @item C-h m
86 Display documentation of the current major mode (@code{describe-mode}).
87 @item C-h n
88 @itemx C-h C-n
89 Display documentation of SXEmacs changes, most recent first
90 (@code{view-emacs-news}).
91 @item C-h p
92 Find packages by topic keyword (@code{finder-by-keyword}).
93 @item C-h C-p
94 Display a table of all mouse bindings currently in effect now, with
95 local bindings of the current major mode first, followed by all global
96 bindings (@code{describe-pointer}).
97 @item C-h s
98 Display current contents of the syntax table, plus an explanation of
99 what they mean (@code{describe-syntax}).  @xref{Syntax}.
100 @item C-h t
101 Enter the SXEmacs interactive tutorial (@code{help-with-tutorial}).
102 @item C-h v @var{var} @key{RET}
103 Display the documentation of the Lisp variable @var{var}
104 (@code{describe-variable}).
105 @item C-h w @var{command} @key{RET}
106 Print which keys run the command named @var{command} (@code{where-is}).
107 @item C-h B @key{RET}
108 Display info on how to deal with Beta versions of SXEmacs
109 (@code{describe-beta}).
110 @item C-h C @var{group} @key{RET}
111 Select customization buffer for @var{group} (@code{customize}).
112 @item C-h F @key{RET}
113 View the local copy of the SXEmacs FAQ (@code{sxemacs-local-faq}).
114 @item C-h C-i @var{file} @key{RET}
115 Read Info file @var{file} with Info browser (@code{Info-query}).
116 @item C-h C-c @var{command} @key{RET}
117 Look up an Emacs command @var{command} in the Emacs manual in the Info
118 system (@code{Info-goto-emacs-command-node}).
119 @item C-h C-f @var{function} @key{RET}
120 Look up an Emacs Lisp function @var{function} in the Elisp manual in the
121 Info system (@code{Info-elisp-ref}).
122 @end table
123
124 @node Key Help, Name Help, Help Summary, Help
125 @section Documentation for a Key
126
127 @kindex C-h c
128 @findex describe-key-briefly
129   The most basic @kbd{C-h} options are @kbd{C-h c}
130 (@code{describe-key-briefly}) and @w{@kbd{C-h k}} (@code{describe-key}).
131 @kbd{C-h c @var{key}} prints in the echo area the name of the command
132 that @var{key} is bound to.  For example, @kbd{C-h c C-f} prints
133 @samp{forward-char}.  Since command names are chosen to describe what
134 the commands do, this is a good way to get a very brief description of
135 what @var{key} does.
136
137 @kindex C-h k
138 @findex describe-key
139   @kbd{C-h k @var{key}} is similar to @kbd{C-h c} but gives more
140 information.  It displays the documentation string of the function
141 @var{key} is bound to as well as its name.  @var{key} is a string or
142 vector of events.  When called interactively, @var{key} may also be a menu
143 selection.  This information does not usually fit into the echo area, so a
144 window is used for the display.
145
146   @kbd{C-h c} and @kbd{C-h k} work for any sort of key sequences,
147 including function keys and mouse events.
148
149 @node Name Help, Apropos, Key Help, Help
150 @section Help by Command or Variable Name
151
152 @kindex C-h f
153 @findex describe-function
154 @vindex describe-function-show-arglist
155   @kbd{C-h f} (@code{describe-function}) reads the name of a Lisp
156 function using the minibuffer, then displays that function's
157 documentation string in a window.  Since commands are Lisp functions,
158 you can use the argument @var{function} to get the documentation of a
159 command that you know by name.  For example,
160
161 @example
162 C-h f auto-fill-mode @key{RET}
163 @end example
164
165 @noindent
166 displays the documentation for @code{auto-fill-mode}. Using @kbd{C-h f}
167 is the only way to see the documentation of a command that is not bound
168 to any key, that is, a command you would normally call using @kbd{M-x}.
169 If the variable @code{describe-function-show-arglist} is @code{t},
170 @code{describe-function} shows its arglist if the @var{function} is not
171 an autoload function.
172
173   @kbd{C-h f} is also useful for Lisp functions that you are planning to
174 use in a Lisp program.  For example, if you have just written the
175 expression @code{(make-vector len)} and want to make sure you are using
176 @code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}.
177 Because @kbd{C-h f} allows all function names, not just command names,
178 you may find that some of your favorite abbreviations that work in
179 @kbd{M-x} don't work in @kbd{C-h f}.  An abbreviation may be unique
180 among command names, yet fail to be unique when other function names are
181 allowed.
182
183   The function name for @kbd{C-h f} to describe has a default which is
184 used if you type @key{RET} leaving the minibuffer empty.  The default is
185 the function called by the innermost Lisp expression in the buffer
186 around point, @emph{provided} that is a valid, defined Lisp function
187 name.  For example, if point is located following the text
188 @samp{(make-vector (car x)}, the innermost list containing point is the
189 one that starts with @samp{(make-vector}, so the default is to describe the
190 function @code{make-vector}.
191
192   @kbd{C-h f} is often useful just to verify that you have the right
193 spelling for the function name.  If @kbd{C-h f} mentions a name from the
194 buffer as the default, that name must be defined as a Lisp function.  If
195 that is all you want to know, just type @kbd{C-g} to cancel the @kbd{C-h
196 f} command, then go on editing.
197
198 @kindex C-h w
199 @findex where-is
200   @kbd{C-h w @var{command} @key{RET}} (@code{where-is}) tells you what
201 keys are bound to @var{command}.  It prints a list of the keys in the
202 echo area. Alternatively, it informs you that a command is not bound to
203 any keys, which implies that you must use @kbd{M-x} to call the
204 command.
205
206 @kindex C-h v
207 @findex describe-variable
208   @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but
209 describes Lisp variables instead of Lisp functions.  Its default is the
210 Lisp symbol around or before point, if that is the name of a known Lisp
211 variable.  @xref{Variables}.
212
213 @node Apropos, Library Keywords, Name Help, Help
214 @section Apropos
215
216 @kindex C-h A
217 @findex command-apropos
218 @cindex apropos
219
220 @table @kbd
221 @item C-h A
222 Show only symbols that are names of commands
223 (@code{command-apropos}).
224
225 @item M-x apropos @var{regexp}
226 Show all symbols whose names contain matches for @var{regexp}.
227 @end table
228
229   A more sophisticated sort of question to ask is, ``What are the
230 commands for working with files?''  To ask this question, type @kbd{C-h
231 a file @key{RET}}, which displays a list of all command names that
232 contain @samp{file}, including @code{copy-file}, @code{find-file}, and
233 so on.  With each command name appears a brief description of how to use
234 the command, and what keys you can currently invoke it with.  For
235 example, it would say that you can invoke @code{find-file} by typing
236 @kbd{C-x C-f}.  The @kbd{A} in @kbd{C-h A} stands for `Apropos';
237 @kbd{C-h A} runs the command @code{command-apropos}.  This command
238 normally checks only commands (interactive functions); if you specify a
239 prefix argument, it checks noninteractive functions as well.
240
241   Because @kbd{C-h A} looks only for functions whose names contain the
242 string you specify, you must use ingenuity in choosing the string.  If
243 you are looking for commands for killing backwards and @kbd{C-h a
244 kill-backwards @key{RET}} doesn't reveal any, don't give up.  Try just
245 @kbd{kill}, or just @kbd{backwards}, or just @kbd{back}.  Be persistent.
246 Pretend you are playing Adventure.  Also note that you can use a regular
247 expression as the argument, for more flexibility (@pxref{Regexps}).
248
249   Here is a set of arguments to give to @kbd{C-h a} that covers many
250 classes of SXEmacs commands, since there are strong conventions for
251 naming the standard SXEmacs commands.  By giving you a feel for the
252 naming conventions, this set should also serve to aid you in developing
253 a technique for picking @code{apropos} strings.
254
255 @quotation
256 char, line, word, sentence, paragraph, region, page, sexp, list, defun,
257 rect, buffer, frame, window, face, file, dir, register, mode, beginning,
258 end, forward, backward, next, previous, up, down, search, goto, kill,
259 delete, mark, insert, yank, fill, indent, case, change, set, what, list,
260 find, view, describe, default.
261 @end quotation
262
263 @findex apropos
264   To list all Lisp symbols that contain a match for a regexp, not just
265 the ones that are defined as commands, use the command @kbd{M-x apropos}
266 instead of @kbd{C-h A}.  This command does not check key bindings by
267 default; specify a numeric argument if you want it to check them.
268
269 @findex apropos-documentation
270   The @code{apropos-documentation} command is like @code{apropos} except
271 that it searches documentation strings for matches for the specified
272 regular expression.
273
274 @findex apropos-value
275   The @code{apropos-value} command is like @code{apropos} except that it
276 searches symbols' values for matches for the specified regular
277 expression.  This command does not check function definitions or
278 property lists by default; specify a numeric argument if you want it to
279 check them.
280
281 @vindex apropos-do-all
282   If the variable @code{apropos-do-all} is non-@code{nil}, the commands
283 above all behave as if they had been given a prefix argument.
284
285   If you want more information about a function definition, variable or
286 symbol property listed in the Apropos buffer, you can click on it with
287 @kbd{Mouse-2} or move there and type @key{RET}.
288
289 @node Library Keywords, Help Mode, Apropos, Help
290 @section Keyword Search for Lisp Libraries
291
292 @kindex C-h p
293 @findex finder-by-keyword
294 The @kbd{C-h p} command lets you search the standard Emacs Lisp
295 libraries by topic keywords.  Here is a partial list of keywords you can
296 use:
297
298 @display
299 abbrev        abbreviation handling, typing shortcuts, macros
300 bib           code related to the `bib' bibliography processor
301 c             C, C++, and Objective-C language support
302 calendar      calendar and time management support
303 comm          communications, networking, remote access to files
304 data          support for editing files of data
305 docs          support for Emacs documentation
306 dumped        files preloaded into Emacs
307 emulations    emulations of other editors
308 extensions    Emacs Lisp language extensions
309 faces         support for multiple fonts
310 frames        support for Emacs frames and window systems
311 games         games, jokes and amusements
312 hardware      support for interfacing with exotic hardware
313 help          support for on-line help systems
314 hypermedia    support for links between text or other media types
315 i18n          internationalization and alternate character-set support
316 internal      code for Emacs internals, build process, defaults
317 languages     specialized modes for editing programming languages
318 lisp          Lisp support, including Emacs Lisp
319 local         code local to your site
320 maint         maintenance aids for the Emacs development group
321 mail          modes for electronic-mail handling
322 matching      various sorts of searching and matching
323 mouse         mouse support
324 mule          multi-language extensions
325 news          support for netnews reading and posting
326 oop           support for object-oriented programming
327 outlines      support for hierarchical outlining
328 processes     process, subshell, compilation, and job control support
329 terminals     support for terminal types
330 tex           code related to the TeX formatter
331 tools         programming tools
332 unix          front-ends/assistants for, or emulators of, UNIX features
333 vms           support code for vms
334 wp            word processing
335 @end display
336
337 @node Help Mode, Misc Help, Library Keywords, Help
338 @section Help Mode Commands
339
340   Help buffers provide the commands of View mode (@pxref{Misc File
341 Ops}), plus a few special commands of their own.
342
343 @table @kbd
344 @item @key{SPC}
345 Scroll forward.
346 @item @key{DEL}
347 @itemx @key{BS}
348 Scroll backward.
349 @c @item @key{RET}
350 @c Follow a cross reference at point.
351 @c @item @key{TAB}
352 @c Move point forward to the next cross reference.
353 @c @item S-@key{TAB}
354 @c Move point back to the previous cross reference.
355 @c @item Mouse-2
356 @c Follow a cross reference that you click on.
357 @end table
358
359   When a command name (@pxref{M-x,, Running Commands by Name}) or
360 variable name (@pxref{Variables}) appears in the documentation, it
361 normally appears inside paired single-quotes.
362
363 @node Misc Help,  , Help Mode, Help
364 @section Other Help Commands
365
366 @kindex C-h i
367 @findex info
368 @cindex Info
369 @cindex manuals, on-line
370 @cindex on-line manuals
371   @kbd{C-h i} (@code{info}) runs the Info program, which is used for
372 browsing through structured documentation files.  The entire SXEmacs manual
373 is available within Info.  Eventually all the documentation of the GNU
374 system will be available.  Type @kbd{h} after entering Info to run
375 a tutorial on using Info.
376
377   If you specify a numeric argument, @kbd{C-h i} prompts for the name of
378 a documentation file.  This way, you can browse a file which doesn't
379 have an entry in the top-level Info menu.  It is also handy when you
380 need to get to the documentation quickly, and you know the exact name of
381 the file.
382
383 @kindex C-h C-f
384 @kindex C-h C-k
385 @findex Info-elisp-ref
386 @findex Info-goto-emacs-command-node
387 @findex Info-goto-emacs-key-command-node
388   There are two special help commands for accessing SXEmacs documentation
389 through Info.  @kbd{C-h C-f @var{function} @key{RET}} enters Info and
390 goes straight to the documentation of the SXEmacs function
391 @var{function}.  @kbd{C-h C-k @var{key}} enters Info and goes straight
392 to the documentation of the key @var{key}.  These two keys run the
393 commands @code{Info-elisp-ref} and
394 @code{Info-goto-emacs-key-command-node}.  (GNU Emacs binds @kbd{C-h C-f}
395 to @code{Info-goto-emacs-command-node}, but this is less helpful to
396 programmers.)
397
398 @kindex C-h l
399 @findex view-lossage
400   If something surprising happens, and you are not sure what commands you
401 typed, use @kbd{C-h l} (@code{view-lossage}).  @kbd{C-h l} prints the last
402 100 command characters you typed in.  If you see commands that you don't
403 know, you can use @kbd{C-h c} to find out what they do.
404
405 @kindex C-h m
406 @findex describe-mode
407   SXEmacs has several major modes.  Each mode redefines a few keys and
408 makes a few other changes in how editing works.  @kbd{C-h m}
409 (@code{describe-mode}) prints documentation on the current major mode,
410 which normally describes all the commands that are changed in this mode.
411
412 @kindex C-h b
413 @findex describe-bindings
414   @kbd{C-h b} (@code{describe-bindings}) and @kbd{C-h s}
415 (@code{describe-syntax}) present information about the current SXEmacs
416 mode that is not covered by @kbd{C-h m}.  @kbd{C-h b} displays a list of
417 all the key bindings currently in effect, with the local bindings of the
418 current major mode first, followed by the global bindings (@pxref{Key
419 Bindings}).  @kbd{C-h s} displays the contents of the syntax table with
420 explanations of each character's syntax (@pxref{Syntax}).
421
422   You can get a similar list for a particular prefix key by typing
423 @kbd{C-h} after the prefix key.  (There are a few prefix keys for which
424 this does not work---those that provide their own bindings for
425 @kbd{C-h}.  One of these is @key{ESC}, because @kbd{@key{ESC} C-h} is
426 actually @kbd{C-M-h}, which marks a defun.)
427
428 @kindex C-h F
429 @findex sxemacs-local-faq
430 @kindex C-h n
431 @findex view-emacs-news
432 @kindex C-h t
433 @findex help-with-tutorial
434 @kindex C-h C-c
435 @findex describe-copying
436 @kindex C-h C-d
437 @findex describe-distribution
438 @kindex C-h C-w
439 @findex describe-no-warranty
440   The other @kbd{C-h} options display various files of useful
441 information.  @kbd{C-h C-w} (@code{describe-no-warranty}) displays the
442 full details on the complete absence of warranty for SXEmacs.  @kbd{C-h
443 n} (@code{view-emacs-news}) displays the file @file{sxemacs/etc/NEWS},
444 which contains documentation on SXEmacs changes arranged chronologically.
445 @kbd{C-h F} (@code{sxemacs-local-faq}) displays local version of the
446 SXEmacs frequently-answered-questions-list.  @kbd{C-h t}
447 (@code{help-with-tutorial}) displays the learn-by-doing SXEmacs
448 tutorial. @kbd{C-h C-c} (@code{describe-copying}) displays the file
449 @file{sxemacs/etc/COPYING}, which tells you the conditions you must obey
450 in distributing copies of SXEmacs.  @kbd{C-h C-d}
451 (@code{describe-distribution}) displays another file named
452 @file{sxemacs/etc/DISTRIB}, which tells you how you can order a copy of
453 the latest version of SXEmacs.