2

I have keyboard shortcuts set up to switch to virtual desktops with Ctrl-n. When I switch to a desktop, the "front-most" app in that window becomes focused. But not for Emacs.

Another, perhaps related, issue is that even though I have the When switching to an application, switch to a Space with open windows for the application option checked Mission Control preferences, when I Cmd-Tab to Emacs, the Emacs window is moved to the desktop I'm currently in. That's unexpected since when I Cmd-Tab to any other app, I'm switched to that desktop.

Any idea how to get Emacs to behave like normal applications?

  • Emacs version: GNU Emacs 25.1.1 (x86_64-apple-darwin15.4.0, Carbon Version 157 AppKit 1404.46) of 2016-10-24 (brew install emacs-mac)
  • OS version: 10.11.4 (15E65)
  • I can't reproduce this (OS X 10.11.6, GNU Emacs 26.0.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G1004)) of 2016-10-17). I am not sure about your emacs-mac-port tag, though. Is that the port by Mitsuhary Yamamoto? I am building from straight GNU source myself. – Harald Hanche-Olsen Oct 25 '16 at 15:20
  • @HaraldHanche-Olsen thanks I'll try building from source. It's the emacs port packaged as railwaycat/emacsmacport/emacs-mac: stable emacs-25.1-z-mac-6.0, HEAD in Homebrew (brew info emacs-mac) – Andreas Jansson Oct 25 '16 at 15:33
  • You might want to see if this happens with the generic unmodified version of just plain old Emacs 25 -- nothing extra: emacsformacosx.com Also, OSX 10.11 was finalized at 10.11.6. So you are 2 decimal points behind the final release. – lawlist Oct 25 '16 at 16:19
  • If you can reproduce it with a standard Emacs 25.1, please report it as a bug to the Emacs team. Unfortunately, not many people are working on the OS X interface (a.k.a. the "ns" port). However, if you (or anyone else) are willing to invest some effort into tracking this down I can give you some advice on how to get started. – Lindydancer Oct 25 '16 at 19:13
2

I don't see this behavior either with: osx 10.11.6 "GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G31)) of 2016-09-22"

Emacs from brew as follows: brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick

4

The behavior you described is specific to Emacs Mac port and can be observed when the menu bar is globally disabled. Enabling it should make Emacs behave like other applications on OS X.

I emailed the maintainer of the port, Yamamoto Mitsuharu, regarding this issue and he referred me to the relevant section of the Mac port info node, which goes as follows.

Unlike the original Emacs, enabling or disabling Menu Bar mode (@pxref{Menu Bars}) does not affect the appearance of the menu bar on the Mac port because it does not make sense on OS X having the global menu bar. Instead, the value of the @code{menu-bar-lines} frame parameter affects the system-wide full screen behavior of the frame. In most cases, disabling the menu bar of a particular frame by default means that it is a utility frame used for a subsidiary purpose together with other frames, rather than an ordinary frame on its own. Examples include the speedbar (@pxref{Speedbar}) and Ediff Control Panel (@pxref{Top, Ediff, Ediff, ediff, The Ediff Manual}). Using this heuristics, the Mac port regards a frame having a menu bar as an ordinary frame that is eligible for full screen. Conversely, a frame without a menu bar is considered as a utility frame and it can coexist with a full screen ordinary frame and other utility frames in a same desktop (or Space) for full screen. Note that a utility frame doesn't have the full screen button on the title bar. If you don't see the full screen button while it is supposed to be there, then check the menu bar setting.

  • Just as reference, you want menu-bar-mode, more can be found here So just add (menu-bar-mode t) to your init.el – Hugo Mar 6 '18 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.