From: Eli Zaretskii <eliz@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: arrow keys vs. C-f/b/n/p
Date: Sat, 12 Jun 2010 12:09:46 +0300 [thread overview]
Message-ID: <83ljakliqt.fsf@gnu.org> (raw)
In-Reply-To: <871vcc4xhf.fsf@catnip.gol.com>
> From: Miles Bader <miles@gnu.org>
> Date: Sat, 12 Jun 2010 14:43:24 +0900
> Cc: Chong Yidong <cyd@stupidchicken.com>, David Kastrup <dak@gnu.org>,
> Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
>
> James Cloos <cloos@jhcloos.com> writes:
> > Oh, and my personal preference, as a l2r reader who occasionally deals
> > with r2l text, is for both C-f/C-b and LEFT/RIGHT to *always* move in
> > logical order. The feedback that provides is useful and welcome.
>
> I agree.
This thread is riddled with confusion and misunderstanding, not the
least part of which is because many participants do not read any R2L
scripts.
I will respond to individual messages, but first let me set the stage
by defining the terminology and the use-cases. I'm sorry, but this
message will necessarily be a longish one. Nevertheless, please read
it in its entirety before responding to any further messages.
The current Emacs supports two text directions and two paragraph
directions. Both can be either left-to-right (L2R) or right-to-left
(R2L).
Paragraph direction determines whether the text starts at the left
window margin or at the right margin. Text direction determines
the direction in which text is read.
A L2R paragraph can include both L2R text and R2L text. Likewise, a
R2L paragraph can include both L2R text and R2L text.
In general, a R2L paragraph is supposed to have most of its text R2L,
and a L2R paragraph is supposed to have most of its text L2R, but
that's not a restriction, and Emacs does not impose that in any way.
It's just that a L2R paragraph that has most or all of its text R2L
will look awkward; try setting bidi-paragraph-direction to
right-to-left in the "*scratch*" buffer, and you'll see what I mean.
Here are 2 use-cases I will use throughout the rest of the discussion,
and I suggest that everyone else does as well, to avoid confusion. As
usual, upper-case letters represent characters from R2L scripts (such
as Arabic or Hebrew), while lower-case letters represent characters
from L2R scripts, such as the various Latin scripts.
Here's how a L2R paragraph which includes mixed L2R and R2L text will
be shown on the screen:
abcde EDCBA xyz
This display corresponds to the following buffer text:
abcde ABCDE xyz
Here's a R2L paragraph that includes mixed R2L and L2R text. Note
that such a paragraph is displayed flushed all the way to the right
margin of the window:
ZYX abcde EDCBA
This display corresponds to the following buffer text:
ABCDE abcde XYZ
The buffer order of characters is known as the "logical" or "reading"
order. The order of characters on the screen is known as the "visual"
order. Note that the visual order always goes from left to right, at
least in Emacs (and hence in this thread). That is, in the R2L
paragraph example above, the first character in the visual order is Z,
the second is Y, etc.
This thread is about movement keys. In Emacs, these keys always move
in the _logical_ order, i.e. in the order of the character positions
in the buffer. While visual-mode movement might make sense in some
use-cases, it is not yet implemented. Personally, I think it is much
less important (see my other messages for why I think so), which is
the main reason why they are not yet implemented in Emacs. But I hope
everyone will agree that having logical-order motion keys is an
absolute must.
So let's stop talking about visual-order movement vs logical-order
movement, from this point on, in this thread. The _only_ movement
mode we have in Emacs is the logical-order one. Both C-f/C-b and the
arrow keys move strictly in logical order.
C-f always moves forward in the logical order. Thus, in the first
example above, it will move like this:
a->b->c->d->e->A->B->C->D->E->x->y->z
Note that this means the cursor will jump on the screen between e and
A and then jump again from E to x.
In the second example, of the R2L paragraph, C-f will move cursor like
this:
Z<-Y<-X<-e<-d<-c<-b<-a<-E<-D<-C<-B<-A
Note that again, it will jump from E to a and from e to X.
Now please note an important detail: in a L2R paragraph, C-f generally
moves cursor _to_the_right_, even though it could sometimes change
direction and move to the left, when we are traversing R2L text
embedded into a L2R paragraph. Similarly, in a R2L paragraph, C-f
generally moves cursor _to_the_left_. In the important special case,
when L2R paragraphs include only L2R text and R2L paragraphs include
only R2L text, cursor motion with C-f is strictly to the right
resp. to the left.
This is the reason why the <right> arrow key moves like C-f in a L2R
paragraph, and why the <left> arrow key moves like C-f in a R2L
paragraph. (And similarly with C-b.) It is so that Emacs behaves as
expected in a purely R2L paragraph containing only R2L text. Any
other operation would be confusingly counter-intuitive: the <right>
key would actually move cursor _to_the_left_!
Again, we are talking _only_ about _logical-order_movement_!
I hope the issue is more clear now. I will now go and respond to some
of the comments posted in this thread.
next prev parent reply other threads:[~2010-06-12 9:09 UTC|newest]
Thread overview: 158+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-07 1:05 Performance Stefan Monnier
2010-06-07 13:35 ` Performance Eli Zaretskii
2010-06-07 14:22 ` arrow keys vs. C-f/b/n/p (was: Performance) David Kastrup
2010-06-07 14:39 ` Eli Zaretskii
2010-06-07 15:01 ` arrow keys vs. C-f/b/n/p David Kastrup
2010-06-07 23:00 ` Eli Zaretskii
2010-06-07 15:34 ` arrow keys vs. C-f/b/n/p (was: Performance) Uday S Reddy
2010-06-11 14:12 ` arrow keys vs. C-f/b/n/p Chong Yidong
2010-06-11 15:47 ` Stefan Monnier
2010-06-11 17:12 ` Drew Adams
2010-06-11 19:34 ` Uday S Reddy
2010-06-11 20:16 ` Drew Adams
2010-06-11 21:24 ` Uday S Reddy
2010-06-11 22:46 ` Drew Adams
2010-06-12 10:28 ` Eli Zaretskii
2010-06-12 10:20 ` Eli Zaretskii
2010-06-12 14:27 ` Drew Adams
2010-06-12 10:12 ` Eli Zaretskii
2010-06-12 10:00 ` Eli Zaretskii
2010-06-12 10:17 ` David Kastrup
2010-06-12 10:38 ` Eli Zaretskii
2010-06-12 14:26 ` Drew Adams
2010-06-12 16:10 ` Eli Zaretskii
2010-06-12 17:12 ` Drew Adams
2010-06-12 17:25 ` Lennart Borgman
2010-06-12 18:38 ` Eli Zaretskii
2010-06-12 18:49 ` Lennart Borgman
2010-06-12 19:38 ` Eli Zaretskii
2010-06-12 19:51 ` Lennart Borgman
2010-06-12 18:01 ` Uday S Reddy
2010-06-12 19:16 ` Drew Adams
2010-06-12 18:49 ` Eli Zaretskii
2010-06-12 19:19 ` Drew Adams
2010-06-12 22:57 ` Davis Herring
2010-06-11 19:45 ` Chong Yidong
2010-06-11 19:50 ` Chong Yidong
2010-06-12 10:17 ` Eli Zaretskii
2010-06-13 18:08 ` Eli Zaretskii
2010-06-12 10:14 ` Eli Zaretskii
2010-06-12 9:16 ` Eli Zaretskii
2010-06-12 9:34 ` David Kastrup
2010-06-12 10:30 ` Eli Zaretskii
2010-06-12 20:54 ` David Kastrup
2010-06-12 14:26 ` Drew Adams
2010-06-12 20:31 ` Stefan Monnier
2010-06-11 16:29 ` James Cloos
2010-06-11 17:09 ` Lennart Borgman
2010-06-12 9:27 ` Eli Zaretskii
2010-06-12 14:49 ` Lennart Borgman
2010-06-12 16:11 ` Eli Zaretskii
2010-06-12 16:18 ` Lennart Borgman
2010-06-12 18:33 ` Eli Zaretskii
2010-06-12 18:58 ` Lennart Borgman
2010-06-12 19:34 ` Lennart Borgman
2010-06-12 19:58 ` Eli Zaretskii
2010-06-12 20:26 ` Lennart Borgman
2010-06-12 21:08 ` Eli Zaretskii
2010-06-12 21:20 ` Lennart Borgman
2010-06-12 19:55 ` Eli Zaretskii
2010-06-12 20:07 ` Lennart Borgman
2010-06-12 21:05 ` Eli Zaretskii
2010-06-12 21:16 ` Lennart Borgman
2010-06-13 3:52 ` Lennart Borgman
2010-06-13 7:53 ` David Kastrup
2010-06-11 17:37 ` Chong Yidong
2010-06-11 18:04 ` Lennart Borgman
2010-06-11 21:23 ` W Dan Meyer
2010-06-12 5:40 ` Miles Bader
2010-06-12 10:48 ` Eli Zaretskii
2010-06-12 14:57 ` Lennart Borgman
2010-06-12 10:02 ` Eli Zaretskii
2010-06-12 10:22 ` James Cloos
2010-06-12 9:24 ` Eli Zaretskii
2010-06-12 10:17 ` James Cloos
2010-06-12 12:03 ` Eli Zaretskii
2010-06-12 12:40 ` James Cloos
2010-06-12 20:37 ` Stefan Monnier
2010-06-12 16:36 ` Andreas Schwab
2010-06-12 16:57 ` Current head won't build Randal L. Schwartz
2010-06-12 17:24 ` Chong Yidong
2010-06-12 18:55 ` Randal L. Schwartz
2010-06-12 19:54 ` Juri Linkov
2010-06-12 20:13 ` Randal L. Schwartz
2010-06-14 15:43 ` Juri Linkov
2010-06-15 14:50 ` Randal L. Schwartz
2010-06-15 18:28 ` Andreas Schwab
2010-06-15 18:31 ` Randal L. Schwartz
2010-06-15 19:25 ` Andreas Schwab
2010-06-15 19:38 ` Teemu Likonen
2010-06-15 19:43 ` Andreas Schwab
2010-06-15 19:54 ` Randal L. Schwartz
2010-06-16 3:28 ` Stephen J. Turnbull
2010-06-16 8:21 ` Andreas Schwab
2010-06-16 9:47 ` Juanma Barranquero
2010-06-16 12:23 ` Stephen J. Turnbull
2010-06-16 12:36 ` Andreas Schwab
2010-06-18 6:05 ` Stephen J. Turnbull
2010-06-18 8:20 ` Andreas Schwab
2010-06-18 9:04 ` Stephen J. Turnbull
2010-06-18 9:27 ` Andreas Schwab
2010-06-18 10:41 ` Stephen J. Turnbull
2010-06-18 11:33 ` Andreas Schwab
2010-06-16 12:44 ` Andreas Schwab
2010-06-16 13:12 ` Randal L. Schwartz
2010-06-16 13:17 ` Andreas Schwab
2010-06-16 13:21 ` Randal L. Schwartz
2010-06-16 14:00 ` Andreas Schwab
2010-06-16 14:18 ` Randal L. Schwartz
2010-06-16 14:25 ` Andreas Schwab
2010-06-16 14:29 ` Randal L. Schwartz
2010-06-16 14:58 ` Andreas Schwab
2010-06-16 15:09 ` Randal L. Schwartz
2010-06-16 15:51 ` Andreas Schwab
2010-06-16 13:29 ` Randal L. Schwartz
2010-06-16 14:14 ` Andreas Schwab
2010-06-16 18:32 ` Stefan Monnier
2010-06-16 18:43 ` Randal L. Schwartz
2010-06-18 6:04 ` Stephen J. Turnbull
2010-06-12 16:41 ` arrow keys vs. C-f/b/n/p Andreas Schwab
2010-06-12 23:34 ` James Cloos
2010-06-11 17:12 ` James Cloos
2010-06-12 5:43 ` Miles Bader
2010-06-12 9:09 ` Eli Zaretskii [this message]
2010-06-12 11:13 ` Uday S Reddy
2010-06-12 12:00 ` Eli Zaretskii
2010-06-12 14:26 ` Drew Adams
2010-06-12 16:14 ` Eli Zaretskii
2010-06-12 22:27 ` Kenichi Handa
2010-06-13 3:02 ` Eli Zaretskii
2010-06-13 10:24 ` Kenichi Handa
2010-06-13 15:28 ` Lennart Borgman
2010-06-13 17:20 ` Eli Zaretskii
2010-06-13 18:03 ` Lennart Borgman
2010-06-12 10:03 ` Eli Zaretskii
2010-06-12 10:23 ` James Cloos
2010-06-12 14:27 ` Drew Adams
2010-06-12 9:11 ` Eli Zaretskii
2010-06-07 15:19 ` Stefan Monnier
2010-06-07 16:08 ` Juanma Barranquero
2010-06-07 16:21 ` David Kastrup
2010-06-07 17:25 ` Juanma Barranquero
2010-06-07 18:26 ` Andreas Schwab
2010-06-07 19:24 ` Juanma Barranquero
2010-06-07 19:57 ` Stefan Monnier
2010-06-07 20:17 ` Juanma Barranquero
2010-06-07 22:32 ` Davis Herring
2010-06-07 22:40 ` Juanma Barranquero
2010-06-08 0:15 ` Stefan Monnier
2010-06-08 13:51 ` Uday S Reddy
2010-06-08 20:25 ` Stefan Monnier
2010-06-08 21:07 ` Uday S Reddy
2010-06-07 23:19 ` Eli Zaretskii
2010-06-08 7:58 ` Miles Bader
2010-06-07 15:33 ` Performance Stefan Monnier
2010-06-10 10:30 ` Performance Kenichi Handa
-- strict thread matches above, loose matches on Subject: below --
2010-06-12 20:56 arrow keys vs. C-f/b/n/p grischka
2010-06-12 21:04 ` Eli Zaretskii
2010-06-12 21:26 ` grischka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83ljakliqt.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.