emacs-devel
[Top][All Lists]
Advanced

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

Re: Changes in frame/window code


From: Eli Zaretskii
Subject: Re: Changes in frame/window code
Date: Mon, 28 Jul 2014 21:15:37 +0300

> Date: Mon, 28 Jul 2014 19:27:34 +0200
> From: martin rudalics <address@hidden>
> CC: address@hidden
> 
> I still have no feeling for how hscrolling works with bidi text.  IIUC
> with L2R and R2L paragraphs in the same window, like
> 
> LLLLLLLLLLLLLLLLLLLLLL2RRRRRRRRRRRRRRRRRRR
> 
>                 RRRRRRR2LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL
> 
> hscrolling will NOT preserve the aspect that the two "2" visually appear
> above each other.  Correct?

Yes.  As the hscroll amount grows, the characters in the L2R lines
will move to the left, while characters in the R2L lines will move to
the right.

>  > I feel there's some misunderstanding here, because I don't believe
>  > you'd ask about such trivia.  What am I missing?  What's bothering
>  > you?
> 
> What you said earlier, that "Horizontal scrolling of mixed-direction
> paragraphs is a hard problem".

It's a hard problem primarily because it's hard to know what is TRT,
and there's no "prior art" to follow.

>  >> Is the size of the slider correct in the sense described above?
>  >
>  > Yes.
> 
> Did you check with a window containg say one huge L2R line and all
> other lines short and one huge R2L line and all other lines short?

Yes.  Again, this is just normal hscroll, which works with
bidirectional text since v24.1.  The fact that hscroll is triggered by
clicking the scroll bar does not matter, as long as the direction of
the scroll is interpreted correctly.  The changes I made simply took
care of translating the scroll-bar clicks to hscroll amount.

> The whole idea would be then to change the positions of
> 
>        start = w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w));
> 
> and
> 
>        end = start + box_width;
> 
> on lines 15808 and 15810 of xdisp.c according to the value of
> `current-bidi-paragraph-direction'.  But how?

You need to reverse the meaning of START and END for the R2L case:

   end = whole - w->hscroll * FRAME_COLUMN_WIDTH (WINDOW_XFRAME (w));
   start = end - box_width;

(Note that current-bidi-paragraph-direction returns the results at
buffer's point, so you will need to temporarily go to the window's
point marker.)



reply via email to

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