GNU bug report logs -
#61215
29.0.60; font-lock broken in diff-mode with long lines
Previous Next
Full log
View this message in rfc822 format
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 61215 <at> debbugs.gnu.org
> Date: Thu, 02 Feb 2023 19:16:34 +0200
>
> > Thanks. Can you post a recipe for reproducing that, preferably
> > starting from "emacs -Q"?
>
> 0. emacs -Q
> 1. Set debug-on-error and backtrace-on-redisplay-error to t
> 2. Create a commit with some diff hunks in a prog mode at the beginning,
> and a single-line 1MB file added at the end;
> 3. From *vc-change-log* type `d' on that commit that opens *vc-diff* buffer
> 4. Scroll the *vc-diff* buffer
>
> It displays an error in the *Warning* buffer:
>
> ⛔ Warning (error): Error in a redisplay Lisp hook. See buffer *Redisplay_trace*
Can you reproduce this easily? If so, does the patch below help?
diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el
index eb01ded..9bc742a 100644
--- a/lisp/vc/diff-mode.el
+++ b/lisp/vc/diff-mode.el
@@ -2762,7 +2762,8 @@ diff-syntax-fontify-hunk
"Highlight source language syntax in diff hunk between BEG and END.
When OLD is non-nil, highlight the hunk from the old source."
(goto-char beg)
- (let* ((hunk (buffer-substring-no-properties beg end))
+ (let* ((hunk (buffer-substring-no-properties (max beg (point-min))
+ (min end (point-max))))
;; Trim a trailing newline to find hunk in diff-syntax-fontify-props
;; in diffs that have no newline at end of diff file.
(text (string-trim-right
This bug report was last modified 2 years and 76 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.