summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-08-26 03:45:21 +0000
committerRichard M. Stallman <rms@gnu.org>1997-08-26 03:45:21 +0000
commitb18fff674d8a01b42db210688862e73103a402a0 (patch)
treea20132ee5361615de6b6f6765e86d86a9c39d523
parent4704334eb4fb5a0e5516b6cf76cd5c94d602bf30 (diff)
downloademacs-b18fff674d8a01b42db210688862e73103a402a0.tar.gz
(custom-declare-variable): Use custom-initialize-reset
by default, rather than custom-initialize-set. (custom-initialize-reset, custom-initialize-set): Doc fixes.
-rw-r--r--lisp/custom.el22
1 files changed, 14 insertions, 8 deletions
diff --git a/lisp/custom.el b/lisp/custom.el
index 16c73babbf1..9cdab4cc3d8 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -62,9 +62,11 @@ symbol."
(eval value)))))
(defun custom-initialize-set (symbol value)
- "Initialize SYMBOL with VALUE.
-Like `custom-initialize-default', but use the function specified by
-`:set' to initialize SYMBOL."
+ "Initialize SYMBOL based on VALUE.
+If the symbol doesn't have a default binding already,
+then set it using its `:set' function (or `set-default' if it has none).
+The value is either the value in the symbol's `saved-value' property,
+if any, or VALUE."
(unless (default-boundp symbol)
(funcall (or (get symbol 'custom-set) 'set-default)
symbol
@@ -73,9 +75,12 @@ Like `custom-initialize-default', but use the function specified by
(eval value)))))
(defun custom-initialize-reset (symbol value)
- "Initialize SYMBOL with VALUE.
-Like `custom-initialize-set', but use the function specified by
-`:get' to reinitialize SYMBOL if it is already bound."
+ "Initialize SYMBOL based on VALUE.
+Set the symbol, using its `:set' function (or `set-default' if it has none).
+The value is either the symbol's current value
+ \(as obtained using the `:get' function), if any,
+or the value in the symbol's `saved-value' property if any,
+or (last of all) VALUE."
(funcall (or (get symbol 'custom-set) 'set-default)
symbol
(cond ((default-boundp symbol)
@@ -89,7 +94,8 @@ Like `custom-initialize-set', but use the function specified by
(defun custom-initialize-changed (symbol value)
"Initialize SYMBOL with VALUE.
Like `custom-initialize-reset', but only use the `:set' function if the
-not using the standard setting. Otherwise, use the `set-default'."
+not using the standard setting.
+For the standard setting, use the `set-default'."
(cond ((default-boundp symbol)
(funcall (or (get symbol 'custom-set) 'set-default)
symbol
@@ -114,7 +120,7 @@ not the default value itself."
(put symbol 'force-value nil))
(when doc
(put symbol 'variable-documentation doc))
- (let ((initialize 'custom-initialize-set)
+ (let ((initialize 'custom-initialize-reset)
(requests nil))
(while args
(let ((arg (car args)))