Commit b22b1918 authored by Chong Yidong's avatar Chong Yidong
Browse files

Updates to Text chapter of manual.

* doc/emacs/text.texi (Words): Add xref to Position Info.
(Paragraphs): Add xref to Regexps.
parent e15c184e
2011-11-28 Chong Yidong <cyd@gnu.org> 2011-11-28 Chong Yidong <cyd@gnu.org>
* text.texi (Words): Add xref to Position Info.
(Paragraphs): Add xref to Regexps.
* indent.texi (Indentation): Rewrite introduction. Move table to * indent.texi (Indentation): Rewrite introduction. Move table to
Indentation Commands node. Indentation Commands node.
(Indentation Commands): Add index entries to table. Copyedits. (Indentation Commands): Add index entries to table. Copyedits.
......
...@@ -78,8 +78,8 @@ for editing such pictures. ...@@ -78,8 +78,8 @@ for editing such pictures.
@cindex words @cindex words
@cindex Meta commands and words @cindex Meta commands and words
Emacs has commands for moving over or operating on words. By convention, Emacs defines several commands for moving over or operating on
the keys for them are all Meta characters. words:
@table @kbd @table @kbd
@item M-f @item M-f
...@@ -157,13 +157,17 @@ the syntax table. Any character can, for example, be declared to be a ...@@ -157,13 +157,17 @@ the syntax table. Any character can, for example, be declared to be a
word delimiter. @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs word delimiter. @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs
Lisp Reference Manual}. Lisp Reference Manual}.
In addition, see @ref{Position Info} for the @kbd{M-=}
(@code{count-words-region}) and @kbd{M-x count-words} commands, which
count and report the number of words in the region or buffer.
@node Sentences @node Sentences
@section Sentences @section Sentences
@cindex sentences @cindex sentences
@cindex manipulating sentences @cindex manipulating sentences
The Emacs commands for manipulating sentences and paragraphs are mostly The Emacs commands for manipulating sentences and paragraphs are
on Meta keys, so as to be like the word-handling commands. mostly on Meta keys, like the word-handling commands.
@table @kbd @table @kbd
@item M-a @item M-a
...@@ -180,12 +184,12 @@ Kill back to the beginning of the sentence (@code{backward-kill-sentence}). ...@@ -180,12 +184,12 @@ Kill back to the beginning of the sentence (@code{backward-kill-sentence}).
@kindex M-e @kindex M-e
@findex backward-sentence @findex backward-sentence
@findex forward-sentence @findex forward-sentence
The commands @kbd{M-a} and @kbd{M-e} (@code{backward-sentence} and The commands @kbd{M-a} (@code{backward-sentence}) and @kbd{M-e}
@code{forward-sentence}) move to the beginning and end of the current (@code{forward-sentence}) move to the beginning and end of the current
sentence, respectively. They were chosen to resemble @kbd{C-a} and sentence, respectively. Their bindings were chosen to resemble
@kbd{C-e}, which move to the beginning and end of a line. Unlike @kbd{C-a} and @kbd{C-e}, which move to the beginning and end of a
them, @kbd{M-a} and @kbd{M-e} move over successive sentences if line. Unlike them, @kbd{M-a} and @kbd{M-e} move over successive
repeated. sentences if repeated.
Moving backward over a sentence places point just before the first Moving backward over a sentence places point just before the first
character of the sentence; moving forward places point right after the character of the sentence; moving forward places point right after the
...@@ -207,15 +211,14 @@ it kills back to the beginning of the @var{n}th preceding sentence. ...@@ -207,15 +211,14 @@ it kills back to the beginning of the @var{n}th preceding sentence.
to the beginning of a sentence. to the beginning of a sentence.
The sentence commands assume that you follow the American typist's The sentence commands assume that you follow the American typist's
convention of putting two spaces at the end of a sentence; they consider convention of putting two spaces at the end of a sentence. That is, a
a sentence to end wherever there is a @samp{.}, @samp{?} or @samp{!} sentence ends wherever there is a @samp{.}, @samp{?} or @samp{!}
followed by the end of a line or two spaces, with any number of followed by the end of a line or two spaces, with any number of
@samp{)}, @samp{]}, @samp{'}, or @samp{"} characters allowed in between. @samp{)}, @samp{]}, @samp{'}, or @samp{"} characters allowed in
A sentence also begins or ends wherever a paragraph begins or ends. between. A sentence also begins or ends wherever a paragraph begins
It is useful to follow this convention, because it makes a distinction or ends. It is useful to follow this convention, because it allows
between periods that end a sentence and periods that indicate the Emacs sentence commands to distinguish between periods that end a
abbreviations; that enables the Emacs sentence commands to distinguish, sentence and periods that indicate abbreviations.
too. These commands do not stop for periods that indicate abbreviations.
@vindex sentence-end-double-space @vindex sentence-end-double-space
If you want to use just one space between sentences, you can set the If you want to use just one space between sentences, you can set the
...@@ -225,7 +228,7 @@ drawback: there is no way to distinguish between periods that end ...@@ -225,7 +228,7 @@ drawback: there is no way to distinguish between periods that end
sentences and those that indicate abbreviations. For convenient and sentences and those that indicate abbreviations. For convenient and
reliable editing, we therefore recommend you follow the two-space reliable editing, we therefore recommend you follow the two-space
convention. The variable @code{sentence-end-double-space} also convention. The variable @code{sentence-end-double-space} also
affects filling (@pxref{Fill Commands}) in related ways. affects filling (@pxref{Fill Commands}).
@vindex sentence-end @vindex sentence-end
The variable @code{sentence-end} controls how to recognize the end The variable @code{sentence-end} controls how to recognize the end
...@@ -237,19 +240,14 @@ Emacs computes sentence ends according to various criteria such as the ...@@ -237,19 +240,14 @@ Emacs computes sentence ends according to various criteria such as the
value of @code{sentence-end-double-space}. value of @code{sentence-end-double-space}.
@vindex sentence-end-without-period @vindex sentence-end-without-period
Some languages do not use periods to indicate the end of a sentence. Some languages, such as Thai, do not use periods to indicate the end
For example, sentences in Thai end with a double space but without a of a sentence. Set the variable @code{sentence-end-without-period} to
period. Set the variable @code{sentence-end-without-period} to
@code{t} in such cases. @code{t} in such cases.
@node Paragraphs @node Paragraphs
@section Paragraphs @section Paragraphs
@cindex paragraphs @cindex paragraphs
@cindex manipulating paragraphs @cindex manipulating paragraphs
@kindex M-@{
@kindex M-@}
@findex backward-paragraph
@findex forward-paragraph
The Emacs commands for manipulating paragraphs are also on Meta keys. The Emacs commands for manipulating paragraphs are also on Meta keys.
...@@ -262,23 +260,15 @@ Move forward to next paragraph end (@code{forward-paragraph}). ...@@ -262,23 +260,15 @@ Move forward to next paragraph end (@code{forward-paragraph}).
Put point and mark around this or next paragraph (@code{mark-paragraph}). Put point and mark around this or next paragraph (@code{mark-paragraph}).
@end table @end table
@kbd{M-@{} moves to the beginning of the current or previous @kindex M-@{
paragraph, while @kbd{M-@}} moves to the end of the current or next @kindex M-@}
paragraph. Blank lines and text-formatter command lines separate @findex backward-paragraph
paragraphs and are not considered part of any paragraph. If there is @findex forward-paragraph
a blank line before the paragraph, @kbd{M-@{} moves to the blank line, @kbd{M-@{} (@code{backward-paragraph}) moves to the beginning of the
because that is convenient in practice. current or previous paragraph (see below for the definition of a
paragraph). @kbd{M-@}} (@code{forward-paragraph}) moves to the end of
In Text mode, an indented line is not a paragraph break. If you the current or next paragraph. If there is a blank line before the
want indented lines to have this effect, use Paragraph-Indent Text paragraph, @kbd{M-@{} moves to the blank line.
mode instead. @xref{Text Mode}.
In major modes for programs, paragraphs begin and end only at blank
lines. This makes the paragraph commands useful, even though there
are no paragraphs as such in a program.
When you have set a fill prefix, then paragraphs are delimited by
all lines which don't start with the fill prefix. @xref{Filling}.
@kindex M-h @kindex M-h
@findex mark-paragraph @findex mark-paragraph
...@@ -287,31 +277,42 @@ all lines which don't start with the fill prefix. @xref{Filling}. ...@@ -287,31 +277,42 @@ all lines which don't start with the fill prefix. @xref{Filling}.
@kbd{M-h C-w} kills the paragraph around or after point. @kbd{M-h} @kbd{M-h C-w} kills the paragraph around or after point. @kbd{M-h}
puts point at the beginning and mark at the end of the paragraph point puts point at the beginning and mark at the end of the paragraph point
was in. If point is between paragraphs (in a run of blank lines, or was in. If point is between paragraphs (in a run of blank lines, or
at a boundary), the paragraph following point is surrounded by point at a boundary), @kbd{M-h} sets the region around the paragraph
and mark. If there are blank lines preceding the first line of the following point. If there are blank lines preceding the first line of
paragraph, one of these blank lines is included in the region. If the the paragraph, one of these blank lines is included in the region. If
region is already active, the command sets the mark without changing the region is already active, the command sets the mark without
point; furthermore, each subsequent @kbd{M-h} further advances the changing point, and each subsequent @kbd{M-h} further advances the
mark by one paragraph. mark by one paragraph.
The definition of a paragraph depends on the major mode. In
Fundamental mode, as well as Text mode and related modes, a paragraph
is separated each neighboring paragraph another by one or more
@dfn{blank lines}---lines that are either empty, or consist solely of
space, tab and/or formfeed characters. In programming language modes,
paragraphs are usually defined in a similar way, so that you can use
the paragraph commands even though there are no paragraphs as such in
a program.
Note that an indented line is @emph{not} itself a paragraph break in
Text mode. If you want indented lines to separate paragraphs, use
Paragraph-Indent Text mode instead. @xref{Text Mode}.
If you set a fill prefix, then paragraphs are delimited by all lines
which don't start with the fill prefix. @xref{Filling}.
@vindex paragraph-start @vindex paragraph-start
@vindex paragraph-separate @vindex paragraph-separate
The precise definition of a paragraph boundary is controlled by the The precise definition of a paragraph boundary is controlled by the
variables @code{paragraph-separate} and @code{paragraph-start}. The variables @code{paragraph-separate} and @code{paragraph-start}. The
value of @code{paragraph-start} is a regexp that should match any line value of @code{paragraph-start} is a regular expression that should
that either starts or separates paragraphs. The value of match lines that either start or separate paragraphs
@code{paragraph-separate} is another regexp that should match only lines (@pxref{Regexps}). The value of @code{paragraph-separate} is another
that separate paragraphs without being part of any paragraph (for regular expression that should match lines that separate paragraphs
example, blank lines). Lines that start a new paragraph and are without being part of any paragraph (for example, blank lines). Lines
contained in it must match only @code{paragraph-start}, not that start a new paragraph and are contained in it must match only
@code{paragraph-separate}. Each regular expression must match at the @code{paragraph-start}, not @code{paragraph-separate}. For example,
left margin. For example, in Fundamental mode, @code{paragraph-start} in Fundamental mode, @code{paragraph-start} is @w{@code{"\f\\|[
is @w{@code{"\f\\|[ \t]*$"}}, and @code{paragraph-separate} is \t]*$"}}, and @code{paragraph-separate} is @w{@code{"[ \t\f]*$"}}.
@w{@code{"[ \t\f]*$"}}.
Normally it is desirable for page boundaries to separate paragraphs.
The default values of these variables recognize the usual separator for
pages.
@node Pages @node Pages
@section Pages @section Pages
......
...@@ -253,6 +253,7 @@ off by customizing x-gtk-use-system-tooltips. ...@@ -253,6 +253,7 @@ off by customizing x-gtk-use-system-tooltips.
** New basic faces `error', `warning', `success' are available to ** New basic faces `error', `warning', `success' are available to
highlight strings that indicate failure, caution or successful operation. highlight strings that indicate failure, caution or successful operation.
---
** Lucid menus and dialogs can display antialiased fonts if Emacs is built ** Lucid menus and dialogs can display antialiased fonts if Emacs is built
with Xft. To change font, use the X resource font, for example: with Xft. To change font, use the X resource font, for example:
Emacs.pane.menubar.font: Courier-12 Emacs.pane.menubar.font: Courier-12
...@@ -379,7 +380,7 @@ The elisp implementation sha1.el is removed. Feature sha1 is provided ...@@ -379,7 +380,7 @@ The elisp implementation sha1.el is removed. Feature sha1 is provided
by default. by default.
** Menu-bar changes ** Menu-bar changes
---
*** `menu-bar-select-buffer-function' lets you choose another operation *** `menu-bar-select-buffer-function' lets you choose another operation
instead of `switch-to-buffer' when selecting an item in the Buffers menu. instead of `switch-to-buffer' when selecting an item in the Buffers menu.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment