aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDario Gjorgjevski2020-11-26 11:59:23 +0100
committerLars Ingebrigtsen2020-11-26 20:09:28 +0100
commite3d8f4b98f19f4e8d194f1ae9a91065b80e01a0f (patch)
treea61f236c504cc3c43aaf9537da5636401a834323
parent771bd26b778c089e153604244c00430f36227943 (diff)
downloademacs-e3d8f4b98f19f4e8d194f1ae9a91065b80e01a0f.tar.gz
emacs-e3d8f4b98f19f4e8d194f1ae9a91065b80e01a0f.zip
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
2900in a customize buffer. 2900in a customize buffer.
2901To check for other states, call `custom-variable-state'." 2901To check for other states, call `custom-variable-state'."
2902 (catch 'get-error 2902 (catch 'get-error
2903 (let* ((symbol (widget-get widget :value)) 2903 (let* ((form (widget-get widget :custom-form))
2904 (symbol (widget-get widget :value))
2904 (get (or (get symbol 'custom-get) 'default-value)) 2905 (get (or (get symbol 'custom-get) 'default-value))
2905 (value (if (default-boundp symbol) 2906 (value (if (default-boundp symbol)
2906 (condition-case nil 2907 (condition-case nil
2907 (funcall get symbol) 2908 (funcall get symbol)
2908 (error (throw 'get-error t))) 2909 (error (throw 'get-error t)))
2909 (symbol-value symbol)))) 2910 (symbol-value symbol)))
2910 (not (equal value (widget-value (car (widget-get widget :children)))))))) 2911 (orig-value (widget-value (car (widget-get widget :children)))))
2912 (not (equal (if (memq form '(lisp mismatch))
2913 ;; Mimic `custom-variable-value-create'.
2914 (custom-quote value)
2915 value)
2916 orig-value)))))
2911 2917
2912(defun custom-variable-state-set (widget &optional state) 2918(defun custom-variable-state-set (widget &optional state)
2913 "Set the state of WIDGET to STATE. 2919 "Set the state of WIDGET to STATE.