Gnuru.org
Productive Linux


Subscribe

 Subscribe in a reader

Enter your email address:

Delivered by FeedBurner


Emacs - Getting Paragraphs to Wrap Lines
20 October 2008 @ 21:49 BST
by Paul

In the world's best text editor, the traditional way (as far as I'm concerned, at least) of getting paragraphs of plain text to wrap is to use autofill-mode. That's what I'd been doing.

This mode has a problem in that it inserts a hard break at the end of each line. This wouldn't be a problem except when you are interacting with the non-Emacs world and with such productivity applications as web browsers, email programmes, word processors and so on.

To fix this, the solution is to use longlines-mode. This mode makes it look as if your text has a linefeed inserted at the end of the line, but in fact, when you save the file or copy it anywhere, that linefeed disappears.

To do this, I commented out the line that turned on auto-fill:

(add-hook 'text-mode-hook 'turn-on-auto-fill)

and turn on longlines mode:

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

Hopefully, that should do the trick. More info.



Leave a comment:

Are you human?