Mercurial > emacs
comparison man/text.texi @ 61115:dcdebd4bb525
(Refill): Refer to Long Lines Mode.
(Longlines): New node.
(Auto Fill): Don't index "word wrap" here.
(Filling): Add Longlines to menu.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 29 Mar 2005 21:06:20 +0000 |
parents | 5270dfec18f9 |
children | 56749022baa0 4da4a09e8b1b |
comparison
equal
deleted
inserted
replaced
61114:e1f821140a5a | 61115:dcdebd4bb525 |
---|---|
401 * Refill:: Keeping paragraphs filled. | 401 * Refill:: Keeping paragraphs filled. |
402 * Fill Commands:: Commands to refill paragraphs and center lines. | 402 * Fill Commands:: Commands to refill paragraphs and center lines. |
403 * Fill Prefix:: Filling paragraphs that are indented | 403 * Fill Prefix:: Filling paragraphs that are indented |
404 or in a comment, etc. | 404 or in a comment, etc. |
405 * Adaptive Fill:: How Emacs can determine the fill prefix automatically. | 405 * Adaptive Fill:: How Emacs can determine the fill prefix automatically. |
406 * Longlines:: Editing text with very long lines. | |
406 @end menu | 407 @end menu |
407 | 408 |
408 @node Auto Fill | 409 @node Auto Fill |
409 @subsection Auto Fill Mode | 410 @subsection Auto Fill Mode |
410 @cindex Auto Fill mode | 411 @cindex Auto Fill mode |
411 @cindex mode, Auto Fill | 412 @cindex mode, Auto Fill |
412 @cindex word wrap | |
413 | 413 |
414 @dfn{Auto Fill} mode is a minor mode in which lines are broken | 414 @dfn{Auto Fill} mode is a minor mode in which lines are broken |
415 automatically when they become too wide. Breaking happens only when | 415 automatically when they become too wide. Breaking happens only when |
416 you type a @key{SPC} or @key{RET}. | 416 you type a @key{SPC} or @key{RET}. |
417 | 417 |
472 Refill minor mode provides support for keeping paragraphs filled as | 472 Refill minor mode provides support for keeping paragraphs filled as |
473 you type or modify them in other ways. It provides an effect similar | 473 you type or modify them in other ways. It provides an effect similar |
474 to typical word processor behavior. This works by running a | 474 to typical word processor behavior. This works by running a |
475 paragraph-filling command at suitable times. | 475 paragraph-filling command at suitable times. |
476 | 476 |
477 When you are typing text, only characters which normally trigger | |
478 auto filling, like the space character, will trigger refilling. This | |
479 is to avoid making it too slow. Apart from self-inserting characters, | |
480 other commands which modify the text cause refilling. | |
481 | |
482 The current implementation is preliminary and probably not robust. | |
483 We expect to improve on it. | |
484 | |
485 To toggle the use of Refill mode in the current buffer, type | 477 To toggle the use of Refill mode in the current buffer, type |
486 @kbd{M-x refill-mode}. | 478 @kbd{M-x refill-mode}. When you are typing text, only characters |
479 which normally trigger auto filling, like the space character, will | |
480 trigger refilling. This is to avoid making it too slow. Apart from | |
481 self-inserting characters, other commands which modify the text cause | |
482 refilling. | |
483 | |
484 The current implementation is preliminary and not robust. You can | |
485 get better ``line wrapping'' behavior using Longlines mode. | |
486 @xref{Longlines}. However, Longlines mode has an important | |
487 side-effect: the newlines that it inserts for you are not saved to | |
488 disk, so the files that you make with Longlines mode will appear to be | |
489 completely unfilled if you edit them without Longlines mode. | |
487 | 490 |
488 @node Fill Commands | 491 @node Fill Commands |
489 @subsection Explicit Fill Commands | 492 @subsection Explicit Fill Commands |
490 | 493 |
491 @table @kbd | 494 @table @kbd |
742 automatically by setting the variable @code{adaptive-fill-function} to a | 745 automatically by setting the variable @code{adaptive-fill-function} to a |
743 function. This function is called with point after the left margin of a | 746 function. This function is called with point after the left margin of a |
744 line, and it should return the appropriate fill prefix based on that | 747 line, and it should return the appropriate fill prefix based on that |
745 line. If it returns @code{nil}, that means it sees no fill prefix in | 748 line. If it returns @code{nil}, that means it sees no fill prefix in |
746 that line. | 749 that line. |
750 | |
751 @node Longlines | |
752 @subsection Long Lines Mode | |
753 @cindex refilling text, word processor style | |
754 @cindex modes, Long Lines | |
755 @cindex word wrap | |
756 @cindex Long Lines minor mode | |
757 | |
758 Long Lines mode is a minor mode for @dfn{word wrapping}; it lets you | |
759 edit ``unfilled'' text files, which Emacs would normally display as a | |
760 bunch of extremely long lines. Many text editors, such as those built | |
761 into many web browsers, normally do word wrapping. | |
762 | |
763 @findex longlines-mode | |
764 To enable Long Lines mode, type @kbd{M-x longlines-mode}. If the | |
765 text is full of long lines, this will ``wrap'' them | |
766 immediately---i.e., break up to fit in the window. As you edit the | |
767 text, Long Lines mode automatically re-wraps lines by inserting or | |
768 deleting @dfn{soft newlines} as necessary (@pxref{Hard and Soft | |
769 Newlines}.) These soft newlines won't show up when you save the | |
770 buffer into a file, or when you copy the text into the kill ring, | |
771 clipboard, or a register. | |
772 | |
773 @findex longlines-auto-wrap | |
774 Word wrapping is @emph{not} the same as ordinary filling | |
775 (@pxref{Fill Commands}). It does not contract multiple spaces into a | |
776 single space, recognize fill prefixes (@pxref{Fill Prefix}), or | |
777 perform adaptive filling (@pxref{Adaptive Fill}). The reason for this | |
778 is that a wrapped line is still, conceptually, a single line. Each | |
779 soft newline is equivalent to exactly one space in that long line, and | |
780 vice versa. However, you can still call filling functions such as | |
781 @kbd{M-q}, and these will work as expected, inserting soft newlines | |
782 that won't show up on disk or when the text is copied. You can even | |
783 rely entirely on the normal fill commands by turning off automatic | |
784 line wrapping, with @kbd{C-u M-x longlines-auto-wrap}. To turn | |
785 automatic line wrapping back on, type @kbd{M-x longlines-auto-wrap}. | |
786 | |
787 @findex longlines-show-hard-newlines | |
788 Whenever you type @kbd{RET}, you are inserting a hard newline. If | |
789 you want to see where all the hard newlines are, type @kbd{M-x | |
790 longlines-show-hard-newlines}. This will mark each hard newline with | |
791 a special symbol. The same command with a prefix argument turns this | |
792 display off. | |
793 | |
794 Long Lines mode does not change normal text files that are already | |
795 filled, since the existing newlines are considered hard newlines. | |
796 Before Long Lines can do anything, you need to transform each | |
797 paragraph into a long line. One way is to set @code{fill-column} to a | |
798 large number (e.g., @kbd{C-u 9999 C-x f}), re-fill all the paragraphs, | |
799 and then set @code{fill-column} back to its original value. | |
747 | 800 |
748 @node Case | 801 @node Case |
749 @section Case Conversion Commands | 802 @section Case Conversion Commands |
750 @cindex case conversion | 803 @cindex case conversion |
751 | 804 |