Highlit19 for STk (for emacs19 not xemacs)

From: John A. Zinky <jzinky_at_bbn.com>
Date: Fri, 10 Jan 1997 11:57:37 -0500

;;; This emacs 19 code enables highlighting in scheme-mode
;;; Just add it to your .emacs file
;;;
;;; John Zinky BBN Nov 1996
;;; Could not find a STk version of hilit19 so hacked lisp version
(cond
 (window-system
        ;; Turn on hilit19 for Emacs 19
        ;; You may have already done this
        (setq hilit-mode-enable-list '(not text-mode)
              hilit-background-mode 'light
              hilit-inhibit-hooks nil
              hilit-inhibit-rebinding nil)
         (require 'hilit19)

        ;; Define STk Highlighting patterns
         (hilit-set-mode-patterns
          '(scheme-mode)
          '(
            ;; Comments
            (";.*" nil comment)
            ("#|" "|#" comment)
            ;; Strings
            (hilit-string-find ?\\ string)
            ;; STklos class names <name>
            ("<[a-zA-Z0-9-]*>" nil type)
            ;; Scheme function "(define ()"
            ("^\\s *(define\\s +(" "\\()\\|nil\\)" defun)
            ;; Scheme variable (define name
            ("^\\s *(define\\s +[a-zA-Z0-9-]*" nil decl)
            ;; STk class (does not highlight the signiture yet)
            ("^\\s *(define\\(-class\\|-generic\\|-method\\|-macro\\)"
             nil define)
            ;; STk require statements
            ("^\\s *(\\(provide\\|require\\|\\(auto\\)?load\\).*$" nil include)
            ;; Leftovers from lisp
            ("[ \t]\\&\\(key\\|rest\\|optional\\|aux\\)\\s *" nil keyword)
            ;; Scheme keywords with leftovers from lisp
            ("(\\(let\\*?\\|locally\\|cond\\|if\\*?\\|or\\|and\\|map\\|make\\(car\\|c[ao]n\\)?\\|prog[nv1*]?\\|dotimes\\|for-each\\|while\\|when\\|unless\\|do\\(\\*\\|list\\|times\\)\\|lambda\\|function\\|values\\|set\\([q!f]\\|car\\|cdr\\)?\\|rplac[ad]\\|nconc\\|block\\|go\\|return\\(-from\\)?\\|[ec]?\\(type\\)?case\\|multiple-value-\\(bind\\|setq\\|list\\|call\\|prog1\\)\\|unwind-protect\\|handler-case\\|append\\|insert\\|catch\\|throw\\|eval-when\\(-compile\\)?\\)[ \t\n]" 1 keyword)
            ))
         
         ;; Change hilite colors
         (hilit-translate
          decl 'purple-bold
          type 'coral )

         ))
Received on Fri Jan 10 1997 - 17:57:18 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST