mu4e: implement mu4e-compose-post-hook

A hook for when we're done with message composition.

We populate it with a function to kill created frames and one to attempt
to restore window configuration.
This commit is contained in:
Dirk-Jan C. Binnema
2024-04-27 17:20:19 +03:00
parent a49cd03f6b
commit 4440594066
3 changed files with 100 additions and 18 deletions

View File

@ -1798,11 +1798,15 @@ value of various properties (and see @ref{Message functions}).
starts, when the whole buffer has already been set up. This is a good place
for editing-related settings. @code{mu4e-compose-parent-message} (see above)
is also at your disposal.
@item @code{mu4e-compose-post-hook}: this hook is run when we're done with
message compositions. See the docstring for details.
@end itemize
@noindent
Let's look at an examples. As mentioned, @code{mu4e-compose-mode-hook} is especially
useful for editing-related settings. For example:
As mentioned, @code{mu4e-compose-mode-hook} is especially useful for
editing-related settings:
Let's look at an example:
@lisp
(add-hook 'mu4e-compose-mode-hook
(defun my-do-compose-stuff ()
@ -1811,7 +1815,7 @@ useful for editing-related settings. For example:
(flyspell-mode)))
@end lisp
This hook is also useful for adding headers or changing headers, since the
The hook is also useful for adding headers or changing headers, since the
message is fully formed when this hook runs. For example, to add a
@t{Bcc:}-header, you could add something like the following, using
@code{message-add-header} from @code{message-mode}.