From: pjb@informatimago.com (Pascal J. Bourguignon)
To: help-gnu-emacs@gnu.org
Subject: Re: Emacs script that works on all platforms
Date: Thu, 27 May 2010 16:12:58 +0200 [thread overview]
Message-ID: <lzeigxsaad.fsf@informatimago.com> (raw)
In-Reply-To: mailman.0.1274964713.14889.help-gnu-emacs@gnu.org
Johan Andersson <johan.rejeep@gmail.com> writes:
> Hey,
>
> To bad you could not get away with an alias or function though... But it works, thanks for the tip! :)
>
> On Fri, May 21, 2010 at 3:24 PM, Tassilo Horn <tassilo@member.fsf.org> wrote:
>
> Johan Andersson <johan.rejeep@gmail.com> writes:
>
> Hi Johan,
>
> > #!/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
> >
> > [...]
> >
> > I was thinking I could use env somehow, like this:
> > #!/usr/bin/env emacs --script
Well, unfortunately, someimes, env is /bin/env sometimes it's in
/usr/bin/env, so this doesn't really work either. (Of course, one of
these system is broken, but that's the deal).
So if you do a symlink to repair env, why not for emacs?
> Now I make a symlink to `less' that I call `emacs' inside
> /home/horn/bin:
That's an acceptable solution for your own needs. I even do it "per
project", installing project specific tool versions in a "opt"
directory, and generating an env.sh shell commands file to set the
PATH et al. for a specific project. When I switch from one project to
another, I just have to source the env.sh from the opt directory of
the new project, and I get all the tools and libraries in the versions
needed by that project.
But if you want to provide a script to other users on the same
system or on another system, you need something else.
Two options I find acceptable are either your script can work with
various versions, or it should come with an "installation" procedure
that will update the #! command.
--
__Pascal Bourguignon__
http://www.informatimago.com
next prev parent reply other threads:[~2010-05-27 14:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-20 19:01 Emacs script that works on all platforms 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 message]
[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=lzeigxsaad.fsf@informatimago.com \
--to=pjb@informatimago.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.