From: Eric Abrahamsen Date: Mon, 11 Jan 2021 17:46:58 +0000 (-0800) Subject: Fix possible prepending of "TEXT" to IMAP searches X-Git-Tag: emacs-28.0.90~4295 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fcf8ad610d43ba9b96d9ad1cc67185144c819006;p=emacs.git Fix possible prepending of "TEXT" to IMAP searches * lisp/gnus/gnus-search.el (gnus-search-imap-search-keys): Add missing keys "old", "new", "or" and "not". (gnus-search-run-search): In addition, don't touch the query if it starts with a parenthesis. Consider just getting rid of this convenience altogether. --- diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el index 44f43b073c8..5c6a5b9efd0 100644 --- a/lisp/gnus/gnus-search.el +++ b/lisp/gnus/gnus-search.el @@ -1036,7 +1036,7 @@ Responsible for handling and, or, and parenthetical expressions.") '(body cc bcc from header keyword larger smaller subject text to uid x-gm-raw answered before deleted draft flagged on since recent seen sentbefore senton sentsince unanswered undeleted undraft unflagged unkeyword - unseen all) + unseen all old new or not) "Known IMAP search keys.") ;; imap interface @@ -1072,10 +1072,11 @@ Responsible for handling and, or, and parenthetical expressions.") ;; A bit of backward-compatibility slash convenience: if the ;; query string doesn't start with any known IMAP search ;; keyword, assume it is a "TEXT" search. - (unless (and (string-match "\\`[^[:blank:]]+" q-string) - (memql (intern-soft (downcase - (match-string 0 q-string))) - gnus-search-imap-search-keys)) + (unless (or (looking-at "(") + (and (string-match "\\`[^[:blank:]]+" q-string) + (memql (intern-soft (downcase + (match-string 0 q-string))) + gnus-search-imap-search-keys))) (setq q-string (concat "TEXT " q-string))) ;; If it's a thread query, make sure that all message-id