summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles A. Roelli <charles@aurox.ch>2017-07-10 21:08:14 +0200
committerCharles A. Roelli <charles@aurox.ch>2017-07-23 16:48:33 +0200
commit2c87aab57946b95d67b664259f30e64468d08544 (patch)
treeb0236e5ba254f465ee0876ef3ff9ab48deeae800
parente1d1aa69e8cce480f51ebf81d5b0bb55c7ad4ec8 (diff)
downloademacs-2c87aab57946b95d67b664259f30e64468d08544.tar.gz
Enable GUI Emacs without 'make install' on macOS (Bug #27645)
* nextstep/INSTALL: Correct it, and mention that Emacs can be run from 'src/emacs'. * src/nsterm.m (applicationDidFinishLaunching:): When Emacs is launched outside of a macOS application bundle, change its activation policy from the default 'prohibited' to 'regular'. ; * etc/NEWS: Mention the change on macOS.
-rw-r--r--etc/NEWS3
-rw-r--r--nextstep/INSTALL16
-rw-r--r--src/nsterm.m13
3 files changed, 28 insertions, 4 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 4324d87991f..4cb02bf518a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1600,6 +1600,9 @@ debugger has been attached to it.
** 'set-mouse-position' and 'set-mouse-absolute-pixel-position' work
on macOS.
+** Emacs can now be run as a GUI application from the command line on
+macOS.
+
----------------------------------------------------------------------
This file is part of GNU Emacs.
diff --git a/nextstep/INSTALL b/nextstep/INSTALL
index 799cd4d866a..b7e84e018ee 100644
--- a/nextstep/INSTALL
+++ b/nextstep/INSTALL
@@ -21,15 +21,23 @@ In the top-level directory, use:
(On macOS, --with-ns is enabled by default.)
-This will compile all the files, but emacs will not be able to be run except
-in -nw (terminal) mode.
+Then run:
-In order to run Emacs.app, you must run:
+ make
+
+This will compile all the files.
+
+In order to run Emacs, you must run:
+
+ src/emacs
+
+In order to install Emacs, you must run:
make install
This will assemble the app in nextstep/Emacs.app (i.e., the --prefix
-argument has no effect in this case).
+argument has no effect in this case). You can then move the Emacs.app
+bundle to a location of your choice.
If you pass the --disable-ns-self-contained option to configure, the lisp
files will be installed under whatever 'prefix' is set to (defaults to
diff --git a/src/nsterm.m b/src/nsterm.m
index a3c7031331a..36d906a7cec 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -5497,6 +5497,19 @@ ns_term_shutdown (int sig)
object:nil];
#endif
+#ifdef NS_IMPL_COCOA
+ if ([NSApp activationPolicy] == NSApplicationActivationPolicyProhibited) {
+ /* Set the app's activation policy to regular when we run outside
+ of a bundle. This is already done for us by Info.plist when we
+ run inside a bundle. */
+ [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
+ [NSApp setApplicationIconImage:
+ [EmacsImage
+ allocInitFromFile:
+ build_string("icons/hicolor/128x128/apps/emacs.png")]];
+ }
+#endif
+
ns_send_appdefined (-2);
}