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?

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.

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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