Function: rng-after-change-function

rng-after-change-function is a byte-compiled function defined in rng-valid.el.gz.

Signature

(rng-after-change-function START END PRE-CHANGE-LEN)

Source Code

;; Defined in /usr/src/emacs/lisp/nxml/rng-valid.el.gz
(defun rng-after-change-function (start end pre-change-len)
  (setq rng-message-overlay-inhibit-point nil)
  (with-silent-modifications
    (rng-clear-cached-state start end))
  ;; rng-validate-up-to-date-end holds the position before the change
  ;; Adjust it to reflect the change.
  (if (< start rng-validate-up-to-date-end)
      (setq rng-validate-up-to-date-end
	    (if (<= (+ start pre-change-len) rng-validate-up-to-date-end)
		(+ rng-validate-up-to-date-end
		   (- end start pre-change-len))
	      start)))
  ;; Adjust the conditional zone
  (cond (rng-conditional-up-to-date-start
	 (when (< rng-conditional-up-to-date-start end)
	   (if (< end rng-conditional-up-to-date-end)
	       (set-marker rng-conditional-up-to-date-start end)
	     (rng-clear-conditional-region))))
	((< end rng-validate-up-to-date-end)
	 (setq rng-conditional-up-to-date-end
	       (copy-marker rng-validate-up-to-date-end nil))
	 (setq rng-conditional-up-to-date-start
	       (copy-marker end t))))
  ;; Adjust rng-validate-up-to-date-end
  (if (< start rng-validate-up-to-date-end)
      (setq rng-validate-up-to-date-end start))
  ;; Must make rng-validate-up-to-date-end < point-max
  ;; (unless the buffer is empty).
  ;; otherwise rng-validate-prepare will say there's nothing to do.
  (when (>= rng-validate-up-to-date-end (point-max))
    (setq rng-validate-up-to-date-end
          (if (< (point-min) (point-max))
              (1- (point-max))
            ;; Only widen if really necessary.
            (save-restriction (widen) (max (point-min) (1- (point-max)))))))
  ;; Arrange to revalidate
  (rng-activate-timers)
  ;; Need to do this after activating the timer
  (force-mode-line-update))