Skip to content

Commit

Permalink
Support backend specific org-msg-edit-mode kill-buffer function
Browse files Browse the repository at this point in the history
mu4e has a `mu4e-message-kill-buffer' function doing a little bit more
than calling `message-kill-buffer'.  This patch makes OrgMsg offer the
ability to have a specific to the backend callback called for "C-c
C-k" key.

This is addressing #45.

Signed-off-by: Jeremy Compostella <jeremy.compostella@gmail.com>
  • Loading branch information
jeremy-compostella committed May 7, 2020
1 parent a18fd1a commit b117b96
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions org-msg.el
Original file line number Diff line number Diff line change
Expand Up @@ -1096,14 +1096,22 @@ HTML emails."
(add-hook 'message-sent-hook
(lambda () ;; mu4e~compose-mark-after-sending
(setq mu4e-sent-func 'mu4e-sent-handler)
(mu4e~proc-sent (buffer-file-name))) nil t))
(mu4e~proc-sent (buffer-file-name))) nil t)
(define-key org-msg-edit-mode-map (kbd "C-c C-k") 'mu4e-message-kill-buffer))

(defalias 'org-msg-edit-kill-buffer-gnus 'message-kill-buffer)
(defalias 'org-msg-edit-kill-buffer-mu4e 'mu4e-message-kill-buffer)

(defun org-msg-edit-kill-buffer ()
(interactive)
(org-msg-mua-call 'edit-kill-buffer))

(defvar org-msg-edit-mode-map
(let ((map (make-sparse-keymap)))
(set-keymap-parent map org-mode-map)
(define-key map (kbd "<tab>") 'org-msg-tab)
(define-key map [remap org-export-dispatch] 'org-msg-preview)
(define-key map (kbd "C-c C-k") 'message-kill-buffer)
(define-key map (kbd "C-c C-k") 'org-msg-edit-kill-buffer)
(define-key map (kbd "C-c C-s") 'message-goto-subject)
(define-key map (kbd "C-c C-b") 'org-msg-goto-body)
(define-key map [remap org-attach] 'org-msg-attach)
Expand Down

0 comments on commit b117b96

Please sign in to comment.