From ca9a96b54f06e44f082b7c01f3493154a20a802a Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 23 Sep 2024 05:58:34 +0100 Subject: gnus: recoll search engine: thread queries implemented --- custom/jao-custom-gnus.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'custom/jao-custom-gnus.el') diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index 0d75b43..603fe89 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -114,7 +114,7 @@ (cl-defmethod gnus-search-indexed-search-command ((engine gnus-search-recoll) (qstring string) - _query + query &optional groups) (let* ((subdir (slot-value engine 'remove-prefix)) (sep (slot-value engine 'separator)) @@ -128,8 +128,18 @@ (mapconcat (lambda (d) (format "dir:%s" d)) gdirs " OR ") ")"))) - (q (concat "mime:message " dirsq " (" qstring ")"))) - ;; (message "query is: %s" q) + (qstring (if (string-prefix-p "id:" qstring) + (replace-regexp-in-string "<\\|>" "\"" qstring) + qstring)) + (qstring (if (cdr (assoc 'thread query)) + (concat qstring " OR " + (replace-regexp-in-string "id:\"" "ref:\"" + qstring)) + qstring)) + (qstring (replace-regexp-in-string " or " " OR " qstring)) + (qstring (replace-regexp-in-string " and " " AND " qstring)) + (q (format "mime:message %s (%s)" dirsq qstring))) + ;; (message "query is: %s -- %S" q query) `("-b" "-t" "-q" ,q)))) ;; (add-to-list 'gnus-parameters '("^nnselect:.*" (nnselect-rescan . t))) -- cgit v1.2.3