Function: diff-hl-search-next-hunk

diff-hl-search-next-hunk is a natively compiled function defined in diff-hl.el.

Signature

(diff-hl-search-next-hunk &optional BACKWARD POINT)

Documentation

Search the next hunk in the current buffer, or previous if BACKWARD.

Source Code

;; Defined in /nix/store/cfz56rl3lp066226i0bmmgiicls3gcq7-emacs-packages-deps/share/emacs/site-lisp/elpa/diff-hl-20261001.135/diff-hl.el
(defun diff-hl-search-next-hunk (&optional backward point)
  "Search the next hunk in the current buffer, or previous if BACKWARD."
  (save-excursion
    (when point
      (goto-char point))
    (catch 'found
      (while (not (if backward (bobp) (eobp)))
        (goto-char (if backward
                       (previous-overlay-change (point))
                     (next-overlay-change (point))))
        (let ((o (diff-hl-hunk-overlay-at (point))))
          (when (and o (= (overlay-start o) (point)))
            (throw 'found o)))))))