[Top][All Lists]

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

Re: highlighting non-ASCII characters

From: Lennart Borgman
Subject: Re: highlighting non-ASCII characters
Date: Mon, 29 Mar 2010 22:51:02 +0200

On Mon, Mar 29, 2010 at 10:19 PM, Stefan Monnier
<address@hidden> wrote:
>> Yes, probably.  But that's accidental.  I still think the character
>> classes [:idn:] (revised name from before) and [:confusable:] (or
>> [:homoglyph:]) would make sense as a first step, then we can decide how
>> to highlight them.
> The homoglyph data would be a useful starting point for the feature
> I imagine, indeed.  But from the message that started this thread, "K"
> is a homoglyph, yet highlighting it everywhere doesn't sound like a good
> idea, so basically we need to associate with each homoglyph char
> a context where it is expected and only highlight it when it appears in
> a different context (or maybe rather when it appears in the context of
> its peer).

I agree (and I agree to most of what Ted said too).

However just hilighting non-IDN chars seems useful enough. I think it
should be done everywhere (because it is simple and probably does not
hurt, IDN seems mostly useful for variables to for examples), or
optionally only in strings (the only URL context we can actually

For the moment I have implemented this as fontification. Having it as
a char class that is flexibly initialized would be better. Perhaps my
routines for reading the chars can be used there too.

The homoglyph context thing is maybe more difficult. I did not try to
read carefully so I do not know much. I guess there is something like
char value ranges to use, or? Someone knows which document that where
those ranges can be read (by some elisp code)?

reply via email to

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