[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fix quotes for @samp

From: Per Bothner
Subject: fix quotes for @samp
Date: Sun, 31 Jul 2005 19:39:20 -0700
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

See http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html

The html part of the patch is presumably uncontroversial;
it mirrors the existing docbook handling.
Modern terminal handlers and fonts (at least
gnome-terminal on Fedora Core 4) handle Unicode quotes fine,
so the html output (as patched) shows the correct font
in lynx; the links browser substitutes `...' which is at
least no worse than the current situation.

The info part will be more controversial; if nothing else
it may also require changing the documentation.  But really
it's time we fixed the ugly output of @samp with modern fonts.
(If we could assume UTF-8 support by info and terminals we could
of course emit the correct characters directly.)
(By the way, gcc messages now emit the Unicode quotes, if the locale
permits this.)

For the info part of the patch, I'm not sure whether add_char
or add_meta_char is correct.
        --Per Bothner
address@hidden   http://per.bothner.com/
2005-07-31  Per Bothner  <address@hidden>

        * makeinfo/cmds.c (cm_code): For html output use lsquo and rsquot
        entities around @samp.
        For info output, don't use grave accent.

Index: cmds.c
RCS file: /cvsroot/texinfo/texinfo/makeinfo/cmds.c,v
retrieving revision 1.60
diff -u -r1.60 cmds.c
--- cmds.c      15 May 2005 00:00:07 -0000      1.60
+++ cmds.c      1 Aug 2005 02:19:06 -0000
@@ -833,14 +833,16 @@
         { /* Use <samp> tag in general to get typewriter.  */
           if (arg == START)
             { /* If @samp specifically, add quotes a la TeX output.  */
-              if (STREQ (command, "samp")) add_char ('`');
+              if (STREQ (command, "samp"))
+               add_word ("&lsquo;");
               add_word ("<samp>");
           insert_html_tag_with_attribute (arg, "span", "class=\"%s\"",command);
           if (arg == END)
               add_word ("</samp>");
-              if (STREQ (command, "samp")) add_char ('\'');
+              if (STREQ (command, "samp"))
+               add_word ("&rsquo;");
@@ -851,7 +853,7 @@
       if (!printing_index)
           if (arg == START)
-            add_char ('`');
+            add_char ('\'');
             add_meta_char ('\'');

reply via email to

[Prev in Thread] Current Thread [Next in Thread]