* [PATCH] [emacs] Add an argument to notmuch-mua-mail
@ 2011-12-16 10:30 Aaron Ecay
2011-12-16 11:04 ` Dmitry Kurochkin
2011-12-16 11:06 ` Tomi Ollila
0 siblings, 2 replies; 14+ messages in thread
From: Aaron Ecay @ 2011-12-16 10:30 UTC (permalink / raw)
To: notmuch
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"
Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
---
emacs/notmuch-mua.el | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 8824b08..23552ad 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)
@@ -139,7 +140,8 @@ list."
(notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))
(message-mail to subject other-headers continue
- switch-function yank-action send-actions)
+ switch-function yank-action send-actions
+ return-action)
(message-sort-headers)
(message-hide-headers)
(set-buffer-modified-p nil)
--
1.7.8
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-16 10:30 [PATCH] [emacs] Add an argument to notmuch-mua-mail Aaron Ecay
@ 2011-12-16 11:04 ` Dmitry Kurochkin
2011-12-16 11:06 ` Tomi Ollila
1 sibling, 0 replies; 14+ messages in thread
From: Dmitry Kurochkin @ 2011-12-16 11:04 UTC (permalink / raw)
To: Aaron Ecay, notmuch
On Fri, 16 Dec 2011 05:30:39 -0500, Aaron Ecay <aaronecay@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@gmail.com on Aug. 1:
> id:"877h6x6oor.fsf@veracitynetworks.com"
> Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
> ---
Looks good. And thanks for the good preamble.
Regards,
Dmitry
> emacs/notmuch-mua.el | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index 8824b08..23552ad 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)
>
> @@ -139,7 +140,8 @@ list."
> (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))
>
> (message-mail to subject other-headers continue
> - switch-function yank-action send-actions)
> + switch-function yank-action send-actions
> + return-action)
> (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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-16 10:30 [PATCH] [emacs] Add an argument to notmuch-mua-mail Aaron Ecay
2011-12-16 11:04 ` Dmitry Kurochkin
@ 2011-12-16 11:06 ` Tomi Ollila
2011-12-16 11:16 ` Aaron Ecay
2011-12-16 11:23 ` Dmitry Kurochkin
1 sibling, 2 replies; 14+ messages in thread
From: Tomi Ollila @ 2011-12-16 11:06 UTC (permalink / raw)
To: Aaron Ecay, notmuch
On Fri, 16 Dec 2011 05:30:39 -0500, Aaron Ecay <aaronecay@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@gmail.com on Aug. 1:
> id:"877h6x6oor.fsf@veracitynetworks.com"
> Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
> ---
Emacs 23.3 message-mail is defined as follows:
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
(defun message-mail (&optional to subject
other-headers continue switch-function
yank-action send-actions)
...
--8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
If I'd apply your patch would that break it on Emacs 23 ?
Tomi
> emacs/notmuch-mua.el | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index 8824b08..23552ad 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)
>
> @@ -139,7 +140,8 @@ list."
> (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))
>
> (message-mail to subject other-headers continue
> - switch-function yank-action send-actions)
> + switch-function yank-action send-actions
> + return-action)
> (message-sort-headers)
> (message-hide-headers)
> (set-buffer-modified-p nil)
> --
> 1.7.8
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-16 11:06 ` Tomi Ollila
@ 2011-12-16 11:16 ` Aaron Ecay
2011-12-16 11:40 ` Dmitry Kurochkin
2011-12-16 11:23 ` Dmitry Kurochkin
1 sibling, 1 reply; 14+ messages in thread
From: Aaron Ecay @ 2011-12-16 11:16 UTC (permalink / raw)
To: notmuch
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"
---
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.
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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-16 11:16 ` Aaron Ecay
@ 2011-12-16 11:40 ` Dmitry Kurochkin
0 siblings, 0 replies; 14+ messages in thread
From: Dmitry Kurochkin @ 2011-12-16 11:40 UTC (permalink / raw)
To: Aaron Ecay, notmuch
On Fri, 16 Dec 2011 06:16:45 -0500, Aaron Ecay <aaronecay@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@gmail.com on Aug. 1:
> id:"877h6x6oor.fsf@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@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@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-16 11:06 ` Tomi Ollila
2011-12-16 11:16 ` Aaron Ecay
@ 2011-12-16 11:23 ` Dmitry Kurochkin
2011-12-17 10:23 ` Tomi Ollila
1 sibling, 1 reply; 14+ messages in thread
From: Dmitry Kurochkin @ 2011-12-16 11:23 UTC (permalink / raw)
To: Tomi Ollila, Aaron Ecay, notmuch
On Fri, 16 Dec 2011 13:06:21 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> On Fri, 16 Dec 2011 05:30:39 -0500, Aaron Ecay <aaronecay@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@gmail.com on Aug. 1:
> > id:"877h6x6oor.fsf@veracitynetworks.com"
> > Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
> > ---
>
> Emacs 23.3 message-mail is defined as follows:
>
> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
> (defun message-mail (&optional to subject
> other-headers continue switch-function
> yank-action send-actions)
> ...
> --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<--
>
> If I'd apply your patch would that break it on Emacs 23 ?
>
Good point! It seems like it would.
Perhaps we can change `notmuch-mua-mail' to accept (&optional to subject
other-headers &rest rest) and pass it all to `message-mail'. That
should be compatible with both Emacs 23 and 24, and is future-proof.
Regards,
Dmitry
>
> Tomi
>
> > emacs/notmuch-mua.el | 6 ++++--
> > 1 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> > index 8824b08..23552ad 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)
> >
> > @@ -139,7 +140,8 @@ list."
> > (notmuch-user-name) " <" (notmuch-user-primary-email) ">")) other-headers))
> >
> > (message-mail to subject other-headers continue
> > - switch-function yank-action send-actions)
> > + switch-function yank-action send-actions
> > + return-action)
> > (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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-16 11:23 ` Dmitry Kurochkin
@ 2011-12-17 10:23 ` Tomi Ollila
2011-12-17 10:41 ` Aaron Ecay
0 siblings, 1 reply; 14+ messages in thread
From: Tomi Ollila @ 2011-12-17 10:23 UTC (permalink / raw)
To: Dmitry Kurochkin, Tomi Ollila, Aaron Ecay, notmuch
On Fri, 16 Dec 2011 15:23:31 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmail.com> wrote:
>
> Perhaps we can change `notmuch-mua-mail' to accept (&optional to subject
> other-headers &rest rest) and pass it all to `message-mail'. That
> should be compatible with both Emacs 23 and 24, and is future-proof.
+1 for this approach.
btw: do I see things double of is there 2 (interactive) lines in
notmuch-mua-mail () ?
> Regards,
> Dmitry
Tomi
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-17 10:23 ` Tomi Ollila
@ 2011-12-17 10:41 ` Aaron Ecay
2011-12-17 13:48 ` Tomi Ollila
2011-12-17 14:40 ` Dmitry Kurochkin
0 siblings, 2 replies; 14+ messages in thread
From: Aaron Ecay @ 2011-12-17 10:41 UTC (permalink / raw)
To: notmuch
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.
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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-17 10:41 ` Aaron Ecay
@ 2011-12-17 13:48 ` Tomi Ollila
2011-12-17 14:40 ` Dmitry Kurochkin
1 sibling, 0 replies; 14+ messages in thread
From: Tomi Ollila @ 2011-12-17 13:48 UTC (permalink / raw)
To: Aaron Ecay, notmuch
On Sat, 17 Dec 2011 05:41:28 -0500, Aaron Ecay <aaronecay@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@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.
Very good -- except -- you should drop the attempt to clean that long line:
1) It attempts to change another thing...
2) ...and it doesn't achieve it.
See "Remember: one patch per email" in http://notmuchmail.org/patchformatting/
So, please resend with that one hunk removed.
Long line "cleanup" should be applied on wider scale (whole while -- or
every emacs lisp file there) -- in a (set of) separate patch(es).
Tomi
> 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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-17 10:41 ` Aaron Ecay
2011-12-17 13:48 ` Tomi Ollila
@ 2011-12-17 14:40 ` Dmitry Kurochkin
2011-12-17 15:24 ` Aaron Ecay
1 sibling, 1 reply; 14+ messages in thread
From: Dmitry Kurochkin @ 2011-12-17 14:40 UTC (permalink / raw)
To: Aaron Ecay, notmuch
On Sat, 17 Dec 2011 05:41:28 -0500, Aaron Ecay <aaronecay@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@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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-17 14:40 ` Dmitry Kurochkin
@ 2011-12-17 15:24 ` Aaron Ecay
2011-12-17 15:31 ` Dmitry Kurochkin
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Aaron Ecay @ 2011-12-17 15:24 UTC (permalink / raw)
To: notmuch
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"
---
emacs/notmuch-mua.el | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 8824b08..b525762 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
@@ -138,8 +139,7 @@ list."
(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
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-17 15:24 ` Aaron Ecay
@ 2011-12-17 15:31 ` Dmitry Kurochkin
2011-12-17 19:51 ` Tomi Ollila
2011-12-18 12:22 ` David Bremner
2 siblings, 0 replies; 14+ messages in thread
From: Dmitry Kurochkin @ 2011-12-17 15:31 UTC (permalink / raw)
To: Aaron Ecay, notmuch
Looks good to me.
Regards,
Dmitry
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-17 15:24 ` Aaron Ecay
2011-12-17 15:31 ` Dmitry Kurochkin
@ 2011-12-17 19:51 ` Tomi Ollila
2011-12-18 12:22 ` David Bremner
2 siblings, 0 replies; 14+ messages in thread
From: Tomi Ollila @ 2011-12-17 19:51 UTC (permalink / raw)
To: Aaron Ecay, notmuch
Looks good to me.
Regards,
Tomi
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] [emacs] Add an argument to notmuch-mua-mail
2011-12-17 15:24 ` Aaron Ecay
2011-12-17 15:31 ` Dmitry Kurochkin
2011-12-17 19:51 ` Tomi Ollila
@ 2011-12-18 12:22 ` David Bremner
2 siblings, 0 replies; 14+ messages in thread
From: David Bremner @ 2011-12-18 12:22 UTC (permalink / raw)
To: Aaron Ecay, notmuch
On Sat, 17 Dec 2011 10:24:47 -0500, Aaron Ecay <aaronecay@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.
>
pushed.
d
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2011-12-18 12:22 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-16 10:30 [PATCH] [emacs] Add an argument to notmuch-mua-mail Aaron Ecay
2011-12-16 11:04 ` Dmitry Kurochkin
2011-12-16 11:06 ` Tomi Ollila
2011-12-16 11:16 ` Aaron Ecay
2011-12-16 11:40 ` Dmitry Kurochkin
2011-12-16 11:23 ` Dmitry Kurochkin
2011-12-17 10:23 ` Tomi Ollila
2011-12-17 10:41 ` Aaron Ecay
2011-12-17 13:48 ` Tomi Ollila
2011-12-17 14:40 ` Dmitry Kurochkin
2011-12-17 15:24 ` Aaron Ecay
2011-12-17 15:31 ` Dmitry Kurochkin
2011-12-17 19:51 ` Tomi Ollila
2011-12-18 12:22 ` David Bremner
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).