« 46:10/153 | Main | New shoes »

June 22, 2005

1 character per hour

Andy found me complaining to him in email about how our DTD at work, SolBook, supports underscores in entity names and attribute values, and how PSGML mode for Emacs doesn't. So he told me to fix it.

I don't know Lisp, and am slow anyway. Ludo helped me a bit, but I found the suspicious bit myself. It was in the range of line 300 in psgml-parse.el:

(mapconcat (function (lambda (c)
             (modify-syntax-entry c "w" sgml-parser-syntax)))
           "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrtsuvwxyz" "")
(mapconcat (function (lambda (c)
                       (modify-syntax-entry c "_" sgml-parser-syntax)))
           "-.0123456789" "")

Ludo told me about C-h f, to get the doc about mapconcat and modify-syntax-entry, and saw this mapping alphabetic characters to w (word) and numeric characters to _.

So I added an underscore to the SEQUENCE:

           "_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrtsuvwxyz" "")

This seems to have done the trick. I could now load and parse our DTD in PSGML mode.

Too bad it took me so long to understand. At one character per hour, it should only take me 128 years to write the next version of our Developer's Guide.

Posted by Mark at June 22, 2005 08:30 PM