Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have emacs on OS X that comes pre-installed, and is found in /usr/bin/emacs. It does not allow me to run it as a bg process (using &) and does not present me with a nice GUI.

I therefore installed the GUI package of emacs, which gets installed in /Applications/Emacs.app/Contents/MacOS - the executable name is Emacs.

I want my OS X to always point to /Applications/Emacs.app/Contents/MacOS/Emacs instead of /usr/bin/emacs. I updated my .profile and added the path of graphical Emacs to the PATH.

Now if I run which emacs, it results in:

/Applications/Emacs.app/Contents/MacOS/emacs
  1. Why would this work? Why is the Emacs GUI app now used instead of the pre-installed one?
  2. Why is the system printing 'emacs' in lowercase while the actual application name starts with an upper case?
share|improve this question

migrated from stackoverflow.com Aug 31 '11 at 17:45

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

  1. From the Wikipedia page on PATH:

    When a command name is specified by the user or an exec call is made from a program, the system searches the path, examining each directory from left to right in the list, looking for a filename that matches the command name. Once found, the program is executed as a child process of the command shell or program that issued the command.

  2. The default Mac OSX file system is case-insensitive by default. That is, there is no distinction between /Applications/Emacs.app/Contents/MacOS/Emacs and /Applications/Emacs.app/Contents/MacOS/emacs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.