oantolin / orderless

Emacs completion style that matches multiple regexps in any order
GNU General Public License v3.0
771 stars 27 forks source link

[Q] How do I use `orderless-style-dispatchers` with `ivy`? #164

Closed NightMachinery closed 8 months ago

NightMachinery commented 8 months ago

Is it possible?

I tried

(setq ivy-re-builders-alist '((t . orderless-ivy-re-builder)))

but it doesn't seem to use orderless-style-dispatchers?

oantolin commented 8 months ago

That function calls orderless's compiler which does use orderless-style-dispatchers. Can you provide a recipe to reproduce the problem?

NightMachinery commented 8 months ago

I did some tests:

(orderless-ivy-re-builder "!12")
(defun tmp1 (&rest dummy)
  (list (cons
         ;; "\\(?:\\(?:[^1]\\|1?:[^2]\\)\\)+"
         "\\(?:\\(?:[^1]\\|1\\(?:[^2]\\)\\)+\\)"
         ;; "\\(?:\\(\\`\\)\\(?:[^1]\\|\\'\\|1\\(?:[^2]\\|\\'\\)\\)*\\)"
         t))
  )
(setq ivy-re-builders-alist '((t . tmp1)))

These tests show that the regexes don't work with swiper-isearch, and the problem isn't exactly with orderless. They do work with swiper itself ... Do you have any ideas why?

oantolin commented 8 months ago

Sorry, no clue. Back when I was an Ivy user I only ever used swiper. I don't think swiper-isearch existed yet in those days.