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 <dam...@cassou.me>
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

Reply via email to