[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#27645: MacOS: run GUI Emacs without 'make install'
From: |
Charles A. Roelli |
Subject: |
bug#27645: MacOS: run GUI Emacs without 'make install' |
Date: |
Mon, 10 Jul 2017 21:06:26 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
Currently, when building Emacs for MacOS, you have to run 'make
install' before you can run the GUI version, which needs to be running
inside an Apple "bundle" (which includes a configuration file,
"Info.plist"). If you try to run 'src/emacs -q' directly after
'make', you get an Emacs frame with no menu or dock icon, and the
frame does not take any keyboard input. This is fixed by changing the
"activation policy" of Emacs at runtime.
The following snippet from
/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSRunningApplication.h:
has more details:
/* The following activation policies control whether and how an
application may be activated. They are determined by the Info.plist. */
enum {
/* The application is an ordinary app that appears in the Dock and
may have a user interface. This is the default for bundled apps, unless
overridden in the Info.plist. */
NSApplicationActivationPolicyRegular,
/* The application does not appear in the Dock and does not have a
menu bar, but it may be activated programmatically or by clicking on one
of its windows. This corresponds to LSUIElement=1 in the Info.plist. */
NSApplicationActivationPolicyAccessory,
/* The application does not appear in the Dock and may not create
windows or be activated. This corresponds to LSBackgroundOnly=1 in the
Info.plist. This is also the default for unbundled executables that do
not have Info.plists. */
NSApplicationActivationPolicyProhibited
};
typedef NSInteger NSApplicationActivationPolicy;
So when we call 'src/emacs -q' directly, Emacs should change
activation policy to NSApplicationActivationPolicyRegular. The
patch in the next message implements this.
Normally the Info.plist file inside the application's bundle takes
care of setting this policy, but when we run Emacs outside of the
bundle, that won't happen.
This change also makes it easier to run Emacs inside GDB in MacOS,
since there's no need to run 'make install' and give GDB the bundled
executable's name -- it's now done as on GNU/Linux.
Some things still to consider:
- Is this necessary/feasible on GNUstep?
- Does this work on the X11 port in macOS? (I don't have a build ATM.)
- bug#27645: MacOS: run GUI Emacs without 'make install',
Charles A. Roelli <=
- bug#27645: MacOS: run GUI Emacs without 'make install', Charles A. Roelli, 2017/07/10
- bug#27645: MacOS: run GUI Emacs without 'make install', Alan Third, 2017/07/12
- bug#27645: MacOS: run GUI Emacs without 'make install', Jean-Christophe Helary, 2017/07/12
- bug#27645: MacOS: run GUI Emacs without 'make install', Charles A. Roelli, 2017/07/15
- bug#27645: MacOS: run GUI Emacs without 'make install', Charles A. Roelli, 2017/07/20
- bug#27645: MacOS: run GUI Emacs without 'make install', Alan Third, 2017/07/20
- bug#27645: MacOS: run GUI Emacs without 'make install', Charles A. Roelli, 2017/07/23
- bug#27645: MacOS: run GUI Emacs without 'make install', Charles A. Roelli, 2017/07/24