From eeb6cc88a999104c4ada43ce4dee2c40875a2016 Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Sun, 5 Feb 2012 21:41:50 +0800 Subject: [PATCH] Fix presentation of type-mismatched customization widgets. * lisp/cus-edit.el (custom-variable-value-create): For mismatched types, show the current value. Fixes: debbugs:7600 --- lisp/ChangeLog | 3 +++ lisp/cus-edit.el | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fdf25af86ee..6a31a20f947 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -5,6 +5,9 @@ 2012-02-05 Chong Yidong + * 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 diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 0d7b0733b64..d7b1b6f94fb 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -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)))))) -- 2.39.2