all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: chris <chrisl_ak@hotmail.com>
Subject: Font locking in PSGML mode
Date: Wed, 12 Mar 2003 01:56:10 -0000	[thread overview]
Message-ID: <v6t4tqpp83n715@corp.supernews.com> (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)

             reply	other threads:[~2003-03-12  1:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-12  1:56 chris [this message]
2003-03-12  9:30 ` Font locking in PSGML mode 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=v6t4tqpp83n715@corp.supernews.com \
    --to=chrisl_ak@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.