Re: Moving to XEmacs

Tim Johnson <[email protected]> Tue, 20 Apr 2004 07:59:46 -0800
Newsgroups gmane.emacs.xemacs.general
Message-ID <[email protected]>
Hello David: 

This is a follow-up to to a posting that you
made. My original reply does not appear to have gotten to
the list. Please let me know if you get this - will look for
it again in the list.
cheers

tim

> 
> >>> 1. Customized Syntax Highlighting:
  I'm still just "playing" with Xemacs, but as a programming
  professional with a large supply of my own re-usable 
  assets, I've found it useful to create my own font-lock groups.
  It also gives me better visual disgression since my up-close
  vision is that great.

  There's an example at the end of this message:
  Please note that the default colors are overridden by custom.el
  And that these faces can be modified directly from 
  Options->Advanced(Customize)->Faces

  I would use a similar approach if I were to seperate (In C)
  Ansi keywords from compiler-specific ones, so I could do
  something like 
    (defface font-lock-user-keyword-face .... )
  watch out for line-wrapping, if anyone wishes, I can send it
  individually OTL as an attachment.

  tim

;; =========================================================================
;; File: font-lock-more.el
;; Created by Tim Johnson. March 17, 2004
;; Add new font-lock faces
;; =========================================================================
(require 'font-lock)
(defconst more-font-lock-faces 
  '(font-lock-loop-face
	font-lock-constant-face
	font-lock-conditional-face
	font-lock-predicate-face
	font-lock-user-keyword-face))
;; cloned the font-lock-string-face from font-lock.el for templates
(defface font-lock-loop-face
  '((((class color) (background dark)) (:foreground "tan"))
    (((class color) (background light)) (:foreground "green4"))
    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
    (t (:bold t)))
  "Font Lock mode face used to highlight loops."
  :group 'font-lock-faces)
;; ==========================================================================
(defface font-lock-constant-face
  '((((class color) (background dark)) (:foreground "tan"))
    (((class color) (background light)) (:foreground "green4"))
    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
    (t (:bold t)))
  "Font Lock mode face used to highlight constants."
  :group 'font-lock-faces)
;; ==========================================================================
(defface font-lock-conditional-face
  '((((class color) (background dark)) (:foreground "tan"))
    (((class color) (background light)) (:foreground "green4"))
    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
    (t (:bold t)))
  "Font Lock mode face used to highlight keywords for conditional code blocks."
  :group 'font-lock-faces)
;; ===========================================================================
(defface font-lock-predicate-face
  '((((class color) (background dark)) (:foreground "tan"))
    (((class color) (background light)) (:foreground "green4"))
    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
    (t (:bold t)))
  "Font Lock mode face used to highlight predicate keywords."
  :group 'font-lock-faces)
;; ===========================================================================
(defface font-lock-user-keyword-face
  '((((class color) (background dark)) (:foreground "tan"))
    (((class color) (background light)) (:foreground "green4"))
    (((class grayscale) (background light)) (:foreground "DimGray" :italic t))
    (((class grayscale) (background dark)) (:foreground "LightGray" :italic t))
    (t (:bold t)))
  "Font Lock mode face used to highlight user keywords."
  :group 'font-lock-faces)
(setq font-lock-face-list (cons more-font-lock-faces font-lock-face-list))
(provide 'font-lock-more)

-- 
Tim Johnson <[email protected]>
      http://www.alaska-internet-solutions.com