GNU bug report logs - #33740
[PATCH] Customizable flymake mode-line indicator

Previous Next

Package: emacs;

Reported by: Andrii Kolomoiets <andreyk.mad <at> gmail.com>

Date: Fri, 14 Dec 2018 09:21:01 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33740 in the body.
You can then email your comments to 33740 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Fri, 14 Dec 2018 09:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Andrii Kolomoiets <andreyk.mad <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 Dec 2018 09:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 14 Dec 2018 11:19:31 +0200
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))



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Fri, 04 Jan 2019 20:29:02 GMT) Full text and rfc822 format available.

Message #8 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 04 Jan 2019 20:27:57 +0000
Andrii Kolomoiets <andreyk.mad <at> gmail.com> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Sat, 22 Jun 2019 14:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Štěpán Němec <stepnem <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Sat, 22 Jun 2019 16:15:50 +0200
Could we have a fix for this installed already, please?

-- 
Štěpán




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Mon, 16 Sep 2019 22:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 17 Sep 2019 00:22:08 +0200
João Távora <joaotavora <at> gmail.com> writes:

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

Below is a proof-of-this-concept-not-working when done via the normal
format-spec machinery.  :-)

I thought we could just put text properties on strings we feed to the
mode-line machinery, but it seems like these don't survive?  Do I
remember vaguely there being a long-running bug report about that
problem?  I thought it had been fixed by now.

Anybody remember?

diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el
index 6d47c8bb17..00c941ca5d 100644
--- a/lisp/progmodes/flymake.el
+++ b/lisp/progmodes/flymake.el
@@ -1166,6 +1166,15 @@ flymake--mode-line-format
 
 (put 'flymake--mode-line-format 'risky-local-variable t)
 
+(defcustom flymake-mode-line-indicator-format " Flymake%s[%e %w %n]"
+  "Format to use for the Flymake mode line indicator.
+The following format characters can be used:
+
+%s: The status.
+%e: The number of errors.
+%w: The number of warnings.
+%n: The number of notes."
+  :type 'string)
 
 (defun flymake--mode-line-format ()
   "Produce a pretty minor mode indicator."
@@ -1183,71 +1192,74 @@ flymake--mode-line-format
                                       diags-by-type)))
                      (flymake--backend-state-diags state)))
              flymake--backend-state)
