unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Emacs script that works on all platforms
@ 2010-05-20 19:01 Johan Andersson
  2010-05-21 13:24 ` Tassilo Horn
  0 siblings, 1 reply; 6+ messages in thread
From: Johan Andersson @ 2010-05-20 19:01 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 861 bytes --]

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?

[-- Attachment #2: Type: text/html, Size: 1142 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-05-27 14:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.15.1274382091.29716.help-gnu-emacs@gnu.org>
2010-05-20 20:40 ` Emacs script that works on all platforms Frédéric Perrin
     [not found] ` <3c0b258e-32ae-4ab8-b936-3d304f3e4771@34g2000prs.googlegroups.com>
2010-05-22 12:31   ` Tassilo Horn
2010-05-20 19:01 Johan Andersson
2010-05-21 13:24 ` Tassilo Horn
2010-05-27 12:51   ` Johan Andersson
     [not found]   ` <mailman.0.1274964713.14889.help-gnu-emacs@gnu.org>
2010-05-27 14:12     ` Pascal J. Bourguignon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).