--- /dev/null
+Return-Path: <sojkam1@fel.cvut.cz>\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 A9C076DE1992\r
+ for <notmuch@notmuchmail.org>; Sat, 2 Jan 2016 08:48:01 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.605\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.605 tagged_above=-999 required=5 tests=[AWL=1.245,\r
+ RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.55] 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 AUFG7pGFr14q for <notmuch@notmuchmail.org>;\r
+ Sat, 2 Jan 2016 08:47:58 -0800 (PST)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 857D36DE1962\r
+ for <notmuch@notmuchmail.org>; Sat, 2 Jan 2016 08:47:58 -0800 (PST)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 6964219F48CD\r
+ for <notmuch@notmuchmail.org>; Sat, 2 Jan 2016 17:47:56 +0100 (CET)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044)\r
+ with ESMTP id wA04puoL6EMA for <notmuch@notmuchmail.org>;\r
+ Sat, 2 Jan 2016 17:47:54 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 7F86519F48D2\r
+ for <notmuch@notmuchmail.org>; Sat, 2 Jan 2016 17:47:53 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.86)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1aFPLM-0007BI-6x; Sat, 02 Jan 2016 17:47:52 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] emacs: Refactor notmuch-mua-mail\r
+Date: Sat, 2 Jan 2016 17:47:44 +0100\r
+Message-Id: <1451753265-26713-3-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 2.6.4\r
+In-Reply-To: <1451753265-26713-1-git-send-email-sojkam1@fel.cvut.cz>\r
+References: <1451753265-26713-1-git-send-email-sojkam1@fel.cvut.cz>\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: Sat, 02 Jan 2016 16:48:01 -0000\r
+\r
+This should be more readable.\r
+---\r
+ emacs/notmuch-mua.el | 26 +++++++++++++-------------\r
+ 1 file changed, 13 insertions(+), 13 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index d4950cb..2d6825d 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -320,24 +320,24 @@ modified. This function is notmuch addaptation of\r
+ (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))\r
+ \r
+ (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to))\r
+- (let ((args (list yank-action send-actions)))\r
++ (let ((headers\r
++ ;; The following sexp is copied from `message-mail'\r
++ (nconc\r
++ `((To . ,(or to "")) (Subject . ,(or subject "")))\r
++ ;; C-h f compose-mail says that headers should be specified as\r
++ ;; (string . value); however all the rest of message expects\r
++ ;; headers to be symbols, not strings (eg message-header-format-alist).\r
++ ;; http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html\r
++ ;; We need to convert any string input, eg from rmail-start-mail.\r
++ (dolist (h other-headers other-headers)\r
++ (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))))\r
++ (args (list yank-action send-actions)))\r
+ ;; message-setup-1 in Emacs 23 does not accept return-action\r
+ ;; argument. Pass it only if it is supplied by the caller. This\r
+ ;; will never be the case when we're called by `compose-mail' in\r
+ ;; Emacs 23.\r
+ (when return-action (nconc args '(return-action)))\r
+- (apply 'message-setup-1\r
+- ;; The following sexp is copied from `message-mail'\r
+- (nconc\r
+- `((To . ,(or to "")) (Subject . ,(or subject "")))\r
+- ;; C-h f compose-mail says that headers should be specified as\r
+- ;; (string . value); however all the rest of message expects\r
+- ;; headers to be symbols, not strings (eg message-header-format-alist).\r
+- ;; http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html\r
+- ;; We need to convert any string input, eg from rmail-start-mail.\r
+- (dolist (h other-headers other-headers)\r
+- (if (stringp (car h)) (setcar h (intern (capitalize (car h)))))))\r
+- args))\r
++ (apply 'message-setup-1 headers args))\r
+ (notmuch-fcc-header-setup)\r
+ (message-sort-headers)\r
+ (message-hide-headers)\r
+-- \r
+2.6.4\r
+\r