(cdr (assq 'search-query-spec specs))
(cdr (assq 'nnir-query-spec specs))
(gnus-search-make-spec no-parse))))
+ ;; If our query came via an old call to nnir, we know not to
+ ;; parse the query.
+ (when (assq 'nnir-query-spec specs)
+ (setf (alist-get 'raw query-spec) t))
(gnus-group-make-group
name
(list 'nnselect "nnselect")
(or (cdr (assq 'search-query-spec specs))
(cdr (assq 'nnir-query-spec specs))
(gnus-search-make-spec no-parse))))
+ ;; If our query came via an old call to nnir, we know not to parse
+ ;; the query.
+ (when (assq 'nnir-query-spec specs)
+ (setf (alist-get 'raw query-spec) t))
(gnus-group-read-ephemeral-group
(concat "nnselect-" (message-unique-id))
(list 'nnselect "nnselect")
(cl-defmethod gnus-search-make-query-string ((engine gnus-search-engine)
query-spec)
- (if (and gnus-search-use-parsed-queries
- (null (alist-get 'raw query-spec))
- (null (slot-value engine 'raw-queries-p)))
- (gnus-search-transform
- engine (alist-get 'parsed-query query-spec))
- (alist-get 'query query-spec)))
+ (let ((parsed-query (alist-get 'parsed-query query-spec))
+ (raw-query (alist-get 'query query-spec)))
+ (if (and gnus-search-use-parsed-queries
+ (null (alist-get 'raw query-spec))
+ (null (slot-value engine 'raw-queries-p))
+ parsed-query)
+ (gnus-search-transform engine parsed-query)
+ (if (listp raw-query)
+ ;; Some callers are sending this in as (query "query"), not
+ ;; as a cons cell?
+ (car raw-query)
+ raw-query))))
(defsubst gnus-search-single-p (query)
"Return t if QUERY is a search for a single message."
;; TODO: Don't exclude booleans and date keys, just check for them
;; before checking for general keywords.
(defvar gnus-search-imap-search-keys
- '(body cc bcc from header keyword larger smaller subject text to uid)
+ '(body cc bcc from header keyword larger smaller subject text to uid x-gm-raw)
"Known IMAP search keys, excluding booleans and date keys.")
(cl-defmethod gnus-search-transform ((_ gnus-search-imap)
(setq query
(string-trim (replace-match "" t t query 0)))
(setf (alist-get 'query query-spec) query)))
- (when gnus-search-use-parsed-queries
+ (when (and gnus-search-use-parsed-queries
+ (null (alist-get 'raw query-spec)))
(setf (alist-get 'parsed-query query-spec)
(gnus-search-parse-query query)))
query-spec))