unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: [harder@ifa.au.dk: Speed of all-completions]
Date: 15 Jun 2004 01:27:48 +0200	[thread overview]
Message-ID: <x5ekohyb2j.fsf@lola.goethe.zz> (raw)
In-Reply-To: <jehdtfp08a.fsf@sykes.suse.de>

Andreas Schwab <schwab@suse.de> 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	other threads:[~2004-06-14 23:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-13 21:48 [harder@ifa.au.dk: Speed of all-completions] Richard Stallman
2004-06-13 22:22 ` Andreas Schwab
2004-06-14 23:27   ` David Kastrup [this message]
2004-06-15  0:04     ` Luc Teirlinck
2004-06-15  7:29       ` David Kastrup
2004-06-15 11:00     ` Andreas Schwab
2004-06-15 11:28       ` David Kastrup
2004-06-15 12:13         ` Andreas Schwab
2004-06-15 13:27           ` David Kastrup
2004-06-15 13:40             ` Andreas Schwab
2004-06-15 13:48               ` David Kastrup
2004-06-15 14:08                 ` Andreas Schwab
2004-06-15 14:19                   ` David Kastrup
2004-06-15 14:32                     ` Andreas Schwab
2004-06-15 15:42             ` Luc Teirlinck
2004-06-15 15:55               ` David Kastrup
2004-06-18 18:45                 ` Luc Teirlinck
2004-06-19  3:19                   ` Richard Stallman
2004-06-20 22:35                     ` David Kastrup
2004-06-15 18:13   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=x5ekohyb2j.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).