It seems it' ok to use 'EDITOR=emacs',it open GUI emacs. If I use 'EDITOR=emacs -nw', it fails.
There are many programs that launch an editor based on the
The safe option is to write a short script that calls your editor with the options you want and give it a name that doesn't include any special characters. Here's a sample script:
Call that script
By the way, if you have Emacs 23, you may want to set up the Emacs daemon and call