emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r105429: New function `string-mar


From: Eli Zaretskii
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r105429: New function `string-mark-left-to-right' for handling LRMs.
Date: Thu, 11 Aug 2011 06:02:39 +0300

> From: Stefan Monnier <address@hidden>
> Date: Wed, 10 Aug 2011 22:14:28 -0400
> Cc: address@hidden
> 
> > +** New function `string-mark-left-to-right' appends a Unicode LRM
> > +(left-to-right mark) character to a string if it terminates in
> > +right-to-left script.

This algorithm (which the code implements) is wrong: the unwanted
reordering can happen even if the string does not end in a strong R
character.  It could end in a series of weak characters, if the strong
character preceding that is R, for example.

The precise definition of the necessary conditions is complicated.
That is why I suggested to test _all_ the characters for being strong
R.  Why wasn't that implemented?  It might catch more strings that
need this, but at least it won't miss any.

If we really want only a 100% accurate solution, I will need to code
something non-trivial.  Let me know.

>                           This is useful when the buffer has overall
> > +left-to-right paragraph direction and you need to insert a string
> > +whose contents (and directionality) are not known in advance.
> 
> This is too low-level a description I think.  It's understandable by
> people who understand what LRM does

I think even people who know about that won't realize the purpose.

> Maybe something along the lines of
> 
>   "Add whatever is necessary for STRING to make sure its content is not
>   reordered with surrounding text"

This is also incorrect or at least inaccurate.  The problem is with
reordering the text following the offending string, not surrounding
it, nor with reordering the string content itself.



reply via email to

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