emacs-devel
[Top][All Lists]
Advanced

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

Re: idn.el and confusables.txt


From: Eli Zaretskii
Subject: Re: idn.el and confusables.txt
Date: Sat, 14 May 2011 19:42:39 +0300

> From: Ted Zlatanov <address@hidden>
> Date: Sat, 14 May 2011 10:30:37 -0500
> 
> It wouldn't be ideal, surely, but most glyphs are not confusable so the
> lookup would fail.

For some value of "most": there are 20K entries in confusables.txt.

> I might write some of it in C if performance was an issue

C won't help, if you need to access the same char-table and compare
with half a dozen possible symbols.

> or try to inline the conditions with macros, or cache the lookups.

Isn't it better to design the table for efficient use to begin with?

> But I don't know if markchars.el needs to be terribly fast.

I hope we are not introducing another character property for a single
use.  Some use, some day might need to do it fast.

> It runs at the font-lock level and IIUC that's opportunistic and not
> time-critical like the display code.  For instance, unmodified text is
> not rechecked, right?

No, you cannot count on that.  E.g., fontification-functions are
always called with a region that starts at the beginning of a line,
even if part of that line is already fontified.

> Two char-tables would be enough: one small table for the confusable ->
> target mapping, and one even smaller for the reverse target ->
> (confusable list) mapping.  The reverse lookup table could be stored in
> an extra slot of the primary lookup table.

Doesn't confusables.txt include both mappings already?  If so, you
don't need the reverse table.



reply via email to

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