From 1e2b5ce115d67d350e27d7d3bd33ef5131cc59fa Mon Sep 17 00:00:00 2001 From: Dario Gjorgjevski Date: Tue, 24 Nov 2020 17:34:08 +0100 Subject: [PATCH] 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'. --- lisp/cus-edit.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index eceba8fa4d..27c0147f58 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -2900,14 +2900,19 @@ custom-variable-modified-p 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)) + (custom-quote value) ; Mimic `custom-variable-value-create'. + value) + orig-value))))) (defun custom-variable-state-set (widget &optional state) "Set the state of WIDGET to STATE. -- 2.28.0