@c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2012
-@c Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2014 Free Software
+@c Foundation, Inc.
@c See file emacs.texi for copying conditions.
-@node Text, Programs, Indentation, Top
+@node Text
@chapter Commands for Human Languages
@cindex text
@cindex manipulating text
@cindex mode, nXML
@findex nxml-mode
Emacs has other major modes for text which contains ``embedded''
-commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and
+commands, such as @TeX{} and @LaTeX{} (@pxref{TeX Mode}); HTML and
SGML (@pxref{HTML Mode}); XML
@ifinfo
(@pxref{Top,The nXML Mode Manual,,nxml-mode, nXML Mode});
* Text Mode:: The major modes for editing text files.
* Outline Mode:: Editing outlines.
* Org Mode:: The Emacs organizer.
-* TeX Mode:: Editing input to the formatter TeX.
+* TeX Mode:: Editing TeX and LaTeX files.
* HTML Mode:: Editing HTML and SGML files.
-* Nroff Mode:: Editing input to the formatter nroff.
-* Enriched Text:: Editing text ``enriched'' with fonts, colors, etc.
+* Nroff Mode:: Editing input to the nroff formatter.
+* Enriched Text:: Editing text "enriched" with fonts, colors, etc.
* Text Based Tables:: Commands for editing text-based tables.
* Two-Column:: Splitting text columns into separate windows.
@end menu
@findex backward-word
The commands @kbd{M-f} (@code{forward-word}) and @kbd{M-b}
(@code{backward-word}) move forward and backward over words. These
-@key{Meta}-based key sequences are analogous to the key sequences
+@key{META}-based key sequences are analogous to the key sequences
@kbd{C-f} and @kbd{C-b}, which move over single characters. The
analogy extends to numeric arguments, which serve as repeat counts.
@kbd{M-f} with a negative argument moves backward, and @kbd{M-b} with
@cindex formfeed character
Within some text files, text is divided into @dfn{pages} delimited
by the @dfn{formfeed character} (@acronym{ASCII} code 12, also denoted
-as @key{control-L}), which is displayed in Emacs as the escape
+as @samp{control-L}), which is displayed in Emacs as the escape
sequence @samp{^L} (@pxref{Text Display}). Traditionally, when such
text files are printed to hardcopy, each formfeed character forces a
page break. Most Emacs commands treat it just like any other
following page delimiter in the region is to ensure that.
A numeric argument to @kbd{C-x C-p} specifies which page to go to,
-relative to the current one. Zero means the current page. One means
-the next page, and @minus{}1 means the previous one.
+relative to the current one. Zero means the current page, one
+the next page, and @minus{}1 the previous one.
@kindex C-x l
@findex count-lines-page
specified width. Emacs does filling in two ways. In Auto Fill mode,
inserting text with self-inserting characters also automatically fills
it. There are also explicit fill commands that you can use when editing
-text leaves it unfilled.
+text.
@menu
* Auto Fill:: Auto Fill mode breaks long lines automatically.
(@pxref{Hooks}). Each function in this hook is called with no
arguments, with point positioned where Emacs is considering breaking a
line. If a function returns a non-@code{nil} value, Emacs will not
-break the line there. Two functions you can use are
+break the line there. Functions you can use there include:
@code{fill-single-word-nobreak-p} (don't break after the first word of
-a sentence or before the last) and @code{fill-french-nobreak-p} (don't
-break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}).
+a sentence or before the last); @code{fill-single-char-nobreak-p}
+(don't break after a one-letter word); and @code{fill-french-nobreak-p}
+(don't break after @samp{(} or before @samp{)}, @samp{:} or @samp{?}).
@node Fill Prefix
@subsection The Fill Prefix
Text mode turns off the features concerned with comments except when
you explicitly invoke them. It changes the syntax table so that
-single-quotes are considered part of words (e.g.@: @samp{don't} is
+single-quotes are considered part of words (e.g., @samp{don't} is
considered one word). However, if a word starts with a single-quote,
it is treated as a prefix for the purposes of capitalization
-(e.g.@: @kbd{M-c} converts @samp{'hello'} into @samp{'Hello'}, as
+(e.g., @kbd{M-c} converts @samp{'hello'} into @samp{'Hello'}, as
expected).
@cindex Paragraph-Indent Text mode
@kindex C-c C-f @r{(Outline mode)}
@kindex C-c C-b @r{(Outline mode)}
@kindex C-c C-u @r{(Outline mode)}
- The commands @kbd{C-c C-f} (@code{outline-forward-same-level}) and
-@kbd{C-c C-b} (@code{outline-backward-same-level}) move from one
-heading line to another visible heading at the same depth in the
-outline. @kbd{C-c C-u} (@code{outline-up-heading}) moves backward to
-another heading that is less deeply nested.
+ @kbd{C-c C-f} (@code{outline-forward-same-level}) and @kbd{C-c C-b}
+(@code{outline-backward-same-level}) move from one heading line to
+another visible heading at the same depth in the outline. @kbd{C-c
+C-u} (@code{outline-up-heading}) moves backward to another heading
+that is less deeply nested.
@node Outline Visibility
@subsection Outline Visibility Commands
current heading line as well as all the bodies in its subtree; the
subheadings themselves are left visible. The command @kbd{C-c C-k}
(@code{show-branches}) reveals the subheadings, if they had previously
-been hidden (e.g.@: by @kbd{C-c C-d}). The command @kbd{C-c C-i}
+been hidden (e.g., by @kbd{C-c C-d}). The command @kbd{C-c C-i}
(@code{show-children}) is a weaker version of this; it reveals just
-the direct subheadings, i.e.@: those one level down.
+the direct subheadings, i.e., those one level down.
@findex hide-other
@kindex C-c C-o @r{(Outline mode)}
numeric argument @var{n}, it hides everything except the top @var{n}
levels of heading lines.
+@anchor{Outline Search}
@findex reveal-mode
+@vindex search-invisible
When incremental search finds text that is hidden by Outline mode,
it makes that part of the buffer visible. If you exit the search at
-that position, the text remains visible. You can also automatically
-make text visible as you navigate in it by using Reveal mode (@kbd{M-x
-reveal-mode}), a buffer-local minor mode.
+that position, the text remains visible. To toggle whether or not
+an active incremental search can match hidden text, type @kbd{M-s i}.
+To change the default for future searches, customize the option
+@code{search-invisible}. (This option also affects how @code{query-replace}
+and related functions treat hidden text, @pxref{Query Replace}.)
+You can also automatically make text visible as you navigate in it by
+using Reveal mode (@kbd{M-x reveal-mode}), a buffer-local minor mode.
@node Outline Views
@subsection Viewing One Outline in Multiple Views
When zooming in on a heading, to see only the child subheadings specify
a numeric argument: @kbd{C-u C-c C-z}. The number of levels of children
-can be specified too (compare @kbd{M-x show-children}), e.g.@: @kbd{M-2
+can be specified too (compare @kbd{M-x show-children}), e.g., @kbd{M-2
C-c C-z} exposes two levels of child subheadings. Alternatively, the
body can be specified with a negative argument: @kbd{M-- C-c C-z}. The
whole subtree can be expanded, similarly to @kbd{C-c C-s} (@kbd{M-x
@end itemize
@end table
+@c FIXME not marked as a user variable
@vindex foldout-mouse-modifiers
You can specify different modifier keys (instead of
-@kbd{Control-Meta-}) by setting @code{foldout-mouse-modifiers}; but if
+@kbd{@key{Ctrl}-@key{META}-}) by setting @code{foldout-mouse-modifiers}; but if
you have already loaded the @file{foldout.el} library, you must reload
it in order for this to take effect.
To use the Foldout package, you can type @kbd{M-x load-library
@key{RET} foldout @key{RET}}; or you can arrange for to do that
-automatically by putting this in your init file (@pxref{Init File}):
+automatically by putting the following in your init file:
@example
(eval-after-load "outline" '(require 'foldout))
if invoked on a body line.
The following subsections give basic instructions for using Org mode
-as an organizer and as an authoring system. @xref{Top,The Org Mode
-Manual,,org, The Org Manual}, for details.
+as an organizer and as an authoring system. For details, @pxref{Top,
+The Org Mode Manual, Introduction, org, The Org Manual}.
@menu
* Org Organizer:: Managing TODO lists and agendas.
Once you have some TODO items planned in an Org file, you can add
that file to the list of @dfn{agenda files} by typing @kbd{C-c [}
(@code{org-agenda-file-to-front}). Org mode is designed to let you
-easily maintain multiple agenda files, e.g.@: for organizing different
+easily maintain multiple agenda files, e.g., for organizing different
aspects of your life. The list of agenda files is stored in the
variable @code{org-agenda-files}.
export and publication. To export the current buffer, type @kbd{C-c
C-e} (@code{org-export}) anywhere in an Org buffer. This command
prompts for an export format; currently supported formats include
-HTML, La@TeX{}, OpenDocument (@file{.odt}), and PDF. Some formats,
+HTML, @LaTeX{}, OpenDocument (@file{.odt}), and PDF@. Some formats,
such as PDF, require certain system tools to be installed.
@vindex org-publish-project-alist
#+end_example
@end example
- For further details, see @ref{Exporting,,,org, The Org Manual} and
+ For further details, @ref{Exporting,,,org, The Org Manual}, and
@ref{Publishing,,,org, The Org Manual}.
@node TeX Mode
@section @TeX{} Mode
@cindex @TeX{} mode
-@cindex La@TeX{} mode
+@cindex @LaTeX{} mode
@cindex Sli@TeX{} mode
@cindex Doc@TeX{} mode
@cindex mode, @TeX{}
-@cindex mode, La@TeX{}
+@cindex mode, @LaTeX{}
@cindex mode, Sli@TeX{}
@cindex mode, Doc@TeX{}
@findex tex-mode
Emacs provides special major modes for editing files written in
@TeX{} and its related formats. @TeX{} is a powerful text formatter
written by Donald Knuth; like GNU Emacs, it is free software.
-La@TeX{} is a simplified input format for @TeX{}, implemented using
+@LaTeX{} is a simplified input format for @TeX{}, implemented using
@TeX{} macros. Doc@TeX{} is a special file format in which the
-La@TeX{} sources are written, combining sources with documentation.
-Sli@TeX{} is an obsolete special form of La@TeX{}.@footnote{It has
+@LaTeX{} sources are written, combining sources with documentation.
+Sli@TeX{} is an obsolete special form of @LaTeX{}.@footnote{It has
been replaced by the @samp{slides} document class, which comes with
-La@TeX{}.}
+@LaTeX{}.}
@vindex tex-default-mode
- @TeX{} mode has four variants: Plain @TeX{} mode, La@TeX{} mode,
+ @TeX{} mode has four variants: Plain @TeX{} mode, @LaTeX{} mode,
Doc@TeX{} mode, and Sli@TeX{} mode. These distinct major modes differ
only slightly, and are designed for editing the four different
formats. Emacs selects the appropriate mode by looking at the
@itemize @bullet
@item
Bib@TeX{} mode is a major mode for Bib@TeX{} files, which are commonly
-used for keeping bibliographic references for La@TeX{} documents. For
+used for keeping bibliographic references for @LaTeX{} documents. For
more information, see the documentation string for the command
@code{bibtex-mode}.
@item
The Ref@TeX{} package provides a minor mode which can be used with
-La@TeX{} mode to manage bibliographic references.
+@LaTeX{} mode to manage bibliographic references.
@ifinfo
@xref{Top,The Ref@TeX{} Manual,,reftex}.
@end ifinfo
point, and inserts two newlines to start a new paragraph. It outputs
a message in the echo area if any mismatch is found. @kbd{M-x
tex-validate-region} checks a region, paragraph by paragraph. The
-errors are listed in an @samp{*Occur*} buffer; you can use the usual
+errors are listed in an @file{*Occur*} buffer; you can use the usual
Occur mode commands in that buffer, such as @kbd{C-c C-c}, to visit a
particular mismatch (@pxref{Other Repeating Search}).
to work with them.
@node LaTeX Editing
-@subsection La@TeX{} Editing Commands
+@subsection @LaTeX{} Editing Commands
- La@TeX{} mode provides a few extra features not applicable to plain
+ @LaTeX{} mode provides a few extra features not applicable to plain
@TeX{}:
@table @kbd
@item C-c C-o
-Insert @samp{\begin} and @samp{\end} for La@TeX{} block and position
+Insert @samp{\begin} and @samp{\end} for @LaTeX{} block and position
point on a line between them (@code{tex-latex-block}).
@item C-c C-e
-Close the innermost La@TeX{} block not yet closed
+Close the innermost @LaTeX{} block not yet closed
(@code{tex-close-latex-block}).
@end table
@findex tex-latex-block
-@kindex C-c C-o @r{(La@TeX{} mode)}
- In La@TeX{} input, @samp{\begin} and @samp{\end} tags are used to
+@kindex C-c C-o @r{(@LaTeX{} mode)}
+ In @LaTeX{} input, @samp{\begin} and @samp{\end} tags are used to
group blocks of text. To insert a block, type @kbd{C-c C-o}
(@code{tex-latex-block}). This prompts for a block type, and inserts
the appropriate matching @samp{\begin} and @samp{\end} tags, leaving a
@vindex latex-block-names
When entering the block type argument to @kbd{C-c C-o}, you can use
the usual completion commands (@pxref{Completion}). The default
-completion list contains the standard La@TeX{} block types. If you
+completion list contains the standard @LaTeX{} block types. If you
want additional block types for completion, customize the list
variable @code{latex-block-names}.
@findex tex-close-latex-block
-@kindex C-c C-e @r{(La@TeX{} mode)}
+@kindex C-c C-e @r{(@LaTeX{} mode)}
@findex latex-electric-env-pair-mode
- In La@TeX{} input, @samp{\begin} and @samp{\end} tags must balance.
+ In @LaTeX{} input, @samp{\begin} and @samp{\end} tags must balance.
You can use @kbd{C-c C-e} (@code{tex-close-latex-block}) to insert an
@samp{\end} tag which matches the last unmatched @samp{\begin}. It
also indents the @samp{\end} to match the corresponding @samp{\begin},
@subsection @TeX{} Printing Commands
You can invoke @TeX{} as an subprocess of Emacs, supplying either
-the entire contents of the buffer or just part of it (e.g.@: one
+the entire contents of the buffer or just part of it (e.g., one
chapter of a larger document).
@table @kbd
The buffer's @TeX{} variant determines what shell command @kbd{C-c
C-b} actually runs. In Plain @TeX{} mode, it is specified by the
variable @code{tex-run-command}, which defaults to @code{"tex"}. In
-La@TeX{} mode, it is specified by @code{latex-run-command}, which
+@LaTeX{} mode, it is specified by @code{latex-run-command}, which
defaults to @code{"latex"}. The shell command that @kbd{C-c C-v} runs
to view the @file{.dvi} output is determined by the variable
@code{tex-dvi-view-command}, regardless of the @TeX{} variant. The
shell command strings described in the preceding paragraph. For
example, if @code{tex-dvi-view-command} is @code{"xdvi"}, @kbd{C-c
C-v} runs @command{xdvi @var{output-file-name}}. In some cases,
-however, the file name needs to be embedded in the command, e.g.@: if
+however, the file name needs to be embedded in the command, e.g., if
you need to provide the file name as an argument to one command whose
output is piped to another. You can specify where to put the file
name with @samp{*} in the command string. For example,
@findex tex-recenter-output-buffer
@kindex C-c C-l @r{(@TeX{} mode)}
The terminal output from @TeX{}, including any error messages,
-appears in a buffer called @samp{*tex-shell*}. If @TeX{} gets an
+appears in a buffer called @file{*tex-shell*}. If @TeX{} gets an
error, you can switch to this buffer and feed it input (this works as
in Shell mode; @pxref{Interactive Shell}). Without switching to this
buffer you can scroll it so that its last line is visible by typing
If @samp{%**start of header} does not appear within the first 100 lines of
the buffer, @kbd{C-c C-r} assumes that there is no header.
- In La@TeX{} mode, the header begins with @samp{\documentclass} or
+ In @LaTeX{} mode, the header begins with @samp{\documentclass} or
@samp{\documentstyle} and ends with @samp{\begin@{document@}}. These
-are commands that La@TeX{} requires you to use in any case, so nothing
+are commands that @LaTeX{} requires you to use in any case, so nothing
special needs to be done to identify the header.
@findex tex-file
@findex tex-bibtex-file
@kindex C-c TAB @r{(@TeX{} mode)}
@vindex tex-bibtex-command
- For La@TeX{} files, you can use Bib@TeX{} to process the auxiliary
+ For @LaTeX{} files, you can use Bib@TeX{} to process the auxiliary
file for the current buffer's file. Bib@TeX{} looks up bibliographic
citations in a data base and prepares the cited references for the
bibliography section. The command @kbd{C-c @key{TAB}}
@kindex C-c / @r{(SGML mode)}
@findex sgml-close-tag
Insert a close tag for the innermost unterminated tag
-(@code{sgml-close-tag}). If called from within a tag or a comment,
-close this element instead of inserting a close tag.
+(@code{sgml-close-tag}). If called within a tag or a comment,
+close it instead of inserting a close tag.
@item C-c 8
@kindex C-c 8 @r{(SGML mode)}
Run a shell command (which you must specify) to validate the current
buffer as SGML (@code{sgml-validate}).
-@item C-c TAB
+@item C-c @key{TAB}
@kindex C-c TAB @r{(SGML mode)}
@findex sgml-tags-invisible
Toggle the visibility of existing tags in the buffer. This can be
The major mode for editing XML documents is called nXML mode. This
is a powerful major mode that can recognize many existing XML schema
and use them to provide completion of XML elements via
-@kbd{C-@key{RET}} or @kbd{M-@key{TAB}}, as well as ``on-the-fly'' XML
+@kbd{M-@key{TAB}}, as well as ``on-the-fly'' XML
validation with error highlighting. To enable nXML mode in an
existing buffer, type @kbd{M-x nxml-mode}, or, equivalently, @kbd{M-x
xml-mode}. Emacs uses nXML mode for files which have the extension
@vindex sgml-xml-mode
You may choose to use the less powerful SGML mode for editing XML,
-since XML is a strict subset of SGML. To enable SGML mode in an
+since XML is a strict subset of SGML@. To enable SGML mode in an
existing buffer, type @kbd{M-x sgml-mode}. On enabling SGML mode,
Emacs examines the buffer to determine whether it is XML; if so, it
sets the variable @code{sgml-xml-mode} to a non-@code{nil} value.
@cindex nroff
@findex nroff-mode
@vindex nroff-mode-hook
- Nroff mode is a major mode derived from Text mode, which is
-specialized for editing nroff files (e.g.@: Unix man pages). Type
+ Nroff mode, a major mode derived from Text mode, is
+specialized for editing nroff files (e.g., Unix man pages). Type
@kbd{M-x nroff-mode} to enter this mode. Entering Nroff mode runs the
-hook @code{text-mode-hook}, followed by @code{nroff-mode-hook}
+hook @code{text-mode-hook}, then @code{nroff-mode-hook}
(@pxref{Hooks}).
In Nroff mode, nroff command lines are treated as paragraph
mode assigns text properties automatically, based on the current
buffer contents; those properties are not saved to disk.
- The file @file{etc/enriched.doc} in the Emacs distribution serves as
-an example of the features of Enriched mode.
+ The file @file{enriched.txt} in Emacs's @code{data-directory}
+serves as an example of the features of Enriched mode.
@menu
* Enriched Mode:: Entering and exiting Enriched mode.
commands, including Auto Fill (@pxref{Auto Fill}), insert only soft
newlines and delete only soft newlines, leaving hard newlines alone.
+@c FIXME: I don't see 'unfilled' in that node. --xfq
Thus, when editing with Enriched mode, you should not use @key{RET}
or @kbd{C-o} to break lines in the middle of filled paragraphs. Use
Auto Fill mode or explicit fill commands (@pxref{Fill Commands})
@node Editing Format Info
@subsection Editing Format Information
- The easiest way to alter properties is with the Text Properties
-menu. You can get to this menu from the Edit menu in the menu bar
-(@pxref{Menu Bar}), or with @kbd{C-Mouse-2} (@pxref{Menu Mouse
-Clicks}). Some of the commands in the Text Properties menu are listed
-below (you can also invoke them with @kbd{M-x}):
+ The easiest way to alter properties is with the @samp{Text
+Properties} menu. You can get to this menu from the @samp{Edit} menu
+in the menu bar (@pxref{Menu Bar}), or with @kbd{C-Mouse-2}
+(@pxref{Menu Mouse Clicks}). Some of the commands in the @samp{Text
+Properties} menu are listed below (you can also invoke them with
+@kbd{M-x}):
@table @code
@findex facemenu-remove-face-props
These margins also affect fill commands such as @kbd{M-q}
(@pxref{Filling}).
- The Indentation submenu of Text Properties provides four commands
+ The Indentation submenu of Text Properties offers commands
for specifying indentation:
@table @code
@node Enriched Justification
@subsection Justification in Enriched Text
+@cindex justification style
In Enriched mode, you can use the following commands to specify
various @dfn{justification styles} for filling. These commands apply
still indent the left margin.
@end table
- You can also specify justification styles using the Justification
-submenu in the Text Properties menu.
-
@vindex default-justification
- The default justification style is specified by the per-buffer
-variable @code{default-justification}. Its value should be one of the
-symbols @code{left}, @code{right}, @code{full}, @code{center}, or
-@code{none}.
+ You can also specify justification styles using the Justification
+submenu in the Text Properties menu. The default justification style
+is specified by the per-buffer variable @code{default-justification}.
+Its value should be one of the symbols @code{left}, @code{right},
+@code{full}, @code{center}, or @code{none}; their meanings correspond
+to the commands above.
@node Enriched Properties
@subsection Setting Other Text Properties
within the text). The @samp{Remove Special} menu item removes all of
these special properties from the text in the region.
- The @code{invisible} and @code{intangible} properties are not saved
-in the @samp{text/enriched} format.
+ The @code{invisible} and @code{intangible} properties are not saved.
@node Text Based Tables
@section Editing Text-based Tables
following sections for navigating and editing the table layout.
@findex table-fixed-width-mode
- To toggle the automatic table resizing feature, type @kbd{M-x
-table-fixed-width-mode}.
+ Type @kbd{M-x table-fixed-width-mode} to toggle the automatic table
+resizing feature.
@menu
* Table Definition:: What is a text based table.
@cindex text-based tables, splitting cells
@cindex splitting table cells
@kbd{M-x table-split-cell} splits the current cell vertically or
-horizontally, prompting for the direction with the minibuffer. The
-commands @kbd{M-x table-split-cell-vertically} and @kbd{M-x
-table-split-cell-horizontally} split in a specific direction. When
-splitting vertically, the old cell contents are automatically split
-between the two new cells. When splitting horizontally, you are
-prompted for how to divide the cell contents, if the cell is
-non-empty; the options are @samp{split} (divide the contents at
-point), @samp{left} (put all the contents in the left cell), and
-@samp{right} (put all the contents in the right cell).
+horizontally, prompting for the direction with the minibuffer. To
+split in a specific direction, use @kbd{M-x
+table-split-cell-vertically} and @kbd{M-x
+table-split-cell-horizontally}. When splitting vertically, the old
+cell contents are automatically split between the two new cells. When
+splitting horizontally, you are prompted for how to divide the cell
+contents, if the cell is non-empty; the options are @samp{split}
+(divide the contents at point), @samp{left} (put all the contents in
+the left cell), and @samp{right} (put all the contents in the right
+cell).
The following commands enlarge or shrink a cell. By default, they
resize by one row or column; if a numeric argument is supplied, that
@findex table-insert-row
@kbd{M-x table-insert-row} inserts a row of cells before the current
table row. The current row, together with point, is pushed down past
-the new row. To insert rows after the last row at the bottom of a
+the new row. To insert a row after the last row at the bottom of a
table, invoke this command with point below the table, just below the
-bottom edge. A numeric prefix argument specifies the number of rows
-to insert.
+bottom edge. You can insert more than one row at a time by using a
+numeric prefix argument.
+
+@c A numeric prefix argument specifies the number of rows to insert.
@findex table-insert-column
Similarly, @kbd{M-x table-insert-column} inserts a column of cells
@findex table-insert-sequence
@kbd{M-x table-insert-sequence} inserts a string into each cell.
-Each string is a part of a sequence i.e.@: a series of increasing
+Each string is a part of a sequence i.e., a series of increasing
integer numbers.
@cindex table for HTML and LaTeX