Function: diff-test-hunk

diff-test-hunk is an interactive and byte-compiled function defined in diff-mode.el.gz.

Signature

(diff-test-hunk &optional REVERSE)

Documentation

See whether it's possible to apply the current hunk.

With a prefix argument, try to REVERSE the hunk.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/diff-mode.el.gz
(defun diff-test-hunk (&optional reverse)
  "See whether it's possible to apply the current hunk.
With a prefix argument, try to REVERSE the hunk."
  (interactive "P")
  (pcase-let ((`(,buf ,line-offset ,pos ,src ,_dst ,switched)
               (diff-find-source-location nil reverse)))
    (set-window-point (display-buffer buf) (+ (car pos) (cdr src)))
    (diff-hunk-status-msg line-offset (xor reverse switched) t)))