next up previous contents
Next: Reformatting Hard Wrapped Documents Up: Word wrap (Filling) Previous: Word wrap (Filling)   Contents

longlines.el

There is one way to have the word wrap you want: Emacs is extensible, and by writing and loading packages of elisp code you can add functionality to the program. Naturally, someone has already written a package that deals with the word wrap situation and it's called longlines.el . Find the package on the Internet and install it with the rest of the lisp code on your system. Where you install it might not be obvious. On my Linux system it was a matter of copying the file to /usr/share/emacs/21.2/site-lisp/ and setting the permissions to -rw-r-r-. I added the following line to my .emacs file:

(autoload 'longlines-mode "longlines.el" 
     "Minor mode for editing long lines." t)

That line makes the additional functionality available to emacs. But to start using it you have to activate it by issuing the command M-x longlines-mode, The status line will reflect the change with the letters LL. If you turn off longlines mode (by issuing the same command), the text will not be reformatted unless you manually refill the paragraph using M-q. I alway use longlines when I'm writing, because it makes text behave the way I expect it to after using so many other software packages. It's an especially nice effect when you're working at a virtual console and longlines wraps your text at the screen edge (120 characters, in my case). If you too use longlines.el whenever you write, you can make it load automatically whenever you load emacs by adding the following line to your .emacs customization file (see section 19):

(add-hook 'text-mode-hook 'longlines-mode)

Be aware that longlines-wrapped text is subject to the same limitation in searching that auto-filled text is (see section 13), an issue you can easily get around by using the powerful word search command C-s RET C-w (that is, C-s, hit return, C-w) which is able to find phrases even if they are separated by newlines.


next up previous contents
Next: Reformatting Hard Wrapped Documents Up: Word wrap (Filling) Previous: Word wrap (Filling)   Contents
Randall Wood 2007-07-04