[Top][All Lists]

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

Re: emacs 24's forward-char vs right-char behavior

From: Eli Zaretskii
Subject: Re: emacs 24's forward-char vs right-char behavior
Date: Thu, 26 Apr 2012 18:00:50 +0300

> From: Xah Lee <address@hidden>
> Date: Thu, 26 Apr 2012 07:24:06 -0700 (PDT)
> can't right-char always move to the right even in mixed R2L/L2R
> situations?

It can: that's what "visual" cursor motion is about.  But moving
always to the right requires that after each move, Emacs figures out
the value of point, because moving by one screen position no longer
means moving by one buffer position; it could potentially mean jumping
over many buffer positions.

By contrast, the current "logical" cursor motion always moves point by
one buffer position, then positions the cursor accordingly.  The only
new aspect of right-char in Emacs 24 is that sometimes it moves
forward in the buffer and sometimes backward.  But it still moves only
one buffer position.

The significant difference between logical and visual cursor motion is
that the former doesn't care about what's on the screen, because it
moves by buffer positions.  Therefore, it can easily and predictably
do its job even when the Emacs display is not up to date (e.g.,
because Emacs cannot keep up with input events, or has some prolonged
command running).  By contrast, visual cursor movement needs either to
consult the contents of the screen (which would mean difficulties when
you move the cursor off the screen, or if the display is not yet up to
date), or figure out how the text _would_ be displayed (which means
each <right> keypress will need to do much more work than it does
now).  These difficulties are the reason why visual cursor motion was
not yet implemented in Emacs.

reply via email to

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