From dc387bc48666fd911425f9c15ece1702840ea46d Mon Sep 17 00:00:00 2001 From: Martin Myrseth Date: Thu, 3 Oct 2024 06:45:35 +0200 Subject: [PATCH] fix(mu4e): org-msg: toggle behavior Toggle behavior: The `(integerp current-prefix-arg)` check didn't appropriately catch `C-u`/`SPC u` prefixes. This attempts to use `(prefix-numeric-value current-prefix-arg)` instead to normalize these cases. Variable naming: I'm not sure if this was supposed to continue to be called `+mu4e-compose-org-msg-toggle-next` or if the rename to private `+mu4e--compose-org-msg-toggle-next` was intentional and the usage wasn't updated accordingly. I see the `mu4e` README still mentions it, so I would guess the former and this was a typo. Ref: #8073 Amend: a78237cc01ad --- modules/email/mu4e/config.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/email/mu4e/config.el b/modules/email/mu4e/config.el index f02b7a923..4a1810353 100644 --- a/modules/email/mu4e/config.el +++ b/modules/email/mu4e/config.el @@ -442,14 +442,14 @@ This should already be the case yet it does not always seem to be." (org-msg-set-prop "attachment" (nconc files (list file))))) ;; HACK: Toggle `org-msg' where sensible. - (defvar +mu4e--compose-org-msg-toggle-next t) + (defvar +mu4e-compose-org-msg-toggle-next t) (defadvice! +mu4e-maybe-toggle-org-msg-a (&rest _) :before #'+mu4e/attach-files :before #'mu4e-compose-new :before #'mu4e-compose-reply :before #'mu4e-compose-forward :before #'mu4e-compose-resend - (when (xor (/= 1 (if (integerp current-prefix-arg) current-prefix-arg 0)) + (when (xor (/= 1 (prefix-numeric-value current-prefix-arg)) +mu4e-compose-org-msg-toggle-next) (org-msg-mode (if org-msg-mode -1 1)) (cl-callf not +mu4e-compose-org-msg-toggle-next)))