Function: xref--next-error-function

xref--next-error-function is a byte-compiled function defined in xref.el.gz.

Signature

(xref--next-error-function N RESET?)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/xref.el.gz
(defun xref--next-error-function (n reset?)
  (when reset?
    (goto-char (point-min)))
  (let ((backward (< n 0))
        (n (abs n))
        (xref nil))
    (if (= n 0)
        (setq xref (get-text-property (point) 'xref-item))
      (dotimes (_ n)
        (setq xref (xref--search-property 'xref-item backward))))
    (cond (xref
           ;; Save the current position (when the buffer is visible,
           ;; it gets reset to that window's point from time to time).
           (let ((win (get-buffer-window (current-buffer))))
             (and win (set-window-point win (point))))
           (xref--set-arrow)
           (let ((xref-current-item xref))
             (xref--show-location (xref-item-location xref) t)))
          (t
           (error "No %s xref" (if backward "previous" "next"))))))