-
Notifications
You must be signed in to change notification settings - Fork 30
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
Setting a default modeline results in different faces being used #58
Comments
I'm not sure to get the point here. We only want to modify the header (or mode) line face when nano-modeline is in use, no? |
Yes, but the recommendation for setting a default is to invoke (defun nano-modeline-header (left &optional right default)
"Install a header line made of LEFT and RIGHT parts. Line can be
made DEFAULT."
(require 'tooltip)
(if default
(setq-default header-line-format (nano-modeline--make left right 'header))
(setq-local header-line-format (nano-modeline--make left right 'header)))
;; Everything below here only applies to the current buffer (aside from the things that are not buffer local, of course)
(make-local-variable 'nano-modeline--buttons)
(setq nano-modeline--buttons nil)
(advice-add 'tooltip-hide :before #'nano-modeline--reset-button-state)
(face-remap-set-base 'header-line 'nano-modeline--empty-face)
(add-hook 'post-command-hook #'nano-modeline--update-selected-window)) |
I do this instead: (add-hook 'after-change-major-mode-hook #'aj-nano-modeline)
(defun aj-nano-modeline ()
"Set modeline accordingly"
(cond ((derived-mode-p 'prog-mode)
(aj-nano-modeline-prog-mode))
((derived-mode-p 'vterm-mode))
(t
(aj-nano-modeline-text-mode)))) |
Oh, I got it. I see your solution but this is precisely what I wanted to avoid even though it is now a hook. I wonder if there's a better solution. |
Specifically this line does not apply to every buffer:
Because of that, any buffer that does not have an explicit hook to establish a modeline format will use header-line as the basis, rather than default.
The text was updated successfully, but these errors were encountered: