Which places in ivy would be best for implementing a preconfigured recursive-search that uses multiple ivy-builders-alists?
I have difficulties following ivy-builders-alist to figure out it's usage in order to
implement the following example demonstrates the desired behavior:
(require 's)
(require 'dash)
(defun the-narrow-rule (s)
;; this would be ivy-re-builders-alist-1
(s-matches? "^fuzz " s))
(defun the-wide-rule (s)
;; this would be ivy-re-builders-alist-2
(s-matches? "fuzz" s))
(defun combining-two-search-result-sets ()
"Takes two matching-rules of different relevance and a set of
candidates and returns matches according to their relevance
without duplicates."
(let* ((candidates
(s-split "\n"
"not matching 0
matching but less relevant fuzz 1
matching fuzz but less relevant 2
fuzz matching and more relevant 3
matching but less relevant fuzz 4
not matching 5
matching fuzz but less relevant 6
not matching 7"))
(matches0
(-filter
(lambda (cand)
(the-wide-rule cand))
candidates))
(matches1
(-remove
(lambda (cand)
(the-narrow-rule cand))
matches0))
(matches2
(-filter
(lambda (cand)
(the-narrow-rule cand))
matches0)))
(-concat matches2 matches1)))
(combining-two-search-result-sets)
;; ("fuzz matching and more relevant 3"
;; "matching but less relevant fuzz 1"
;; "matching fuzz but less relevant 2"
;; "matching but less relevant fuzz 4"
;; "matching fuzz but less relevant 6")
Which places in ivy would be best for implementing a preconfigured recursive-search that uses multiple ivy-builders-alists?
I have difficulties following ivy-builders-alist to figure out it's usage in order to implement the following example demonstrates the desired behavior: