aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Teirlinck2004-06-19 16:02:06 +0000
committerLuc Teirlinck2004-06-19 16:02:06 +0000
commita075569a2988643f56657591fa52d11f1007b5d7 (patch)
tree73ec61ad0f573a0e910b657169ccf035cf5a4907
parent331fbb7dfddae10e7915de7b387fe8bc0064613d (diff)
downloademacs-a075569a2988643f56657591fa52d11f1007b5d7.tar.gz
emacs-a075569a2988643f56657591fa52d11f1007b5d7.zip
(custom-variable-documentation): New function.
(custom-variable): Use it.
-rw-r--r--lisp/cus-edit.el16
1 files changed, 15 insertions, 1 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 5caeb78265e..9e0efc5d3d0 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2074,11 +2074,25 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
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.
2079Normally just return the docstring. But if VARIABLE automatically
2080becomes 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
2087This variable automatically becomes buffer-local when set outside Custom.
2088However, 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