Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make a opened buffer read only without reloading again with 'find-file-read-only'

Tags:

emacs

I like to have my coding buffers read-only when I am not editing them (like Vi modes edit, read-only). For that, I can use C-x C-q for turning a emacs buffer on/off the writable status. Seems that this write-locking feature has some inheritance from RCS or similar way of file-loking/revision-system so working with files under Version Control does not work:

C-x C-q
File is under version-control; use C-x v v to check in/out 

I don't want to check in/out I want only to prevent "cat-typing". I can write a macro flip-flop find-file-read-only '/'find-file ' and give some key-binding to it but I am sure there would be a solution inside emacs or .el written already. Any suggestion?

like image 732
Pablo Marin-Garcia Avatar asked Mar 01 '11 12:03

Pablo Marin-Garcia


1 Answers

You can use view-mode instead.

like image 133
Chen Levy Avatar answered Sep 22 '22 15:09

Chen Levy