]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix presentation of type-mismatched customization widgets.
authorChong Yidong <cyd@gnu.org>
Sun, 5 Feb 2012 13:41:50 +0000 (21:41 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 5 Feb 2012 13:41:50 +0000 (21:41 +0800)
* lisp/cus-edit.el (custom-variable-value-create): For mismatched
types, show the current value.

Fixes: debbugs:7600
lisp/ChangeLog
lisp/cus-edit.el

index fdf25af86eed306e8748dd723be21020a14f5333..6a31a20f947ec31cb37608ea8209694fad9bad76 100644 (file)
@@ -5,6 +5,9 @@
 
 2012-02-05  Chong Yidong  <cyd@gnu.org>
 
+       * cus-edit.el (custom-variable-value-create): For mismatched
+       types, show the current value (Bug#7600).
+
        * custom.el (defcustom): Doc fix.
 
 2012-02-05  Glenn Morris  <rgm@gnu.org>
index 0d7b0733b64f74738f81082877d5a377446769d2..d7b1b6f94fbc45bb7731ad82ea5df2a1e4cd0434 100644 (file)
@@ -2599,7 +2599,6 @@ try matching its doc string against `custom-guess-doc-alist'."
                  :parent widget)
                 buttons))
          ((memq form '(lisp mismatch))
-          ;; In lisp mode edit the saved value when possible.
           (push (widget-create-child-and-convert
                  widget 'custom-visibility
                  :help-echo "Hide the value of this option."
@@ -2611,11 +2610,10 @@ try matching its doc string against `custom-guess-doc-alist'."
                  t)
                 buttons)
           (insert " ")
-          (let* ((value (cond ((get symbol 'saved-value)
-                               (car (get symbol 'saved-value)))
-                              ((get symbol 'standard-value)
-                               (car (get symbol 'standard-value)))
-                              ((default-boundp symbol)
+          ;; This used to try presenting the saved value or the
+          ;; standard value, but it seems more intuitive to present
+          ;; the current value (Bug#7600).
+          (let* ((value (cond ((default-boundp symbol)
                                (custom-quote (funcall get symbol)))
                               (t
                                (custom-quote (widget-get conv :value))))))