Symlinking Emacs.app to the $PATH

Vincent Lefevre vincent-opdarw at vinc17.org
Fri Nov 14 06:14:43 PST 2008


On 2008-11-14 00:29:03 -0600, Ryan Schmidt wrote:
> alias emacs='open -a "/Applications/MacPorts/Emacs.app"'

This won't work with options. It's better to write a wrapper script.
I use the following one:

#!/bin/sh

app="Emacs.app/Contents/MacOS/Emacs"
#emacs="/Applications/$app"
test -x "$emacs" || emacs="/Applications/MacPorts/$app"
test -x "$emacs" || emacs="/usr/bin/emacs"

exec "$emacs" ${SSH_CONNECTION:+-nw} ${SCREEN_IN_SSH:+-nw} "$@"

This also allows Emacs to automatically run in the terminal (instead
of the physical screen) when it is a ssh session (one can also do
this for a screen session recalled from a ssh session, but this
needs some config).

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)


More information about the macports-users mailing list