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.

Full log


View this message in rfc822 format

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




This bug report was last modified 4 years and 140 days ago.

Previous Next


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