* bug#16961: left-char moves to beginning of line; visual-order-cursor-movement
[not found] <CAARRV4TVSFiF+SKwpZyo4uE9AbB4P4D2GX2jJrn7j5Dw=gLYqQ@mail.gmail.com>
@ 2014-03-07 15:52 ` David Reitter
2014-03-07 20:03 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: David Reitter @ 2014-03-07 15:52 UTC (permalink / raw
To: 16961; +Cc: markoilcan
[-- Attachment #1: Type: text/plain, Size: 2034 bytes --]
X-Debbugs-cc: markoilcan@gmail.com
To reproduce this bug:
Start Emacs -Q (testing with mainline build dated Jan 29):
Paste the following:
——snip
(global-hl-line-mode)
(setq visual-order-cursor-movement t)
(visual-line-mode)
asdasd
——snap
Note that “ asdasd” has a space at the beginning, and it needs to be the last line of the buffer.
Evaluate the first three expressions, place the text cursor at the end of the buffer (that is, after “asd”).
The line should be highlighted. Now press `left’ (or do M-x left-char).
Point will jump to the beginning of the line.
Expected behavior is that it would move by just one char.
Begin forwarded message:
> From: M A <markoilcan@gmail.com>
> Subject: cursor movement error
> Date: March 6, 2014 at 5:55:29 PM EST
> To: aquamacs-bugs@aquamacs.org
>
> When pressing the left arrow key when global-hl-line-mode is enabled and the cursor is at the very end of the buffer (no characters following it, including \n) and there is a space earlier in the line, instead of moving left a single characacter, the cursor moves a whole word.
>
>
> To replicate this:
> 1. Start aquamacs without customizations.
> 2. M-x global-hl-line-mode.
> 3. Type " testing" (note space before the word "testing").
> 4. Press left arrow key once.
> At this point the cursor is to the left of the space character before the word "testing" instead of before the letter "g".
>
> In Aquamacs 3.0a GNU Emacs 24.3.50.2
> (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00)
> of 2014-01-20 (Aquamacs-3.0a) on watson
> Git revision: Aquamacs-3.0a
> Operating System: OS X Version 10.7.5 (Build 11G63b)
> Configured using:
> `configure --with-ns --without-x 'CFLAGS=-arch x86_64 -O3 -g
> -mtune=corei7 -mmacosx-version-min=10.6' 'LDFLAGS=-arch x86_64 -O3 -g
> -mtune=corei7 -mmacosx-version-min=10.6''
>
> Important settings:
> value of $LANG: en_US.UTF-8
> locale-coding-system: utf-8-unix
> default enable-multibyte-characters: t
>
>
[-- Attachment #2: Type: text/html, Size: 3715 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#16961: left-char moves to beginning of line; visual-order-cursor-movement
2014-03-07 15:52 ` bug#16961: left-char moves to beginning of line; visual-order-cursor-movement David Reitter
@ 2014-03-07 20:03 ` Eli Zaretskii
2014-03-08 3:38 ` David Reitter
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2014-03-07 20:03 UTC (permalink / raw
To: David Reitter; +Cc: 16961-done, markoilcan
> From: David Reitter <david.reitter@gmail.com>
> Date: Fri, 7 Mar 2014 10:52:38 -0500
> Cc: markoilcan@gmail.com
>
> Start Emacs -Q (testing with mainline build dated Jan 29):
>
> Paste the following:
>
> ——snip
> (global-hl-line-mode)
> (setq visual-order-cursor-movement t)
> (visual-line-mode)
>
> asdasd
> ——snap
>
> Note that “ asdasd” has a space at the beginning, and it needs to be the last line of the buffer.
> Evaluate the first three expressions, place the text cursor at the end of the buffer (that is, after “asd”).
>
> The line should be highlighted. Now press `left’ (or do M-x left-char).
>
> Point will jump to the beginning of the line.
> Expected behavior is that it would move by just one char.
HL Line Mode, the Mother Of All Evil...
Fixed in trunk revision 116701.
> > 1. Start aquamacs without customizations.
> > 2. M-x global-hl-line-mode.
> > 3. Type " testing" (note space before the word "testing").
> > 4. Press left arrow key once.
> > At this point the cursor is to the left of the space character before the word "testing" instead of before the letter "g".
Does this mean "Aquamacs without customizations" has
visual-order-cursor-movement set to t? If so, I think it's not a good
idea at all: that variable is user-level customization, it shouldn't
be forced on the users.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: bug#16961: left-char moves to beginning of line; visual-order-cursor-movement
2014-03-07 20:03 ` Eli Zaretskii
@ 2014-03-08 3:38 ` David Reitter
2014-03-08 8:03 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: David Reitter @ 2014-03-08 3:38 UTC (permalink / raw
To: Eli Zaretskii; +Cc: M A, emacs-devel@gnu.org developers
[-- Attachment #1: Type: text/plain, Size: 851 bytes --]
On Mar 7, 2014, at 2:03 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> HL Line Mode, the Mother Of All Evil…
Couldn’t the core of this be implemented in redisplay instead of in Lisp?
(I’m assuming it places overlays in the buffer.)
> Does this mean "Aquamacs without customizations" has
> visual-order-cursor-movement set to t? If so, I think it's not a good
> idea at all: that variable is user-level customization, it shouldn't
> be forced on the users.
Users can change it the way the want it.
Aquamacs just sets a different default, as it does with a lot of settings.
The reason why I’m doing this is that otherwise, left/right keys do not move left/right movement of the cursor (in RTL or mixed text), and that would be incoherent with other situations in the system where users edit RTL text.
Do you have a better suggestion?
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 4151 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: bug#16961: left-char moves to beginning of line; visual-order-cursor-movement
2014-03-08 3:38 ` David Reitter
@ 2014-03-08 8:03 ` Eli Zaretskii
0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2014-03-08 8:03 UTC (permalink / raw
To: David Reitter; +Cc: markoilcan, emacs-devel
> From: David Reitter <david.reitter@gmail.com>
> Date: Fri, 7 Mar 2014 21:38:38 -0600
> Cc: M A <markoilcan@gmail.com>,
> "emacs-devel@gnu.org developers" <emacs-devel@gnu.org>
>
> On Mar 7, 2014, at 2:03 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> > HL Line Mode, the Mother Of All Evil…
>
> Couldn’t the core of this be implemented in redisplay instead of in Lisp?
Indeed, I think it could be, similarly to the current implementation
of the region highlight. Volunteers are welcome.
> (I’m assuming it places overlays in the buffer.)
It moves an overlay in a post-command-hook, which makes the window
display "non-current", and disables a lot of redisplay optimizations
as result. The default mode of operation of visual-order
cursor-movement is to traverse the glyph matrices that describe what's
on the glass, but it can only do that if the display is marked
"current". Otherwise, it falls back to Plan B, which is much trickier
(it needs to simulate the display without actually performing it), and
where the use of word-wrap caused this bug.
> > Does this mean "Aquamacs without customizations" has
> > visual-order-cursor-movement set to t? If so, I think it's not a good
> > idea at all: that variable is user-level customization, it shouldn't
> > be forced on the users.
>
> Users can change it the way the want it.
Users can change the default no matter what its value. The question
for defaults is what would most of the users want.
> Aquamacs just sets a different default, as it does with a lot of settings.
I'm talking specifically about this one. You will notice that I
didn't say anything about turning on visual-line-mode by default.
> The reason why I’m doing this is that otherwise, left/right keys do not move left/right movement of the cursor (in RTL or mixed text), and that would be incoherent with other situations in the system where users edit RTL text.
What other situations with bidirectional text trigger different
behavior? And what do you mean by "the system" here?
Anyway, AFAIK most, if not all, of the apps that support bidirectional
text default to logical-order cursor movement. Some don't even
support visual-order movement as an option. Visual-order movement
might look nice to someone who doesn't speak languages which use
bidirectional scripts, but it is seldom needed by those who do speak
them, because in some contexts it moves the cursor into a place that
is significantly different from where it should be according to the
reading order. Their other effects are also weird, e.g. try moving
the cursor with the Shift key pressed, and watch the region highlight.
So I expect your default to be a significant surprise for users of
bidirectional scripts. OTOH, users of unidirectional scripts will
never notice it (apart of bugs such as this one), because the effect
is indistinguishable from logical-order movement. The only effect on
users of unidirectional scripts is that cursor motion is more
expensive in CPU usage than the logical-order movement, which is
hardly a good trade-off.
> Do you have a better suggestion?
Yes: keep the upstream default for this one. Its value is not an
accident, but rather well thought-of.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-03-08 8:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CAARRV4TVSFiF+SKwpZyo4uE9AbB4P4D2GX2jJrn7j5Dw=gLYqQ@mail.gmail.com>
2014-03-07 15:52 ` bug#16961: left-char moves to beginning of line; visual-order-cursor-movement David Reitter
2014-03-07 20:03 ` Eli Zaretskii
2014-03-08 3:38 ` David Reitter
2014-03-08 8:03 ` Eli Zaretskii
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.