From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 12 01:04:08 2025 Received: (at submit) by debbugs.gnu.org; 12 Aug 2025 05:04:08 +0000 Received: from localhost ([127.0.0.1]:51157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ulhB9-0003wK-KY for submit@debbugs.gnu.org; Tue, 12 Aug 2025 01:04:08 -0400 Received: from lists.gnu.org ([2001:470:142::17]:48552) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ulhB3-0003vd-7k for submit@debbugs.gnu.org; Tue, 12 Aug 2025 01:04:04 -0400 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 1ulhAu-0006iS-0u for bug-gnu-emacs@gnu.org; Tue, 12 Aug 2025 01:03:52 -0400 Received: from fout-b5-smtp.messagingengine.com ([202.12.124.148]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ulhAn-0007G9-Tk for bug-gnu-emacs@gnu.org; Tue, 12 Aug 2025 01:03:49 -0400 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 4A9411D000A0 for ; Tue, 12 Aug 2025 01:03:41 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 12 Aug 2025 01:03:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pub.pink; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1754975021; x=1755061421; bh=hvC80rOVJLltnGlZCQtHcc2yhj4CNxHB qu8MeAWoDpY=; b=e0aQbVfq5kUbXy2uCV4wW0fjW2a3pJvnfuzsSGpTB/N3Lva7 jHroLirAkHJ+SdxKp9BfxBmgASegLef4wbZ+ue8UtRXFPhViqqdqcgTW+Mi2y+Gh lRr4xKog2r9K5C79fyvMVvA/NcCkV4ci3KTZgo3B0eG/XrPazEleXoZFPgPX7Fpy ob24utfLE42gAS6D7jNSA1VThjx1ztUHmfFWjR6SumAwc6z/Pxv+mFEObgKfGHLs 5ZHkn0YzqIZXV0+GyUgvTnHIgFIBCLo2cq5/Mhd/ARrKxgd1H+N0a1EAPKRwr8xZ n/2LY3q2rmMtD7UVa8JyGzEsMRLS4NEZ4K7NNw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1754975021; x= 1755061421; bh=hvC80rOVJLltnGlZCQtHcc2yhj4CNxHBqu8MeAWoDpY=; b=P d15Y69NkTgUyNk3Fd29152rqo6OvvTrd/AxmkhcbEYA9UN5HlqypnOh1/BDsNbFM HZ4zCk1ivAQ9EsoGvJZA1IlGQuUZ70/mMJZsmbo6Y9x0W9Tv3xoMChYGaIuJgRVw HcZppN0x5bdrCzhpKP9sauLF8+So0LjyYdHNSJ4YnsaNOZxeN3DSVROBZJInxt14 ZeX9LNZkEhUMwTV4VuxdTaz4zvQNbbSf44sZ5KK4VvGwOpj177/ctx13vHOidFHj K2Zl1i0pKbWWJnq3yfhrCYLZY2zO8UPFe7On6uO8Vw1c+SPAYouVHW0QRqcMrKxz 2B0/H5o7Xo1gqZVlL9hyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddufeeggeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkfgggtgesmhdtreertdertd enucfhrhhomhepjhhohhhnuchmuhhhlhcuoehjmhesphhusgdrphhinhhkqeenucggtffr rghtthgvrhhnpedugfeftdejffevheeggedvieffgefgtedthfeiveeigfettdelveffhe efteettdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pehjmhesphhusgdrphhinhhkpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpoh huthdprhgtphhtthhopegsuhhgqdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i74194916:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 12 Aug 2025 01:03:40 -0400 (EDT) From: john muhl To: bug-gnu-emacs@gnu.org Subject: [PATCH] Fix fringe test in 'diff--font-lock-prettify' X-Debbugs-Cc: Stefan Monnier Date: Tue, 12 Aug 2025 00:03:35 -0500 Message-ID: <875xetnnbs.fsf@pub.pink> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=202.12.124.148; envelope-from=jm@pub.pink; helo=fout-b5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.3 (/) --=-=-= Content-Type: text/plain Tags: patch With diff-font-lock-prettify enabled opening a diff (or having Gnus try to render one, &c) in a tty frame causes an error since 'left-fringe is nil in that case. emacs -Q -nw -eval "(setopt diff-font-lock-prettify t)" some.diff --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-Fix-fringe-width-test-in-diff-font-lock-prettify.patch >From 50314aaae7287b03754315a5ad7aa922c417cdb2 Mon Sep 17 00:00:00 2001 From: john muhl Date: Mon, 11 Aug 2025 17:43:20 -0500 Subject: [PATCH] Fix fringe width test in 'diff--font-lock-prettify' * lisp/vc/diff-mode.el (diff--font-lock-prettify): Use 'window-fringes' instead of the 'left-fringe' frame parameter since the former returns an integer on both GUI and TTY frames. --- lisp/vc/diff-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el index 31a505f19be..df72cecb749 100644 --- a/lisp/vc/diff-mode.el +++ b/lisp/vc/diff-mode.el @@ -2949,7 +2949,7 @@ 'diff-fringe-nul (defun diff--font-lock-prettify (limit) (when diff-font-lock-prettify - (when (> (frame-parameter nil 'left-fringe) 0) + (when (> (car (window-fringes)) 0) (save-excursion ;; FIXME: Include the first space for context-style hunks! (while (re-search-forward "^[-+! ]" limit t) -- 2.50.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 16 05:02:35 2025 Received: (at 79222-done) by debbugs.gnu.org; 16 Aug 2025 09:02:35 +0000 Received: from localhost ([127.0.0.1]:40921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1unCo6-0002CO-8t for submit@debbugs.gnu.org; Sat, 16 Aug 2025 05:02:35 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17963) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1unCo3-0002Bv-7P for 79222-done@debbugs.gnu.org; Sat, 16 Aug 2025 05:02:32 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 715BD8168E; Sat, 16 Aug 2025 05:02:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1755334943; bh=FeQNrZVUStFoILClhgO+yNPcN+qN5df9Q33rY+lxSVQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=mcXStLzjPrmd60W7Xie+egbfiZbuylWDOYlUXZgmNnDtlikU6poNEZM4IFZBqHNeA k6trtMexg59rZ34VNIhuaS6KqfDkcJMmNumm7j2y+Q68T6arbRy2aZuMSNI7W5gJeJ dNTtsTlA6oz5NIew/COXQVdIm+I8lizYXD22b5WIfG82n+GOSnrnKli1UHQJadnf0i 2fFGCqOJ+CVhvjtymcLAxL/7vg4SG7swR32dxhUc/cXdNtCpLmrOi53wG9EzCLXift wU3wDXnqQYQs+uMC5bh+NTEVW3/UyuG9a0S1QczD9EeEz5KoX24H64vDxF6EpBw2C+ XmrTbmbqqtlBA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 30AE08074F; Sat, 16 Aug 2025 05:02:23 -0400 (EDT) Received: from asado (dyn.144-85-254-173.dsl.vtx.ch [144.85.254.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 436E01201B2; Sat, 16 Aug 2025 05:02:22 -0400 (EDT) From: Stefan Monnier To: john muhl Subject: Re: bug#79222: [PATCH] Fix fringe test in 'diff--font-lock-prettify' In-Reply-To: <875xetnnbs.fsf@pub.pink> Message-ID: References: <875xetnnbs.fsf@pub.pink> Date: Sat, 16 Aug 2025 05:02:18 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.005 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 79222-done Cc: 79222-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Thank John! Pushed to `master`. I added a comment about the "wasted" 4-element list that's constructed by `window-fringes`, but not before having noticed that `frame-parameter` was even worse. Stefan john muhl [2025-08-12 00:03:35] wrote: > With diff-font-lock-prettify enabled opening a diff (or having Gnus try > to render one, &c) in a tty frame causes an error since 'left-fringe is > nil in that case. > > emacs -Q -nw -eval "(setopt diff-font-lock-prettify t)" some.diff > > From 50314aaae7287b03754315a5ad7aa922c417cdb2 Mon Sep 17 00:00:00 2001 > From: john muhl > Date: Mon, 11 Aug 2025 17:43:20 -0500 > Subject: [PATCH] Fix fringe width test in 'diff--font-lock-prettify' > > * lisp/vc/diff-mode.el (diff--font-lock-prettify): > Use 'window-fringes' instead of the 'left-fringe' frame parameter > since the former returns an integer on both GUI and TTY frames. > --- > lisp/vc/diff-mode.el | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lisp/vc/diff-mode.el b/lisp/vc/diff-mode.el > index 31a505f19be..df72cecb749 100644 > --- a/lisp/vc/diff-mode.el > +++ b/lisp/vc/diff-mode.el > @@ -2949,7 +2949,7 @@ 'diff-fringe-nul > > (defun diff--font-lock-prettify (limit) > (when diff-font-lock-prettify > - (when (> (frame-parameter nil 'left-fringe) 0) > + (when (> (car (window-fringes)) 0) > (save-excursion > ;; FIXME: Include the first space for context-style hunks! > (while (re-search-forward "^[-+! ]" limit t)