Function: diff-hl-diff-goto-hunk-1

diff-hl-diff-goto-hunk-1 is a natively compiled function defined in diff-hl.el.

Signature

(diff-hl-diff-goto-hunk-1 HISTORIC REV1)

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-diff-goto-hunk-1 (historic rev1)
  (defvar vc-sentinel-movepoint)
  (with-current-buffer (diff-hl--target-buffer)
    (vc-buffer-sync))
  (let* ((line (line-number-at-pos))
         (buffer (current-buffer))
         rev2)
    (when historic
      (let ((revs (diff-hl-diff-read-revisions rev1)))
        (setq rev1 (car revs)
              rev2 (cdr revs))))
    (vc-diff-internal
     (if (boundp 'vc-allow-async-diff)
         vc-allow-async-diff
       t)
     (vc-deduce-fileset) rev1 rev2 t)
    (vc-run-delayed (if (< (line-number-at-pos (point-max)) 3)
                        (with-current-buffer buffer (diff-hl-update))
                      (when (or (not rev2) diff-hl-goto-hunk-old-revisions)
                        (diff-hl-diff-skip-to line))
                      (setq vc-sentinel-movepoint (point))))))