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

From: João Távora <[email-masked]>
Date: Fri, 04 Jan 2019 20:27:57 +0000

Andrii Kolomoiets <[email-masked]> writes:

> Hi,
>
> I would like to hide Flymake label in mode line leaving just counters.
>
> Customizable mode line indicator like in this patch can solve my issue
> and can help to those wanting to keep their mode line cleaner.
>
>
> diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
> index 7b100da..477abdd 100644
> --- a/lisp/progmodes/flymake.el
> +++ b/lisp/progmodes/flymake.el
> @@ -220,6 +220,10 @@ Specifically, start it when the saved buffer is actually displayed."
>    :version "26.1"
>    :type 'boolean)
>
> +(defcustom flymake-mode-line-indicator "Flymake"
> +  "Mode label in mode-line."
> +  :type 'string)
> +
> (when (fboundp 'define-fringe-bitmap)
>    (define-fringe-bitmap 'flymake-double-exclamation-mark
>      (vector #b00000000
> @@ -1152,7 +1156,7 @@ default) no filter is applied."
>                                        diags-by-type)))
>                       (flymake--backend-state-diags state)))
>               flymake--backend-state)
> -    `((:propertize " Flymake"
> +    `((:propertize ,(format " %s" flymake-mode-line-indicator)
>                     mouse-face mode-line-highlight
>                     help-echo
>                     ,(concat (format "%s known backends\n" (length known))

Looks good, though I would prefer if the defcustom was a format-string
where %s would be substituted by the error counts.  That way you could
even get rid of the braces or use something else.

João