[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Movement mode

From: address@hidden
Subject: Re: Movement mode
Date: Wed, 26 May 2004 13:18:46 -0400
User-agent: KNode/0.7.1

Tobias Radloff wrote:

> Hi there,
> I wonder if there is a way to make emacs behave like modern editors like
> kedit and the like, especially when it comes to paragraphs continuing over
> several lines. I'd like to change the behavior of the up and down keys
> (and that of C-P and C-N too, of course) from moving one paragraph up or
> down to moving one line up or down. I would like to change the behavior of
> pos1 and end similarly.
> Since we're talking emacs here, I don't ask if it's possible but rather:
> how do I do it? :)
> Regards
> Tobias

You need auto-fill mode, which breaks the lines as you type along. That'll 
also give you the cursor motion that you're looking for.

Unfortunately, it uses hard carriage returns and won't rebreak them so you 
have to use M-q to put the paragraph into the proper order.

There's also refill-mode, which does the M-qing automatically. It has one 
major drawback: It's greedy. If you do this:

First line
second line
third line

You'll get: First line second line third line.

Because of this I find it easier to write in block style, without tabs. When 
I need tabs (and longlines) I use a macro to convert two carriage returns 
in a row to a carriage return and tab and then delete single carriage 
returns. It's basically just some replace-regexps. First I replace the 
carriage returns with a symbol (I use # because I don't use it otherwise) 
and then the replacements as stated in the beginning of the paragraph.

For writing, don't use the normal text mode but paragraph-indent-text-mode. 
It handles tabs better. But still Emacs' tabbing is better for programmers 
than writers. Tabs can be a problem. So I skip them. The macro I described 
makes it painless to convert to tabbed style.

Yeah, for writing, Emacs method of line-breaking can be a bit of a pain. But 
its wealth of other editing commands more than makes up for this small 



Author of "Linux for Non-Geeks--Clear-eyed Answers for Practical Consumers" 
and "Boring Stories from Uncle Rod." Both are available at

To reply by e-mail, take the extra "o" out of the name.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]