From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: [harder@ifa.au.dk: Speed of all-completions] Date: 15 Jun 2004 01:27:48 +0200 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1087255737 4982 80.91.224.253 (14 Jun 2004 23:28:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 14 Jun 2004 23:28:57 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Jun 15 01:28:48 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ba0si-0003nG-00 for ; Tue, 15 Jun 2004 01:28:48 +0200 Original-Received: from lists.gnu.org ([199.232.76.165]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ba0si-0005Pq-00 for ; Tue, 15 Jun 2004 01:28:48 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Ba0td-0006u0-03 for emacs-devel@quimby.gnus.org; Mon, 14 Jun 2004 19:29:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Ba0tH-0006tj-Kx for emacs-devel@gnu.org; Mon, 14 Jun 2004 19:29:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Ba0tH-0006tQ-4U for emacs-devel@gnu.org; Mon, 14 Jun 2004 19:29:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Ba0tH-0006tN-0i for emacs-devel@gnu.org; Mon, 14 Jun 2004 19:29:23 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Ba0rt-0002iR-AR for emacs-devel@gnu.org; Mon, 14 Jun 2004 19:27:57 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1Ba0rm-0000rs-Ay; Mon, 14 Jun 2004 19:27:50 -0400 Original-To: Andreas Schwab In-Reply-To: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-Lines: 25 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:24975 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:24975 Andreas Schwab 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