Function: nnmaildir--add-flag

nnmaildir--add-flag is a byte-compiled function defined in nnmaildir.el.gz.

Signature

(nnmaildir--add-flag FLAG SUFFIX)

Documentation

Return a copy of SUFFIX where FLAG is set.

SUFFIX should start with ":2,".

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmaildir.el.gz
(defun nnmaildir--add-flag (flag suffix)
  "Return a copy of SUFFIX where FLAG is set.
SUFFIX should start with \":2,\"."
  (unless (string-match-p "^:2," suffix)
    (error "Invalid suffix `%s'" suffix))
  (let* ((flags (substring suffix 3))
	 (flags-as-list (append flags nil))
	 (new-flags
	  (concat (gnus-delete-duplicates
		   ;; maildir flags must be sorted
		   (sort (cons flag flags-as-list) #'<)))))
    (concat ":2," new-flags)))