From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +OaLMMrAxWC+ZwAAgWs5BA (envelope-from ) for ; Sun, 13 Jun 2021 10:24:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2AHXK8rAxWB0BAAAB5/wlQ (envelope-from ) for ; Sun, 13 Jun 2021 08:24:42 +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 F41A2262BF for ; Sun, 13 Jun 2021 10:24:39 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 6C3CC2B273; Sun, 13 Jun 2021 04:24:32 -0400 (EDT) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mail.notmuchmail.org (Postfix) with ESMTPS id 7D3B62B20F for ; Sun, 13 Jun 2021 04:24:29 -0400 (EDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 2024B10DE; Sun, 13 Jun 2021 04:24:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 13 Jun 2021 04:24:28 -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=zzjt5JkbLFZE1 N18eW43vpxXUaWIWecxeT8S8CfS5kM=; b=QyJcfy29B/CO0wjcMy1fylXqG/3Tw UWHSsdRNTcdEKPWWev5SPHfvMfGv4RMYgR4b+JYUrQyD3GK3OoMMszYMemOcwCDe /hIH1p0xRgnzxU45dtAu6OlG/XHPyEgBsXsVf15XXMp69siQAfMWJEerA5F9DRni i418VLAOkFU/AaFHRssOhAG4p7PTM5+96tqfuvagmISRUNQIWqAF/utpF/pTrboF cA6SzZwZaphdcLRVmB2Xweu+vriU4xF64bwIWDQyegyW9S/9JiNmVrFye08x7q+f lt4CzMjcLi3I1BPbj/rRYxh+ZjgvJrZehXd7Ab8ReuPYosJF7xVtrn30A== 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= fm3; bh=zzjt5JkbLFZE1N18eW43vpxXUaWIWecxeT8S8CfS5kM=; b=WaS2DksH U/LBOTNqBn3FkupJUlT9xbqqtHXs/20DypKqviOVg8FOqNkzUulgne67yf9GfpLJ /Xx8OTbx5aO/fUE4tLdpe9Isi6cmkYhe4U5Jpa9zi0G39z5aVnEgKPDN1b4jAaYk jC1fL9wSIzUidh4TNNGAR3Ts5fkgxnVd6Lfqk3KZ6nypQMRITFYy2OC0pKE4nnXs BoE9KH9SeIjHvkclq3dv3T0h0IQjmFvXewO+kQBwJQFg0P01rS++TECjKAhROYJf Ui0VNOSzUIIVAO4BGLnElSkuld7rj9yIUUphzP9S0iEb1/SL5E7lFi4nCKCiyERq ZLBY5m2yZVVU3g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrfedvfedgtdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvgguvghfuceovgguvghfsegvuggvfhdrvghuqeenucggtffr rghtthgvrhhnpeekuddvveegueffgfehhefhfeegleeludevjefhudegtdfhffeggfdvvd dugefgheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhm pegvuggvfhesvgguvghfrdgvuh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 13 Jun 2021 04:24:27 -0400 (EDT) From: edef To: notmuch@notmuchmail.org Subject: [PATCH v2] emacs: remap send-message and send-message-and-exit Date: Sun, 13 Jun 2021 08:23:58 +0000 Message-Id: <20210613082357.76606-1-edef@edef.eu> X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Message-ID-Hash: 5LQKR4C3GIELMQZHUNHJZJBKFMD6PN6Z X-Message-ID-Hash: 5LQKR4C3GIELMQZHUNHJZJBKFMD6PN6Z 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=1623572681; 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=sn+Lsv69Gss4DT1mDJGrcv2V7uBhrHhAELGJAGmWU6k=; b=JhOh0i/rp6EVhK3qEnQEy6jr+b92zjkQ8Id98cRrfopH9DP1bRZDbhW8fPvDV8YnfUVjoO el4lYUM+xww2bjU4bELTpC9hmkuojQunN74zCHTYTioOH0eLaMBr5JgVDiL1NLiML+rq0L 3Y65ml6p5arpekLG3fjmLOwJnC6xh8ZQaWLyjKK/0eRD0G8RsSj0tOcJeGxXLhVZAdzmSG Km6qOVT2OWFGnJY9WaIZFJqfYtiXgm82l7OQauXG6avXSMNIAabkzLfP5e600bmarZ1Muk iAr2winM29OZn4nI6rmb8iY5Fz6oRZ1vETT4t2l2JVp1FqsqtTUoX0VcQWPqFg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1623572681; a=rsa-sha256; cv=none; b=qYw9wcdbh0Kb8pMHTTCEktiviNhZ77Zbrjs+9V9/Xr6K1yNuf0a/u+xNhzhrQY11LRpggc tvIEZFlmkFMHZFLIl0/kwvUCVRyE/be5mhotOHmXh4bro0xX/AEwjWokcVXDmyxITlqR1g g4ynwIBfSsP4y84/jodPQ0nKyo5u2TyKZKfWt1QM1MWkj8Osk583Dc+ApDmOBFShUV4Oqa 8ChfTP5UT00MnNPRlgi6DW0XbBCej9Bz+xDEo8RfgMt6Ff2JDeANomxc/RcGCACx2k7tRD 3vIys6zd2AjY5Onzbnfxai/y5W8QOo/7AEPgxyLpQQ0SvbeeGPqB3PqFqX9Q9w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=edef.eu header.s=fm3 header.b=QyJcfy29; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm3 header.b=WaS2DksH; 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.03 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=edef.eu header.s=fm3 header.b=QyJcfy29; dkim=fail ("body hash did not verify") header.d=messagingengine.com header.s=fm3 header.b=WaS2DksH; 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: F41A2262BF X-Spam-Score: -0.03 X-Migadu-Scanner: scn1.migadu.com X-TUID: MRIQGGFWL8tp 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. --- Fixed up the nits reported by Tomi Ollila. 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..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) -- 2.31.1