Eli Zaretskii | 1 Feb 05:11
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

> Date: Sun, 31 Jan 2010 21:01:29 +0100
> From: martin rudalics <rudalics <at> gmx.at>
> CC: emacs-bidi <at> gnu.org, emacs-devel <at> gnu.org
> 
>  > In a R2L line, columns should be numbered from the
>  > right margin of the window.
> 
> Technically columns are numbered by counting characters following the
> last newline in the buffer text.

As Miles points out, it's not a simple character counting, but I see
what you mean.

> Just that for R2L text you have to jump to the end of the text first
> and then go back in the text.

Actually, if a R2L line displays text made mostly of strong R
characters (which is normally the case), the first character at the
right margin of the window is also the first character following the
newline in the buffer's logical order.

> So I suppose you're using the term window margin as metaphor here.

Yes, in a sense.  In the displayed portion of the buffer, that is
really the window margin, though.

> There is one thing I conceptually don't understand yet: When I currently
> shrink the width of a window Emacs doesn't hide text at the left side of
> the window but text at the right side may get truncated when the window
> becomes too small.  Will this behavior be reverted for R2L text in the
(Continue reading)

Eli Zaretskii | 1 Feb 05:12
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

> From: Miles Bader <miles <at> gnu.org>
> Cc: Eli Zaretskii <eliz <at> gnu.org>,  emacs-bidi <at> gnu.org,  emacs-devel <at> gnu.org
> Date: Mon, 01 Feb 2010 06:53:21 +0900
> 
> martin rudalics <rudalics <at> gmx.at> writes:
> > Technically columns are numbered by counting characters following the
> > last newline in the buffer text.
> 
> Eh?  Clearly they're not, because things like tabs expand into multiple
> columns...  Columns are a display concept, not a buffer concept.

I guess Martin meant to say that column numbering is defined even for
parts of a buffer that are not displayed, or even for buffers that are
not displayed in any window.
Ehud Karni | 1 Feb 15:00
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

On Sat, 30 Jan 2010 15:44:28 Eli Zaretskii wrote:
>
> 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|
>       |                                       |
>       +---------------------------------------+

[sniped]  Eli's final conclusion for scrolled text is:

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

I agree with Eli's decision, but it applies only to non-technical text.

Consider Example1: a list of items, each line has: name, quantity,
catalog-id and description. Most of the names are in Latin but some
are in Hebrew.
In this case there must be an external dictation of paragraph direction.

(Continue reading)

Eli Zaretskii | 1 Feb 21:18
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

> Date: Mon, 1 Feb 2010 16:00:45 +0200
> From: "Ehud Karni" <ehud <at> unix.mvs.co.il>
> Cc: emacs-devel <at> gnu.org, emacs-bidi <at> gnu.org
> 
> [sniped]  Eli's final conclusion for scrolled text is:
> 
> >       +---------+---------+-------------------+
> >       |$ijk     |abcdefgh$|abcdefghijk        |
> >       |     KJI$|$HGFEDCBA|        KJIHGFEDCBA|
> >       |         |         |                   |
> >       +---------+---------+-------------------+
> 
> I agree with Eli's decision, but it applies only to non-technical text.

What is a ``non-technical text'', and how is it different from the
other kind?  Also, to what kind belong your examples in this message?

> Consider Example1: a list of items, each line has: name, quantity,
> catalog-id and description. Most of the names are in Latin but some
> are in Hebrew.

Where is Example1?  I don't see it in the message you posted?  Did you
talk in general about itemized lists with mixed L2R and R2L text?

> In this case there must be an external dictation of paragraph direction.

There is already a variable to force certain paragraph direction on
all the paragraphs in a buffer.  Finer (per-paragraph) control can be
exercised by starting a paragraph with a suitable mark (RLM or LRM)
character.
(Continue reading)

Eli Zaretskii | 1 Feb 21:21
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

> Date: Mon, 01 Feb 2010 09:34:53 +0100
> From: martin rudalics <rudalics <at> gmx.at>
> CC: emacs-bidi <at> gnu.org, emacs-devel <at> gnu.org
> 
> It might be probably interesting for a user to dynamically switch during
> typing whether a buffer should be dominantly displayed as R2L or L2R.

