emacs-bidi
[Top][All Lists]
Advanced

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

[emacs-bidi] Display of continuation lines


From: Eli Zaretskii
Subject: [emacs-bidi] Display of continuation lines
Date: Mon, 01 Oct 2001 14:58:53 +0200

As I slowly work on coding the sequential bidi algorithm suited for
Emacs, one issue presented itself that I thought would be useful to
discuss: how do we want to display continuation lines.

Given a pure LTR text:

      abcdefghijklm

if the window line is too short to display all of it, it is displayed
by the current Emacs code like this:

      abcdefgh\
      ijklm

(Emacs 21 uses some special graphical glyph instead of the \, but the
principle doesn't change.)

The question is, given a bidirectional text:

      abcdeABCDEFGH

do we want it to be displayed like this:

      abcdeHGF\
      EDCBA

or like this:

      abcdeCBA\
      HGFED

Please note: I'm _not_ talking about filling text.  Filling text
inserts newlines into the buffer, and will therefore be displayed like
this:

      abcdeCBA
      HGFED

Continuation lines are something different; they are what UTR#9 calls
``line breaks'', except that line breaks in a typical word procesor
work like filling in Emacs.  And, since no bidi word-processor I know
of supports Emacs-style continuation lines, we seem to be on uncharted
territory here.

The main problem with continuation lines is that, AFAIK, implementing
the second form of display above is infeasible with the current design
of the Emacs display engine, because the decision whether the current
line should be continued is made only after computing the glyphs for
each display element and after the computed glyphs are entered into
the glyph matrices.  By contrast, rearrangement of the characters from
logical to visual order must happen _before_ computations of the
display elements, and so it cannot know whether the current line is to
be broken, and where.  Adding line-break computations to the logical-
to-visual transformation would slow down the display a great deal.

So if you think that the correct display is the second variant above,
please also tell whether it is reasonable to defer the solution of
this to a later time, and have the initial bidi support in Emacs work
like shown in the first variant.

Any comments are welcome.



reply via email to

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