Whitespace-only fixes. Wrap long lines, leading spaces to tabs where

needed, two spaces at beginning of sentences.
This commit is contained in:
Warren Block 2012-02-15 03:49:36 +00:00
parent fb72b15f59
commit 39214a1acf
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=38458

View file

@ -33,101 +33,110 @@
<chapter id="psgml-mode">
<title>Using <literal>sgml-mode</literal> with
<application>Emacs</application></title>
<para>Recent versions of <application>Emacs</application> or <application>XEmacs</application> (available from the Ports
Collection) contain a very useful package called PSGML (can be installed from <filename role="package">editors/psgml</filename>). Automatically
invoked when a file with the <filename>.sgml</filename> extension is loaded,
or by typing <command>M-x sgml-mode</command>, it is a major mode for
dealing with SGML files, elements and attributes.</para>
<para>An understanding of some of the commands provided by this mode can
make working with SGML documents such as the Handbook much easier.</para>
<para>Recent versions of <application>Emacs</application> or
<application>XEmacs</application> (available from the Ports
Collection) contain a very useful package called PSGML (can be
installed from <filename role="package">editors/psgml</filename>).
Automatically invoked when a file with the
<filename>.sgml</filename> extension is loaded, or by typing
<command>M-x sgml-mode</command>, it is a major mode for dealing
with SGML files, elements and attributes.</para>
<para>An understanding of some of the commands provided by this mode
can make working with SGML documents such as the Handbook much
easier.</para>
<variablelist>
<varlistentry>
<term><command>C-c C-e</command></term>
<listitem>
<para>Runs <function>sgml-insert-element</function>. You will be
prompted for the name of the element to insert at the current point.
You can use the <keycap>Tab</keycap> key to complete the element. Elements that are
not valid at the current point will be disallowed.</para>
<para>The start and end tags for the element will be inserted. If the
element contains other, mandatory, elements then these will be
inserted as well.</para>
<listitem>
<para>Runs <function>sgml-insert-element</function>. You will
be prompted for the name of the element to insert at the
current point. You can use the <keycap>Tab</keycap> key to
complete the element. Elements that are not valid at the
current point will be disallowed.</para>
<para>The start and end tags for the element will be inserted.
If the element contains other, mandatory, elements then
these will be inserted as well.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>C-c =</command></term>
<listitem>
<para>Runs <function>sgml-change-element-name</function>. Place the
point within an element and run this command. You will be prompted
for the name of the element to change to. Both the start and end
tags of the current element will be changed to the new
element.</para>
<para>Runs <function>sgml-change-element-name</function>.
Place the point within an element and run this command. You
will be prompted for the name of the element to change to.
Both the start and end tags of the current element will be
changed to the new element.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>C-c C-r</command></term>
<listitem>
<para>Runs <function>sgml-tag-region</function>. Select some text (move
to start of text, <command>C-space</command>, move to end of text, <command>C-space</command>) and then
run this command. You will be prompted for the element to use. This
element will then be inserted immediately before and after your
marked region.</para>
<para>Runs <function>sgml-tag-region</function>. Select some
text (move to start of text, <command>C-space</command>,
move to end of text, <command>C-space</command>) and then
run this command. You will be prompted for the element to
use. This element will then be inserted immediately before
and after your marked region.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>C-c -</command></term>
<listitem>
<para>Runs <function>sgml-untag-element</function>. Place the point
within the start or end tag of an element you want to remove, and
run this command. The element's start and end tags will be
removed.</para>
<para>Runs <function>sgml-untag-element</function>. Place the
point within the start or end tag of an element you want to
remove, and run this command. The element's start and end
tags will be removed.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>C-c C-q</command></term>
<listitem>
<para>Runs <function>sgml-fill-element</function>. Will recursively fill
(i.e., reformat) content from the current element in. The filling
<emphasis>will</emphasis> affect content in which whitespace is
significant, such as within <sgmltag>programlisting</sgmltag>
elements, so run this command with care.</para>
<para>Runs <function>sgml-fill-element</function>. Will
recursively fill (i.e., reformat) content from the current
element in. The filling <emphasis>will</emphasis> affect
content in which whitespace is significant, such as within
<sgmltag>programlisting</sgmltag> elements, so run this
command with care.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>C-c C-a</command></term>
<listitem>
<para>Runs <function>sgml-edit-attributes</function>. Opens a second
buffer containing a list of all the attributes for the closest
enclosing element, and their current values. Use <keycap>Tab</keycap> to navigate
between attributes, <command>C-k</command> to remove an existing
value and replace it with a new one, <command>C-c C-c</command>
to close this buffer and return to the main document.</para>
<para>Runs <function>sgml-edit-attributes</function>. Opens a
second buffer containing a list of all the attributes for
the closest enclosing element, and their current values.
Use <keycap>Tab</keycap> to navigate between attributes,
<command>C-k</command> to remove an existing value and
replace it with a new one, <command>C-c C-c</command> to
close this buffer and return to the main document.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>C-c C-v</command></term>
<listitem>
<para>Runs <function>sgml-validate</function>. Prompts you to save the
current document (if necessary) and then runs an SGML validator. The
output from the validator is captured into a new buffer, and you can
then navigate from one troublespot to the next, fixing markup errors
as you go.</para>
<para>Runs <function>sgml-validate</function>. Prompts you to
save the current document (if necessary) and then runs an
SGML validator. The output from the validator is captured
into a new buffer, and you can then navigate from one
troublespot to the next, fixing markup errors as you
go.</para>
</listitem>
</varlistentry>
@ -135,18 +144,19 @@
<term><command>C-c /</command></term>
<listitem>
<para>Runs <function>sgml-insert-end-tag</function>. Inserts the
end tag for the current open element.</para>
<para>Runs <function>sgml-insert-end-tag</function>. Inserts
the end tag for the current open element.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Doubtless there are other useful functions of this mode, but those are
the ones I use most often.</para>
<para>Doubtless there are other useful functions of this mode, but
those are the ones I use most often.</para>
<para>You can also use the following entries in
<filename>.emacs</filename> to set proper spacing, indentation,
and column width for working with the Documentation Project.</para>
and column width for working with the Documentation
Project.</para>
<programlisting>
(defun local-sgml-mode-hook
@ -160,7 +170,6 @@
(add-hook 'psgml-mode-hook
'(lambda () (local-psgml-mode-hook)))
</programlisting>
</chapter>