Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Git version that I built from source, zsh is my shell, and emacs is my editor.

Recently I started seeing the following:

/usr/local/Cellar/git/ line 106: emacs: command not found

Could not execute editor

My zshrc looks like the following so I can use the Cocoa build and the console binary provided with it.


function e()  { PATH=$EMACS_HOME/bin:$PATH $EMACS_HOME/Emacs -nw $@ }                                                                                                             
function ec() { PATH=$EMACS_HOME/bin:$PATH emacsclient -t $@ }                                                                                                                    

function es() { e --daemon=$1 && ec -s $1 }                                                                                                                                       
function el() { ps ax|grep Emacs }                                                                                                                                                
function ek() { $EMACS_HOME/bin/emacsclient -e '(kill-emacs)' -s $1 }                                                                                                             

function ecompile() {                                                                                                                                                             
   e -eval "(setq load-path (cons (expand-file-name \".\") load-path))" \                                                                                                         
       -batch -f batch-byte-compile $@                                                                                                                                            

alias emacs=e                                                                                                                                                                     
alias emacsclient=ec

And I also have

export EDITOR="emacs"

and have tried adding

export GIT_EDITOR="emacs" 

(and swapping that out with "e")

But whatever I try I can't get git to open emacs whenever I need to do a commit or an interactive rebase, etc etc...

share|improve this question
which emacs? Or maybe enter the full path to emacs in EDITOR? – Daniel Beck Jan 13 '11 at 16:06
A very recent build of Emacs 24. And yes, a full path might be necessary... – mwilliams Jan 13 '11 at 16:22
Would you mind if I answered it for the 15 rep when accepted? – Daniel Beck Jan 13 '11 at 16:51

I needed to skip the functions built in my .zshrc and reference the full path for $GIT_EDITOR.

export GIT_EDITOR="/Applications/ -nw"
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.