From: edef Date: Sun, 13 Jun 2021 08:23:58 +0000 (+0000) Subject: emacs: remap send-message and send-message-and-exit X-Git-Tag: archive/debian/0.33_rc0-1~41 X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=fb4b45062f8551eb35ff1c22faf5c0bc95249a57;p=notmuch-old emacs: remap send-message and send-message-and-exit All three of C-c C-c, , and are bound to message-send-and-exit by message.el, but notmuch-mua.el only had an explicit override for the keyboard binding. This mostly manifests as confusing Fcc behaviour for GUI users. Patching the bindings for specific keys is rather brittle, since it has to be aware of every relevant binding. This change switches to instead using a remap binding, which turns any binding for message-send or message-send-and-exit into a binding for the corresponding notmuch-mua command. --- diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index bbf059a2..17954fb3 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -341,8 +341,8 @@ Typically this is added to `notmuch-mua-send-hook'." (defvar notmuch-message-mode-map (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-c C-c") #'notmuch-mua-send-and-exit) - (define-key map (kbd "C-c C-s") #'notmuch-mua-send) + (define-key map [remap message-send-and-exit] #'notmuch-mua-send-and-exit) + (define-key map [remap message-send] #'notmuch-mua-send) (define-key map (kbd "C-c C-p") #'notmuch-draft-postpone) (define-key map (kbd "C-x C-s") #'notmuch-draft-save) map)