Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run emacs from command line? #57

Closed
chetstone opened this issue Nov 27, 2016 · 2 comments
Closed

How to run emacs from command line? #57

chetstone opened this issue Nov 27, 2016 · 2 comments

Comments

@chetstone
Copy link

chetstone commented Nov 27, 2016

I installed emacs 25.1.1 using brew cask install emacs. All went well (I can run it by launching from the finder) until I tried to create a symlink to run emacs from the command line. I tried

ln -s /Applications/Emacs.app/Contents/MacOS/Emacs /usr/local/bin/emacs

and when I run it I get a popup that says This application will not run on your computer. Sorry!

I discovered that when run from the finder it actually uses Emacs-x86_64-10_9 (I'm on Yosemite) so I tried

ln -s /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_9 /usr/local/bin/emacs

and I get:

Warning: arch-dependent data dir '/Users/build/workspace/Emacs-Multi-Build/label/mavericks/emacs-source/nextstep/Emacs.app/Contents/MacOS/libexec/': No such file or directory
Warning: arch-independent data dir '/Users/build/workspace/Emacs-Multi-Build/label/mavericks/emacs-source/nextstep/Emacs.app/Contents/Resources/etc/': No such file or directory
Warning: Lisp directory '/Users/build/workspace/Emacs-Multi-Build/label/mavericks/emacs-source/nextstep/Emacs.app/Contents/Resources/lisp': No such file or directory
Error: charsets directory not found:
/Users/build/workspace/Emacs-Multi-Build/label/mavericks/emacs-source/nextstep/Emacs.app/Contents/Resources/etc/charsets
Emacs will not function correctly without the character map files.
Please check your installation!

What is the secret?

thanks

@caldwell
Copy link
Owner

Using an alias should work: alias emacs=/Application/Emacs.app/Contents/MacOS/Emacs. Of course that only works if you are typing emacs into a shell. If you want other programs to be able to launch Emacs (maybe it's in your EDITOR env var, for instance), you need to do something else. I use a little stub shell script (as described here):

#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$@"

I'm not going to close this bug though, because I think using a symlink should work. The launcher script should be able to detect that and act appropriately.

@chetstone
Copy link
Author

chetstone commented Nov 28, 2016 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants