aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/custom.el
diff options
context:
space:
mode:
authorPer Abrahamsen1997-04-12 17:51:31 +0000
committerPer Abrahamsen1997-04-12 17:51:31 +0000
commitbd042c030f6530726313e4ff55065df7e2ee41a9 (patch)
treeabb71fe08c194635b74c71d314bcc23c319790b3 /lisp/custom.el
parentc5292bc831ae97cd0d99234c039c9309c05af2a6 (diff)
downloademacs-bd042c030f6530726313e4ff55065df7e2ee41a9.tar.gz
emacs-bd042c030f6530726313e4ff55065df7e2ee41a9.zip
Sync with 1.84.
Diffstat (limited to 'lisp/custom.el')
-rw-r--r--lisp/custom.el36
1 files changed, 23 insertions, 13 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 57026fc8f4a..4e4cde95d9e 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -4,7 +4,7 @@
4;; 4;;
5;; Author: Per Abrahamsen <abraham@dina.kvl.dk> 5;; Author: Per Abrahamsen <abraham@dina.kvl.dk>
6;; Keywords: help, faces 6;; Keywords: help, faces
7;; Version: 1.71 7;; Version: 1.84
8;; X-URL: http://www.dina.kvl.dk/~abraham/custom/ 8;; X-URL: http://www.dina.kvl.dk/~abraham/custom/
9 9
10;;; Commentary: 10;;; Commentary:
@@ -23,16 +23,26 @@
23 23
24(define-widget-keywords :prefix :tag :load :link :options :type :group) 24(define-widget-keywords :prefix :tag :load :link :options :type :group)
25 25
26(defvar custom-define-hook nil
27 ;; Customize information for this option is in `cus-edit.el'.
28 "Hook called after defining each customize option.")
29
26;;; The `defcustom' Macro. 30;;; The `defcustom' Macro.
27 31
28(defun custom-declare-variable (symbol value doc &rest args) 32(defun custom-declare-variable (symbol value doc &rest args)
29 "Like `defcustom', but SYMBOL and VALUE are evaluated as normal arguments." 33 "Like `defcustom', but SYMBOL and VALUE are evaluated as normal arguments."
30 (unless (and (default-boundp symbol) 34 ;; Bind this variable unless it already is bound.
31 (not (get symbol 'saved-value))) 35 (unless (default-boundp symbol)
36 ;; Use the saved value if it exists, otherwise the factory setting.
32 (set-default symbol (if (get symbol 'saved-value) 37 (set-default symbol (if (get symbol 'saved-value)
33 (eval (car (get symbol 'saved-value))) 38 (eval (car (get symbol 'saved-value)))
34 (eval value)))) 39 (eval value))))
40 ;; Remember the factory setting.
35 (put symbol 'factory-value (list value)) 41 (put symbol 'factory-value (list value))
42 ;; Maybe this option was rogue in an earlier version. It no longer is.
43 (when (get symbol 'force-value)
44 ;; It no longer is.
45 (put symbol 'force-value nil))
36 (when doc 46 (when doc
37 (put symbol 'variable-documentation doc)) 47 (put symbol 'variable-documentation doc))
38 (while args 48 (while args
@@ -262,23 +272,23 @@ the default value for the SYMBOL."
262 (value (nth 1 entry)) 272 (value (nth 1 entry))
263 (now (nth 2 entry))) 273 (now (nth 2 entry)))
264 (put symbol 'saved-value (list value)) 274 (put symbol 'saved-value (list value))
265 (when now 275 (cond (now
266 (put symbol 'force-value t) 276 ;; Rogue variable, set it now.
267 (set-default symbol (eval value))) 277 (put symbol 'force-value t)
278 (set-default symbol (eval value)))
279 ((default-boundp symbol)
280 ;; Something already set this, overwrite it.
281 (set-default symbol (eval value))))
268 (setq args (cdr args))) 282 (setq args (cdr args)))
269 ;; Old format, a plist of SYMBOL VALUE pairs. 283 ;; Old format, a plist of SYMBOL VALUE pairs.
284 (message "Warning: old format `custom-set-variables'")
285 (ding)
286 (sit-for 2)
270 (let ((symbol (nth 0 args)) 287 (let ((symbol (nth 0 args))
271 (value (nth 1 args))) 288 (value (nth 1 args)))
272 (put symbol 'saved-value (list value))) 289 (put symbol 'saved-value (list value)))
273 (setq args (cdr (cdr args))))))) 290 (setq args (cdr (cdr args)))))))
274 291
275;;; Meta Customization
276
277(defcustom custom-define-hook nil
278 "Hook called after defining each customize option."
279 :group 'customize
280 :type 'hook)
281
282;;; The End. 292;;; The End.
283 293
284(provide 'custom) 294(provide 'custom)