diff options
| author | Damien Cassou <damien@cassou.me> | 2022-06-01 21:50:48 +0200 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2022-06-02 08:21:56 -0300 |
| commit | 3a6b479a7360fbdbc1c6def4c1e1581bfd63e8a2 (patch) | |
| tree | bfc96fba58868120dcf0e254054f80b6aead272e /emacs | |
| parent | 66369ddf1cd1d7f84a048095ee5dcf5cb07e110c (diff) | |
emacs: change where notmuch-mua-mail moves point
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.
Amended by db: move news item to UNRELEASED.
Diffstat (limited to 'emacs')
| -rw-r--r-- | emacs/notmuch-mua.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 60801f4b..0ae33127 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -385,7 +385,13 @@ instead of `message-mode' and SWITCH-FUNCTION is mandatory." (defun notmuch-mua-mail (&optional to subject other-headers _continue switch-function yank-action send-actions return-action &rest ignored) - "Invoke the notmuch mail composition window." + "Invoke the notmuch mail composition window. + +The position of point when the function returns differs depending +on the values of TO and SUBJECT. If both are non-nil, point is +moved to the message's body. If SUBJECT is nil but TO isn't, +point is moved to the \"Subject:\" header. Otherwise, point is +moved to the \"To:\" header." (interactive) (when notmuch-mua-user-agent-function (let ((user-agent (funcall notmuch-mua-user-agent-function))) @@ -420,7 +426,10 @@ instead of `message-mode' and SWITCH-FUNCTION is mandatory." (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) |
