Bug 19736

Summary: eshell should set EDITOR (at least, when needed)
Product: Branch 4.1 Reporter: Ivan Zakharyaschev <imz>
Component: emacs22-commonAssignee: Eugene Vlasov <eugvv>
Status: CLOSED NOTABUG QA Contact: qa-4.1 <qa-4.1>
Severity: normal    
Priority: P3    
Version: unspecified   
Hardware: all   
OS: Linux   

Description Ivan Zakharyaschev 2009-04-23 18:09:18 MSD
emacs22-common-22.2-alt5

It would be convenient if eshell set EDITOR=emacsclient (at least if EDITOR is initially unset, or perhaps better always).

Then, in the following case, the message could be edited in an Emacs buffer, when "git commit" is called in eshell: 

~/.ssh $ git commit
Terminal is dumb but no VISUAL nor EDITOR defined.
Please supply the message using either -m or -F option.
~/.ssh $
Comment 1 Eugene Vlasov 2009-04-23 23:11:35 MSD
There is several ways to do that:

1. Set EDITOR variable in your session (or just run emacs as "EDITOR=emacsclient emacs").
2. Use something like

(add-hook 'eshell-mode-hook
         '(lambda () (setenv "EDITOR" "emacsclient")))

in your init-file
3. Or use M-x shell (M-x term) (and set this variable in ~/.emacs_SHELLNAME).