-    `((:propertize " Flymake"
-                   mouse-face mode-line-highlight
-                   help-echo
-                   ,(concat (format "%s known backends\n" (length known))
-                            (format "%s running\n" (length running))
-                            (format "%s disabled\n" (length disabled))
-                            "mouse-1: Display minor mode menu\n"
-                            "mouse-2: Show help for minor mode")
-                   keymap
-                   ,(let ((map (make-sparse-keymap)))
-                      (define-key map [mode-line down-mouse-1]
-                        flymake-menu)
-                      (define-key map [mode-line mouse-2]
-                        (lambda ()
-                          (interactive)
-                          (describe-function 'flymake-mode)))
-                      map))
-      ,@(pcase-let ((`(,ind ,face ,explain)
-                     (cond ((null known)
-                            '("?" mode-line "No known backends"))
-                           (some-waiting
-                            `("Wait" compilation-mode-line-run
-                              ,(format "Waiting for %s running backend(s)"
-                                       (length some-waiting))))
-                           (all-disabled
-                            '("!" compilation-mode-line-run
-                              "All backends disabled"))
-                           (t
-                            '(nil nil nil)))))
-          (when ind
-            `((":"
-               (:propertize ,ind
-                            face ,face
-                            help-echo ,explain
-                            keymap
-                            ,(let ((map (make-sparse-keymap)))
-                               (define-key map [mode-line mouse-1]
-                                 'flymake-switch-to-log-buffer)
-                               map))))))
-      ,@(unless (or all-disabled
-                    (null known))
-          (cl-loop
-           with types = (hash-table-keys diags-by-type)
-           with _augmented = (cl-loop for extra in '(:error :warning)
-                                      do (cl-pushnew extra types
-                                                     :key #'flymake--severity))
-           for type in (cl-sort types #'> :key #'flymake--severity)
-           for diags = (gethash type diags-by-type)
-           for face = (flymake--lookup-type-property type
-                                                     'mode-line-face
-                                                     'compilation-error)
-           when (or diags
-                    (cond ((eq flymake-suppress-zero-counters t)
-                           nil)
-                          (flymake-suppress-zero-counters
-                           (>= (flymake--severity type)
-                               (warning-numeric-level
-                                flymake-suppress-zero-counters)))
-                          (t t)))
-           collect `(:propertize
-                     ,(format "%d" (length diags))
-                     face ,face
-                     mouse-face mode-line-highlight
-                     keymap
-                     ,(let ((map (make-sparse-keymap))
+    (format-spec
+     (propertize flymake-mode-line-indicator-format
+                 'mouse-face 'mode-line-highlight
+                 'help-echo
+                 (concat (format "%s known backends\n" (length known))
+                         (format "%s running\n" (length running))
+                         (format "%s disabled\n" (length disabled))
+                         "mouse-1: Display minor mode menu\n"
+                         "mouse-2: Show help for minor mode")
+                 'keymap
+                 (let ((map (make-sparse-keymap)))
+                   (define-key map [mode-line down-mouse-1]
+                     flymake-menu)
+                   (define-key map [mode-line mouse-2]
+                     (lambda ()
+                       (interactive)
+                       (describe-function 'flymake-mode)))
+                   map))
+     (cons
+      (cons ?s (cl-destructuring-bind
+                   (ind face explain)
+                   (cond ((null known)
+                          '("?" mode-line "No known backends"))
+                         (some-waiting
+                          `("Wait" compilation-mode-line-run
+                            ,(format "Waiting for %s running backend(s)"
+                                     (length some-waiting))))
+                         (all-disabled
+                          '("!" compilation-mode-line-run
+                            "All backends disabled"))
+                         (t
+                          '(nil nil nil)))
+                 (when ind
+                   (concat
+                    ":"
+                    (propertize ind
+                                'face face
+                                'help-echo explain
+                                'keymap
+                                (let ((map (make-sparse-keymap)))
+                                  (define-key map [mode-line mouse-1]
+                                    'flymake-switch-to-log-buffer)
+                                  map))))))
+      (cl-loop
+       with types = (hash-table-keys diags-by-type)
+       with _augmented = (cl-loop for extra in '(:error :warning)
+                                  do (cl-pushnew extra types
+                                                 :key #'flymake--severity))
+       for type in (cl-sort types #'> :key #'flymake--severity)
+       for diags = (gethash type diags-by-type)
+       for face = (flymake--lookup-type-property type
+                                                 'mode-line-face
+                                                 'compilation-error)
+       when (or diags
+                (cond ((eq flymake-suppress-zero-counters t)
+                       nil)
+                      (flymake-suppress-zero-counters
+                       (>= (flymake--severity type)
+                           (warning-numeric-level
+                            flymake-suppress-zero-counters)))
+                      (t t)))
+       collect (cons (elt (format "%s" type) 1)
+                     (propertize
+                      (format "%d" (length diags))
+                      'face face
+                      'mouse-face 'mode-line-highlight
+                      'keymap
+                      (let ((map (make-sparse-keymap))
                             (type type))
                         (define-key map (vector 'mode-line
                                                 mouse-wheel-down-event)
@@ -1262,8 +1274,8 @@ flymake--mode-line-format
                             (with-selected-window (posn-window (event-start event))
                               (flymake-goto-next-error 1 (list type) t))))
                         map)
-                     help-echo
-                     ,(concat (format "%s diagnostics of type %s\n"
+                      'help-echo
+                      (concat (format "%s diagnostics of type %s\n"
                                       (propertize (format "%d"
                                                           (length diags))
                                                   'face face)
@@ -1271,14 +1283,7 @@ flymake--mode-line-format
                                                   'face face))
                               (format "%s/%s: previous/next of this type"
                                       mouse-wheel-down-event
-                                      mouse-wheel-up-event)))
-           into forms
-           finally return
-           `((:propertize "[")
-             ,@(cl-loop for (a . rest) on forms by #'cdr
-                        collect a when rest collect
-                        '(:propertize " "))
-             (:propertize "]")))))))
+                                      mouse-wheel-up-event)))))))))
 
 ;;; Diagnostics buffer
 

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 17 Sep 2019 06:10:02 GMT) Full text and rfc822 format available.

Message #17 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 17 Sep 2019 09:09:14 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Tue, 17 Sep 2019 00:22:08 +0200
> Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
> 
> I thought we could just put text properties on strings we feed to the
> mode-line machinery, but it seems like these don't survive?

You need to do it "wisely", then they do survive.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 17 Sep 2019 11:58:02 GMT) Full text and rfc822 format available.

Message #20 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 17 Sep 2019 13:57:34 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I thought we could just put text properties on strings we feed to the
>> mode-line machinery, but it seems like these don't survive?
>
> You need to do it "wisely", then they do survive.

What does the wisdom entail?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 17 Sep 2019 12:14:01 GMT) Full text and rfc822 format available.

Message #23 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 17 Sep 2019 15:13:37 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: joaotavora <at> gmail.com,  33740 <at> debbugs.gnu.org,  andreyk.mad <at> gmail.com
> Date: Tue, 17 Sep 2019 13:57:34 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> I thought we could just put text properties on strings we feed to the
> >> mode-line machinery, but it seems like these don't survive?
> >
> > You need to do it "wisely", then they do survive.
> 
> What does the wisdom entail?

Apply the properties judiciously to specific parts of the mode-line
string, not wholesale to all of it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 17 Sep 2019 12:23:01 GMT) Full text and rfc822 format available.

Message #26 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 17 Sep 2019 14:22:27 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Apply the properties judiciously to specific parts of the mode-line
> string, not wholesale to all of it.

That's what I did (or tried to do).  I basically made the function
return something like

(concat "foo" (propertize "bar" 'face 'bold) "zot")

but the "bar" remained non-bold in the mode line.  If that's supposed to
work, then there's something else wrong with my code, I guess?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 17 Sep 2019 12:45:02 GMT) Full text and rfc822 format available.

Message #29 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 17 Sep 2019 15:44:30 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: joaotavora <at> gmail.com,  33740 <at> debbugs.gnu.org,  andreyk.mad <at> gmail.com
> Date: Tue, 17 Sep 2019 14:22:27 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Apply the properties judiciously to specific parts of the mode-line
> > string, not wholesale to all of it.
> 
> That's what I did (or tried to do).  I basically made the function
> return something like
> 
> (concat "foo" (propertize "bar" 'face 'bold) "zot")
> 
> but the "bar" remained non-bold in the mode line.  If that's supposed to
> work, then there's something else wrong with my code, I guess?

Most probably, but a bare-bones minimal Lisp to run and investigate
will be appreciated.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 17 Sep 2019 14:09:01 GMT) Full text and rfc822 format available.

Message #32 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 17 Sep 2019 15:07:59 +0100
[Message part 1 (text/plain, inline)]
On Mon, Sep 16, 2019 at 11:22 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> João Távora <joaotavora <at> gmail.com> writes:
>
> > 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.
>
> Below is a proof-of-this-concept-not-working when done via the normal
> format-spec machinery.  :-)
>

Thanks, Lars.  I'm away from my emacs dev machine so I can't read
the diff very carefully, but if you want to risk it, go ahead and push,
because I
like the defcustom spec and I see you've kept the default. A short entry
in NEWS and the Flymake manual is probably worth it (but you can skip
the latter).

There are arbitrary errors levels in this flymake (not just error warning
and note). But those are the main ones and anyway we can always
add more format machinery later.

I see a lot of changed lines, but most of them are probably whitespace.
Is there some diff format which elides those?

João
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 18 Sep 2019 13:39:02 GMT) Full text and rfc822 format available.

Message #35 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 18 Sep 2019 15:38:17 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> Most probably, but a bare-bones minimal Lisp to run and investigate
> will be appreciated.

Here's a simple one:

(setq my-format (concat " foo " (propertize " bar " 'face 'bold) " zot "))
(setq mode-line-format (append mode-line-format (list 'my-format)))

I get " foo bar zot " at the end of the mode line without any faces.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 18 Sep 2019 13:41:02 GMT) Full text and rfc822 format available.

Message #38 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 18 Sep 2019 15:40:44 +0200
João Távora <joaotavora <at> gmail.com> writes:

> Thanks, Lars.  I'm away from my emacs dev machine so I can't read the
> diff very carefully, but if you want to risk it, go ahead and push,
> because I like the defcustom spec and I see you've kept the default. A
> short entry in NEWS and the Flymake manual is probably worth it (but
> you can skip the latter).

Well, it doesn't quite work yet, so it's a bit premature.  :-)

> There are arbitrary errors levels in this flymake (not just error warning 
> and note). But those are the main ones and anyway we can always
> add more format machinery later.

Hm, is there a list of all the error levels?  If not, I think the
approach I took in the patch is probably misguided (what with %e for
"error" and stuff).  

> I see a lot of changed lines, but most of them are probably whitespace.

Yes, it's mostly whitespace due to rearranging the way the strings are
computed.

> Is there some diff format which elides those?

I'm not sure?

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 18 Sep 2019 14:00:02 GMT) Full text and rfc822 format available.

Message #41 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 18 Sep 2019 14:59:08 +0100
[Message part 1 (text/plain, inline)]
On Wed, Sep 18, 2019 at 2:40 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:

> João Távora <joaotavora <at> gmail.com> writes:
>
> > Thanks, Lars.  I'm away from my emacs dev machine so I can't read the
> > diff very carefully, but if you want to risk it, go ahead and push,
> > because I like the defcustom spec and I see you've kept the default. A
> > short entry in NEWS and the Flymake manual is probably worth it (but
> > you can skip the latter).
>
> Well, it doesn't quite work yet, so it's a bit premature.  :-)
>

I see, what's wrong with it?


> > There are arbitrary errors levels in this flymake (not just error
> warning
> > and note). But those are the main ones and anyway we can always
> > add more format machinery later.
>
> Hm, is there a list of all the error levels?  If not, I think the
> approach I took in the patch is probably misguided (what with %e for
> "error" and stuff).
>

There isn't a list of error levels, there are just severities. There are
some built-in flymake _categories_ linked to the symbols :error, :warning
and
:note that connect these symbols with some preset severity.

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.

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


> > I see a lot of changed lines, but most of them are probably whitespace.
>
> Yes, it's mostly whitespace due to rearranging the way the strings are
> computed.
>
> > Is there some diff format which elides those?
>
> I'm not sure?
>

I think git diff -w does something to that effect.

João Távora
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 18 Sep 2019 14:04:01 GMT) Full text and rfc822 format available.

Message #44 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org,
 João Távora <joaotavora <at> gmail.com>,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 18 Sep 2019 10:02:53 -0400
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Yes, it's mostly whitespace due to rearranging the way the strings are
> computed.
>
>> Is there some diff format which elides those?
>
> I'm not sure?

You can pass --ignore-all-space (aka -w) to git diff (although the
result might not work for git apply).

https://git-scm.com/docs/git-diff#Documentation/git-diff.txt--w




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 18 Sep 2019 14:10:03 GMT) Full text and rfc822 format available.

Message #47 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 18 Sep 2019 16:09:12 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Eli Zaretskii <eliz <at> gnu.org> writes:
>
>> Most probably, but a bare-bones minimal Lisp to run and investigate
>> will be appreciated.
>
> Here's a simple one:
>
> (setq my-format (concat " foo " (propertize " bar " 'face 'bold) " zot "))
> (setq mode-line-format (append mode-line-format (list 'my-format)))
>
> I get " foo bar zot " at the end of the mode line without any faces.

I did something as radical as actually reading the doc string to
mode-line-format, and doing this

(put 'my-format 'risky-local-variable t)

makes this work as expected.  Then I guess I can proceed with the
original flymake feature implementation.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Thu, 19 Sep 2019 15:29:02 GMT) Full text and rfc822 format available.

Message #50 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 19 Sep 2019 17:28:40 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I did something as radical as actually reading the doc string to
> mode-line-format, and doing this
>
> (put 'my-format 'risky-local-variable t)
>
> makes this work as expected.  Then I guess I can proceed with the
> original flymake feature implementation.

But... no.

As a test case, go to any .el file in Emacs and say `M-x flymake-mode',
and you'll get a lighter in the minor modes in the mode lines saying
something like " Flymake[0 3 17]" or whatever.

Then try this:

(setq flymake--mode-line-format (concat (propertize " bar " 'face 'bold) "foo"))

Both "bar" and "foo" will be bold in the mode line.

(setq flymake--mode-line-format (concat "foo" (propertize " bar " 'face 'bold)))

Neither "foo" nor "bar" will be bold.

So it seems like whatever is computing the mode line is somehow copying
the faces from the first character in the lighter string and applies
them to the entire lighter?  Very confusing.

This does not happen outside of the minor modes in the mode line (i.e.,
if I add an element outside of the minor modes, text properties are not
overwritten this way).

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Thu, 19 Sep 2019 15:40:01 GMT) Full text and rfc822 format available.

Message #53 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 19 Sep 2019 17:39:38 +0200
João Távora <joaotavora <at> gmail.com> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Thu, 19 Sep 2019 15:56:01 GMT) Full text and rfc822 format available.

Message #56 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 19 Sep 2019 17:55:00 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Then try this:
>
> (setq flymake--mode-line-format (concat (propertize " bar " 'face 'bold) "foo"))
>
> Both "bar" and "foo" will be bold in the mode line.

I...  think I know why this is happening.

Mixing the two ways of specifying text properties isn't really allowed.

`mode-line-modes' has this:

 (:propertize
  ("" minor-mode-alist)
  mouse-face mode-line-highlight help-echo "Minor mode\nmouse-1: Display minor m
  ...

display_mode_element does this for strings:

	    Lisp_Object oprops, aelt;
	    oprops = Ftext_properties_at (make_fixnum (0), elt);

	    /* If the starting string's properties are not what
	       we want, translate the string.  Also, if the string
	       is risky, do that anyway.  */

	    if (NILP (Fequal (props, oprops)) || risky)
	      {
		/* If the starting string has properties,
		   merge the specified ones onto the existing ones.  */
		if (! NILP (oprops) && !risky)

So we basically do exactly what I was seeing -- overwrite the entire
string's text properties with the text property in the first character
of the string.

But!

This is only done if the string is inside a (:propertize ...) clause,
because this is only done of props is passed in, which (if I read the
code correctly) only happens if that's done.

But the code in that function could be clearer -- I don't really
understand why this is done at all.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Thu, 19 Sep 2019 16:24:01 GMT) Full text and rfc822 format available.

Message #59 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 19 Sep 2019 18:23:01 +0200
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> But the code in that function could be clearer -- I don't really
> understand why this is done at all.

		aelt = Fassoc (elt, mode_line_proptrans_alist, Qnil);
		if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt))))
		  {
		    /* AELT is what we want.  Move it to the front
		       without consing.  */
		    elt = XCAR (aelt);
		    mode_line_proptrans_alist
		      = move_elt_to_front (aelt, mode_line_proptrans_alist);
		  }
		else
		  {
		    Lisp_Object tem;

		    /* If AELT has the wrong props, it is useless.
		       so get rid of it.  */


Oh, this entire thing is just so that we can maintain a cache of text
properties and avoid some consing?  And if we have a cache, then all the
characters in the element has to have the same text properties.  I
wonder whether all this is really warranted...

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Thu, 19 Sep 2019 17:27:02 GMT) Full text and rfc822 format available.

Message #62 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 19 Sep 2019 20:26:17 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: 33740 <at> debbugs.gnu.org,  joaotavora <at> gmail.com,  andreyk.mad <at> gmail.com
> Date: Thu, 19 Sep 2019 18:23:01 +0200
> 
> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> 
> > But the code in that function could be clearer -- I don't really
> > understand why this is done at all.
> 
> 		aelt = Fassoc (elt, mode_line_proptrans_alist, Qnil);
> 		if (! NILP (aelt) && !NILP (Fequal (props, XCDR (aelt))))
> 		  {
> 		    /* AELT is what we want.  Move it to the front
> 		       without consing.  */
> 		    elt = XCAR (aelt);
> 		    mode_line_proptrans_alist
> 		      = move_elt_to_front (aelt, mode_line_proptrans_alist);
> 		  }
> 		else
> 		  {
> 		    Lisp_Object tem;
> 
> 		    /* If AELT has the wrong props, it is useless.
> 		       so get rid of it.  */
> 
> 
> Oh, this entire thing is just so that we can maintain a cache of text
> properties and avoid some consing?  And if we have a cache, then all the
> characters in the element has to have the same text properties.

Yes.

> I wonder whether all this is really warranted...

It is.  Redrawing the mode line is a very frequent redisplay thing, so
optimizing the heck out of it is justified.

That's what I meant when I said "wisely": you need to create faces in
advance, and take care to have each individual string you use to be of
a uniform face.  And don't use propertize.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Fri, 20 Sep 2019 12:33:01 GMT) Full text and rfc822 format available.

Message #65 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 20 Sep 2019 14:32:00 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> It is.  Redrawing the mode line is a very frequent redisplay thing, so
> optimizing the heck out of it is justified.

In the simple case where the mode line element is a string, I can
definitely see that it's warranted.  In the Flymake case, where the
value is (:eval (flymake--mode-line-format)), which returns a long and
complex (:propertize) form that's then interpreted by this machinery --
it's pessimal.

> That's what I meant when I said "wisely": you need to create faces in
> advance, and take care to have each individual string you use to be of
> a uniform face.  And don't use propertize.

Most modes do not have dynamic lighters, and using (:propertize) forms
is a fine solution.  For something like Flymake, that updates its
lighter every time the mode line is redrawn, it just doesn't make much
sense.  If Flymake could just return a properly propertized string, then
that would be a lot more efficient (both cons-wise and time wise) having
it return this form (which I've lightly edited to elide the keymaps):

((:propertize " Flymake" mouse-face mode-line-highlight help-echo "3 known backends\n2 running\n1 disabled\nmouse-1: Display minor mode menu\nmouse-2: Show help for minor mode" keymap ...)
 (:propertize "[")
 (:propertize "0" face compilation-error mouse-face mode-line-highlight keymap ..
	      help-echo
	      #("0 diagnostics of type :error\nmouse-4/mouse-5: previous/next of this type" 0 1
		(face compilation-error)
		22 28
		(face compilation-error)))
 (:propertize " ")
 (:propertize "0" face compilation-warning mouse-face mode-line-highlight keymap ...
	      help-echo
	      #("0 diagnostics of type :warning\nmouse-4/mouse-5: previous/next of this type" 0 1
		(face compilation-warning)
		22 30
		(face compilation-warning)))
 (:propertize " ")
 (:propertize "14" face compilation-info mouse-face mode-line-highlight keymap ...
	      help-echo
	      #("14 diagnostics of type :note\nmouse-4/mouse-5: previous/next of this type" 0 2
		(face compilation-info)
		23 28
		(face compilation-info)))
 (:propertize "]"))

If there was a way to tell display_mode_element "don't do the caching
stuff on this element", then Flymake could just return a propertized
string and display_mode_element would have to do a whole lot less
processing.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Fri, 20 Sep 2019 13:07:01 GMT) Full text and rfc822 format available.

Message #68 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 20 Sep 2019 16:06:36 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Cc: 33740 <at> debbugs.gnu.org,  joaotavora <at> gmail.com,  andreyk.mad <at> gmail.com
> Date: Fri, 20 Sep 2019 14:32:00 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > It is.  Redrawing the mode line is a very frequent redisplay thing, so
> > optimizing the heck out of it is justified.
> 
> In the simple case where the mode line element is a string, I can
> definitely see that it's warranted.  In the Flymake case, where the
> value is (:eval (flymake--mode-line-format)), which returns a long and
> complex (:propertize) form that's then interpreted by this machinery --
> it's pessimal.

No, it isn't.  If I'm not mistaken, we have bug reports regarding
flickering of mode lines, including under Flymake.

If we want to have a richer set of indicators for Flymake, may I
suggest considering alternative methods of indicating stuff, and
leaving the poor-old crammed mode line alone?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Fri, 20 Sep 2019 13:08:02 GMT) Full text and rfc822 format available.

Message #71 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 20 Sep 2019 14:07:30 +0100
[Message part 1 (text/plain, inline)]
On Thu, Sep 19, 2019 at 4:39 PM Lars Ingebrigtsen <larsi <at> 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.
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Fri, 20 Sep 2019 13:14:01 GMT) Full text and rfc822 format available.

Message #74 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 33740 <at> debbugs.gnu.org, joaotavora <at> gmail.com, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 20 Sep 2019 15:13:21 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

> If we want to have a richer set of indicators for Flymake, may I
> suggest considering alternative methods of indicating stuff, and
> leaving the poor-old crammed mode line alone?

No, we don't want a richer set of indicators -- a user requested being
allowed to customise it (to remove stuff from it), and I tried to do
that via the `format-spec' machinery.

But that can't be used, since display_mode_element requires us to return
a complex list that it re-interprets instead of being able to just give
it a string that it'll display.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Sat, 21 Sep 2019 07:55:01 GMT) Full text and rfc822 format available.

Message #77 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Sat, 21 Sep 2019 09:54:13 +0200
João Távora <joaotavora <at> gmail.com> writes:

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

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Sun, 22 Sep 2019 21:10:02 GMT) Full text and rfc822 format available.

Message #80 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org,
 João Távora <joaotavora <at> gmail.com>,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Sun, 22 Sep 2019 23:55:07 +0300
> 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?

A more logical place would be in the same place where errors
are displayed by compilation-mode, i.e. mode-line-process indeed.
From compile.el:

              (setq mode-line-process
                    '((:propertize ":%s" face compilation-mode-line-run)
                      compilation-mode-line-errors))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Mon, 23 Sep 2019 09:19:01 GMT) Full text and rfc822 format available.

Message #83 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 33740 <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Mon, 23 Sep 2019 10:18:30 +0100
[Message part 1 (text/plain, inline)]
On Sun, Sep 22, 2019 at 10:09 PM Juri Linkov <juri <at> linkov.net> wrote:

> > 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?
>
> A more logical place would be in the same place where errors
> are displayed by compilation-mode, i.e. mode-line-process indeed.
>

+1 from me, no objections.  Indeed flymake is a kind of incremental
compilation, so it makes perfect sense... not least because I can't
possibly see the need of ever enabling flymake in a compilation-mode
buffer (but this is Emacs so I probably should shut up now...)

João
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Mon, 23 Sep 2019 09:26:01 GMT) Full text and rfc822 format available.

Message #86 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Mon, 23 Sep 2019 10:25:32 +0100
[Message part 1 (text/plain, inline)]
On Sat, Sep 21, 2019 at 8:54 AM Lars Ingebrigtsen <larsi <at> gnus.org> 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 %<integer>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<no whitespace here>]" if there are 0 notes.
> >
> > Hope this isn't becoming very complicated.
>
> Only slightly.  :-)


But is it complicated enough? :-)
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Mon, 23 Sep 2019 18:11:02 GMT) Full text and rfc822 format available.

Message #89 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>,
 Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Mon, 23 Sep 2019 20:10:53 +0200
João Távora <joaotavora <at> gmail.com> writes:

> +1 from me, no objections.  Indeed flymake is a kind of incremental 
> compilation, so it makes perfect sense... not least because I can't 
> possibly see the need of ever enabling flymake in a compilation-mode 
> buffer (but this is Emacs so I probably should shut up now...)

They can probably coexist, I think?  That is, both of them can add to
the variable buffer-locally.  Perhaps.  :-)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Mon, 23 Sep 2019 18:12:01 GMT) Full text and rfc822 format available.

Message #92 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Mon, 23 Sep 2019 20:11:31 +0200
João Távora <joaotavora <at> gmail.com> writes:

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

Makes sense.  I'll try to implement this, but probably not right away.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 29 Dec 2020 02:13:01 GMT) Full text and rfc822 format available.

Message #95 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 29 Dec 2020 03:12:14 +0100
João Távora <joaotavora <at> gmail.com> writes:

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

I've now altered format-spec to (optionally) return a list of strings,
which makes the previously proposed patch work, so I've now pushed it
(after rebasing it).  It seems to work fine in my test cases, but it
hasn't been tested extensively.

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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 29 Dec 2020 02:13:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 33740 <at> debbugs.gnu.org and Andrii Kolomoiets <andreyk.mad <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 29 Dec 2020 02:13:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 29 Dec 2020 02:20:02 GMT) Full text and rfc822 format available.

Message #102 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 29 Dec 2020 03:19:30 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> I've now altered format-spec to (optionally) return a list of strings,
> which makes the previously proposed patch work, so I've now pushed it
> (after rebasing it).  It seems to work fine in my test cases, but it
> hasn't been tested extensively.

(João, if you could have a look over the resulting code change (which is
mostly just indentation changes, but also changes a lot of the quoting),
that'd be nice.)

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 29 Dec 2020 13:53:01 GMT) Full text and rfc822 format available.

Message #105 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 29 Dec 2020 13:52:32 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> I've now altered format-spec to (optionally) return a list of strings,
>> which makes the previously proposed patch work, so I've now pushed it
>> (after rebasing it).  It seems to work fine in my test cases, but it
>> hasn't been tested extensively.
>
> (João, if you could have a look over the resulting code change (which is
> mostly just indentation changes, but also changes a lot of the quoting),
> that'd be nice.)

The first thing I notice is that the indicator is completely gone.
I.e. I can't see any flymake indications in the mode-line.  Is that
intended, or am I doing something wrong?  Did you test this?

I tried with

   src/emacs -Q -f flymake-mode

Before your change, one sees error thingies in the mode-line, after your
change one doesn't.  Perhaps it wouldn't be a bad idea to revert and
stage these ideas in a side branch?

João






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 29 Dec 2020 14:16:02 GMT) Full text and rfc822 format available.

Message #108 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 29 Dec 2020 15:14:47 +0100
[Message part 1 (text/plain, inline)]
João Távora <joaotavora <at> gmail.com> writes:

> The first thing I notice is that the indicator is completely gone.
> I.e. I can't see any flymake indications in the mode-line.  Is that
> intended, or am I doing something wrong?  Did you test this?
>
> I tried with
>
>    src/emacs -Q -f flymake-mode

Yes, my test case was

src/emacs -Q lisp/abbrev.el -f flymake-mode

And I get:

[Message part 2 (image/png, inline)]
[Message part 3 (text/plain, inline)]
-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 29 Dec 2020 14:19:02 GMT) Full text and rfc822 format available.

Message #111 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 29 Dec 2020 14:18:29 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>
>> I've now altered format-spec to (optionally) return a list of strings,
>> which makes the previously proposed patch work, so I've now pushed it
>> (after rebasing it).  It seems to work fine in my test cases, but it
>> hasn't been tested extensively.
>
> (João, if you could have a look over the resulting code change (which is
> mostly just indentation changes, but also changes a lot of the quoting),
> that'd be nice.)

I've just reverted the patch: it is seriously flawed.  I don't know if
"format-spec" allows this, but the previous indicators semantics were to
omit some counters (notably the notes counter) completely if the count
was 0.  This is why when opening the *scratch* buffer, which has 0
notes, the function you touched now exits non-locally with an error.

I'm not sure you've taken these details into account, and they're quite
an important feature that I don't think we can afford to lose.

So better put the patch in a side branch and decide if we want to
overhaul format-spec to allow for these things, or maybe just use the
more powerful existing mode-line language for this, perhaps breaking up
that big function into well-behaved pieces that users can compose.

Thanks,
João








Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 29 Dec 2020 14:23:02 GMT) Full text and rfc822 format available.

Message #114 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 29 Dec 2020 15:22:14 +0100
João Távora <joaotavora <at> gmail.com> writes:

> So better put the patch in a side branch and decide if we want to
> overhaul format-spec to allow for these things, or maybe just use the
> more powerful existing mode-line language for this, perhaps breaking up
> that big function into well-behaved pieces that users can compose.

Well, the request was for being able to customise the flymake mode-line
indicator, which isn't really feasible by asking the user to write mode
line specs.

But I don't really care one way or the other -- it's up to you, and I
won't pursue this matter any further.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Tue, 29 Dec 2020 15:14:02 GMT) Full text and rfc822 format available.

Message #117 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Tue, 29 Dec 2020 15:13:39 +0000
Tue, Dec 29, 2020 at 2:22 PM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
> João Távora <joaotavora <at> gmail.com> writes:
>
> > So better put the patch in a side branch and decide if we want to
> > overhaul format-spec to allow for these things, or maybe just use the
> > more powerful existing mode-line language for this, perhaps breaking up
> > that big function into well-behaved pieces that users can compose.
>
> Well, the request was for being able to customise the flymake mode-line
> indicator, which isn't really feasible by asking the user to write mode
> line specs.

How is it more feasible to ask her to write such customizations
inside a string than asking her to write the same customizations
in a symbolic expression?

> But I don't really care one way or the other -- it's up to you, and I
> won't pursue this matter any further.

I'm sorry, but the patch you pushed is crucially flawed, it simply
banishes the indicator in every file without diagnostics in the
"note" category.  This is plain to see in many Elisp files, but is
not only for Elisp, it affects Eglot and likely other uses that
rely on Flymake.  Since I don't know how to fix your "format-spec"
mini-language in the very short term, I hope you understand I
had to revert your patch.

In other words, the problem at hand doesn't get any simpler
just by choosing less powerful language. Either we make
the language more powerful, or we choose to solve a narrower
problem.

I don't understand your "don't care" comment.  You don't care
for enhancing format-spec to allow for conditional formattings.
Or you don't care for Flymake or what?

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 30 Dec 2020 03:23:01 GMT) Full text and rfc822 format available.

