From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 68A34421183 for ; Thu, 5 Jan 2012 12:25:41 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oI5+DEaeO+gE for ; Thu, 5 Jan 2012 12:25:40 -0800 (PST) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 23581421175 for ; Thu, 5 Jan 2012 12:25:34 -0800 (PST) Received: by mail-ee0-f53.google.com with SMTP id d41so756745eek.26 for ; Thu, 05 Jan 2012 12:25:33 -0800 (PST) Received: by 10.14.52.2 with SMTP id d2mr1281096eec.60.1325795133746; Thu, 05 Jan 2012 12:25:33 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id u53sm190165042eeu.6.2012.01.05.12.25.31 (version=SSLv3 cipher=OTHER); Thu, 05 Jan 2012 12:25:32 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org, david@tethera.net Subject: [PATCH 4/4] emacs: add support for replying just to the sender of messages and threads Date: Thu, 5 Jan 2012 22:25:15 +0200 Message-Id: X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 20:25:41 -0000 Make the search and show reply functions reply just to the sender, and provide reply-all counterparts to reply to all. Add key binding 'R' to reply to sender, while keeping 'r' as reply-to-all, both in search and show views. Signed-off-by: Jani Nikula --- emacs/notmuch-mua.el | 8 +++++--- emacs/notmuch-show.el | 12 +++++++++--- emacs/notmuch.el | 11 +++++++++-- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 7114e48..3cdf360 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -71,12 +71,14 @@ list." (push header message-hidden-headers))) notmuch-mua-hidden-headers)) -(defun notmuch-mua-reply (query-string &optional sender) +(defun notmuch-mua-reply (query-string &optional reply-all sender) (let (headers body (args '("reply"))) (if notmuch-show-process-crypto (setq args (append args '("--decrypt")))) + (unless reply-all + (setq args (append args '("--no-reply-all")))) (setq args (append args (list query-string))) ;; This make assumptions about the output of `notmuch reply', but ;; really only that the headers come first followed by a blank @@ -217,13 +219,13 @@ the From: address first." (notmuch-mua-forward-message)) (notmuch-mua-forward-message))) -(defun notmuch-mua-new-reply (query-string &optional prompt-for-sender) +(defun notmuch-mua-new-reply (query-string &optional reply-all prompt-for-sender) "Invoke the notmuch reply window." (interactive "P") (let ((sender (when prompt-for-sender (notmuch-mua-prompt-for-sender)))) - (notmuch-mua-reply query-string sender))) + (notmuch-mua-reply query-string reply-all sender))) (defun notmuch-mua-send-and-exit (&optional arg) (interactive "P") diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 5502efd..6f812d8 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -932,7 +932,8 @@ thread id. If a prefix is given, crypto processing is toggled." (define-key map "s" 'notmuch-search) (define-key map "m" 'notmuch-mua-new-mail) (define-key map "f" 'notmuch-show-forward-message) - (define-key map "r" 'notmuch-show-reply) + (define-key map "r" 'notmuch-show-reply-all) + (define-key map "R" 'notmuch-show-reply) (define-key map "|" 'notmuch-show-pipe-message) (define-key map "w" 'notmuch-show-save-attachments) (define-key map "V" 'notmuch-show-view-raw-message) @@ -1237,9 +1238,14 @@ any effects from previous calls to (notmuch-show-previous-message))))) (defun notmuch-show-reply (&optional prompt-for-sender) - "Reply to the current message." + "Reply to the sender of the current message." (interactive "P") - (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender)) + (notmuch-mua-new-reply (notmuch-show-get-message-id) nil prompt-for-sender)) + +(defun notmuch-show-reply-all (&optional prompt-for-sender) + "Reply to the sender and all recipients of the current message." + (interactive "P") + (notmuch-mua-new-reply (notmuch-show-get-message-id) t prompt-for-sender)) (defun notmuch-show-forward-message (&optional prompt-for-sender) "Forward the current message." diff --git a/emacs/notmuch.el b/emacs/notmuch.el index fde2377..bd1fd4f 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -206,7 +206,8 @@ For a mouse binding, return nil." (define-key map ">" 'notmuch-search-last-thread) (define-key map "p" 'notmuch-search-previous-thread) (define-key map "n" 'notmuch-search-next-thread) - (define-key map "r" 'notmuch-search-reply-to-thread) + (define-key map "r" 'notmuch-search-reply-all-to-thread) + (define-key map "R" 'notmuch-search-reply-to-thread) (define-key map "m" 'notmuch-mua-new-mail) (define-key map "s" 'notmuch-search) (define-key map "o" 'notmuch-search-toggle-order) @@ -444,7 +445,13 @@ Complete list of currently available key bindings: "Begin composing a reply to the entire current thread in a new buffer." (interactive "P") (let ((message-id (notmuch-search-find-thread-id))) - (notmuch-mua-new-reply message-id prompt-for-sender))) + (notmuch-mua-new-reply message-id nil prompt-for-sender))) + +(defun notmuch-search-reply-all-to-thread (&optional prompt-for-sender) + "Begin composing a reply-all to the entire current thread in a new buffer." + (interactive "P") + (let ((message-id (notmuch-search-find-thread-id))) + (notmuch-mua-new-reply message-id t prompt-for-sender))) (defun notmuch-call-notmuch-process (&rest args) "Synchronously invoke \"notmuch\" with the given list of arguments. -- 1.7.5.4