diff options
| author | Richard M. Stallman | 1997-08-26 03:45:21 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-26 03:45:21 +0000 |
| commit | 71bd46d292c7f3f684bbf38230cbb2472e162e9c (patch) | |
| tree | 80c647ab03c979456872e05463b776ac0ec0c0a8 | |
| parent | 98cd103425af9eb2005476bd8e80e3185866f9a7 (diff) | |
| download | emacs-71bd46d292c7f3f684bbf38230cbb2472e162e9c.tar.gz emacs-71bd46d292c7f3f684bbf38230cbb2472e162e9c.zip | |
(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.el | 22 |
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." | |||
| 62 | (eval value))))) | 62 | (eval value))))) |
| 63 | 63 | ||
| 64 | (defun custom-initialize-set (symbol value) | 64 | (defun custom-initialize-set (symbol value) |
| 65 | "Initialize SYMBOL with VALUE. | 65 | "Initialize SYMBOL based on VALUE. |
| 66 | Like `custom-initialize-default', but use the function specified by | 66 | If the symbol doesn't have a default binding already, |
| 67 | `:set' to initialize SYMBOL." | 67 | then set it using its `:set' function (or `set-default' if it has none). |
| 68 | The value is either the value in the symbol's `saved-value' property, | ||
| 69 | if any, or VALUE." | ||
| 68 | (unless (default-boundp symbol) | 70 | (unless (default-boundp symbol) |
| 69 | (funcall (or (get symbol 'custom-set) 'set-default) | 71 | (funcall (or (get symbol 'custom-set) 'set-default) |
| 70 | symbol | 72 | symbol |
| @@ -73,9 +75,12 @@ Like `custom-initialize-default', but use the function specified by | |||
| 73 | (eval value))))) | 75 | (eval value))))) |
| 74 | 76 | ||
| 75 | (defun custom-initialize-reset (symbol value) | 77 | (defun custom-initialize-reset (symbol value) |
| 76 | "Initialize SYMBOL with VALUE. | 78 | "Initialize SYMBOL based on VALUE. |
| 77 | Like `custom-initialize-set', but use the function specified by | 79 | Set the symbol, using its `:set' function (or `set-default' if it has none). |
| 78 | `:get' to reinitialize SYMBOL if it is already bound." | 80 | The value is either the symbol's current value |
| 81 | \(as obtained using the `:get' function), if any, | ||
| 82 | or the value in the symbol's `saved-value' property if any, | ||
| 83 | or (last of all) VALUE." | ||
| 79 | (funcall (or (get symbol 'custom-set) 'set-default) | 84 | (funcall (or (get symbol 'custom-set) 'set-default) |
| 80 | symbol | 85 | symbol |
| 81 | (cond ((default-boundp symbol) | 86 | (cond ((default-boundp symbol) |
| @@ -89,7 +94,8 @@ Like `custom-initialize-set', but use the function specified by | |||
| 89 | (defun custom-initialize-changed (symbol value) | 94 | (defun custom-initialize-changed (symbol value) |
| 90 | "Initialize SYMBOL with VALUE. | 95 | "Initialize SYMBOL with VALUE. |
| 91 | Like `custom-initialize-reset', but only use the `:set' function if the | 96 | Like `custom-initialize-reset', but only use the `:set' function if the |
| 92 | not using the standard setting. Otherwise, use the `set-default'." | 97 | not using the standard setting. |
| 98 | For the standard setting, use the `set-default'." | ||
| 93 | (cond ((default-boundp symbol) | 99 | (cond ((default-boundp symbol) |
| 94 | (funcall (or (get symbol 'custom-set) 'set-default) | 100 | (funcall (or (get symbol 'custom-set) 'set-default) |
| 95 | symbol | 101 | symbol |
| @@ -114,7 +120,7 @@ not the default value itself." | |||
| 114 | (put symbol 'force-value nil)) | 120 | (put symbol 'force-value nil)) |
| 115 | (when doc | 121 | (when doc |
| 116 | (put symbol 'variable-documentation doc)) | 122 | (put symbol 'variable-documentation doc)) |
| 117 | (let ((initialize 'custom-initialize-set) | 123 | (let ((initialize 'custom-initialize-reset) |
| 118 | (requests nil)) | 124 | (requests nil)) |
| 119 | (while args | 125 | (while args |
| 120 | (let ((arg (car args))) | 126 | (let ((arg (car args))) |