help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question regarding flymake and the mode line


From: Fredrik Salomonsson
Subject: Question regarding flymake and the mode line
Date: Fri, 8 May 2020 00:25:40 -0700

Hi,

I like to keep my mode line to a single color. Blueish when active and gray
when inactive. But flymake messes up my color scheme as it shows a pink and
orange number regardless of the state of the mode line.

>From what I can understand, flymake; for the error number face uses the
`compilation-error' face to set the face property when constructing the
string for the mode line. Similar for the warning number. I can set the
compilation faces to blue and that will set the correct color for when the
mode line is active. But this messes up the compilation colors, and the
number is the wrong color when the mode line is inactive.

Is there a way to tell flymake to respect the colors from mode-line and
mode-line-inactive?

I tried adding an advice around the lighter for flymake and remove the
faces. But that makes flymake disappear from the mode line entirely. Not
sure why.

(defun plattfot--strip-text-properties (flymake--mode-line-format)
  "Remove text properties from FLYMAKE--MODE-LINE-FORMAT."
  (let ((str (funcall flymake--mode-line-format)))
    (remove-text-properties 0 (length str) '(face nil) str)
    str))

(advice-add 'flymake--mode-line-format :around
#'plattfot--strip-text-properties)

Using emacs-26.3 and flymake-1.0.8. My theme is here:
https://github.com/plattfot/plattfot-theme.el

Thanks
-- 
s/Fred[re]+i[ck]+/Fredrik/g


reply via email to

[Prev in Thread] Current Thread [Next in Thread]