emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Unicode Lisp reader escapes


From: Oliver Scholz
Subject: Re: [PATCH] Unicode Lisp reader escapes
Date: Thu, 04 May 2006 15:07:36 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

address@hidden (Kim F. Storm) writes:

> Oliver Scholz <address@hidden> writes:
>
>> Here's the patch, only slightly tested:
>
>> +
>> +/* Return the internal character coresponding to an UCS code point.*/
>> +
>> +int
>> +ucs_to_internal (ucs)
>> +     int ucs;
>> +{
>> +  if (! EQ (Qnil, SYMBOL_VALUE (intern ("utf-translate-cjk-mode"))))
>> +      if (EQ (Qnil, SYMBOL_VALUE (intern ("utf-translate-cjk-lang-env"))))
>> +        call0 (intern ("utf-translate-cjk-load-tables"));
>> +                           Fget (intern ("utf-subst-table-for-decode"),
>> +                                 intern ("translation-hash-table")),
>> +      Lisp_Object vect = Fget (intern ("utf-translation-table-for-decode"),
>> +                               intern ("translation-table"));
>> +}
>
> That's 7 lisp vars accessed from C - for decoding one character!?!

Nearly inevitable, if you want to DTRT with CJK.

> How often does this happen?

Every time a character specified with \u is decoded. The call0,
however, probably just once per Emacs session.

> If it is only/primarily used for interactive use, I guess it doesn't matter.
> Otherwise, I think those vars should be declared in C, to avoid the overhead
> of interning them at run-time...

I tend to agree; but that is probably too intrusive.


    Oliver
-- 
15 Floréal an 214 de la Révolution
Liberté, Egalité, Fraternité!





reply via email to

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