In my .bash_profile
, I use this:
export EDITOR=emacsclient
alias e='emacsclient -t'
When I commit changes with Git, it will open a new emacs window, but with emacs --daemon
.
How can I set my default Git editor to be emacs with the t flag enabled?
git config --global core.editor 'emacsclient -t -a=\"\"'
This will start a daemon if there is not already one running.
You may be having issues with quotation marks, as it shows up in my .gitconfig as
[core]
editor = emacsclient -t -a=\\\"\\\"
export GIT_EDITOR="`which emacsclient` -t -s $EMACS_SERVER_FILE"
git seems to muck with the PATH variable before calling your EDITOR or GIT_EDITOR so the built in emacsclient from /usr/bin gets called even if normally the emacsclient from your more up to date Emacs would be called. I solved this by getting the path to the executable from a subprocess which has its own environment I believe (either way it works...).
Tested on OS X 10.8.2 with Emacs 24.1 built locally, server running and clients connecting via socket.
I have not tested tcp clients.
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