Adjust the line according to the screen width












1














I copied a long sentence to org-mode




As I mentioned in the last section, Richard Stallman, the founder of the Free Software Foundation, was more than a programmer. He was an educated social critic, and his vision of the future was to have an enormous impact on the world.
enter image description here




I tried to achieve line-break automatically with auto-fill-mode, but get a result as



enter image description here



How could I enable it to extend and shrink according the the screen width rather than the line limitation of 80 words.










share|improve this question



























    1














    I copied a long sentence to org-mode




    As I mentioned in the last section, Richard Stallman, the founder of the Free Software Foundation, was more than a programmer. He was an educated social critic, and his vision of the future was to have an enormous impact on the world.
    enter image description here




    I tried to achieve line-break automatically with auto-fill-mode, but get a result as



    enter image description here



    How could I enable it to extend and shrink according the the screen width rather than the line limitation of 80 words.










    share|improve this question

























      1












      1








      1







      I copied a long sentence to org-mode




      As I mentioned in the last section, Richard Stallman, the founder of the Free Software Foundation, was more than a programmer. He was an educated social critic, and his vision of the future was to have an enormous impact on the world.
      enter image description here




      I tried to achieve line-break automatically with auto-fill-mode, but get a result as



      enter image description here



      How could I enable it to extend and shrink according the the screen width rather than the line limitation of 80 words.










      share|improve this question













      I copied a long sentence to org-mode




      As I mentioned in the last section, Richard Stallman, the founder of the Free Software Foundation, was more than a programmer. He was an educated social critic, and his vision of the future was to have an enormous impact on the world.
      enter image description here




      I tried to achieve line-break automatically with auto-fill-mode, but get a result as



      enter image description here



      How could I enable it to extend and shrink according the the screen width rather than the line limitation of 80 words.







      org-mode






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked yesterday









      user10726006user10726006

      194




      194






















          3 Answers
          3






          active

          oldest

          votes


















          5














          It sounds like you don't want "hard" returns at the end of lines, and you instead just want "soft" returns. That is, you don't want to insert end-of-line characters, such as newline. You just want lines to appear broken, and you want the apparent line breaks to be just before the window edge. Is that right?



          If so, what you want is to just turn on visual-line-mode in a given buffer -- or global-visual-line-mode, if you want this behavior in all buffers. (And turn off auto-fill-mode.)



          C-h f visual-line-mode tells you this:




          visual-line-mode is an interactive compiled Lisp function in
          simple.el.



          (visual-line-mode &optional ARG)



          Toggle visual line based editing (Visual Line mode) in the current buffer.



          Interactively, with a prefix argument, enable
          Visual Line mode if the prefix argument is positive,
          and disable it otherwise. If called from Lisp, toggle
          the mode if ARG is toggle, disable the mode if ARG is
          a non-positive integer, and enable the mode otherwise
          (including if ARG is omitted or nil or a positive integer).



          When Visual Line mode is enabled, word-wrap is turned on in
          this buffer, and simple editing commands are redefined to act on
          visual lines, not logical lines. See Info node Visual Line Mode for details.







          share|improve this answer





























            0














            create a function that sets the fill-mode width to (window-width) and add it to the post-command-hook






            share|improve this answer

















            • 3




              An example would make this answer much more useful.
              – Stefan
              yesterday



















            0














            C-x f to set a fill-column variable.
            M-q to fill paragraph or selection to that width.



            As a minor mode:



            (defun dynamic-fill-column-set-var (frame)
            (when dynamic-fill-column-mode
            (setq fill-column (- (window-total-width) 3))))

            (defun dynamic-fill-column-buffer-list-change ()
            (when dynamic-fill-column-mode
            (setq fill-column (- (window-total-width) 3))))

            (define-minor-mode dynamic-fill-column-mode
            "Sets `fill-column' when buffer's window is resized"
            :lighter " DFC"
            (if dynamic-fill-column-mode
            (progn
            (add-hook 'window-size-change-functions 'dynamic-fill-column-set-var nil t)
            (add-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change nil t))
            (remove-hook 'window-size-change-functions 'dynamic-fill-column-set-var t)
            (remove-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change t)))


            after resizing M-q(executes fill-paragraph function).






            share|improve this answer










            New contributor




            Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















              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',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              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%2f46935%2fadjust-the-line-according-to-the-screen-width%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              5














              It sounds like you don't want "hard" returns at the end of lines, and you instead just want "soft" returns. That is, you don't want to insert end-of-line characters, such as newline. You just want lines to appear broken, and you want the apparent line breaks to be just before the window edge. Is that right?



              If so, what you want is to just turn on visual-line-mode in a given buffer -- or global-visual-line-mode, if you want this behavior in all buffers. (And turn off auto-fill-mode.)



              C-h f visual-line-mode tells you this:




              visual-line-mode is an interactive compiled Lisp function in
              simple.el.



              (visual-line-mode &optional ARG)



              Toggle visual line based editing (Visual Line mode) in the current buffer.



              Interactively, with a prefix argument, enable
              Visual Line mode if the prefix argument is positive,
              and disable it otherwise. If called from Lisp, toggle
              the mode if ARG is toggle, disable the mode if ARG is
              a non-positive integer, and enable the mode otherwise
              (including if ARG is omitted or nil or a positive integer).



              When Visual Line mode is enabled, word-wrap is turned on in
              this buffer, and simple editing commands are redefined to act on
              visual lines, not logical lines. See Info node Visual Line Mode for details.







              share|improve this answer


























                5














                It sounds like you don't want "hard" returns at the end of lines, and you instead just want "soft" returns. That is, you don't want to insert end-of-line characters, such as newline. You just want lines to appear broken, and you want the apparent line breaks to be just before the window edge. Is that right?



                If so, what you want is to just turn on visual-line-mode in a given buffer -- or global-visual-line-mode, if you want this behavior in all buffers. (And turn off auto-fill-mode.)



                C-h f visual-line-mode tells you this:




                visual-line-mode is an interactive compiled Lisp function in
                simple.el.



                (visual-line-mode &optional ARG)



                Toggle visual line based editing (Visual Line mode) in the current buffer.



                Interactively, with a prefix argument, enable
                Visual Line mode if the prefix argument is positive,
                and disable it otherwise. If called from Lisp, toggle
                the mode if ARG is toggle, disable the mode if ARG is
                a non-positive integer, and enable the mode otherwise
                (including if ARG is omitted or nil or a positive integer).



                When Visual Line mode is enabled, word-wrap is turned on in
                this buffer, and simple editing commands are redefined to act on
                visual lines, not logical lines. See Info node Visual Line Mode for details.







                share|improve this answer
























                  5












                  5








                  5






                  It sounds like you don't want "hard" returns at the end of lines, and you instead just want "soft" returns. That is, you don't want to insert end-of-line characters, such as newline. You just want lines to appear broken, and you want the apparent line breaks to be just before the window edge. Is that right?



                  If so, what you want is to just turn on visual-line-mode in a given buffer -- or global-visual-line-mode, if you want this behavior in all buffers. (And turn off auto-fill-mode.)



                  C-h f visual-line-mode tells you this:




                  visual-line-mode is an interactive compiled Lisp function in
                  simple.el.



                  (visual-line-mode &optional ARG)



                  Toggle visual line based editing (Visual Line mode) in the current buffer.



                  Interactively, with a prefix argument, enable
                  Visual Line mode if the prefix argument is positive,
                  and disable it otherwise. If called from Lisp, toggle
                  the mode if ARG is toggle, disable the mode if ARG is
                  a non-positive integer, and enable the mode otherwise
                  (including if ARG is omitted or nil or a positive integer).



                  When Visual Line mode is enabled, word-wrap is turned on in
                  this buffer, and simple editing commands are redefined to act on
                  visual lines, not logical lines. See Info node Visual Line Mode for details.







                  share|improve this answer












                  It sounds like you don't want "hard" returns at the end of lines, and you instead just want "soft" returns. That is, you don't want to insert end-of-line characters, such as newline. You just want lines to appear broken, and you want the apparent line breaks to be just before the window edge. Is that right?



                  If so, what you want is to just turn on visual-line-mode in a given buffer -- or global-visual-line-mode, if you want this behavior in all buffers. (And turn off auto-fill-mode.)



                  C-h f visual-line-mode tells you this:




                  visual-line-mode is an interactive compiled Lisp function in
                  simple.el.



                  (visual-line-mode &optional ARG)



                  Toggle visual line based editing (Visual Line mode) in the current buffer.



                  Interactively, with a prefix argument, enable
                  Visual Line mode if the prefix argument is positive,
                  and disable it otherwise. If called from Lisp, toggle
                  the mode if ARG is toggle, disable the mode if ARG is
                  a non-positive integer, and enable the mode otherwise
                  (including if ARG is omitted or nil or a positive integer).



                  When Visual Line mode is enabled, word-wrap is turned on in
                  this buffer, and simple editing commands are redefined to act on
                  visual lines, not logical lines. See Info node Visual Line Mode for details.








                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered yesterday









                  DrewDrew

                  47.1k462104




                  47.1k462104























                      0














                      create a function that sets the fill-mode width to (window-width) and add it to the post-command-hook






                      share|improve this answer

















                      • 3




                        An example would make this answer much more useful.
                        – Stefan
                        yesterday
















                      0














                      create a function that sets the fill-mode width to (window-width) and add it to the post-command-hook






                      share|improve this answer

















                      • 3




                        An example would make this answer much more useful.
                        – Stefan
                        yesterday














                      0












                      0








                      0






                      create a function that sets the fill-mode width to (window-width) and add it to the post-command-hook






                      share|improve this answer












                      create a function that sets the fill-mode width to (window-width) and add it to the post-command-hook







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered yesterday









                      Zypps987Zypps987

                      111




                      111








                      • 3




                        An example would make this answer much more useful.
                        – Stefan
                        yesterday














                      • 3




                        An example would make this answer much more useful.
                        – Stefan
                        yesterday








                      3




                      3




                      An example would make this answer much more useful.
                      – Stefan
                      yesterday




                      An example would make this answer much more useful.
                      – Stefan
                      yesterday











                      0














                      C-x f to set a fill-column variable.
                      M-q to fill paragraph or selection to that width.



                      As a minor mode:



                      (defun dynamic-fill-column-set-var (frame)
                      (when dynamic-fill-column-mode
                      (setq fill-column (- (window-total-width) 3))))

                      (defun dynamic-fill-column-buffer-list-change ()
                      (when dynamic-fill-column-mode
                      (setq fill-column (- (window-total-width) 3))))

                      (define-minor-mode dynamic-fill-column-mode
                      "Sets `fill-column' when buffer's window is resized"
                      :lighter " DFC"
                      (if dynamic-fill-column-mode
                      (progn
                      (add-hook 'window-size-change-functions 'dynamic-fill-column-set-var nil t)
                      (add-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change nil t))
                      (remove-hook 'window-size-change-functions 'dynamic-fill-column-set-var t)
                      (remove-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change t)))


                      after resizing M-q(executes fill-paragraph function).






                      share|improve this answer










                      New contributor




                      Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.























                        0














                        C-x f to set a fill-column variable.
                        M-q to fill paragraph or selection to that width.



                        As a minor mode:



                        (defun dynamic-fill-column-set-var (frame)
                        (when dynamic-fill-column-mode
                        (setq fill-column (- (window-total-width) 3))))

                        (defun dynamic-fill-column-buffer-list-change ()
                        (when dynamic-fill-column-mode
                        (setq fill-column (- (window-total-width) 3))))

                        (define-minor-mode dynamic-fill-column-mode
                        "Sets `fill-column' when buffer's window is resized"
                        :lighter " DFC"
                        (if dynamic-fill-column-mode
                        (progn
                        (add-hook 'window-size-change-functions 'dynamic-fill-column-set-var nil t)
                        (add-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change nil t))
                        (remove-hook 'window-size-change-functions 'dynamic-fill-column-set-var t)
                        (remove-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change t)))


                        after resizing M-q(executes fill-paragraph function).






                        share|improve this answer










                        New contributor




                        Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.





















                          0












                          0








                          0






                          C-x f to set a fill-column variable.
                          M-q to fill paragraph or selection to that width.



                          As a minor mode:



                          (defun dynamic-fill-column-set-var (frame)
                          (when dynamic-fill-column-mode
                          (setq fill-column (- (window-total-width) 3))))

                          (defun dynamic-fill-column-buffer-list-change ()
                          (when dynamic-fill-column-mode
                          (setq fill-column (- (window-total-width) 3))))

                          (define-minor-mode dynamic-fill-column-mode
                          "Sets `fill-column' when buffer's window is resized"
                          :lighter " DFC"
                          (if dynamic-fill-column-mode
                          (progn
                          (add-hook 'window-size-change-functions 'dynamic-fill-column-set-var nil t)
                          (add-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change nil t))
                          (remove-hook 'window-size-change-functions 'dynamic-fill-column-set-var t)
                          (remove-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change t)))


                          after resizing M-q(executes fill-paragraph function).






                          share|improve this answer










                          New contributor




                          Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          C-x f to set a fill-column variable.
                          M-q to fill paragraph or selection to that width.



                          As a minor mode:



                          (defun dynamic-fill-column-set-var (frame)
                          (when dynamic-fill-column-mode
                          (setq fill-column (- (window-total-width) 3))))

                          (defun dynamic-fill-column-buffer-list-change ()
                          (when dynamic-fill-column-mode
                          (setq fill-column (- (window-total-width) 3))))

                          (define-minor-mode dynamic-fill-column-mode
                          "Sets `fill-column' when buffer's window is resized"
                          :lighter " DFC"
                          (if dynamic-fill-column-mode
                          (progn
                          (add-hook 'window-size-change-functions 'dynamic-fill-column-set-var nil t)
                          (add-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change nil t))
                          (remove-hook 'window-size-change-functions 'dynamic-fill-column-set-var t)
                          (remove-hook 'buffer-list-update-hook 'dynamic-fill-column-buffer-list-change t)))


                          after resizing M-q(executes fill-paragraph function).







                          share|improve this answer










                          New contributor




                          Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer








                          edited yesterday





















                          New contributor




                          Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered yesterday









                          Alex KarbivnichiyAlex Karbivnichiy

                          1113




                          1113




                          New contributor




                          Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          Alex Karbivnichiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Emacs Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f46935%2fadjust-the-line-according-to-the-screen-width%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              An IMO inspired problem

                              Management

                              Has there ever been an instance of an active nuclear power plant within or near a war zone?