<?xml version='1.0' encoding='utf-8'?>
<?xml-stylesheet href="/style/browser.xsl" type="text/xsl"?>
<essay xmlns="http://docbook.org/ns/docbook"
       xmlns:xlink="http://www.w3.org/1999/xlink"
       xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
       xmlns:dc='http://purl.org/dc/elements/1.1/'
       xmlns:dcterms="http://purl.org/dc/terms/"
       xmlns:gal='http://norman.walsh.name/rdf/gallery#'
       version="pto">
<info>
<title>More Emacs, XML, &amp; Unicode</title>
<volumenum>6</volumenum>
<issuenum>92</issuenum>
<pubdate>2003-10-03</pubdate>
<date>$Date: 2005-09-11 10:27:02 -0400 (Sun, 11 Sep 2005) $</date>
<author><personname>
<firstname>Norman</firstname><surname>Walsh</surname>
</personname></author>
<copyright><year>2003</year><holder>Norman Walsh</holder></copyright>
<abstract>
<para>More UI hacking for entering Unicode into XML documents in Emacs.</para>
</abstract>
</info>

<epigraph>
<attribution>Robert Benchley</attribution>
<para xml:id='p1'>Anyone can do any amount of work provided
it isn't the work he is supposed to be doing at the moment.</para>
</epigraph>

<para xml:id='p2'>Inspired by some additional discussion of character entities on the
<link xlink:href="http://groups.yahoo.com/group/emacs-nxml-mode/">emacs-nxml-mode</link>
list<footnote><para xml:id='p3'>Aside: Does the Yahoo Groups archive work for
anyone? Half the time I get host not found errors, half of the
remaining time I get completely empty documents, and at least half of
the time that still remains, I get advertisements that I can’t click
through. I’m not sure I’ve ever successfully read a message in their
archives.</para></footnote>,
I hacked at my <filename>xmlchars.el</filename> work a bit more and
produced <link xlink:href="http://nwalsh.com/emacs/xmlchars/">XML Unicode</link>.</para>

<para xml:id='p4'>XML Unicode<indexterm><primary>Unicode</primary></indexterm>
improves on my previous efforts:</para>

<itemizedlist>
<listitem>
<para xml:id='p5'>Added a function to insert characters by Unicode name. Don’t remember
the ISO entity name for “triple prime”? No worries, hit
<keycap>C-t</keycap> <keycap>u</keycap><footnote>
<para xml:id='p6'>Or whatever binding you added for <function>unicode-character-insert</function>
</para></footnote> type “trip&lt;tab&gt;pr&lt;tab&gt;&lt;enter&gt;”
and in it goes.
</para>
</listitem>

<listitem>
<para xml:id='p7'>Added a similar function for ISO entity names.
</para>
</listitem>

<listitem>
<para xml:id='p8'>Added a glyph list. Inserting literal Unicode characters is great, if they
display properly. If not, I’d rather see the numeric character reference.
</para>
</listitem>

<listitem>
<para xml:id='p9'>If the character occurs in an XML name, then I need the real character even
if I can’t see it. For those cases, each of the functions takes a prefix arg.
In other words, <keycap>C-u</keycap> <keycap>C-t</keycap> <keycap>u</keycap>.</para>
</listitem>

<listitem>
<para xml:id='p10'>Adapted <systemitem role="emacs-input-mode">sgml-input</systemitem> so
that it’s sensitive to the glyph list. My new
<systemitem role="emacs-input-mode">xml-input</systemitem> watches what you type
and automatically replaces ISO entity names with appropriate characters.
</para>
<para xml:id='p11'>In other words, typing <literal>&amp;eacute;</literal> automatically
inserts an “é” while typing <literal>&amp;tprime;</literal> inserts
&amp;#x2034; because I don’t have a glyph for it in my
<application>emacs</application> setup.</para>
</listitem>

<listitem>
<para xml:id='p12'>The ISO entity names are all table driven; you can use any mneumonics you
like.
</para>
</listitem>

<listitem>
<para xml:id='p13'>I added code to construct a real Emacs pull-down menu (in addition to or instead
of the pop-up menu) for any special characters that you’d like to access that way.</para>
</listitem>
</itemizedlist>

<para xml:id='p14'>Share and enjoy.</para>

</essay>
