all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Johan Andersson <johan.rejeep@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Emacs script that works on all platforms
Date: Thu, 20 May 2010 21:01:05 +0200	[thread overview]
Message-ID: <AANLkTiltJUeJWZNyRQlzrcbPLLLFZDfRUu4Vbbz2ercr@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2010-05-20 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20 19:01 Johan Andersson [this message]
2010-05-21 13:24 ` Emacs script that works on all platforms 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
     [not found] <mailman.15.1274382091.29716.help-gnu-emacs@gnu.org>
2010-05-20 20:40 ` Frédéric Perrin
     [not found] ` <3c0b258e-32ae-4ab8-b936-3d304f3e4771@34g2000prs.googlegroups.com>
2010-05-22 12:31   ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTiltJUeJWZNyRQlzrcbPLLLFZDfRUu4Vbbz2ercr@mail.gmail.com \
    --to=johan.rejeep@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.