-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to selectively show or hide minor mode indicators #159
base: master
Are you sure you want to change the base?
Conversation
Just realised that the white-list mode implementation is still a little bit aggressive. ;-) Let me fix that... |
From my side, this PR would be ready to merge. @milkypostman, any thoughts? |
aren't there already separate packages that do this like diminish? |
Thanks for your consideration! I tried a couple of them (incl. diminish), but couldn't get any of them to work. Also, when you read the descriptions of mode-line and minor-mode-hiding packages, compatibility with one or the other package is being mentioned. I guess it will depend on how the mode-line package generates the minor mode indicators. If and when it retrieves the information from a variable which a minor-mode-hiding package has previously modified, then the modes will he shown/hidden as intended. If and when it however retrieves the information from a variable which has not (or not yet) been modified by a minor-mode-hiding package, then there will be no showing/hiding effect. So ultimately it seems to depend on which variables and which hooks each package uses, whether each combination works or not. That was my motivation for making this PR. |
i'm still considering this. i'd like to understand better why the other packages don't work. they should work just fine with this package unless we're not adhering to some standard. |
It's been a while... Some further thoughts: I opted to not use |
Update: I have (locally) modified my code to patch (require 'powerline)
(powerline-default-theme)
(setq rm-blacklist nil)
(setq rm-whitelist (format "^ \\(%s\\)$" (mapconcat #'identity
'("Narrow" "Ov.*")
"\\|")))
(rich-minority-mode 1) it will have the desired effect (white-/black-listing of minor modes with regular expressions ). If Maybe making it an integration feature with another, optional package, makes it more palatable? |
I think this PR would probably be suitable to address #64.
I have added two new config variables to control the new behaviour:
powerline-minor-mode-filter-mode
which can be set to eitherinclude
(white-list mode), orexclude
(black-list mode);powerline-minor-mode-filter-regexp-list
is a list of regular expressions which is used to filter the minor mode indicators according to the filter mode determined bypowerline-minor-mode-filter-mode
.The default behaviour is to show all minor modes, i.e. no change to the current behaviour.
In white-list mode, only minor mode indicators matching one of the regular expressions are shown. In black-list mode, all minor mode indicators matching one of the regular expressions are hidden.
Example: to hide all minor modes, you could use this: