[Top][All Lists]

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

Re: faster unicode character name completion

From: Kenichi Handa
Subject: Re: faster unicode character name completion
Date: Mon, 07 Dec 2009 11:00:41 +0900

In article <address@hidden>, Stefan Monnier <address@hidden> writes:

> > The drawback of the new code is that one can see only the
> > list of the first words of character names in the completion
> > buffer at once by C-x 8 RET TAB, instead of all of the
> > unicode character names.

> That's a pretty serious drawback as it prevents uses such as
> C-x 8 RET *arro TAB.

It may be possible to automatically fallback to the current
way of building a full list in such a case.

> Maybe another way to speed things up is to precompute the
> ucs-completions lazy completion table at compilation time and store it
> in a .elc file, so it can be "computed" by reading that file.

> This can be done simply by having an autoloaded `ucs-completions'
> function in a file where the ucs-completions variable is defined with an
> eval-when-compile expression.

Yes, that's one solution.

> > (defun ucs-name-filter (str names)
> >   (let (l)
> >     (dolist (elt names)
> >       (if (eq (string-match str (car elt)) 0)
> >       (push elt l)))
> >     l))

> > (defun ucs-name-completion (str)
> >   (when (string-match "^[A-Za-z]*" str)
> >     (let ((head (match-string 0 str))
> >       slot names)
> >       (if (and (= (length head) (length str))
> >            (not (assoc-string str ucs-name-head-table)))
> >       (ucs-name-filter str ucs-name-head-table)
> >     (ucs-name-filter str (ucs-name-expand-table head))))))

> I don't understand what ucs-name-filter is trying to do.

?? It simply filters out elements that doesn't match with
STR from NAMES (alist).

Kenichi Handa

reply via email to

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