aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2001-08-20 03:57:13 +0000
committerRichard M. Stallman2001-08-20 03:57:13 +0000
commite79c6b89b38c84c475b382b3f1b4feb46f40fc09 (patch)
treefd5f14314654380bf2f6ca4733b537356b928f11
parente6fef0a3b30880f18851100f1af61e9312cb066b (diff)
downloademacs-e79c6b89b38c84c475b382b3f1b4feb46f40fc09.tar.gz
emacs-e79c6b89b38c84c475b382b3f1b4feb46f40fc09.zip
Many clarifications.
-rw-r--r--man/programs.texi250
1 files changed, 131 insertions, 119 deletions
diff --git a/man/programs.texi b/man/programs.texi
index 5c0cb9a9aad..df649b99b43 100644
--- a/man/programs.texi
+++ b/man/programs.texi
@@ -7,8 +7,8 @@
7@cindex C editing 7@cindex C editing
8@cindex program editing 8@cindex program editing
9 9
10 Emacs provides many features to facilitate editing programs. These 10 Emacs provides many features to facilitate editing programs. Some
11features can: 11of these features can
12 12
13@itemize @bullet 13@itemize @bullet
14@item 14@item
@@ -24,6 +24,8 @@ Balance parentheses (@pxref{Parentheses}).
24Highlight program syntax (@pxref{Font Lock}). 24Highlight program syntax (@pxref{Font Lock}).
25@end itemize 25@end itemize
26 26
27 This chapter describes these features and many more.
28
27@menu 29@menu
28* Program Modes:: Major modes for editing programs. 30* Program Modes:: Major modes for editing programs.
29* Defuns:: Commands to operate on major top-level parts 31* Defuns:: Commands to operate on major top-level parts
@@ -50,15 +52,15 @@ Highlight program syntax (@pxref{Font Lock}).
50@xref{Major Modes}. A programming language major mode typically 52@xref{Major Modes}. A programming language major mode typically
51specifies the syntax of expressions, the customary rules for 53specifies the syntax of expressions, the customary rules for
52indentation, how to do syntax highlighting for the language, and how 54indentation, how to do syntax highlighting for the language, and how
53to find the beginning of a function definition. They often provide 55to find the beginning of a function definition. It often customizes
54facilities for compiling and debugging programs as well. 56or provides facilities for compiling and debugging programs as well.
55 57
56 Ideally, Emacs should provide a major mode for each programming 58 Ideally, Emacs should provide a major mode for each programming
57language that you might want to edit; if it doesn't have a mode for 59language that you might want to edit; if it doesn't have a mode for
58your favorite language, you can contribute one. But often the mode 60your favorite language, you can contribute one. But often the mode
59for one language can serve for other syntactically similar languages. 61for one language can serve for other syntactically similar languages.
60The major mode for language @var{l} is called @code{@var{l}-mode}, 62The major mode for language @var{l} is called @code{@var{l}-mode},
61and you can enable it by typing @kbd{M-x @var{l}-mode @key{RET}}. 63and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
62@xref{Choosing Modes}. 64@xref{Choosing Modes}.
63 65
64@cindex Perl mode 66@cindex Perl mode
@@ -86,7 +88,7 @@ companion for font creation), Modula2, Objective-C, Octave, Pascal,
86Perl, Pike, PostScript, Prolog, Simula, Tcl, and VHDL. There is 88Perl, Pike, PostScript, Prolog, Simula, Tcl, and VHDL. There is
87also a major mode for makefiles, called Makefile mode. An alternative 89also a major mode for makefiles, called Makefile mode. An alternative
88mode for Perl is called CPerl mode. Modes are available for the 90mode for Perl is called CPerl mode. Modes are available for the
89scripting languages of the common Unix shells, VMS DCL, and 91scripting languages of the common GNU and Unix shells, VMS DCL, and
90MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for 92MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for
91editing various sorts of configuration files. 93editing various sorts of configuration files.
92 94
@@ -94,12 +96,12 @@ editing various sorts of configuration files.
94@findex c-electric-backspace 96@findex c-electric-backspace
95 In most programming languages, indentation should vary from line to 97 In most programming languages, indentation should vary from line to
96line to illustrate the structure of the program. So the major modes 98line to illustrate the structure of the program. So the major modes
97for program languages arrange for @key{TAB} to update the indentation 99for programming languages arrange for @key{TAB} to update the
98of the current line. They also rebind @key{DEL} to treat a tab as if 100indentation of the current line. They also rebind @key{DEL} to treat
99it were the equivalent number of spaces. This makes it possible to 101a tab as if it were the equivalent number of spaces; this lets you
100reduce indentation one column at a time without worrying whether it is 102delete one column of indentation without worrying whether the
101made up of spaces or tabs. Use @kbd{C-b C-d} to delete a tab 103whitespace consists of spaces or tabs. Use @kbd{C-b C-d} to delete a
102character before point, in these modes. 104tab character before point, in these modes.
103 105
104 Separate manuals are available for the modes for Ada (@pxref{Top, , Ada 106 Separate manuals are available for the modes for Ada (@pxref{Top, , Ada
105Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL 107Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL
@@ -240,51 +242,52 @@ command while point is between defuns, it uses the following defun.
240 In C mode, @kbd{C-M-h} runs the function @code{c-mark-function}, 242 In C mode, @kbd{C-M-h} runs the function @code{c-mark-function},
241which is almost the same as @code{mark-defun}; the difference is that 243which is almost the same as @code{mark-defun}; the difference is that
242it backs up over the argument declarations, function name and returned 244it backs up over the argument declarations, function name and returned
243data type so that the entire C function is inside the region. 245data type so that the entire C function is inside the region. This is
244@xref{Marking Objects}. This is an example of how major modes adjust 246an example of how major modes adjust the standard key bindings so that
245the standard key bindings so that they do their standard jobs in a way 247they do their standard jobs in a way better fitting a particular
246better fitting a particular language. Other major modes may adjust 248language. Other major modes may replace any or all of these key
247any or all of these key bindings for that purpose. 249bindings for that purpose.
248 250
249@node Imenu 251@node Imenu
250@subsection Imenu 252@subsection Imenu
251@cindex indexes of buffer contents 253@cindex index of buffer definitions
252@cindex buffer content indexes 254@cindex buffer definitions index
253@cindex tags 255@cindex tags
254 256
255 The Imenu facility offers a way to find the the major definitions in 257 The Imenu facility offers a way to find the the major definitions in
256a file by name. It is also useful in text formatter major modes, 258a file by name. It is also useful in text formatter major modes,
257where it treats each chapter, section, etc., as a definition. 259where it treats each chapter, section, etc., as a definition.
258(@pxref{Tags}, for a more powerful feature that handles multiple files 260(@xref{Tags}, for a more powerful feature that handles multiple files
259together.) 261together.)
260 262
261@findex imenu 263@findex imenu
262 If you type @kbd{M-x imenu}, it reads the name of a definition using 264 If you type @kbd{M-x imenu}, it reads the name of a definition using
263the minibuffer, then goes to that definition. You can use completion 265the minibuffer, then moves point to that definition. You can use
264to specify the name, and a complete list of possible names is always 266completion to specify the name; the command always displays the whole
265displayed. 267list of valid names.
266 268
267@findex imenu-add-menubar-index 269@findex imenu-add-menubar-index
268 Alternatively, you can bind the command @code{imenu} to a mouse 270 Alternatively, you can bind the command @code{imenu} to a mouse
269click. Then it displays mouse menus for you to select the definition 271click. Then it displays mouse menus for you to select a definition
270you want. You can also add the buffer's index to the menu bar by 272name. You can also add the buffer's index to the menu bar by calling
271calling @code{imenu-add-menubar-index}. If you want to have this 273@code{imenu-add-menubar-index}. If you want to have this menu bar
272menu bar item available for all buffers in a certain major mode, you 274item available for all buffers in a certain major mode, you can do
273can do this by adding @code{imenu-add-menubar-index} to its mode 275this by adding @code{imenu-add-menubar-index} to its mode hook. But
274hook. But then you will have to wait for the buffer to be searched 276if you have done that, you will have to wait each time you visit a
275for definitions, each time you visit a file which uses that mode. 277file in that mode, while Emacs finds all the definitions in that
278buffer.
276 279
277@vindex imenu-auto-rescan 280@vindex imenu-auto-rescan
278 When you change the contents of a buffer, if you add or delete 281 When you change the contents of a buffer, if you add or delete
279definitions, you can update the buffer's index to correspond to the 282definitions, you can update the buffer's index based on the
280new contents by invoking the @samp{*Rescan*} item in the menu. 283new contents by invoking the @samp{*Rescan*} item in the menu.
281Rescanning happens automatically if @code{imenu-auto-rescan} is 284Rescanning happens automatically you set @code{imenu-auto-rescan} to a
282non-@code{nil}. There is no need to rescan because of small changes 285non-@code{nil} value. There is no need to rescan because of small
283in the text. 286changes in the text.
284 287
285@vindex imenu-sort-function 288@vindex imenu-sort-function
286 You can customize the way the menus are sorted by setting the 289 You can customize the way the menus are sorted by setting the
287variable @code{imenu-sort-function}. By default names are ordered as 290variable @code{imenu-sort-function}. By default, names are ordered as
288they occur in the buffer; if you want alphabetic sorting, use the 291they occur in the buffer; if you want alphabetic sorting, use the
289symbol @code{imenu--sort-by-name} as the value. You can also 292symbol @code{imenu--sort-by-name} as the value. You can also
290define your own comparison function by writing Lisp code. 293define your own comparison function by writing Lisp code.
@@ -309,11 +312,11 @@ buffer.
309@vindex which-func-modes 312@vindex which-func-modes
310 To enable (or disable) Which Function mode, use the command @kbd{M-x 313 To enable (or disable) Which Function mode, use the command @kbd{M-x
311which-function-mode}. This command is global; it applies to all 314which-function-mode}. This command is global; it applies to all
312buffers, both existing ones and those yet to be created. However, this 315buffers, both existing ones and those yet to be created. However,
313only affects certain major modes, those listed in the value of 316it only takes effect in certain major modes, those listed in the value of
314@code{which-func-modes}. If the value is @code{t}, then Which Function 317@code{which-func-modes}. If the value is @code{t}, then Which
315mode applies to all major modes that know how to support it---which are 318Function mode applies to all major modes that know how to support
316the major modes that support Imenu. 319it---in other words, all the major modes that support Imenu.
317 320
318@node Program Indent 321@node Program Indent
319@section Indentation for Programs 322@section Indentation for Programs
@@ -348,7 +351,7 @@ Adjust indentation of current line.
348@item C-j 351@item C-j
349Equivalent to @key{RET} followed by @key{TAB} (@code{newline-and-indent}). 352Equivalent to @key{RET} followed by @key{TAB} (@code{newline-and-indent}).
350@item @key{LINEFEED} 353@item @key{LINEFEED}
351This key is a way to enter @kbd{C-j}, on some keyboards. 354This key, if the keyboard has it, is another way to enter @kbd{C-j}.
352@end table 355@end table
353 356
354@kindex TAB @r{(programming modes)} 357@kindex TAB @r{(programming modes)}
@@ -405,11 +408,11 @@ you have several commands available.
405@table @kbd 408@table @kbd
406@item C-M-q 409@item C-M-q
407Reindent all the lines within one parenthetical grouping(@code{indent-sexp}). 410Reindent all the lines within one parenthetical grouping(@code{indent-sexp}).
411@item C-M-\
412Reindent all lines in the region (@code{indent-region}).
408@item C-u @key{TAB} 413@item C-u @key{TAB}
409Shift an entire parenthetical grouping rigidly sideways so that its 414Shift an entire parenthetical grouping rigidly sideways so that its
410first line is properly indented. 415first line is properly indented.
411@item C-M-\
412Reindent all lines in the region (@code{indent-region}).
413@item M-x indent-code-rigidly 416@item M-x indent-code-rigidly
414Shift all the lines in the region rigidly sideways, but do not alter 417Shift all the lines in the region rigidly sideways, but do not alter
415lines that start inside comments and strings. 418lines that start inside comments and strings.
@@ -425,6 +428,11 @@ the line where the grouping starts is not changed; therefore, this
425changes only the relative indentation within the grouping, not its 428changes only the relative indentation within the grouping, not its
426overall indentation. To correct that as well, type @key{TAB} first. 429overall indentation. To correct that as well, type @key{TAB} first.
427 430
431 Another way to specify the range to be reindented is with the
432region. The command @kbd{C-M-\} (@code{indent-region}) applies
433@key{TAB} to every line whose first character is between point and
434mark.
435
428@kindex C-u TAB 436@kindex C-u TAB
429 If you like the relative indentation within a grouping, but not the 437 If you like the relative indentation within a grouping, but not the
430indentation of its first line, you can type @kbd{C-u @key{TAB}} to 438indentation of its first line, you can type @kbd{C-u @key{TAB}} to
@@ -436,13 +444,11 @@ line. It is clever, though, and does not alter lines that start
436inside strings, or C preprocessor lines when in C mode. 444inside strings, or C preprocessor lines when in C mode.
437 445
438@findex indent-code-rigidly 446@findex indent-code-rigidly
439 Another way to specify the range to be reindented is with the region. 447 You can also perform this operation on the region, using the command
440The command @kbd{C-M-\} (@code{indent-region}) applies @key{TAB} to 448@kbd{M-x indent-code-rigidly}. It rigidly shifts all the lines in the
441every line whose first character is between point and mark. The command 449region sideways, like @code{indent-rigidly} does (@pxref{Indentation
442@kbd{M-x indent-code-rigidly} rigidly shifts all the lines in the region 450Commands}). It doesn't alter the indentation of lines that start
443sideways, like @code{indent-rigidly} does (@pxref{Indentation 451inside a comment or a string, unless the region starts inside that
444Commands}), except that it doesn't alter the indentation of lines that
445start inside a comment or a string, unless the region starts inside that
446comment or string. 452comment or string.
447 453
448@node Lisp Indent 454@node Lisp Indent
@@ -482,7 +488,7 @@ function name. There are four possibilities for this property:
482This is the same as no property---use the standard indentation pattern. 488This is the same as no property---use the standard indentation pattern.
483@item @code{defun} 489@item @code{defun}
484Handle this function like a @samp{def} construct: treat the second 490Handle this function like a @samp{def} construct: treat the second
485line the start of a @dfn{body}. 491line as the start of a @dfn{body}.
486@item a number, @var{number} 492@item a number, @var{number}
487The first @var{number} arguments of the function are 493The first @var{number} arguments of the function are
488@dfn{distinguished} arguments; the rest are considered the body 494@dfn{distinguished} arguments; the rest are considered the body
@@ -593,8 +599,8 @@ definition.
593c-set-style}. Specify a style name as an argument (case is not 599c-set-style}. Specify a style name as an argument (case is not
594significant). This command affects the current buffer only, and it 600significant). This command affects the current buffer only, and it
595affects only future invocations of the indentation commands; it does 601affects only future invocations of the indentation commands; it does
596not change the indentation of the code in the buffer. To reindent the 602not reindent the code in the buffer. To reindent the whole buffer in
597whole buffer in the new style, you can type @kbd{C-x h C-M-\}. 603the new style, you can type @kbd{C-x h C-M-\}.
598 604
599@vindex c-default-style 605@vindex c-default-style
600 You can also set the variable @code{c-default-style} to specify the 606 You can also set the variable @code{c-default-style} to specify the
@@ -610,7 +616,7 @@ style to use for it. For example,
610@noindent 616@noindent
611specifies an explicit choice for Java mode, and the default @samp{gnu} 617specifies an explicit choice for Java mode, and the default @samp{gnu}
612style for the other C-like modes. This variable takes effect when you 618style for the other C-like modes. This variable takes effect when you
613switch to one of the C-like major modes; thus, if you specify a new 619select one of the C-like major modes; thus, if you specify a new
614default style for Java mode, you can make it take effect in an 620default style for Java mode, you can make it take effect in an
615existing Java mode buffer by typing @kbd{M-x java-mode} there. 621existing Java mode buffer by typing @kbd{M-x java-mode} there.
616 622
@@ -618,7 +624,7 @@ existing Java mode buffer by typing @kbd{M-x java-mode} there.
618Project for C; it is the default, so as to encourage use of our 624Project for C; it is the default, so as to encourage use of our
619recommended style. 625recommended style.
620 626
621 @xref{Customizing Indentation,, cc-mode, the CC Mode Manual}, for 627 @xref{Customizing Indentation,,, cc-mode, the CC Mode Manual}, for
622more information on customizing indentation for C and related modes, 628more information on customizing indentation for C and related modes,
623including how to override parts of an existing style and how to define 629including how to override parts of an existing style and how to define
624your own styles. 630your own styles.
@@ -634,9 +640,9 @@ balanced.
634 640
635 When talking about these facilities, the term ``parenthesis'' also 641 When talking about these facilities, the term ``parenthesis'' also
636includes braces, brackets, or whatever delimiters are defined to match 642includes braces, brackets, or whatever delimiters are defined to match
637in pairs. This is controlled by the major mode, through the syntax 643in pairs. The major mode controls which delimiters are significant,
638table (@pxref{Syntax}). In Lisp, only parentheses count; in C, these 644through the syntax table (@pxref{Syntax}). In Lisp, only parentheses
639commands apply to braces and brackets too. 645count; in C, these commands apply to braces and brackets too.
640 646
641 You can use @kbd{M-x check-parens} to find any unbalanced 647 You can use @kbd{M-x check-parens} to find any unbalanced
642parentheses and unbalanced string quotes in the buffer. 648parentheses and unbalanced string quotes in the buffer.
@@ -676,16 +682,16 @@ Put mark after following expression (@code{mark-sexp}).
676 Each programming language major mode customizes the definition of 682 Each programming language major mode customizes the definition of
677balanced expressions to suit that language. Balanced expressions 683balanced expressions to suit that language. Balanced expressions
678typically include symbols, numbers, and string constants, as well as 684typically include symbols, numbers, and string constants, as well as
679anything contained in parentheses, brackets or braces. Some languages 685any pair of matching delimiters and their contents. Some languages
680have obscure forms of expression syntax that nobody has bothered to 686have obscure forms of expression syntax that nobody has bothered to
681implement in Emacs. 687implement in Emacs.
682 688
683@cindex Control-Meta 689@cindex Control-Meta
684 By convention, the keys for these commands are always Control-Meta 690 By convention, the keys for these commands are all Control-Meta
685characters. They usually act like the corresponding Meta characters, 691characters. They usually act on expressions just as the corresponding
686except that they take note of parentheses and their contents. For 692Meta characters act on words. For instance, the command @kbd{C-M-b}
687instance, the command @kbd{C-M-b} moves backward over a balanced 693moves backward over a balanced expression, just as @kbd{M-b} moves
688expression, just as @kbd{M-b} moves back over a word. 694back over a word.
689 695
690@kindex C-M-f 696@kindex C-M-f
691@kindex C-M-b 697@kindex C-M-b
@@ -731,10 +737,11 @@ Emacs is really @key{BACKSPACE}, and the reboot command is
731 A somewhat random-sounding command which is nevertheless handy is 737 A somewhat random-sounding command which is nevertheless handy is
732@kbd{C-M-t} (@code{transpose-sexps}), which drags the previous 738@kbd{C-M-t} (@code{transpose-sexps}), which drags the previous
733balanced expression across the next one. An argument serves as a 739balanced expression across the next one. An argument serves as a
734repeat count, and a negative argument drags backwards (thus canceling 740repeat count, and a negative argument drags the previous balanced
735out the effect of @kbd{C-M-t} with a positive argument). An argument 741expression backwards across those before it (thus canceling out the
736of zero, rather than doing nothing, transposes the balanced 742effect of @kbd{C-M-t} with a positive argument). An argument of zero,
737expressions ending after point and the mark. 743rather than doing nothing, transposes the balanced expressions ending
744at or after point and the mark.
738 745
739@kindex C-M-@@ 746@kindex C-M-@@
740@findex mark-sexp 747@findex mark-sexp
@@ -752,8 +759,9 @@ not treat @samp{foo + bar} as a single expression, even though it
752expression and @samp{bar} as another, with the @samp{+} as punctuation 759expression and @samp{bar} as another, with the @samp{+} as punctuation
753between them. Both @samp{foo + bar} and @samp{foo} are legitimate 760between them. Both @samp{foo + bar} and @samp{foo} are legitimate
754choices for ``the expression following point'' when point is at the 761choices for ``the expression following point'' when point is at the
755@samp{f}. Note that @samp{(foo + bar)} does act as a single 762@samp{f}, so the expression commands must perforce choose one or the
756expression in C mode. 763other to operate on. Note that @samp{(foo + bar)} is recognized as a
764single expression in C mode, because of the parentheses.
757 765
758@node Moving by Parens 766@node Moving by Parens
759@subsection Moving in the Parenthesis Structure 767@subsection Moving in the Parenthesis Structure
@@ -817,8 +825,8 @@ automatically how parentheses (and other matching delimiters) match in
817the text. Whenever you type a self-inserting character that is a 825the text. Whenever you type a self-inserting character that is a
818closing delimiter, the cursor moves momentarily to the location of the 826closing delimiter, the cursor moves momentarily to the location of the
819matching opening delimiter, provided that is on the screen. If it is 827matching opening delimiter, provided that is on the screen. If it is
820not on the screen, Emacs displays some text near it in the echo area. 828not on the screen, Emacs displays some of the text near it in the echo
821Either way, you can tell what grouping you are closing off. 829area. Either way, you can tell which grouping you are closing off.
822 830
823 If the opening delimiter and closing delimiter are mismatched---such 831 If the opening delimiter and closing delimiter are mismatched---such
824as in @samp{[x)}---a warning message is displayed in the echo area. 832as in @samp{[x)}---a warning message is displayed in the echo area.
@@ -1102,34 +1110,36 @@ typically available with the appropriate GNU package.
1102@node Man Page 1110@node Man Page
1103@subsection Man Page Lookup 1111@subsection Man Page Lookup
1104 1112
1105 Eventually the GNU project hopes to replace most man pages in the 1113@cindex manual page
1106GNU operating system with better-organized manuals that you can browse 1114 On Unix, the main form of on-line documentation was the @dfn{manual
1107with Info (@pxref{Misc Help}). Since this process is not finished, it 1115page} or @dfn{man page}. In the GNU operating system, we hope to
1108is still useful to read manual pages. 1116replace man pages with better-organized manuals that you can browse
1117with Info (@pxref{Misc Help}). This process is not finished, so it is
1118still useful to read manual pages.
1109 1119
1110@findex manual-entry 1120@findex manual-entry
1111@cindex manual pages 1121 You can read the man page for an operating system command, library
1112 You can read the ``man page'' for an operating system command, 1122function, or system call, with the @kbd{M-x manual-entry} command. It
1113library function, or system call, with the @kbd{M-x manual-entry} 1123runs the @code{man} program to format the man page; if the system
1114command. It runs the @code{man} program to format the man page, and 1124permits, it runs @code{man} asynchronously, so that you can keep on
1115runs it asynchronously if your system permits, so that you can keep on 1125editing while the page is being formatted. (On MS-DOS and MS-Windows
1116editing while the page is being formatted. (MS-DOS and MS-Windows 3 11263, you cannot edit while Emacs waits for @code{man} to finish.) The
1117do not permit asynchronous subprocesses, so on these systems you 1127result goes in a buffer named @samp{*Man @var{topic}*}. These buffers
1118cannot edit while Emacs waits for @code{man} to finish.) The result 1128use a special major mode, Man mode, that facilitates scrolling and
1119goes in a buffer named @samp{*Man @var{topic}*}. These buffers use a 1129jumping to other manual pages. For details, type @kbd{C-h m} while in
1120special major mode, Man mode, that facilitates scrolling and jumping 1130a man page buffer.
1121to other manual pages. For details, type @kbd{C-h m} while in a man
1122page buffer.
1123 1131
1124@cindex sections of manual pages 1132@cindex sections of manual pages
1125 Each man page belongs to one of around ten @dfn{sections}; sometimes 1133 Each man page belongs to one of ten or more @dfn{sections}, each
1126there are multiple man pages with the same name in different sections. 1134named by a digit or by a digit and a letter. Sometimes there are
1127To read a man page from a specific section, type 1135multiple man pages with the same name in different sections. To read
1136a man page from a specific section, type
1128@samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}} 1137@samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}}
1129when @kbd{M-x manual-entry} prompts for the topic. For example, to 1138when @kbd{M-x manual-entry} prompts for the topic. For example, to
1130read the man page for the C library function @code{chmod} (as opposed 1139read the man page for the C library function @code{chmod} (as opposed
1131to a command by the same name), type @kbd{M-x manual-entry @key{RET} 1140to a command of the same name), type @kbd{M-x manual-entry @key{RET}
1132chmod(2v) @key{RET}} (assuming @code{chmod} is in section @samp{2v}). 1141chmod(2) @key{RET}} (@code{chmod} is a system call, so it is in
1142section @samp{2}).
1133 1143
1134@vindex Man-switches 1144@vindex Man-switches
1135 If you do not specify a section, the results depend on how the 1145 If you do not specify a section, the results depend on how the
@@ -1143,11 +1153,10 @@ can add this option to the value of the variable @code{Man-switches}.}.
1143The mode line shows how many manual pages are present in the Man buffer. 1153The mode line shows how many manual pages are present in the Man buffer.
1144 1154
1145@vindex Man-fontify-manpage-flag 1155@vindex Man-fontify-manpage-flag
1146 By default, Emacs uses faces in man pages if Emacs can display 1156 By default, Emacs highlights the text in man pages. For a long man
1147different fonts or colors. For a long man page, setting the faces 1157page, highlighting can take substantial time. You can turn off
1148properly can take substantial time. You can turn off use of faces in 1158highlighting of man pages by setting the variable
1149man pages by setting the variable @code{Man-fontify-manpage-flag} to 1159@code{Man-fontify-manpage-flag} to @code{nil}.
1150@code{nil}.
1151 1160
1152@findex Man-fontify-manpage 1161@findex Man-fontify-manpage
1153 If you insert the text of a man page into an Emacs buffer in some 1162 If you insert the text of a man page into an Emacs buffer in some
@@ -1186,7 +1195,7 @@ them.
1186directories specified in the @code{MANPATH} environment variable. (If 1195directories specified in the @code{MANPATH} environment variable. (If
1187@code{MANPATH} is not set, @code{woman} uses a suitable default value, 1196@code{MANPATH} is not set, @code{woman} uses a suitable default value,
1188which can be customized.) More precisely, @code{woman} looks for 1197which can be customized.) More precisely, @code{woman} looks for
1189subdirectories that match the shell wildcard @file{man*} in each one 1198subdirectories that match the shell wildcard pattern @file{man*} in each one
1190of these directories, and tries to find the manual pages in those 1199of these directories, and tries to find the manual pages in those
1191subdirectories. When first invoked, @kbd{M-x woman} converts the 1200subdirectories. When first invoked, @kbd{M-x woman} converts the
1192value of @code{MANPATH} to a list of directory names and stores that 1201value of @code{MANPATH} to a list of directory names and stores that
@@ -1316,7 +1325,7 @@ Open neither blocks nor comments.
1316@end table 1325@end table
1317 1326
1318@item hs-special-modes-alist 1327@item hs-special-modes-alist
1319A list of elements, each Specifying how to initialize Hideshow 1328A list of elements, each specifying how to initialize Hideshow
1320variables for one major mode. See the variable's documentation string 1329variables for one major mode. See the variable's documentation string
1321for more information. 1330for more information.
1322@end table 1331@end table
@@ -1325,18 +1334,20 @@ for more information.
1325@section Completion for Symbol Names 1334@section Completion for Symbol Names
1326@cindex completion (symbol names) 1335@cindex completion (symbol names)
1327 1336
1328 Usually completion happens in the minibuffer. But one kind of completion 1337 In Emacs, completion is something you normally do in the minibuffer.
1329is available in all buffers: completion for symbol names. 1338But one kind of completion is available in all buffers: completion for
1339symbol names.
1330 1340
1331@kindex M-TAB 1341@kindex M-TAB
1332 The character @kbd{M-@key{TAB}} runs a command to complete the partial 1342 The character @kbd{M-@key{TAB}} runs a command to complete the
1333symbol before point against the set of meaningful symbol names. Any 1343partial symbol before point against the set of meaningful symbol
1334additional characters determined by the partial name are inserted at 1344names. This command inserts at point any additional characters that
1335point. 1345it can determine from the partial name.
1336 1346
1337 If the partial name in the buffer has more than one possible completion 1347 If the partial name in the buffer has multiple possible completions
1338and they have no additional characters in common, a list of all possible 1348that differ in the very next character, so that it is impossible to
1339completions is displayed in another window. 1349complete even one more character, @kbd{M-@key{TAB}} displays a list of
1350all possible completions in another window.
1340 1351
1341@cindex tags-based completion 1352@cindex tags-based completion
1342@cindex Info index completion 1353@cindex Info index completion
@@ -1373,25 +1384,26 @@ based on the spell-checker's dictionary. @xref{Spelling}.
1373@findex glasses-mode 1384@findex glasses-mode
1374 1385
1375 Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} 1386 Glasses minor mode makes @samp{unreadableIdentifiersLikeThis}
1376readable by altering the display. It knows two different ways to do 1387readable by altering the way they display. It knows two different
1377this: by displaying underscores between a lower-case letter and the 1388ways to do this: by displaying underscores between a lower-case letter
1378following capital letter, or by emboldening the capital letters. It 1389and the following capital letter, and by emboldening the capital
1379does not alter the buffer text, only the way they display, so you can 1390letters. It does not alter the buffer text, only the way they
1380use it even on read-only buffers. You can use the command @kbd{M-x 1391display, so you can use it even on read-only buffers. You can use the
1381glasses-mode} to enable or disable the mode; you can also add 1392command @kbd{M-x glasses-mode} to enable or disable the mode in the
1382@code{glasses-mode} to the mode hook of appropriate programming 1393current buffer; you can also add @code{glasses-mode} to the mode hook
1383language major modes. 1394of the programming language major modes in which you normally want
1395to use Glasses mode.
1384 1396
1385@node Misc for Programs 1397@node Misc for Programs
1386@section Other Features Useful for Editing Programs 1398@section Other Features Useful for Editing Programs
1387 1399
1388 A number of Emacs commands that aren't designed specifically for 1400 A number of Emacs commands that aren't designed specifically for
1389editing programs are useful for it nonetheless. 1401editing programs are useful for that nonetheless.
1390 1402
1391 The Emacs commands that operate on words, sentences and paragraphs 1403 The Emacs commands that operate on words, sentences and paragraphs
1392are useful for editing code. Most symbols names contain words 1404are useful for editing code. Most symbols names contain words
1393(@pxref{Words}); sentences can be found in strings and comments 1405(@pxref{Words}); sentences can be found in strings and comments
1394(@pxref{Sentences}). Paragraphs in the strict sense may be found in 1406(@pxref{Sentences}). Paragraphs in the strict sense can be found in
1395program code (in long comments), but the paragraph commands are useful 1407program code (in long comments), but the paragraph commands are useful
1396in other places too, because programming language major modes define 1408in other places too, because programming language major modes define
1397paragraphs to begin and end at blank lines (@pxref{Paragraphs}). 1409paragraphs to begin and end at blank lines (@pxref{Paragraphs}).