|
From: | Kevin Rodgers |
Subject: | Re: Font locking in PSGML mode |
Date: | Wed, 12 Mar 2003 10:02:34 -0700 |
User-agent: | Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2 |
chris wrote:
When I load a file into Emacs that starts sgml mode, there is no syntax coloring. After I parse the DTD, the font coloring starts working, but only on text that I manually move my cursor through. As Imove through each element, it becomes colorized.Is there a way to get this to happen automatically?
1. How do you parse the DTD? 2. Here's a variable declaration and some code I use in an sgml-mode-hook function: (defvar psgml-auto-parse 'query "*If t, `\\[sgml-mode'] automatically invokes `\\[sgml-next-trouble-spot]'; if a number, automatically parse the buffer if the buffer's size is smaller; if non-nil and non-t, query the user whether to parse the buffer.") (if (and (cond ((eq psgml-auto-parse t)) ((numberp psgml-auto-parse) (<= (buffer-size) psgml-auto-parse)) ((not (null psgml-auto-parse)) ; symbolp (y-or-n-p "Parse SGML document? "))) (or (null sgml-top-tree) (null (sgml-tree-end sgml-top-tree)))) (progn (sgml-next-trouble-spot) ; doesn't return a meaningful value, ; or signal an error... (if (eobp) (goto-char (point-min))))) -- <a href="mailto:<kevin.rodgers@ihs.com>">Kevin Rodgers</a>
[Prev in Thread] | Current Thread | [Next in Thread] |