Re: [PATCH] Fix notmuch-mua.el notmuch-mua-mail

2022-06-02 Thread Damien Cassou
David Bremner  writes:
> There are some convenient tools for applying patches from notmuch in
> Sean Whitton's mailscripts collection [1]. I tend to work in the shell
> with some git aliases…

thank you very much for your explanations!

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] Fix notmuch-mua.el notmuch-mua-mail

2022-06-02 Thread David Bremner
Damien Cassou  writes:

> Hi David,
>
> Can you please explain me what in git-send-email makes it easier to
> apply the patches?  I'm also interested in your process to apply
> patches from your mua (notmuch in Emacs hopefully) to your git
> repository.

There are some convenient tools for applying patches from notmuch in
Sean Whitton's mailscripts collection [1]. I tend to work in the shell
with some git aliases.

[alias]
nmam = "!f() { notmuch extract-patch $1 | git am -; }; f"

[alias]
nmam8 = "!f() { notmuch extract-patch $1 | email-to-8bit |  git 
am -; }; f"

[alias]
nmam3 = "!f() { notmuch extract-patch $1 | git am -3 -; }; f"

I use "c i" to copy the message id, and then paste it into a command
line
$ git nmam 

email-to-8bit is a little hack to work around mailman induced damage to
patches; it seems less needed with new versions of git.

notmuch-extract-patch is from mailscripts, and it fails (well, fails to
extract any patch) with attached
patches. I used to use

 notmuch show --format=raw

in place of "notmuch extract-patch". This succeeds in extracting a
patch, but smashes the body text together with the commit message in the
resulting commit.

>> [ about emacs git commit messages ]

> I think it focuses too much on what has changed
> (something that could be inferred from the patch with a little tooling)
> instead of why the code has changed this way (something only the author
> can tell).

Exactly.


[1]: https://git.spwhitton.name/mailscripts
 also available in e.g. Debian.



email-to-8bit
Description: Binary data
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] Fix notmuch-mua.el notmuch-mua-mail

2022-06-01 Thread Damien Cassou
Hi David,

David Bremner  writes:
> If possible, please use git-send-email, as it makes applying the patches
> easier.


I've sent a new version in <20220601195048.166397-1-dam...@cassou.me>. I
hope I followed all recommendations. If I didn't, please tell me so I
can do better next time.

Can you please explain me what in git-send-email makes it easier to
apply the patches? I'm also interested in your process to apply patches
from your mua (notmuch in Emacs hopefully) to your git repository.

> Our conventions for commit messages are different than emacs [1], we
> don't list filenames in the commit message but we do usually list the
> "subsystem" in the subject [2]


I'm sorry I completely forgot to have a look at the conventions before
sending.

> I think the cursor positioning behaviour should be documented in the
> function docstring. 


done


> [1]: It might be a personal issue, but the emacs commit message style
> really annoys me.


I also don't like it. I think it focuses too much on what has changed
(something that could be inferred from the patch with a little tooling)
instead of why the code has changed this way (something only the author
can tell).

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] Fix notmuch-mua.el notmuch-mua-mail

2022-06-01 Thread David Bremner


If possible, please use git-send-email, as it makes applying the patches
easier.

Damien Cassou  writes:

> From 6106765b56464edc649d73916f97208b67ef5eb4 Mon Sep 17 00:00:00 2001
> From: Damien Cassou 
> Date: Mon, 23 May 2022 08:17:27 +0200
> Subject: [PATCH] Change where to move point at the end of `notmuch-mua-mail`
>
> * emacs/notmuch-mua.el (notmuch-mua-mail): Move point to the position
> that makes the most sense instead of always moving point to the TO.
> This is useful when TO/SUBJECT are passed as argument.

It's a minor issue, but...

Our conventions for commit messages are different than emacs [1], we don't
list filenames in the commit message but we do usually list the
"subsystem" in the subject [2]

> ---
>  emacs/notmuch-mua.el | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
> index 60801f4b..4ee252f2 100644
> --- a/emacs/notmuch-mua.el
> +++ b/emacs/notmuch-mua.el
> @@ -420,7 +420,10 @@ (defun notmuch-mua-mail (&optional to subject 
> other-headers _continue
>(message-hide-headers)
>(set-buffer-modified-p nil)
>(notmuch-mua-maybe-set-window-dedicated)
> -  (message-goto-to))
> +  (cond
> +   ((and to subject) (message-goto-body))
> +   (to (message-goto-subject))
> +   (t (message-goto-to

I think the cursor positioning behaviour should be documented in the
function docstring. 

[1]: It might be a personal issue, but the emacs commit message style
really annoys me.

[2]: https://notmuchmail.org/contributing/ "Write meaningful commit messages"
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] Fix notmuch-mua.el notmuch-mua-mail

2022-05-22 Thread Damien Cassou
Here is a new version of the patch that takes into account the fact that
notmuch-mua-mail can also be called interactively by notmuch and not
only through the mail-user-agent variable.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
>From 6106765b56464edc649d73916f97208b67ef5eb4 Mon Sep 17 00:00:00 2001
From: Damien Cassou 
Date: Mon, 23 May 2022 08:17:27 +0200
Subject: [PATCH] Change where to move point at the end of `notmuch-mua-mail`

* emacs/notmuch-mua.el (notmuch-mua-mail): Move point to the position
that makes the most sense instead of always moving point to the TO.
This is useful when TO/SUBJECT are passed as argument.
---
 emacs/notmuch-mua.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 60801f4b..4ee252f2 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -420,7 +420,10 @@ (defun notmuch-mua-mail (&optional to subject other-headers _continue
   (message-hide-headers)
   (set-buffer-modified-p nil)
   (notmuch-mua-maybe-set-window-dedicated)
-  (message-goto-to))
+  (cond
+   ((and to subject) (message-goto-body))
+   (to (message-goto-subject))
+   (t (message-goto-to
 
 (defvar notmuch-mua-sender-history nil)
 
-- 
2.36.0

___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


[PATCH] Fix notmuch-mua.el notmuch-mua-mail

2022-05-22 Thread Damien Cassou
Hi,

Emacs' `mail-user-agent` variable specifies several options and
notmuch-mua.el defines a new one that can be used with:

  (setq mail-user-agent 'notmuch-user-agent)

This setup works well except that notmuch-mua-mail moves point to the TO
header at the end whereas message, sendmail and gnus all move point to
the BODY. This is ok because nothing in the Emacs documentation says
that point should be in the BODY but some functions expect it there such
as submit-emacs-patch: I sent a fix upstream in
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55571 so point doesn't
have to be in the BODY at then end.

The attached patch makes sure that notmuch-mua-mail moves point to the
BODY at the end so that its behavior is closer to the one of other MUAs.

Best

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
--- notmuch-mua.el	1970-01-01 01:00:01.0 +0100
+++ notmuch-mua2.el	2022-05-22 08:58:10.073043741 +0200
@@ -418,7 +418,7 @@
   (message-hide-headers)
   (set-buffer-modified-p nil)
   (notmuch-mua-maybe-set-window-dedicated)
-  (message-goto-to))
+  (message-goto-body))
 
 (defvar notmuch-mua-sender-history nil)
 
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org