From b633d0c74a7dc08daae131c2834fabea10a25c77 Mon Sep 17 00:00:00 2001 From: djcb Date: Wed, 11 Apr 2012 18:30:12 +0300 Subject: [PATCH] * 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 --- emacs/mu4e-send.el | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/emacs/mu4e-send.el b/emacs/mu4e-send.el index 7512acdb..55a62f2c 100644 --- a/emacs/mu4e-send.el +++ b/emacs/mu4e-send.el @@ -215,15 +215,28 @@ never hits the disk. Also see `mu4e-insert-mail-header-separator." (when (search-forward-regexp (concat "^" mail-header-separator)) (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) "Create a draft message as a reply to original message ORIGMSG." (let* ((recipnum (+ (length (mu4e--create-to-lst origmsg)) (length (mu4e--create-cc-lst origmsg t)))) - (reply-all (when (> recipnum 1) - (yes-or-no-p - (format "Reply to all ~%d recipients? " - (+ recipnum))))) + (reply-all (mu4e--user-wants-reply-all origmsg)) (old-msgid (plist-get origmsg :message-id)) (subject (or (plist-get origmsg :subject) ""))) (concat