[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 4d63a03: Small improvements to handling of IMAP mark search
From: |
Eric Abrahamsen |
Subject: |
master 4d63a03: Small improvements to handling of IMAP mark search |
Date: |
Fri, 25 Jun 2021 23:43:51 -0400 (EDT) |
branch: master
commit 4d63a033a726a8da33bda8d18a503e88bfb794fb
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>
Small improvements to handling of IMAP mark search
* lisp/gnus/gnus-search.el (gnus-search-imap-handle-flag): Use a
KEYWORD search for any mark starting with a "$", so
"mark:$hasattachment" goes through as "KEYWORD $hasattachment".
---
lisp/gnus/gnus-search.el | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index fc9f868..70bde26 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -1278,17 +1278,23 @@ elements are present."
str)))
(defun gnus-search-imap-handle-flag (flag)
- "Make sure string FLAG is something IMAP will recognize."
- ;; What else? What about the KEYWORD search key?
+ "Adjust string FLAG to help IMAP recognize it.
+If it's one of the RFC3501 flags, make sure it's upcased.
+Otherwise, if FLAG starts with a \"$\", treat as a KEYWORD
+search. Otherwise, drop the flag."
(setq flag
(pcase flag
("flag" "flagged")
("read" "seen")
("replied" "answered")
(_ flag)))
- (if (member flag '("seen" "answered" "deleted" "draft" "flagged"))
- (upcase flag)
- ""))
+ (cond
+ ((member flag '("seen" "answered" "deleted" "draft" "flagged" "recent"))
+ (upcase flag))
+ ((string-prefix-p "$" flag)
+ (format "KEYWORD %s" flag))
+ ;; TODO: Provide a user option to treat *all* marks as a KEYWORDs?
+ (t "")))
;;; Methods for the indexed search engines.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 4d63a03: Small improvements to handling of IMAP mark search,
Eric Abrahamsen <=