From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Steven Tamm Newsgroups: gmane.emacs.devel Subject: Re: Mac OS X GNU Emacs Installer (make-package) Date: Sat, 30 Nov 2002 15:19:25 -0800 Sender: emacs-devel-admin@gnu.org Message-ID: <2ABC8327-04BA-11D7-AADA-00039390AB82@mac.com> References: <2147483647.1038667720@[10.0.0.2]> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v548) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1038698380 4262 80.91.224.249 (30 Nov 2002 23:19:40 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 30 Nov 2002 23:19:40 +0000 (UTC) Cc: emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18IGte-00016b-00 for ; Sun, 01 Dec 2002 00:19:38 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18IH1u-0008N0-00 for ; Sun, 01 Dec 2002 00:28:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 18IGua-0007UD-00; Sat, 30 Nov 2002 18:20:36 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 18IGtW-0004zx-00 for emacs-devel@gnu.org; Sat, 30 Nov 2002 18:19:30 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 18IGtU-0004zl-00 for emacs-devel@gnu.org; Sat, 30 Nov 2002 18:19:29 -0500 Original-Received: from a17-250-248-87.apple.com ([17.250.248.87] helo=smtpout.mac.com) by monty-python.gnu.org with esmtp (Exim 4.10) id 18IGtT-0004yY-00 for emacs-devel@gnu.org; Sat, 30 Nov 2002 18:19:27 -0500 Original-Received: from asmtp01.mac.com (asmtp01-qfe3 [10.13.10.65]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id gAUNJRdY027441 for ; Sat, 30 Nov 2002 15:19:27 -0800 (PST) Original-Received: from mac.com ([12.236.43.16]) by asmtp01.mac.com (Netscape Messaging Server 4.15) with ESMTP id H6EWSE00.6AR; Sat, 30 Nov 2002 15:19:26 -0800 Original-To: David Caldwell In-Reply-To: <2147483647.1038667720@[10.0.0.2]> X-Mailer: Apple Mail (2.548) Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:9767 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:9767 On Saturday, November 30, 2002, at 02:48 PM, David Caldwell wrote: > On 11/30/02 2:23 PM -0800 Steven Tamm wrote: > >> For the list: Why does "make install" install two identical copies of >> the >> executable; emacs & emacs-21.3.50? Why is emacs not a symbolic link? > > It's a hard link... ls -i and check that the inodes are the same > number. Now I feel like an idiot. I even checked for that, but in the wrong directory. I'll revert it, test it, and check it in. > > I have some patches for make-package as well. Should I send them to > the list? Yes, please. > > The second one is more controversial, I think. I made a little shell > wrapper that launches the Emacs.app so that typing plain "emacs" in > the shell doesn't segfault. Since the user should be free to move his > /Applications/Emacs.app around as he sees fit, I can't call that > wrapper. So I made a duplicate app wrapper in libexec. I hard linked > it to the emacs exe in /Applications/Emacs.app so it doesn't take up > any more room in the disk image, nor on the system. It has complete > transparency to the user, I think. This is the solution that Andrew proposes. /usr/local/bin/emacs would be a shell script that calls /usr/local/bin/emacs-21.3.50 -nw $*. I don't like that solution very much. This is a patch I placed on the list earlier; it causes the executable to determine if it is inside an application bundle. If it is not, it will cause it to inhibit_windowing_system. I placed the call to this right after the call to init_mac_osx_environment inside emacs.c:main /* Determine if the executable is not in a bundle, and if so, do not attempt to start up the window system */ void mac_determine_bundle_status() { #if MAC_OSX extern int inhibit_window_system; extern int noninteractive; CFBundleRef appsBundle; /* No need to test if already -nw*/ if (inhibit_window_system || noninteractive) return; appsBundle = CFBundleGetMainBundle(); if (appsBundle != NULL) { CFStringRef cfBI = CFSTR("CFBundleIdentifier"); CFTypeRef res = CFBundleGetValueForInfoDictionaryKey(appsBundle, cfBI); /* We found the bundle identifier, now we know we are valid. */ if (res != NULL) { CFRelease(res); return; } } /* Unless we actually find the resource, set -nw */ inhibit_window_system = 1; #endif } BTW, I think making Contents/MacOS/Emacs be a hard link to emacs-21.3.50 is a bad idea. The Application may (and in my case usually will) live on a different volume than the /usr/local tree. I'll keep the symlink option there for the Application, but remove the bad behavior. -Steven