Function: deftheme

deftheme is a macro defined in custom.el.gz.

Signature

(deftheme THEME &optional DOC &rest PROPERTIES)

Documentation

Declare THEME to be a Custom theme.

The optional argument DOC is a doc string describing the theme. PROPERTIES are interpreted as a property list that will be stored in the theme-properties property for THEME.

Any theme foo should be defined in a file called foo-theme.el; see custom-make-theme-feature for more information.

View in manual

Source Code

;; Defined in /usr/src/emacs/lisp/custom.el.gz
;;; Defining themes.

;; A theme file is named `THEME-theme.el' (where THEME is the theme
;; name) found in `custom-theme-load-path'.  It has this format:
;;
;;   (deftheme THEME
;;     DOCSTRING)
;;
;;   (custom-theme-set-variables
;;    'THEME
;;    [THEME-VARIABLES])
;;
;;   (custom-theme-set-faces
;;    'THEME
;;    [THEME-FACES])
;;
;;   (provide-theme 'THEME)


(defmacro deftheme (theme &optional doc &rest properties)
  "Declare THEME to be a Custom theme.
The optional argument DOC is a doc string describing the theme.
PROPERTIES are interpreted as a property list that will be stored
in the `theme-properties' property for THEME.

Any theme `foo' should be defined in a file called `foo-theme.el';
see `custom-make-theme-feature' for more information."
  (declare (doc-string 2)
           (indent 1))
  (let ((feature (custom-make-theme-feature theme)))
    ;; It is better not to use backquote in this file,
    ;; because that makes a bootstrapping problem
    ;; if you need to recompile all the Lisp files using interpreted code.
    (list 'custom-declare-theme (list 'quote theme) (list 'quote feature) doc
          (cons 'list properties))))