2074 |
:group 'custom-buffer |
:group 'custom-buffer |
2075 |
:version "20.3") |
:version "20.3") |
2076 |
|
|
2077 |
|
(defun custom-variable-documentation (variable) |
2078 |
|
"Return documentation of VARIABLE for use in Custom buffer. |
2079 |
|
Normally just return the docstring. But if VARIABLE automatically |
2080 |
|
becomes buffer local when set, append a message to that effect." |
2081 |
|
(if (and (local-variable-if-set-p variable) |
2082 |
|
(or (not (local-variable-p variable)) |
2083 |
|
(with-temp-buffer |
2084 |
|
(local-variable-if-set-p variable)))) |
2085 |
|
(concat (documentation-property variable 'variable-documentation) |
2086 |
|
"\n |
2087 |
|
This variable automatically becomes buffer-local when set outside Custom. |
2088 |
|
However, setting it through Custom sets the default value.") |
2089 |
|
(documentation-property variable 'variable-documentation))) |
2090 |
|
|
2091 |
(define-widget 'custom-variable 'custom |
(define-widget 'custom-variable 'custom |
2092 |
"Customize variable." |
"Customize variable." |
2093 |
:format "%v" |
:format "%v" |
2094 |
:help-echo "Set or reset this variable." |
:help-echo "Set or reset this variable." |
2095 |
:documentation-property 'variable-documentation |
:documentation-property #'custom-variable-documentation |
2096 |
:custom-category 'option |
:custom-category 'option |
2097 |
:custom-state nil |
:custom-state nil |
2098 |
:custom-menu 'custom-variable-menu-create |
:custom-menu 'custom-variable-menu-create |