Function: deftheme

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

Signature

(deftheme THEME &optional DOC)

Documentation

Declare THEME to be a Custom theme.

The optional argument DOC is a doc string describing the theme.

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

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)


;; The IGNORED arguments to deftheme come from the XEmacs theme code, where
;; they were used to supply keyword-value pairs like `:immediate',
;; `:variable-reset-string', etc.  We don't use any of these, so ignore them.

(defmacro deftheme (theme &optional doc &rest _ignored)
  "Declare THEME to be a Custom theme.
The optional argument DOC is a doc string describing the 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)
           (advertised-calling-convention (theme &optional doc) "22.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)))