emacs-devel
[Top][All Lists]
Advanced

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

Re: bidi and shaping problems in describe-input-method


From: Eli Zaretskii
Subject: Re: bidi and shaping problems in describe-input-method
Date: Sat, 10 Mar 2012 12:27:28 +0200

> From: Kenichi Handa <address@hidden>
> Date: Sat, 10 Mar 2012 11:55:54 +0900
> Cc: address@hidden, address@hidden
> 
> The function body I wrote is just an idea, not a complete
> solution, and of cource checking against L is apparently
> a bug.  At least we must check against R (and AL).
> 
> > > > Also, `lower' and `upper' could be strings, in which case you need a
> > > > more complex test.
> > > 
> > > We can give (if (string lower) (aref lower 0) lower) to that
> > > function.
> 
> > But that doesn't DTRT.  Here's an example where it will fail: ".A".
> 
> Why?

I was explaining why testing for L is not TRT.

> ... | LU | LU | ...
> 
> What we want is to display the left LU to the left of the
> right LU, and display each L (character or string) to the
> right of the corresponding U.
> 
> Even if the L (of the left LU) is ".A", we don't need LRM
> for it.  We have to insert LRM only before a character that
> may reorder the previous characters, and after a character that
> may reorder the following character.  Isn't it right?

You are describing what bidi-string-mark-left-to-right does, I
believe.  Note that it will still insert LRM in some cases where it is
not strictly needed.

> > I tried also a different solution: enclose each row of the keyboard
> > layout in an L2R override embedding, LRO..PDF.  This inserts only 2
> > control characters per row, and doesn't insert them inside the
> > keyboard cells, so it is cleaner, I think.  But using this means that
> > no key description in the layout can be a string that requires
> > reordering individually.  (By contrast, inserting an LRM between the
> > lower and the upper key still allows each description to be
> > reordered.)  Can we live with such a restriction?  I don't know enough
> > about Quail to tell.
> 
> As it's possible to assign a string to a key, there will be
> the case that the characters in the string must be
> reordered.  In the above case, if L is a hebrew "שלום", it
> must be reordered.  But, even if we surround that word with
> LRE and PDF, the word itself is reordered correctly, right?

Yes.  But surrounding each `lower' and `upper' key labels in the
layout with LRE..PDF inserts even more bidirectional control
characters than just inserting LRM.  By contrast, using LRO..PDF
around the whole row of keys inserts just 2 such characters, so if it
were not for the need to reorder the individual key labels, LRO..PDF
would be a better alternative.  I mentioned it because it does exactly
what you originally asked for: it effectively disables
bidi-display-reordering inside the embedded text, while still leaving
the rest of the buffer reordered as usual.




reply via email to

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