I am using MAC OX 10.6 , and install the emacs from here http://emacsformacosx.com/
I want to know how to start it in terminal, so my ecb can open current directory
OS X comes with a preinstalled version of Emacs, but alas it is the outdated Emacs 22. Fortunately, obtaining a newer release is really simple. There are several popular ways to do it.
fn + left: to go to the beginning of the line.
It is actually quite easy, just run it from terminal like this:
/Applications/Emacs.app/Contents/MacOS/Emacs -nw
the -nw option means to start emacs without the gui frame.
You can put the following in your shell (on my mac .zshenv) :
alias Emacs="/Applications/Emacs.app/Contents/MacOS/Emacs -nw"
Then I just have two commands:
Emacs
: for emacs version 24
emacs
: for the apple version of emacs
Of course you can just alias the Emacs.app to emacs, but this allows me to customize the two differently - for instance Emacs 24 allows me to use list-packages and so forth. emacs 22 ignores most of this, so I can always revert to a 'bare metal' emacs if need be. Your usage may vary, but if you don't remember the arguments to emacs you can find them by doing this:
emacs --help
Some interesting ones:
Emacs.app --fullscreen Emacs.app --line-spacing Emacs.app --vertical-scroll-bars
More info here : http://www.gnu.org/software/emacs/manual/html_node/emacs/Option-Index.html#Option-Index
The answer from @Toymakerii is a good one, but you might also consider adding:
export PATH=/Applications/Emacs.app/Contents/MacOS/bin:$PATH
This way, you can use emacsclient
to open files in an already-running Emacs instance:
emacsclient -t SOMEFILE # Open SOMEFILE in a terminal frame emacsclient -c SOMEFILE # Open SOMEFILE in a new graphical frame
Depending on your Emacs version, you might need to put the following in your ~/.emacs.d/init.el
(or ~/.emacs
, if you're old-fashioned):
(require 'server) (unless (server-running-p) (server-start))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With