Function: custom-notify

custom-notify is a byte-compiled function defined in cus-edit.el.gz.

Signature

(custom-notify WIDGET &rest ARGS)

Documentation

Keep track of changes.

Source Code

;; Defined in /usr/src/emacs/lisp/cus-edit.el.gz
(defun custom-notify (widget &rest args)
  "Keep track of changes."
  (let ((state (widget-get widget :custom-state)))
    (unless (eq state 'modified)
      (unless (memq state '(nil unknown hidden))
	(widget-put widget :custom-state 'modified)
        ;; Tell our buttons and the tool bar that we changed the widget's state.
        (force-mode-line-update)
        (dolist (btn custom-command-buttons)
          (widget-apply btn :notify)))
      ;; Update the status text (usually from "STANDARD" to "EDITED
      ;; bla bla" in the buffer after the command has run.  Otherwise
      ;; commands like `M-u' (that work on a region in the buffer)
      ;; will upcase the wrong part of the buffer, since more text has
      ;; been inserted before point.
      (run-with-idle-timer 0.0 nil #'custom-magic-reset widget (current-buffer))
      (apply 'widget-default-notify widget args))))