From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id MDJUISHWt2BBewAAgWs5BA (envelope-from ) for ; Wed, 02 Jun 2021 21:04:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2PL0HCHWt2CxLgAAbx9fmQ (envelope-from ) for ; Wed, 02 Jun 2021 19:04:01 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 1BDA919A71 for ; Wed, 2 Jun 2021 21:04:01 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 515D929C45; Wed, 2 Jun 2021 15:03:54 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 07CE420017 for ; Wed, 2 Jun 2021 15:03:51 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id EA03B1B005D7; Wed, 2 Jun 2021 22:03:47 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1622660628; 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: in-reply-to:in-reply-to:references:references; bh=3INwLqPe30IegcH1ObAjOCtU7t5J6BFha6pWRx1ls94=; b=ujYyG0B7FV8Dahbf7+TfzgF1QgfwAa3BugxOE1gJghygf13yT8pMmhZeorzkZQ+3AoZ34q qvocq3MdrFe1Bmxkk6QNMBBZRwpAlp3DEENH0E/HAuVB12OuQZgojWloLpd5cSQE7wUcQL 6gsU7KT2g2hEIgBtCBgJ3gFHqccWFG6p494pZgTStoCuC+bX1IkhYwHecZWPABY+xFgUvg fv0ON7IwkukJBiibncFaelqaBV+Wz3XyJoUyNj8dTPYPHjiyQQuDyADHtlwdkSOp4wG3yi 43YjUxDEbM05mm/E5OvxAx34Z3fLxscIIlq5Z0oNdEmw35ciu9A4pMtpDb2fag== From: Tomi Ollila To: edef , notmuch@notmuchmail.org, david@tethera.net Subject: Re: [PATCH] emacs: remap send-message and send-message-and-exit In-Reply-To: <20210601061501.115217-1-edef@edef.eu> References: <875yyymqvk.fsf@tethera.net> <20210601061501.115217-1-edef@edef.eu> User-Agent: Notmuch/0.32+21~gfdddd4c (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1622660628; 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: in-reply-to:in-reply-to:references:references; bh=3INwLqPe30IegcH1ObAjOCtU7t5J6BFha6pWRx1ls94=; b=fCwA0c4BDNCWTni9HwQrhnzK9RKBU2bR+jaI3+hgJy+1AwGThlbAn8h7C7O3d7SPVtb8Q9 0H1UzfgmVABvyNGN4pQ5xmAmbuyJ69ZiRuG5qhz8UMkbVRBXfd5N2eug1zs9MD30WMQ62O 18U1LuWuFOLUCWyp9uvK0Cp2sWC6Zm+P3GSo9pfHUElZrTU6jfxLCzzQU7mtRwtmFCWe/h JDvHyB/ryGis5eNpAnwvYUX7tJbquyRWAGJZTaGtTWdlFBcVT6quO9erq7/Bg139wezhOi VeQFiA7+5JTeC/velCfhY1T/nVx2UDcsg8JKfVDCte49qkApMNPY7AQUBRY5bA== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1622660628; a=rsa-sha256; cv=none; b=tbjQSHqgCvGLNKefXIQ6afTWbRxTXFSqHGsgXBRh6h/F+bpQMt0Dp6Iqqy0gQdZgq7q8R8 elw8SXD8t88C3RUtYdbcHk2EB+PwVtTS22HJkBroXSFop2GjvI26Uw/IAp00n2drRQRWNk gqEQs+9EMJv9VaVAtkXn6e5cxUtSJOGp7Xm6cn5K3FDb6TBBdiDICKkrY5TQ/9A9/Fd0eR +IMZB2vUnu5YwQS+w1letOCpZAZWw/xa6bqV5VS8DNA3ZHxlbcFaIzL9Qi1inUkSgrDKKD DUi56IzTvyHCwM9HxQEJdcC23MiKBARd75UtK7rJxXN4PwCM/5PRMdGlCsPEZg== Message-ID-Hash: F5TU4S4ROMWADXN4USMEMQN5BHQTAFGY X-Message-ID-Hash: F5TU4S4ROMWADXN4USMEMQN5BHQTAFGY X-MailFrom: tomi.ollila@iki.fi 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=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622660641; 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=Gu5BxmDG3H9Kx7bKxdyZRSfeSr2FXuIvKH68YzBMMqg=; b=d22uqdoo1XHzV9z1fGQCPEHf2WG2g3lyRYS0MODRY7jUetMQ5Xhjdq1fUvwrm+EcIAgJG6 U8UL76FVgu389zCEOjpc1N5nJssvWq+nJcqvnI3zr1A+GlYFH8bMl9hpdk7iEVwqgzlmWx 4N2I2XdCSvTA1bXWifygDEOFw5yRJq1VJOtr9QLo4x8Cgp0dAHAjE6QJ5XWB7YjCI0VxbZ rS11TV+eX+9bwDpj2y+TtGPBqZlMu8eZCBTiExMcDPX1N1HeFsUKIgCndhYExhYsJOUc33 b3xbSCAWP36JwzHpdfZRqFA79XDmRvOiLGWcTdN73DTfALTFcmURAWyLGrwwgg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1622660641; a=rsa-sha256; cv=fail; b=iN4HVQ317F6vKlr+OdUkQ21fhA2QhBJEAcVIzg7s4vg5TF05znMvX38qoEAhrGP+kdxloQ NquJJhaUPFoWPvTBQ9nQKrOunAGpwuaGKsgFt1Rv7i59eZUGc7nIEMXKY7fb8jON/AExu3 HHdaFDzE9PEguvbxio3rwCaZZ4gwTBO/O8ZiWcBgER4IOMMhJA6LqCJqxA50ljzyFCmLY5 OPjMwgzPwM/RIB2dBl37WWJRIdKScQPYg7AxZtuGYLyPZj60nD+XfmNpL28ADTlAyODQm5 iE1ZLkezEWIqCRHSnxg8o23ReEPw8tGS1Y4xS405iiT1fOUrqNPr/4Pw89T5VQ== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=ujYyG0B7; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 1.10 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=ujYyG0B7; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 1BDA919A71 X-Spam-Score: 1.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: TWZBAj0daG3V On Tue, Jun 01 2021, edef@edef.eu wrote: > 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 After committed to repo this is no longer 'patch'. Simple change is to use 'commit', 'change', 'changeset' -- alternative is not to write 'This ...' but reword... > 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) where did the # characters disappear here ? afaic #' is the recommended way here... > (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 Tomi