help-gnu-emacs
[Top][All Lists]
Advanced

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

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


From: Joost Kremers
Subject: Re: emacs 24's forward-char vs right-char behavior
Date: 25 Apr 2012 08:32:36 GMT
User-agent: slrn/pre1.0.0-18 (Linux)

Xah Lee wrote:
> Now, paste this sentence in emacs “(كتاب ألف ليلة و ليلة)”. Then, hold
> down right arrow key (which is bound to “right-char”), then when
> cursor moves into the Arabic text, it'll suddenly reverse direction,
> and move right to left, until it reaches the left most arabic char
> sequence, it'll jump back to the english text and continue move right.

ah, *now* i see what you're referring to... (the stuff i'm working on right
now basically involves only r2l or l2r paragraphs, not paragraphs with
mixed text.)

> Now, do the same but using “forward-char” 【Ctrl+f】. Actually, the same
> behavior is observed visually!

yes, true.

i have no idea how difficult it would be to make right/left-char always
move to the right/left even in cases of mixed paragraphs, but i suspect it
wouldn't be easy to get it right. i'd involve checking if right/left-char
happens to move over a direction switch and if so, searching
forward/backward to find the buffer position where the direction switches
again and jump there.

but then again, that's basically what is happening right now, except not in
the buffer but on the screen.

> from Eli's post, it seems to be the expected behavior. But then what's
> the difference of forward-char and right-char? Am totally confused
> now.

the difference is with paragraphs that are completely l2r or r2l. c&p the
following into an empty emacs buffer (or put blank lines before and after):

كانت الخبازة تخبز أفضل خبز في المدينة ولذلك أحبها الجميع. كانت تخرج
الخبز الطازج من فرنها الكبير كل صباح. كانت رائحته تعمُ في جميع أنحاء
الشارع.

the text will be right-aligned, as it's an all-arabic paragraph. now move
the cursor through it with forward-char and with right-char, you'll see
they behave differently. though both behave in the way you'd logically
expect.

-- 
Joost Kremers                                      address@hidden
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


reply via email to

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