Re: [PATCH] contrib: pick: use global keymap
authorAustin Clements <amdragon@MIT.EDU>
Sun, 15 Sep 2013 15:36:42 +0000 (11:36 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:57:09 +0000 (09:57 -0800)
96/bb98cc3b58f2977d87e9988d55687a0654e088 [new file with mode: 0644]

diff --git a/96/bb98cc3b58f2977d87e9988d55687a0654e088 b/96/bb98cc3b58f2977d87e9988d55687a0654e088
new file mode 100644 (file)
index 0000000..318c125
--- /dev/null
@@ -0,0 +1,151 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id DB607431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 15 Sep 2013 08:36:54 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id YSUuzpQwMwcF for <notmuch@notmuchmail.org>;\r
+       Sun, 15 Sep 2013 08:36:48 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (dmz-mailsec-scanner-3.mit.edu\r
+       [18.9.25.14])\r
+       by olra.theworths.org (Postfix) with ESMTP id 90D99431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 15 Sep 2013 08:36:48 -0700 (PDT)\r
+X-AuditID: 1209190e-b7f988e0000009a7-b3-5235d40fa775\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 34.88.02471.F04D5325; Sun, 15 Sep 2013 11:36:47 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r8FFakQk013726; \r
+       Sun, 15 Sep 2013 11:36:47 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r8FFah2x019488\r
+       (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT);\r
+       Sun, 15 Sep 2013 11:36:45 -0400\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1VLENP-000106-E0; Sun, 15 Sep 2013 11:36:43 -0400\r
+Date: Sun, 15 Sep 2013 11:36:42 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>\r
+Subject: Re: [PATCH] contrib: pick: use global keymap\r
+Message-ID: <20130915153642.GY1426@mit.edu>\r
+References: <1379233068-9626-1-git-send-email-markwalters1009@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <1379233068-9626-1-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Mutt/1.5.21 (2010-09-15)\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYrdT0eW/YhpksOiPlcXquTwW12/OZHZg\r
+       8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Miavm8VYcFm24umkDsYGxpkSXYycHBICJhIX\r
+       v5xih7DFJC7cW8/WxcjFISSwj1Hiyo2/UM5GRokdp5azglQJCZxmktjY5QyRWMIosf/2fxaQ\r
+       BIuAqkTbijXMIDabgIbEtv3LGUFsEQEdiduHFoCtYBaQlvj2u5kJxBYWMJW49+0ZWA2vgLZE\r
+       3/Nd7BALPCQ+re5jhYgLSpyc+YQFoldL4sa/l0C9HGBzlv/jAAlzCnhKTJk6G2ykqICKxJST\r
+       29gmMArNQtI9C0n3LITuBYzMqxhlU3KrdHMTM3OKU5N1i5MT8/JSi3SN9XIzS/RSU0o3MYKC\r
+       mlOSbwfj14NKhxgFOBiVeHhXXDAJEmJNLCuuzD3EKMnBpCTKG3zONEiILyk/pTIjsTgjvqg0\r
+       J7X4EKMEB7OSCO8mJaAcb0piZVVqUT5MSpqDRUmcd72TfpCQQHpiSWp2ampBahFMVoaDQ0mC\r
+       V/gyUKNgUWp6akVaZk4JQpqJgxNkOA/Q8D2XQIYXFyTmFmemQ+RPMSpKifMygzQLgCQySvPg\r
+       emFJ5xWjONArwrwPQdp5gAkLrvsV0GAmoMGbdxuBDC5JREhJNTCKOz68dSHId9nf60IV/8J2\r
+       3oiazv27SyRP4TGP5POpmQyO58/lfDtv2Bx54Flb97EemYei6QHpOQwHfj9dUBO3WvzCf6sb\r
+       5VOyOzjXnLA+9+J8/sq45WmeGRUzLWT/my472b/o/Rx/EbXFd53Mv+ZMm3qJtYBZYp2BSFTv\r
+       l71Z6/ZkJU9zkp2qxFKckWioxVxUnAgAzoD7KhUDAAA=\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 15 Sep 2013 15:36:55 -0000\r
+\r
+Quoth Mark Walters on Sep 15 at  9:17 am:\r
+> Austin recently introduced a new global keymap. This makes pick use\r
+> this global map.\r
+> \r
+> In most cases pick needs to override this global map because\r
+> it wants to close the message pane before doing the action. However,\r
+> this documents the over-rides and makes it less likely that the pick\r
+> bindings will get out of sync with the main bindings.\r
+> ---\r
+>  contrib/notmuch-pick/notmuch-pick.el |   16 ++++++++++++----\r
+>  1 files changed, 12 insertions(+), 4 deletions(-)\r
+> \r
+> diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+> index cba9549..01ca4bd 100644\r
+> --- a/contrib/notmuch-pick/notmuch-pick.el\r
+> +++ b/contrib/notmuch-pick/notmuch-pick.el\r
+> @@ -230,6 +230,17 @@ FUNC."\r
+>  \r
+>  (defvar notmuch-pick-mode-map\r
+>    (let ((map (make-sparse-keymap)))\r
+> +    (set-keymap-parent map notmuch-common-keymap)\r
+> +    ;; The following override the global keymap.\r
+> +    ;; Override because we want to close message pane first.\r
+> +    (define-key map "?" (notmuch-pick-close-message-pane-and #'notmuch-help))\r
+\r
+Sorry I didn't look at this earlier.\r
+\r
+(define-key map [remap notmuch-help] \r
+            (notmuch-pick-close-message-pane-and #'notmuch-help))\r
+?  (And the same for the others)\r
+\r
+That way if the user changes notmuch-common-keymap bindings in simple\r
+ways, pick should stay in sync.  And if they change them in\r
+complicated ways (say, writing their own notmuch-search wrapper or\r
+something), pick should more or less gracefully de-sync.\r
+\r
+> +    ;; Override because we first close message pane and then close pick buffer.\r
+> +    (define-key map "q" 'notmuch-pick-quit)\r
+> +    ;; Override because we close message pane after the search query is entered.\r
+> +    (define-key map "s" 'notmuch-pick-to-search)\r
+> +    ;; Override because we want to close message pane first.\r
+> +    (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail))\r
+> +\r
+>      (define-key map [mouse-1] 'notmuch-pick-show-message)\r
+>      ;; these use notmuch-show functions directly\r
+>      (define-key map "|" 'notmuch-show-pipe-message)\r
+> @@ -244,20 +255,16 @@ FUNC."\r
+>      (define-key map "e" (notmuch-pick-to-message-pane #'notmuch-pick-button-activate))\r
+>  \r
+>      ;; bindings from show (or elsewhere) but we close the message pane first.\r
+> -    (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail))\r
+>      (define-key map "f" (notmuch-pick-close-message-pane-and #'notmuch-show-forward-message))\r
+>      (define-key map "r" (notmuch-pick-close-message-pane-and #'notmuch-show-reply-sender))\r
+>      (define-key map "R" (notmuch-pick-close-message-pane-and #'notmuch-show-reply))\r
+>      (define-key map "V" (notmuch-pick-close-message-pane-and #'notmuch-show-view-raw-message))\r
+> -    (define-key map "?" (notmuch-pick-close-message-pane-and #'notmuch-help))\r
+>  \r
+>      ;; The main pick bindings\r
+> -    (define-key map "q" 'notmuch-pick-quit)\r
+>      (define-key map "x" 'notmuch-pick-quit)\r
+>      (define-key map "A" 'notmuch-pick-archive-thread)\r
+>      (define-key map "a" 'notmuch-pick-archive-message-then-next)\r
+>      (define-key map "=" 'notmuch-pick-refresh-view)\r
+> -    (define-key map "s" 'notmuch-pick-to-search)\r
+>      (define-key map "z" 'notmuch-pick-to-pick)\r
+>      (define-key map "n" 'notmuch-pick-next-matching-message)\r
+>      (define-key map "p" 'notmuch-pick-prev-matching-message)\r
+> @@ -849,6 +856,7 @@ Complete list of currently available key bindings:\r
+>  \r
+>    (interactive)\r
+>    (kill-all-local-variables)\r
+> +  (setq notmuch-buffer-refresh-function #'notmuch-pick-refresh-view)\r
+>    (use-local-map notmuch-pick-mode-map)\r
+>    (setq major-mode 'notmuch-pick-mode\r
+>      mode-name "notmuch-pick")\r