From 77f5911b7d390a069104db20be86293506ffbff2 Mon Sep 17 00:00:00 2001 From: Hugo Heagren Date: Fri, 13 Aug 2021 19:50:38 +0100 Subject: [PATCH] org-msg-ctrl-c-ctrl-c: support `message-send' With the universal argument (i.e. C-u C-c C-c), org-msg-ctrl-c-ctrl-c calls the 'send mua function, defaulting to `message-send' instead of the 'send-and-exit mua function. This patch addresses #127 Signed-off-by: Hugo Heagren --- README.org | 2 +- org-msg.el | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.org b/README.org index 7c44258..542b722 100644 --- a/README.org +++ b/README.org @@ -23,7 +23,7 @@ The *OrgMsg* mode keys are the usual key combination used in either [[https://or - ~C-c C-s~ -- calls ~message-goto-subject~ (same as in [[https://www.gnu.org/software/emacs/manual/html_mono/message.html][Message mode]]) - ~C-c C-b~ -- calls ~org-msg-goto-body~ (similar to ~message-goto-body~ in [[https://www.gnu.org/software/emacs/manual/html_mono/message.html][Message mode]]) - ~C-c C-a~ -- calls ~org-msg-attach~, very similar to the ~org-attach~ function. It lets you add or delete attachment for this email. Attachment list is stored in the ~:attachment:~ property. -- ~C-c C-c~ -- calls ~org-ctrl-c-ctrl-c~. *OrgMsg* configures ~org-msg-ctrl-c-ctrl-c~ as a final hook of [[https://orgmode.org/][Org mode]]. When ~org-msg-ctrl-c-ctrl-c~ is called in a *OrgMsg* buffer it generates the MIME message and send it. +- ~C-c C-c~ -- calls ~org-ctrl-c-ctrl-c~. *OrgMsg* configures ~org-msg-ctrl-c-ctrl-c~ as a final hook of [[https://orgmode.org/][Org mode]]. When ~org-msg-ctrl-c-ctrl-c~ is called in a *OrgMsg* buffer it generates the MIME message, sends it and exits. If the universal argument is supplied, the last step is skipped. The ~org-msg-mode~ interactive function can be called to enable/disable *OrgMsg*. By default, once the module is loaded, it is disable. If you want to reply to an email without making use of *OrgMsg*, you should call that function before you call the reply-to function. diff --git a/org-msg.el b/org-msg.el index 78498a7..5f33668 100644 --- a/org-msg.el +++ b/org-msg.el @@ -1254,6 +1254,7 @@ MML tags." (unless (org-msg-message-fetch-field "subject") (org-msg-post-setup args))) +(defalias 'org-msg-send-notmuch 'notmuch-mua-send) (defalias 'org-msg-send-and-exit-notmuch 'notmuch-mua-send-and-exit) (defun org-msg-sanity-check () @@ -1274,10 +1275,13 @@ to proceed?") (defun org-msg-ctrl-c-ctrl-c () "Send message like `message-send-and-exit'. If the current buffer is OrgMsg buffer and OrgMsg is enabled (see -`org-msg-toggle'), it calls `message-send-and-exit'." +`org-msg-toggle'), it calls `message-send-and-exit'. With the +universal prefix argument, it calls `message-send'." (when (eq major-mode 'org-msg-edit-mode) (org-msg-sanity-check) - (org-msg-mua-call 'send-and-exit 'message-send-and-exit))) + (if current-prefix-arg + (org-msg-mua-call 'send 'message-send) + (org-msg-mua-call 'send-and-exit 'message-send-and-exit)))) (defun org-msg-tab () "Complete names or Org mode visibility cycle.