From dca4e7cd5a73127b19f229d2c4110823863e32a1 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Tue, 12 Nov 2013 20:10:59 +0000 Subject: [PATCH] [PATCH v4 7/7] emacs: tree: use remap for the over-ridden global bindings --- c0/d5459544b25f836cfe1058fd30b2ae6650fe42 | 101 ++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 c0/d5459544b25f836cfe1058fd30b2ae6650fe42 diff --git a/c0/d5459544b25f836cfe1058fd30b2ae6650fe42 b/c0/d5459544b25f836cfe1058fd30b2ae6650fe42 new file mode 100644 index 000000000..fe37e9f94 --- /dev/null +++ b/c0/d5459544b25f836cfe1058fd30b2ae6650fe42 @@ -0,0 +1,101 @@ +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 AFC13431FD7 + for ; Tue, 12 Nov 2013 12:17:12 -0800 (PST) +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 JRWNHeaMowTY for ; + Tue, 12 Nov 2013 12:17:07 -0800 (PST) +Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com + [74.125.82.46]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 08C4D431FCF for ; Tue, 12 Nov 2013 12:17:06 -0800 + (PST) +Received: by mail-wg0-f46.google.com with SMTP id x12so2121579wgg.25 + for ; Tue, 12 Nov 2013 12:17:03 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=f4kWvHmYOseo5nf8oKQvCNywRigDgqsad7Dg87gy0Vo=; + b=XNvjHpfnUj6hD2Hoco+FYTqEauPY6zp7gLXmObpRzKV8TWDD0onzf5D8g7iOBwG7Sp + OaajZI2y9tdaDsTHBHW3RDE/n3+Eny3DiM2xSS7zVnHmBI2KPyMj/29zNWTDrl28+5/F + PYOkCLGzfhSzwJWs5dPFJEJvGjFHT6RvsFiFTOREKOst+qvJvct1zFFoLV5YEkuYC4V0 + OhaRTU3nnWSepFqiF1mC2dBXtesuFsXD1cRGo2rUhrt5j0wYk7bbSIk4KgDST+1bBOMu + PlemBTKgYm1fw9Kh6HkT2e1AJnD+BStzINfiCR/oDywutsq+jq97ulRC4Mgt4rlIL118 + smuA== +X-Received: by 10.180.83.194 with SMTP id s2mr18088685wiy.60.1384287081567; + Tue, 12 Nov 2013 12:11:21 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id + ey4sm48141160wic.11.2013.11.12.12.11.20 for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Tue, 12 Nov 2013 12:11:21 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v4 7/7] emacs: tree: use remap for the over-ridden global + bindings +Date: Tue, 12 Nov 2013 20:10:59 +0000 +Message-Id: <1384287059-3525-8-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com> +References: <1384287059-3525-1-git-send-email-markwalters1009@gmail.com> +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: Tue, 12 Nov 2013 20:17:12 -0000 + +Following a suggestion by Austin in id:20130915153642.GY1426@mit.edu +we use remap for the over-riding bindings in pick. This means that if +the user modifies the global keymap these modifications will happen in +the tree-view versions of them too. + +[tree-view overrides these to do things like close the message pane +before doing the action, so the functionality is very close to the +original common keymap function.] +--- + emacs/notmuch-tree.el | 8 ++++---- + 1 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el +index f13b41f..8d59e65 100644 +--- a/emacs/notmuch-tree.el ++++ b/emacs/notmuch-tree.el +@@ -220,13 +220,13 @@ FUNC." + (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-tree-close-message-pane-and #'notmuch-help)) ++ (define-key map [remap notmuch-help] (notmuch-tree-close-message-pane-and #'notmuch-help)) + ;; Override because we first close message pane and then close tree buffer. +- (define-key map "q" 'notmuch-tree-quit) ++ (define-key map [remap notmuch-kill-this-buffer] 'notmuch-tree-quit) + ;; Override because we close message pane after the search query is entered. +- (define-key map "s" 'notmuch-tree-to-search) ++ (define-key map [remap notmuch-search] 'notmuch-tree-to-search) + ;; Override because we want to close message pane first. +- (define-key map "m" (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail)) ++ (define-key map [remap notmuch-mua-new-mail] (notmuch-tree-close-message-pane-and #'notmuch-mua-new-mail)) + + ;; these use notmuch-show functions directly + (define-key map "|" 'notmuch-show-pipe-message) +-- +1.7.9.1 + -- 2.26.2