Message #120 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 30 Dec 2020 04:22:12 +0100
João Távora <joaotavora <at> gmail.com> writes:

> How is it more feasible to ask her to write such customizations
> inside a string than asking her to write the same customizations
> in a symbolic expression?

Format spec strings is the common idiom for customising display stuff in
Emacs.

> I don't understand your "don't care" comment.  You don't care
> for enhancing format-spec to allow for conditional formattings.

Whether Flymake offers a way to customise the lighter (or not) is up to
you.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 30 Dec 2020 09:29:01 GMT) Full text and rfc822 format available.

Message #123 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 30 Dec 2020 09:28:22 +0000
On Wed, Dec 30, 2020 at 3:22 AM Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
>
> João Távora <joaotavora <at> gmail.com> writes:
>
> > How is it more feasible to ask her to write such customizations
> > inside a string than asking her to write the same customizations
> > in a symbolic expression?
>
> Format spec strings is the common idiom for customising display stuff in
> Emacs.

Not all of this "stuff" obviously, only the fraction of it that is trivial.
Case in point, the very commonly customized mode-line.
I appreciate the effort to try to move this along, but if you'd
be more aware of Flymake's mode-line mechanics, you'd
see the format-spec function is underpowered currently

I mean, it _could_ become more powerful. See CL:FORMAT for
example (some love it, some hate it, I respect and use it on
occasion).  It could do the job easily, because it has conditional
formatting:

