emacs-devel
[Top][All Lists]
Advanced

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

Re: Bidirectional text and URLs


From: Lars Magne Ingebrigtsen
Subject: Re: Bidirectional text and URLs
Date: Mon, 01 Dec 2014 18:49:58 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> > Anyway, if you want this, please show the API of the function -- what
>> > it should return and how.
>> 
>> Actually, I'm not sure.  :-) Would it make any sense to have a function
>> like `(displayed-directionality POSITION)' that returns either
>> `right-to-left' or `left-to-right?  If so, the URL-finding function
>> would query about the start of the URL (which would normally be the HTTP
>> part), and if that's `right-to-left', Here There Be Shenanigans.
>
> How is this different from the previous suggestion?

I'm not sure what you are referring to.

>> So is your suggestion here to disable all RLO (etc.) characters in mail
>> buffers?
>
> No, only RLOs that affect URLs.
>
> Specifically, I suggest to look for RLO before a URL on the same
> physical line, and PDF or hard newline after it, and if found, cover
> it by a display property whose value is e.g. a string " ".  Since just
> the fact that you find an RLO before doesn't yet mean that it's a
> malicious RLO (other bidirectional controls which you don't want to
> know about can countermand the RLO before it affects the URL display),
> I suggest to augment that by checking that the URL's host and domain
> parts consist of LTR characters whose directionality was overridden.
> The latter part is to be done by calling a new primitive mentioned
> above.
>
> Given all this evidence, I think it's pretty much certain that we
> found our offending RLO.

If you think that that's sufficient (that we only need to look for
preceding RLOs on the same line), then this sounds like a good solution
to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

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