Function: reb-auto-update

reb-auto-update is a byte-compiled function defined in re-builder.el.gz.

Signature

(reb-auto-update BEG END LENOLD &optional FORCE)

Documentation

Called from after-change-functions to update the display.

BEG, END and LENOLD are passed in from the hook. An actual update is only done if the regexp has changed or if the optional fourth argument FORCE is non-nil.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/re-builder.el.gz
(defun reb-auto-update (_beg _end _lenold &optional force)
  "Called from `after-change-functions' to update the display.
BEG, END and LENOLD are passed in from the hook.
An actual update is only done if the regexp has changed or if the
optional fourth argument FORCE is non-nil."
  (let ((prev-valid reb-valid-string)
	(new-valid
	 (condition-case err
	     (progn
	       (when (or (reb-update-regexp) force)
		 (reb-do-update))
	       "")
	   (error (propertize
                   (format " %s"
                           (if (and (consp (cdr err)) (stringp (cadr err)))
                               (format "%s: %s" (car err) (cadr err))
                             (car err)))
                   'face 'font-lock-warning-face)))))
    (setq reb-valid-string new-valid)
    (force-mode-line-update)

    ;; Through the caching of the re a change invalidating the syntax
    ;; for symbolic expressions will not delete the overlays so we
    ;; catch it here
    (when (and (reb-lisp-syntax-p)
	       (not (string= prev-valid new-valid))
	       (string= prev-valid ""))
      (reb-delete-overlays))))