Subject: 30.1.50; Regression: flymake indicators are erroneously using margins
From: Spencer Baugh <[email-masked]>
To: [email-masked]
Date: Thu, 27 Mar 2025 11:13:44 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

The addition of margin-based flymake indicators in Emacs 30 (for use in
terminal frames) also led to a regression: the margin-based indicators
are uglier and should not be used when not necessary, but the code for
determining the default for flymake-indicator-type was wrong and caused
margin indicators to be used sometimes on graphical frames.

The simplest fix, suitable for backporting, is to always default to
fringes.

Please apply the attached patch and backport to Emacs 30.

From 252dd491890323710782d22483bd9cedb9d5b90c Mon Sep 17 00:00:00 2001
From: Spencer Baugh <[email-masked]>
Date: Thu, 27 Mar 2025 11:07:41 -0400
Subject: [PATCH] flymake: default to displaying indicators on fringes

Checking (display-graphic-p) at load time is not a correct way to
determine what kind of indicators to use.  This led to a regression in
Emacs 30, where we used the uglier margin indicators even while on
graphical frames if flymake was loaded before any graphical frame was
created.  For example, users of the emacs daemon who load flymake in
their init.el.

We can re-add this as a per-frame check later.

* lisp/progmodes/flymake.el (flymake-indicator-type): Default to fringes.
---
 lisp/progmodes/flymake.el | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index f8a294908ba..29bc3dacdba 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -185,9 +185,7 @@ flymake-fringe-indicator-position
 		 (const right-fringe)
 		 (const :tag "No fringe indicators" nil)))
 
-(defcustom flymake-indicator-type (if (display-graphic-p)
-                                      'fringes
-                                    'margins)
+(defcustom flymake-indicator-type 'fringes
   "Indicate which indicator type to use for display errors.
 
 The value can be nil (don't indicate errors but just highlight them),
-- 
2.39.3