fontification in psgml

  • Wim Sweldens
    Wim Sweldens

    I don't get any fontification when using
    psgml. Call to font-lock-fontify-buffer
    don't make a difference. Anyone with a
    similar problem? Fonts work fine in
    all other major modes. This in on win2k
    with emacs 20.7.1


    • PSGML doesn't support font-lock, but it can still provide som fontification using its own mechanism. You have to enable this in your .emacs with:

        (setq sgml-set-face t)
        (setq sgml-auto-activate-dtd t)

      and if you have the version 1.2.2 of PSGML, I suggest also setting:

        (setq sgml-use-text-properties t)


      • Mark Mynsted
        Mark Mynsted

        Ok, I tried that.

        Is there color?  (It seems as though it only bold-faced some text.)

    • Brian Ewins
      Brian Ewins

      There is colour. Try this in your .emacs:

      (make-face 'sgml-comment-face)
      (make-face 'sgml-start-tag-face)
      (make-face 'sgml-end-tag-face)
      (make-face 'sgml-entity-face)
      (make-face 'sgml-doctype-face)

      (set-face-foreground 'sgml-comment-face "FireBrick")
      (set-face-foreground 'sgml-start-tag-face "SlateBlue")
      (set-face-foreground 'sgml-end-tag-face "SlateBlue")
      (set-face-background 'sgml-entity-face "SlateBlue")
      (set-face-foreground 'sgml-entity-face "Red")
      (set-face-foreground 'sgml-doctype-face "FireBrick")

      (setq sgml-set-face t)  ; without this, all SGML text is in same color
      (setq sgml-markup-faces
         '((comment   . sgml-comment-face)
           (start-tag . sgml-start-tag-face)
           (end-tag   . sgml-end-tag-face)
           (doctype   . sgml-doctype-face)
           (entity    . sgml-entity-face)))