From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iFyoHbHQtWDU9wAAgWs5BA (envelope-from ) for ; Tue, 01 Jun 2021 08:16:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id sBjsGLHQtWCpAgAA1q6Kng (envelope-from ) for ; Tue, 01 Jun 2021 06:16:17 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id EFE851515C for ; Tue, 1 Jun 2021 08:16:16 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 6BD7F2903E; Tue, 1 Jun 2021 02:16:09 -0400 (EDT) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by mail.notmuchmail.org (Postfix) with ESMTPS id B9178271DC for ; Tue, 1 Jun 2021 02:16:06 -0400 (EDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 6DEFC133C; Tue, 1 Jun 2021 02:16:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 01 Jun 2021 02:16:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=edef.eu; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=zLmHGdapmW4oW GsMXBCetKCSKBRdsi7iLwDiFCsnVHs=; b=YOIMGB0oGAlA9I3k/NrqkV0AqOu+5 XW9iKqoOGecpEoQg4sd8QUsnCfenC0NbBzidlJk3Le8VShiYDbcp8hC+1xsuIk5R po/QbGqEH62tfvkFoE/HwZYgp8iUfUFXfBY3ZQme1W5f7u79nLyoeTsUw1KIyyyS QyjJDv907u3pm4hmu5GZcUUrjiQWhSRN/Mo5Fw+LobjHPQUMUbiwkxhV2z6uX9/c R2lfZ/kpljPFOTmRpHAvzZpUnjWgc0/iSiyYQEg7tMcXx91+G/Zbc8CBIC/Wq+Hn Q+VIy7QTwX0lM/J0we8M7P+1PdB8WKwjtLsaixyY8B/MiJXwqRsyor/6A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=zLmHGdapmW4oWGsMXBCetKCSKBRdsi7iLwDiFCsnVHs=; b=Yeu0Qt9Q Oi+ENa6VPYuk1QO2oc2nAH5EH+AMHHITtlCZyESKyDeyCVIp50HhTxm2sFKmrY3B R9k5CtNL+CcSEn12m2J4BGUnLfYS2KuDGYJ0hQbCVTMLaR1IgrO2LklvaX/W73Ms Qs3SBOFxW5K+paWYBIC8dAea/NO60kgkydZ1186qzH/qSyCWWS65rDJN9v7c/tgz t9Acwk0vI7SVrNeAvnVi2BM+NeneXA4tLinKifXXvARjB7n1vm7QFQ3P8Fy80vlx RNk2PH3WPUCU6O5hrgEoe2zdyZY+ERkhGCnMicLhHdGxN6m4E6CAOkwKJdips1Wl VYFm7R1gwveqgA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdelgedguddtjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpegvuggvfhcuoegvuggvfhesvgguvghfrdgvuheqnecuggft rfgrthhtvghrnhepkeduvdevgeeufffgheehhfefgeelleduveejhfdugedthfffgefgvd dvudeggfehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepvgguvghfsegvuggvfhdrvghu X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Jun 2021 02:16:04 -0400 (EDT) From: edef To: notmuch@notmuchmail.org, david@tethera.net Subject: [PATCH] emacs: remap send-message and send-message-and-exit Date: Tue, 1 Jun 2021 06:15:02 +0000 Message-Id: <20210601061501.115217-1-edef@edef.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: <875yyymqvk.fsf@tethera.net> References: <875yyymqvk.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: JFJLOGGC37KQ7UO46IGQOYVVJGNFIMSF X-Message-ID-Hash: JFJLOGGC37KQ7UO46IGQOYVVJGNFIMSF X-MailFrom: edef@edef.eu X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: edef X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622528177; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=etSPZ9EYTj3bMh4uD0v8OCPYBSOHoMbNScV/NwwIYNU=; b=m8OA9b7Uum5fVVvVRJdk8B1/AH0stKlwJtZXY/Wn4mYgCB1cqV3O56AdAWdKYuxkhP2XE9 rbivnLucCiqFNCqF4gDXBan4EQz3HcPrR/AWr6hlloTIE6u+PIC2yJfw0sHL9HF6yGNIPO SLl1h7cudZLksQwgdC30yq9sDlkjSNtWEmupWl2HbHSRk/rPPm6z9bIB4ifUyHf7rMX0iQ lI+Az+Jf0JEwmG6g81C3LCpYatIb1mjc5gB9Ap5U8QVU7BGMj4G6xw2tDhKCqNTUo0KS9n vUZwNa4W2SaVLVayOJzttbM2G8+jbzCcdrAhk5ioIQveob3covB07O+CrVTiZA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622528177; a=rsa-sha256; cv=none; b=rBhp766FONzz8tp499Z4kVWejHIB3ZpSyaS5LGuEz/6EnVvKjw25o9AqwQlUlA3A48Jzrg XPAIJlxxtIhhG6rTD9zSrbRK6EZerkGsJEDx2FXTXS7NPR8tRdPsqi7Bh7dOLzDTZv0jQt H58EnA0gXMXTBjwfDmazUkDDagYkQYOR9W+pLXrBdu1dT68SlFVVyFUM0hV9owD5VcllQu 9EZAZPXB0XWfpmlGRjHFJBExbpN5vkOCLx+n76xOZ70PMAv+fy5AGZHI9urvaoqsaghwV3 F33wOBF08JhFEgzKQ3EyG6LrPsbMME6z5tEzv6SI1AhJww/eqW1G24pwTTuW+w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=edef.eu header.s=fm3 header.b=YOIMGB0o; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=Yeu0Qt9Q; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.02 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=edef.eu header.s=fm3 header.b=YOIMGB0o; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm2 header.b=Yeu0Qt9Q; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: EFE851515C X-Spam-Score: -0.02 X-Migadu-Scanner: scn0.migadu.com X-TUID: OHwJemM7Z+4g 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 patch 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. --- The previous patch managed to *disappear* the menu item, but while figuring out how to make that work correctly, I happened upon a much simpler and less brittle solution. emacs/notmuch-mua.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index bbf059a2..8572aa1b 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) -- 2.31.1