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: Sat, 15 Jul 2017 16:58:38 +0200 Message-ID: References: <7c02464a-7569-40a8-5746-7a6883dc251e@aurox.ch> <20170712185235.GB23391@breton.holly.idiocy.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------D97992D13029739DD45B1BFB" X-Trace: blaine.gmane.org 1500130756 7313 195.159.176.226 (15 Jul 2017 14:59:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 15 Jul 2017 14:59:16 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Cc: 27645@debbugs.gnu.org, jean.christophe.helary@gmail.com To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 15 16:59:11 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 1dWOXG-0001St-BI for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Jul 2017 16:59:10 +0200 Original-Received: from localhost ([::1]:42342 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWOXK-0002vz-Cv for geb-bug-gnu-emacs@m.gmane.org; Sat, 15 Jul 2017 10:59:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dWOXB-0002u0-RX for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2017 10:59:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dWOX8-00052x-PD for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2017 10:59:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:37823) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dWOX8-00052q-IL for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2017 10:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dWOX8-0008BJ-CG for bug-gnu-emacs@gnu.org; Sat, 15 Jul 2017 10:59:02 -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: Sat, 15 Jul 2017 14:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27645 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 27645-submit@debbugs.gnu.org id=B27645.150013073231433 (code B ref 27645); Sat, 15 Jul 2017 14:59:02 +0000 Original-Received: (at 27645) by debbugs.gnu.org; 15 Jul 2017 14:58:52 +0000 Original-Received: from localhost ([127.0.0.1]:40500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWOWy-0008Av-57 for submit@debbugs.gnu.org; Sat, 15 Jul 2017 10:58:52 -0400 Original-Received: from sinyavsky.aurox.ch ([37.35.109.145]:38243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dWOWw-0008Ai-7s for 27645@debbugs.gnu.org; Sat, 15 Jul 2017 10:58:50 -0400 Original-Received: from sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) by sinyavsky.aurox.ch (Postfix) with ESMTP id D0385224B4 for <27645@debbugs.gnu.org>; Sat, 15 Jul 2017 14:53:27 +0000 (UTC) Authentication-Results: sinyavsky.aurox.ch (amavisd-new); dkim=pass (1024-bit key) reason="pass (just generated, assumed good)" header.d=aurox.ch DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aurox.ch; h= content-type:content-type:in-reply-to:mime-version:user-agent :date:date:message-id:from:from:references:to:subject:subject; s=dkim; t=1500130405; x=1500994406; bh=0ZBOljMVDDWP56GmF/XusmSb OCrDlExLzt8JFO9k7N8=; b=EQ9S1H329jPYPUqZxnbKBIdZHZCifqApHSJTQEJv 2uA+W8lx269qisz5YUOv/krY0WhzPZx+jT3NMrrNVv2E2hmbdbHqoTQSNOAMrsJK StQ1hCwzHZcatdgggFyQoB7qEWRYNzdmaaPACI1NFapK4AkGHI3WzgoJsRlt6G5f OPg= X-Virus-Scanned: Debian amavisd-new at test.virtualizor.com Original-Received: from sinyavsky.aurox.ch ([127.0.0.1]) by sinyavsky.aurox.ch (sinyavsky.aurox.ch [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vzqnui-zGl00 for <27645@debbugs.gnu.org>; Sat, 15 Jul 2017 14:53:25 +0000 (UTC) Original-Received: from [192.168.1.120] (125.85.192.178.dynamic.wline.res.cust.swisscom.ch [178.192.85.125]) by sinyavsky.aurox.ch (Postfix) with ESMTPSA id 3845A22491; Sat, 15 Jul 2017 14:53:25 +0000 (UTC) In-Reply-To: <20170712185235.GB23391@breton.holly.idiocy.org> 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:134590 Archived-At: This is a multi-part message in MIME format. --------------D97992D13029739DD45B1BFB Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 12/07/2017 20:52, Alan Third wrote: > On Mon, Jul 10, 2017 at 09:12:14PM +0200, Charles A. Roelli wrote: >> The patch is attached. > I haven’t had a chance to test this, but it looks good, thanks for > working on it. > >> In the top-level directory, use: >> >> - ./configure --with-ns >> + make >> >> -(On macOS, --with-ns is enabled by default.) >> +This will compile all the files. > I understand that running make also runs configure, but I think it’s > worth leaving configure and the stuff about --with-ns in there. If you > try to build the NS port on anything other than macOS then you really > need to know about --with-ns. Thanks, I've put it back. > >> -This will compile all the files, but emacs will not be able to be run except >> -in -nw (terminal) mode. >> +In order to run Emacs, you must run: >> >> -In order to run Emacs.app, you must run: >> + src/emacs >> + >> +In order to install Emacs, you must run: >> >> make install > I read this as it’s going to install Emacs somewhere on my PC, it > should probably be something like: ‘To build Emacs.app ...’. > It may install it (with --disable-ns-self-contained). I've clarified this (hopefully). I've also placed the nsterm.m change inside #ifdef NS_IMPL_COCOA, since the activationPolicy doesn't seem to exist on GNUstep. See the updated patch again. --------------D97992D13029739DD45B1BFB Content-Type: text/x-patch; name="0001-Enable-GUI-Emacs-without-make-install-on-macOS-Bug-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Enable-GUI-Emacs-without-make-install-on-macOS-Bug-2.pa"; filename*1="tch" >From 37abf2a8e9a30377a2e064f111d546ec083c3363 Mon Sep 17 00:00:00 2001 From: Charles A. Roelli Date: Mon, 10 Jul 2017 21:08:14 +0200 Subject: [PATCH v2] 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. --- etc/NEWS | 3 +++ nextstep/INSTALL | 16 ++++++++++++---- src/nsterm.m | 13 +++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index edb7111..36cb80b 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1544,16 +1544,19 @@ execution and return control to the debugger. If no debugger is attached to the receiving process, the call is typically ignored. This is in contrast to the default action on POSIX Systems, where it causes the receiving process to terminate with a core dump if no 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. GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. diff --git a/nextstep/INSTALL b/nextstep/INSTALL index 799cd4d..b7e84e0 100644 --- a/nextstep/INSTALL +++ b/nextstep/INSTALL @@ -16,25 +16,33 @@ Compilation ----------- In the top-level directory, use: ./configure --with-ns (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 /usr/local). The bundle will be smaller, but depend on these resources (may require 'sudo' for "make install"). Installation diff --git a/src/nsterm.m b/src/nsterm.m index bf83550..7834bac 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -5474,16 +5474,29 @@ - (void)applicationDidFinishLaunching: (NSNotification *)notification #ifdef NS_IMPL_COCOA [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(antialiasThresholdDidChange:) name:NSAntialiasThresholdChangedNotification 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); } - (void)antialiasThresholdDidChange:(NSNotification *)notification { #ifdef NS_IMPL_COCOA macfont_update_antialias_threshold (); #endif -- 1.7.4.4 --------------D97992D13029739DD45B1BFB--