unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#27645: MacOS: run GUI Emacs without 'make install'
@ 2017-07-10 19:06 Charles A. Roelli
  2017-07-10 19:12 ` Charles A. Roelli
  0 siblings, 1 reply; 9+ messages in thread
From: Charles A. Roelli @ 2017-07-10 19:06 UTC (permalink / raw)
  To: 27645

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.)






^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-24 18:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-10 19:06 bug#27645: MacOS: run GUI Emacs without 'make install' Charles A. Roelli
2017-07-10 19:12 ` Charles A. Roelli
2017-07-12 18:52   ` Alan Third
2017-07-12 22:24     ` Jean-Christophe Helary
2017-07-15 14:58     ` Charles A. Roelli
2017-07-20 18:58       ` Charles A. Roelli
2017-07-20 20:34         ` Alan Third
2017-07-23 15:02           ` Charles A. Roelli
2017-07-24 18:24             ` Charles A. Roelli

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).