Function: gnus-search-imap-handle-flag
gnus-search-imap-handle-flag is a byte-compiled function defined in
gnus-search.el.gz.
Signature
(gnus-search-imap-handle-flag FLAG)
Documentation
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.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/gnus-search.el.gz
(defun gnus-search-imap-handle-flag (flag)
"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)))
(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 "")))