emacs-devel
[Top][All Lists]
Advanced

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

Re: C-n and C-a


From: Juri Linkov
Subject: Re: C-n and C-a
Date: Mon, 02 Feb 2009 03:47:19 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-pc-linux-gnu)

>> visual-line-mode is no less misleading - in addition to enabling visual
>> motion commands it also enables word wrap mode.  And there is no way
>> to enable visual motion commands without enabling warping text at
>> word boundaries.
>>
>> These are two separate features amalgamated into one mode.
>> I think we should provide a way to toggle them separately.
>
> The features are logically separate, but in practice they are usually
> useful only in combination.  When there are lots of wrapped lines, it's
> natural to have commands like C-a and C-n act on visual lines.
> Conversely, visual-line based commands are not terribly useful unless
> the buffer has lots of long lines, and that's a pain to deal with unless
> you enable word wrap.

We currently have two separate three-state modes:

1. line wrapping mode with three options:

 1.1. truncate long lines (truncate-lines=t)
 1.2. wrap at window edge (truncate-lines=nil, word-wrap=nil)
 1.3. word wrap           (truncate-lines=nil, word-wrap=t)

Traditionally `toggle-truncate-lines' is not a mode, but a command that
toggles the variable `truncate-lines'.  I think `word-wrap' should be
consistently similar by providing a command `toggle-word-wrap' that
would do almost the same and to toggle `word-wrap'.

2. operations on visual lines (line movement and line killing)

 2.1. real line operations   (line-move-visual=nil, visual-line-mode=nil)
 2.2. visual line C-n/C-p    (line-move-visual=t,   visual-line-mode=nil)
 2.3. visual line operations (line-move-visual=t,   visual-line-mode=t)

It would be enough to have only one mode `visual-line-mode' because
intermediate half-real half-visual mode (2.2) is too confusing.
To avoid inconsistency of the half-real half-visual mode we could
enable `visual-line-mode' by default.

> Longlines-mode had an option to separate the word wrapping and line
> motion behavior, but AFAIK no one ever used it.

I think the same about the default value of `word-wrap'.  If we will set
it to t, too few users will want to change its default value to nil.

But as the same time we should not insist on enabling word wrapping
when someone will explicitly disable `word-wrap' and want to enable
`visual-line-mode' to use visual line commands on lines wrapped at the
window edge.

-- 
Juri Linkov
http://www.jurta.org/emacs/




reply via email to

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