Re: [PATCH] emacs: remove use of message-send-hook

2017-03-10 Thread David Bremner
Mark Walters  writes:

> +(let (tag-change
> +   post-send-tag-changes)
> +  ;; post-send-tag-changes are tag-changes to apply after sending,
> +  ;; but we need to store them now as the compose buffer is
> +  ;; typically killed before message-send-and-exit returns.
> +  (push (notmuch-message-mark-replied t) post-send-tag-changes)
> +  (push (notmuch-draft--mark-deleted t) post-send-tag-changes)
> +  (letf (((symbol-function 'message-do-fcc) 
> #'notmuch-maildir-message-do-fcc))
> + (if exit
> + (message-send-and-exit arg)
> +   (message-send arg)))
> +  (dolist (tag-change post-send-tag-changes)
> + (when tag-change
> +   (apply #'notmuch-tag tag-change))

Would it be possible to concatenate the two lists and only call
notmuch-tag once? It seems like that should be notably faster.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: remove use of message-send-hook

2017-03-10 Thread Mark Walters

On Fri, 10 Mar 2017, David Bremner  wrote:
> Mark Walters  writes:
>
>> +(let (tag-change
>> +  post-send-tag-changes)
>> +  ;; post-send-tag-changes are tag-changes to apply after sending,
>> +  ;; but we need to store them now as the compose buffer is
>> +  ;; typically killed before message-send-and-exit returns.
>> +  (push (notmuch-message-mark-replied t) post-send-tag-changes)
>> +  (push (notmuch-draft--mark-deleted t) post-send-tag-changes)
>> +  (letf (((symbol-function 'message-do-fcc) 
>> #'notmuch-maildir-message-do-fcc))
>> +(if exit
>> +(message-send-and-exit arg)
>> +  (message-send arg)))
>> +  (dolist (tag-change post-send-tag-changes)
>> +(when tag-change
>> +  (apply #'notmuch-tag tag-change))

Hi

> Would it be possible to concatenate the two lists and only call
> notmuch-tag once? It seems like that should be notably faster.

I think that it's not possible as they are tagging different
messages. We could probably do something with --batch but that would
mean some change in notmuch-tag itself.

Best wishes

Mark
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: remove use of message-send-hook

2017-03-11 Thread David Bremner
Mark Walters  writes:

> Hi
>
>> Would it be possible to concatenate the two lists and only call
>> notmuch-tag once? It seems like that should be notably faster.
>
> I think that it's not possible as they are tagging different
> messages. We could probably do something with --batch but that would
> mean some change in notmuch-tag itself.

Ah right, I missed the fact that an id was returned as well from the two
invoked functions. Nevermind then.

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] emacs: remove use of message-send-hook

2017-03-11 Thread David Bremner
Mark Walters  writes:

> We use message-send-hook for two things -- tagging drafts deleted, and
> tagging replied the parent message of a reply. We should not use
> message-send-hook as that will affect gnus etc too. Moreover,
> message-send-hook is run before the message is sent, even before the
> user confirms they want to send it (if message-confirm-send is
> set). This means the user can do C-c C-c to send, then cancel, and the
> parent is still tagged replied.

pushed to master

d

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch