help-gnu-emacs
[Top][All Lists]
Advanced

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

Emacs script that works on all platforms


From: Johan Andersson
Subject: Emacs script that works on all platforms
Date: Thu, 20 May 2010 21:01:05 +0200

Hey,


I have an Emacs script where the first line looks like this:
#!/usr/bin/emacs --script

However, on Mac OSX, Emacs is installed by default, but with an old version.

I have also installed Emacs via Homebrew (compiled from source) and can run that with:
/Usr/local/Cellar/emacs/23.2/Emacs.app/Contents/MacOS/Emacs

So, to run the script with the Homebrew version, I could change the first line in my script to:
#!/Usr/local/Cellar/emacs/23.2/Emacs.app/Contents/MacOS/Emacs --script

That works, but I want this script to work on both GNU/Linux and Mac OSX (Both default and Homebrew version).

I was thinking I could use env somehow, like this:
#!/usr/bin/env emacs --script

And then make emacs an alias or function that points to the correct binary depending on system. But it's still the default Emacs that is used.


Any ideas how I could solve this?

reply via email to

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