summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-01 17:32:19 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-01 17:32:19 +0300
commitf1cf2a0ad0107a41a4339f0889fdb5c15551b1ff (patch)
treeff5067062d35c507e1db2e306ea930b08bbd5252
parentba2943cec7035ddd7444ce55de1d34dc6ec6d9ab (diff)
mu4e-draft: make compose frame config buffer-local
This should help when multiple compose windows are present, such as in issue #2912.
-rw-r--r--mu4e/mu4e-draft.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/mu4e/mu4e-draft.el b/mu4e/mu4e-draft.el
index 90c15dd..61f007f 100644
--- a/mu4e/mu4e-draft.el
+++ b/mu4e/mu4e-draft.el
@@ -1,6 +1,6 @@
;;; mu4e-draft.el --- Helpers for m4e-compose -*- lexical-binding: t -*-
-;; Copyright (C) 2024-2025 Dirk-Jan C. Binnema
+;; Copyright (C) 2024-2026 Dirk-Jan C. Binnema
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
@@ -694,8 +694,8 @@ Used internally for mu4e-compose-post-kill-frame.")
"Function that might kill the composition frame.
This is for use in `mu4e-compose-post-hook'."
(let ((msgframe (selected-frame)))
- ;;(message "kill frame? %s %s" mu4e--draft-activation-frame msgframe)
- (when (and (frame-live-p msgframe)
+ (when (and mu4e--draft-activation-frame
+ (frame-live-p msgframe)
(not (eq mu4e--draft-activation-frame msgframe)))
(delete-frame msgframe))))
@@ -722,9 +722,11 @@ Set up some message actions. In particular, handle closing frames
when we created it. OLDFRAME is the frame from which the
message-composition was triggered. OLDWINDCONF is the current
window configuration."
- ;; remember current frame & window conf
- (setq mu4e--draft-activation-frame oldframe
- mu4e--before-draft-window-config oldwindconf)
+ ;; remember current frame & window configuration; make these buffer-local so
+ ;; each composition buffer tracks its *own* activation context, which is
+ ;; needed when multiple compositions exist simultaneously.
+ (setq-local mu4e--draft-activation-frame oldframe
+ mu4e--before-draft-window-config oldwindconf)
;; make message's "post" hooks local, and multiplex them
(make-local-variable 'message-send-actions)