--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 32E306DE091C\r
+ for <notmuch@notmuchmail.org>; Fri, 10 Jun 2016 16:03:26 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.336\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.336 tagged_above=-999 required=5 tests=[AWL=0.234,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id c3BpuX6F3tyZ for <notmuch@notmuchmail.org>;\r
+ Fri, 10 Jun 2016 16:03:18 -0700 (PDT)\r
+Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com\r
+ [74.125.82.65]) by arlo.cworth.org (Postfix) with ESMTPS id 0E8756DE02A6 for\r
+ <notmuch@notmuchmail.org>; Fri, 10 Jun 2016 16:03:09 -0700 (PDT)\r
+Received: by mail-wm0-f65.google.com with SMTP id n184so1714048wmn.1\r
+ for <notmuch@notmuchmail.org>; Fri, 10 Jun 2016 16:03:08 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+ bh=gIV8dyppNyBRHkA9oCDL0xDKLJiIaJGjgz13raDHHBc=;\r
+ b=jp/A76npHBe6wFSWzub/14XDa5fj5c+7ZJd8bJ8Qnoy0kz/Y2j1ZPwn4FQmHxgCKNH\r
+ 1cn/p7VcDQPGt6LQvrD724yK7ySX4HheJ9gywnJVFxW2jIXXHp9zXLIwN/3cHUy8HcRe\r
+ BCZhcSv6DnznJvnsLeRL9YjSyhsy4Mjpp1+FiCrVmc+i3VXxkY0zYpe9SKiQhTfMed6n\r
+ TfKLHhW+PTYL1Dgt/2bOWnDpx3d/IfuPadRb2M+y1vpJ7nra7bq4XiY/AEP9eUtIQElc\r
+ LuCcqs7VxYQ7E/v/B1oVz4+agT6DBZNI9FwKT7YP/dIEqKCwDGpjbDa+7T9xxY9kWfu0\r
+ jKcw==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=gIV8dyppNyBRHkA9oCDL0xDKLJiIaJGjgz13raDHHBc=;\r
+ b=hrPBoLziuDt2zv3f189QQDZP/Ohol6xQcw5kNGcCIBR+dYDMwNKQZwQ6AnJzjCqI37\r
+ yYWAEFaqwhdgo8q/8Oxr6FZkzJRokoIdCA3w/YzOQHUGJch5XdbY7nsNi4MhS+SR8HA5\r
+ nCCvDzZxDAs2ZltRQjuF0xb2/nB+FZfSGqkzgE28j824YZmytZ1NkZPgY/gFZj5tBQ9W\r
+ c1BQgGE0mM0nmwPUFbkwsxf/Z5okT868ZPIaOAnaAPR3r3Agdotby1DEw3buCUGWgFud\r
+ h89I2nxhrvv+H5AlQb6583npVQjnmvgGWYWobxi8z3SMA9aE5JlNMed9d9k23TKwt/Lr\r
+ Yf2A==\r
+X-Gm-Message-State:\r
+ ALyK8tJuQ7ilkx82S2M44UhF7NIwXldQMpq08oU0eYK+rM8SNX/Qe5tyCTKmjlY40ryS9Q==\r
+X-Received: by 10.28.228.86 with SMTP id b83mr981664wmh.11.1465599787650;\r
+ Fri, 10 Jun 2016 16:03:07 -0700 (PDT)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by smtp.gmail.com with ESMTPSA id r129sm1255989wmr.20.2016.06.10.16.03.06\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Fri, 10 Jun 2016 16:03:06 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/6] emacs: simplify our local copy of message-do-fcc\r
+Date: Sat, 11 Jun 2016 00:02:50 +0100\r
+Message-Id: <1465599772-10297-5-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1465599772-10297-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1465599772-10297-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 10 Jun 2016 23:03:26 -0000\r
+\r
+message-do-fcc has lots of functionality we don't need, so remove it.\r
+---\r
+ emacs/notmuch-maildir-fcc.el | 24 +-----------------------\r
+ emacs/notmuch-mua.el | 11 ++++-------\r
+ 2 files changed, 5 insertions(+), 30 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el\r
+index 6fed11f..7b3f232 100644\r
+--- a/emacs/notmuch-maildir-fcc.el\r
++++ b/emacs/notmuch-maildir-fcc.el\r
+@@ -159,29 +159,7 @@ This is a direct copy from message-mode's message-do-fcc."\r
+ ;; Process FCC operations.\r
+ (while list\r
+ (setq file (pop list))\r
+- (if (string-match "^[ \t]*|[ \t]*\\(.*\\)[ \t]*$" file)\r
+- ;; Pipe the article to the program in question.\r
+- (call-process-region (point-min) (point-max) shell-file-name\r
+- nil nil nil shell-command-switch\r
+- (match-string 1 file))\r
+- ;; Save the article.\r
+- (setq file (expand-file-name file))\r
+- (unless (file-exists-p (file-name-directory file))\r
+- (make-directory (file-name-directory file) t))\r
+- (if (and message-fcc-handler-function\r
+- (not (eq message-fcc-handler-function 'rmail-output)))\r
+- (funcall message-fcc-handler-function file)\r
+- ;; FIXME this option, rmail-output (also used if\r
+- ;; message-fcc-handler-function is nil) is not\r
+- ;; documented anywhere AFAICS. It should work in Emacs\r
+- ;; 23; I suspect it does not work in Emacs 22.\r
+- ;; FIXME I don't see the need for the two different cases here.\r
+- ;; mail-use-rfc822 makes no difference (in Emacs 23),and\r
+- ;; the third argument just controls \"Wrote file\" message.\r
+- (if (and (file-readable-p file) (mail-file-babyl-p file))\r
+- (rmail-output file 1 nil t)\r
+- (let ((mail-use-rfc822 t))\r
+- (rmail-output file 1 t t))))))\r
++ (notmuch-fcc-handler file))\r
+ (kill-buffer (current-buffer))))))\r
+ \r
+ (defun notmuch-fcc-handler (fcc-header)\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 3c1c046..60ad6c3 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -32,7 +32,6 @@\r
+ \r
+ (declare-function notmuch-show-insert-body "notmuch-show" (msg body depth))\r
+ (declare-function notmuch-fcc-header-setup "notmuch-maildir-fcc" ())\r
+-(declare-function notmuch-fcc-handler "notmuch-maildir-fcc" (destdir))\r
+ (declare-function notmuch-maildir-message-do-fcc "notmuch-maildir-fcc" ())\r
+ \r
+ ;;\r
+@@ -491,15 +490,13 @@ will be addressed to all recipients of the source message."\r
+ \r
+ (defun notmuch-mua-send-and-exit (&optional arg)\r
+ (interactive "P")\r
+- (let ((message-fcc-handler-function #'notmuch-fcc-handler))\r
+- (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))\r
+- (message-send-and-exit arg))))\r
++ (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))\r
++ (message-send-and-exit arg)))\r
+ \r
+ (defun notmuch-mua-send (&optional arg)\r
+ (interactive "P")\r
+- (let ((message-fcc-handler-function #'notmuch-fcc-handler))\r
+- (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))\r
+- (message-send arg))))\r
++ (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))\r
++ (message-send arg)))\r
+ \r
+ (defun notmuch-mua-kill-buffer ()\r
+ (interactive)\r
+-- \r
+2.1.4\r
+\r