Skip to content

Commit

Permalink
org-msg-ctrl-c-ctrl-c: support `message-send'
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Hugo-Heagren authored and jeremy-compostella committed Sep 16, 2021
1 parent 599e8b0 commit 77f5911
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
8 changes: 6 additions & 2 deletions org-msg.el
Original file line number Diff line number Diff line change
Expand Up @@ -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 ()
Expand All @@ -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.
Expand Down

0 comments on commit 77f5911

Please sign in to comment.