I have setup emacs as my default editor in /etc/profile. When I want to use emacs in a terminal. I open it with the -nw option. How can I have the same behavior when doing a crontab -e preventing it to open in a window?

  • "I have setup emacs as my default editor in /etc/profile" how?
    – Ant6n
    Sep 29, 2017 at 1:15

2 Answers 2


You have to use

    export EDITOR="emacs -nw"

with the quotes, and it should work as expected.


If you think starting emacs every time is slow, you can also use:

export EDITOR="emacsclient -t"

However, you will have to start the emacs server once using:

emacs --daemon
  • 2
    With EDITOR="emacsclient --alternate-editor= -t", emacsclient will start Emacs in daemon mode if necessary. Aug 13, 2011 at 22:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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