Subject: Re: bug#77313: 30.1.50; Regression: flymake indicators are erroneously using margins

From: Spencer Baugh <[email-masked]>
Date: Thu, 27 Mar 2025 12:28:39 -0400

Eli Zaretskii <[email-masked]> writes:

>> Date: Thu, 27 Mar 2025 11:13:44 -0400
>> From:  Spencer Baugh via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>> 
>> 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.
>
> Please tell how that could or did happen.

e.g.:

1. emacs --daemon -l flymake
2. emacsclient -c somefile.el -f flymake-mode
   (opening a graphical frame)

In Emacs 29, this uses fringes for the indicators.

In Emacs 30, this uses margins, which is a substantial regression.

>> The simplest fix, suitable for backporting, is to always default to
>> fringes.
>
> Which means there will be no indicators on TTY frames, right?

There were never indicators in TTY frames in Emacs 29.

In Emacs 30, there will also be no indicators on TTY frames if, for
example, the user does:

1. emacs (opening a graphical Emacs)
2. (require 'flymake)
   The default of flymake-indicator-type is now 'fringes, since display-graphic-p is true.
3. emacsclient -t
   No indicators.

> If you don't like the default for a user option, you can easily
> customize it locally.  But why make that change for everyone?  Options
> are options so that they could be easily adapted to local needs.

Because it's a regression from Emacs 29.

Keep in mind I was the one who, while reviewing the flymake patch adding
margins, suggested that TTY frames automatically default to using
margins.  This code exists because I requested it.  I sadly did not
realize that the behavior was implemented with a buggy default value for
flymake-indicator-type, nor was it caught before release; I only just
now have received direct user complaints about the regression.