1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

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.
This commit is contained in:
Charles A. Roelli 2017-07-10 21:08:14 +02:00
parent e1d1aa69e8
commit 2c87aab579
3 changed files with 28 additions and 4 deletions

View file

@ -1600,6 +1600,9 @@ debugger has been attached to it.
** 'set-mouse-position' and 'set-mouse-absolute-pixel-position' work ** 'set-mouse-position' and 'set-mouse-absolute-pixel-position' work
on macOS. on macOS.
** Emacs can now be run as a GUI application from the command line on
macOS.
---------------------------------------------------------------------- ----------------------------------------------------------------------
This file is part of GNU Emacs. This file is part of GNU Emacs.

View file

@ -21,15 +21,23 @@ In the top-level directory, use:
(On macOS, --with-ns is enabled by default.) (On macOS, --with-ns is enabled by default.)
This will compile all the files, but emacs will not be able to be run except Then run:
in -nw (terminal) mode.
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 make install
This will assemble the app in nextstep/Emacs.app (i.e., the --prefix 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 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 files will be installed under whatever 'prefix' is set to (defaults to

View file

@ -5497,6 +5497,19 @@ ns_term_shutdown (int sig)
object:nil]; object:nil];
#endif #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); ns_send_appdefined (-2);
} }