aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-05-28 11:43:37 +0000
committerRichard M. Stallman2003-05-28 11:43:37 +0000
commit5ba75c80540b09d4149487e24ef097b03492741d (patch)
tree4e67406dbd43770cdb5827d5ce2b86f1ab071276
parentf9ad161b282e67373227d6ed2d1604b6a18d2ec2 (diff)
downloademacs-5ba75c80540b09d4149487e24ef097b03492741d.tar.gz
emacs-5ba75c80540b09d4149487e24ef097b03492741d.zip
(Indentation): Condense, simplify, clarify prev change.
-rw-r--r--man/indent.texi70
1 files changed, 21 insertions, 49 deletions
diff --git a/man/indent.texi b/man/indent.texi
index 337eb11a858..a940bc77a95 100644
--- a/man/indent.texi
+++ b/man/indent.texi
@@ -40,75 +40,47 @@ be called `indentation':
40 40
41@enumerate 41@enumerate
42@item 42@item
43The most simple operation is to just insert a tab character. This 43Insert a tab character. You can type @kbd{C-q @key{TAB}} to do this.
44operation does not have a convenient key binding, because it is
45subsumed by the more general operation described next. But you can use
46@kbd{C-q @key{TAB}} to insert a literal tab character.
47 44
48A tab character is displayed as a stretch of whitespace which extends 45A tab character is displayed as a stretch of whitespace which extends
49to the next display tab stop position, and the default width of a tab 46to the next display tab stop position, and the default width of a tab
50stop is eight. @xref{Display Custom}, for more details. 47stop is eight. @xref{Display Custom}, for more details.
51 48
52@item 49@item
53Emacs also supports tab stops. You can set them at arbitrary 50Advance to the next tab stop. You can set tab stops at your choice of
54positions, and then use @kbd{M-i} to advance to the next tab stop. The 51column positions, then type @kbd{M-i} to advance to the next tab stop.
55default tab stop list contains positions (columns) that are a multiple 52The default is to have tab stops every eight columns, which means by
56of eight, and so the effect of @kbd{M-i} is the same as that of 53default @kbd{M-i} inserts a tab character. To set the tab stops, use
57@kbd{C-q @key{TAB}} in the default case. 54@kbd{M-x edit-tab-stops}.
58
59You can set the tab stops with @kbd{M-x edit-tab-stops}.
60 55
61@item 56@item
62You can align successive lines with each other. This is called 57Align a line with the previous line. More precisely, the command
63@dfn{relative indentation} in Emacs and is performed by the command 58@kbd{M-x indent-relative} indents the current line under the beginning
64@kbd{M-x indent-relative}. The effect is best shown by an example: 59of some word in the previous line. In Fundamental mode and in Text
65@example 60mode, @key{TAB} runs the command @code{indent-relative}.
66This shows the effect of relative indentation.
67^ ^ ^ ^ ^ ^ ^
68@end example
69The positions for the @code{^} characters on the second line were
70obtained using @kbd{M-x indent-relative}.
71
72In Fundamental mode and in Text mode, @key{TAB} runs the command
73@code{indent-relative}.
74 61
75@item 62@item
76The most sophisticated method is called @dfn{syntax-driven indentation} 63The most sophisticated method is @dfn{syntax-driven indentation}.
77and is the default behavior of the @key{TAB} key in Emacs. 64Most programming languages have an indentation convention. For Lisp
78 65code, lines are indented according to their nesting in parentheses. C
79 Most programming languages have some indentation convention. For Lisp 66code uses the same general idea, but many details are different.
80code, lines are indented according to their nesting in parentheses. The
81same general idea is used for C code, though many details are different.
82
83 For some languages, different kinds of indentation styles are
84commonly used. Emacs accomodates this by allowing users to customize
85the indentation. For example, see @ref{Customizing Indentation,,,ccmode},
86for a description of these facilities for the C language.
87 67
88@kindex TAB 68@kindex TAB
89 Whatever the language, to indent a line, use the @key{TAB} command. Each 69Type @key{TAB} to do syntax-driven indentation, in a mode that
90major mode defines this command to perform the sort of indentation 70supports it. It realigns the current line according with the syntax
91appropriate for the particular language. In Lisp mode, @key{TAB} aligns 71of the preceding lines. No matter where in the line you are when you
92the line according to its depth in parentheses. No matter where in the 72type @key{TAB}, it aligns the line as a whole.
93line you are when you type @key{TAB}, it aligns the line as a whole. In C
94mode, @key{TAB} implements a subtle and sophisticated indentation style that
95knows about many aspects of C syntax.
96
97@end enumerate 73@end enumerate
98 74
99 Normally, all of the above methods insert an optimal mix of tabs and 75 Normally, all of the above methods insert an optimal mix of tabs and
100spaces for the needed indentation. @xref{Just Spaces}, for how to 76spaces to align to the desired column. @xref{Just Spaces}, for how to
101prevent use of tabs. However, the first method (@kbd{C-q @key{TAB}}) 77disable use of tabs. However, @kbd{C-q @key{TAB}} always inserts a
102always inserts a tab, even if you prevented their use. 78tab, even they are disabled for the indentation commands.
103 79
104@c In Text mode, @key{TAB} runs the command @code{tab-to-tab-stop}, which 80@c In Text mode, @key{TAB} runs the command @code{tab-to-tab-stop}, which
105@c indents to the next tab stop column. You can set the tab stops with 81@c indents to the next tab stop column. You can set the tab stops with
106@c @kbd{M-x edit-tab-stops}. 82@c @kbd{M-x edit-tab-stops}.
107 83
108@c Normally, @key{TAB} inserts an optimal mix of tabs and spaces for
109@c the intended indentation. @xref{Just Spaces}, for how to prevent use
110@c of tabs.
111
112@menu 84@menu
113* Indentation Commands:: Various commands and techniques for indentation. 85* Indentation Commands:: Various commands and techniques for indentation.
114* Tab Stops:: You can set arbitrary "tab stops" and then 86* Tab Stops:: You can set arbitrary "tab stops" and then