Make reply work with org-mu4e-mode

This commit is contained in:
Alexander Rosenberg 2024-10-21 04:56:01 -07:00
parent 888a8158d9
commit 22c70eaaa6
Signed by: Zander671
GPG Key ID: 5FD0394ADBD72730
2 changed files with 32 additions and 0 deletions

View File

@ -219,6 +219,32 @@ passed to it."
(cl-letf (((symbol-function 'mu4e-compose-mode) 'org-mu4e-compose-mode))
(apply 'mu4e-compose-new r))))
;;;###autoload
(defun org-mu4e-compose-reply-to (&optional to wide)
"This is like `mu4e-compose-reply-to', but utilizes `org-mu4e-compose-mode'.
TO and WIDE are the same as `mu4e-compose-reply-to'."
(interactive)
;; Save local variables set by `mu4e-compose-reply-to'
(let ((html-part-p (seq-find (lambda (handle)
(equal (mm-handle-media-type (cdr handle))
"text/html"))
gnus-article-mime-handle-alist))
(org-mu4e--internal-message-mode-function
(symbol-function 'mu4e-compose-mode)))
(cl-letf (((symbol-function 'mu4e-compose-mode) 'org-mu4e-compose-mode))
(let ((buf (mu4e-compose-reply-to to wide)))
(with-current-buffer buf
(setq org-mu4e--html-message-p
;; make the variable look nicer by not having random data in it
(not (not html-part-p))))))))
;;;###autoload
(defun org-mu4e-compose-reply (&optional wide)
"This is like `mu4e-compose-reply', but utilizes `org-mu4e-compose-mode'.
WIDE is the same as `mu4e-compose-reply'."
(interactive "P")
(org-mu4e-compose-reply-to nil wide))
;;;###autoload
(defvar-keymap org-mu4e-compose-mode-map
:parent org-mode-map

View File

@ -2127,6 +2127,12 @@ The name is compared with the field name using TESTFN (defaults to `equal')."
"ZD" #'message-dont-send
"ZQ" #'message-kill-buffer
"ZF" #'mml-attach-file)
(evil-define-key 'normal mu4e-view-mode-map
"R" 'org-mu4e-compose-reply
"cr" 'org-mu4e-compose-reply)
(evil-define-key 'normal mu4e-headers-mode-map
"R" 'org-mu4e-compose-reply
"cr" 'org-mu4e-compose-reply)
(defun my/-setup-org-mu4e-compose-mode ()
"Setup up stuff in `org-mu4e-compose' buffers."
(setq-local ltex-eglot-variable-save-method 'file)