aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/vc/diff-mode.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/vc/diff-mode.el')
-rw-r--r--lisp/vc/diff-mode.el33
1 files changed, 18 insertions, 15 deletions
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index 37eaf254fdb..731d1e8256f 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2272,21 +2272,24 @@ Return new point, if it was moved."
2272 "Iterate over all hunks between point and MAX. 2272 "Iterate over all hunks between point and MAX.
2273Call FUN with two args (BEG and END) for each hunk." 2273Call FUN with two args (BEG and END) for each hunk."
2274 (save-excursion 2274 (save-excursion
2275 (let* ((beg (or (ignore-errors (diff-beginning-of-hunk)) 2275 (catch 'malformed
2276 (ignore-errors (diff-hunk-next) (point)) 2276 (let* ((beg (or (ignore-errors (diff-beginning-of-hunk))
2277 max))) 2277 (ignore-errors (diff-hunk-next) (point))
2278 (while (< beg max) 2278 max)))
2279 (goto-char beg) 2279 (while (< beg max)
2280 (cl-assert (looking-at diff-hunk-header-re)) 2280 (goto-char beg)
2281 (let ((end 2281 (unless (looking-at diff-hunk-header-re)
2282 (save-excursion (diff-end-of-hunk) (point)))) 2282 (throw 'malformed nil))
2283 (cl-assert (< beg end)) 2283 (let ((end
2284 (funcall fun beg end) 2284 (save-excursion (diff-end-of-hunk) (point))))
2285 (goto-char end) 2285 (unless (< beg end)
2286 (setq beg (if (looking-at diff-hunk-header-re) 2286 (throw 'malformed nil))
2287 end 2287 (funcall fun beg end)
2288 (or (ignore-errors (diff-hunk-next) (point)) 2288 (goto-char end)
2289 max)))))))) 2289 (setq beg (if (looking-at diff-hunk-header-re)
2290 end
2291 (or (ignore-errors (diff-hunk-next) (point))
2292 max)))))))))
2290 2293
2291(defun diff--font-lock-refined (max) 2294(defun diff--font-lock-refined (max)
2292 "Apply hunk refinement from font-lock." 2295 "Apply hunk refinement from font-lock."