aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/gnus/gnus-search.el16
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index fc9f8684f63..70bde264c11 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -1278,17 +1278,23 @@ elements are present."
1278 str))) 1278 str)))
1279 1279
1280(defun gnus-search-imap-handle-flag (flag) 1280(defun gnus-search-imap-handle-flag (flag)
1281 "Make sure string FLAG is something IMAP will recognize." 1281 "Adjust string FLAG to help IMAP recognize it.
1282 ;; What else? What about the KEYWORD search key? 1282If it's one of the RFC3501 flags, make sure it's upcased.
1283Otherwise, if FLAG starts with a \"$\", treat as a KEYWORD
1284search. Otherwise, drop the flag."
1283 (setq flag 1285 (setq flag
1284 (pcase flag 1286 (pcase flag
1285 ("flag" "flagged") 1287 ("flag" "flagged")
1286 ("read" "seen") 1288 ("read" "seen")
1287 ("replied" "answered") 1289 ("replied" "answered")
1288 (_ flag))) 1290 (_ flag)))
1289 (if (member flag '("seen" "answered" "deleted" "draft" "flagged")) 1291 (cond
1290 (upcase flag) 1292 ((member flag '("seen" "answered" "deleted" "draft" "flagged" "recent"))
1291 "")) 1293 (upcase flag))
1294 ((string-prefix-p "$" flag)
1295 (format "KEYWORD %s" flag))
1296 ;; TODO: Provide a user option to treat *all* marks as a KEYWORDs?
1297 (t "")))
1292 1298
1293;;; Methods for the indexed search engines. 1299;;; Methods for the indexed search engines.
1294 1300