I already implemented such a feature: a per-buffer variable that
forces all paragraphs to be either L2R or R2L.  A value of `nil' means
the direction of each paragraph is dynamically determined by applying
the rules described in the Unicode Standard Annex 9 (UAX#9).
Eli Zaretskii | 1 Feb 22:51
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

> From: Richard Stallman <rms <at> gnu.org>
> Date: Mon, 01 Feb 2010 16:05:19 -0500
> Cc: emacs-bidi <at> gnu.org, emacs-devel <at> gnu.org
> 
>  
>     > Horizontal scrolling should apply to the whole window contents
>     > in a rigid fashion.
> 
>     But that cannot be done in this case, because the second line cannot
>     be scrolled to the left without moving its first character A from the
>     right margin.
> 
> Horizontal scrolling does whatever we make it do.  The question
> is what behavior is best.
> 
> I'm saying that horizontal scrolling should move the window contents
> rigidly left or right, just as vertical scrolling moves the contents
> rigidly up or down.

That can be done, but then we will probably need to introduce some new
display features to indicate that the first character is scrolled off
the margin.  Otherwise, the display will look confusing wrt where each
line begins.  For example, we could draw special glyphs at the left
margin in L2R lines and on the right margin in R2L lines, or we might
use something similar to trailing-whitespace display.

> The definition of hscroll is not the same as how we number columns for
> indentation purposes.

That's true, but the effect of hscroll is defined in terms of columns,
(Continue reading)

Eli Zaretskii | 2 Feb 20:30
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

> Date: Tue, 02 Feb 2010 09:08:40 +0100
> From: martin rudalics <rudalics <at> gmx.at>
> CC: emacs-bidi <at> gnu.org, emacs-devel <at> gnu.org
> 
>  > I already implemented such a feature: a per-buffer variable that
>  > forces all paragraphs to be either L2R or R2L.  A value of `nil' means
>  > the direction of each paragraph is dynamically determined by applying
>  > the rules described in the Unicode Standard Annex 9 (UAX#9).
> 
> I meant a function which does (1) set such a variable

You mean, besides "M-x set-variable RET"?

> and (2) apply it to one or all windows showing a buffer.

Currently, the variable is per-buffer, so it affects all the windows
showing that buffer.  Why would one need to do that only in some
windows showing a buffer?

> Calling this function would temporarily override any L2R/R2L
> specifications specified for a file, buffer, or paragraph.

There are no specifications for a file (unless you set the variable
I'm talking about in file's local variables section).  As for
individual paragraphs, control of their base direction is not by some
Emacs setting, but by inserting special formatting characters at the
beginning of each paragraph.  These characters (LRM and RLM) are
supposed to be invisible by default, i.e. displayed as zero-width
space, but they have strong directionality, L for LRM and R for RLM.
Since UAX#9 says that a paragraph's base direction is determined by
(Continue reading)

Richard Stallman | 2 Feb 22:21
Picon
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

    That can be done, but then we will probably need to introduce some new
    display features to indicate that the first character is scrolled off
    the margin.

The margin glyphs indicate that; I don't we need to change anything there.

    > The definition of hscroll is not the same as how we number columns for
    > indentation purposes.

    That's true, but the effect of hscroll is defined in terms of columns,
    so I think it's best not to break the relation between column
    numbering and hscroll.

The relation is that they count in the same units.  R2L text will not
alter that relationship in any case; one column as regards scrolling
will still be one column as regards indentation.
Richard Stallman | 2 Feb 22:21
Picon
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

     > Since R2L text lines start from the right margin, that will remain
     > true after changes in window width.  This is true independent of how
     > hscroll works.

    With L2R and R2L lines in one and the same buffer we have to decide
    which line type is given preference whenever shrinking a window
    truncates at least one L2R and at least one R2L line.  "Giving
    preference" here means which line type is allowed to place its first
    column at the respective window margin.

I think you are right, when the window shrinks that much.
However, if it shrinks but not enough to make both types truncate,
then there is no need to make a choice.
Eli Zaretskii | 3 Feb 20:01
Picon

Re: Mixed L2R and R2L paragraphs and horizontal scroll

> Date: Wed, 3 Feb 2010 15:22:19 +0200
> From: "Ehud Karni" <ehud <at> unix.mvs.co.il>
> Cc: emacs-bidi <at> gnu.org, emacs-devel <at> gnu.org
> 
> In a wide screen the above will be shown as:
>     +------------------------------------------------------------+
>     |                                            NI SELIF EHT TUP|
>     |/dir1/sdr2/sdr3                                             |
>     |                                        MEHT EKAT LLIW I DNA|
>     +------------------------------------------------------------+
> 
> In a less wide screen it will be shown as:
>     +----------------------------+
>     |            NI SELIF EHT TUP|
>     |/dir1/sdr2/sdr3             |
>     |        MEHT EKAT LLIW I DNA|
>     +----------------------------+
> 
> In a wide screen with `right-margin-goal-column` set to 30:
>     +------------------------------------------------------------+
>     |              NI SELIF EHT TUP                              |
>     |/dir1/sdr2/sdr3                                             |
>     |           EHT EKAT LLIW I DNA                              |
>     +------------------------------------------------------------+
> 
> I hope this is clearer.

Yes, it's clear.  But why is the last variant better than the others?
Is there really significance to the relative horizontal positions of
characters in different lines that makes it important to preserve that
(Continue reading)


Gmane