aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-11-01 23:39:36 +0000
committerChong Yidong2008-11-01 23:39:36 +0000
commite722aa81f9fbdcb018d99244d3f89e3718d88b5a (patch)
tree98999f1c3acd5e069bf517ac85cc62a7800b9e66
parente2346dea8e7743f76b82b74ab43b96848215891a (diff)
downloademacs-e722aa81f9fbdcb018d99244d3f89e3718d88b5a.tar.gz
emacs-e722aa81f9fbdcb018d99244d3f89e3718d88b5a.zip
(Program Modes): Link to Program Indent node.
(Left Margin Paren): Explain consequences of changing open-paren-in-column-0-is-defun-start more concisely. (Which Function, Program Indent, Info Lookup): Minor edits. (Basic Indent): If region is active, TAB indents the region. (Multi-line Indent): If region is active, TAB indents the region. Note that indent-region is useful when Transient Mark mode is off. (Matching): The delimiter at the cursor is highlighted---the character changes color. (Symbol Completion): Link to Completion node.
-rw-r--r--doc/emacs/programs.texi305
1 files changed, 148 insertions, 157 deletions
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 2b8cbf895fa..c48d564b589 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -55,8 +55,9 @@ Highlight program syntax (@pxref{Font Lock}).
55@xref{Major Modes}. A programming language major mode typically 55@xref{Major Modes}. A programming language major mode typically
56specifies the syntax of expressions, the customary rules for 56specifies the syntax of expressions, the customary rules for
57indentation, how to do syntax highlighting for the language, and how 57indentation, how to do syntax highlighting for the language, and how
58to find the beginning of a function definition. It often customizes 58to find the beginning or end of a function definition. It often
59or provides facilities for compiling and debugging programs as well. 59customizes or provides facilities for compiling and debugging programs
60as well.
60 61
61 Ideally, Emacs should provide a major mode for each programming 62 Ideally, Emacs should provide a major mode for each programming
62language that you might want to edit; if it doesn't have a mode for 63language that you might want to edit; if it doesn't have a mode for
@@ -85,28 +86,28 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
85@cindex PostScript mode 86@cindex PostScript mode
86@cindex Conf mode 87@cindex Conf mode
87@cindex DNS mode 88@cindex DNS mode
88 The existing programming language major modes include Lisp, Scheme (a 89 The existing programming language major modes include Lisp, Scheme
89variant of Lisp) and the Scheme-based DSSSL expression language, Ada, 90(a variant of Lisp) and the Scheme-based DSSSL expression language,
90ASM, AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed 91Ada, ASM, AWK, C, C++, Delphi (Object Pascal), Fortran, Icon, IDL
91format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s 92(CORBA), IDLWAVE, Java, Metafont (@TeX{}'s companion for font
92companion for font creation), Modula2, Objective-C, Octave, Pascal, 93creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike,
93Perl, Pike, PostScript, Prolog, Python, Simula, Tcl, and VHDL. An 94PostScript, Prolog, Python, Simula, Tcl, and VHDL. An alternative
94alternative mode for Perl is called CPerl mode. Modes are available for 95mode for Perl is called CPerl mode. Modes are available for the
95the scripting languages of the common GNU and Unix shells, VMS DCL, and 96scripting languages of the common GNU and Unix shells, VMS DCL, and
96MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for 97MS-DOS/MS-Windows @samp{BAT} files. There are also major modes for
97editing makefiles, DNS master files, and various sorts of configuration 98editing makefiles, DNS master files, and various sorts of
98files. 99configuration files.
99 100
100@kindex DEL @r{(programming modes)} 101@kindex DEL @r{(programming modes)}
101@findex c-electric-backspace 102@findex c-electric-backspace
102 In most programming languages, indentation should vary from line to 103 In most programming languages, indentation should vary from line to
103line to illustrate the structure of the program. So the major modes 104line to illustrate the structure of the program. So the major modes
104for programming languages arrange for @key{TAB} to update the 105for programming languages arrange for @key{TAB} to update the
105indentation of the current line. They also rebind @key{DEL} to treat 106indentation of the current line (@pxref{Program Indent}). They also
106a tab as if it were the equivalent number of spaces; this lets you 107rebind @key{DEL} to treat a tab as if it were the equivalent number of
107delete one column of indentation without worrying whether the 108spaces; this lets you delete one column of indentation without
108whitespace consists of spaces or tabs. Use @kbd{C-b C-d} to delete a 109worrying whether the whitespace consists of spaces or tabs. Use
109tab character before point, in these modes. 110@kbd{C-b C-d} to delete a tab character before point, in these modes.
110 111
111 Separate manuals are available for the modes for Ada (@pxref{Top, , Ada 112 Separate manuals are available for the modes for Ada (@pxref{Top, , Ada
112Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK 113Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK
@@ -120,7 +121,6 @@ mode, see
120@ref{Fortran}. 121@ref{Fortran}.
121@end ifnottex 122@end ifnottex
122 123
123
124@cindex mode hook 124@cindex mode hook
125@vindex c-mode-hook 125@vindex c-mode-hook
126@vindex lisp-mode-hook 126@vindex lisp-mode-hook
@@ -138,9 +138,9 @@ place to set up customizations for that major mode. @xref{Hooks}.
138@node Defuns 138@node Defuns
139@section Top-Level Definitions, or Defuns 139@section Top-Level Definitions, or Defuns
140 140
141 In Emacs, a major definition at the top level in the buffer, 141 In Emacs, a major definition at the top level in the buffer, such as
142something like a function, is called a @dfn{defun}. The name comes 142a function, is called a @dfn{defun}. The name comes from Lisp, but in
143from Lisp, but in Emacs we use it for all languages. 143Emacs we use it for all languages.
144 144
145@menu 145@menu
146* Left Margin Paren:: An open-paren or similar opening delimiter 146* Left Margin Paren:: An open-paren or similar opening delimiter
@@ -155,18 +155,22 @@ from Lisp, but in Emacs we use it for all languages.
155 155
156@cindex open-parenthesis in leftmost column 156@cindex open-parenthesis in leftmost column
157@cindex ( in leftmost column 157@cindex ( in leftmost column
158 Emacs assumes by default that any opening delimiter found at the 158 Many programming-language modes assume by default that any opening
159left margin is the start of a top-level definition, or defun. 159delimiter found at the left margin is the start of a top-level
160Therefore, @strong{don't put an opening delimiter at the left margin 160definition, or defun. Therefore, @strong{don't put an opening
161unless it should have that significance}. For instance, never put an 161delimiter at the left margin unless it should have that significance}.
162open-parenthesis at the left margin in a Lisp file unless it is the 162For instance, never put an open-parenthesis at the left margin in a
163start of a top-level list. 163Lisp file unless it is the start of a top-level list.
164
165 The convention speeds up many Emacs operations, which would
166otherwise have to scan back to the beginning of the buffer to analyze
167the syntax of the code.
164 168
165 If you don't follow this convention, not only will you have trouble 169 If you don't follow this convention, not only will you have trouble
166when you explicitly use the commands for motion by defuns; other 170when you explicitly use the commands for motion by defuns; other
167features that use them will also give you trouble. This includes 171features that use them will also give you trouble. This includes the
168the indentation commands (@pxref{Program Indent}) and Font Lock 172indentation commands (@pxref{Program Indent}) and Font Lock mode
169mode (@pxref{Font Lock}). 173(@pxref{Font Lock}).
170 174
171 The most likely problem case is when you want an opening delimiter 175 The most likely problem case is when you want an opening delimiter
172at the start of a line inside a string. To avoid trouble, put an 176at the start of a line inside a string. To avoid trouble, put an
@@ -185,8 +189,8 @@ delimiter from starting a defun. Here's an example:
185highlights confusing opening delimiters (those that ought to be 189highlights confusing opening delimiters (those that ought to be
186quoted) in bold red. 190quoted) in bold red.
187 191
188If you need to override this convention, you can so by setting this 192 If you need to override this convention, you can do so by setting
189user option: 193this user option:
190 194
191@defvar open-paren-in-column-0-is-defun-start 195@defvar open-paren-in-column-0-is-defun-start
192If this user option is set to @code{t} (the default), opening 196If this user option is set to @code{t} (the default), opening
@@ -195,25 +199,14 @@ parentheses or braces at column zero always start defuns. When it's
195outermost level. 199outermost level.
196@end defvar 200@end defvar
197 201
198 Usually, you shouldn't need to set 202 Usually, you should leave this option at its default value of
199@code{open-paren-in-column-0-is-defun-start} to @code{nil}. However, 203@code{t}. If your buffer contains parentheses or braces in column
200if your buffer contains parentheses or braces in column zero which 204zero which don't start defuns, and it is somehow impractical to remove
201don't start defuns and this confuses Emacs, it sometimes helps to set 205these parentheses or braces, it might be helpful to set the option to
202the option to @code{nil}. Be aware, though, that this will make 206@code{nil}. Be aware that this might make scrolling and display in
203scrolling and display in large buffers quite sluggish, and that 207large buffers quite sluggish. Furthermore, the parentheses and braces
204parentheses and braces must be correctly matched throughout the buffer 208must be correctly matched throughout the buffer for it to work
205for it to work properly. 209properly.
206
207 In the earliest days, the original Emacs found defuns by moving
208upward a level of parentheses or braces until there were no more
209levels to go up. This always required scanning all the way back to
210the beginning of the buffer, even for a small function. To speed up
211the operation, we changed Emacs to assume that any opening delimiter
212at the left margin is the start of a defun. This heuristic is nearly
213always right, and avoids the need to scan back to the beginning of the
214buffer. However, now that modern computers are so powerful, this
215scanning is rarely slow enough to annoy, so we've provided a way to
216disable the heuristic.
217 210
218@node Moving by Defuns 211@node Moving by Defuns
219@subsection Moving by Defuns 212@subsection Moving by Defuns
@@ -339,21 +332,22 @@ buffer.
339@findex which-function-mode 332@findex which-function-mode
340@vindex which-func-modes 333@vindex which-func-modes
341 To either enable or disable Which Function mode, use the command 334 To either enable or disable Which Function mode, use the command
342@kbd{M-x which-function-mode}. This command is global; it applies to 335@kbd{M-x which-function-mode}. This command applies to all buffers,
343all buffers, both existing ones and those yet to be created. However, 336both existing ones and those yet to be created. However, it takes
344it takes effect only in certain major modes, those listed in the value 337effect only in certain major modes, those listed in the value of
345of @code{which-func-modes}. If the value is @code{t}, then Which 338@code{which-func-modes}. If the value of @code{which-func-modes} is
346Function mode applies to all major modes that know how to support 339@code{t} rather than a list of modes, then Which Function mode applies
347it---in other words, all the major modes that support Imenu. 340to all major modes that know how to support it---in other words, all
341the major modes that support Imenu.
348 342
349@node Program Indent 343@node Program Indent
350@section Indentation for Programs 344@section Indentation for Programs
351@cindex indentation for programs 345@cindex indentation for programs
352 346
353 The best way to keep a program properly indented is to use Emacs to 347 The best way to keep a program properly indented is to use Emacs to
354reindent it as you change it. Emacs has commands to indent properly 348reindent it as you change it. Emacs has commands to indent either a
355either a single line, a specified number of lines, or all of the lines 349single line, a specified number of lines, or all of the lines inside a
356inside a single parenthetical grouping. 350single parenthetical grouping.
357 351
358@menu 352@menu
359* Basic Indent:: Indenting a single line. 353* Basic Indent:: Indenting a single line.
@@ -373,7 +367,6 @@ This program reformats a Lisp object with indentation chosen to look nice.
373 The basic indentation commands indent a single line according to the 367 The basic indentation commands indent a single line according to the
374usual conventions of the language you are editing. 368usual conventions of the language you are editing.
375 369
376@need 1000
377@table @kbd 370@table @kbd
378@item @key{TAB} 371@item @key{TAB}
379Adjust indentation of current line. 372Adjust indentation of current line.
@@ -386,18 +379,18 @@ Insert a newline, then adjust indentation of following line
386@findex c-indent-command 379@findex c-indent-command
387@findex indent-line-function 380@findex indent-line-function
388@findex indent-for-tab-command 381@findex indent-for-tab-command
389 The basic indentation command is @key{TAB}, which gives the current line 382 The basic indentation command is @key{TAB}. In any
390the correct indentation as determined from the previous lines. The 383programming-language major mode, @key{TAB} gives the current line the
391function that @key{TAB} runs depends on the major mode; it is 384correct indentation as determined from the previous lines. It does
392@code{lisp-indent-line} 385this by inserting or deleting whitespace at the beginning of the
393in Lisp mode, @code{c-indent-command} in C mode, etc. These functions 386current line. If point was inside the whitespace at the beginning of
394understand the syntax and conventions of different languages, but they all do 387the line, @key{TAB} puts it at the end of that whitespace; otherwise,
395conceptually the same job: @key{TAB} in any programming-language major mode 388@key{TAB} keeps point fixed with respect to the characters around it.
396inserts or deletes whitespace at the beginning of the current line, 389If the region is active (@pxref{Mark}), @key{TAB} indents every line
397independent of where point is in the line. If point was inside the 390within the region instead of just the current line. The function that
398whitespace at the beginning of the line, @key{TAB} puts it at the end of 391@key{TAB} runs depends on the major mode; for instance, it is
399that whitespace; otherwise, @key{TAB} keeps point fixed with respect to 392@code{c-indent-line-or-region} in C mode. Each function is aware of
400the characters around it. 393the syntax and conventions for its particular language.
401 394
402 Use @kbd{C-q @key{TAB}} to insert a tab character at point. 395 Use @kbd{C-q @key{TAB}} to insert a tab character at point.
403 396
@@ -406,40 +399,43 @@ the characters around it.
406 When entering lines of new code, use @kbd{C-j} 399 When entering lines of new code, use @kbd{C-j}
407(@code{newline-and-indent}), which inserts a newline and then adjusts 400(@code{newline-and-indent}), which inserts a newline and then adjusts
408indentation after it. (It also deletes any trailing whitespace which 401indentation after it. (It also deletes any trailing whitespace which
409remains before the new newline.) Thus, @kbd{C-j} at the end of a line 402remains before the new newline.) For instance, @kbd{C-j} at the end
410creates a blank line with appropriate indentation. In programming 403of a line creates a blank line with appropriate indentation. In
411language modes, it is equivalent to @key{RET} @key{TAB}. 404programming language modes, it is equivalent to @key{RET} @key{TAB}.
412 405
413 @key{TAB} indents a line that starts within a parenthetical grouping 406 When Emacs indents a line that starts within a parenthetical
414under the preceding line within the grouping, or the text after the 407grouping, it usually places the start of the line under the preceding
415parenthesis. Therefore, if you manually give one of these lines a 408line within the group, or under the text after the parenthesis. If
416nonstandard indentation, the lines below will tend to follow it. This 409you manually give one of these lines a nonstandard indentation, the
417behavior is convenient in cases where you have overridden the standard 410lines below will tend to follow it. This behavior is convenient in
418result of @key{TAB} because you find it unaesthetic for a particular 411cases where you have overridden the standard result of @key{TAB}
419line. 412indentation (e.g., for aesthetic purposes).
420 413
421 In some modes, an open-parenthesis, open-brace or other opening 414 Many programming-language modes assume that an open-parenthesis,
422delimiter at the left margin is assumed by Emacs (including the 415open-brace or other opening delimiter at the left margin is the start
423indentation routines) to be the start of a function. This speeds up 416of a function. This assumption speeds up indentation commands. If
424indentation commands. If you will be editing text which contains 417the text you are editing contains opening delimiters in column zero
425opening delimiters in column zero that aren't the beginning of a 418that aren't the beginning of a functions---even if these delimiters
426functions, even inside strings or comments, you must set 419occur inside strings or comments---then you must set
427@code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin 420@code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin
428Paren}, for more information on this. 421Paren}.
429 422
430 Normally, lines are indented with tabs and spaces. If you want Emacs 423 Normally, Emacs indents lines using an ``optimal'' mix of tab and
431to use spaces only, set @code{indent-tabs-mode} (@pxref{Just Spaces}). 424space characters. If you want Emacs to use spaces only, set
425@code{indent-tabs-mode} (@pxref{Just Spaces}).
432 426
433@node Multi-line Indent 427@node Multi-line Indent
434@subsection Indenting Several Lines 428@subsection Indenting Several Lines
435 429
436 When you wish to reindent several lines of code which have been 430 Sometimes, you may want to reindent several lines of code at a time.
437altered or moved to a different level in the parenthesis structure, 431One way to do this is to use the mark; when the mark is active and the
438you have several commands available. 432region is non-empty, @key{TAB} indents every line within the region.
433In addition, Emacs provides several other commands for indenting large
434chunks of code:
439 435
440@table @kbd 436@table @kbd
441@item C-M-q 437@item C-M-q
442Reindent all the lines within one parenthetical grouping (@code{indent-pp-sexp}). 438Reindent all the lines within one parenthetical grouping.
443@item C-M-\ 439@item C-M-\
444Reindent all lines in the region (@code{indent-region}). 440Reindent all lines in the region (@code{indent-region}).
445@item C-u @key{TAB} 441@item C-u @key{TAB}
@@ -452,38 +448,38 @@ lines that start inside comments and strings.
452 448
453@kindex C-M-q 449@kindex C-M-q
454@findex indent-pp-sexp 450@findex indent-pp-sexp
455 You can reindent the contents of a single parenthetical grouping by 451 To reindent the contents of a single parenthetical grouping,
456positioning point before the beginning of it and typing @kbd{C-M-q} 452position point before the beginning of the grouping and type
457(@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode; also 453@kbd{C-M-q}. This changes the relative indentation within the
458bound to other suitable commands in other modes). The indentation of 454grouping, without affecting its overall indentation (i.e., the
459the line where the grouping starts is not changed; therefore this 455indentation of the line where the grouping starts). The function that
460changes only the relative indentation within the grouping, not its 456@kbd{C-M-q} runs depends on the major mode; it is
461overall indentation. To correct that as well, type @key{TAB} first. 457@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode,
462 458etc. To correct the overall indentation as well, type @key{TAB}
463 Another way to specify the range to be reindented is with the 459first.
464region. The command @kbd{C-M-\} (@code{indent-region}) applies 460
465@key{TAB} to every line whose first character is between point and 461 @kbd{C-M-\} (@code{indent-region}) applies @key{TAB} to the region.
466mark. 462This is useful when Transient Mark mode is disabled (@pxref{Persistent
463Mark}), because in that case @key{TAB} does not act on the region.
467 464
468@kindex C-u TAB 465@kindex C-u TAB
469 If you like the relative indentation within a grouping, but not the 466 If you like the relative indentation within a grouping but not the
470indentation of its first line, you can type @kbd{C-u @key{TAB}} to 467indentation of its first line, move point to that first line and type
471reindent the whole grouping as a rigid unit. (This works in Lisp 468@kbd{C-u @key{TAB}}. In Lisp, C, and some other major modes,
472modes and C and related modes.) @key{TAB} with a numeric argument 469@key{TAB} with a numeric argument reindents the current line as usual,
473reindents the current line as usual, then reindents by the same amount 470then reindents by the same amount all the lines in the parenthetical
474all the lines in the parenthetical grouping starting on the current 471grouping starting on the current line. It is clever, though, and does
475line. It is clever, though, and does not alter lines that start 472not alter lines that start inside strings. Neither does it alter C
476inside strings. Neither does it alter C preprocessor lines when in C 473preprocessor lines when in C mode, but it does reindent any
477mode, but it does reindent any continuation lines that may be attached 474continuation lines that may be attached to them.
478to them.
479 475
480@findex indent-code-rigidly 476@findex indent-code-rigidly
481 You can also perform this operation on the region, using the command 477 The command @kbd{M-x indent-code-rigidly} rigidly shifts all the
482@kbd{M-x indent-code-rigidly}. It rigidly shifts all the lines in the 478lines in the region sideways, like @code{indent-rigidly} does
483region sideways, like @code{indent-rigidly} does (@pxref{Indentation 479(@pxref{Indentation Commands}). It doesn't alter the indentation of
484Commands}). It doesn't alter the indentation of lines that start 480lines that start inside a string, unless the region also starts inside
485inside a string, unless the region also starts inside that string. 481that string. The prefix arg specifies the number of columns to
486The prefix arg specifies the number of columns to indent. 482indent.
487 483
488@node Lisp Indent 484@node Lisp Indent
489@subsection Customizing Lisp Indentation 485@subsection Customizing Lisp Indentation
@@ -852,12 +848,10 @@ lots of time when there is no match. The default is 25600.
852@cindex highlighting matching parentheses 848@cindex highlighting matching parentheses
853@findex show-paren-mode 849@findex show-paren-mode
854 Show Paren mode provides a more powerful kind of automatic matching. 850 Show Paren mode provides a more powerful kind of automatic matching.
855Whenever point is after a closing delimiter, that delimiter and its 851Whenever point is before an opening delimiter or after a closing
856matching opening delimiter are both highlighted; otherwise, if point 852delimiter, both that delimiter and its opposite delimiter are
857is before an opening delimiter, the matching closing delimiter is 853highlighted. Use the command @kbd{M-x show-paren-mode} to enable or
858highlighted. (There is no need to highlight the opening delimiter in 854disable this mode.
859that case, because the cursor appears on top of that character.) Use
860the command @kbd{M-x show-paren-mode} to enable or disable this mode.
861 855
862 Show Paren mode uses the faces @code{show-paren-match} and 856 Show Paren mode uses the faces @code{show-paren-match} and
863@code{show-paren-mismatch} to highlight parentheses; you can customize 857@code{show-paren-mismatch} to highlight parentheses; you can customize
@@ -883,8 +877,7 @@ also do spell checking on comments with Flyspell Prog mode
883@cindex indentation for comments 877@cindex indentation for comments
884@cindex alignment for comments 878@cindex alignment for comments
885 879
886 The comment commands in this table insert, kill and align comments. 880 The commands in this table insert, kill and align comments:
887They are described in this section and following sections.
888 881
889@table @asis 882@table @asis
890@item @kbd{M-;} 883@item @kbd{M-;}
@@ -943,14 +936,14 @@ programmed so that when it receives a prefix argument it calls
943@code{comment-kill}. However, @code{comment-kill} is a valid command 936@code{comment-kill}. However, @code{comment-kill} is a valid command
944in its own right, and you can bind it directly to a key if you wish. 937in its own right, and you can bind it directly to a key if you wish.
945 938
946 When a region is active, @kbd{M-;} does either adds or removes 939 When a region is active, @kbd{M-;} either adds or removes comment
947comment delimiters on each line of the region. @xref{Mark}. If every 940delimiters on each line of the region. @xref{Mark}. If every line in
948line in the region is a comment, it removes comment delimiters from 941the region is a comment, it removes comment delimiters from each;
949each; otherwise, it adds comment delimiters to each. You can also use 942otherwise, it adds comment delimiters to each. You can also use the
950the commands @code{comment-region} and @code{uncomment-region} to do 943commands @code{comment-region} and @code{uncomment-region} to do these
951these jobs (@pxref{Multi-Line Comments}). A prefix argument used in 944jobs (@pxref{Multi-Line Comments}). A prefix argument used in these
952these circumstances specifies how many comment delimiters to add or 945circumstances specifies how many comment delimiters to add or how many
953how many to delete. 946to delete.
954 947
955 Some major modes have special rules for aligning certain kinds of 948 Some major modes have special rules for aligning certain kinds of
956comments in certain contexts. For example, in Lisp code, comments which 949comments in certain contexts. For example, in Lisp code, comments which
@@ -970,13 +963,12 @@ and by not changing the indentation of a triple-semicolon comment at all.
970 (1+ x)) ; This line adds one. 963 (1+ x)) ; This line adds one.
971@end example 964@end example
972 965
973 For C-like modes, you can configure the exact effect of @kbd{M-;} 966 For C-like modes, you can configure the exact effect of @kbd{M-;} by
974more flexibly than for most buffers by setting the variables 967setting the variables @code{c-indent-comment-alist} and
975@code{c-indent-comment-alist} and
976@code{c-indent-comments-syntactically-p}. For example, on a line 968@code{c-indent-comments-syntactically-p}. For example, on a line
977ending in a closing brace, @kbd{M-;} puts the comment one space after 969ending in a closing brace, @kbd{M-;} puts the comment one space after
978the brace rather than at @code{comment-column}. For full details see 970the brace rather than at @code{comment-column}. For full details see
979@ref{Comment Commands,,, ccmode, The CC Mode Manual}. 971@ref{Comment Commands,,, ccmode, The CC Mode Manual}.
980 972
981@node Multi-Line Comments 973@node Multi-Line Comments
982@subsection Multiple Lines of Comments 974@subsection Multiple Lines of Comments
@@ -1109,14 +1101,13 @@ use in your program.
1109@findex info-lookup-symbol 1101@findex info-lookup-symbol
1110@findex info-lookup-file 1102@findex info-lookup-file
1111@kindex C-h S 1103@kindex C-h S
1112 For many major modes, that apply to languages that have 1104 For major modes that apply to languages which have documentation in
1113documentation in Info, you can use @kbd{C-h S} 1105Info, you can use @kbd{C-h S} (@code{info-lookup-symbol}) to view the
1114(@code{info-lookup-symbol}) to view the Info documentation for a 1106Info documentation for a symbol used in the program. You specify the
1115symbol used in the program. You specify the symbol with the 1107symbol with the minibuffer; the default is the symbol appearing in the
1116minibuffer; the default is the symbol appearing in the buffer at 1108buffer at point. For example, in C mode this looks for the symbol in
1117point. For example, in C mode this looks for the symbol in the C 1109the C Library Manual. The command only works if the appropriate
1118Library Manual. The command only works if the appropriate manual's 1110manual's Info files are installed.
1119Info files are installed.
1120 1111
1121 The major mode determines where to look for documentation for the 1112 The major mode determines where to look for documentation for the
1122symbol---which Info files to look in, and which indices to search. 1113symbol---which Info files to look in, and which indices to search.
@@ -1321,9 +1312,9 @@ for more information.
1321@section Completion for Symbol Names 1312@section Completion for Symbol Names
1322@cindex completion (symbol names) 1313@cindex completion (symbol names)
1323 1314
1324 In Emacs, completion is something you normally do in the minibuffer. 1315 In Emacs, completion is something you normally do in the minibuffer
1325But one kind of completion is available in all buffers: completion for 1316(@pxref{Completion}). But one kind of completion is available in all
1326symbol names. 1317buffers: completion for symbol names.
1327 1318
1328@kindex M-TAB 1319@kindex M-TAB
1329 The character @kbd{M-@key{TAB}} runs a command to complete the 1320 The character @kbd{M-@key{TAB}} runs a command to complete the