[Top][All Lists]

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

Re: address@hidden: Speed of all-completions]

From: David Kastrup
Subject: Re: address@hidden: Speed of all-completions]
Date: 15 Jun 2004 01:27:48 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Andreas Schwab <address@hidden> writes:

> This is due to this change:
>       (Ftry_completion, Fall_completions, Ftest_completion): Bind
>       case-fold-search to the value of completion-ignore-case when
>       checking completion-regexp-list.
> I've checked in a fix that avoids the overhead of specbind when
> completion-regexp-list is empty.

At the cost of being more expensive when it isn't.  I don't see why
you have to undo the binding all the time.  Just initialize the
binding depth variable to something illegal at the start of the
function.  Then when you need the binding, you check whether it has
already been done and do it if needed.

And at the exit of the function, you check whether the binding had
happened and in that case undo it before returning.

That way you avoid the overhead of the binding when it is not needed,
but pay at most for one binding when it _is_ needed.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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