I want to create a command line executable which will spawn an emacs window/application.
I searched on the internet and found that the emacs shipped with Mac is not supported in X11 window So, I downloaded the latest emacs from http://emacsformacosx.com/ and installed it in my mac.
Then I go to the /usr/bin directory and create a symbolic link like this:
sudo ln /Applications/Emacs.app/Contents/MacOS/Emacs xemacs
when I run this symblolic link by ./xemacs it says(. means /usr/bin):
Warning: arch-dependent data dir
does not exist. Warning: arch-independent data dir
does not exist. Error: charsets directory not found:
Emacs will not function correctly without the character map files.
Please check your installation!
But if I run the Emacs binary in directory /Applications/Emacs.app/Contents/MacOS/ it starts the application without any error.
Any one knows how to solve this problem?
Up to this point I think the best way is to create an executable script under /usr/bin which will execute the binary file /Applications/Emacs.app/Contents/MacOS/Emacs. The reason I didn't use "open" command is that I need to use some Emacs binary arguments. Compared to "open" this method can spawn multiple instance of emacs.
The script is :
#! /bin/sh /Applications/Emacs.app/Contents/MacOS/Emacs "[email protected]"
Then make it executable by doing chmod +x script.sh
then make the symlink
ln -s "/usr/local/bin/script.sh" /usr/local/bin/xemacs
You could use an alias:
alias emacs="open -a Emacs --args <youroptions>.
--args allows you to pass options directly to emacs (e.g.,
-q avoids the evaluation of the init script).