emacs-devel
[Top][All Lists]
Advanced

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

Mixed L2R and R2L paragraphs and horizontal scroll


From: Eli Zaretskii
Subject: Mixed L2R and R2L paragraphs and horizontal scroll
Date: Sat, 30 Jan 2010 15:44:28 +0200

Here's a peculiar design decision that needs to be made for the bidi
display: how to display horizontally scrolled lines in a buffer with
mixed L2R and R2L paragraphs.

Let me start with an example of 2 single-line paragraphs (the frame
around the text shows the window borders):

      +---------------------------------------+
      |abcdefghijk                            |
      |                            KJIHGFEDCBA|
      |                                       |
      +---------------------------------------+

Looks okay, right?  But what if I split the window horizontally (with
"C-x 3"):

      +-------------------+-------------------+
      |abcdefghijk        |abcdefghijk        |
      |        KJIHGFEDCBA|        KJIHGFEDCBA|
      |                   |                   |
      +-------------------+-------------------+

Does this look correct?  Is anyone bothered by the fact that the
relative horizontal position of the two lines has changed, and yet
there are no line truncation glyphs anywhere in sight?

Some word processors have a rigid length of a line: they display a
ruler somewhere above or below the text, and therefore a line's length
is known as some fixed multiple of a standard character size.  In
these word processors, changing the window width preserves the
relative horizontal position of L2R and R2L lines.  But Emacs does not
have a rigid line length, so flushing the R2L lines against the right
margin of the window makes their position depend on the window width.
Is that okay?  (I think it is.)

Now let's split the leftmost window again, so lines get truncated:

      +---------+---------+-------------------+
      |abcdefgh$|abcdefgh$|abcdefghijk        |
      |$HGFEDCBA|$HGFEDCBA|        KJIHGFEDCBA|
      |         |         |                   |
      +---------+---------+-------------------+

Does this still look okay?  (I think it does.)

Now the crucial question: what do you think should happen if I scroll
the leftmost window horizontally so that the end of the first line
(the characters "ijk") become visible?  I think it should be this:

      +---------+---------+-------------------+
      |$ijk     |abcdefgh$|abcdefghijk        |
      |$HGFEDCBA|$HGFEDCBA|        KJIHGFEDCBA|
      |         |         |                   |
      +---------+---------+-------------------+

Note that the display of the second line in the leftmost window did
not change, and as result, the amounts of horizontal scroll in the 1st
and the 2nd lines are different.  This is unlike in the current
unidirectional display, where all the lines are always hscrolled by
the same amount.

Does this behavior look reasonable?  If not, what are the
alternatives?  Note that any alternative should be consistent about
the fact that Emacs does not have a rigid line length, therefore any
initial relative horizontal position of characters (before we split
the window) is arbitrary, and is a function of the window's initial
arbitrary width.




reply via email to

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