7

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?

AlQuemist
  • 175
  • 6

1 Answers1

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