manpagez: man pages & more
info emacs
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

30.2 Sentences

The Emacs commands for manipulating sentences and paragraphs are mostly on Meta keys, so as to be like the word-handling commands.


Move back to the beginning of the sentence (backward-sentence).


Move forward to the end of the sentence (forward-sentence).


Kill forward to the end of the sentence (kill-sentence).

C-x <DEL>

Kill back to the beginning of the sentence (backward-kill-sentence).

The commands M-a and M-e (backward-sentence and forward-sentence) move to the beginning and end of the current sentence, respectively. They were chosen to resemble C-a and C-e, which move to the beginning and end of a line. Unlike them, M-a and M-e move over successive sentences if repeated.

Moving backward over a sentence places point just before the first character of the sentence; moving forward places point right after the punctuation that ends the sentence. Neither one moves over the whitespace at the sentence boundary.

Just as C-a and C-e have a kill command, C-k, to go with them, so M-a and M-e have a corresponding kill command M-k (kill-sentence) which kills from point to the end of the sentence. With minus one as an argument it kills back to the beginning of the sentence. Larger arguments serve as a repeat count. There is also a command, C-x <DEL> (backward-kill-sentence), for killing back to the beginning of a sentence. This command is useful when you change your mind in the middle of composing text.

The sentence commands assume that you follow the American typist's convention of putting two spaces at the end of a sentence; they consider a sentence to end wherever there is a ‘.’, ‘?’ or ‘!’ followed by the end of a line or two spaces, with any number of ‘)’, ‘]’, ‘'’, or ‘"’ characters allowed in between. A sentence also begins or ends wherever a paragraph begins or ends. It is useful to follow this convention, because it makes a distinction between periods that end a sentence and periods that indicate abbreviations; that enables the Emacs sentence commands to distinguish, too. These commands do not stop for periods that indicate abbreviations.

If you want to use just one space between sentences, you can set the variable sentence-end-double-space to nil to make the sentence commands stop for single spaces. However, this mode has a drawback: there is no way to distinguish between periods that end sentences and those that indicate abbreviations. For convenient and reliable editing, we therefore recommend you follow the two-space convention. The variable sentence-end-double-space also affects filling (see section Explicit Fill Commands) in related ways.

The variable sentence-end controls how to recognize the end of a sentence. If non-nil, it is a regexp that matches the last few characters of a sentence, together with the whitespace following the sentence. If the value is nil, the default, then Emacs computes the regexp according to various criteria such as the value of sentence-end-double-space. See section Regular Expression Example, for a detailed explanation of one of the regular expressions Emacs uses for this purpose.

Some languages do not use periods to indicate the end of a sentence. For example, sentences in Thai end with a double space but without a period. Set the variable sentence-end-without-period to t in such cases.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© 2000-2024
Individual documents may contain additional copyright information.