Function: custom-variable-modified-p

custom-variable-modified-p is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-variable-modified-p WIDGET)

Documentation

Non-nil if the variable value of WIDGET has been modified.

WIDGET should be a custom-variable widget, whose first child is the widget that holds the value. 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.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-variable-modified-p (widget)
  "Non-nil if the variable value of WIDGET has been modified.
WIDGET should be a custom-variable widget, whose first child is the widget
that holds the value.
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* ((form (widget-get widget :custom-form))
           (symbol (widget-get widget :value))
           (get (or (get symbol 'custom-get) 'default-value))
           (value-widget (car (widget-get widget :children)))
           ;; Round-trip the value, for the sake of widgets that accept
           ;; values of different types (e.g., the obsolete key-sequence widget
           ;; which takes either strings or vectors.  (Bug#76156)
           (value
            (widget-apply value-widget :value-to-external
                          (widget-apply value-widget :value-to-internal
                                        (if (default-boundp symbol)
                                            (condition-case nil
                                                (funcall get symbol)
                                              (error (throw 'get-error t)))
                                          (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)))))