Subject: bug#33740: [PATCH] Customizable flymake mode-line indicator

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 19 Sep 2019 17:39:38 +0200

João Távora <[email-masked]> writes:

>  Well, it doesn't quite work yet, so it's a bit premature.  :-)
>
> I see, what's wrong with it? 

I'm not sure -- there's something about the way Emacs renders the minor
mode lighters that doesn't quite preserve the text properties.  That'll
have to be fixed first...  if indeed that's the problem and I'm not just
doing something stupid here somehow.

> But flymake can work with annotations of arbitrary severities with some 
> user-specified meaning. Hence errors, warnings, notes etc are just
> annotations of severities 3, 2, 1, respectively. This was tied to 
> warning-numeric-level, which predates flymake.

Right, I see.  

> So I see "%e" as a shortcut for, say, "%3a" (number of annotations 
> of severity 3), which is no problem imo. "%na" is the thing that could
> be implemented later...

But the problem I see here is that the "unknown" annotations can't
really be specified in the format string and will therefore not be
shown.

If we have

(defvar flymake-mode-line-indicator-format " Flymake%s[%e %w %n]")

then we've enumerated all the annotations the user will ever see, and
new ones won't appear.

So I think specifying it on this detailed level isn't the path to go,
but instead we'll have

(defvar flymake-mode-line-indicator-format " Flymake%s[%a]")

where "%a" is "all the annotations".  I think that's flexible enough --
it doesn't allow the user to change the order of the annotations
individually, but I don't think that's really needed, either...

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