Mercurial > emacs
comparison lisp/cus-edit.el @ 56161:a8ce8bdfcee6
(custom-variable-documentation): New function.
(custom-variable): Use it.
author | Luc Teirlinck <teirllm@auburn.edu> |
---|---|
date | Sat, 19 Jun 2004 16:02:06 +0000 |
parents | 173cdf06168d |
children | 27e0c6aa31c5 4c90ffeb71c5 |
comparison
equal
deleted
inserted
replaced
56160:6ad083598109 | 56161:a8ce8bdfcee6 |
---|---|
2072 :type '(choice (const edit) | 2072 :type '(choice (const edit) |
2073 (const lisp)) | 2073 (const lisp)) |
2074 :group 'custom-buffer | 2074 :group 'custom-buffer |
2075 :version "20.3") | 2075 :version "20.3") |
2076 | 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 | |
2077 (define-widget 'custom-variable 'custom | 2091 (define-widget 'custom-variable 'custom |
2078 "Customize variable." | 2092 "Customize variable." |
2079 :format "%v" | 2093 :format "%v" |
2080 :help-echo "Set or reset this variable." | 2094 :help-echo "Set or reset this variable." |
2081 :documentation-property 'variable-documentation | 2095 :documentation-property #'custom-variable-documentation |
2082 :custom-category 'option | 2096 :custom-category 'option |
2083 :custom-state nil | 2097 :custom-state nil |
2084 :custom-menu 'custom-variable-menu-create | 2098 :custom-menu 'custom-variable-menu-create |
2085 :custom-form nil ; defaults to value of `custom-variable-default-form' | 2099 :custom-form nil ; defaults to value of `custom-variable-default-form' |
2086 :value-create 'custom-variable-value-create | 2100 :value-create 'custom-variable-value-create |