* mu4e-hdrs.el: put checking for reply-all or reply-sender-only in

mu4e--user-wants-reply-all, use the new mu4e-read-option function
This commit is contained in:
djcb
2012-04-11 18:30:12 +03:00
parent 1fe8e694f2
commit b633d0c74a

View File

@ -215,15 +215,28 @@ never hits the disk. Also see `mu4e-insert-mail-header-separator."
(when (search-forward-regexp (concat "^" mail-header-separator)) (when (search-forward-regexp (concat "^" mail-header-separator))
(replace-match "")))) (replace-match ""))))
(defun mu4e--user-wants-reply-all (origmsg)
"Ask user whether she wants to reply to *all* recipients if there
are more than 1 (based on ORIGMSG)."
(let* ((recipnum
(+ (length (mu4e--create-to-lst origmsg))
(length (mu4e--create-cc-lst origmsg t))))
(response
(if (= recipnum 1)
?a ;; with one recipient, we can reply to 'all'....
(mu4e-read-option
"Reply to "
`( (,(format "all %d recipients" recipnum))
("sender only"))))))
(= response ?a)))
(defun mu4e-send-create-reply (origmsg) (defun mu4e-send-create-reply (origmsg)
"Create a draft message as a reply to original message ORIGMSG." "Create a draft message as a reply to original message ORIGMSG."
(let* ((recipnum (let* ((recipnum
(+ (length (mu4e--create-to-lst origmsg)) (+ (length (mu4e--create-to-lst origmsg))
(length (mu4e--create-cc-lst origmsg t)))) (length (mu4e--create-cc-lst origmsg t))))
(reply-all (when (> recipnum 1) (reply-all (mu4e--user-wants-reply-all origmsg))
(yes-or-no-p
(format "Reply to all ~%d recipients? "
(+ recipnum)))))
(old-msgid (plist-get origmsg :message-id)) (old-msgid (plist-get origmsg :message-id))
(subject (or (plist-get origmsg :subject) ""))) (subject (or (plist-get origmsg :subject) "")))
(concat (concat