Originally intended to be use a hook function, but now called directly
by notmuch-mua-mail."
-
(let ((subdir
(cond
((or (not notmuch-fcc-dirs)
(message-field-value "Fcc"))
;; Nothing set or an existing header.
nil)
-
((stringp notmuch-fcc-dirs)
notmuch-fcc-dirs)
-
((and (listp notmuch-fcc-dirs)
(stringp (car notmuch-fcc-dirs)))
;; Old style - no longer works.
(error "Invalid `notmuch-fcc-dirs' setting (old style)"))
-
((listp notmuch-fcc-dirs)
(let* ((from (message-field-value "From"))
(match
(cdr match)
(message "No Fcc header added.")
nil)))
-
(t
(error "Invalid `notmuch-fcc-dirs' setting (neither string nor list)")))))
-
(when subdir
(if notmuch-maildir-use-notmuch-insert
(notmuch-maildir-add-notmuch-insert-style-fcc-header subdir)
(defun notmuch-maildir-add-notmuch-insert-style-fcc-header (subdir)
;; Notmuch insert does not accept absolute paths, so check the user
;; really want this header inserted.
-
(when (or (not (= (elt subdir 0) ?/))
- (y-or-n-p (format "Fcc header %s is an absolute path and notmuch insert is requested.\nInsert header anyway? "
- subdir)))
+ (y-or-n-p
+ (format "Fcc header %s is an absolute path and notmuch insert is requested.
+Insert header anyway? " subdir)))
(message-add-header (concat "Fcc: " subdir))))
(defun notmuch-maildir-add-file-style-fcc-header (subdir)
;; typo, or just the user want a new folder, let the user decide
;; how to deal with it.
(error
- (let ((response (notmuch-read-char-choice
- "Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
- '(?r ?c ?i ?e))))
+ (let ((response (notmuch-read-char-choice "Insert failed: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " '(?r ?c ?i ?e))))
(cl-case response
(?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header))
(?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't))
(notmuch-maildir-fcc-write-buffer-to-maildir fcc-header 't)
;; The fcc-header is not a valid maildir see if the user wants to
;; fix it in some way.
- (let* ((prompt (format "Fcc %s is not a maildir: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? "
- fcc-header))
+ (let* ((prompt (format "Fcc %s is not a maildir: \
+\(r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " fcc-header))
(response (notmuch-read-char-choice prompt '(?r ?c ?i ?e))))
(cl-case response
(?r (notmuch-maildir-fcc-file-fcc fcc-header))