unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 33740@debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad@gmail.com>
Subject: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 20 Sep 2019 14:07:30 +0100	[thread overview]
Message-ID: <CALDnm52tVXh=s0dNWbyPZOM7Gqe2OLE80Zyj2Hy_NmpCF+n9Lw@mail.gmail.com> (raw)
In-Reply-To: <877e64jnwl.fsf@gnus.org>

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

On Thu, Sep 19, 2019 at 4:39 PM Lars Ingebrigtsen <larsi@gnus.org> 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.


> > 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.
>

...unless he sets flymake-mode-line-indicator-format buffer-locally
or globally or something.

And to be clear, he may not see them _summarized_ in the mode line,
which is not the same as saying he is not seeing them.

I think using non-standard severities should be possible
(that's why I added them), but reasonably rare, so I think the extra effort
of
changing flymake-mode-line-indicator-format for those cases is in
proportion.

But read to the end of the mail for another idea.

it doesn't allow the user to change the order of the annotations
> individually, but I don't think that's really needed, either...


On the contrary, I think this is what is requested. Not only change
the order,  but the display paraphernalia around it, for mode-line
loving users.

There is something that we might be forgetting, and which might bridge the
gap between our views.

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]"

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.

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.

João.

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

  reply	other threads:[~2019-09-20 13:07 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14  9:19 bug#33740: [PATCH] Customizable flymake mode-line indicator Andrii Kolomoiets
2019-01-04 20:27 ` João Távora
2019-06-22 14:15   ` Štěpán Němec
2019-09-16 22:22   ` Lars Ingebrigtsen
2019-09-17  6:09     ` Eli Zaretskii
2019-09-17 11:57       ` Lars Ingebrigtsen
2019-09-17 12:13         ` Eli Zaretskii
2019-09-17 12:22           ` Lars Ingebrigtsen
2019-09-17 12:44             ` Eli Zaretskii
2019-09-18 13:38               ` Lars Ingebrigtsen
2019-09-18 14:09                 ` Lars Ingebrigtsen
2019-09-19 15:28                   ` Lars Ingebrigtsen
2019-09-19 15:55                     ` Lars Ingebrigtsen
2019-09-19 16:23                       ` Lars Ingebrigtsen
2019-09-19 17:26                         ` Eli Zaretskii
2019-09-20 12:32                           ` Lars Ingebrigtsen
2019-09-20 13:06                             ` Eli Zaretskii
2019-09-20 13:13                               ` Lars Ingebrigtsen
2019-09-17 14:07     ` João Távora
2019-09-18 13:40       ` Lars Ingebrigtsen
2019-09-18 13:59         ` João Távora
2019-09-19 15:39           ` Lars Ingebrigtsen
2019-09-20 13:07             ` João Távora [this message]
2019-09-21  7:54               ` Lars Ingebrigtsen
2019-09-22 20:55                 ` Juri Linkov
2019-09-23  9:18                   ` João Távora
2019-09-23 18:10                     ` Lars Ingebrigtsen
2019-09-23  9:25                 ` João Távora
2019-09-23 18:11                   ` Lars Ingebrigtsen
2019-09-18 14:02         ` Noam Postavsky
2020-12-29  2:12   ` Lars Ingebrigtsen
2020-12-29  2:19     ` Lars Ingebrigtsen
2020-12-29 13:52       ` João Távora
2020-12-29 14:14         ` Lars Ingebrigtsen
2020-12-29 14:18       ` João Távora
2020-12-29 14:22         ` Lars Ingebrigtsen
2020-12-29 15:13           ` João Távora
2020-12-30  3:22             ` Lars Ingebrigtsen
2020-12-30  9:28               ` João Távora
2020-12-30 20:16                 ` Eli Zaretskii
2020-12-30 21:13                   ` João Távora
2020-12-31 14:05                     ` João Távora
2021-01-01 10:56                       ` Lars Ingebrigtsen
2021-01-02 11:27                         ` João Távora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CALDnm52tVXh=s0dNWbyPZOM7Gqe2OLE80Zyj2Hy_NmpCF+n9Lw@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=33740@debbugs.gnu.org \
    --cc=andreyk.mad@gmail.com \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).