Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 41D2C431FD0 for ; Sat, 17 Dec 2011 06:41:17 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 1.7 X-Spam-Level: * X-Spam-Status: No, score=1.7 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vA-2SkUAHBfr for ; Sat, 17 Dec 2011 06:41:16 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6C8B2431FB6 for ; Sat, 17 Dec 2011 06:41:16 -0800 (PST) Received: by wgbds13 with SMTP id ds13so6436659wgb.2 for ; Sat, 17 Dec 2011 06:41:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=tAKHGPZe1kPUP6bgtKUFi7+OBmshrLHvdUEMpz7myyM=; b=eI5tADTZkID7sPrq6edzPrKf6cYPSFbS3UHegva4ivegwpZwMKjorZHf0mwmpIW0rn NGYbBz11HF2t9f4tpEEjHIUlmXZP4IKEHR9HtzgegyFRFE6wSoGo2uPdci/MQPjG5+WX Y9hhW3vMBsbXffkSuKD/ia3aCYmBSeYPGvhFw= Received: by 10.180.105.232 with SMTP id gp8mr17896460wib.65.1324132871728; Sat, 17 Dec 2011 06:41:11 -0800 (PST) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id w8sm17637724wiz.4.2011.12.17.06.41.09 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Dec 2011 06:41:10 -0800 (PST) From: Dmitry Kurochkin To: Aaron Ecay , notmuch@notmuchmail.org Subject: Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail In-Reply-To: <1324118488-81437-1-git-send-email-aaronecay@gmail.com> References: <1324118488-81437-1-git-send-email-aaronecay@gmail.com> User-Agent: Notmuch/0.10.2+96~g74e5ae5 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Sat, 17 Dec 2011 18:40:30 +0400 Message-ID: <87ty4zw9b5.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2011 14:41:17 -0000 On Sat, 17 Dec 2011 05:41:28 -0500, Aaron Ecay wrote: > From the emacs changelog: > > ** `compose-mail' now accepts an optional 8th arg, RETURN-ACTION, and > passes it to the mail user agent function. This argument specifies an > action for returning to the caller after finishing with the mail. > This is currently used by Rmail to delete a mail window. > > Under Emacs 24, notmuch breaks when this argument is passed to it by a > function in another part of Emacs. One example of a functon that does > this is report-emacs-bug -- so notmuch users cannot file emacs bug > reports! > > This patch also adds a &rest argument to the arg-list of this function, > to future-proof against such changes. This is adapted from the approach > taken by message-mail, a similar function built into emacs. > > This patch was originally submitted by richardmurri@gmail.com on Aug. 1: > id:"877h6x6oor.fsf@veracitynetworks.com" > --- > > This version of the patch adopts Dmitry's arg-passing approach, and also > cleans up a long line (it is still slightly over 80 chars as I didn't > see a better way to break it). Tomi, I don't see two interactive calls > -- I think Emacs would complain if this happened. > Looks good to me, but please revert the line wrapping changes as Tomi already mentioned. Regards, Dmitry > emacs/notmuch-mua.el | 15 ++++++++------- > 1 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el > index 8824b08..510c951 100644 > --- a/emacs/notmuch-mua.el > +++ b/emacs/notmuch-mua.el > @@ -124,9 +124,10 @@ list." > > (message-goto-to)) > > -(defun notmuch-mua-mail (&optional to subject other-headers continue > - switch-function yank-action send-actions) > - "Invoke the notmuch mail composition window." > +(defun notmuch-mua-mail (&optional to subject other-headers &rest other-args) > + "Invoke the notmuch mail composition window. > + > +OTHER-ARGS are passed through to `message-mail'." > (interactive) > > (when notmuch-mua-user-agent-function > @@ -135,11 +136,11 @@ list." > (push (cons "User-Agent" user-agent) other-headers)))) > > (unless (mail-header 'from other-headers) > - (push (cons "From" (concat > - (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers)) > + (push (cons "From" > + (concat (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) > + other-headers)) > > - (message-mail to subject other-headers continue > - switch-function yank-action send-actions) > + (apply #'message-mail to subject other-headers other-args) > (message-sort-headers) > (message-hide-headers) > (set-buffer-modified-p nil) > -- > 1.7.8 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch