[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac OS X GNU Emacs Installer (make-package)

From: Steven Tamm
Subject: Re: Mac OS X GNU Emacs Installer (make-package)
Date: Sat, 30 Nov 2002 15:19:25 -0800

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 */
  extern int inhibit_window_system;
  extern int noninteractive;
  CFBundleRef appsBundle;

  /* No need to test if already -nw*/
  if (inhibit_window_system || noninteractive)

  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)

  /* Unless we actually find the resource, set -nw */
  inhibit_window_system = 1;

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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]