[PATCH] [emacs] Add an argument to notmuch-mua-mail

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Fri Dec 16 03:40:55 PST 2011


On Fri, 16 Dec 2011 06:16:45 -0500, Aaron Ecay <aaronecay at gmail.com> 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 at gmail.com on Aug. 1:
> id:"877h6x6oor.fsf at veracitynetworks.com"
> ---
> 
> The previous version of this patch would break older emacsen.  Not
> passing the return-action argument through to message-mail isn't nice,
> but the alternative is to conditionally pass it based on the emacs
> version, which is less nice.
> 

Actually, we can pass return-action (and any future arguments) to
message-mail and still be compatible with Emacs 23.  See
id:"87ty50sqto.fsf at gmail.com".

Regards,
  Dmitry

> Thanks for the review Dmitry and Tomi.
> 
>  emacs/notmuch-mua.el |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index 8824b08..da31fdd 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -125,7 +125,8 @@ list."
>    (message-goto-to))
>  
>  (defun notmuch-mua-mail (&optional to subject other-headers continue
> -				   switch-function yank-action send-actions)
> +				   switch-function yank-action send-actions
> +				   return-action &rest ignored)
>    "Invoke the notmuch mail composition window."
>    (interactive)
>  
> -- 
> 1.7.8
> 
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list