http://www.lispworks.com/documentation/HyperSpec/Body/22_cgb.htm

So, unless format spec grows something similar, it simply isn't the
tool for the job. What growth? See the end of:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=33740#71

in this thread for a possible start.

> > I don't understand your "don't care" comment.  You don't care
> > for enhancing format-spec to allow for conditional formattings.
>
> Whether Flymake offers a way to customise the lighter (or not) is up to
> you.

I've started work on a `flymake-mode-line`  customizable var, where
users can add and removed pre-baked pieces to control the main
indicator, counters, brackets, etc.  If you're interested in enhancing
format-spec, let me know, else I'll continue this approach.

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 30 Dec 2020 20:17:02 GMT) Full text and rfc822 format available.

Message #126 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: larsi <at> gnus.org, 33740 <at> debbugs.gnu.org, andreyk.mad <at> gmail.com
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 30 Dec 2020 22:16:17 +0200
> From: João Távora <joaotavora <at> gmail.com>
> Date: Wed, 30 Dec 2020 09:28:22 +0000
> Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
> 
> I mean, it _could_ become more powerful. See CL:FORMAT for
> example (some love it, some hate it, I respect and use it on
> occasion).  It could do the job easily, because it has conditional
> formatting:

The mode-line constructs also support conditionals, so I don't think I
follow you here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Wed, 30 Dec 2020 21:14:01 GMT) Full text and rfc822 format available.

