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

(setq mini-modeline-display-gui-line t) is not honored if emacs is started in server mode #59

Open
hpgisler opened this issue Jan 18, 2022 · 3 comments

Comments

@hpgisler
Copy link

Observed behavior:

In emacs server/client mode:

If (mini-modeline-mode t) is activated in init.el then the mode is started as expected,
however, the mini-modeline-display-gui-line is not activated after emacs client has been started, i.e. the frame has been created.

Expected behavior:

Regardless, whether emacs is started in normal mode or in server/client mode, mini-modeline-display-gui-line should be active, is set accordingly in init.el.

Mitigation:

	(if (daemonp)
			(add-hook 'after-make-frame-functions (lambda (frame)
				(with-selected-frame frame
					(if (window-system frame)
						(mini-modeline-mode 1)))))
		(mini-modeline-mode 1))

However, I feel, this is not as clean is it could be...

@andersjohansson
Copy link
Contributor

See #37. I don’t know if there is much emacs can do when starting in server mode (with no gui-frames launched?). I suppose your code could be added to the mode definition, making it much more complicated. Otherwise a note in the readme could be an idea?

@hpgisler
Copy link
Author

A readme note would be good, I think.

  • if emacs is started in server mode, the mini-modeline-mode can't be enabled (because of terminal mode)
  • in that case this / or that hook should be used (note: focus-in-hook as described in GUI line not showing with server-mode #37 is obsolet (emacs 27.2))

@slotThe
Copy link

slotThe commented Feb 21, 2022

@hpgisler for the new after-focus-change-function interface I now use something like

(add-function :after after-focus-change-function
              #'(lambda ()
                  (unless mini-modeline-mode
                    (mini-modeline-mode)
                    (modus-themes-load-operandi))))

which works for me.

Though I agree that it should be mentioned in the README—fancy opening a pr?

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

3 participants