X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fsieve-mode.el;h=0445c02e686174fd1cdbc73ae6aa651b472edf68;hb=36bd162f4f7cd40453b8683e796730836c352b2a;hp=eb32cf79abc6795d125cd5351e95307e2d9d095f;hpb=ccafddd52118358ade01985eba8b7f7fe52b95de;p=elisp%2Fgnus.git- diff --git a/lisp/sieve-mode.el b/lisp/sieve-mode.el index eb32cf7..0445c02 100644 --- a/lisp/sieve-mode.el +++ b/lisp/sieve-mode.el @@ -45,7 +45,7 @@ ;; added keymap and menubar to hook into sieve-manage ;; 2001-10-31 version 1.2 committed to Oort Gnus ;; -;; $Id: sieve-mode.el,v 1.1.2.1 2001-11-01 08:25:40 yamaoka Exp $ +;; $Id: sieve-mode.el,v 1.1.2.2 2001-11-08 00:10:42 yamaoka Exp $ ;;; Code: @@ -66,20 +66,70 @@ ;; Font-lock +(defvar sieve-control-commands-face 'sieve-control-commands-face + "Face name used for Sieve Control Commands.") + +(defface sieve-control-commands-face + '((((type tty) (class color)) (:foreground "blue" :weight light)) + (((class grayscale) (background light)) (:foreground "LightGray" :bold t)) + (((class grayscale) (background dark)) (:foreground "DimGray" :bold t)) + (((class color) (background light)) (:foreground "Orchid")) + (((class color) (background dark)) (:foreground "LightSteelBlue")) + (t (:bold t))) + "Face used for Sieve Control Commands.") + +(defvar sieve-action-commands-face 'sieve-action-commands-face + "Face name used for Sieve Action Commands.") + +(defface sieve-action-commands-face + '((((type tty) (class color)) (:foreground "blue" :weight bold)) + (((class color) (background light)) (:foreground "Blue")) + (((class color) (background dark)) (:foreground "LightSkyBlue")) + (t (:inverse-video t :bold t))) + "Face used for Sieve Action Commands.") + +(defvar sieve-test-commands-face 'sieve-test-commands-face + "Face name used for Sieve Test Commands.") + +(defface sieve-test-commands-face + '((((type tty) (class color)) (:foreground "magenta")) + (((class grayscale) (background light)) + (:foreground "LightGray" :bold t :underline t)) + (((class grayscale) (background dark)) + (:foreground "Gray50" :bold t :underline t)) + (((class color) (background light)) (:foreground "CadetBlue")) + (((class color) (background dark)) (:foreground "Aquamarine")) + (t (:bold t :underline t))) + "Face used for Sieve Test Commands.") + +(defvar sieve-tagged-arguments-face 'sieve-tagged-arguments-face + "Face name used for Sieve Tagged Arguments.") + +(defface sieve-tagged-arguments-face + '((((type tty) (class color)) (:foreground "cyan" :weight bold)) + (((class grayscale) (background light)) (:foreground "LightGray" :bold t)) + (((class grayscale) (background dark)) (:foreground "DimGray" :bold t)) + (((class color) (background light)) (:foreground "Purple")) + (((class color) (background dark)) (:foreground "Cyan")) + (t (:bold t))) + "Face used for Sieve Tagged Arguments.") + + (defconst sieve-font-lock-keywords (eval-when-compile (list ;; control commands (cons (regexp-opt '("require" "if" "else" "elsif" "stop")) - 'font-lock-keyword-face) + 'sieve-control-commands-face) ;; action commands (cons (regexp-opt '("fileinto" "redirect" "reject" "keep" "discard")) - 'font-lock-keyword-face) + 'sieve-action-commands-face) ;; test commands (cons (regexp-opt '("address" "allof" "anyof" "exists" "false" "true" "header" "not" "size" "envelope")) - 'font-lock-builtin-face) - (cons "\\Sw+:\\sw+" 'font-lock-constant-face)))) + 'sieve-test-commands-face) + (cons "\\Sw+:\\sw+" + 'sieve-tagged-arguments-face)))) ;; Syntax table @@ -136,8 +186,9 @@ Turning on Sieve mode runs `sieve-mode-hook'." (set (make-local-variable 'comment-end) "") ;;(set (make-local-variable 'comment-start-skip) "\\(^\\|\\s-\\);?#+ *") (set (make-local-variable 'comment-start-skip) "#+ *") - (set (make-local-variable 'font-lock-defaults) - '(sieve-font-lock-keywords nil nil ((?_ . "w")))) + (unless (featurep 'xemacs) + (set (make-local-variable 'font-lock-defaults) + '(sieve-font-lock-keywords nil nil ((?_ . "w"))))) (easy-menu-add-item nil nil sieve-mode-menu)) ;; Menu