summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDario Gjorgjevski <dario.gjorgjevski@gmail.com>2020-11-26 11:59:23 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2020-11-26 20:09:28 +0100
commite3d8f4b98f19f4e8d194f1ae9a91065b80e01a0f (patch)
treea61f236c504cc3c43aaf9537da5636401a834323
parent771bd26b778c089e153604244c00430f36227943 (diff)
downloademacs-e3d8f4b98f19f4e8d194f1ae9a91065b80e01a0f.tar.gz
Fix modification check when custom-form is `lisp'
* lisp/cus-edit.el (custom-variable-modified-p): Quote the value when custom form is 'lisp (or 'mismatch) prior to comparing in order to accommodate `custom-variable-value-create' (bug#44852).
-rw-r--r--lisp/cus-edit.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index cb68bae3c9b..a00cb17e298 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -2900,14 +2900,20 @@ Modified means that the widget that holds the value has been edited by the user
in a customize buffer.
To check for other states, call `custom-variable-state'."
(catch 'get-error
- (let* ((symbol (widget-get widget :value))
+ (let* ((form (widget-get widget :custom-form))
+ (symbol (widget-get widget :value))
(get (or (get symbol 'custom-get) 'default-value))
(value (if (default-boundp symbol)
(condition-case nil
(funcall get symbol)
(error (throw 'get-error t)))
- (symbol-value symbol))))
- (not (equal value (widget-value (car (widget-get widget :children))))))))
+ (symbol-value symbol)))
+ (orig-value (widget-value (car (widget-get widget :children)))))
+ (not (equal (if (memq form '(lisp mismatch))
+ ;; Mimic `custom-variable-value-create'.
+ (custom-quote value)
+ value)
+ orig-value)))))
(defun custom-variable-state-set (widget &optional state)
"Set the state of WIDGET to STATE.