all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Drew Adams <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: arrow keys vs. C-f/b/n/p
Date: Sat, 12 Jun 2010 13:00:03 +0300	[thread overview]
Message-ID: <83eigclgf0.fsf@gnu.org> (raw)
In-Reply-To: <DBFF4F0A12BF4F5B8C131A0CEF2438CB@us.oracle.com>

> From: "Drew Adams" <drew.adams@oracle.com>
> Cc: "'Eli Zaretskii'" <eliz@gnu.org>, "'David Kastrup'" <dak@gnu.org>,
>         <emacs-devel@gnu.org>
> Date: Fri, 11 Jun 2010 10:12:45 -0700
> 
> On the surface this seems wrong and overly complicated (to me). "Eminently
> meaningful" it no doubt is, but it seems somehow bass ackwards. ;-)

Do you still think that, after reading my explanations?

> It seems wrong for `right' to mean "left".

It does seem wrong.  Which is why Emacs doesn't do that.  Do you
agree, after reading my explanations?

> Why would it be wrong for `right' (right arrow) to always represent movement
> toward the right, regardless of R2L/L2R?

It is not wrong, which is why Emacs behaves precisely like that.

The only exception is when R2L text is embedded in a L2R paragraph
(i.e. in otherwise mostly L2R text).  Since arrow keys still move in
logical order, the direction is reversed while we are traversing R2L
text; it returns to its usual sense when point is back inside L2R
text.

Having the right arrow always go right (i.e. in the visual order)
means that users will be unable to press the Shift key and have the
text they traverse be marked correctly.  That is why we have only the
logical-order movement for now -- because it is indispensable.  While
I don't object to have a visual-order movement mode, I think it is
much less useful, and it must be a separate mode in any case.

In general, I believe the visual-mode movement is useful only to
people who don't really read the bidirectional text they traverse with
the cursor-motion keys.  Any person who actually reads and understand
the text will need the logical-order motion first and foremost, and
the fact that direction is sometimes switched for a short period of
time is expected and understood by users of bidirectional scripts.  It
is a necessary complication, and one that is not hard to become used
to -- because the cursor moves in the reading order, the same order
our eyes move when we scan text.

> I suppose that you want to make `C-f' move "forward", which is arguably toward
> the left in R2L languages, and you want to keep the association of `C-f' with
> `right' (right arrow).

Why would I want C-f to be associated with <right> if it actually
moves to the left?  Don't you think it's terribly confusing mentally?

> But is it really important that "forward" in a command name move toward the left
> in R2L? Why should "forward" necessarily mean "from text beginning toward text
> end" rather than just "toward the right"? What is at stake here?

At stake here is a very fundamental issue: the reading order is still
from character position 1 to position 2 to 3 and so forth.  The order
on the screen does not change this fundamental fact.  If you break
this fundamental relation between the buffer order and the reading
order, users will throw Emacs out the window.

> You don't change the meaning of `bobp' to `eobp' for R2L, do you? You don't swap
> the meanings of "left" and "right". Why exchange "forward" and "backward" but
> not "left" and right"?

We didn't change forward and backward.  We did change the relation
between left/right and forward/backward.  That is, "right" is not
always "forward" anymore.

> Just which things really need to be flipped/mirrored?

We need to break the one-to-one relation between buffer's logical
order and the left/right direction.  This is what bidirectional text
support is all about: "leftmost" no longer means "the first", because
screen direction and screen sides no longer correspond to buffer
order, in general.

> Why not leave everything as it is wrt "forward" movement, and let users
> understand that "forward" always means toward the right (in both L2R and R2L)?
> Wouldn't that be just as useful and a lot less confusing overall?

No, it would be terribly confusing.  "Forward" must mean what the word
means, and "left" must also mean what the word says.  Any other way
means placing a terrible mental burden on the user -- and for what?
for convenience of ELisp programmers?

> Maybe you'll say that at least `C-d' and `backspace' need to flip direction
> (forward/backward)

They don't, and shouldn't, IMO.  C-d always deletes the character at
point, and Backspace always deletes the character before point.  The
basic Emacs notions of "before point" and "after point" are not
changed by the bidi support, because doing that would mean that
everything in Emacs would stop working.

In general, the basic design of the bidi support changes only the
display features.  It changes nothing in how buffer text is processed
and accessed.  This is done on purpose: I strongly believe that
bidirectional text is a display-only feature.  It must not change
anything else.

> I can see that self-insertion should move point to the left of the inserted char
> in R2L.

This is a misunderstanding.  There's no "left" and "right" in the
buffer.  Insertion doesn't move point to the left, it moves point
farther from the beginning of the buffer, i.e. it increases its buffer
position.  Whether this is right or left on the screen depends on the
surrounding bidirectional context.  I could even concoct an example
where inserting a single character reorders many characters around the
insertion locus and moves the cursor far away from its previous
position.

> Again, I know nothing about R2L. I'm sure it's a tough and tricky problem, and
> I'm sure you have thought it all out carefully. It just seems wrong and
> unnecessarily complicated for this ignoramus who has not thought it all out.

Complicated, yes.  But also necessary.  Any other solution is simply
wrong, from the user perspective.

> If nothing else, perhaps the naive questions expressed here will help you
> document the bidi stuff for other naive users - HTH.

Naive users who read bidirectional scripts do not need this to be
explained: they expect this behavior by default.

> Perhaps something analogous to node `(elisp) Not Intervals' would be
> helpful for this, explaining the logic behind the design choices.

We don't explain design choices in the manuals.  There're plenty of
comments in the code to explain these decisions; if you or someone
else can point out where more commentary is in order, I'd be more than
happy to add whatever is missing, being a documentation maniac.



  parent reply	other threads:[~2010-06-12 10:00 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 [this message]
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
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=83eigclgf0.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=drew.adams@oracle.com \
    --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.