summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-09-23 05:58:34 +0100
committerjao <jao@gnu.org>2024-09-23 05:58:34 +0100
commitca9a96b54f06e44f082b7c01f3493154a20a802a (patch)
tree27242125f2b1204f2f0570a19fbcbbd3c452dd0b
parent40240bd59b4034ff74d74b1a7c6c99ddfe496684 (diff)
downloadelibs-ca9a96b54f06e44f082b7c01f3493154a20a802a.tar.gz
elibs-ca9a96b54f06e44f082b7c01f3493154a20a802a.tar.bz2
gnus: recoll search engine: thread queries implemented
-rw-r--r--custom/jao-custom-gnus.el16
1 files changed, 13 insertions, 3 deletions
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)))