emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master fcf8ad6: Fix possible prepending of "TEXT" to IMAP searches


From: Eric Abrahamsen
Subject: master fcf8ad6: Fix possible prepending of "TEXT" to IMAP searches
Date: Mon, 11 Jan 2021 12:49:17 -0500 (EST)

branch: master
commit fcf8ad610d43ba9b96d9ad1cc67185144c819006
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    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.
---
 lisp/gnus/gnus-search.el | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 44f43b0..5c6a5b9 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]