Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In my latest ubuntu box,

  1. When I type for example emacs ~/.bashrc, Emacs will start but not open .bashrc. This is true for any file I pass in. I've used Emacs for several years, and have never experienced this problem before.

  2. I added (global-font-lock-mode 1);; to my .emacs file, and Emacs does recognize it, for example. "(C++/; Abbrev)", but it won't do syntax highlighting.

If you can solve any of these problems, it will be very appreciated. The following is my machine's configuration:

uname -a
Linux 2.6.35-28-generic-pae #49-Ubuntu SMP Tue Mar 1 14:58:06 UTC 2011 i686 GNU/Linux

(global-font-lock-mode 1);;

share|improve this question

migrated from stackoverflow.com Mar 27 '11 at 8:13

This question came from our site for professional and enthusiast programmers.

Better asked on askubuntu.com –  Oded Mar 26 '11 at 21:22
What happens if you start emacs then use C-x C-f to open ~/.bashrc? Might give you a useful error message. –  Tom Zych Mar 26 '11 at 21:27
Does the *Messages* buffer contain anything useful? –  MatthewD Mar 27 '11 at 2:35
hi thanks a lot, it seems it is caused by the directory ~/.emacs.d, emacs actually complains upon startup :"~/.emacs.d already exists". So I removed ~/.emacs.d, and now everything works! (I can open files through command line argument and syntax highlighting also works now). @Tom, previously I can start emacs, and then use C-x C-f to open .bashrc, but cannot open by > emacs ~/.bashrc –  Jus Mar 27 '11 at 5:13

3 Answers 3

I got the same problem. It was due to the fact I first used emacs with sudo. As a consequence the .emacs.d was created with super user right and I could not access it as a regular user.

By removing the .emacs.d created as root let emacs generate a new one with your user account.

share|improve this answer
or you can simply change owner sudo chown -hR <groupname>:<username> .emacs.d/ –  logcat Aug 5 '13 at 6:11
Yep, this fixed the problem. It'd be great if emacs showed some information about this error... –  José Tomás Tocino May 1 '14 at 15:03

Remember: you may have either ~/.emacs file or a ~/.emacs.d/ directory, not both. In the latter case you use ~/.emacs.d/init.el file instead of ~/.emacs file.

share|improve this answer

initial-buffer-choice in startup.el allows initial file customization.

share|improve this answer
perhaps some context would be helpful. An example config? –  JoshP Sep 28 '12 at 14:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.