emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/cus-edit.el


From: Luc Teirlinck
Subject: [Emacs-diffs] Changes to emacs/lisp/cus-edit.el
Date: Sat, 19 Jun 2004 12:01:52 -0400

Index: emacs/lisp/cus-edit.el
diff -c emacs/lisp/cus-edit.el:1.194 emacs/lisp/cus-edit.el:1.195
*** emacs/lisp/cus-edit.el:1.194        Sun Jun  6 02:45:28 2004
--- emacs/lisp/cus-edit.el      Sat Jun 19 16:02:06 2004
***************
*** 2074,2084 ****
    :group 'custom-buffer
    :version "20.3")
  
  (define-widget 'custom-variable 'custom
    "Customize variable."
    :format "%v"
    :help-echo "Set or reset this variable."
!   :documentation-property 'variable-documentation
    :custom-category 'option
    :custom-state nil
    :custom-menu 'custom-variable-menu-create
--- 2074,2098 ----
    :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 #'custom-variable-documentation
    :custom-category 'option
    :custom-state nil
    :custom-menu 'custom-variable-menu-create




reply via email to

[Prev in Thread] Current Thread [Next in Thread]