[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [elpa] master 9f21e1d 06/18: Add a matching optimization
From: |
Oleh Krehel |
Subject: |
Re: [elpa] master 9f21e1d 06/18: Add a matching optimization |
Date: |
Mon, 20 Apr 2015 17:08:17 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> * ivy.el (ivy-completions): When the new regex `re' is a contains the
>> old regex `ivy--old-re', it must be true that all candidates that
>> match `re' are contained inside all candidates that match
>
> IIUC ivy-mode treats the minibuffer's content as a regexp, so the user
> can write any fancy regexp she wants. In that case, the above is
> actually not guaranteed. E.g. "foo" matches fewer candidates than
> "foo?".
True, it's an optimization for the most basic use of space separated
words. But I was playing around with filtering the 3000000 lines git
grep in the emacs repo, and I wanted to see if it would be faster with
the optimization.
I'll either add a custom var to turn this optimization on/off or try to
check if the input is just space-separated words.
>> + ((and ivy--old-re (eq 0 (cl-search ivy--old-re re)))
>
> Why not use string-prefix-p?
Because I didn't know about it. I'll switch.
Oleh