[Top][All Lists]

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

Re: Bidirectional text and URLs

From: Eli Zaretskii
Subject: Re: Bidirectional text and URLs
Date: Sun, 07 Dec 2014 17:50:39 +0200

> Date: Sun, 07 Dec 2014 04:20:31 -0500
> From: Richard Stallman <address@hidden>
> Cc: address@hidden, address@hidden
>   > >   > We already have a better solution for that, I just added yesterday 
> the
>   > >   > infrastructure that enables such a solution.
>   > > 
>   > > Could you tell me what that solution is?  I'm concerned that we
>   > > may be miscommunicating again.
>   > I meant this primitive:
>   >   (bidi-find-overridden-directionality FROM TO &optional OBJECT)
>   >   Return position between FROM and TO where directionality was overridden.
> This looks like a way to _test_ part of a buffer or string to see if
> it has any bidi strangeness.  Could you confirm?

Yes, that's the purpose of that primitive.

> If so, the questionis: once you detect the strangeness, what then?

It's up to the application.  Lars requested the above infrastructure
for eww, so I guess we will need to see what eww does to handle these
"reversed" URLs.  It's possible that eww will need some further
assistance in that matter, in which case it should come up with the
requirements, and we (probably I) should implement whatever is needed.

> I suppose the next step is either an error message or a query.
> In either case, I think we should show the user (1) what the text
> looks like and (2) what's actually in it.
> With your implementation of context-regeneration, we can show what
> the text looks like.
> How can we show what it really is?

That's easy: copy the text without the directional override and
display it in some other buffer.  The position returned by
bidi-find-overridden-directionality is of the 1st character following
the override control, so copying the text starting at that position
will exclude the override and avoid its effects.

The advantage of this method as compared to presenting the text
non-reordered (a.k.a. "disable bidi") is that the above method works
for RTL text that is similarly obfuscated by the LRO character,
whereas disabling bidi reordering will show RTL text in the order that
is very hard, sometimes impossible, to read correctly (it has the same
effect as showing words in reversed order to a user of a left-to-right

> Perhaps what we want is a suppress-bidi property, or a bidi property
> that would specify the direction for certain text.  These properties
> would override all bidi attributes of the characters themselves.

I think this won't be needed, but if it is, then it certainly can be

reply via email to

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