unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jani Nikula <jani@nikula.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v3 2/4] emacs: add support for replying just to the sender
Date: Tue, 10 Jan 2012 21:54:02 +0200	[thread overview]
Message-ID: <069a0cddd4e848314fb64da861b3bf5b4f053f14.1326224339.git.jani@nikula.org> (raw)
In-Reply-To: <cover.1326224339.git.jani@nikula.org>
In-Reply-To: <cover.1326224339.git.jani@nikula.org>

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 <jani@nikula.org>
---
 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

  parent reply	other threads:[~2012-01-10 19:54 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 20:25 [PATCH 0/4] notmuch reply bugfix & reply to sender only Jani Nikula
2012-01-05 20:25 ` [PATCH 1/4] cli: fix use of uninitialized variable in "notmuch reply" Jani Nikula
2012-01-06  3:22   ` David Bremner
2012-01-06  8:11     ` Jani Nikula
2012-01-06 11:57       ` David Bremner
2012-01-07  3:52   ` David Bremner
2012-01-07  7:31     ` Jani Nikula
2012-01-07 11:57       ` Mark Walters
2012-01-07 12:14       ` David Bremner
2012-01-05 20:25 ` [PATCH 2/4] cli: convert "notmuch reply" to use the new argument parser Jani Nikula
2012-01-05 20:25 ` [PATCH 3/4] cli: add support for replying just to the sender in "notmuch reply" Jani Nikula
2012-01-05 20:25 ` [PATCH 4/4] emacs: add support for replying just to the sender of messages and threads Jani Nikula
2012-01-05 20:33 ` [PATCH 0/4] notmuch reply bugfix & reply to sender only Jameson Graef Rollins
2012-01-07 19:25   ` Mueen Nawaz
2012-01-05 22:01 ` Mark Walters
2012-01-06 12:34   ` Jani Nikula
2012-01-06 13:32     ` Mark Walters
2012-01-06 13:34       ` [PATCH 1/4] Add the option "--reply-to" to notmuch reply Mark Walters
2012-01-08 12:47         ` Jani Nikula
2012-01-08 15:08           ` Mark Walters
2012-01-08 16:11             ` Jani Nikula
2012-01-06 13:34       ` [PATCH 2/4] Update the man page for notmuch-reply to give the syntax for the --reply-to option Mark Walters
2012-01-06 13:34       ` [PATCH 3/4] Emacs changes for reply-to-sender Mark Walters
2012-01-06 13:34       ` [PATCH 4/4] add tests " Mark Walters
2012-01-06 14:20     ` [PATCH 0/4] notmuch reply bugfix & reply to sender only Mark Walters
2012-01-06  0:01 ` Adam Wolfe Gordon
2012-01-06 22:11   ` Tomi Ollila
2012-01-06  8:54 ` David Edmondson
2012-01-08 21:48 ` [PATCH v2 0/6] reply to sender Jani Nikula
2012-01-09  8:22   ` David Edmondson
2012-01-09 18:55   ` Dmitry Kurochkin
2012-01-08 21:48 ` [PATCH v2 1/6] cli: fix use of uninitialized variable in "notmuch reply" Jani Nikula
2012-01-08 21:48 ` [PATCH v2 2/6] cli: convert "notmuch reply" to use the new argument parser Jani Nikula
2012-01-08 21:48 ` [PATCH v2 3/6] cli: add support for replying just to the sender in "notmuch reply" Jani Nikula
2012-01-08 23:23   ` Mark Walters
2012-01-09  9:41     ` Jani Nikula
2012-01-09 11:13       ` Mark Walters
2012-01-08 21:48 ` [PATCH v2 4/6] emacs: add support for replying just to the sender Jani Nikula
2012-01-08 21:48 ` [PATCH v2 5/6] emacs: bind 'r' to reply-to-sender and 'R' to reply-to-all Jani Nikula
2012-01-08 22:01   ` Jeremy Nickurak
2012-01-08 23:32     ` Jameson Graef Rollins
2012-01-08 23:56       ` Jeremy Nickurak
2012-01-09 14:10     ` is there a default reply function? (was: Re: [PATCH v2 5/6] emacs: bind 'r' to reply-to-sender and 'R' to reply-to-all) Gregor Zattler
2012-01-08 21:48 ` [PATCH v2 6/6] test: add tests for "notmuch reply" --reply-to=sender Jani Nikula
2012-01-10 19:54 ` [PATCH v3 0/4] reply to sender Jani Nikula
2012-01-10 19:54 ` [PATCH v3 1/4] cli: add support for replying just to the sender in "notmuch reply" Jani Nikula
2012-01-12  3:31   ` Austin Clements
2012-01-10 19:54 ` Jani Nikula [this message]
2012-01-11  8:20   ` [PATCH v3 2/4] emacs: add support for replying just to the sender David Edmondson
2012-01-11  8:45     ` Jani Nikula
2012-01-11  9:08       ` David Edmondson
2012-01-11 21:15     ` Aaron Ecay
2012-01-11 22:08       ` Jani Nikula
2012-01-10 19:54 ` [PATCH v3 3/4] emacs: bind 'r' to reply-to-sender and 'R' to reply-to-all Jani Nikula
2012-01-11  8:21   ` David Edmondson
2012-01-10 19:54 ` [PATCH v3 4/4] test: add tests for "notmuch reply" --reply-to=sender Jani Nikula
2012-01-12  3:50   ` Austin Clements
2012-01-12 12:59     ` Tomi Ollila
2012-01-12 21:40 ` [PATCH v4 0/5] reply to sender Jani Nikula
2012-01-12 21:40 ` [PATCH v4 1/5] cli: slightly refactor "notmuch reply" address scanning functions Jani Nikula
2012-01-12 21:59   ` Austin Clements
2012-01-14 14:22     ` Jani Nikula
2012-01-12 23:28   ` Mark Walters
2012-01-12 21:40 ` [PATCH v4 2/5] cli: add support for replying just to the sender in "notmuch reply" Jani Nikula
2012-01-12 22:02   ` Austin Clements
2012-01-12 23:46   ` Mark Walters
2012-01-12 21:40 ` [PATCH v4 3/5] emacs: add support for replying just to the sender Jani Nikula
2012-01-12 21:40 ` [PATCH v4 4/5] emacs: bind 'r' to reply-to-sender and 'R' to reply-to-all Jani Nikula
2012-01-12 21:40 ` [PATCH v4 5/5] test: add tests for "notmuch reply" --reply-to=sender Jani Nikula
2012-01-14 14:46 ` [PATCH v5 0/5] reply to sender Jani Nikula
2012-01-14 14:46 ` [PATCH v5 1/5] cli: slightly refactor "notmuch reply" address scanning functions Jani Nikula
2012-01-14 15:31   ` David Bremner
2012-01-14 16:48     ` Jani Nikula
2012-01-16 18:06     ` Dmitry Kurochkin
2012-01-16 18:40       ` David Edmondson
2012-01-16 19:26       ` David Bremner
2012-01-16 19:32       ` Jameson Graef Rollins
2012-01-14 14:46 ` [PATCH v5 2/5] cli: add support for replying just to the sender in "notmuch reply" Jani Nikula
2012-01-14 14:46 ` [PATCH v5 3/5] emacs: add support for replying just to the sender Jani Nikula
2012-01-14 14:46 ` [PATCH v5 4/5] emacs: bind 'r' to reply-to-sender and 'R' to reply-to-all Jani Nikula
2012-01-14 14:46 ` [PATCH v5 5/5] test: add tests for "notmuch reply" --reply-to=sender Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=069a0cddd4e848314fb64da861b3bf5b4f053f14.1326224339.git.jani@nikula.org \
    --to=jani@nikula.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).