(setq value (gnus-search-query-parse-date value)))
((string-match-p "contact" key)
(setq return (gnus-search-query-parse-contact key value)))
- ((equal key "address")
- (setq return `(or (sender . ,value) (recipient . ,value))))
((equal key "mark")
(setq value (gnus-search-query-parse-mark value))))
(or return
("contact-to"
(list (cons 'recipient a)))
("contact"
- `(or (recipient . ,a) (sender . ,a)))))
+ (list (cons 'address a)))))
addresses)))))
(defun gnus-search-query-expand-key (key)
(format
"to:%s or (cc:%s or bcc:%s)"
(cdr expr) (cdr expr) (cdr expr)))))
+ ((eq (car expr) 'address)
+ (gnus-search-transform
+ engine (gnus-search-parse-query
+ (format
+ "from:%s or (to:%s or (cc:%s or bcc:%s))"
+ (cdr expr) (cdr expr) (cdr expr) (cdr expr)))))
((memq (car expr) '(before since on sentbefore senton sentsince))
;; Ignore dates given as strings.
(when (listp (cdr expr))
;; for now.
((memq (car expr) '(subject from to))
(format "+%s:%s" (car expr) (cdr expr)))
+ ((eql (car expr) 'address)
+ (gnus-search-transform engine `((or (from . ,(cdr expr))
+ (to . ,(cdr expr))))))
((eq (car expr) 'id)
(format "+message-id:%s" (cdr expr)))
(t (ignore-errors (cl-call-next-method)))))
;; Swap keywords as necessary.
(cl-case (car expr)
(sender (setcar expr 'from))
+ ;; Notmuch's "to" is already equivalent to our "recipient".
(recipient (setcar expr 'to))
(mark (setcar expr 'tag)))
;; Then actually format the results.
(format "%d/%d/%d" m d y))))))
(cond
((consp (car expr))
- (format "(%s)") (gnus-search-transform engine expr))
+ (format "(%s)" (gnus-search-transform engine expr)))
+ ((eql (car expr) 'address)
+ (gnus-search-transform engine `((or (from . ,(cdr expr))
+ (to . ,(cdr expr))))))
((eql (car expr) 'body)
(cdr expr))
((memq (car expr) '(from to subject attachment mimetype tag id