Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

migrated from serverfault.com Aug 6 '11 at 22:10

This question came from our site for professional system and network administrators.

add comment

2 Answers

up vote 9 down vote accepted

You have to use

    export EDITOR="emacs -nw"

with the quotes, and it should work as expected.

share|improve this answer
add comment

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
share|improve this answer
2  
With EDITOR="emacsclient --alternate-editor= -t", emacsclient will start Emacs in daemon mode if necessary. –  Gilles Aug 13 '11 at 22:00
add comment

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.