emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: set-fontset-font is slow if the fontset is specified by a long name


From: Kenichi Handa
Subject: Re: set-fontset-font is slow if the fontset is specified by a long name
Date: Mon, 25 Oct 2004 16:25:16 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

In article <address@hidden>, YAMAMOTO Mitsuharu <address@hidden> writes:

>>>>>>  On Mon, 25 Oct 2004 11:01:07 +0900 (JST), Kenichi Handa 
>>>>>> <address@hidden> said:
>>  set-fontset-font converts NAME into a regular expression while
>>  converting every '*' into '.*'.  So, the above slowness is because
>>  of this regular-expression processing is slow.

>>  (string-match "-.*-.*-.*-.*-.*-.*-.*-.*-.*-.*-.*-.*-fontset-default"
>>  "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default"))

>>  I fixed the code so that convert '*' to "[^-]*" if full XLFD is
>>  given.  This speedups the second example, but still the first one is
>>  faster because it's registered in fontset-alias-alist.

> How about consulting Vfontset_table literally before doing regexp
> matches?

Such a change may make what matches with NAME different from
the current code (though only in vary rare case such as you
have a fontset
"-adove-courier-*-*-*-*-*-*-*-*-*-*-fontset-default").

> The scenario I'm considering is something like the following:

>   (let ((fontset (create-fontset-from-ascii-font "7x14")))
>     (while ...
>      (set-fontset-font fontset ...)
>      ...)
>     (set-frame-font fontset))

Isn't the latest code fast enough?

---
Ken'ichi HANDA
address@hidden




reply via email to

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