diff options
author | Luc Teirlinck <teirllm@auburn.edu> | 2004-06-19 16:02:06 +0000 |
---|---|---|
committer | Luc Teirlinck <teirllm@auburn.edu> | 2004-06-19 16:02:06 +0000 |
commit | a075569a2988643f56657591fa52d11f1007b5d7 (patch) | |
tree | 73ec61ad0f573a0e910b657169ccf035cf5a4907 /lisp/cus-edit.el | |
parent | 331fbb7dfddae10e7915de7b387fe8bc0064613d (diff) | |
download | emacs-a075569a2988643f56657591fa52d11f1007b5d7.tar.gz |
(custom-variable-documentation): New function.
(custom-variable): Use it.
Diffstat (limited to 'lisp/cus-edit.el')
-rw-r--r-- | lisp/cus-edit.el | 16 |
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:\"." :group 'custom-buffer :version "20.3") +(defun custom-variable-documentation (variable) + "Return documentation of VARIABLE for use in Custom buffer. +Normally just return the docstring. But if VARIABLE automatically +becomes buffer local when set, append a message to that effect." + (if (and (local-variable-if-set-p variable) + (or (not (local-variable-p variable)) + (with-temp-buffer + (local-variable-if-set-p variable)))) + (concat (documentation-property variable 'variable-documentation) + "\n +This variable automatically becomes buffer-local when set outside Custom. +However, setting it through Custom sets the default value.") + (documentation-property variable 'variable-documentation))) + (define-widget 'custom-variable 'custom "Customize variable." :format "%v" :help-echo "Set or reset this variable." - :documentation-property 'variable-documentation + :documentation-property #'custom-variable-documentation :custom-category 'option :custom-state nil :custom-menu 'custom-variable-menu-create |