kiennq / emacs-mini-modeline

Display emacs mode line in minibuffer
GNU General Public License v3.0
197 stars 14 forks source link

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

Open hpgisler opened 2 years ago

hpgisler commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

A readme note would be good, I think.

slotThe commented 2 years ago

@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?