# HG changeset patch # User Luc Teirlinck # Date 1087660926 0 # Node ID a8ce8bdfcee6f8d62c0d091b8e894db3692a0826 # Parent 6ad083598109c3bcb7ebcce93ff5a97680046c02 (custom-variable-documentation): New function. (custom-variable): Use it. diff -r 6ad083598109 -r a8ce8bdfcee6 lisp/cus-edit.el --- a/lisp/cus-edit.el Sat Jun 19 00:59:28 2004 +0000 +++ b/lisp/cus-edit.el Sat Jun 19 16:02:06 2004 +0000 @@ -2074,11 +2074,25 @@ :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