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

Dmitry Kurochkin dmitry.kurochkin at gmail.com
Sat Dec 17 06:40:30 PST 2011


On Sat, 17 Dec 2011 05:41:28 -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"
> ---
> 
> 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 at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


More information about the notmuch mailing list