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

OSX menus gone. #72

Closed
ankhers opened this Issue Feb 17, 2012 · 7 comments

Comments

Projects
None yet
3 participants
@ankhers
Contributor

ankhers commented Feb 17, 2012

I have these two alias' that I have been using for some time to use emacs.

alias emacs='/usr/local/Cellar/emacs/HEAD/bin/emacsclient -c $@'
alias em-daemon='/usr/local/Cellar/emacs/HEAD/Emacs.app/Contents/MacOS/Emacs --daemon'

Though when I use my emacs alias, which calls emacsclient -c, I no longer get the menus with my non-terminal frame.

I believe this commit broke them.

@NicholasKirchner

This comment has been minimized.

Show comment
Hide comment
@NicholasKirchner

NicholasKirchner Feb 18, 2012

Contributor

Do the menus come back if you add the -n option for emacsclient?

Contributor

NicholasKirchner commented Feb 18, 2012

Do the menus come back if you add the -n option for emacsclient?

@ankhers

This comment has been minimized.

Show comment
Hide comment
@ankhers

ankhers Feb 18, 2012

Contributor

Unfortunately not. I almost always invoke my emacs alias using emacs -n

Contributor

ankhers commented Feb 18, 2012

Unfortunately not. I almost always invoke my emacs alias using emacs -n

@NicholasKirchner

This comment has been minimized.

Show comment
Hide comment
@NicholasKirchner

NicholasKirchner Feb 18, 2012

Contributor

This is very strange; you and I have similar set-ups, yet when I fetched the latest prelude it caused no problems with my menu bars. Only other thing I can think of is that maybe the LSUIElement flag is set to 1 for Emacs.app. To check that out, sift through the Emacs.app/Info.plist file.

Contributor

NicholasKirchner commented Feb 18, 2012

This is very strange; you and I have similar set-ups, yet when I fetched the latest prelude it caused no problems with my menu bars. Only other thing I can think of is that maybe the LSUIElement flag is set to 1 for Emacs.app. To check that out, sift through the Emacs.app/Info.plist file.

@ankhers

This comment has been minimized.

Show comment
Hide comment
@ankhers

ankhers Feb 18, 2012

Contributor

That doesn't appear in my Info.plist at all. The strange thing, when I start emacs manually via the Emacs.app or command-line without daemon, it seems to work properly. I also just grabbed a fresh prelude, and I still had the issue.

Contributor

ankhers commented Feb 18, 2012

That doesn't appear in my Info.plist at all. The strange thing, when I start emacs manually via the Emacs.app or command-line without daemon, it seems to work properly. I also just grabbed a fresh prelude, and I still had the issue.

@NicholasKirchner

This comment has been minimized.

Show comment
Hide comment
@NicholasKirchner

NicholasKirchner Feb 18, 2012

Contributor

Ah... I've managed to get to the same place you're at right now (after quitting initially, I forgot to restart the daemon. Rather I was simply running Emacs.app).

Anyway, the problem is with the (display-graphic-p) command, I think. From reading this, it seems that when emacs daemon starts up, (display-graphic-p) returns nil since there are no graphical frames.

Contributor

NicholasKirchner commented Feb 18, 2012

Ah... I've managed to get to the same place you're at right now (after quitting initially, I forgot to restart the daemon. Rather I was simply running Emacs.app).

Anyway, the problem is with the (display-graphic-p) command, I think. From reading this, it seems that when emacs daemon starts up, (display-graphic-p) returns nil since there are no graphical frames.

@NicholasKirchner

This comment has been minimized.

Show comment
Hide comment
@NicholasKirchner

NicholasKirchner Feb 18, 2012

Contributor

OK, this is very strange: with Emacs daemon running I went to ielm and input (menu-bar-mode 1). This revealed the menu bar (no surprise there). However, the next command I gave it was (menu-bar-mode -1). This did not turn off the menubar.

Could this be an Emacs bug regarding the behavior of menu-bar-mode when the daemon is running?

Contributor

NicholasKirchner commented Feb 18, 2012

OK, this is very strange: with Emacs daemon running I went to ielm and input (menu-bar-mode 1). This revealed the menu bar (no surprise there). However, the next command I gave it was (menu-bar-mode -1). This did not turn off the menubar.

Could this be an Emacs bug regarding the behavior of menu-bar-mode when the daemon is running?

@NicholasKirchner

This comment has been minimized.

Show comment
Hide comment
@NicholasKirchner

NicholasKirchner Feb 18, 2012

Contributor

All right... cracked this one: menu-bar-mode is a global variable which effects all frames. We need a local variable associated to each frame which turns the menubar on for a graphical frame and off for a console frame. menu-bar-lines is such a variable. The fix is to replace the prelude-frame-config function in prelude-ui.el with this one:

(defun prelude-frame-config (frame)
  "Custom behaviours for new frames."
  (if (eq system-type 'darwin)
      (with-selected-frame frame
        (if (display-graphic-p)
            (modify-frame-parameters frame '((menu-bar-lines . 1)))
          (modify-frame-parameters frame '((menu-bar-lines . 0)))))
    (menu-bar-mode -1)))
Contributor

NicholasKirchner commented Feb 18, 2012

All right... cracked this one: menu-bar-mode is a global variable which effects all frames. We need a local variable associated to each frame which turns the menubar on for a graphical frame and off for a console frame. menu-bar-lines is such a variable. The fix is to replace the prelude-frame-config function in prelude-ui.el with this one:

(defun prelude-frame-config (frame)
  "Custom behaviours for new frames."
  (if (eq system-type 'darwin)
      (with-selected-frame frame
        (if (display-graphic-p)
            (modify-frame-parameters frame '((menu-bar-lines . 1)))
          (modify-frame-parameters frame '((menu-bar-lines . 0)))))
    (menu-bar-mode -1)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment