OS Mac OS X 10.6.6 emacs 23.2.1

I'm currently trying to install magit on carbon emacs using their proposed make solution. I'm an almost complete makefile newby so I might be on the complete wrong path altogether. Makefile displays:

%.elc: %.el
$(BATCH) --eval '(byte-compile-file "$<")'

which gets expanded to:

emacs -batch -q -no-site-file -eval "(setq load-path (cons (expand-file-name \".\") load-path))" --eval '(byte-compile-file "magit.el")'

What I do understand. However it comes back with:

Cannot open load file: subst-ksc

What after a bit of googling reveals some missing libraries. I also realized that the emacs referenced in the expanded command is pointing to /usr/bin/emacs which is one big file, I don't see the normal lisp / site-lisp / etc directories. I also know that my prefered emacs is carbon emacs located in /Application/Emacs.app which just opens when clicking on it, or alternatively, I can open it in with the terminal:

open /Application/MyApp.app

Finally the title question: How can I make Makefile using the Emacs.app on the applications directory? I hope someone here knows the answer, or can point me to alternatives.

regards, Jeroen.

  • I think this belongs on StackExchange.com – user588 Feb 28 '11 at 20:33
  • site-lisp is located here: /usr/share/emacs/site-lisp – user588 Feb 28 '11 at 21:29

To use the Emacs.app from shell you need the unix executable embedded inside it. It is at Emacs.app/Contents/MacOS/Emacs (I don't have this version of emacs so the capitalisation might differ)

An alternative is to use open to start any app from the workspace using open.


open -a Emacs.app --args <all those passed to emacs>
  • 1
    Thank you for your answer! The first option went well thank (even capitalisation was spot on!). I could not get the second option to work. The open -a indeed brings emacs to the foreground (it is open already) but that is it. The batch/eval options / attributes seem to be ignored: open -a /Applications/Emacs22.app --args -batch -q -no-site-file -eval "(setq load-path (cons (expand-file-name \".\") load-path))" --eval '(byte-compile-file "magit.el")' – dr jerry Feb 28 '11 at 22:24
  • calling it from scratch (emacs closed) gives an error msg: LSOpenURLsWithRole() failed for the application /Applications/Emacs.app with error -10810. – dr jerry Feb 28 '11 at 22:31

I'm answering an older question in case anyone else happens across it via Google like I did.

As Mark pointed out, to byte-compile a file using the Emacs.app executable you need to replace emacs or /usr/bin/emacs in the Makefile with /Applications/Emacs.app/Contents/MacOS/Emacs. I believe that in general byte-compiled files are not compatible across different versions of Emacs, so when installing a package for use with Emacs.app you should byte-compile it using this executable, not with the default Apple-installed /usr/bin/emacs (which is a version 22 emacs on my 10.6 system).

If you do need to run the /usr/bin/emacs for some other reason, take care that EMACSLOADPATH doesn't contain files belonging to a newer Emacs. This is one potential cause of error messages such as

Cannot open load file: subst-ksc

Invoking emacs from the shell as

EMACSLOADPATH=/usr/share/emacs/22.1/leim:/usr/share/emacs/22.1/lisp:/usr/share/emacs/22.1/site-lisp emacs

should do the trick.

Hope this helps someone else!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .