Start filling out query options
Now everything is supported except for: - thread - limit - grep
This commit is contained in:
parent
18f8b41045
commit
b34a68c674
1 changed files with 22 additions and 20 deletions
|
@ -43,7 +43,6 @@
|
||||||
;; - `gnus-search-mu-switches'
|
;; - `gnus-search-mu-switches'
|
||||||
;; - `gnus-search-mu-remove-prefix'
|
;; - `gnus-search-mu-remove-prefix'
|
||||||
;; - `gnus-search-mu-config-directory'
|
;; - `gnus-search-mu-config-directory'
|
||||||
;; - `gnus-search-mu-config-directory'
|
|
||||||
;; - `gnus-search-mu-raw-queries-p'
|
;; - `gnus-search-mu-raw-queries-p'
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,9 +124,15 @@ This can also be set per-server."
|
||||||
(cl-defmethod gnus-search-transform-expression ((engine gnus-search-mu)
|
(cl-defmethod gnus-search-transform-expression ((engine gnus-search-mu)
|
||||||
(expr list))
|
(expr list))
|
||||||
(cl-case (car expr)
|
(cl-case (car expr)
|
||||||
(sender (setf (car expr) 'from))
|
(recipient (setf (car expr) 'recip))
|
||||||
(recipient (setf (car expr) 'to))
|
(address (setf (car expr) 'contact))
|
||||||
(mark (setf (car expr) 'tag)))
|
(id (setf (car expr) 'msgid)) ; message-id is translated
|
||||||
|
;; mark
|
||||||
|
(attachment (setf (car expr) 'file))
|
||||||
|
;; TODO: implement or remove these
|
||||||
|
(thread (error "thread: not supported by mu"))
|
||||||
|
(limit (error "limit: not yet implemented"))
|
||||||
|
(grep (error "grep: not yet implemented")))
|
||||||
(cl-flet ((mu-date (date)
|
(cl-flet ((mu-date (date)
|
||||||
(if (stringp date)
|
(if (stringp date)
|
||||||
date
|
date
|
||||||
|
@ -145,22 +150,19 @@ This can also be set per-server."
|
||||||
(cond
|
(cond
|
||||||
((consp (car expr))
|
((consp (car expr))
|
||||||
(format "(%s)" (gnus-search-transform engine expr)))
|
(format "(%s)" (gnus-search-transform engine expr)))
|
||||||
;; ((eql (car expr) 'address)
|
((memq (car expr) '(cc c bcc h from f to t subject s body b
|
||||||
;; (gnus-search-transform engine `((or (from . ,(cdr expr))
|
maildir m msgid i prio p flag g date d
|
||||||
;; (to . ,(cdr expr))))))
|
size z embed e file j mime y tag x
|
||||||
;; ((eql (car expr 'body))
|
list v))
|
||||||
;; (cdr expr))
|
;; TODO: check if msgid needs translation
|
||||||
;; ((memq (car expr) '(from to subject attachment mimetype tag
|
;; (when (eql (car expr) 'id)
|
||||||
;; id thread folder path lastmod query
|
;; (setf (cdr expr) (replace-regexp-in-string "\\`<\\|>\\'"
|
||||||
;; property))
|
;; ""
|
||||||
;; (when (eql (car expr) 'id)
|
;; (cdr expr))))
|
||||||
;; (setf (cdr expr) (replace-regexp-in-string "\\`<\\|>\\'"
|
(format "%s:%s" (car expr)
|
||||||
;; ""
|
(if (string-match "\\`\\*" (cdr expr))
|
||||||
;; (cdr expr))))
|
(replace-match "" nil nil (cdr expr))
|
||||||
;; (format "%s:%s" (car expr)
|
(cdr expr))))
|
||||||
;; (if (string-match "\\`\\*" (cdr expr))
|
|
||||||
;; (replace-match "" nil nil (cdr expr))
|
|
||||||
;; (cdr expr))))
|
|
||||||
((eq (car expr) 'date)
|
((eq (car expr) 'date)
|
||||||
(format "date:%s" (mu-date (cdr expr))))
|
(format "date:%s" (mu-date (cdr expr))))
|
||||||
((eq (car expr) 'before)
|
((eq (car expr) 'before)
|
||||||
|
|
Loading…
Reference in a new issue