[Top][All Lists]

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

Re: Bidirectional text and URLs

From: Ted Zlatanov
Subject: Re: Bidirectional text and URLs
Date: Fri, 28 Nov 2014 19:26:14 -0500
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)

On Fri, 28 Nov 2014 16:02:02 -0500 Stefan Monnier <address@hidden> wrote: 

>> For Gnus users, for instance, the buffer would be using SHR so there's
>> some control over the experience and metadata about the content.  You're
>> right that in general this is not clear, which is why interactive
>> functions like `browse-url' and others may need to be advised.

SM> What I meant is that in the SHR case, the text displayed is not the URL
SM> but some random piece of text that should be highlighted as a button
SM> (although in some cases it is the same text as the URL itself, SHR has
SM> no idea whether that's the case or not).

SM> We can do something in the Gnus case rendering non-HTML contents, where
SM> the URL is highlighted as a button, because at that point we do display
SM> something which we know is supposed to be interpreted by the user as a URL.

I see what you mean. You're right that it should be rendered
differently, but there's too many ways the rendering can be modified by
the buffer mode, so whatever SHR does will not be enough. Intercepting
the `browse-url' action, on the other hand, is definitely going to
interrupt the user in order to warn them, no matter how they got that

For rendering, I think some help from the core would be nice for modes
that want it; see below about "markchars" and `prettify-symbols-mode' etc.

On Sat, 29 Nov 2014 00:26:01 +0200 Eli Zaretskii <address@hidden> wrote: 

>> From: Ted Zlatanov <address@hidden>
>> Date: Fri, 28 Nov 2014 14:49:59 -0500
>> I'm not sure about the bidi markers, Eli can discuss that side.  I'll
>> try to get the confusables in there and maybe write general code that
>> bidi markers and others can hook into.

EZ> I cannot say I can follow that.  Those "bidi markers" are just
EZ> characters, so how can they hook into something?

Sorry, I meant "code that detects suspicious bidi markers" instead of
"bidi markers." We have the "markchars" package in the GNU ELPA, which
can currently highlight Unicode confusables and others with a special
face (magenta underline by default). For confusables specifically, it
just looks for more than one Unicode script within a word, so it's not
exactly what Lars asked originally. There was an epic discussion about
"markchars" back in 2011: http://comments.gmane.org/gmane.emacs.devel/122200

Anyhow, I was thinking of bringing something like "markchars" into the
core and also making the "uni-confusables" package (which is just a
conversion of the Unicode confusables.txt) available by default as a
char-table. I'm not sure what it will look like, so if anyone can think
of precedents, let me know. I think the `prettify-symbols-mode' approach
is one possibility, and in fact it was just suggested recently that it
should support regexps... any others?

EZ> For that matter, what functionality are we talking about?
>> The uni-confusables package from the GNU ELPA and glue code to let SHR
>> and EWW know that a URL includes such characters.

EZ> Once again, these characters are not confusables.  Their use around
EZ> the URL is.  So highlighting them wherever we see them is not
EZ> necessarily the best way.

OK, understood.  See above about rendering vs. interrupting UI flow.
The latter is what Lars suggested and I agree is more useful.


reply via email to

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