1 @c This is part of the Emacs manual.
2 @c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2017 Free Software
4 @c See file emacs.texi for copying conditions.
9 @cindex self-documentation
16 Emacs provides a wide variety of help commands, all accessible
17 through the prefix key @kbd{C-h} (or, equivalently, the function key
18 @key{F1}). These help commands are described in the following
19 sections. You can also type @kbd{C-h C-h} to view a list of help
20 commands (@code{help-for-help}). You can scroll the list with
21 @key{SPC} and @key{DEL}, then type the help command you want. To
22 cancel, type @kbd{C-g}.
24 Many help commands display their information in a special @dfn{help
25 buffer}. In this buffer, you can type @key{SPC} and @key{DEL} to
26 scroll and type @key{RET} to follow hyperlinks. @xref{Help Mode}.
28 @cindex searching documentation efficiently
29 @cindex looking for a subject in documentation
30 If you are looking for a certain feature, but don't know what it is
31 called or where to look, we recommend three methods. First, try an
32 apropos command, then try searching the manual index, then look in the
33 FAQ and the package keywords.
36 @item C-h a @var{topics} @key{RET}
37 This searches for commands whose names match the argument
38 @var{topics}. The argument can be a keyword, a list of keywords, or a
39 regular expression (@pxref{Regexps}). @xref{Apropos}.
41 @item C-h i d m emacs @key{RET} i @var{topic} @key{RET}
42 This searches for @var{topic} in the indices of the Emacs Info manual,
43 displaying the first match found. Press @kbd{,} to see subsequent
44 matches. You can use a regular expression as @var{topic}.
46 @item C-h i d m emacs @key{RET} s @var{topic} @key{RET}
47 Similar, but searches the @emph{text} of the manual rather than the
51 This displays the Emacs FAQ, using Info.
54 This displays the available Emacs packages based on keywords.
55 @xref{Package Keywords}.
58 @kbd{C-h} or @key{F1} mean ``help'' in various other contexts as
59 well. For instance, you can type them after a prefix key to view a
60 list of the keys that can follow the prefix key. (You can also use
61 @kbd{?} in this context. A few prefix keys don't support @kbd{C-h}
62 or @kbd{?} in this way, because they define other meanings for those
63 inputs, but they all support @key{F1}.)
66 * Help Summary:: Brief list of all Help commands.
67 * Key Help:: Asking what a key does in Emacs.
68 * Name Help:: Asking about a command, variable or function name.
69 * Apropos:: Asking what pertains to a given topic.
70 * Help Mode:: Special features of Help mode and Help buffers.
71 * Package Keywords:: Finding Lisp libraries by keywords (topics).
72 * Language Help:: Help relating to international language support.
73 * Misc Help:: Other help commands.
74 * Help Files:: Commands to display auxiliary help files.
75 * Help Echo:: Help on active text and tooltips (``balloon help'').
86 Here is a summary of help commands for accessing the built-in
87 documentation. Most of these are described in more detail in the
91 @item C-h a @var{topics} @key{RET}
92 Display a list of commands whose names match @var{topics}
93 (@code{apropos-command}).
95 Display all active key bindings; minor mode bindings first, then those
96 of the major mode, then global bindings (@code{describe-bindings}).
98 Show the name of the command that the key sequence @var{key} is bound
99 to (@code{describe-key-briefly}). Here @kbd{c} stands for
100 ``character''. For more extensive information on @var{key}, use
102 @item C-h d @var{topics} @key{RET}
103 Display the commands and variables whose documentation matches
104 @var{topics} (@code{apropos-documentation}).
106 Display the @file{*Messages*} buffer
107 (@code{view-echo-area-messages}).
108 @item C-h f @var{function} @key{RET}
109 Display documentation on the Lisp function named @var{function}
110 (@code{describe-function}). Since commands are Lisp functions,
111 this works for commands too.
113 Display the @file{HELLO} file, which shows examples of various character
116 Run Info, the GNU documentation browser (@code{info}). The Emacs
117 manual is available in Info.
118 @item C-h k @var{key}
119 Display the name and documentation of the command that @var{key} runs
120 (@code{describe-key}).
122 Display a description of your last 300 keystrokes
123 (@code{view-lossage}).
125 Display documentation of the current major mode and minor modes
126 (@code{describe-mode}).
128 Display news of recent Emacs changes (@code{view-emacs-news}).
129 @item C-h o @var{symbol}
130 Display documentation of the Lisp symbol named @var{symbol}
131 (@code{describe-symbol}). This will show the documentation of all
132 kinds of symbols: functions, variables, and faces.
134 Find packages by topic keyword (@code{finder-by-keyword}). This lists
135 packages using a package menu buffer. @xref{Packages}.
136 @item C-h P @var{package} @key{RET}
137 Display documentation about the specified package
138 (@code{describe-package}).
140 Display the Emacs manual in Info (@code{info-emacs-manual}).
142 Display the contents of the current @dfn{syntax table}
143 (@code{describe-syntax}). The syntax table says which characters are
144 opening delimiters, which are parts of words, and so on. @xref{Syntax
145 Tables,, Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for
148 Enter the Emacs interactive tutorial (@code{help-with-tutorial}).
149 @item C-h v @var{var} @key{RET}
150 Display the documentation of the Lisp variable @var{var}
151 (@code{describe-variable}).
152 @item C-h w @var{command} @key{RET}
153 Show which keys run the command named @var{command} (@code{where-is}).
154 @item C-h C @var{coding} @key{RET}
155 Describe the coding system @var{coding}
156 (@code{describe-coding-system}).
157 @item C-h C @key{RET}
158 Describe the coding systems currently in use.
159 @item C-h F @var{command} @key{RET}
160 Enter Info and go to the node that documents the Emacs command
161 @var{command} (@code{Info-goto-emacs-command-node}).
162 @item C-h I @var{method} @key{RET}
163 Describe the input method @var{method} (@code{describe-input-method}).
164 @item C-h K @var{key}
165 Enter Info and go to the node that documents the key sequence
166 @var{key} (@code{Info-goto-emacs-key-command-node}).
167 @item C-h L @var{language-env} @key{RET}
168 Display information on the character sets, coding systems, and input
169 methods used in language environment @var{language-env}
170 (@code{describe-language-environment}).
171 @item C-h S @var{symbol} @key{RET}
172 Display the Info documentation on symbol @var{symbol} according to the
173 programming language you are editing (@code{info-lookup-symbol}).
175 Display the help message for a special text area, if point is in one
176 (@code{display-local-help}). (These include, for example, links in
177 @file{*Help*} buffers.)
181 @section Documentation for a Key
183 @findex describe-key-briefly
185 The help commands to get information about a key sequence are
186 @kbd{C-h c} (@code{describe-key-briefly}) and @kbd{C-h k}
187 (@code{describe-key}).
190 @kbd{C-h c @var{key}} displays in the echo area the name of the
191 command that @var{key} is bound to. For example, @kbd{C-h c C-f}
192 displays @samp{forward-char}.
194 @cindex documentation string
196 @kbd{C-h k @var{key}} is similar but gives more information: it
197 displays a help buffer containing the command's @dfn{documentation
198 string}, which describes exactly what the command does.
201 @findex Info-goto-emacs-key-command-node
202 @kbd{C-h K @var{key}} displays the section of the Emacs manual that
203 describes the command corresponding to @var{key}.
205 @kbd{C-h c}, @kbd{C-h k} and @kbd{C-h K} work for any sort of key
206 sequences, including function keys, menus, and mouse events (except
207 that @kbd{C-h c} ignores mouse movement events). For instance, after
208 @kbd{C-h k} you can select a menu item from the menu bar, to view the
209 documentation string of the command it runs.
213 @kbd{C-h w @var{command} @key{RET}} lists the keys that are bound to
214 @var{command}. It displays the list in the echo area. If it says the
215 command is not on any key, that means you must use @kbd{M-x} to run
216 it. @kbd{C-h w} runs the command @code{where-is}.
219 @section Help by Command or Variable Name
222 @findex describe-function
223 @kbd{C-h f @var{function} @key{RET}} (@code{describe-function})
224 displays the documentation of Lisp function @var{function}, in a
225 window. Since commands are Lisp functions, you can use this method to
226 view the documentation of any command whose name you know. For
230 C-h f auto-fill-mode @key{RET}
234 displays the documentation of @code{auto-fill-mode}. This is the only
235 way to get the documentation of a command that is not bound to any key
236 (one which you would normally run using @kbd{M-x}).
238 @kbd{C-h f} is also useful for Lisp functions that you use in a Lisp
239 program. For example, if you have just written the expression
240 @code{(make-vector len)} and want to check that you are using
241 @code{make-vector} properly, type @kbd{C-h f make-vector @key{RET}}.
242 Because @kbd{C-h f} allows all function names, not just command names,
243 you may find that some of your favorite completion abbreviations that
244 work in @kbd{M-x} don't work in @kbd{C-h f}. An abbreviation that is
245 unique among command names may not be unique among all function names.
247 If you type @kbd{C-h f @key{RET}}, it describes the function called
248 by the innermost Lisp expression in the buffer around point,
249 @emph{provided} that function name is a valid, defined Lisp function.
250 (That name appears as the default while you enter the argument.) For
251 example, if point is located following the text @samp{(make-vector
252 (car x)}, the innermost list containing point is the one that starts
253 with @samp{(make-vector}, so @kbd{C-h f @key{RET}} describes the
254 function @code{make-vector}.
256 @kbd{C-h f} is also useful just to verify that you spelled a
257 function name correctly. If the minibuffer prompt for @kbd{C-h f}
258 shows the function name from the buffer as the default, it means that
259 name is defined as a Lisp function. Type @kbd{C-g} to cancel the
260 @kbd{C-h f} command if you don't really want to view the
264 @findex describe-variable
265 @kbd{C-h v} (@code{describe-variable}) is like @kbd{C-h f} but
266 describes Lisp variables instead of Lisp functions. Its default is
267 the Lisp symbol around or before point, if that is the name of a
268 defined Lisp variable. @xref{Variables}.
270 Help buffers that describe Emacs variables and functions normally
271 have hyperlinks to the corresponding source code, if you have the
272 source files installed (@pxref{Hyperlinking}).
275 @findex Info-goto-emacs-command-node
276 To find a command's documentation in a manual, use @kbd{C-h F}
277 (@code{Info-goto-emacs-command-node}). This knows about various
278 manuals, not just the Emacs manual, and finds the right one.
281 @findex describe-symbol
282 @kbd{C-h o} (@code{describe-symbol}) is like @kbd{C-h f} and
283 @kbd{C-h v}, but it describes any symbol, be it a function, a
284 variable, or a face. If the symbol has more than one definition, like
285 it has both definition as a function and as a variable, this command
286 will show the documentation of all of them, one after the other.
292 The @dfn{apropos} commands answer questions like, ``What are the
293 commands for working with files?'' More precisely, you specify an
294 @dfn{apropos pattern}, which means either a word, a list of words, or
295 a regular expression.
297 Each of the following apropos commands reads an apropos pattern in
298 the minibuffer, searches for items that match the pattern, and
299 displays the results in a different window.
304 @findex apropos-command
305 Search for commands (@code{apropos-command}). With a prefix argument,
306 search for noninteractive functions too.
310 Search for functions and variables. Both interactive functions
311 (commands) and noninteractive functions can be found by this.
313 @item M-x apropos-user-option
314 @findex apropos-user-option
315 Search for user-customizable variables. With a prefix argument,
316 search for non-customizable variables too.
318 @item M-x apropos-variable
319 @findex apropos-variable
320 Search for variables. With a prefix argument, search for
321 customizable variables only.
323 @item M-x apropos-local-variable
324 @findex apropos-local-variable
325 Search for buffer-local variables.
327 @item M-x apropos-value
328 @findex apropos-value
329 Search for variables whose values match the specified pattern. With a
330 prefix argument, search also for functions with definitions matching
331 the pattern, and Lisp symbols with properties matching the pattern.
333 @item M-x apropos-local-value
334 @findex apropos-local-value
335 Search for buffer-local variables whose values match the specified
340 @findex apropos-documentation
341 Search for functions and variables whose documentation strings match
342 the specified pattern (@code{apropos-documentation}).
345 The simplest kind of apropos pattern is one word. Anything
346 containing that word matches the pattern. Thus, to find commands that
347 work on files, type @kbd{C-h a file @key{RET}}. This displays a list
348 of all command names that contain @samp{file}, including
349 @code{copy-file}, @code{find-file}, and so on. Each command name
350 comes with a brief description and a list of keys you can currently
351 invoke it with. In our example, it would say that you can invoke
352 @code{find-file} by typing @kbd{C-x C-f}.
354 For more information about a function definition, variable or symbol
355 property listed in an apropos buffer, you can click on it with
356 @kbd{mouse-1} or @kbd{mouse-2}, or move there and type @key{RET}.
358 When you specify more than one word in the apropos pattern, a name
359 must contain at least two of the words in order to match. Thus, if
360 you are looking for commands to kill a chunk of text before point, you
361 could try @kbd{C-h a kill back backward behind before @key{RET}}. The
362 real command name @code{kill-backward} will match that; if there were
363 a command @code{kill-text-before}, it would also match, since it
364 contains two of the specified words.
366 For even greater flexibility, you can specify a regular expression
367 (@pxref{Regexps}). An apropos pattern is interpreted as a regular
368 expression if it contains any of the regular expression special
369 characters, @samp{^$*+?.\[}.
371 Following the conventions for naming Emacs commands, here are some
372 words that you'll find useful in apropos patterns. By using them in
373 @kbd{C-h a}, you will also get a feel for the naming conventions.
376 char, line, word, sentence, paragraph, region, page, sexp, list, defun,
377 rect, buffer, frame, window, face, file, dir, register, mode, beginning, end,
378 forward, backward, next, previous, up, down, search, goto, kill, delete,
379 mark, insert, yank, fill, indent, case, change, set, what, list, find,
380 view, describe, default.
383 @vindex apropos-do-all
384 If the variable @code{apropos-do-all} is non-@code{nil}, most
385 apropos commands behave as if they had been given a prefix argument.
386 There is one exception: @code{apropos-variable} without a prefix
387 argument will always search for all variables, no matter what the
388 value of @code{apropos-do-all} is.
390 @vindex apropos-sort-by-scores
391 @cindex apropos search results, order by score
392 @vindex apropos-documentation-sort-by-scores
393 By default, all apropos commands except @code{apropos-documentation}
394 list their results in alphabetical order. If the variable
395 @code{apropos-sort-by-scores} is non-@code{nil}, these commands
396 instead try to guess the relevance of each result, and display the
397 most relevant ones first. The @code{apropos-documentation} command
398 lists its results in order of relevance by default; to list them in
399 alphabetical order, change the variable
400 @code{apropos-documentation-sort-by-scores} to @code{nil}.
403 @section Help Mode Commands
405 Help buffers provide the same commands as View mode (@pxref{View
406 Mode}); for instance, @key{SPC} scrolls forward, and @key{DEL} or
407 @kbd{S-@key{SPC}} scrolls backward. A few special commands are also
412 Follow a cross reference at point (@code{help-follow}).
414 Move point forward to the next hyperlink (@code{forward-button}).
416 Move point back to the previous hyperlink (@code{backward-button}).
419 Follow a hyperlink that you click on.
421 Show all documentation about the symbol at point
422 (@code{help-follow-symbol}).
425 Go forward to the next help topic (@code{help-go-forward}).
428 Go back to the previous help topic (@code{help-go-back}).
434 @findex help-go-forward
435 @kindex RET @r{(Help mode)}
436 @kindex C-c C-b @r{(Help mode)}
437 @kindex l @r{(Help mode)}
438 @kindex C-c C-f @r{(Help mode)}
439 @kindex r @r{(Help mode)}
440 When a function name, variable name, or face name (@pxref{Faces})
441 appears in the documentation in the help buffer, it is normally an
442 underlined @dfn{hyperlink}. To view the associated documentation,
443 move point there and type @key{RET} (@code{help-follow}), or click on
444 the hyperlink with @kbd{mouse-1} or @kbd{mouse-2}. Doing so replaces
445 the contents of the help buffer; to retrace your steps, type @kbd{C-c
446 C-b} or @kbd{l} (@code{help-go-back}). While retracing your steps,
447 you can go forward by using @kbd{C-c C-f} or @kbd{r}
448 (@code{help-go-forward}).
450 @cindex URL, viewing in help
451 @cindex help, viewing web pages
452 @cindex viewing web pages in help
453 @cindex web pages, viewing in help
455 A help buffer can also contain hyperlinks to Info manuals, source
456 code definitions, and URLs (web pages). The first two are opened in
457 Emacs, and the third using a web browser via the @code{browse-url}
458 command (@pxref{Browse-URL}).
460 @kindex TAB @r{(Help mode)}
461 @findex forward-button
462 @kindex S-TAB @r{(Help mode)}
463 @findex backward-button
464 In a help buffer, @key{TAB} (@code{forward-button}) moves point
465 forward to the next hyperlink, while @kbd{S-@key{TAB}}
466 (@code{backward-button}) point back to the previous hyperlink. These
467 commands act cyclically; for instance, typing @key{TAB} at the last
468 hyperlink moves back to the first hyperlink.
470 To view all documentation about any symbol in the text, move point
471 to there and type @kbd{C-c C-c} (@code{help-follow-symbol}). This
472 shows all available documentation about the symbol---as a variable,
473 function and/or face.
475 @node Package Keywords
476 @section Keyword Search for Packages
479 Most optional features in Emacs are grouped into @dfn{packages}.
480 Emacs contains several hundred built-in packages, and more can be
481 installed over the network (@pxref{Packages}).
484 @findex finder-by-keyword
485 To make it easier to find packages related to a topic, most packages
486 are associated with one or more @dfn{keywords} based on what they do.
487 Type @kbd{C-h p} (@code{finder-by-keyword}) to bring up a list of
488 package keywords, together with a description of what the keywords
489 mean. To view a list of packages for a given keyword, type @key{RET}
490 on that line; this displays the list of packages in a Package Menu
491 buffer (@pxref{Package Menu}).
493 @findex describe-package
495 @kbd{C-h P} (@code{describe-package}) prompts for the name of a
496 package, and displays a help buffer describing the attributes of the
497 package and the features that it implements. The buffer lists the
498 keywords that relate to the package in the form of buttons. Click on
499 a button to see other packages related to that keyword.
502 @section Help for International Language Support
504 For information on a specific language environment (@pxref{Language
505 Environments}), type @kbd{C-h L}
506 (@code{describe-language-environment}). This displays a help buffer
507 describing the languages supported by the language environment, and
508 listing the associated character sets, coding systems, and input
509 methods, as well as some sample text for that language environment.
511 The command @kbd{C-h h} (@code{view-hello-file}) displays the file
512 @file{etc/HELLO}, which demonstrates various character sets by showing
513 how to say ``hello'' in many languages.
515 The command @kbd{C-h I} (@code{describe-input-method}) describes an
516 input method---either a specified input method, or by default the
517 input method currently in use. @xref{Input Methods}.
519 The command @kbd{C-h C} (@code{describe-coding-system}) describes
520 coding systems---either a specified coding system, or the ones
521 currently in use. @xref{Coding Systems}.
524 @section Other Help Commands
529 @cindex manuals, included
530 @kbd{C-h i} (@code{info}) runs the Info program, which browses
531 structured documentation files. The entire Emacs manual is available
532 within Info, along with many other manuals for the GNU system. Type
533 @kbd{h} after entering Info to run a tutorial on using Info.
535 @cindex find Info manual by its file name
536 With a numeric argument @var{n}, @kbd{C-h i} selects the Info buffer
537 @samp{*info*<@var{n}>}. This is useful if you want to browse multiple
538 Info manuals simultaneously. If you specify just @kbd{C-u} as the
539 prefix argument, @kbd{C-h i} prompts for the name of a documentation
540 file, so you can browse a file which doesn't have an entry in the
543 The help commands @kbd{C-h F @var{function} @key{RET}} and @kbd{C-h
544 K @var{key}}, described above, enter Info and go straight to the
545 documentation of @var{function} or @var{key}.
548 @findex info-lookup-symbol
549 When editing a program, if you have an Info version of the manual
550 for the programming language, you can use @kbd{C-h S}
551 (@code{info-lookup-symbol}) to find an entry for a symbol (keyword,
552 function or variable) in the proper manual. The details of how this
553 command works depend on the major mode.
557 If something surprising happens, and you are not sure what you typed,
558 use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} displays your last
559 300 input keystrokes and the commands they invoked. If you see
560 commands that you are not familiar with, you can use @kbd{C-h k} or
561 @kbd{C-h f} to find out what they do.
564 @findex view-echo-area-messages
565 To review recent echo area messages, use @kbd{C-h e}
566 (@code{view-echo-area-messages}). This displays the buffer
567 @file{*Messages*}, where those messages are kept.
570 @findex describe-mode
571 Each Emacs major mode typically redefines a few keys and makes other
572 changes in how editing works. @kbd{C-h m} (@code{describe-mode})
573 displays documentation on the current major mode, which normally
574 describes the commands and features that are changed in this mode, and
575 also its key bindings.
578 @findex describe-bindings
580 @findex describe-syntax
581 @kbd{C-h b} (@code{describe-bindings}) and @kbd{C-h s}
582 (@code{describe-syntax}) show other information about the current
583 environment within Emacs. @kbd{C-h b} displays a list of all the key
584 bindings now in effect: first the local bindings of the current minor
585 modes, then the local bindings defined by the current major mode, and
586 finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s}
587 displays the contents of the syntax table, with explanations of each
588 character's syntax (@pxref{Syntax Tables,, Syntax Tables, elisp, The
589 Emacs Lisp Reference Manual}).
591 @findex describe-prefix-bindings
592 You can get a list of subcommands for a particular prefix key by
593 typing @kbd{C-h}, @kbd{?}, or @key{F1}
594 (@code{describe-prefix-bindings}) after the prefix key. (There are a
595 few prefix keys for which not all of these keys work---those that
596 provide their own bindings for that key. One of these prefix keys
597 is @key{ESC}, because @kbd{@key{ESC} C-h} is actually @kbd{C-M-h},
598 which marks a defun. However, @kbd{@key{ESC} @key{F1}} and
599 @kbd{@key{ESC} ?} work fine.)
604 Apart from the built-in documentation and manuals, Emacs contains
605 several other files describing topics like copying conditions, release
606 notes, instructions for debugging and reporting bugs, and so forth.
607 You can use the following commands to view these files. Apart from
608 @kbd{C-h g}, they all have the form @kbd{C-h C-@var{char}}.
611 @findex describe-copying
613 @findex view-emacs-debugging
615 @findex view-external-packages
617 @findex view-emacs-FAQ
619 @findex describe-gnu-project
621 @findex view-order-manuals
623 @findex view-emacs-news
625 @findex describe-distribution
627 @findex view-emacs-problems
629 @findex view-emacs-todo
631 @findex describe-no-warranty
635 Display the rules under which you can copy and redistribute Emacs
636 (@code{describe-copying}).
638 Display help for debugging Emacs (@code{view-emacs-debugging}).
640 Display information about where to get external packages
641 (@code{view-external-packages}).
643 Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}).
645 Visit a @uref{https://www.gnu.org} page with information about the GNU
646 Project (@code{describe-gnu-project}).
648 Display information about ordering printed copies of Emacs manuals
649 (@code{view-order-manuals}).
651 Display the news, which lists the new features in this
652 version of Emacs (@code{view-emacs-news}).
654 Display how to order or download the latest version of
655 Emacs and other GNU software (@code{describe-distribution}).
657 Display the list of known Emacs problems, sometimes with suggested
658 workarounds (@code{view-emacs-problems}).
660 Display the Emacs to-do list (@code{view-emacs-todo}).
662 Display the full details on the complete absence of warranty for GNU
663 Emacs (@code{describe-no-warranty}).
667 @section Help on Active Text and Tooltips
672 In Emacs, stretches of @dfn{active text} (text that does something
673 special in response to mouse clicks or @key{RET}) often have
674 associated help text. This includes hyperlinks in Emacs buffers, as
675 well as parts of the mode line. On graphical displays, as well as
676 some text terminals which support mouse tracking, moving the mouse
677 over the active text displays the help text as a @dfn{tooltip}.
681 @findex display-local-help
682 @vindex help-at-pt-display-when-idle
683 On terminals that don't support mouse-tracking, you can display the
684 help text for active buffer text at point by typing @kbd{C-h .}
685 (@code{display-local-help}). This shows the help text in the echo
686 area. To display help text automatically whenever it is available at
687 point, set the variable @code{help-at-pt-display-when-idle} to