unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [elpa] master 9f21e1d 06/18: Add a matching optimization
       [not found] ` <E1YkAyd-0005aA-JJ@vcs.savannah.gnu.org>
@ 2015-04-20 15:02   ` Stefan Monnier
  2015-04-20 15:08     ` Oleh Krehel
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2015-04-20 15:02 UTC (permalink / raw)
  To: emacs-devel; +Cc: Oleh Krehel

>     * 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?".

> +                      ((and ivy--old-re (eq 0 (cl-search ivy--old-re re)))

Why not use string-prefix-p?


        Stefan



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [elpa] master 9f21e1d 06/18: Add a matching optimization
  2015-04-20 15:02   ` [elpa] master 9f21e1d 06/18: Add a matching optimization Stefan Monnier
@ 2015-04-20 15:08     ` Oleh Krehel
  2015-04-20 17:29       ` Artur Malabarba
  0 siblings, 1 reply; 7+ messages in thread
From: Oleh Krehel @ 2015-04-20 15:08 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> 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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [elpa] master a94ca83 01/18: swiper.el: Add a work-around for window-start not being current
       [not found] ` <E1YkAyb-0005Z5-GL@vcs.savannah.gnu.org>
@ 2015-04-20 15:08   ` Stefan Monnier
  2015-04-20 15:19     ` Oleh Krehel
  0 siblings, 1 reply; 7+ messages in thread
From: Stefan Monnier @ 2015-04-20 15:08 UTC (permalink / raw)
  To: emacs-devel; +Cc: Oleh Krehel

>     An alternative would be to use `redisplay' to update `window-start' and
>     `window-end', but that causes excessive blinking.

Yes, this sucks.  Currently, I think the best mechanism in Emacs to
perform such highlighting is fontification-functions, but that is used
by jit-lock.  So you could use jit-lock-register, but it would cause
re-font-locking the (visible part of) the buffer, which also sucks.

jit-lock should ideally be extended to better deal with "multiple
clients" so that it is able to understand that some parts of the buffer
have already been handled by some clients (currently, it's all or
nothing: either jit-lock thinks that a part of the buffer has been
handled by all clients, or it thinks that it's been handled by none).


        Stefan



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [elpa] master a94ca83 01/18: swiper.el: Add a work-around for window-start not being current
  2015-04-20 15:08   ` [elpa] master a94ca83 01/18: swiper.el: Add a work-around for window-start not being current Stefan Monnier
@ 2015-04-20 15:19     ` Oleh Krehel
  2015-04-20 19:46       ` Stefan Monnier
  0 siblings, 1 reply; 7+ messages in thread
From: Oleh Krehel @ 2015-04-20 15:19 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>>     An alternative would be to use `redisplay' to update `window-start' and
>>     `window-end', but that causes excessive blinking.
>
> Yes, this sucks.  Currently, I think the best mechanism in Emacs to
> perform such highlighting is fontification-functions, but that is used
> by jit-lock.  So you could use jit-lock-register, but it would cause
> re-font-locking the (visible part of) the buffer, which also sucks.
>
> jit-lock should ideally be extended to better deal with "multiple
> clients" so that it is able to understand that some parts of the buffer
> have already been handled by some clients (currently, it's all or
> nothing: either jit-lock thinks that a part of the buffer has been
> handled by all clients, or it thinks that it's been handled by none).

It's not a big deal for swiper: in this case, just double the window
height gets overlays, instead of single window height.
The advantage is that I don't have to deal with callbacks and sequencing.

Oleh




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [elpa] master 9f21e1d 06/18: Add a matching optimization
  2015-04-20 17:29       ` Artur Malabarba
@ 2015-04-20 17:29         ` Oleh Krehel
  0 siblings, 0 replies; 7+ messages in thread
From: Oleh Krehel @ 2015-04-20 17:29 UTC (permalink / raw)
  To: Artur Malabarba; +Cc: Stefan Monnier, emacs-devel

Artur Malabarba <bruce.connor.am@gmail.com> writes:

>> >> + ((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.
>
> Is it on 24.1? (can't check right now)

Thanks to the new and improved `counsel-git-grep' I found this in the Changelog:

> ** New function `string-prefix-p'.
> (This was actually added in Emacs 23.2 but was not advertised at the time.)

Could someone help me with this issue: when I combine `while-no-input'
and `shell-command-to-string` I get annoying "Waiting for process to
die...done" messages interrupting by minibuffer?

Oleh



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [elpa] master 9f21e1d 06/18: Add a matching optimization
  2015-04-20 15:08     ` Oleh Krehel
@ 2015-04-20 17:29       ` Artur Malabarba
  2015-04-20 17:29         ` Oleh Krehel
  0 siblings, 1 reply; 7+ messages in thread
From: Artur Malabarba @ 2015-04-20 17:29 UTC (permalink / raw)
  To: Oleh; +Cc: Stefan Monnier, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 207 bytes --]

> >> +                      ((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.

Is it on 24.1? (can't check right now)

[-- Attachment #2: Type: text/html, Size: 313 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [elpa] master a94ca83 01/18: swiper.el: Add a work-around for window-start not being current
  2015-04-20 15:19     ` Oleh Krehel
@ 2015-04-20 19:46       ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2015-04-20 19:46 UTC (permalink / raw)
  To: Oleh Krehel; +Cc: emacs-devel

> It's not a big deal for swiper: in this case, just double the window
> height gets overlays, instead of single window height.

That assumes that the displayed text lines have indeed the
expected height.  If you play with images, change the size of some
fonts, play with text-scale-adjust, or with invisible text, you may bump
into corner cases where you code will get it wrong.  Or if the scroll
goes much further for some reason.


        Stefan



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-04-20 19:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20150420123900.21320.5807@vcs.savannah.gnu.org>
     [not found] ` <E1YkAyd-0005aA-JJ@vcs.savannah.gnu.org>
2015-04-20 15:02   ` [elpa] master 9f21e1d 06/18: Add a matching optimization Stefan Monnier
2015-04-20 15:08     ` Oleh Krehel
2015-04-20 17:29       ` Artur Malabarba
2015-04-20 17:29         ` Oleh Krehel
     [not found] ` <E1YkAyb-0005Z5-GL@vcs.savannah.gnu.org>
2015-04-20 15:08   ` [elpa] master a94ca83 01/18: swiper.el: Add a work-around for window-start not being current Stefan Monnier
2015-04-20 15:19     ` Oleh Krehel
2015-04-20 19:46       ` Stefan Monnier

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).