@c This is part of the Emacs manual.
@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
-@c 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@node Text, Programs, Indentation, Top
@chapter Commands for Human Languages
@end iftex
For text which contains embedded commands for text formatters, Emacs
-has other major modes, each for a particular text formatter. Thus, for
+has other major modes, each for a particular formatter. Thus, for
input to @TeX{}, you would use @TeX{}
@iftex
-mode (@pxref{TeX Mode}).
+mode (@pxref{TeX Mode,,@TeX{} Mode}).
@end iftex
-@ifinfo
+@ifnottex
mode.
-@end ifinfo
+@end ifnottex
For input to groff or nroff, use Nroff mode.
Instead of using a text formatter, you can edit formatted text in
If you need to edit pictures made out of text characters (commonly
referred to as ``ASCII art''), use @kbd{M-x edit-picture} to enter
Picture mode, a special major mode for editing such pictures.
-@inforef{Picture Mode,, emacs-xtra}.
+@iftex
+@xref{Picture Mode,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
+@ifnottex
+@xref{Picture Mode}.
+@end ifnottex
+
@cindex skeletons
@cindex templates
@item M-@@
Mark the end of the next word (@code{mark-word}).
@item M-t
-Transpose two words or drag a word across other words
+Transpose two words or drag a word across others
(@code{transpose-words}).
@end table
containing point with the following word. The delimiter characters between
the words do not move. For example, @w{@samp{FOO, BAR}} transposes into
@w{@samp{BAR, FOO}} rather than @samp{@w{BAR FOO,}}. @xref{Transpose}, for
-more on transposition and on arguments to transposition commands.
+more on transposition.
@kindex M-@@
@findex mark-word
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 to not stop for periods that indicate abbreviations.
+too. These commands do not stop for periods that indicate abbreviations.
@vindex sentence-end-double-space
If you want to use just one space between sentences, you can set the
for this purpose.
@vindex sentence-end-without-period
- Some languages do not use period to indicate end of sentence. For
-example, a sentence in Thai text ends with double space but without a
+ 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 @code{sentence-end-without-period} to
-@code{t} to tell the sentence commands that a period is not necessary.
+@code{t} in such cases.
@node Paragraphs
@section Paragraphs
@findex backward-paragraph
@findex forward-paragraph
- The Emacs commands for manipulating paragraphs are also Meta keys.
+ The Emacs commands for manipulating paragraphs are also on Meta keys.
@table @kbd
@item M-@{
cannot merge lines. So editing in the middle of a paragraph can result in
a paragraph that is not correctly filled. The easiest way to make the
paragraph properly filled again is usually with the explicit fill commands.
-@ifinfo
+@ifnottex
@xref{Fill Commands}.
-@end ifinfo
+@end ifnottex
Many users like Auto Fill mode and want to use it in all text files.
The section on init files says how to arrange this permanently for yourself.
@code{text-mode-hook} can look at the value of @code{major-mode} to see
which of these modes is actually being entered. @xref{Hooks}.
-@ifinfo
+@ifnottex
Emacs provides two other modes for editing text that is to be passed
through a text formatter to produce fancy formatted printed output.
@xref{Nroff Mode}, for editing input to the formatter nroff.
-@xref{TeX Mode}, for editing input to the formatter TeX.
+@xref{TeX Mode,,@TeX{} Mode}, for editing input to the formatter TeX.
Another mode is used for editing outlines. It allows you to view the
text at various levels of detail. You can view either the outline
headings alone or both headings and text; you can also hide some of the
headings at lower levels from view to make the high level structure more
visible. @xref{Outline Mode}.
-@end ifinfo
+@end ifnottex
@node Outline Mode
@section Outline Mode
deeper heading lines and their body lines is called a @dfn{subtree}.
@vindex outline-regexp
- You can customize the criterion for distinguishing heading lines
-by setting the variable @code{outline-regexp}. Any line whose
-beginning has a match for this regexp is considered a heading line.
-Matches that start within a line (not at the left margin) do not count.
-The length of the matching text determines the level of the heading;
-longer matches make a more deeply nested level. Thus, for example,
-if a text formatter has commands @samp{@@chapter}, @samp{@@section}
-and @samp{@@subsection} to divide the document into chapters and
-sections, you could make those lines count as heading lines by
-setting @code{outline-regexp} to @samp{"@@chap\\|@@\\(sub\\)*section"}.
-Note the trick: the two words @samp{chapter} and @samp{section} are equally
+ You can customize the criterion for distinguishing heading lines by
+setting the variable @code{outline-regexp}. (The recommended ways to
+do this are in a major mode function or with a file local variable.)
+Any line whose beginning has a match for this regexp is considered a
+heading line. Matches that start within a line (not at the left
+margin) do not count.
+
+ The length of the matching text determines the level of the heading;
+longer matches make a more deeply nested level. Thus, for example, if
+a text formatter has commands @samp{@@chapter}, @samp{@@section} and
+@samp{@@subsection} to divide the document into chapters and sections,
+you could make those lines count as heading lines by setting
+@code{outline-regexp} to @samp{"@@chap\\|@@\\(sub\\)*section"}. Note
+the trick: the two words @samp{chapter} and @samp{section} are equally
long, but by defining the regexp to match only @samp{chap} we ensure
that the length of the text matched on a chapter heading is shorter,
-so that Outline mode will know that sections are contained in chapters.
-This works as long as no other command starts with @samp{@@chap}.
+so that Outline mode will know that sections are contained in
+chapters. This works as long as no other command starts with
+@samp{@@chap}.
@vindex outline-level
- You can change the rule for calculating the level of a heading line
-by setting the variable @code{outline-level}. The value of
-@code{outline-level} should be a function that takes no arguments and
-returns the level of the current heading. Some major modes such as C,
-Nroff, and Emacs Lisp mode set this variable and @code{outline-regexp}
-in order to work with Outline minor mode.
+ You can explicitly specify a rule for calculating the level of a
+heading line by setting the variable @code{outline-level}. The value
+of @code{outline-level} should be a function that takes no arguments
+and returns the level of the current heading. The recommended ways to
+set this variable are in a major mode command or with a file local
+variable.
@node Outline Motion
@subsection Outline Motion Commands
also free software, like GNU Emacs. La@TeX{} is a simplified input
format for @TeX{}, implemented by @TeX{} macros; it comes with @TeX{}.
Sli@TeX{} is a special form of La@TeX{}.@footnote{Sli@TeX{} is
-obsoleted by the @samp{slides} document class in recent La@TeX{}
-versions.} Doc@TeX{} (@file{.dtx}) is a special file format in which
-the La@TeX{} sources are written, combining sources with
-documentation.
+obsoleted by the @samp{slides} document class and other alternative
+packages in recent La@TeX{} versions.} Doc@TeX{} (@file{.dtx}) is a
+special file format in which the La@TeX{} sources are written,
+combining sources with documentation.
Emacs has a special @TeX{} mode for editing @TeX{} input files.
It provides facilities for checking the balance of delimiters and for
you can do so by setting the values of the variables @code{tex-run-command},
@code{latex-run-command}, @code{slitex-run-command},
@code{tex-dvi-print-command}, @code{tex-dvi-view-command}, and
-@code{tex-show-queue-command}. You @emph{must} set the value of
-@code{tex-dvi-view-command} for your particular terminal; this variable
-has no default value. The other variables have default values that may
+@code{tex-show-queue-command}. The default values may
(or may not) be appropriate for your system.
Normally, the file name given to these commands comes at the end of
Run a shell command (which you must specify) to validate the current
buffer as SGML (@code{sgml-validate}).
-@item C-x TAB
+@item C-c TAB
@kindex C-c TAB @r{(SGML mode)}
@findex sgml-tags-invisible
Toggle the visibility of existing tags in the buffer. This can be
@subsection Faces in Formatted Text
The Faces submenu lists various Emacs faces including @code{bold},
-@code{italic}, and @code{underline}. Selecting one of these adds the
-chosen face to the region. @xref{Faces}. You can also specify a face
-with these keyboard commands:
+@code{italic}, and @code{underline} (@pxref{Faces}). These menu items
+operate on the region if it is active and nonempty. Otherwise, they
+specify to use that face for an immediately following self-inserting
+character. Instead of the menu, you can use these keyboard commands:
@table @kbd
@kindex M-o d @r{(Enriched mode)}
@findex facemenu-set-default
@item M-o d
-Set the region, or the next inserted character, to the @code{default} face
-(@code{facemenu-set-default}).
+Remove all @code{face} properties from the region (which includes
+specified colors), or force the following inserted character to have no
+@code{face} property (@code{facemenu-set-default}).
@kindex M-o b @r{(Enriched mode)}
@findex facemenu-set-bold
@item M-o b
-Set the region, or the next inserted character, to the @code{bold} face
-(@code{facemenu-set-bold}).
+Add the face @code{bold} to the region or to the following inserted
+character (@code{facemenu-set-bold}).
@kindex M-o i @r{(Enriched mode)}
@findex facemenu-set-italic
@item M-o i
-Set the region, or the next inserted character, to the @code{italic} face
-(@code{facemenu-set-italic}).
+Add the face @code{italic} to the region or to the following inserted
+character (@code{facemenu-set-italic}).
@kindex M-o l @r{(Enriched mode)}
@findex facemenu-set-bold-italic
@item M-o l
-Set the region, or the next inserted character, to the @code{bold-italic} face
-(@code{facemenu-set-bold-italic}).
+Add the face @code{bold-italic} to the region or to the following
+inserted character (@code{facemenu-set-bold-italic}).
@kindex M-o u @r{(Enriched mode)}
@findex facemenu-set-underline
@item M-o u
-Set the region, or the next inserted character, to the @code{underline} face
-(@code{facemenu-set-underline}).
+Add the face @code{underline} to the region or to the following inserted
+character (@code{facemenu-set-underline}).
@kindex M-o o @r{(Enriched mode)}
@findex facemenu-set-face
@item M-o o @var{face} @key{RET}
-Set the region, or the next inserted character, to the face @var{face}
-(@code{facemenu-set-face}).
+Add the face @var{face} to the region or to the following inserted
+character (@code{facemenu-set-face}).
@end table
- If you use these commands with a prefix argument---or, in Transient Mark
-mode, if the region is not active---then these commands specify a face
-to use for any immediately following self-inserting input.
-@xref{Transient Mark}. This applies to both the keyboard commands and
-the menu commands.
+ With a prefix argument, all these commands apply to an immediately
+following self-inserting character, disregarding the region.
- Specifying the @code{default} face also resets foreground and
-background color to their defaults.(@pxref{Format Colors}).
+ A self-inserting character normally inherits the @code{face}
+property (and most other text properties) from the preceding character
+in the buffer. If you use the above commands to specify face for the
+next self-inserting character, or the next section's commands to
+specify a foreground or background color for it, then it does not
+inherit the @code{face} property from the preceding character; instead
+it uses whatever you specified. It will still inherit other text
+properties, though.
- Any self-inserting character you type inherits, by default, the face
-properties (as well as most other text properties) of the preceding
-character. Specifying any face property, including foreground or
-background color, for your next self-inserting character will prevent
-it from inheriting any face properties from the preceding character,
-although it will still inherit other text properties. Characters
-inserted by yanking do not inherit text properties.
+ Strictly speaking, these commands apply only to the first following
+self-inserting character that you type. But if you insert additional
+characters after it, they will inherit from the first one. So it
+appears that these commands apply to all of them.
Enriched mode defines two additional faces: @code{excerpt} and
@code{fixed}. These correspond to codes used in the text/enriched file
If you specify a color with a prefix argument---or, in Transient
Mark mode, if the region is not active---then it applies to any
-immediately following self-inserting input. @xref{Transient Mark}.
-Otherwise, the command applies to the region.
+immediately following self-inserting input. Otherwise, the command
+applies to the region.
Each color menu contains one additional item: @samp{Other}. You can use
this item to specify a color that is not listed in the menu; it reads
@findex facemenu-set-foreground
@findex facemenu-set-background
- There are no key bindings for specifying colors, but you can do so
+ There are no predefined key bindings for specifying colors, but you can do so
with the extended commands @kbd{M-x facemenu-set-foreground} and
@kbd{M-x facemenu-set-background}. Both of these commands read the name
of the color with the minibuffer.
Normally, Emacs knows when you are editing formatted text because it
recognizes the special annotations used in the file that you visited.
-However, there are situations in which you must take special actions
-to convert file contents or turn on Enriched mode:
+However, sometimes you must take special actions to convert file
+contents or turn on Enriched mode:
@itemize @bullet
@item
text-based tables. Here is an example of such a table:
@smallexample
+@group
+-----------------+--------------------------------+-----------------+
| Command | Description | Key Binding |
+-----------------+--------------------------------+-----------------+
| |end of buffer, stop and signal | |
| |error. | |
+-----------------+--------------------------------+-----------------+
+@end group
@end smallexample
Table mode allows the contents of the table such as this one to be
lines):
@example
-@samp{table-capture} is a powerful command however mastering its power
-requires some practice. Here are some things it can do:
+@samp{table-capture} is a powerful command, but mastering its
+power requires some practice. Here are some things it can do:
Parse Cell Items By using column delimiter regular
expression and raw delimiter regular
@c The first line's right-hand frame in the following two examples
@c sticks out to accommodate for the removal of @samp in the
@c produced output!!
-@example
+@smallexample
+@group
+-----------------------------------------------------------------+
|@samp{table-capture} is a powerful command, but mastering its |
|power requires some practice. Here are some things it can do: |
| the specified region is placed in that |
| cell. |
+-----------------------------------------------------------------+
-@end example
+@end group
+@end smallexample
@noindent
By splitting the cell appropriately we now have a table consisting of
paragraphs occupying its own cell. Each cell can now be edited
independently without affecting the layout of other cells.
-@example
+@smallexample
+-----------------------------------------------------------------+
|@samp{table-capture} is a powerful command, but mastering its |
|power requires some practice. Here are some things it can do: |
| |the specified region is placed in that |
| |cell. |
+---------------------+-------------------------------------------+
-@end example
+@end smallexample
@noindent
By applying @code{table-release}, which does the opposite process, the