Skip to content
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

Unable to diminish lighter in modeline for beginend-global-mode #43

Closed
doolio opened this issue Aug 14, 2017 · 10 comments
Closed

Unable to diminish lighter in modeline for beginend-global-mode #43

doolio opened this issue Aug 14, 2017 · 10 comments

Comments

@doolio
Copy link
Contributor

doolio commented Aug 14, 2017

Firstly, thank you for this great package. I would like to hide the lighter from the modeline. Yes, sadly I wish to "diminish" this great package and still have it continue its work. To that end I have the following use-package declaration in my configuration:

(use-package beginend
  :pin melpa
  :ensure t
  :init (beginend-global-mode)
  :diminish beginend-global-mode)

I've also tried the (diminish 'beginend-global-mode) form but it too does not work. Is there something missing from my beginend configuration setup?

@DamienCassou
Copy link
Owner

Hi @doolio,

thanks for your interest. I diminish most of the packages I use so no need to apologize :-). For beginend, there are several modes, each of them requiring "diminishion":

(use-package beginend
  :demand t
  :diminish (beginend-global-mode beginend-dired-mode beginend-prog-mode)
  :config
  (progn
    (beginend-global-mode)))

Add all the modes you don't want to see.

Enjoy beginend!

@DamienCassou
Copy link
Owner

I'm closing for now. Please reopen if this doesn't solve your problem.

@doolio
Copy link
Contributor Author

doolio commented Aug 14, 2017

Yes, this removes the lighter as I wanted.

I did not appreciate that it needed to be done for each supported mode. I presumed as the lighter was defined for the global minor mode it was sufficient to only diminish it so it would be diminished for all supported modes. Anyway, thanks again for your time and the quick response.

@DamienCassou
Copy link
Owner

DamienCassou commented Aug 15, 2017 via email

@doolio
Copy link
Contributor Author

doolio commented Aug 26, 2017

Do you have any suggestion?

Unfortunately, not at this time. I don't know Emacs Lisp myself and am in fact trying to slowly learn how to programme in general and so quite ignorant of programming to be in a position to provide a solution. I've kinda gone in the deep end and chose to learn how to use Emacs as part of that journey!

In any case, if I understand how minor modes work in general, your code provides the lighter for each supported mode individually and/or globally (which includes all the supported modes). Would it make sense to limit the global minor mode to only those modes supported which I guess would mean it would not be global in the strict sense of the definition and so perhaps a meaningless suggestion?

Because as it stands with the global minor mode enabled but not diminished the lighter appears twice for buffers with modes that are supported.

@oantolin
Copy link
Contributor

If you want to diminish all beginend modes you can use this configuration:

(use-package beginend
  :ensure t
  :demand t
  :config
  (cl-loop for (minor-mode lighter) in minor-mode-alist
           when (equal lighter " be")
           do (diminish minor-mode))
  (beginend-global-mode))

@DamienCassou
Copy link
Owner

Thank you. I'm using minions mode for some time now so I don't need dimish or similar anymore.

@doolio
Copy link
Contributor Author

doolio commented Jan 26, 2020

Yes, like Damien I switched to using the minions package some time ago but thank you.

@sshaw
Copy link

sshaw commented Apr 12, 2020

(dolist (mode beginend-modes) (diminish  mode))

@oantolin
Copy link
Contributor

oantolin commented Apr 12, 2020

I think you're missing a cdr:

(dolist (mode beginend-modes) (diminish (cdr mode)))

Also, with this approach one needs to separately diminish beginend-global-mode. (My (equal lighter " be") includes beginend-global-mode too.)

But I do like this better than my approach, so I'm now using:

(use-package beginend
  :ensure t
  :demand t
  :diminish beginend-global-mode
  :config
  (dolist (mode beginend-modes) (diminish (cdr mode)))
  (beginend-global-mode))

Thanks, @sshaw !

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

No branches or pull requests

4 participants