403 |
* Fill Prefix:: Filling paragraphs that are indented |
* Fill Prefix:: Filling paragraphs that are indented |
404 |
or in a comment, etc. |
or in a comment, etc. |
405 |
* Adaptive Fill:: How Emacs can determine the fill prefix automatically. |
* Adaptive Fill:: How Emacs can determine the fill prefix automatically. |
406 |
|
* Longlines:: Editing text with very long lines. |
407 |
@end menu |
@end menu |
408 |
|
|
409 |
@node Auto Fill |
@node Auto Fill |
410 |
@subsection Auto Fill Mode |
@subsection Auto Fill Mode |
411 |
@cindex Auto Fill mode |
@cindex Auto Fill mode |
412 |
@cindex mode, Auto Fill |
@cindex mode, Auto Fill |
|
@cindex word wrap |
|
413 |
|
|
414 |
@dfn{Auto Fill} mode is a minor mode in which lines are broken |
@dfn{Auto Fill} mode is a minor mode in which lines are broken |
415 |
automatically when they become too wide. Breaking happens only when |
automatically when they become too wide. Breaking happens only when |
474 |
to typical word processor behavior. This works by running a |
to typical word processor behavior. This works by running a |
475 |
paragraph-filling command at suitable times. |
paragraph-filling command at suitable times. |
476 |
|
|
|
When you are typing text, only characters which normally trigger |
|
|
auto filling, like the space character, will trigger refilling. This |
|
|
is to avoid making it too slow. Apart from self-inserting characters, |
|
|
other commands which modify the text cause refilling. |
|
|
|
|
|
The current implementation is preliminary and probably not robust. |
|
|
We expect to improve on it. |
|
|
|
|
477 |
To toggle the use of Refill mode in the current buffer, type |
To toggle the use of Refill mode in the current buffer, type |
478 |
@kbd{M-x refill-mode}. |
@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. |
490 |
|
|
491 |
@node Fill Commands |
@node Fill Commands |
492 |
@subsection Explicit Fill Commands |
@subsection Explicit Fill Commands |
748 |
line. If it returns @code{nil}, that means it sees no fill prefix in |
line. If it returns @code{nil}, that means it sees no fill prefix in |
749 |
that line. |
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. |
800 |
|
|
801 |
@node Case |
@node Case |
802 |
@section Case Conversion Commands |
@section Case Conversion Commands |
803 |
@cindex case conversion |
@cindex case conversion |