@c This is part of the Emacs manual.
-@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000
+@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001, 2002
@c Free Software Foundation, Inc.
@c See file emacs.texi for copying conditions.
@node Text, Programs, Indentation, Top
@xref{Formatted Text}.
@end iftex
+@cindex skeletons
+@cindex templates
+@cindex autotyping
+@cindex automatic typing
The ``automatic typing'' features may be useful when writing text.
@xref{Top,, Autotyping, autotype, Features for Automatic Typing}.
* Text Mode:: The major modes for editing text files.
* Outline Mode:: Editing outlines.
* TeX Mode:: Editing input to the formatter TeX.
+* HTML Mode:: Editing HTML, SGML, and XML files.
* Nroff Mode:: Editing input to the formatter nroff.
* Formatted Text:: Editing formatted text directly in WYSIWYG fashion.
@end menu
period. Set the variable @code{sentence-end-without-period} to
@code{t} to tell the sentence commands that a period is not necessary.
+@vindex fill-nobreak-predicate
+ The variable @code{fill-nobreak-predicate} specifies additional
+conditions for where line-breaking is allowed. Its value is either
+@code{nil} or a Lisp function; the function is called with no
+arguments, and if it returns a non-@code{nil} value, then point is not
+a good place to break the line. The standard functions you can use
+@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{?}).
+
@node Fill Prefix
@subsection The Fill Prefix
setting @code{selective-display-ellipses} to @code{nil}. Then there is
no visible indication of the presence of invisible lines.
+@findex reveal-mode
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.
+at that position, the text remains visible. You can also
+automatically make text visible as you navigate in it by using
+@kbd{M-x reveal-mode}.
@node Outline Views
@subsection Viewing One Outline in Multiple Views
folds, and for showing and hiding text:
@table @asis
-@item @kbd{M-C-Mouse-1} zooms in on the heading clicked on
+@item @kbd{C-M-Mouse-1} zooms in on the heading clicked on
@itemize @asis
@item
single click: expose body.
@item
quad click: expose entire subtree.
@end itemize
-@item @kbd{M-C-Mouse-2} exposes text under the heading clicked on
+@item @kbd{C-M-Mouse-2} exposes text under the heading clicked on
@itemize @asis
@item
single click: expose body.
@item
quad click: expose entire subtree.
@end itemize
-@item @kbd{M-C-Mouse-3} hides text under the heading clicked on or exits fold
+@item @kbd{C-M-Mouse-3} hides text under the heading clicked on or exits fold
@itemize @asis
@item
single click: hide subtree.
(eval-after-load "outline" '(require 'foldout))
@end example
-@node TeX Mode, Nroff Mode, Outline Mode, Text
+@node TeX Mode
@section @TeX{} Mode
@cindex @TeX{} mode
@cindex La@TeX{} mode
modified buffers. Generally, you need to use (@code{tex-file}) twice to
get the cross-references right.
-@vindex tex-start-options-string
- The value of the variable @code{tex-start-options-string} specifies
-options for the @TeX{} run. The default value causes @TeX{} to run in
-nonstop mode. To run @TeX{} interactively, set the variable to @code{""}.
+@vindex tex-start-options
+ The value of the variable @code{tex-start-options} specifies
+options for the @TeX{} run.
+
+@vindex tex-start-commands
+ The value of the variable @code{tex-start-commands} specifies @TeX{}
+commands for starting @TeX{}. The default value causes @TeX{} to run
+in nonstop mode. To run @TeX{} interactively, set the variable to
+@code{""}.
@vindex tex-main-file
Large @TeX{} documents are often split into several files---one main
@findex tildify-region
@cindex ties, @TeX{}, inserting
@cindex hard spaces, @TeX{}, inserting
-@cindex SGML
-@cindex HTML
The commands @kbd{M-x tildify-buffer} and @kbd{M-x tildify-region}
insert @samp{~} (@dfn{tie}) characters where they are conventionally
required. This is set up for Czech---customize the group
For managing all kinds of references for La@TeX{}, you can use
Ref@TeX{}. @xref{Top, , RefTeX, reftex}.
+@node HTML Mode
+@section SGML, XML, and HTML Modes
+
+ The major modes for SGML and HTML include indentation support and
+commands to operate on tags. This section describes the special
+commands of these modes. (HTML mode is a slightly customized variant
+of SGML mode.)
+
+@table @kbd
+@item C-c C-n
+@kindex C-c C-n @r{(SGML mode)}
+@findex sgml-name-char
+Interactively specify a special character and insert the SGML
+@samp{&}-command for that character.
+
+@item C-c C-t
+@kindex C-c C-t @r{(SGML mode)}
+@findex sgml-tag
+Interactively specify a tag and its attributes (@code{sgml-tag}).
+This command asks you for a tag name and for the attribute values,
+then inserts both the opening tag and the closing tag, leaving point
+between them.
+
+With a prefix argument @var{n}, the command puts the tag around the
+@var{n} words already present in the buffer after point. With
+@minus{}1 as argument, it puts the tag around the region. (In
+Transient Mark mode, it does this whenever a region is active.)
+
+@item C-c C-a
+@kindex C-c C-a @r{(SGML mode)}
+@findex sgml-attributes
+Interactively insert attribute values for the current tag
+(@code{sgml-attributes}).
+
+@item C-c C-f
+@kindex C-c C-f @r{(SGML mode)}
+@findex sgml-skip-tag-forward
+Skip across a balanced tag group (which extends from an opening tag
+through its corresponding closing tag) (@code{sgml-skip-tag-forward}).
+A numeric argument acts as a repeat count.
+
+@item C-c C-b
+@kindex C-c C-b @r{(SGML mode)}
+@findex sgml-skip-tag-backward
+Skip backward across a balanced tag group (which extends from an
+opening tag through its corresponding closing tag)
+(@code{sgml-skip-tag-forward}). A numeric argument acts as a repeat
+count.
+
+@item C-c C-d
+@kindex C-c C-d @r{(SGML mode)}
+@findex sgml-delete-tag
+Delete the tag at or after point, and delete the matching tag too
+(@code{sgml-delete-tag}). If the tag at or after point is an opening
+tag, delete the closing tag too; if it is a closing tag, delete the
+opening tag too.
+
+@item C-c ? @var{tag} @key{RET}
+@kindex C-c ? @r{(SGML mode)}
+@findex sgml-tag-help
+Display a description of the meaning of tag @var{tag}
+(@code{sgml-tag-help}). If the argument @var{tag} is empty, describe
+the tag at point.
+
+@item C-c /
+@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.
+
+@item C-c 8
+@kindex C-c 8 @r{(SGML mode)}
+@findex sgml-name-8bit-mode
+Toggle a minor mode in which Latin-1 characters insert the
+corresponding SGML commands that stand for them, instead of the
+characters themselves (@code{sgml-name-8bit-mode}).
+
+@item C-c C-v
+@kindex C-c C-v @r{(SGML mode)}
+@findex sgml-validate
+Run a shell command (which you must specify) to validate the current
+buffer as SGML (@code{sgml-validate}).
+
+@item C-x TAB
+@kindex C-c TAB @r{(SGML mode)}
+@findex sgml-tags-invisible
+Toggle the visibility of existing tags in the buffer. This can be
+used as a cheap preview.
+@end table
+
+@vindex sgml-xml-mode
+ SGML mode and HTML mode support XML also. In XML, every opening tag
+must have an explicit closing tag. When @code{sgml-xml-mode} is
+non-@code{nil}, SGML mode (and HTML mode) always insert explicit
+closing tags. When you visit a file, these modes determine from the
+file contents whether it is XML or not, and set @code{sgml-xml-mode}
+accordingly, so that they do the right thing for the file in either
+case.
+
@node Nroff Mode
@section Nroff Mode
@node Requesting Formatted Text
@subsection Requesting to Edit Formatted Text
- Whenever you visit a file that Emacs saved in the text/enriched format,
-Emacs automatically converts the formatting information in the file into
-Emacs's own internal format (text properties), and turns on Enriched
-mode.
+ Whenever you visit a file that Emacs saved in the text/enriched
+format, Emacs automatically converts the formatting information in the
+file into Emacs's own internal format (known as @dfn{text
+properties}), and turns on Enriched mode.
@findex enriched-mode
To create a new file of formatted text, first visit the nonexistent
@samp{x-read-only}. This ensures that they will not conflict with
standard annotations that may be added later.
+ @xref{Text Properties,,, elisp, the Emacs Lisp Reference Manual},
+for more information about text properties.
+
@node Hard and Soft Newlines
@subsection Hard and Soft Newlines
@cindex hard newline
There are two ways to alter the formatting information for a formatted
text file: with keyboard commands, and with the mouse.
- The easiest way to add properties to your document is by using the Text
+ The easiest way to add properties to your document is with the Text
Properties menu. You can get to this menu in two ways: from the Edit
-menu in the menu bar, or with @kbd{C-Mouse-2} (hold the @key{CTRL} key
-and press the middle mouse button).
+menu in the menu bar (use @kbd{@key{F10} e t} if you have no mouse),
+or with @kbd{C-Mouse-2} (hold the @key{CTRL} key and press the middle
+mouse button). There are also keyboard commands described in the
+following section.
Most of the items in the Text Properties menu lead to other submenus.
These are described in the sections that follow. Some items run
commands directly:
@table @code
-@findex facemenu-remove-props
-@item Remove Properties
+@findex facemenu-remove-face-props
+@item Remove Face Properties
Delete from the region all the text properties that the Text Properties
-menu works with (@code{facemenu-remove-props}).
+menu works with (@code{facemenu-remove-face-props}).
@findex facemenu-remove-all
@item Remove All
Delete @emph{all} text properties from the region
(@code{facemenu-remove-all}).
-@findex list-text-properties-at
-@item List Properties
-List all the text properties of the character following point
-(@code{list-text-properties-at}).
+@findex describe-text-at
+@cindex text properties of characters
+@cindex overlays at character position
+@cindex widgets at buffer position
+@cindex buttons at buffer position
+@item Describe Text
+List all the text properties, widgets, buttons, and overlays of the
+character following point (@code{describe-text-at}).
@item Display Faces
-Display a list of all the defined faces.
+Display a list of all the defined faces (@code{list-faces-display}).
@item Display Colors
-Display a list of all the defined colors.
+Display a list of all the defined colors (@code{list-colors-display}).
@end table
-
+
@node Format Faces
@subsection Faces in Formatted Text