Use emacsclient and set EDITOR to console emacs.