Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Fri, 16 Dec 2011 11:23:31 +0000 (15:23 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:54 +0000 (09:40 -0800)
30/3bd6743b2b62cd1c055b0bea7f7a425a6311f1 [new file with mode: 0644]

diff --git a/30/3bd6743b2b62cd1c055b0bea7f7a425a6311f1 b/30/3bd6743b2b62cd1c055b0bea7f7a425a6311f1
new file mode 100644 (file)
index 0000000..3f45eaa
--- /dev/null
@@ -0,0 +1,146 @@
+Return-Path: <dmitry.kurochkin@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 B0DD5429E25\r
+       for <notmuch@notmuchmail.org>; Fri, 16 Dec 2011 03:24:13 -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 k+P69ZJalQwM for <notmuch@notmuchmail.org>;\r
+       Fri, 16 Dec 2011 03:24:13 -0800 (PST)\r
+Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com\r
+       [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D4BD1431FD0\r
+       for <notmuch@notmuchmail.org>; Fri, 16 Dec 2011 03:24:12 -0800 (PST)\r
+Received: by faaa5 with SMTP id a5so3133556faa.26\r
+       for <notmuch@notmuchmail.org>; Fri, 16 Dec 2011 03:24:11 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=hyElZ6DUucxCKFqBdogU8dOE0/pZvzfdl0s5tHAOz1k=;\r
+       b=hjeD21d6IsdKaQR3EZ8rcmTD9CLVEHhxpT8FIQx4Xy1IFJCvwXm3o7JkmwNrUGa2I5\r
+       raIMIsxM52V+GAnENu57Ggyp15ERAD7MiYb1Qyi3ty/zvBa9NA18IROaz3mRtbdrslsD\r
+       CgTth3stZUuH2xcJrjXyy/gwJSvpjiek/xyMA=\r
+Received: by 10.180.96.103 with SMTP id dr7mr12072973wib.16.1324034651567;\r
+       Fri, 16 Dec 2011 03:24:11 -0800 (PST)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id v10sm12636125wiy.23.2011.12.16.03.24.10\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 16 Dec 2011 03:24:10 -0800 (PST)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, Aaron Ecay <aaronecay@gmail.com>,\r
+       notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail\r
+In-Reply-To: <yf6pqfog4ia.fsf@taco2.nixu.fi>\r
+References: <1324031439-72313-1-git-send-email-aaronecay@gmail.com>\r
+       <yf6pqfog4ia.fsf@taco2.nixu.fi>\r
+User-Agent: Notmuch/0.10.2+96~g74e5ae5 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Fri, 16 Dec 2011 15:23:31 +0400\r
+Message-ID: <87ty50sqto.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\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: Fri, 16 Dec 2011 11:24:13 -0000\r
+\r
+On Fri, 16 Dec 2011 13:06:21 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> On Fri, 16 Dec 2011 05:30:39 -0500, Aaron Ecay <aaronecay@gmail.com> wrote:\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
+> > Signed-off-by: Aaron Ecay <aaronecay@gmail.com>\r
+> > ---\r
+> \r
+> Emacs 23.3 message-mail is defined as follows:\r
+> \r
+> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--\r
+> (defun message-mail (&optional to subject\r
+>                                other-headers continue switch-function\r
+>                                yank-action send-actions)\r
+> ...\r
+> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--\r
+> \r
+> If I'd apply your patch would that break it on Emacs 23 ?\r
+> \r
+\r
+Good point! It seems like it would.\r
+\r
+Perhaps we can change `notmuch-mua-mail' to accept (&optional to subject\r
+other-headers &rest rest) and pass it all to `message-mail'.  That\r
+should be compatible with both Emacs 23 and 24, and is future-proof.\r
+\r
+Regards,\r
+  Dmitry\r
+\r
+> \r
+> Tomi\r
+> \r
+> >  emacs/notmuch-mua.el |    6 ++++--\r
+> >  1 files changed, 4 insertions(+), 2 deletions(-)\r
+> > \r
+> > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+> > index 8824b08..23552ad 100644\r
+> > --- a/emacs/notmuch-mua.el\r
+> > +++ b/emacs/notmuch-mua.el\r
+> > @@ -125,7 +125,8 @@ list."\r
+> >    (message-goto-to))\r
+> >  \r
+> >  (defun notmuch-mua-mail (&optional to subject other-headers continue\r
+> > -                             switch-function yank-action send-actions)\r
+> > +                             switch-function yank-action send-actions\r
+> > +                             return-action &rest ignored)\r
+> >    "Invoke the notmuch mail composition window."\r
+> >    (interactive)\r
+> >  \r
+> > @@ -139,7 +140,8 @@ list."\r
+> >                    (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))\r
+> >  \r
+> >    (message-mail to subject other-headers continue\r
+> > -          switch-function yank-action send-actions)\r
+> > +          switch-function yank-action send-actions\r
+> > +          return-action)\r
+> >    (message-sort-headers)\r
+> >    (message-hide-headers)\r
+> >    (set-buffer-modified-p nil)\r
+> > -- \r
+> > 1.7.8\r
+> \r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r