Message #129 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 33740 <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Wed, 30 Dec 2020 21:13:36 +0000
On Wed, Dec 30, 2020 at 8:16 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
>
> > From: João Távora <joaotavora <at> gmail.com>
> > Date: Wed, 30 Dec 2020 09:28:22 +0000
> > Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
> >
> > I mean, it _could_ become more powerful. See CL:FORMAT for
> > example (some love it, some hate it, I respect and use it on
> > occasion).  It could do the job easily, because it has conditional
> > formatting:
>
> The mode-line constructs also support conditionals, so I don't think I
> follow you here.

Yes, mode-line constructs are what I'm using right now and what
I'm going to use to give users an interface.  Lars was suggesting
that format strings are the preferred customization method, and they
could become an alternative. But currently, Emacs's format-spec
falls well short of what is required.  It could become more powerful,
like CL:FORMAT, or not. Until then, mode-line constructs.

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Thu, 31 Dec 2020 14:07:02 GMT) Full text and rfc822 format available.

Message #132 received at 33740-done <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 33740-done <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Thu, 31 Dec 2020 14:05:59 +0000
I finally did this work.  Check it out in master.  If you think it's acceptable
we can bump the Flymake version to GNU Elpa.

Happy new year (soon at least),
João

On Wed, Dec 30, 2020 at 9:13 PM João Távora <joaotavora <at> gmail.com> wrote:
>
> On Wed, Dec 30, 2020 at 8:16 PM Eli Zaretskii <eliz <at> gnu.org> wrote:
> >
> > > From: João Távora <joaotavora <at> gmail.com>
> > > Date: Wed, 30 Dec 2020 09:28:22 +0000
> > > Cc: 33740 <at> debbugs.gnu.org, Andrii Kolomoiets <andreyk.mad <at> gmail.com>
> > >
> > > I mean, it _could_ become more powerful. See CL:FORMAT for
> > > example (some love it, some hate it, I respect and use it on
> > > occasion).  It could do the job easily, because it has conditional
> > > formatting:
> >
> > The mode-line constructs also support conditionals, so I don't think I
> > follow you here.
>
> Yes, mode-line constructs are what I'm using right now and what
> I'm going to use to give users an interface.  Lars was suggesting
> that format strings are the preferred customization method, and they
> could become an alternative. But currently, Emacs's format-spec
> falls well short of what is required.  It could become more powerful,
> like CL:FORMAT, or not. Until then, mode-line constructs.
>
> João



-- 
João Távora




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Fri, 01 Jan 2021 10:57:01 GMT) Full text and rfc822 format available.

Message #135 received at 33740-done <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: João Távora <joaotavora <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 33740-done <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Fri, 01 Jan 2021 11:56:40 +0100
João Távora <joaotavora <at> gmail.com> writes:

> I finally did this work.  Check it out in master.  If you think it's
> acceptable we can bump the Flymake version to GNU Elpa.

Sure; looks good.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33740; Package emacs. (Sat, 02 Jan 2021 11:28:02 GMT) Full text and rfc822 format available.

Message #138 received at 33740 <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 33740 <at> debbugs.gnu.org,
 Andrii Kolomoiets <andreyk.mad <at> gmail.com>
Subject: Re: bug#33740: [PATCH] Customizable flymake mode-line indicator
Date: Sat, 02 Jan 2021 11:27:25 +0000
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> João Távora <joaotavora <at> gmail.com> writes:
>
>> I finally did this work.  Check it out in master.  If you think it's
>> acceptable we can bump the Flymake version to GNU Elpa.
>
> Sure; looks good.

Done.  Bumped to Flymake to 1.1.0, should be in GNU Elpa soon.

João





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 30 Jan 2021 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 84 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.