summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Kost <alezost@gmail.com>2015-09-06 21:55:36 +0300
committerJose Antonio Ortega Ruiz <jao@gnu.org>2015-09-07 00:32:03 +0200
commite19dde931f9ec768d142a3f2c7bb4b6779ac4d4a (patch)
tree03cf2f804db6d83d4e7be1d13ebc11193a2899ee
parent9356155e725ef185a211cf577126aca421a2a708 (diff)
downloadgeiser-chez-e19dde931f9ec768d142a3f2c7bb4b6779ac4d4a.tar.gz
geiser-chez-e19dde931f9ec768d142a3f2c7bb4b6779ac4d4a.tar.bz2
Add highlighting for geiser-custom--defcustom/defface
-rw-r--r--elisp/geiser-custom.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/elisp/geiser-custom.el b/elisp/geiser-custom.el
index f1a4adc..bf15bc9 100644
--- a/elisp/geiser-custom.el
+++ b/elisp/geiser-custom.el
@@ -30,6 +30,7 @@
:group 'faces)
(defmacro geiser-custom--defface (face def group doc)
+ (declare (doc-string 4))
(let ((face (intern (format "geiser-font-lock-%s" face))))
`(defface ,face (face-default-spec ,def)
,(format "Face for %s." doc)
@@ -49,6 +50,7 @@
(add-to-list 'geiser-custom--memoized-vars name))
(defmacro geiser-custom--defcustom (name &rest body)
+ (declare (doc-string 3) (debug (name body)))
`(progn
(geiser-custom--memoize ',name)
(defcustom ,name ,@body)))
@@ -63,4 +65,14 @@
(put 'geiser-custom--defcustom 'lisp-indent-function 2)
+(defconst geiser-custom-font-lock-keywords
+ (eval-when-compile
+ `((,(concat "(\\(geiser-custom--\\(?:defcustom\\|defface\\)\\)\\_>"
+ "[ \t'\(]*"
+ "\\(\\(?:\\sw\\|\\s_\\)+\\)?")
+ (1 font-lock-keyword-face)
+ (2 font-lock-variable-name-face nil t)))))
+
+(font-lock-add-keywords 'emacs-lisp-mode geiser-custom-font-lock-keywords)
+
(provide 'geiser-custom)