[PATCH] [emacs] Add an argument to notmuch-mua-mail
authorAaron Ecay <aaronecay@gmail.com>
Sat, 17 Dec 2011 10:41:28 +0000 (05:41 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:58 +0000 (09:40 -0800)
a3/59d8d99a9ab97f6e6d0609d432afd7cf19856f [new file with mode: 0644]

diff --git a/a3/59d8d99a9ab97f6e6d0609d432afd7cf19856f b/a3/59d8d99a9ab97f6e6d0609d432afd7cf19856f
new file mode 100644 (file)
index 0000000..1311696
--- /dev/null
@@ -0,0 +1,125 @@
+Return-Path: <aaronecay@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 olra.theworths.org (Postfix) with ESMTP id 9E779431FD0\r
+       for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 02:41:41 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.7\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.7 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]\r
+       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 AEDEwHoIxLEx for <notmuch@notmuchmail.org>;\r
+       Sat, 17 Dec 2011 02:41:40 -0800 (PST)\r
+Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com\r
+       [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id E91D3431FB6\r
+       for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 02:41:39 -0800 (PST)\r
+Received: by qcha6 with SMTP id a6so2845555qch.26\r
+       for <notmuch@notmuchmail.org>; Sat, 17 Dec 2011 02:41:38 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=viwDbJDaWenPJpSJqC0Fwj7J+sfoH9c1+E5mboEpYfQ=;\r
+       b=vGbUXpInRrSSvnKevUZKYMCgVRc50bmPC6te4rQNtZIqmKBaXANq1aaLQWHeSteleX\r
+       LdOox60uzF7EuGRSN9UqzYAS9dCsFaoKmzcfQ3UP6KuzsqqYznVdwBqHB34upfRnijOm\r
+       Tz/LO0Z7qYmTRG3TbaEKCl9JD1iZMKSqog7BA=\r
+Received: by 10.229.78.206 with SMTP id m14mr2877955qck.113.1324118498106;\r
+       Sat, 17 Dec 2011 02:41:38 -0800 (PST)\r
+Received: from localhost.localdomain (c-68-80-94-73.hsd1.pa.comcast.net.\r
+       [68.80.94.73])\r
+       by mx.google.com with ESMTPS id j7sm25576002qaq.11.2011.12.17.02.41.36\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 17 Dec 2011 02:41:37 -0800 (PST)\r
+From: Aaron Ecay <aaronecay@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] [emacs] Add an argument to notmuch-mua-mail\r
+Date: Sat, 17 Dec 2011 05:41:28 -0500\r
+Message-Id: <1324118488-81437-1-git-send-email-aaronecay@gmail.com>\r
+X-Mailer: git-send-email 1.7.8\r
+In-Reply-To: <yf6wr9v4hu1.fsf@taco2.nixu.fi>\r
+References: <yf6wr9v4hu1.fsf@taco2.nixu.fi>\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: Sat, 17 Dec 2011 10:41:41 -0000\r
+\r
+>From the emacs changelog:\r
+\r
+  ** `compose-mail' now accepts an optional 8th arg, RETURN-ACTION, and\r
+  passes it to the mail user agent function.  This argument specifies an\r
+  action for returning to the caller after finishing with the mail.\r
+  This is currently used by Rmail to delete a mail window.\r
+\r
+Under Emacs 24, notmuch breaks when this argument is passed to it by a\r
+function in another part of Emacs.  One example of a functon that does\r
+this is report-emacs-bug -- so notmuch users cannot file emacs bug\r
+reports!\r
+\r
+This patch also adds a &rest argument to the arg-list of this function,\r
+to future-proof against such changes.  This is adapted from the approach\r
+taken by message-mail, a similar function built into emacs.\r
+\r
+This patch was originally submitted by richardmurri@gmail.com on Aug. 1:\r
+id:"877h6x6oor.fsf@veracitynetworks.com"\r
+---\r
+\r
+This version of the patch adopts Dmitry's arg-passing approach, and also\r
+cleans up a long line (it is still slightly over 80 chars as I didn't\r
+see a better way to break it).  Tomi, I don't see two interactive calls\r
+-- I think Emacs would complain if this happened.\r
+\r
+ emacs/notmuch-mua.el |   15 ++++++++-------\r
+ 1 files changed, 8 insertions(+), 7 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 8824b08..510c951 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -124,9 +124,10 @@ list."\r
\r
+   (message-goto-to))\r
\r
+-(defun notmuch-mua-mail (&optional to subject other-headers continue\r
+-                                 switch-function yank-action send-actions)\r
+-  "Invoke the notmuch mail composition window."\r
++(defun notmuch-mua-mail (&optional to subject other-headers &rest other-args)\r
++  "Invoke the notmuch mail composition window.\r
++\r
++OTHER-ARGS are passed through to `message-mail'."\r
+   (interactive)\r
\r
+   (when notmuch-mua-user-agent-function\r
+@@ -135,11 +136,11 @@ list."\r
+       (push (cons "User-Agent" user-agent) other-headers))))\r
\r
+   (unless (mail-header 'from other-headers)\r
+-    (push (cons "From" (concat\r
+-                      (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))\r
++    (push (cons "From"\r
++              (concat (notmuch-user-name) " <" (notmuch-user-primary-email) ">"))\r
++        other-headers))\r
\r
+-  (message-mail to subject other-headers continue\r
+-              switch-function yank-action send-actions)\r
++  (apply #'message-mail to subject other-headers other-args)\r
+   (message-sort-headers)\r
+   (message-hide-headers)\r
+   (set-buffer-modified-p nil)\r
+-- \r
+1.7.8\r
+\r