--- /dev/null
+Return-Path: <prvs=400325a14=jrosenthal@jhu.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 816E6431FAF\r
+ for <notmuch@notmuchmail.org>; Thu, 1 Mar 2012 12:34:46 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id XcUcP275wtd3 for <notmuch@notmuchmail.org>;\r
+ Thu, 1 Mar 2012 12:34:46 -0800 (PST)\r
+Received: from ipex3.johnshopkins.edu (ipex3.johnshopkins.edu\r
+ [128.220.161.140]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id E716A431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 1 Mar 2012 12:34:45 -0800 (PST)\r
+X-IronPort-AV: E=Sophos;i="4.73,513,1325480400"; d="scan'208";a="197548012"\r
+Received: from unknown (HELO watt) ([10.161.33.18])\r
+ by ipex3.johnshopkins.edu with ESMTP/TLS/AES256-SHA;\r
+ 01 Mar 2012 15:34:45 -0500\r
+Received: from jkr by watt with local (Exim 4.76)\r
+ (envelope-from <jrosenthal@jhu.edu>)\r
+ id 1S3CiX-0003pO-Vd; Thu, 01 Mar 2012 15:35:14 -0500\r
+From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC] Smart replying\r
+Date: Thu, 01 Mar 2012 15:35:13 -0500\r
+Message-ID: <87hay8xdoe.fsf@jhu.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 01 Mar 2012 20:34:46 -0000\r
+\r
+Dear All,\r
+\r
+I know that folks recently got done haggling over reply bindings, but\r
+there's something I've been using for a little while, and I was curious\r
+about whether it's something people would be interested in. Forgive me\r
+if this functionality was already discussed and I missed it.\r
+\r
+The problem is that I often forget to reply-all to list mails and write\r
+out half a message, and then have to cut and paste. So, as usual, my\r
+solution is to try and have emacs figure it out for me.\r
+\r
+Pretty simple: have a variable `reply-all-list'. If an address in the\r
+`To' or `CC' fields is in that list, 'r' replies-all. If not, it\r
+replies-sender. CTRL-r (or whatever) forces `reply-sender', on the rare\r
+occasion I want to take a conversation offline.\r
+\r
+The nice thing about this is, if `reply-all-list' is nil, then it acts\r
+as normal, so it wouldn't make a difference to most users.\r
+\r
+The implementation that's been sitting in my .emacs is below. I'm not\r
+offering it as a patch, because I don't quite understand the current\r
+relation of notmuch-show.el and notmuch-mua.el. \r
+\r
+If people are interested, though, I could make it into a patch. And, if\r
+not, I hope it's a snippet that someone finds useful.\r
+\r
+Best,\r
+Jesse\r
+\r
+~~~~~~~~~~~~~~~~~~~~~~~~~\r
+(defvar reply-all-list nil)\r
+\r
+(defun jkr/notmuch-show-check-to-cc (address-list)\r
+ (let* ((to-cc-list (apply 'append \r
+ (mapcar 'mail-header-parse-addresses \r
+ (list (notmuch-show-get-to) \r
+ (notmuch-show-get-cc)))))\r
+ (to-cc-addr-list (mapcar 'car to-cc-list)))\r
+ (intersection address-list to-cc-addr-list :test 'equal)))\r
+\r
+(defun jkr/notmuch-show-smart-reply-all ()\r
+ "Reply to sender, unless address is on reply-all list"\r
+ (interactive)\r
+ (if (jkr/notmuch-show-check-to-cc reply-all-list)\r
+ (notmuch-show-reply)\r
+ (notmuch-show-reply-sender)))\r
+\r
+(defun jkr/notmuch-show-force-reply-sender ()\r
+ "Reply to sender only, regardless of reply-all list"\r
+ (interactive)\r
+ (notmuch-show-reply-sender))\r
+\r
+(define-key notmuch-show-mode-map "r" 'jkr/notmuch-show-smart-reply-all)\r
+\r
+(define-key notmuch-show-mode-map "\C-r" 'jkr/notmuch-show-force-reply-sender)\r
+\r
+; (setq reply-all-list '("notmuch@notmuchmail.org"))\r
+\r
+\r