;;; custom.el --- tools for declaring and initializing options
;;
-;; Copyright (C) 1996, 1997, 1999, 2001, 2002, 2004, 2005
-;; Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1997, 1999, 2001, 2002, 2003, 2004,
+;; 2005 Free Software Foundation, Inc.
;;
;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
;; Maintainer: FSF
"Like `custom-initialize-set', but catches errors.
If an error occurs during initialization, SYMBOL is set to nil
and no error is thrown. This is meant for use in pre-loaded files
-where some variables used to compute VALUE are not yet defined.
-You can then re-evaluate VALUE in startup.el, for instance using
-`custom-reevaluate-setting'."
+where some variables or functions used to compute VALUE may not yet
+be defined. You can then re-evaluate VALUE in startup.el, for instance
+using `custom-reevaluate-setting'."
(condition-case nil
(custom-initialize-set symbol value)
(error (set-default symbol nil))))
"Like `custom-initialize-default', but catches errors.
If an error occurs during initialization, SYMBOL is set to nil
and no error is thrown. This is meant for use in pre-loaded files
-where some variables used to compute VALUE are not yet defined.
-You can then re-evaluate VALUE in startup.el, for instance using
-`custom-reevaluate-setting'."
+where some variables or functions used to compute VALUE may not yet
+be defined. You can then re-evaluate VALUE in startup.el, for instance
+using `custom-reevaluate-setting'."
(condition-case nil
(custom-initialize-default symbol value)
(error (set-default symbol nil))))
"Themes that have been defined with `deftheme'.
The default value is the list (user standard). The theme `standard'
contains the Emacs standard settings from the original Lisp files. The
-theme `user' contains all the the settings the user customized and saved.
+theme `user' contains all the settings the user customized and saved.
Additional themes declared with the `deftheme' macro will be added to
the front of this list.")
(apply 'custom-theme-set-variables 'user args))
(defun custom-reevaluate-setting (symbol)
- "Reset the value of SYMBOL by re-evaluating its saved or default value.
-This is useful for variables that are defined before their default value
-can really be computed. E.g. dumped variables whose default depends on
-run-time information."
+ "Reset the value of SYMBOL by re-evaluating its saved or standard value.
+Use the :set function to do so. This is useful for customizable options
+that are defined before their standard value can really be computed.
+E.g. dumped variables whose default depends on run-time information."
(funcall (or (get symbol 'custom-set) 'set-default)
symbol
(eval (car (or (get symbol 'saved-value) (get symbol 'standard-value))))))
(error "Circular custom dependency between `%s' and `%s'"
sym1 sym2))
(2-then-1 nil)
- ;; Put symbols with :require last. The macro
- ;; define-minor-mode generates a defcustom
- ;; with a :require and a :set, where the
- ;; setter function calls the mode function.
- ;; Putting symbols with :require last ensures
- ;; that the mode function will see other
- ;; customized values rather than default
- ;; values.
- (t (nth 3 a2)))))))
+ ;; Put minor modes and symbols with :require last.
+ ;; Putting minor modes last ensures that the mode
+ ;; function will see other customized values rather
+ ;; than default values.
+ (t (or (nth 3 a2)
+ (eq (get sym2 'custom-set)
+ 'custom-set-minor-mode))))))))
(while args
(let ((entry (car args)))
(if (listp entry)