diff options
author | Jan Moringen <jmoringe@techfak.uni-bielefeld.de> | 2021-01-02 16:19:17 +0100 |
---|---|---|
committer | Daniel KochmaĆski <daniel@turtleware.eu> | 2021-04-09 18:55:14 +0200 |
commit | 99c3366a1335933b048f19b022758122a75c78cc (patch) | |
tree | 0d20ab5cd596ee1232a7f888858f0052211dc19f /Tools | |
parent | 8d2182d1c7e3e03b9fa0cb055a53fcb3045ab0b6 (diff) |
hyperclim.el: add font-lock highlighting for specification symbols
Only activate the additional highlighting for files within in the
McCLIM code base.
Diffstat (limited to 'Tools')
-rw-r--r-- | Tools/hyperclim.el | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/Tools/hyperclim.el b/Tools/hyperclim.el index d5918842..4af1d928 100644 --- a/Tools/hyperclim.el +++ b/Tools/hyperclim.el @@ -1247,5 +1247,32 @@ ("abort-gesture" . "22-2.html#_1088") ("*abort-gestures*" . "22-2.html#_1087"))) +;;; Font lock highlighting for CLIM-specified symbols + +(defface font-lock-clim-specified-face + '((t . (:underline "gray40"))) + "Face for symbols specified in the CLIM specification." + :group 'slime) + +(defun hyperclim-add-specification-keywords () + "Add highlighting for CLIM-specified symbols." + (let ((keywords '())) + (dolist (entry (cl-rest clim-gilberth-spec)) + (let ((symbol (car entry))) + (unless (cl-member symbol '("t" "nil" + "integer" "number" "keyword" "symbol" "string" "member" + "null" "not" "and" "or" + "active" "state") ; concepts, not exported symbols + :test #'string=) + (let ((regex (format "\\_<\\(%s\\)\\_>" (regexp-quote symbol)))) + (push `(,regex 1 'font-lock-clim-specified-face) + keywords))))) + (font-lock-add-keywords nil keywords))) + +(add-hook 'lisp-mode-hook + (lambda () + (when (string-match-p "/mcclim/" (buffer-file-name)) + (hyperclim-add-specification-keywords)))) + (provide 'hyperclim) ;;; hyperclim.el ends here |