0

This problem is driving me crazy. Emacs open all buffers including new ones in read only mode (yes, I know that I can do C-x C-q). I've tried everything including:

  • Delete .emacs.d/
  • Delete .config/emacs/init.el
  • Delete .emacs.el
  • Launch Emacs as: emacs -q -Q --debug-init (no errors, same behavior)
  • Reinstall Emacs.

I am using gentoo. I've create a new user (guest). Emacs works as expected. I guess the problem is somehow related to my user.

I can open a file in nano, edit it and save it. No problem. Afterwards, I open the same file in emacs it opens in read only mode. I have to hit Ctrl-Q to edit it. I can save it without problems. It's an emacs problem

All the files have write permission, that's why I can open and edit them in nano for instance.

Any help would be much appreciated.

4
  • Can you edit files in another editor? This may not be an emacs problem. Commented Oct 3, 2020 at 18:04
  • Do you see the same behavior if you start Emacs with emacs -Q (no init file)? If not, bisect your init file to find the culprit.
    – Drew
    Commented Oct 3, 2020 at 18:54
  • 1
    Have you checked that you have write permission for the files you are opening?
    – mikado
    Commented Oct 6, 2020 at 6:02
  • I have the opposite problem. I want emacs to open files read-only by default and for me to have to explicitly set it to writeable. Reason being, sometimes I'll be working with say very similar looking configuration files where I want to copy from one to the other but if I'm not careful I end up editing the wrong one by mistake.
    – tomsgd
    Commented Aug 10, 2023 at 7:50

1 Answer 1

0

Check for a .dir-locals.el file.

I had the same symptoms, and in my case there was a .dir-locals.el (at the top of my git repos, next to .git), containing this line:

((nil . ((buffer-read-only . t))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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