mu4e-draft: add mu4e-compose-jump-to-reasonable-place

t by default (current behavior), but you can turn if off if your change (e.g.
compose-hook) wants to put the point in some different place.
This commit is contained in:
Dirk-Jan C. Binnema
2025-07-11 20:51:39 +03:00
parent 8f15eedc74
commit 5fdb13fd72
3 changed files with 21 additions and 1 deletions

View File

@ -176,6 +176,16 @@ Also see `mu4e-context-policy'."
:safe 'symbolp
:group 'mu4e-compose)
(defcustom mu4e-compose-jump-to-a-reasonable-place t
"Put point at some reasonable place in the compose buffer?
After the compose-buffer has been setup, mu4e can jump to some
reasonable place as per `mu4e--jump-to-a-reasonable-place'. If
you don't consider that reasonable, set to nil."
:type 'boolean
:safe 'booleanp
:group 'mu4e-compose)
;;
;; display the ready-to-go display buffer in the desired way.
;;
@ -636,7 +646,8 @@ COMPOSE-TYPE and PARENT are as in `mu4e--draft'."
(add-hook 'message-send-hook #'mu4e--compose-before-send nil t)
(setq-local message-fcc-handler-function #'mu4e--fcc-handler)
(mu4e--jump-to-a-reasonable-place)
(when mu4e-compose-jump-to-a-reasonable-place
(mu4e--jump-to-a-reasonable-place))
(set-buffer-modified-p nil)
(undo-boundary))

View File

@ -1939,6 +1939,11 @@ Or to something context-specific:
(save-excursion (message-add-header "Bcc: account2@@example.com\n"))))))))
@end lisp
By default, @t{mu4e} moves point to some ``reasonable place'' before letting you
edit the message; if you want something else, see
@code{mu4e-compose-jump-to-reasonable-place}.
@noindent
For a more general discussion about extending @t{mu4e}, see @ref{Extending
mu4e}.