Remove the "Using sgml-mode with Emacs" chapter. It's outdated and

beyond the scope of the FDP Primer.  We can do better for the reader by
just referring them to the relevant links in the new Editor Configuration
chapter.
This commit is contained in:
Warren Block 2013-07-24 05:12:09 +00:00
parent fcd488be93
commit c21c7988a0
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=42410
4 changed files with 0 additions and 175 deletions
en_US.ISO8859-1/books/fdp-primer

View file

@ -32,7 +32,6 @@ SRCS+= docbook-markup/chapter.xml
SRCS+= stylesheets/chapter.xml
SRCS+= translations/chapter.xml
SRCS+= writing-style/chapter.xml
SRCS+= psgml-mode/chapter.xml
SRCS+= editor-config/chapter.xml
SRCS+= see-also/chapter.xml

View file

@ -260,7 +260,6 @@ The time is 09:18</screen></entry>
&chap.stylesheets;
&chap.translations;
&chap.writing-style;
&chap.psgml-mode;
&chap.editor-config;
&chap.see-also;

View file

@ -22,7 +22,6 @@
<!ENTITY chap.stylesheets SYSTEM "stylesheets/chapter.xml">
<!ENTITY chap.translations SYSTEM "translations/chapter.xml">
<!ENTITY chap.writing-style SYSTEM "writing-style/chapter.xml">
<!ENTITY chap.psgml-mode SYSTEM "psgml-mode/chapter.xml">
<!ENTITY chap.editor-config SYSTEM "editor-config/chapter.xml">
<!ENTITY chap.see-also SYSTEM "see-also/chapter.xml">

View file

@ -1,172 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Copyright (c) 1998, 1999 Nik Clayton, All rights reserved.
Redistribution and use in source (SGML DocBook) and 'compiled' forms
(SGML HTML, PDF, PostScript, RTF and so forth) with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code (SGML DocBook) must retain the above
copyright notice, this list of conditions and the following
disclaimer as the first lines of this file unmodified.
2. Redistributions in compiled form (transformed to other DTDs,
converted to PDF, PostScript, RTF and other formats) must reproduce
the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials
provided with the distribution.
THIS DOCUMENTATION IS PROVIDED BY NIK CLAYTON "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL NIK CLAYTON BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
$FreeBSD$
-->
<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>.xml</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>
</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>
</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>
</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>
</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>
</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>
</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>
</listitem>
</varlistentry>
<varlistentry>
<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>
</listitem>
</varlistentry>
</variablelist>
<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>
<programlisting> (defun local-sgml-mode-hook
(setq fill-column 70
indent-tabs-mode nil
next-line-add-newlines nil
standard-indent 4
sgml-indent-data t)
(auto-fill-mode t)
(setq sgml-catalog-files '("/usr/local/share/xml/catalog")))
(add-hook 'psgml-mode-hook
'(lambda () (local-psgml-mode-hook)))</programlisting>
</chapter>