summaryrefslogtreecommitdiffhomepage
path: root/custom
diff options
context:
space:
mode:
Diffstat (limited to 'custom')
-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)))