Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Recently I started seeing the following:

/usr/local/Cellar/git/1.7.3.2/libexec/git-core/git-sh-setup: 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.

EMACS_HOME="/Applications/Emacs.app/Contents/MacOS"                                                                                                                               

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

1 Answer 1

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

export GIT_EDITOR="/Applications/Emacs.app/Contents/MacOS/Emacs -nw"
share|improve this answer

Your Answer

 
discard

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.