You signed in with another tab or window. Reload to re
8000
fresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot control face (and presence) of major mode name #41
I am failing to change the face of the major mode name (mode-name) inserted inside the minions-mode-line-modes object. A propertize affecting minions-mode-line-modes does not do the job, since mode-line is already under a propertize, and they cannot be nested. So I end up with something similar to what was found in #32, but without using any mode-line modification package.
Would if be possible to add and expose a custom face for the major mode name, or, alternatively, an option to remove it from the minions-mode-line-modes so that its face can be changed separately? I may be able to write a PR for the 2nd case, though my elisp is not very good at all and it would need some review.
Please post the code you have come up with so far.
Would if be possible to add and expose a custom face for the major mode name
That might be an option, but it might be best that would be done in Emacs. minions-mode-line-modes is a copy of mode-line-modes, which adds the delimiters and menu; but the major-mode part is the same in both formats (except we had some newlines to the help-text).
The 2nd blob takes care of the optional space between major mode name and the minor modes lighter,
Would if be possible to add and expose a custom face for the major mode name
That might be an option, but it might be best that would be done in Emacs. minions-mode-line-modes is a copy of mode-line-modes, which adds the delimiters and menu; but the major-mode part is the same in both formats (except we had some newlines to the help-text).
It could, sure. But unless I am missing something (again, not an elisp expert) one would need to redefine all the properties, including the help-text in the new definition, just to change the face?
It does the job for the major mode name, but it does not apply to the extra text added by some modes, as shown below for the /l for lisp lexical binding:
At the end of the day, passing nil as your-modified-element in your suggestion basically does the same as the change I was proposing (minus conditionally removing the space between major and minor, which can also be achieved without modification).
I guess this is a non-issue, if you prefer to leave minions as-is. I have learned quite a bit from this conversation. Thanks a lot for your time!
Activity
tarsius commentedon Mar 5, 2024
Please post the code you have come up with so far.
That might be an option, but it might be best that would be done in Emacs.
minions-mode-line-modesis a copy ofmode-line-modes, which adds the delimiters and menu; but the major-mode part is the same in both formats (except we had some newlines to the help-text).JesusTorrado commentedon Mar 6, 2024
Thanks for the quick answer!
main...JesusTorrado:minions:major_mode_switch
The 2nd blob takes care of the optional space between major mode name and the minor modes lighter,
It could, sure. But unless I am missing something (again, not an elisp expert) one would need to redefine all the properties, including the help-text in the new definition, just to change the face?
tarsius commentedon Mar 6, 2024
Try this instead:
JesusTorrado commentedon Mar 6, 2024
Sorry, you got me there. Where should I try this?
tarsius commentedon Mar 6, 2024
Add it to your init file, right after
(require 'minions).JesusTorrado commentedon Mar 6, 2024
I see, sorry. Thanks!
It does the job for the major mode name, but it does not apply to the extra text added by some modes, as shown below for the
/lfor lisp lexical binding:tarsius commentedon Mar 6, 2024
IMO that's acceptable. In the case of Elisp, the
/dis supposed to stand out, to draw attention to the fact that it's not/l.But if you really must, you can do that without modifying
minions.el:You probably have to use
'(:eval (propertize ...))instead of'(:propertize ...)to override existing faces.JesusTorrado commentedon Mar 6, 2024
Thanks!
At the end of the day, passing
nilasyour-modified-elementin your suggestion basically does the same as the change I was proposing (minus conditionally removing the space between major and minor, which can also be achieved without modification).I guess this is a non-issue, if you prefer to leave minions as-is. I have learned quite a bit from this conversation. Thanks a lot for your time!
tarsius commentedon Mar 6, 2024
You're welcome!