Skip to content

Conversation

@vadim-zyamalov
Copy link

@vadim-zyamalov vadim-zyamalov commented Jan 27, 2022

Hello!

I've been using minions with the vanilla mode-line and everything was ok. minions is fantastic!

Now I've moved from vanilla mode-line to the telephone-line. As the built in minions segment doesn't support mouse clicks (it just prints plain text) I've injected minions into it. But I found that the major-mode part of the result doesn't use the background provided but inherits the base mode-line face:

telephon-line-pre

I've tried to propertize major-mode part with the same code as for minor-mode part and it seems to work!

telephon-line-post
telephon-line-post2

This changes keep minions working for the vanilla mode-line both standard and themed:
vanilla
doom

@tarsius
Copy link
Owner

tarsius commented Jan 28, 2022

As the built in minions segment doesn't support mouse clicks (it just prints plain text)

That is a bug in telephone-line. You should ask them for help.

It appears that this not only applies the correct face to the minions segment but that it at the same time strips all other properties:

(telephone-line-defsegment* telephone-line-minions-mode-segment ()
  (telephone-line-raw minions-mode-line-modes t))

I've injected minions into it. But I found that the major-mode part of the result doesn't use the background provided but inherits the base mode-line face: [...] I've tried to propertize major-mode part with the same code as for minor-mode part and it seems to work!

The variable minions-mode-line-face is not intended to make the text that uses blend in with its surrounding. On the contrary, it is assumed that that automatically the case, and this variable can be used to select a face that makes it standout more, e.g. to give it the appearance of a button.

The reason that it does not blend in when using telephone-line is that that mode-line package does not stick to two faces, one for the active and one for the inactive mode-line, but instead uses different faces for different parts of the mode-line.

That is problematic because many segments are written with the assumption that they do not have to and usually should not specify a face. This is one of the major reasons why I don't use {power,space,telephone-,...}line and have instead implemented my own mode line "theme" package: moody. Also see https://github.com/tarsius/minions/wiki.

I want to keep minions-mode-line-modes as similar to mode-line-modes as possible. Specifying a face for the major mode part would be a departure from that, especially if that is shared with something else and intended to make that stand out.

Also I think changing ("" mode-name) to mode-name is a bug; I would expect that to result in an error if mode-name is nil.

So in summary, I don't think anything should be changed in this package and I am not merging this, but thanks for the effort.

@tarsius tarsius closed this Jan 28, 2022
@vadim-zyamalov
Copy link
Author

vadim-zyamalov commented Jan 29, 2022

Strange enough for me.

I've injected minions like this:

(telephone-line-defsegment my/telephone-line-minions-mode-segment ()
  minions-mode-line-modes)

I don't quite understand why shouldn't major-mode and ;- use the same face?
Taking into account that ;- is faced with minions-mode-line-face explicitly and it's background is the expected one i.e. it somehow inherits the non-standard face. I personally see a problem in that behavior.

But you're the original author and if you don't see any problems than that's "not bug but feature".

Sorry for wasting your time...

@tarsius
Copy link
Owner

tarsius commented Jan 29, 2022

I don't quite understand why shouldn't major-mode and ;- use the same face?

It was added to give users the option to make the minor-mode menu look different from anything else. See #23.

Taking into account that ;- is faced with minions-mode-line-face explicitly and it's background is the expected one i.e. it somehow inherits the non-standard face. I personally see a problem in that behavior.

Well by default this effectively is :face nil. Please try if this does the trick for you:

diff --git a/minions.el b/minions.el
index 00aff2f..332c569 100644
--- a/minions.el
+++ b/minions.el
@@ -153,6 +153,7 @@ (defvar minions-mode-line-modes
 mouse-1: Display major mode menu
 mouse-2: Show help for major mode
 mouse-3: Toggle minor modes"
+                        face nil
                         mouse-face mode-line-highlight
                         local-map ,mode-line-major-mode-keymap)
           '("" mode-line-process)

If it does, then I could add that. I hope that doesn't break anything for anybody else.

@vadim-zyamalov
Copy link
Author

Please try if this does the trick for you:

It doesn't unfortunately... 😞
I partially "solved" the problem installing moody. It serves my needs in smth simple, lightweight, and eye-pleasing.

Sorry to bother you!
Thanks for your amazing packages!

@tarsius
Copy link
Owner

tarsius commented Jan 29, 2022

😀

I might some day look into why that doesn't work, seems like an opportunity to learn about subtle different ways of propertizing mode-line elements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants