mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-23 06:00:41 -08:00
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).
This commit is contained in:
parent
771bd26b77
commit
e3d8f4b98f
1 changed files with 9 additions and 3 deletions
|
|
@ -2900,14 +2900,20 @@ Modified means that the widget that holds the value has been edited by the user
|
||||||
in a customize buffer.
|
in a customize buffer.
|
||||||
To check for other states, call `custom-variable-state'."
|
To check for other states, call `custom-variable-state'."
|
||||||
(catch 'get-error
|
(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))
|
(get (or (get symbol 'custom-get) 'default-value))
|
||||||
(value (if (default-boundp symbol)
|
(value (if (default-boundp symbol)
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(funcall get symbol)
|
(funcall get symbol)
|
||||||
(error (throw 'get-error t)))
|
(error (throw 'get-error t)))
|
||||||
(symbol-value symbol))))
|
(symbol-value symbol)))
|
||||||
(not (equal value (widget-value (car (widget-get widget :children))))))))
|
(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)
|
(defun custom-variable-state-set (widget &optional state)
|
||||||
"Set the state of WIDGET to STATE.
|
"Set the state of WIDGET to STATE.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue