Guile: font lock for all components of module names
[geiser.git] / elisp / geiser-custom.el
blobf1a4adcb1835e3d7fc85400837250b90879d3316
1 ;;; geiser-custom.el -- customization utilities
3 ;; Copyright (C) 2009, 2010, 2012 Jose Antonio Ortega Ruiz
5 ;; This program is free software; you can redistribute it and/or
6 ;; modify it under the terms of the Modified BSD License. You should
7 ;; have received a copy of the license along with this program. If
8 ;; not, see <http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5>.
10 ;; Start date: Sat Feb 14, 2009 21:49
14 (require 'font-lock)
15 (require 'geiser-base)
18 ;;; Customization group:
20 (defgroup geiser nil
21 "Geiser framework for Scheme-Emacs interaction."
22 :group 'languages)
25 ;;; Faces:
27 (defgroup geiser-faces nil
28 "Faces used by Geiser."
29 :group 'geiser
30 :group 'faces)
32 (defmacro geiser-custom--defface (face def group doc)
33 (let ((face (intern (format "geiser-font-lock-%s" face))))
34 `(defface ,face (face-default-spec ,def)
35 ,(format "Face for %s." doc)
36 :group ',group
37 :group 'geiser-faces
38 :group 'faces)))
40 (put 'geiser-custom--defface 'lisp-indent-function 1)
44 ;;; Reload support:
46 (defvar geiser-custom--memoized-vars nil)
48 (defun geiser-custom--memoize (name)
49 (add-to-list 'geiser-custom--memoized-vars name))
51 (defmacro geiser-custom--defcustom (name &rest body)
52 `(progn
53 (geiser-custom--memoize ',name)
54 (defcustom ,name ,@body)))
56 (defun geiser-custom--memoized-state ()
57 (let ((result))
58 (dolist (name geiser-custom--memoized-vars result)
59 (when (boundp name)
60 (push (cons name (symbol-value name)) result)))))
63 (put 'geiser-custom--defcustom 'lisp-indent-function 2)
66 (provide 'geiser-custom)