From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#61215: 29.0.60; font-lock broken in diff-mode with long lines Date: Thu, 02 Feb 2023 22:41:31 +0200 Message-ID: <83a61vx0jo.fsf@gnu.org> References: <86lelh6yhq.fsf_-_@mail.linkov.net> <83cz6tz12b.fsf@gnu.org> <86o7qcf2x5.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19941"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 61215@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 02 21:42:13 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNgPM-0004yC-9s for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Feb 2023 21:42:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNgPD-0002RL-4Z; Thu, 02 Feb 2023 15:42:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNgPC-0002QZ-Dp for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 15:42:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNgPC-0005Gy-5X for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 15:42:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNgPB-0002NI-Pm for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 15:42:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Feb 2023 20:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61215 X-GNU-PR-Package: emacs Original-Received: via spool by 61215-submit@debbugs.gnu.org id=B61215.16753704989084 (code B ref 61215); Thu, 02 Feb 2023 20:42:01 +0000 Original-Received: (at 61215) by debbugs.gnu.org; 2 Feb 2023 20:41:38 +0000 Original-Received: from localhost ([127.0.0.1]:35931 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNgOn-0002MR-RW for submit@debbugs.gnu.org; Thu, 02 Feb 2023 15:41:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNgOm-0002MD-Ac for 61215@debbugs.gnu.org; Thu, 02 Feb 2023 15:41:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNgOg-000598-GK; Thu, 02 Feb 2023 15:41:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=HjTv87y+0kyvdvTJDdn/9sbQSsFbh0uY3OhjSDdSQAY=; b=BPCFFKies9sTrDUuffj8 piinqLqrNV7XHjjX6gjxEeXOdEV//rUfRjXglFqXOo16EQQyOHvBRTH4xr4M2jSARY1isRfGy1+up v/rSOUi1FcgcCweEtwLZWK/21ltaUxkbbdhBDGGCaOLCIOKRdKwBDxTFDY1IhgRWbmkkzo/+q0FuS HtH1KC2mVq7xvUKZS0sG06FU3vjH3ypvD+6SUkshGESIceufObGGg2rUkEo2WxOZSEIJI40OsRj1+ 6FAgML4Apl6LAmynOIjadBL7y9eSO8ZmJpY2FI2Hnnhs+4xJauOhto5YDscS0guuMr6PfMOO70/8m nQlOMyVXCMxzOA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNgOf-0007E5-98; Thu, 02 Feb 2023 15:41:30 -0500 In-Reply-To: <86o7qcf2x5.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 02 Feb 2023 19:16:34 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254695 Archived-At: > From: Juri Linkov > Cc: 61215@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