From: Mark Walters Date: Sun, 15 Sep 2013 08:17:48 +0000 (+0100) Subject: [PATCH] contrib: pick: use global keymap X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ca946a802e7b5f46c584ed685cadc3a6a773fcef;p=notmuch-archives.git [PATCH] contrib: pick: use global keymap --- diff --git a/b4/b3c05340cc935067104b417ea2c74803a6f8d6 b/b4/b3c05340cc935067104b417ea2c74803a6f8d6 new file mode 100644 index 000000000..a146e4d4a --- /dev/null +++ b/b4/b3c05340cc935067104b417ea2c74803a6f8d6 @@ -0,0 +1,125 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DB2CC431FAF + for ; Sun, 15 Sep 2013 01:18:00 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id Y4Cs6SPBF8bq for ; + Sun, 15 Sep 2013 01:17:55 -0700 (PDT) +Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com + [74.125.82.54]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 2BE9B431FAE for ; Sun, 15 Sep 2013 01:17:55 -0700 + (PDT) +Received: by mail-wg0-f54.google.com with SMTP id m15so2629184wgh.9 + for ; Sun, 15 Sep 2013 01:17:54 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=ivHaA+d1Qq6hEI8HmgSErJSboTZoky+SABe4IRludcc=; + b=n4jiyxXSI90dUZgnjaToZ8iPDx74L4Lu8DNFgNw/z+7WOAm0XeuxfQATD+FXRN0FLF + PK+a5Ym18JgJNDMrCLwF7At0NIMhl/EvL95/QbVlQ2Jxfevqilmga0PjunZr7//oLntV + oAHvRCgAfv1Nhevui8FmF1S+qfrufSdX2u75aYrGgZBuaNRLcjOiQnrbXXXQqGFRl03q + X2ikSC+No2YPpvnQbZMQFJGWXKC4MCxMgsjpamg6tLWK2TrsCZepgr6/rR145a1iq/Ck + s5TDcH/WX3ek1IP2jsvYwyrVaJRU1V/oO/cOYfDaIl9RGghVDPfqA6XvggB9DL5GBW+b + OIig== +X-Received: by 10.194.22.97 with SMTP id c1mr44781wjf.43.1379233074017; + Sun, 15 Sep 2013 01:17:54 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id gp9sm14873159wib.8.1969.12.31.16.00.00 + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sun, 15 Sep 2013 01:17:53 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH] contrib: pick: use global keymap +Date: Sun, 15 Sep 2013 09:17:48 +0100 +Message-Id: <1379233068-9626-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 15 Sep 2013 08:18:01 -0000 + +Austin recently introduced a new global keymap. This makes pick use +this global map. + +In most cases pick needs to override this global map because +it wants to close the message pane before doing the action. However, +this documents the over-rides and makes it less likely that the pick +bindings will get out of sync with the main bindings. +--- + contrib/notmuch-pick/notmuch-pick.el | 16 ++++++++++++---- + 1 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el +index cba9549..01ca4bd 100644 +--- a/contrib/notmuch-pick/notmuch-pick.el ++++ b/contrib/notmuch-pick/notmuch-pick.el +@@ -230,6 +230,17 @@ FUNC." + + (defvar notmuch-pick-mode-map + (let ((map (make-sparse-keymap))) ++ (set-keymap-parent map notmuch-common-keymap) ++ ;; The following override the global keymap. ++ ;; Override because we want to close message pane first. ++ (define-key map "?" (notmuch-pick-close-message-pane-and #'notmuch-help)) ++ ;; Override because we first close message pane and then close pick buffer. ++ (define-key map "q" 'notmuch-pick-quit) ++ ;; Override because we close message pane after the search query is entered. ++ (define-key map "s" 'notmuch-pick-to-search) ++ ;; Override because we want to close message pane first. ++ (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail)) ++ + (define-key map [mouse-1] 'notmuch-pick-show-message) + ;; these use notmuch-show functions directly + (define-key map "|" 'notmuch-show-pipe-message) +@@ -244,20 +255,16 @@ FUNC." + (define-key map "e" (notmuch-pick-to-message-pane #'notmuch-pick-button-activate)) + + ;; bindings from show (or elsewhere) but we close the message pane first. +- (define-key map "m" (notmuch-pick-close-message-pane-and #'notmuch-mua-new-mail)) + (define-key map "f" (notmuch-pick-close-message-pane-and #'notmuch-show-forward-message)) + (define-key map "r" (notmuch-pick-close-message-pane-and #'notmuch-show-reply-sender)) + (define-key map "R" (notmuch-pick-close-message-pane-and #'notmuch-show-reply)) + (define-key map "V" (notmuch-pick-close-message-pane-and #'notmuch-show-view-raw-message)) +- (define-key map "?" (notmuch-pick-close-message-pane-and #'notmuch-help)) + + ;; The main pick bindings +- (define-key map "q" 'notmuch-pick-quit) + (define-key map "x" 'notmuch-pick-quit) + (define-key map "A" 'notmuch-pick-archive-thread) + (define-key map "a" 'notmuch-pick-archive-message-then-next) + (define-key map "=" 'notmuch-pick-refresh-view) +- (define-key map "s" 'notmuch-pick-to-search) + (define-key map "z" 'notmuch-pick-to-pick) + (define-key map "n" 'notmuch-pick-next-matching-message) + (define-key map "p" 'notmuch-pick-prev-matching-message) +@@ -849,6 +856,7 @@ Complete list of currently available key bindings: + + (interactive) + (kill-all-local-variables) ++ (setq notmuch-buffer-refresh-function #'notmuch-pick-refresh-view) + (use-local-map notmuch-pick-mode-map) + (setq major-mode 'notmuch-pick-mode + mode-name "notmuch-pick") +-- +1.7.9.1 +