From 36545fa4c9f4ea9c2d23e1d3dedc127a99a07320 Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 12 Jan 2012 23:40:17 +0200 Subject: [PATCH] [PATCH v4 3/5] emacs: add support for replying just to the sender --- 7b/d1bfa2598f93dadf1dd89c2b4aebf7c1130753 | 166 ++++++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 7b/d1bfa2598f93dadf1dd89c2b4aebf7c1130753 diff --git a/7b/d1bfa2598f93dadf1dd89c2b4aebf7c1130753 b/7b/d1bfa2598f93dadf1dd89c2b4aebf7c1130753 new file mode 100644 index 000000000..2d70c3b9e --- /dev/null +++ b/7b/d1bfa2598f93dadf1dd89c2b4aebf7c1130753 @@ -0,0 +1,166 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1A868429E35 + for ; Thu, 12 Jan 2012 13:40: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 wc41HTmu2nNq for ; + Thu, 12 Jan 2012 13:40:39 -0800 (PST) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 3B49F429E28 + for ; Thu, 12 Jan 2012 13:40:37 -0800 (PST) +Received: by werm12 with SMTP id m12so2055945wer.26 + for ; Thu, 12 Jan 2012 13:40:36 -0800 (PST) +Received: by 10.216.136.232 with SMTP id w82mr2365341wei.46.1326404435924; + Thu, 12 Jan 2012 13:40:35 -0800 (PST) +Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. + [80.220.92.23]) + by mx.google.com with ESMTPS id k33sm7892220wbo.5.2012.01.12.13.40.33 + (version=SSLv3 cipher=OTHER); Thu, 12 Jan 2012 13:40:34 -0800 (PST) +From: Jani Nikula +To: notmuch@notmuchmail.org +Subject: [PATCH v4 3/5] emacs: add support for replying just to the sender +Date: Thu, 12 Jan 2012 23:40:17 +0200 +Message-Id: + <606b1287930b576abcb878dfc6dc3e980a497ede.1326403905.git.jani@nikula.org> +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, 12 Jan 2012 21:40:41 -0000 + +Provide reply to sender counterparts to the search and show reply +functions. 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 | 9 ++++++--- + emacs/notmuch-show.el | 10 ++++++++-- + emacs/notmuch.el | 9 ++++++++- + 3 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el +index 32e2e30..d8ab822 100644 +--- a/emacs/notmuch-mua.el ++++ b/emacs/notmuch-mua.el +@@ -71,12 +71,15 @@ 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 sender reply-all) + (let (headers + body + (args '("reply"))) + (if notmuch-show-process-crypto + (setq args (append args '("--decrypt")))) ++ (if reply-all ++ (setq args (append args '("--reply-to=all"))) ++ (setq args (append args '("--reply-to=sender")))) + (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 +@@ -218,13 +221,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 prompt-for-sender reply-all) + "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 sender reply-all))) + + (defun notmuch-mua-send-and-exit (&optional arg) + (interactive "P") +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 5502efd..96eea19 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -933,6 +933,7 @@ thread id. If a prefix is given, crypto processing is toggled." + (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-sender) + (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 and all recipients 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) prompt-for-sender t)) ++ ++(defun notmuch-show-reply-sender (&optional prompt-for-sender) ++ "Reply to the sender of the current message." ++ (interactive "P") ++ (notmuch-mua-new-reply (notmuch-show-get-message-id) prompt-for-sender nil)) + + (defun notmuch-show-forward-message (&optional prompt-for-sender) + "Forward the current message." +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 1e61775..9ac2888 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -214,6 +214,7 @@ For a mouse binding, return nil." + (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-to-thread-sender) + (define-key map "m" 'notmuch-mua-new-mail) + (define-key map "s" 'notmuch-search) + (define-key map "o" 'notmuch-search-toggle-order) +@@ -448,10 +449,16 @@ Complete list of currently available key bindings: + (message "End of search results.")))) + + (defun notmuch-search-reply-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 prompt-for-sender t))) ++ ++(defun notmuch-search-reply-to-thread-sender (&optional prompt-for-sender) + "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 prompt-for-sender nil))) + + (defun notmuch-call-notmuch-process (&rest args) + "Synchronously invoke \"notmuch\" with the given list of arguments. +-- +1.7.5.4 + -- 2.26.2