From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "Charles A. Roelli" Newsgroups: gmane.emacs.bugs Subject: bug#27645: MacOS: run GUI Emacs without 'make install' Date: Mon, 10 Jul 2017 21:06:26 +0200 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1499713639 2569 195.159.176.226 (10 Jul 2017 19:07:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 10 Jul 2017 19:07:19 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 To: 27645@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 10 21:07:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUe1W-00006N-6I for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Jul 2017 21:07:10 +0200 Original-Received: from localhost ([::1]:42563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUe1Y-0003X9-Ju for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Jul 2017 15:07:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38161) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUe1S-0003X3-Pd for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 15:07:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUe1P-0000Se-Lk for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 15:07:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUe1P-0000Sa-I8 for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 15:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dUe1P-0001Vq-7n for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 15:07:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Charles A. Roelli" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2017 19:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 27645 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14997136215803 (code B ref -1); Mon, 10 Jul 2017 19:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Jul 2017 19:07:01 +0000 Original-Received: from localhost ([127.0.0.1]:32985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUe1M-0001VX-TO for submit@debbugs.gnu.org; Mon, 10 Jul 2017 15:07:01 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:47119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dUe1L-0001VH-Cj for submit@debbugs.gnu.org; Mon, 10 Jul 2017 15:06:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUe1E-0000O8-Vx for submit@debbugs.gnu.org; Mon, 10 Jul 2017 15:06:53 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:55020) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dUe1E-0000O2-Sb for submit@debbugs.gnu.org; Mon, 10 Jul 2017 15:06:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38081) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUe1D-0003Wl-MF for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 15:06:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUe1A-0000N4-Hm for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 15:06:51 -0400 Original-Received: from [195.159.176.226] (port=42824 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUe1A-0000MK-Aa for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 15:06:48 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1dUe0u-0006sH-Cg for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2017 21:06:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 50 Original-X-Complaints-To: usenet@blaine.gmane.org X-Mozilla-News-Host: news://news.gmane.org:119 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:134408 Archived-At: 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.)