From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: chris Newsgroups: gmane.emacs.help Subject: Font locking in PSGML mode Date: Wed, 12 Mar 2003 01:56:10 -0000 Organization: Posted via Supernews, http://www.supernews.com Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1047434436 5518 80.91.224.249 (12 Mar 2003 02:00:36 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 12 Mar 2003 02:00:36 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 12 03:00:35 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18svXn-0001Qi-00 for ; Wed, 12 Mar 2003 03:00:35 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18svXj-0000Hb-03 for gnu-help-gnu-emacs@m.gmane.org; Tue, 11 Mar 2003 21:00:31 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs Original-Followup-To: gnu.emacs.help User-Agent: slrn/0.9.7.4 (Linux) Original-X-Complaints-To: abuse@supernews.com Original-Lines: 73 Original-Xref: shelby.stanford.edu gnu.emacs.help:110996 comp.emacs:78135 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7496 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7496 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 I move through each element, it becomes colorized. Is there a way to get this to happen automatically? I have the following in my .emacs (require 'font-lock) (global-font-lock-mode t) (setq font-lock-support-mode 'lazy-lock-mode) (setq font-lock-maximum-decoration t) (require 'psgml) (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t) (autoload 'xml-mode "psgml" "Major mode to edit XML files." t) (add-to-list 'sgml-catalog-files "/etc/sgml/catalog") (add-to-list 'sgml-catalog-files "/etc/xml/catalog") (setq auto-mode-alist (append '( ("\\.sgml\\'" . sgml-mode) ("\\.xml\\'" . xml-mode) ("\\.html\\'" . xml-mode) ("\\.php\\'" . xml-mode) ) auto-mode-alist ) ) (setq-default sgml-set-face t) (make-face 'sgml-comment-face) (make-face 'sgml-doctype-face) (make-face 'sgml-end-tag-face) (make-face 'sgml-entity-face) (make-face 'sgml-ignored-face) (make-face 'sgml-ms-end-face) (make-face 'sgml-ms-start-face) (make-face 'sgml-pi-face) (make-face 'sgml-sgml-face) (make-face 'sgml-short-ref-face) (make-face 'sgml-start-tag-face) (set-face-foreground 'sgml-comment-face "dark magenta") (set-face-foreground 'sgml-doctype-face "red") (set-face-foreground 'sgml-end-tag-face "blue") (set-face-foreground 'sgml-entity-face "magenta") (set-face-foreground 'sgml-ignored-face "gray40") (set-face-background 'sgml-ignored-face "gray60") (set-face-foreground 'sgml-ms-end-face "green") (set-face-foreground 'sgml-ms-start-face "yellow") (set-face-foreground 'sgml-pi-face "lime green") (set-face-foreground 'sgml-sgml-face "brown") (set-face-foreground 'sgml-short-ref-face "deep sky blue") (set-face-foreground 'sgml-start-tag-face "dark green") (setq-default sgml-markup-faces '((comment . sgml-comment-face) (doctype . sgml-doctype-face) (end-tag . sgml-end-tag-face) (entity . sgml-entity-face) (ignored . sgml-ignored-face) (ms-end . sgml-ms-end-face) (ms-start . sgml-ms-start-face) (pi . sgml-pi-face) (sgml . sgml-sgml-face) (short-ref . sgml-short-ref-face) (start-tag . sgml-start-tag-face))) (setq-default sgml-indent-data t)