help-gnu-emacs
[Top][All Lists]
Advanced

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

Font locking in PSGML mode


From: chris
Subject: Font locking in PSGML mode
Date: Wed, 12 Mar 2003 01:56:10 -0000
User-agent: slrn/0.9.7.4 (Linux)

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)



reply via email to

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