unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
@ 2020-11-16 17:17 Protesilaos Stavrou
  2020-11-16 22:20 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Protesilaos Stavrou @ 2020-11-16 17:17 UTC (permalink / raw)
  To: 44689

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

When Flymake has not yet checked the backend of a visited file it
displays a question mark on the mode line next to its lighter text.
This "?" indicator is fontified with the 'mode-line' face, which means
that it inherits properties such as ':box', ':background', and
potentially others.

The attached patch changes fontification to 'mode-line-emphasis', which
is a face that is specifically designed for drawing attention to such
indicators.

This allows users/themes to maintain a consistent presentation for their
mode lines, regardless of whether they are active or not.

The attached screenshots show the before and after states with all
themes disabled.  Focus on the inactive mode line at the middle of the
screen.

If maintainers think that this change does not provide sufficient
emphasis, I would suggest we look into updating the specifications of
'mode-line-emphasis' instead of using an inappropriate face for
individual indicators.

What do you think?

Best regards,
Protesilaos

-- 
Protesilaos Stavrou
protesilaos.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Use-appropriate-face-for-Flymake-unknown-backend.patch --]
[-- Type: text/x-patch, Size: 1146 bytes --]

From 78fc4caba2ee0f3f81afe7b3167b07f9df5be137 Mon Sep 17 00:00:00 2001
From: Protesilaos Stavrou <info@protesilaos.com>
Date: Mon, 16 Nov 2020 18:57:13 +0200
Subject: [PATCH] Use appropriate face for Flymake unknown backend

