Next: Nroff Mode, Previous: TeX Mode, Up: Text
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.)
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 n, the command puts the tag around the
n words already present in the buffer after point. With
−1 as argument, it puts the tag around the region. (In
Transient Mark mode, it does this whenever a region is active.)
sgml-attributes
).
sgml-skip-tag-forward
).
A numeric argument acts as a repeat count.
sgml-skip-tag-forward
). A numeric argument acts as a repeat
count.
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.
sgml-tag-help
). If the argument tag is empty, describe
the tag at point.
sgml-close-tag
). If called from within a tag or a comment,
close this element instead of inserting a close tag.
sgml-name-8bit-mode
).
sgml-validate
).
SGML mode and HTML mode support XML also. In XML, every opening tag
must have an explicit closing tag. When sgml-xml-mode
is
non-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 sgml-xml-mode
accordingly, so that they do the right thing for the file in either
case.