Function: nnimap-request-set-mark
nnimap-request-set-mark is a byte-compiled function defined in
nnimap.el.gz.
Signature
(nnimap-request-set-mark GROUP ACTIONS &optional SERVER)
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/nnimap.el.gz
(deffoo nnimap-request-set-mark (group actions &optional server)
(when (nnimap-change-group group server)
(let (sequence)
(with-current-buffer (nnimap-buffer)
(erase-buffer)
;; Just send all the STORE commands without waiting for
;; response. If they're successful, they're successful.
(dolist (action actions)
(cl-destructuring-bind (range action marks) action
;; If we add a tick mark, then also mark the message as
;; read. Other IMAP clients can have marked messages
;; without having them read, but Gnus can't.
(when (and (memq 'tick marks)
(eq action 'add))
(push 'read marks))
(let ((flags (nnimap-marks-to-flags marks)))
(when flags
(setq sequence (nnimap-send-command
"UID STORE %s %sFLAGS.SILENT (%s)"
(nnimap-article-ranges range)
(cond
((eq action 'del) "-")
((eq action 'add) "+")
((eq action 'set) ""))
(mapconcat #'identity flags " ")))))))
;; Wait for the last command to complete to avoid later
;; synchronization problems with the stream.
(when sequence
(nnimap-wait-for-response sequence))))))