View a buffer in read-only mode in a window while editing it in another window

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
7
down vote

favorite












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?







share|improve this question
























    up vote
    7
    down vote

    favorite












    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?







    share|improve this question






















      up vote
      7
      down vote

      favorite









      up vote
      7
      down vote

      favorite











      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?







      share|improve this question












      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?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 17 at 8:19









      AlQuemist

      1385




      1385




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          8
          down vote



          accepted










          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.






          share|improve this answer






















          • could you please add some explanation?
            – AlQuemist
            Aug 17 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 at 10:26










          • Thanks. IMO, it is better to add some explanation along with the commands for the general audience.
            – AlQuemist
            Aug 17 at 10:36










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "583"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f44176%2fview-a-buffer-in-read-only-mode-in-a-window-while-editing-it-in-another-window%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          8
          down vote



          accepted










          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.






          share|improve this answer






















          • could you please add some explanation?
            – AlQuemist
            Aug 17 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 at 10:26










          • Thanks. IMO, it is better to add some explanation along with the commands for the general audience.
            – AlQuemist
            Aug 17 at 10:36














          up vote
          8
          down vote



          accepted










          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.






          share|improve this answer






















          • could you please add some explanation?
            – AlQuemist
            Aug 17 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 at 10:26










          • Thanks. IMO, it is better to add some explanation along with the commands for the general audience.
            – AlQuemist
            Aug 17 at 10:36












          up vote
          8
          down vote



          accepted







          up vote
          8
          down vote



          accepted






          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.






          share|improve this answer














          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.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 17 at 10:28

























          answered Aug 17 at 9:54









          Jeeves

          45135




          45135











          • could you please add some explanation?
            – AlQuemist
            Aug 17 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 at 10:26










          • Thanks. IMO, it is better to add some explanation along with the commands for the general audience.
            – AlQuemist
            Aug 17 at 10:36
















          • could you please add some explanation?
            – AlQuemist
            Aug 17 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 at 10:26










          • Thanks. IMO, it is better to add some explanation along with the commands for the general audience.
            – AlQuemist
            Aug 17 at 10:36















          could you please add some explanation?
          – AlQuemist
          Aug 17 at 10:25




          could you please add some explanation?
          – AlQuemist
          Aug 17 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 at 10:26




          Ah, ok, one min. Since you were using M-x and toggling modes already, I thought you would understand very easily.
          – Jeeves
          Aug 17 at 10:26












          Thanks. IMO, it is better to add some explanation along with the commands for the general audience.
          – AlQuemist
          Aug 17 at 10:36




          Thanks. IMO, it is better to add some explanation along with the commands for the general audience.
          – AlQuemist
          Aug 17 at 10:36

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f44176%2fview-a-buffer-in-read-only-mode-in-a-window-while-editing-it-in-another-window%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What does second last employer means? [closed]

          List of Gilmore Girls characters

          Confectionery