unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Font locking in PSGML mode
@ 2003-03-12  1:56 chris
  2003-03-12  9:30 ` Kai Großjohann
  2003-03-12 17:02 ` Kevin Rodgers
  0 siblings, 2 replies; 11+ messages in thread
From: chris @ 2003-03-12  1:56 UTC (permalink / raw)


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)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-03-15  0:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-12  1:56 Font locking in PSGML mode chris
2003-03-12  9:30 ` Kai Großjohann
2003-03-13  4:16   ` chris
2003-03-13  9:00     ` Kai Großjohann
2003-03-14 19:05       ` Karl Eichwalder
2003-03-15  0:02         ` Chris
2003-03-13  6:11   ` Karl Eichwalder
2003-03-12 17:02 ` Kevin Rodgers
2003-03-13  4:17   ` chris
2003-03-13 18:27     ` Kevin Rodgers
2003-03-15  0:00       ` Chris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).