* lisp/progmodes/flymake.el (flymake--mode-line-format): Apply
'mode-line-emphasis' face which is better suited for indicators that
are placed on the mode line.
---
 lisp/progmodes/flymake.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index b286208fff..84f7c42eb2 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1224,7 +1224,7 @@ default) no filter is applied."
                       map))
       ,@(pcase-let ((`(,ind ,face ,explain)
                      (cond ((null known)
-                            '("?" mode-line "No known backends"))
+                            '("?" mode-line-emphasis "No known backends"))
                            (some-waiting
                             `("Wait" compilation-mode-line-run
                               ,(format "Waiting for %s running backend(s)"
-- 
2.29.2


[-- Attachment #3: flymake-unknown-backend-after.png --]
[-- Type: image/png, Size: 197971 bytes --]

[-- Attachment #4: flymake-unknown-backend-before.png --]
[-- Type: image/png, Size: 196942 bytes --]

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-16 17:17 bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend Protesilaos Stavrou
@ 2020-11-16 22:20 ` Lars Ingebrigtsen
  2020-11-17  5:38   ` Protesilaos Stavrou
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-16 22:20 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 44689

Protesilaos Stavrou <info@protesilaos.com> writes:

> The attached patch changes fontification to 'mode-line-emphasis', which
> is a face that is specifically designed for drawing attention to such
> indicators.

I'm not sure why it's useful to draw attention to this bit in the mode
line, though.  Is that something users would find useful to have their
attentions drawn to?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-16 22:20 ` Lars Ingebrigtsen
@ 2020-11-17  5:38   ` Protesilaos Stavrou
  2020-11-17  9:20     ` João Távora
  0 siblings, 1 reply; 10+ messages in thread
From: Protesilaos Stavrou @ 2020-11-17  5:38 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 44689, João Távora

On 2020-11-16, 23:20 +0100, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Protesilaos Stavrou <info@protesilaos.com> writes:
>
>> The attached patch changes fontification to 'mode-line-emphasis', which
>> is a face that is specifically designed for drawing attention to such
>> indicators.
>
> I'm not sure why it's useful to draw attention to this bit in the mode
> line, though.  Is that something users would find useful to have their
> attentions drawn to?

Perhaps João can answer your question (in cc).

The current design draws a lot of attention to itself when the modeline
is inactive, because it inherits the style of the active modeline---so
it gets a box property and a different background.

'mode-line-emphasis' just feels like a more suitable choice for a face,
if emphasis in the mode line is the ultimate goal.  Otherwise I would
personally prefer no face whatsoever.

-- 
Protesilaos Stavrou
protesilaos.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-17  5:38   ` Protesilaos Stavrou
@ 2020-11-17  9:20     ` João Távora
  2020-11-17  9:47       ` Protesilaos Stavrou
  2020-11-24  5:18       ` Lars Ingebrigtsen
  0 siblings, 2 replies; 10+ messages in thread
From: João Távora @ 2020-11-17  9:20 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 44689, Lars Ingebrigtsen

[-- Attachment #1: Type: text/plain, Size: 1601 bytes --]

On Tue, Nov 17, 2020 at 5:38 AM Protesilaos Stavrou <info@protesilaos.com>
wrote:

> > I'm not sure why it's useful to draw attention to this bit in the mode
> > line, though.  Is that something users would find useful to have their
> > attentions drawn to?
>
> Perhaps João can answer your question (in cc).

Thanks. I dunno, really.  That '?' is placed whenever Flymake has
been activated but no suitable backend has been found, or no
backend has been found to answer suitably. This is an abnormal
situation.  It points to some misconfiguration, in principle. Does
that merit "immediate attention"?  I'd say "some attention", but
I'm ignorant of the policy and the associated face here, so I'll leave
this hair-splitting to you, and you have my blessing for choosing
a different face or even no face at all.

> 'mode-line-emphasis' just feels like a more suitable choice for a face,
> if emphasis in the mode line is the ultimate goal.

The ultimate goal is to have Flymake working.  The `?` is something
you or some package you're using has misconfigured.

Lars, this reminds me of a bug report (completely forgot the number),
where the mode-line's indicators would become configurable via some
"format string" mini-language, or something like that.  Maybe we should
take that up again, and maybe abandon the "format string" and make it
use the same kind of language used in mode-line-format itself. Regardless
of the simpler decision in this bug, it should allow, in principle, that
demanding users modify Flymake's mode-line indications to their
liking.

João

[-- Attachment #2: Type: text/html, Size: 2121 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-17  9:20     ` João Távora
@ 2020-11-17  9:47       ` Protesilaos Stavrou
  2020-11-17 16:30         ` João Távora
  2020-11-24  5:18       ` Lars Ingebrigtsen
  1 sibling, 1 reply; 10+ messages in thread
From: Protesilaos Stavrou @ 2020-11-17  9:47 UTC (permalink / raw)
  To: João Távora; +Cc: 44689, Lars Ingebrigtsen

[-- Attachment #1: Type: text/plain, Size: 1221 bytes --]

On 2020-11-17, 09:20 +0000, João Távora <joaotavora@gmail.com> wrote:

>> > I'm not sure why it's useful to draw attention to this bit in the mode
>> > line, though.  Is that something users would find useful to have their
>> > attentions drawn to?
>>
>> Perhaps João can answer your question (in cc).
>
> Thanks. I dunno, really.  That '?' is placed whenever Flymake has
> been activated but no suitable backend has been found, or no
> backend has been found to answer suitably. This is an abnormal
> situation.  It points to some misconfiguration, in principle. Does 
> that merit "immediate attention"?  I'd say "some attention", but 
> I'm ignorant of the policy and the associated face here, so I'll leave
> this hair-splitting to you, and you have my blessing for choosing
> a different face or even no face at all.

While you discuss the rest of the issue with Lars, just to point out
that the "?" is easy to get.

On 'emacs -Q':

    (require 'flymake)
    (setq flymake-start-on-flymake-mode nil)

Now visit an '*.el' file.  Activate 'flymake-mode' and check the
modeline.

Screenshot attached.

Thanks again for your contributions!

-- 
Protesilaos Stavrou
protesilaos.com

[-- Attachment #2: flymake-unknown-backend-emacs-q.png --]
[-- Type: image/png, Size: 79242 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-17  9:47       ` Protesilaos Stavrou
@ 2020-11-17 16:30         ` João Távora
  2020-11-18  5:58           ` Protesilaos Stavrou
  0 siblings, 1 reply; 10+ messages in thread
From: João Távora @ 2020-11-17 16:30 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 44689, Lars Ingebrigtsen

Protesilaos Stavrou <info@protesilaos.com> writes:

> On 2020-11-17, 09:20 +0000, João Távora <joaotavora@gmail.com> wrote:
>
>>> > I'm not sure why it's useful to draw attention to this bit in the mode
>>> > line, though.  Is that something users would find useful to have their
>>> > attentions drawn to?
>>>
>>> Perhaps João can answer your question (in cc).
>>
>> Thanks. I dunno, really.  That '?' is placed whenever Flymake has
>> been activated but no suitable backend has been found, or no
>> backend has been found to answer suitably. This is an abnormal
>> situation.  It points to some misconfiguration, in principle. Does 
>> that merit "immediate attention"?  I'd say "some attention", but 
>> I'm ignorant of the policy and the associated face here, so I'll leave
>> this hair-splitting to you, and you have my blessing for choosing
>> a different face or even no face at all.
>
> While you discuss the rest of the issue with Lars, just to point out
> that the "?" is easy to get.
>
> On 'emacs -Q':
>
>     (require 'flymake)
>     (setq flymake-start-on-flymake-mode nil)
>
> Now visit an '*.el' file.  Activate 'flymake-mode' and check the
> modeline.

Indeed, that's not a misconfiguration.  But I'd say it's an edge case:
normally one does want to start checking when enabling flymake, I just
kept that option there for backward compatibility.  I personally see no
use for it, do you?

João





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-17 16:30         ` João Távora
@ 2020-11-18  5:58           ` Protesilaos Stavrou
  2020-11-18  8:29             ` João Távora
  0 siblings, 1 reply; 10+ messages in thread
From: Protesilaos Stavrou @ 2020-11-18  5:58 UTC (permalink / raw)
  To: João Távora; +Cc: 44689, Lars Ingebrigtsen

On 2020-11-17, 16:30 +0000, João Távora <joaotavora@gmail.com> wrote:

>> [...]
>>
>> just to point out that the "?" is easy to get.
>>
>> On 'emacs -Q':
>>
>>     (require 'flymake)
>>     (setq flymake-start-on-flymake-mode nil)
>>
>> Now visit an '*.el' file.  Activate 'flymake-mode' and check the
>> modeline.
>
> Indeed, that's not a misconfiguration.  But I'd say it's an edge case:
> normally one does want to start checking when enabling flymake, I just
> kept that option there for backward compatibility.  I personally see no
> use for it, do you?

The fact that the option exists means that some people might be using
it.  Is there any immediate downside to keeping it around?  Personally,
I am fine with any decision you may take and agree that it is not what
one would normally expect when activating 'flycheck-mode'.

What I wanted to suggest when I opened this issue is merely this: if
this "edge case" option remains present, please consider reviewing the
face it uses (with 'mode-line-emphasis' being more appropriate than
'mode-line').

-- 
Protesilaos Stavrou
protesilaos.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-18  5:58           ` Protesilaos Stavrou
@ 2020-11-18  8:29             ` João Távora
  2020-11-24  5:23               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: João Távora @ 2020-11-18  8:29 UTC (permalink / raw)
  To: Protesilaos Stavrou; +Cc: 44689, Lars Ingebrigtsen

[-- Attachment #1: Type: text/plain, Size: 1458 bytes --]

On Wed, Nov 18, 2020, 05:58 Protesilaos Stavrou <info@protesilaos.com>
wrote:

> On 2020-11-17, 16:30 +0000, João Távora <joaotavora@gmail.com> wrote:
>
> >> [...]
> >>
> >> just to point out that the "?" is easy to get.
> >>
> >> On 'emacs -Q':
> >>
> >>     (require 'flymake)
> >>     (setq flymake-start-on-flymake-mode nil)
> >>
> >> Now visit an '*.el' file.  Activate 'flymake-mode' and check the
> >> modeline.
> >
> > Indeed, that's not a misconfiguration.  But I'd say it's an edge case:
> > normally one does want to start checking when enabling flymake, I just
> > kept that option there for backward compatibility.  I personally see no
> > use for it, do you?
>
> The fact that the option exists means that some people might be using
> it.  Is there any immediate downside to keeping it around?  Personally,
> I am fine with any decision you may take and agree that it is not what
> one would normally expect when activating 'flycheck-mode'.
>
> What I wanted to suggest when I opened this issue is merely this: if
> this "edge case" option remains present, please consider reviewing the
> face it uses (with 'mode-line-emphasis' being more appropriate than
> 'mode-line').
>

Yes, I am totally fine with changing the face, or using some other
character to indicate this situation. I just don't see it as super priority
because it's an odd setting to have, in my opinion, but patches welcome.

João

>

[-- Attachment #2: Type: text/html, Size: 2296 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-17  9:20     ` João Távora
  2020-11-17  9:47       ` Protesilaos Stavrou
@ 2020-11-24  5:18       ` Lars Ingebrigtsen
  1 sibling, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-24  5:18 UTC (permalink / raw)
  To: João Távora; +Cc: 44689, Protesilaos Stavrou

João Távora <joaotavora@gmail.com> writes:

> Lars, this reminds me of a bug report (completely forgot the number),
> where the mode-line's indicators would become configurable via some 
> "format string" mini-language, or something like that.  Maybe we should 
> take that up again, and maybe abandon the "format string" and make it
> use the same kind of language used in mode-line-format itself.

Yes, it should be possible to basically allow the same customisations,
but have a different "backend" for `format-string' that generates mode
line constructs instead of a propertized string.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend
  2020-11-18  8:29             ` João Távora
@ 2020-11-24  5:23               ` Lars Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-11-24  5:23 UTC (permalink / raw)
  To: João Távora; +Cc: 44689, Protesilaos Stavrou

João Távora <joaotavora@gmail.com> writes:

> Yes, I am totally fine with changing the face, or using some other
> character to indicate this situation. I just don't see it as super
> priority because it's an odd setting to have, in my opinion, but
> patches welcome.

I'm now just removed the face from the "?", which makes it look OK in
both active and inactive windows.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-11-24  5:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 17:17 bug#44689: 28.0.50; Use appropriate face for Flymake unknown backend Protesilaos Stavrou
2020-11-16 22:20 ` Lars Ingebrigtsen
2020-11-17  5:38   ` Protesilaos Stavrou
2020-11-17  9:20     ` João Távora
2020-11-17  9:47       ` Protesilaos Stavrou
2020-11-17 16:30         ` João Távora
2020-11-18  5:58           ` Protesilaos Stavrou
2020-11-18  8:29             ` João Távora
2020-11-24  5:23               ` Lars Ingebrigtsen
2020-11-24  5:18       ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).