annotate man/xemacs/text.texi @ 5167:e374ea766cc1

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