A buffer can be made write-protected by toggling the read-only mode via M-x toggle-read-only
.
Is there a way to make a buffer read-only in a window, while editing it in another window?
Asked
Active
Viewed 186 times
7

AlQuemist
- 175
- 6
1 Answers
8
In your original buffer, where you want to keep editing it :
M-x clone-indirect-buffer
This would create another buffer, and by default open it in another window too. Initially both of these are editable. But a buffer specific mode change can be made in the second one - which will now become read only after you do the following :
M-x read-only-mode
Now this second buffer is your buffer in read-only mode - same content as the earlier read-write buffer.

Jeeves
- 611
- 4
- 5
-
could you please add some explanation? – AlQuemist Aug 17 '18 at 10:25
-
Ah, ok, one min. Since you were using M-x and toggling modes already, I thought you would understand very easily. – Jeeves Aug 17 '18 at 10:26
-
Thanks. IMO, it is better to add some explanation along with the commands for the general audience. – AlQuemist Aug 17 '18 at 10:36