From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#33740: [PATCH] Customizable flymake mode-line indicator Date: Mon, 23 Sep 2019 10:25:32 +0100 Message-ID: References: <87bm4wjhgy.fsf@gmail.com> <87h85bq3u7.fsf@gnus.org> <87lfullo2r.fsf@gnus.org> <877e64jnwl.fsf@gnus.org> <877e622ifu.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000005ba2220593350031" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4946"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 33740@debbugs.gnu.org, Andrii Kolomoiets To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Sep 23 11:26:18 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iCKbo-001870-Tz for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Sep 2019 11:26:17 +0200 Original-Received: from localhost ([::1]:54192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCKbn-0002F8-5T for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Sep 2019 05:26:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55066) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCKbd-0002CX-UG for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 05:26:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCKbc-0001aD-GF for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 05:26:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54488) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCKbc-0001a4-CM for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 05:26:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iCKbZ-0004b0-K3 for bug-gnu-emacs@gnu.org; Mon, 23 Sep 2019 05:26:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Sep 2019 09:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33740 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 33740-submit@debbugs.gnu.org id=B33740.156923074017626 (code B ref 33740); Mon, 23 Sep 2019 09:26:01 +0000 Original-Received: (at 33740) by debbugs.gnu.org; 23 Sep 2019 09:25:40 +0000 Original-Received: from localhost ([127.0.0.1]:35076 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCKbD-0004aE-Iy for submit@debbugs.gnu.org; Mon, 23 Sep 2019 05:25:39 -0400 Original-Received: from mail-io1-f54.google.com ([209.85.166.54]:47054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCKbB-0004a1-QL for 33740@debbugs.gnu.org; Mon, 23 Sep 2019 05:25:38 -0400 Original-Received: by mail-io1-f54.google.com with SMTP id c6so18509345ioo.13 for <33740@debbugs.gnu.org>; Mon, 23 Sep 2019 02:25:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3LRuZC/AlRidN03rPNtjr49I959WWtc8eWsfRnVyxvQ=; b=tuvNqKIUKqqyomS2bxIXBzNgwLh8/MbEZ5EhU/fXvQ3mCJIyek9pvbMlbVJsrEud0+ qutfMxP2R9GGmwee1XcvhuRhkXX7vSQvuy7sJUEILYMuE5axKoqvfhiBbvGXhuLd8cF2 XuY0x8xwEelcAJGjGyba7ycxvU328kiFDtdbXIr6vlcRgnDvtKu+FtpH14WW+Lgoae3x KSdg4TERKLmRo3WIX8M2izlGokZbvJXFP6nJvuT+JoI4l9vP2iKm1a3JKaYcgFl+XfVo AXcn/52E2ZtFc0PzIDgfk2dpploGEHUgc7WA8JSy022ubkvzDGRCEJoCdCir+lCK5/XX q/SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3LRuZC/AlRidN03rPNtjr49I959WWtc8eWsfRnVyxvQ=; b=Md4EB/WQajGhD8ndEo1nUF92dehDlX7ckRXCrGu2jkXWICymOqiX/GEzW0v52qin/T VX0nPTm36IYGyXRG0cSL7icUwXTPynEciA6Z3jPCmolf6hjok+H35eqIf2gxwcFkmJ9O vbGgxT4H7yciSiuZfb+QSJi1ywjz/qBgTvvTOzQI721B4lZXe9AxWdc+WwE1tg9movsH vYyhl+DxV/lp3ydyJ9ufYsU/LbUT279nO72Md4Jk3TaxgRmj3FTCqq8o3IvtcoVJtnmc CdX9ve1S3PlVF/ZyoH5o8xXsqj/hN7kMHerKzOJ7fWOeSfSzS+4S5yuNnRRBXoH8Payr cVxA== X-Gm-Message-State: APjAAAWGy5PGS4ruL/iZ88TpwysDZNSD63Kn9sfHli1hjZd8JFBMcGB5 eWbMX8D4IAI4x8jEd/lEpNcAImctzaSTZESPTjdjEw== X-Google-Smtp-Source: APXvYqztYoCMtMIP8DEYyH7PGnKuaooYOCDkF7pWyLlUw6P8/sIZ3Vc7gZ3F59ewFI9VDKeOH1toW/Ic6heIoLmLlb0= X-Received: by 2002:a6b:c38f:: with SMTP id t137mr15702425iof.137.1569230732106; Mon, 23 Sep 2019 02:25:32 -0700 (PDT) In-Reply-To: <877e622ifu.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:166971 Archived-At: --0000000000005ba2220593350031 Content-Type: text/plain; charset="UTF-8" On Sat, Sep 21, 2019 at 8:54 AM Lars Ingebrigtsen wrote: > > work... And perhaps that's a more logical place, anyway? > Yup. > 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... > Fine with me. > > 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... > It's really "all the annotations for which you selected a non-standard severity", but they can be of many types. So the use case for this might be smaller than you think. Also, one reason I can think of for selecting a non-standard severity for your custom diagnostic type might be precisely to hide it from the mode-line. And if 'format-spec' is ever enhanced to allow numeric stuff, then we can fine tune %a into something like %a or something. > We should also do something about whitespace. I lean towards > > somehow(TM) munching whitespace so that "Flymake[%!e %!w %n]" > > becomes "Flymake[42 42]" if there are 0 notes. > > > > Hope this isn't becoming very complicated. > > Only slightly. :-) But is it complicated enough? :-) --0000000000005ba2220593350031 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Sat, Sep 21, 2019 at 8:54 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:

work...=C2=A0 And perhaps that's a more logical place, anyway?

Yup.

> 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 wo= rk...

Fine with me.
=C2= =A0
> 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".=C2= =A0 Or something
> like that.

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

It&#= 39;s really "all the annotations for which you selected a non-standard=
severity", but they can be of many types. So the use c= ase for this might
be smaller than you think.=C2=A0 Also, one rea= son I can think of for selecting
a non-standard severity for= your custom diagnostic type might be precisely
to hide it f= rom the mode-line.

And if 'format-spec' is= ever enhanced to allow numeric stuff, then we can
fine tune= %a into something like %<integer>a or something.

=
> We should also do something about whitespace.=C2=A0 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.=C2=A0 :-)

But is it co= mplicated enough? :-)
--0000000000005ba2220593350031--