[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs script that works on all platforms
From: |
Pascal J. Bourguignon |
Subject: |
Re: Emacs script that works on all platforms |
Date: |
Wed, 08 Dec 2010 15:10:14 -0000 |
User-agent: |
Gnus/5.101 (Gnus v5.10.10) Emacs/23.1 (darwin) |
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
- Re: Emacs script that works on all platforms,
Pascal J. Bourguignon <=