;; same hunk.
(goto-char (next-single-char-property-change
(point) 'diff--font-lock-refined nil max)))
- (diff--iterate-hunks
- max
- (lambda (beg end)
- (unless (get-char-property beg 'diff--font-lock-refined)
- (diff--refine-hunk beg end)
- (let ((ol (make-overlay beg end)))
- (overlay-put ol 'diff--font-lock-refined t)
- (overlay-put ol 'diff-mode 'fine)
- (overlay-put ol 'evaporate t)
- (overlay-put ol 'modification-hooks
- '(diff--overlay-auto-delete))))))))
+ ;; Ignore errors that diff cannot be found so that custom font-lock
+ ;; keywords after `diff--font-lock-refined' can still be evaluated.
+ (ignore-error file-missing
+ (diff--iterate-hunks
+ max
+ (lambda (beg end)
+ (unless (get-char-property beg 'diff--font-lock-refined)
+ (diff--refine-hunk beg end)
+ (let ((ol (make-overlay beg end)))
+ (overlay-put ol 'diff--font-lock-refined t)
+ (overlay-put ol 'diff-mode 'fine)
+ (overlay-put ol 'evaporate t)
+ (overlay-put ol 'modification-hooks
+ '(diff--overlay-auto-delete)))))))))
(defun diff--overlay-auto-delete (ol _after _beg _end &optional _len)
(delete-overlay ol))