annotate man/xemacs/text.texi @ 337:fbbf69b4e8a7 r21-0-66

Import from CVS: tag r21-0-66
author cvs
date Mon, 13 Aug 2007 10:51:02 +0200
parents bfd6434d15b3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @node Text, Programs, Indentation, Top
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @chapter Commands for Human Languages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @cindex text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 The term @dfn{text} has two widespread meanings in our area of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 computer field. One is data that is a sequence of characters. In this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 sense of the word any file that you edit with Emacs is text. The other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 meaning is more restrictive: a sequence of characters in a human
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 language for humans to read (possibly after processing by a text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 formatter), as opposed to a program or commands for a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 Human languages have syntactic and stylistic conventions that editor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 commands should support or use to advantage: conventions involving
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 words, sentences, paragraphs, and capital letters. This chapter describes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 Emacs commands for all these things. There are also commands for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 @dfn{filling}, or rearranging paragraphs into lines of approximately equal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 length. The commands for moving over and killing words, sentences,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 and paragraphs, while intended primarily for editing text, are also often
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 useful for editing programs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 Emacs has several major modes for editing human language text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 If a file contains plain text, use Text mode, which customizes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 Emacs in small ways for the syntactic conventions of text. For text which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 contains embedded commands for text formatters, Emacs has other major modes,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 each for a particular text formatter. Thus, for input to @TeX{}, you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 use @TeX{} mode; for input to nroff, Nroff mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 * Text Mode:: The major modes for editing text files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 * Nroff Mode:: The major mode for editing input to the formatter nroff.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 * TeX Mode:: The major modes for editing input to the formatter TeX.
181
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 0
diff changeset
33 * Outline Mode:: The major mode for editing outlines.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 * Words:: Moving over and killing words.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 * Sentences:: Moving over and killing sentences.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 * Paragraphs:: Moving over paragraphs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 * Pages:: Moving over pages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 * Filling:: Filling or justifying text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 * Case:: Changing the case of text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 @node Text Mode, Words, Text, Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 @section Text Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 @findex tab-to-tab-stop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 @findex edit-tab-stops
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 @cindex Text mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 @kindex TAB
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 @findex text-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 You should use Text mode---rather than Fundamental or Lisp mode---to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 edit files of text in a human language. Invoke @kbd{M-x text-mode} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 enter Text mode. In Text mode, @key{TAB} runs the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @code{tab-to-tab-stop}, which allows you to use arbitrary tab stops set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 with @kbd{M-x edit-tab-stops} (@pxref{Tab Stops}). Features concerned
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 with comments in programs are turned off unless they are explicitly invoked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 The syntax table is changed so that periods are not considered part of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 word, while apostrophes, backspaces and underlines are.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 @findex indented-text-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 A similar variant mode is Indented Text mode, intended for editing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 text in which most lines are indented. This mode defines @key{TAB} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 run @code{indent-relative} (@pxref{Indentation}), and makes Auto Fill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 indent the lines it creates. As a result, a line made by Auto Filling,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 or by @key{LFD}, is normally indented just like the previous line. Use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 @kbd{M-x indented-text-mode} to select this mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 @vindex text-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 Entering Text mode or Indented Text mode calls the value of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 variable @code{text-mode-hook} with no arguments, if that value exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 and is not @code{nil}. This value is also called when modes related to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 Text mode are entered; this includes Nroff mode, @TeX{} mode, Outline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 mode, and Mail mode. Your hook can look at the value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 @code{major-mode} to see which of these modes is actually being entered.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 Two modes similar to Text mode are of use for editing text that is to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 be passed through a text formatter before achieving its final readable form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 * Nroff Mode:: The major mode for editing input to the formatter nroff.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 * TeX Mode:: The major modes for editing input to the formatter TeX.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 Another similar mode is used for editing outlines. It allows you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 to view the text at various levels of detail. You can view either
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 the outline headings alone or both headings and text; you can also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 hide some of the headings at lower levels from view to make the high
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 level structure more visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89
181
bfd6434d15b3 Import from CVS: tag r20-3b17
cvs
parents: 0
diff changeset
90 * Outline Mode:: The major mode for editing outlines.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 @node Nroff Mode, TeX Mode, Text Mode, Text Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 @subsection Nroff Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 @cindex nroff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 @findex nroff-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 Nroff mode is a mode like Text mode but modified to handle nroff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 commands present in the text. Invoke @kbd{M-x nroff-mode} to enter this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 mode. Nroff mode differs from Text mode in only a few ways. All nroff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 command lines are considered paragraph separators, so that filling never
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 garbles the nroff commands. Pages are separated by @samp{.bp} commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 Comments start with backslash-doublequote. There are also three special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 commands that are not available in Text mode:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 @findex forward-text-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 @findex backward-text-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 @findex count-text-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 @kindex M-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 @kindex M-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 @kindex M-?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 @item M-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 Move to the beginning of the next line that isn't an nroff command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (@code{forward-text-line}). An argument is a repeat count.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 @item M-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 Like @kbd{M-n} but move up (@code{backward-text-line}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 @item M-?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 Prints in the echo area the number of text lines (lines that are not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 nroff commands) in the region (@code{count-text-lines}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 @findex electric-nroff-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 The other feature of Nroff mode is Electric Nroff newline mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 This is a minor mode that you can turn on or off with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 @kbd{M-x electric-nroff-mode} (@pxref{Minor Modes}). When the mode is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 on and you use @key{RET} to end a line containing an nroff command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 that opens a kind of grouping, Emacs automatically inserts the matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 nroff command to close that grouping on the following line. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 example, if you are at the beginning of a line and type @kbd{.@:(b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 @key{RET}}, the matching command @samp{.)b} will be inserted on a new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 line following point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 @vindex nroff-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 Entering Nroff mode calls the value of the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 @code{text-mode-hook} with no arguments, if that value exists and is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 @code{nil}; then it does the same with the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 @code{nroff-mode-hook}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 @node TeX Mode, Outline Mode, Nroff Mode, Text Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 @subsection @TeX{} Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 @cindex TeX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 @cindex LaTeX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 @findex TeX-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 @findex tex-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 @findex plain-tex-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 @findex LaTeX-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 @findex plain-TeX-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 @findex latex-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 @TeX{} is a powerful text formatter written by Donald Knuth; like GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 Emacs, it is free. La@TeX{} is a simplified input format for @TeX{},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 implemented by @TeX{} macros. It is part of @TeX{}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 Emacs has a special @TeX{} mode for editing @TeX{} input files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 It provides facilities for checking the balance of delimiters and for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 invoking @TeX{} on all or part of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 @TeX{} mode has two variants, Plain @TeX{} mode and La@TeX{} mode,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 which are two distinct major modes that differ only slightly. These
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 modes are designed for editing the two different input formats. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 command @kbd{M-x tex-mode} looks at the contents of a buffer to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 determine whether it appears to be La@TeX{} input or not; it then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 selects the appropriate mode. If it can't tell which is right (e.g.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 the buffer is empty), the variable @code{tex-default-mode} controls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 which mode is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 The commands @kbd{M-x plain-tex-mode} and @kbd{M-x latex-mode}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 explicitly select one of the variants of @TeX{} mode. Use these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 commands when @kbd{M-x tex-mode} does not guess right.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 * Editing: TeX Editing. Special commands for editing in TeX mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 * Printing: TeX Print. Commands for printing part of a file with TeX.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 @TeX{} for Unix systems can be obtained from the University of Washington
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 for a distribution fee.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 To order a full distribution, send $140.00 for a 1/2 inch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 9-track tape, $165.00 for two 4-track 1/4 inch cartridge tapes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (foreign sites $150.00, for 1/2 inch, $175.00 for 1/4 inch, to cover
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 the extra postage) payable to the University of Washington to:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 @display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 The Director
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 Northwest Computer Support Group, DW-10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 University of Washington
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 Seattle, Washington 98195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 @end display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 Purchase orders are acceptable, but there is an extra charge of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 $10.00 to pay for processing charges. (The total cost comes to $150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 for domestic sites, $175 for foreign sites).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 The normal distribution is a tar tape, blocked 20, 1600 bpi, on an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 industry standard 2400 foot half-inch reel. The physical format for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 the 1/4 inch streamer cartridges uses QIC-11, 8000 bpi, 4-track
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 serpentine recording for the SUN. Also, SystemV tapes can be written
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 in cpio format, blocked 5120 bytes, ASCII headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 @node TeX Editing,TeX Print,TeX Mode,TeX Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 @subsubsection @TeX{} Editing Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 Here are the special commands provided in @TeX{} mode for editing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 text of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 @item "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 Insert, according to context, either @samp{``} or @samp{"} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 @samp{''} (@code{TeX-insert-quote}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 @item @key{LFD}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 Insert a paragraph break (two newlines) and check the previous
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 paragraph for unbalanced braces or dollar signs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (@code{tex-terminate-@*paragraph}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 @item M-x validate-tex-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 Check each paragraph in the buffer for unbalanced braces or dollar signs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 @item C-c @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 Insert @samp{@{@}} and position point between them (@code{tex-insert-braces}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 @item C-c @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 Move forward past the next unmatched close brace (@code{up-list}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 @item C-c C-e
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 Close a block for La@TeX{} (@code{tex-close-latex-block}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 @findex tex-insert-quote
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 @kindex " (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 In @TeX{}, the character @samp{"} is not normally used; you use @samp{``}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 to start a quotation and @samp{''} to end one. @TeX{} mode defines the key
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 @kbd{"} to insert @samp{``} after whitespace or an open brace, @samp{"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 after a backslash, or @samp{''} otherwise. This is done by the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 @code{tex-insert-quote}. If you need the character @samp{"} itself in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 unusual contexts, use @kbd{C-q} to insert it. Also, @kbd{"} with a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 numeric argument always inserts that number of @samp{"} characters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 In @TeX{} mode, @samp{$} has a special syntax code which attempts to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 understand the way @TeX{} math mode delimiters match. When you insert a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 @samp{$} that is meant to exit math mode, the position of the matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 @samp{$} that entered math mode is displayed for a second. This is the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 same feature that displays the open brace that matches a close brace that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 is inserted. However, there is no way to tell whether a @samp{$} enters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 math mode or leaves it; so when you insert a @samp{$} that enters math
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 mode, the previous @samp{$} position is shown as if it were a match, even
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 though they are actually unrelated.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 @findex tex-insert-braces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 @kindex C-c @{ (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 @findex up-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 @kindex C-c @} (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 If you prefer to keep braces balanced at all times, you can use @kbd{C-c @{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (@code{tex-insert-braces}) to insert a pair of braces. It leaves point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 between the two braces so you can insert the text that belongs inside.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 Afterward, use the command @kbd{C-c @}} (@code{up-list}) to move forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 past the close brace.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 @findex validate-tex-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 @findex tex-terminate-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 @kindex LFD (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 There are two commands for checking the matching of braces. @key{LFD}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (@code{tex-terminate-paragraph}) checks the paragraph before point, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 inserts two newlines to start a new paragraph. It prints a message in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 echo area if any mismatch is found. @kbd{M-x validate-tex-buffer} checks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 the entire buffer, paragraph by paragraph. When it finds a paragraph that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 contains a mismatch, it displays point at the beginning of the paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 for a few seconds and pushes a mark at that spot. Scanning continues
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 until the whole buffer has been checked or until you type another key.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 The positions of the last several paragraphs with mismatches can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 found in the mark ring (@pxref{Mark Ring}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 Note that square brackets and parentheses, not just braces, are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 matched in @TeX{} mode. This is wrong if you want to check @TeX{} syntax.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 However, parentheses and square brackets are likely to be used in text as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 matching delimiters and it is useful for the various motion commands and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 automatic match display to work with them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 @findex tex-close-latex-block
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 @kindex C-c C-f (LaTeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 In La@TeX{} input, @samp{\begin} and @samp{\end} commands must balance.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 After you insert a @samp{\begin}, use @kbd{C-c C-f}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (@code{tex-close-latex-block}) to insert automatically a matching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 @samp{\end} (on a new line following the @samp{\begin}). A blank line is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 inserted between the two, and point is left there.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 @node TeX Print,,TeX Editing,TeX Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 @subsubsection @TeX{} Printing Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 You can invoke @TeX{} as an inferior of Emacs on either the entire
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 contents of the buffer or just a region at a time. Running @TeX{} in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 this way on just one chapter is a good way to see what your changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 look like without taking the time to format the entire file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 @item C-c C-r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 Invoke @TeX{} on the current region, plus the buffer's header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (@code{tex-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 @item C-c C-b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 Invoke @TeX{} on the entire current buffer (@code{tex-buffer}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 @item C-c C-l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 Recenter the window showing output from the inferior @TeX{} so that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 the last line can be seen (@code{tex-recenter-output-buffer}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 @item C-c C-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 Kill the inferior @TeX{} (@code{tex-kill-job}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 @item C-c C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 Print the output from the last @kbd{C-c C-r} or @kbd{C-c C-b} command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (@code{tex-print}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 @item C-c C-q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 Show the printer queue (@code{tex-show-print-queue}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 @findex tex-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 @kindex C-c C-b (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 @findex tex-print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 @kindex C-c C-p (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 @findex tex-show-print-queue
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 @kindex C-c C-q (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 You can pass the current buffer through an inferior @TeX{} using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 @kbd{C-c C-b} (@code{tex-buffer}). The formatted output appears in a file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 in @file{/tmp}; to print it, type @kbd{C-c C-p} (@code{tex-print}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 Afterward use @kbd{C-c C-q} (@code{tex-show-print-queue}) to view the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 progress of your output towards being printed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 @findex tex-kill-job
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 @kindex C-c C-k (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 @findex tex-recenter-output-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 @kindex C-c C-l (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 The console output from @TeX{}, including any error messages, appears in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 buffer called @samp{*TeX-shell*}. If @TeX{} gets an error, you can switch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 to this buffer and feed it input (this works as in Shell mode;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 @pxref{Interactive Shell}). Without switching to this buffer, you can scroll
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 it so that its last line is visible by typing @kbd{C-c C-l}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 Type @kbd{C-c C-k} (@code{tex-kill-job}) to kill the @TeX{} process if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 you see that its output is no longer useful. Using @kbd{C-c C-b} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 @kbd{C-c C-r} also kills any @TeX{} process still running.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 @findex tex-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 @kindex C-c C-r (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 You can pass an arbitrary region through an inferior @TeX{} by typing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 @kbd{C-c C-r} (@code{tex-region}). This is tricky, however, because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 most files of @TeX{} input contain commands at the beginning to set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 parameters and define macros. Without them, no later part of the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 will format correctly. To solve this problem, @kbd{C-c C-r} allows you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 to designate a part of the file as containing essential commands; it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 included before the specified region as part of the input to @TeX{}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 The designated part of the file is called the @dfn{header}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 @cindex header (TeX mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 To indicate the bounds of the header in Plain @TeX{} mode, insert two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 special strings in the file: @samp{%**start of header} before the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 header, and @samp{%**end of header} after it. Each string must appear
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 entirely on one line, but there may be other text on the line before or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 after. The lines containing the two strings are included in the header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 If @samp{%**start of header} does not appear within the first 100 lines of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 the buffer, @kbd{C-c C-r} assumes there is no header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 In La@TeX{} mode, the header begins with @samp{\documentstyle} and ends
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 with @*@samp{\begin@{document@}}. These are commands that La@TeX{} requires
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 you to use, so you don't need to do anything special to identify the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 @vindex TeX-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 @vindex LaTeX-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 @vindex plain-TeX-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 When you enter either kind of @TeX{} mode, Emacs calls with no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 arguments the value of the variable @code{text-mode-hook}, if that value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 exists and is not @code{nil}. Emacs then calls the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 @code{TeX-mode-hook} and either @code{plain-TeX-mode-hook} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 @code{LaTeX-mode-hook} under the same conditions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 @node Outline Mode,, TeX Mode, Text Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 @subsection Outline Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 @cindex outlines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 @cindex selective display
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 @cindex invisible lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 Outline mode is a major mode similar to Text mode but intended for editing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 outlines. It allows you to make parts of the text temporarily invisible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 so that you can see just the overall structure of the outline. Type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 @kbd{M-x outline-mode} to turn on Outline mode in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 @vindex outline-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 When you enter Outline mode, Emacs calls with no arguments the value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 of the variable @code{text-mode-hook}, if that value exists and is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 @code{nil}; then it does the same with the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 @code{outline-mode-hook}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 When a line is invisible in outline mode, it does not appear on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 screen. The screen appears exactly as if the invisible line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 were deleted, except that an ellipsis (three periods in a row) appears
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 at the end of the previous visible line (only one ellipsis no matter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 how many invisible lines follow).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 All editing commands treat the text of the invisible line as part of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 previous visible line. For example, @kbd{C-n} moves onto the next visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 line. Killing an entire visible line, including its terminating newline,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 really kills all the following invisible lines as well; yanking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 everything back yanks the invisible lines and they remain invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 * Format: Outline Format. What the text of an outline looks like.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 * Motion: Outline Motion. Special commands for moving through outlines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 * Visibility: Outline Visibility. Commands to control what is visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 @node Outline Format,Outline Motion,Outline Mode, Outline Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 @subsubsection Format of Outlines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 @cindex heading lines (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 @cindex body lines (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 Outline mode assumes that the lines in the buffer are of two types:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 @dfn{heading lines} and @dfn{body lines}. A heading line represents a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 topic in the outline. Heading lines start with one or more stars; the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 number of stars determines the depth of the heading in the outline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 structure. Thus, a heading line with one star is a major topic; all the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 heading lines with two stars between it and the next one-star heading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 are its subtopics; and so on. Any line that is not a heading line is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 body line. Body lines belong to the preceding heading line. Here is an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 * Food
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 This is the body,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 which says something about the topic of food.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 ** Delicious Food
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 This is the body of the second-level header.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 ** Distasteful Food
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 This could have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 a body too, with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 several lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 *** Dormitory Food
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 * Shelter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 A second first-level topic with its header line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 A heading line together with all following body lines is called
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 collectively an @dfn{entry}. A heading line together with all following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 deeper heading lines and their body lines is called a @dfn{subtree}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 @vindex outline-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 You can customize the criterion for distinguishing heading lines by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 setting the variable @code{outline-regexp}. Any line whose beginning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 has a match for this regexp is considered a heading line. Matches that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 start within a line (not at the beginning) do not count. The length of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 the matching text determines the level of the heading; longer matches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 make a more deeply nested level. Thus, for example, if a text formatter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 has commands @samp{@@chapter}, @samp{@@section} and @samp{@@subsection}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 to divide the document into chapters and sections, you can make those
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 lines count as heading lines by setting @code{outline-regexp} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 @samp{"@@chap\\|@@\\(sub\\)*section"}. Note the trick: the two words
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 @samp{chapter} and @samp{section} are the same length, but by defining
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 the regexp to match only @samp{chap} we ensure that the length of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 text matched on a chapter heading is shorter, so that Outline mode will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 know that sections are contained in chapters. This works as long as no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 other command starts with @samp{@@chap}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 Outline mode makes a line invisible by changing the newline before it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 into an ASCII Control-M (code 015). Most editing commands that work on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 lines treat an invisible line as part of the previous line because,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 strictly speaking, it @i{is} part of that line, since there is no longer a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 newline in between. When you save the file in Outline mode, Control-M
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 characters are saved as newlines, so the invisible lines become ordinary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 lines in the file. Saving does not change the visibility status of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 line inside Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 @node Outline Motion,Outline Visibility,Outline Format,Outline Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 @subsubsection Outline Motion Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 Some special commands in Outline mode move backward and forward to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 heading lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 @item C-c C-n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 Move point to the next visible heading line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (@code{outline-next-visible-heading}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 @item C-c C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 Move point to the previous visible heading line @*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (@code{outline-previous-visible-heading}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 @item C-c C-f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 Move point to the next visible heading line at the same level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 as the one point is on (@code{outline-forward-same-level}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 @item C-c C-b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 Move point to the previous visible heading line at the same level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (@code{outline-backward-same-level}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 @item C-c C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 Move point up to a lower-level (more inclusive) visible heading line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (@code{outline-up-heading}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 @findex outline-next-visible-heading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 @findex outline-previous-visible-heading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 @kindex C-c C-n (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 @kindex C-c C-p (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 @kbd{C-c C-n} (@code{next-visible-heading}) moves down to the next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 heading line. @kbd{C-c C-p} (@code{previous-visible-heading}) moves
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 similarly backward. Both accept numeric arguments as repeat counts. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 names emphasize that invisible headings are skipped, but this is not really
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 a special feature. All editing commands that look for lines ignore the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 invisible lines automatically.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 @findex outline-up-heading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 @findex outline-forward-same-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 @findex outline-backward-same-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 @kindex C-c C-f (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 @kindex C-c C-b (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 @kindex C-c C-u (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 More advanced motion commands understand the levels of headings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 The commands @kbd{C-c C-f} (@code{outline-forward-same-level}) and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 @kbd{C-c C-b} (@code{outline-backward-same-level}) move from one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 heading line to another visible heading at the same depth in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 the outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 backward to another heading that is less deeply nested.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 @node Outline Visibility,,Outline Motion,Outline Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 @subsubsection Outline Visibility Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 The other special commands of outline mode are used to make lines visible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 or invisible. Their names all start with @code{hide} or @code{show}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 Most of them exist as pairs of opposites. They are not undoable; instead,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 you can undo right past them. Making lines visible or invisible is simply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 not recorded by the undo mechanism.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 @item M-x hide-body
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 Make all body lines in the buffer invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 @item M-x show-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 Make all lines in the buffer visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 @item C-c C-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 Make everything under this heading invisible, not including this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 heading itself (@code{hide-subtree}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 @item C-c C-s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 Make everything under this heading visible, including body,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 subheadings, and their bodies (@code{show-subtree}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 @item M-x hide-leaves
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 Make the body of this heading line, and of all its subheadings,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 @item M-x show-branches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 Make all subheadings of this heading line, at all levels, visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 @item C-c C-i
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 Make immediate subheadings (one level down) of this heading line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 visible (@code{show-children}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 @item M-x hide-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 Make this heading line's body invisible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 @item M-x show-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 Make this heading line's body visible.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 @findex hide-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 @findex show-entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 Two commands that are exact opposites are @kbd{M-x hide-entry} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 @kbd{M-x show-entry}. They are used with point on a heading line, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 apply only to the body lines of that heading. The subtopics and their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 bodies are not affected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 @findex hide-subtree
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 @findex show-subtree
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 @kindex C-c C-s (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 @kindex C-c C-h (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 @cindex subtree (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 Two more powerful opposites are @kbd{C-c C-h} (@code{hide-subtree}) and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 @kbd{C-c C-s} (@code{show-subtree}). Both should be used when point is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 on a heading line, and both apply to all the lines of that heading's
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 @dfn{subtree}: its body, all its subheadings, both direct and indirect, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 all of their bodies. In other words, the subtree contains everything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 following this heading line, up to and not including the next heading of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 the same or higher rank.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 @findex hide-leaves
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 @findex show-branches
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 Intermediate between a visible subtree and an invisible one is having
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 all the subheadings visible but none of the body. There are two commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 for doing this, one that hides the bodies and one that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 makes the subheadings visible. They are @kbd{M-x hide-leaves} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 @kbd{M-x show-branches}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 @kindex C-c C-i (Outline mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 @findex show-children
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 A little weaker than @code{show-branches} is @kbd{C-c C-i}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (@code{show-children}). It makes just the direct subheadings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 visible---those one level down. Deeper subheadings remain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 invisible.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 @findex hide-body
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 @findex show-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 Two commands have a blanket effect on the whole file. @kbd{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 hide-body} makes all body lines invisible, so that you see just the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 outline structure. @kbd{M-x show-all} makes all lines visible. You can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 think of these commands as a pair of opposites even though @kbd{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 show-all} applies to more than just body lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 @vindex selective-display-ellipses
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 You can turn off the use of ellipses at the ends of visible lines by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 setting @code{selective-display-ellipses} to @code{nil}. The result is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 no visible indication of the presence of invisible lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 @node Words, Sentences, Text Mode, Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 @section Words
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 @cindex words
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 @cindex Meta
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 Emacs has commands for moving over or operating on words. By convention,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 the keys for them are all @kbd{Meta-} characters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 @c widecommands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 @item M-f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 Move forward over a word (@code{forward-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 @item M-b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 Move backward over a word (@code{backward-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 @item M-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 Kill up to the end of a word (@code{kill-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 @item M-@key{DEL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 Kill back to the beginning of a word (@code{backward-kill-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 @item M-@@
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 Mark the end of the next word (@code{mark-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 @item M-t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 Transpose two words; drag a word forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 or backward across other words (@code{transpose-words}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 Notice how these keys form a series that parallels the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 character-based @kbd{C-f}, @kbd{C-b}, @kbd{C-d}, @kbd{C-t} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 @key{DEL}. @kbd{M-@@} is related to @kbd{C-@@}, which is an alias for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 @kbd{C-@key{SPC}}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 @kindex M-f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 @kindex M-b
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 @findex forward-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 @findex backward-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 The commands @kbd{Meta-f} (@code{forward-word}) and @kbd{Meta-b}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (@code{backward-word}) move forward and backward over words. They are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 analogous to @kbd{Control-f} and @kbd{Control-b}, which move over single
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 characters. Like their @kbd{Control-} analogues, @kbd{Meta-f} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 @kbd{Meta-b} move several words if given an argument. @kbd{Meta-f} with a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 negative argument moves backward, and @kbd{Meta-b} with a negative argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 moves forward. Forward motion stops after the last letter of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 word, while backward motion stops before the first letter.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 @kindex M-d
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 @findex kill-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 @kbd{Meta-d} (@code{kill-word}) kills the word after point. To be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 precise, it kills everything from point to the place @kbd{Meta-f} would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 move to. Thus, if point is in the middle of a word, @kbd{Meta-d} kills
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 just the part after point. If some punctuation comes between point and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 next word, it is killed along with the word. (To kill only the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 next word but not the punctuation before it, simply type @kbd{Meta-f} to get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 to the end and kill the word backwards with @kbd{Meta-@key{DEL}}.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 @kbd{Meta-d} takes arguments just like @kbd{Meta-f}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 @findex backward-kill-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 @kindex M-DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 @kbd{Meta-@key{DEL}} (@code{backward-kill-word}) kills the word before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 point. It kills everything from point back to where @kbd{Meta-b} would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 move to. If point is after the space in @w{@samp{FOO, BAR}}, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 @w{@samp{FOO, }} is killed. To kill just @samp{FOO}, type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 @kbd{Meta-b Meta-d} instead of @kbd{Meta-@key{DEL}}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 @cindex transposition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 @kindex M-t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 @findex transpose-words
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 @kbd{Meta-t} (@code{transpose-words}) exchanges the word before or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 containing point with the following word. The delimiter characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 between the words do not move. For example, transposing @w{@samp{FOO,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 BAR}} results in @w{@samp{BAR, FOO}} rather than @samp{@w{BAR FOO,}}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 @xref{Transpose}, for more on transposition and on arguments to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 transposition commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 @kindex M-@@
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 @findex mark-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 To operate on the next @var{n} words with an operation which applies
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 between point and mark, you can either set the mark at point and then move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 over the words, or you can use the command @kbd{Meta-@@} (@code{mark-word})
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 which does not move point but sets the mark where @kbd{Meta-f} would move
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 to. It can be given arguments just like @kbd{Meta-f}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 @cindex syntax table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 The word commands' understanding of syntax is completely controlled by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 the syntax table. For example, any character can be declared to be a word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 delimiter. @xref{Syntax}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 @node Sentences, Paragraphs, Words, Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 @section Sentences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 @cindex sentences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 The Emacs commands for manipulating sentences and paragraphs are mostly
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 on @kbd{Meta-} keys, and therefore are like the word-handling commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 @item M-a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 Move back to the beginning of the sentence (@code{backward-sentence}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 @item M-e
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 Move forward to the end of the sentence (@code{forward-sentence}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 @item M-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 Kill forward to the end of the sentence (@code{kill-sentence}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 @item C-x @key{DEL}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 Kill back to the beginning of the sentence @*(@code{backward-kill-sentence}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 @kindex M-a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 @kindex M-e
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 @findex backward-sentence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 @findex forward-sentence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 The commands @kbd{Meta-a} and @kbd{Meta-e} (@code{backward-sentence}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 and @code{forward-sentence}) move to the beginning and end of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 current sentence, respectively. They resemble @kbd{Control-a} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 @kbd{Control-e}, which move to the beginning and end of a line. Unlike
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 their counterparts, @kbd{Meta-a} and @kbd{Meta-e} move over successive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 sentences if repeated or given numeric arguments. Emacs assumes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 the typist's convention is followed, and thus considers a sentence to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 end wherever there is a @samp{.}, @samp{?}, or @samp{!} followed by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 end of a line or two spaces, with any number of @samp{)}, @samp{]},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 @samp{'}, or @samp{"} characters allowed in between. A sentence also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 begins or ends wherever a paragraph begins or ends.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 Neither @kbd{M-a} nor @kbd{M-e} moves past the newline or spaces beyond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 the sentence edge at which it is stopping.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 @kindex M-k
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 @kindex C-x DEL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 @findex kill-sentence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 @findex backward-kill-sentence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 @kbd{M-a} and @kbd{M-e} have a corresponding kill command, just like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 @kbd{C-a} and @kbd{C-e} have @kbd{C-k}. The command is @kbd{M-k}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (@code{kill-sentence}) which kills from point to the end of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 sentence. With minus one as an argument it kills back to the beginning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 of the sentence. Larger arguments serve as repeat counts.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 There is a special command, @kbd{C-x @key{DEL}}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 (@code{backward-kill-sentence}), for killing back to the beginning of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 sentence, which is useful when you change your mind in the middle of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 composing text.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 @vindex sentence-end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 The variable @code{sentence-end} controls recognition of the end of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 sentence. It is a regexp that matches the last few characters of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 sentence, together with the whitespace following the sentence. Its
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 normal value is:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 "[.?!][]\"')]*\\($\\|\t\\| \\)[ \t\n]*"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 This example is explained in the section on regexps. @xref{Regexps}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 @node Paragraphs, Pages, Sentences, Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 @section Paragraphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 @cindex paragraphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 @kindex M-[
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 @kindex M-]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 @findex backward-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 @findex forward-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 The Emacs commands for manipulating paragraphs are also @kbd{Meta-}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 keys.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 @item M-[
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 Move back to previous paragraph beginning @*(@code{backward-paragraph}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 @item M-]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 Move forward to next paragraph end (@code{forward-paragraph}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 @item M-h
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 Put point and mark around this or next paragraph (@code{mark-paragraph}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 @kbd{Meta-[} moves to the beginning of the current or previous paragraph,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 while @kbd{Meta-]} moves to the end of the current or next paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 Blank lines and text formatter command lines separate paragraphs and are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 not part of any paragraph. An indented line starts a new paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 In major modes for programs (as opposed to Text mode), paragraphs begin
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 and end only at blank lines. As a result, the paragraph commands continue to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 be useful even though there are no paragraphs per se.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 When there is a fill prefix, paragraphs are delimited by all lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 which don't start with the fill prefix. @xref{Filling}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 @kindex M-h
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 @findex mark-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 To operate on a paragraph, you can use the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 @kbd{Meta-h} (@code{mark-paragraph}) to set the region around it. This
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 command puts point at the beginning and mark at the end of the paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 point was in. If point is between paragraphs (in a run of blank lines or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 at a boundary), the paragraph following point is surrounded by point and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 mark. If there are blank lines preceding the first line of the paragraph,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 one of the blank lines is included in the region. Thus, for example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 @kbd{M-h C-w} kills the paragraph around or after point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 @vindex paragraph-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 @vindex paragraph-separate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 The precise definition of a paragraph boundary is controlled by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 variables @code{paragraph-separate} and @code{paragraph-start}. The value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 of @code{paragraph-start} is a regexp that matches any line that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 either starts or separates paragraphs. The value of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 @code{paragraph-separate} is another regexp that matches only lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 that separate paragraphs without being part of any paragraph. Lines that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 start a new paragraph and are contained in it must match both regexps. For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 example, normally @code{paragraph-start} is @code{"^[ @t{\}t@t{\}n@t{\}f]"}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 and @code{paragraph-separate} is @code{"^[ @t{\}t@t{\}f]*$"}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 Normally it is desirable for page boundaries to separate paragraphs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 The default values of these variables recognize the usual separator for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 pages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 @node Pages, Filling, Paragraphs, Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 @section Pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 @cindex pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 @cindex formfeed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 Files are often thought of as divided into @dfn{pages} by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 @dfn{formfeed} character (ASCII Control-L, octal code 014). For
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 example, if a file is printed on a line printer, each ``page'' of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 file starts on a new page of paper. Emacs treats a page-separator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 character just like any other character. It can be inserted with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 @kbd{C-q C-l} or deleted with @key{DEL}. You are free to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 paginate your file or not. However, since pages are often meaningful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 divisions of the file, commands are provided to move over them and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 operate on them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 @c WideCommands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 @item C-x [
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 Move point to previous page boundary (@code{backward-page}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 @item C-x ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 Move point to next page boundary (@code{forward-page}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 @item C-x C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 Put point and mark around this page (or another page) (@code{mark-page}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 @item C-x l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 Count the lines in this page (@code{count-lines-page}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 @kindex C-x [
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 @kindex C-x ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 @findex forward-page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 @findex backward-page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 The @kbd{C-x [} (@code{backward-page}) command moves point to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 immediately after the previous page delimiter. If point is already
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 right after a page delimiter, the command skips that one and stops at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 the previous one. A numeric argument serves as a repeat count. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 @kbd{C-x ]} (@code{forward-page}) command moves forward past the next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 page delimiter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 @kindex C-x C-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 @findex mark-page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 The @kbd{C-x C-p} command (@code{mark-page}) puts point at the beginning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 of the current page and the mark at the end. The page delimiter at the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 is included (the mark follows it). The page delimiter at the front is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 excluded (point follows it). You can follow this command by @kbd{C-w} to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 kill a page you want to move elsewhere. If you insert the page after a page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 delimiter, at a place where @kbd{C-x ]} or @kbd{C-x [} would take you,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 the page will be properly delimited before and after once again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 A numeric argument to @kbd{C-x C-p} is used to specify which page to go
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 to, relative to the current one. Zero means the current page. One means
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 the next page, and @minus{}1 means the previous one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 @kindex C-x l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 @findex count-lines-page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 The @kbd{C-x l} command (@code{count-lines-page}) can help you decide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 where to break a page in two. It prints the total number of lines in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 the current page in the echo area, then divides the lines into those
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 preceding the current line and those following it, for example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 Page has 96 (72+25) lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 Notice that the sum is off by one; this is correct if point is not at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 beginning of a line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 @vindex page-delimiter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 The variable @code{page-delimiter} should have as its value a regexp that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 matches the beginning of a line that separates pages. This defines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 where pages begin. The normal value of this variable is @code{"^@t{\}f"},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 which matches a formfeed character at the beginning of a line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 @node Filling, Case, Pages, Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 @section Filling Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 @cindex filling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 If you use Auto Fill mode, Emacs @dfn{fills} text (breaks it up into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 lines that fit in a specified width) as you insert it. When you alter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 existing text it is often no longer be properly filled afterwards and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 you can use explicit commands for filling.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 * Auto Fill:: Auto Fill mode breaks long lines automatically.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 * Fill Commands:: Commands to refill paragraphs and center lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 * Fill Prefix:: Filling when every line is indented or in a comment, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 @node Auto Fill, Fill Commands, Filling, Filling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 @subsection Auto Fill Mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 @cindex Auto Fill mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 @dfn{Auto Fill} mode is a minor mode in which lines are broken
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 automatically when they become too wide. Breaking happens only when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 you type a @key{SPC} or @key{RET}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 @item M-x auto-fill-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 Enable or disable Auto Fill mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 @item @key{SPC}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 @itemx @key{RET}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 In Auto Fill mode, break lines when appropriate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 @findex auto-fill-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 @kbd{M-x auto-fill-mode} turns Auto Fill mode on if it was off, or off
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 if it was on. With a positive numeric argument the command always turns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 Auto Fill mode on, and with a negative argument it always turns it off.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 The presence of the word @samp{Fill} in the mode line, inside the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 parentheses, indicates that Auto Fill mode is in effect. Auto Fill mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 is a minor mode; you can turn it on or off for each buffer individually.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 @xref{Minor Modes}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 In Auto Fill mode, lines are broken automatically at spaces when they get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 longer than desired. Line breaking and rearrangement takes place
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 only when you type @key{SPC} or @key{RET}. To insert a space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 or newline without permitting line-breaking, type @kbd{C-q @key{SPC}} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 @kbd{C-q @key{LFD}} (recall that a newline is really a linefeed).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 @kbd{C-o} inserts a newline without line breaking.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 Auto Fill mode works well with Lisp mode: when it makes a new line in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 Lisp mode, it indents that line with @key{TAB}. If a line ending in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 Lisp comment gets too long, the text of the comment is split into two
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 comment lines. Optionally, new comment delimiters are inserted at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 end of the first line and the beginning of the second, so that each line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 is a separate comment. The variable @code{comment-multi-line} controls
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 the choice (@pxref{Comments}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 Auto Fill mode does not refill entire paragraphs. It can break lines but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 cannot merge lines. Editing in the middle of a paragraph can result in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 a paragraph that is not correctly filled. The easiest way to make the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 paragraph properly filled again is using an explicit fill commands.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 Many users like Auto Fill mode and want to use it in all text files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 The section on init files explains how you can arrange this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 permanently for yourself. @xref{Init File}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 @node Fill Commands, Fill Prefix, Auto Fill, Filling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 @subsection Explicit Fill Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 @item M-q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 Fill current paragraph (@code{fill-paragraph}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 @item M-g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 Fill each paragraph in the region (@code{fill-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 @item C-x f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 Set the fill column (@code{set-fill-column}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 @item M-x fill-region-as-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 Fill the region, considering it as one paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 @item M-s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 Center a line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 @kindex M-q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 @findex fill-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 To refill a paragraph, use the command @kbd{Meta-q}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (@code{fill-paragraph}). It causes the paragraph containing point, or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 the one after point if point is between paragraphs, to be refilled. All
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 line breaks are removed, and new ones are inserted where necessary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 @kbd{M-q} can be undone with @kbd{C-_}. @xref{Undo}.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 @kindex M-g
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 @findex fill-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 To refill many paragraphs, use @kbd{M-g} (@code{fill-region}), which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 divides the region into paragraphs and fills each of them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 @findex fill-region-as-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 @kbd{Meta-q} and @kbd{Meta-g} use the same criteria as @kbd{Meta-h} for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 finding paragraph boundaries (@pxref{Paragraphs}). For more control, you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 can use @kbd{M-x fill-region-as-paragraph}, which refills everything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 between point and mark. This command recognizes only blank lines as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 paragraph separators.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 @cindex justification
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 A numeric argument to @kbd{M-g} or @kbd{M-q} causes it to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 @dfn{justify} the text as well as filling it. Extra spaces are inserted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 to make the right margin line up exactly at the fill column. To remove
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 the extra spaces, use @kbd{M-q} or @kbd{M-g} with no argument.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 @vindex auto-fill-inhibit-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 The variable @code{auto-fill-inhibit-regexp} takes as a value a regexp to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 match lines that should not be auto-filled.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 @kindex M-s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 @cindex centering
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 @findex center-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 The command @kbd{Meta-s} (@code{center-line}) centers the current line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 within the current fill column. With an argument, it centers several lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 individually and moves past them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 @vindex fill-column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 The maximum line width for filling is in the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 @code{fill-column}. Altering the value of @code{fill-column} makes it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 local to the current buffer; until then, the default value---initially
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 70---is in effect. @xref{Locals}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 @kindex C-x f
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 @findex set-fill-column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 The easiest way to set @code{fill-column} is to use the command @kbd{C-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 f} (@code{set-fill-column}). With no argument, it sets @code{fill-column}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 to the current horizontal position of point. With a numeric argument, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 uses that number as the new fill column.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 @node Fill Prefix,, Fill Commands, Filling
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 @subsection The Fill Prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 @cindex fill prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 To fill a paragraph in which each line starts with a special marker
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (which might be a few spaces, giving an indented paragraph), use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 @dfn{fill prefix} feature. The fill prefix is a string which is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 included in filling. Emacs expects every line to start with a fill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 prefix.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 @item C-x .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 Set the fill prefix (@code{set-fill-prefix}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 @item M-q
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 Fill a paragraph using current fill prefix (@code{fill-paragraph}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 @item M-x fill-individual-paragraphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 Fill the region, considering each change of indentation as starting a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 new paragraph.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 @kindex C-x .
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 @findex set-fill-prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 To specify a fill prefix, move to a line that starts with the desired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 prefix, put point at the end of the prefix, and give the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 @w{@kbd{C-x .}}@: (@code{set-fill-prefix}). That's a period after the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 @kbd{C-x}. To turn off the fill prefix, specify an empty prefix: type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 @w{@kbd{C-x .}}@: with point at the beginning of a line.@refill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 When a fill prefix is in effect, the fill commands remove the fill
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 prefix from each line before filling and insert it on each line after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 filling. Auto Fill mode also inserts the fill prefix inserted on new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 lines it creates. Lines that do not start with the fill prefix are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 considered to start paragraphs, both in @kbd{M-q} and the paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 commands; this is just right if you are using paragraphs with hanging
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 indentation (every line indented except the first one). Lines which are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 blank or indented once the prefix is removed also separate or start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 paragraphs; this is what you want if you are writing multi-paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 comments with a comment delimiter on each line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 @vindex fill-prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 The fill prefix is stored in the variable @code{fill-prefix}. Its value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 is a string, or @code{nil} when there is no fill prefix. This is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 per-buffer variable; altering the variable affects only the current buffer,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 but there is a default value which you can change as well. @xref{Locals}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 @findex fill-individual-paragraphs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 Another way to use fill prefixes is through @kbd{M-x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 fill-individual-paragraphs}. This function divides the region into groups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 of consecutive lines with the same amount and kind of indentation and fills
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 each group as a paragraph, using its indentation as a fill prefix.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 @node Case,, Filling, Text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 @section Case Conversion Commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 @cindex case conversion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 Emacs has commands for converting either a single word or any arbitrary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 range of text to upper case or to lower case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 @c WideCommands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 @table @kbd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 @item M-l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 Convert following word to lower case (@code{downcase-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 @item M-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 Convert following word to upper case (@code{upcase-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 @item M-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 Capitalize the following word (@code{capitalize-word}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 @item C-x C-l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 Convert region to lower case (@code{downcase-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 @item C-x C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 Convert region to upper case (@code{upcase-region}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 @kindex M-l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 @kindex M-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 @kindex M-c
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 @cindex words
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 @findex downcase-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 @findex upcase-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 @findex capitalize-word
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 The word conversion commands are used most frequently. @kbd{Meta-l}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (@code{downcase-word}) converts the word after point to lower case,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 moving past it. Thus, repeating @kbd{Meta-l} converts successive words.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 @kbd{Meta-u} (@code{upcase-word}) converts to all capitals instead,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 while @kbd{Meta-c} (@code{capitalize-word}) puts the first letter of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 word into upper case and the rest into lower case. The word conversion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 commands convert several words at once if given an argument. They are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 especially convenient for converting a large amount of text from all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104 upper case to mixed case: you can move through the text using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 @kbd{M-l}, @kbd{M-u}, or @kbd{M-c} on each word as appropriate,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 occasionally using @kbd{M-f} instead to skip a word.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 When given a negative argument, the word case conversion commands apply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 to the appropriate number of words before point, but do not move point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 This is convenient when you have just typed a word in the wrong case: you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 can give the case conversion command and continue typing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 If a word case conversion command is given in the middle of a word, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 applies only to the part of the word which follows point. This is just
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 like what @kbd{Meta-d} (@code{kill-word}) does. With a negative argument,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 case conversion applies only to the part of the word before point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 @kindex C-x C-l
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 @kindex C-x C-u
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 @cindex region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 @findex downcase-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 @findex upcase-region
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 The other case conversion commands are @kbd{C-x C-u}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 (@code{upcase-region}) and @kbd{C-x C-l} (@code{downcase-region}), which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 convert everything between point and mark to the specified case. Point and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 mark do not move.@refill