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

From: Lars Ingebrigtsen <[email-masked]>
Date: Sat, 21 Sep 2019 09:54:13 +0200

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

> On Thu, Sep 19, 2019 at 4:39 PM Lars Ingebrigtsen <[email-masked]> wrote:
>
>  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.
>
> OK. And this is what you're discussing with Eli in the side thread, I suppose. 

Yes, and it doesn't seem like looks very positively on the possibility
of allowing the minor mode lighters of being strings with text
properties, so my suggested rewrite is a no-go.  But if we move the
status from the minor mode lighter to mode-line-process, then it'd
work...  And perhaps that's a more logical place, anyway?

> Currently, notes (diagnostics of severity 1) are only shown in the mode-line
> summary if they total >= 0. This is hardcoded, but the behaviour should be
> configurable, too.
>
> So, along with "%e" we should probably have something like "%!e". The 
> former would mean "replace with number of errors if this number is greater 
> than 0", the latter being "replace with number of errors, even if 0".
>
> The default value for the proposed defcustom would be
>
> "Flymake[%!e %!w %n]"

`format-spec' doesn't allow two-character specs, but %E/%e would work...

> which mirrors the current behaviour. Now, supposing there are some
> new annotations with arbitrary severities, we could use the non-! form
> to include them and keep the default value working. Maybe "%>e" 
> could mean "put all annotations more severe than 3 here".  Or something
> like that.

Having a spec for "all the rest of the annotations" is possible, but
seems a bit odd, interface wise...

> We should also do something about whitespace.  I lean towards 
> somehow(TM) munching whitespace so that "Flymake[%!e %!w %n]"
> becomes "Flymake[42 42<no whitespace here>]" if there are 0 notes.
>
> Hope this isn't becoming very complicated.

Only slightly.  :-)

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