Closed shawnohare closed 4 years ago
Not a bad shout, I'll put something together for the README.
In the meantime though, this gets a little tricky, as you can't just symlink the main executable to somewhere else, because it depends on all the files within the application bundle, and executing it outside of the bundle via a symlink or hardlink, means the executable can't find any other parts of Emacs to run.
Normally with CLI-only installs of Emacs, it will have all of it's internal guts (lisp files, libraries, etc.) placed in absolute paths on disk, so the physical location on disk of the executable or symlinks to it don't matter that much.
Personally I use shell aliases to create a emacs
command for use in the
terminal, from my emacs.zsh shell setup file:
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -f "/Applications/Emacs.app/Contents/MacOS/Emacs" ]; then
alias emacsgui="env TERM=screen-24bit /Applications/Emacs.app/Contents/MacOS/Emacs"
alias emacs="env TERM=screen-24bit /Applications/Emacs.app/Contents/MacOS/Emacs -nw"
fi
if [ -f "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient" ]; then
alias emacsclient="env TERM=screen-24bit /Applications/Emacs.app/Contents/MacOS/bin/emacsclient"
fi
fi
As for doom-emacs, I've just had a look at how its doom
command initializes
itself, and it either uses the value of a EMACS
environment variable as the
executable, or if that's not set, just uses emacs
.
So for doom-emacs' doom
command to work, setting EMACS
seems to work for me.
Something like this in your shell setup should do the trick:
export EMACS="/Applications/Emacs.app/Contents/MacOS/Emacs"
Thanks for the quick response. I think adding the alias snippet to the README would be very helpful, and works well enough until the native-comp feature is readily packaged.
If possible, it would be useful to provide some basic instructions in the README about how to execute the built Emacs.app from the command line. My naive attempts to do this failed.
I successfully built Emacs.app against
feature/native-comp
yesterday. I symlinked the builtEmacs.app
into/Applications/Emacs.app
and then tried to link to underlying executable as follows, but have issues with dynamic linkage:I appear to be able to open emacs via Spotlight just fine, but can't successfully run a doom-emacs install since the linked emacs executable fails.
One obvious solution, which I dislike, is to just modify PATH to include the built emacs executable. Is there another way? In either case I'm sure a few sentences in the README would help.