From 82978c792c7e0d11da273cb4432407c86432e2f6 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 23 May 2026 04:07:42 -0500 Subject: feat(mail): kill org-msg compose buffers on exit The earlier setup kept compose buffers after exit (org-msg set message-kill-buffer-on-exit to nil), so HTML draft buffers lingered after a message was sent or aborted. I want them cleaned up, so I set the org-msg value to t to match the mu4e default. Both composers now kill the buffer on exit. The modules byte-compile and the mail-config tests stay green. The kill-on-exit behavior itself only shows up in live use, not in batch. --- modules/mail-config.el | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/mail-config.el b/modules/mail-config.el index 6702adb7..e46ff936 100644 --- a/modules/mail-config.el +++ b/modules/mail-config.el @@ -131,10 +131,9 @@ Prompts user for the action when executing." (setq mail-user-agent 'mu4e-user-agent) ;; default to mu4e for email (setq message-citation-line-format "On %a %d %b %Y at %R, %f wrote:\n") ;; helps show up properly in Outlook/Gmail threads (setq message-citation-line-function 'message-insert-formatted-citation-line) - ;; Plain-mu4e default: kill the compose buffer on send/exit. org-msg is the - ;; active composer (org-msg-mode is enabled in every compose buffer), and its - ;; :config overrides this to nil. So this value only takes effect if org-msg - ;; is ever disabled. + ;; Kill the compose buffer on send/exit so compose buffers don't accumulate. + ;; org-msg (the active composer) sets this to t as well, so the policy holds + ;; whether or not org-msg is on. (setq message-kill-buffer-on-exit t) (setq mu4e-change-filenames-when-moving t) ;; avoid gmail dup UID issues: https://goo.gl/RTCgVa (setq mu4e-completing-read-function 'completing-read) ;; use generic completing read, rather than ido @@ -440,10 +439,10 @@ Prompts user for the action when executing." ;; enforce css usage; default renders too small (setq org-msg-enforce-css t) - ;; org-msg owns the final compose-buffer policy: keep the buffer on exit - ;; (nil = don't kill) so an in-progress HTML draft isn't lost when it's buried - ;; or switched away from. This overrides the plain-mu4e default set above. - (setq message-kill-buffer-on-exit nil) + ;; Kill the compose buffer on exit, matching the mu4e default above, so an + ;; org-msg HTML draft buffer doesn't linger after the message is sent or + ;; aborted. org-msg defaults this to nil, so set it explicitly here. + (setq message-kill-buffer-on-exit t) ;; Override just the problematic styles with important tags (setq org-msg-extra-css -- cgit v1.2.3