1

First, I tried installing the latest emacs-nox, but that did not work.

Then, I added -nw to my ~/.bash_aliases, which works in most cases, except when I need to run sudo emacs [file] I still get emacs with X. Furthermore, when I set my git editor to emacs, and run git commit -a, emacs with X pops up. How do I disable X globally, so I don't have to go around adding -nw to every possible configuration?

Ann Kilzer
  • 183
  • 2
  • 8
  • Why not use sudo emacs -nw [file[? – waltinator Apr 08 '15 at 12:49
  • Because I hate typing. On 12.04, I used to be able to just type sudo emacs [file] – Ann Kilzer Apr 08 '15 at 15:21
  • So this is incredibly frustrating. I tried to clarify a question with disabling X support, noting that it didn't work with sudo. Then, I was asked to post it as a separate question. Now, that separate question gets flagged as duplicate. – Ann Kilzer Apr 08 '15 at 15:23
  • 1
    This is different than "Aliases not available when using sudo" because I'm really looking for an answer on why emacs-nox doesn't work out of the box. – Ann Kilzer Apr 08 '15 at 15:24
  • Well, turns out I didn't properly remove xemacs. apt-get remove emacs didn't clean up the right one, but adding * to the end of that command solved everything. So not sure this question is even helpful anymore. – Ann Kilzer Apr 08 '15 at 20:14
  • @EliahKagan Regarding the meta post, I was just frustrated and venting. I want to try to improve the questions here, but it takes rank, which is hard to earn. It probably wasn't the right place for that sort of discussion, and I'd like to move on, since it's not worth arguing anymore. Anyhow, thanks for listening. – Ann Kilzer Apr 08 '15 at 20:31
  • Understood. I do hope this still gets reopened, though, as I believe this emacs-specific question will be useful to others (and much more visible to them if not closed as a duplicate of a question about sudo and aliases in general, where emacs-specific answers wouldn't fit). Furthermore, there may be other solutions, which could be posted as answers. In particular, I wonder if emacs can be configured (i.e., with per-user configuration stored in dotfiles) to assume -nw. – Eliah Kagan Apr 08 '15 at 20:36

1 Answers1

0

So far I've had success making bash aliases for emacs and sudo. Edit your ~/.bashrc (or ~/.bash_aliases if you use that) to include the following:

alias emacs="emacs -nw"
alias sudo="sudo "

I'm still disappointed that the latest emacs-nox doesn't just work out of the box.

Update: I found I had not properly removed the old version of emacs. Make sure when you run the remove command, you include the *:

apt-get remove emacs*
apt-get install emacs23-nox
Ann Kilzer
  • 183
  • 2
  • 8