Open Olivia5k opened 4 years ago
It's intentional that the segments don't hide when they're empty, I intended it that way so that you could keep the number of supersegments symmetrical. I hadn't thought of this use case, but I'd be open to a PR to make hiding an optional feature.
However, I think it might be an easier solution to make the color of this segment depend upon the number of notifications. Much as the evil
keyword allows a segment to change color depending upon evil state, you could make this segment turn red whenever you have unread mail.
To do this, you would define a function which takes one parameter, active
, and returns an appropriate face depending upon this (and whatever else). Then, add a pair of (whatever-symbol . my-func)
to telephone-line-faces
, and use whatever-symbol
as the color for this supersegment.
I want to highlight when I have unread mail in the modeline. Doing so was easy;
However, when I don't have any email (or when I don't have any un-diminished minor modes, like
whitespace-mode
asws
in the screenshot above) the separators for the segments are still rendered;This might be a bit of a fringe use case, but I'd like to not have them rendered at all if they don't contain anything. The minor mode list is fine, but the red for the email alert is literally designed to catch my eye. If it's there when I don't need it, I'll passively train my brain to not react to it, and then it's suddenly kind of pointless to have it there in the first place.
I didn't dig too much into the code yet, but I'm thinking it probably doesn't require too much wizardry to make it an optional thing to render the separators if the content inside of them is empty. Would that be possible? No biggie at all if it's not, I just wanted to check!
(Also, cheers for a neat package that I've been using for years and that has caused literally zero seconds of trouble! :+1:)