From 2d162e62d970792911d87957234d4fede073104a Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 30 Aug 2013 12:25:56 +2000 Subject: [PATCH] [PATCH 8/9] emacs: Define a common shared keymap for all of notmuch --- ec/9a75c9d1dfe49d2c1fc5b105a71fd478bd80d3 | 145 ++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 ec/9a75c9d1dfe49d2c1fc5b105a71fd478bd80d3 diff --git a/ec/9a75c9d1dfe49d2c1fc5b105a71fd478bd80d3 b/ec/9a75c9d1dfe49d2c1fc5b105a71fd478bd80d3 new file mode 100644 index 000000000..f8e3cc437 --- /dev/null +++ b/ec/9a75c9d1dfe49d2c1fc5b105a71fd478bd80d3 @@ -0,0 +1,145 @@ +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 1C097431FD0 + for ; Thu, 29 Aug 2013 09:26:26 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[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 JVa3NjFTpRmf for ; + Thu, 29 Aug 2013 09:26:22 -0700 (PDT) +Received: from dmz-mailsec-scanner-4.mit.edu (dmz-mailsec-scanner-4.mit.edu + [18.9.25.15]) + by olra.theworths.org (Postfix) with ESMTP id ACA77431FD6 + for ; Thu, 29 Aug 2013 09:26:08 -0700 (PDT) +X-AuditID: 1209190f-b7fa58e000000953-3f-521f761eb429 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP + id EB.4E.02387.E167F125; Thu, 29 Aug 2013 12:26:06 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r7TGQ3om025415; + Thu, 29 Aug 2013 12:26:04 -0400 +Received: from drake.dyndns.org + (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com + [216.15.114.40]) (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r7TGQ1NU015004 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Thu, 29 Aug 2013 12:26:02 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1VF52n-0007X2-69; Thu, 29 Aug 2013 12:26:01 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH 8/9] emacs: Define a common shared keymap for all of notmuch +Date: Thu, 29 Aug 2013 12:25:56 -0400 +Message-Id: <1377793557-28878-9-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <1377793557-28878-1-git-send-email-amdragon@mit.edu> +References: <1377793557-28878-1-git-send-email-amdragon@mit.edu> +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFtrEIsWRmVeSWpSXmKPExsUixG6noitXJh9ksOyUqsX1mzOZHRg9nq26 + xRzAGMVlk5Kak1mWWqRvl8CVserpacaCmWIVqx8tZmxgbBPqYuTkkBAwkWj994MNwhaTuHBv + PZDNxSEksI9R4veTgywQzkZGiUe3lrJDOHeYJP61T2CGcOYySky6sZsZpJ9NQENi2/7ljCC2 + iIC0xM67s1m7GDk4mAXUJP50qYCEhQV8JLpungIrYRFQlfg6oxOshFfAQeLJBxGIKxQlup9N + ALuIU8BRov/uWxYQWwio5M/Fp+wTGPkXMDKsYpRNya3SzU3MzClOTdYtTk7My0st0jXRy80s + 0UtNKd3ECAoaTkn+HYzfDiodYhTgYFTi4e0IlA8SYk0sK67MPcQoycGkJMobWAIU4kvKT6nM + SCzOiC8qzUktPsQowcGsJML7lhMox5uSWFmVWpQPk5LmYFES53329GygkEB6YklqdmpqQWoR + TFaGg0NJgvc+yFDBotT01Iq0zJwShDQTByfIcB6g4f9AaniLCxJzizPTIfKnGBWlxHl/giQE + QBIZpXlwvbCofsUoDvSKMK9kKVAVDzAhwHW/AhrMBDR4Qr4cyOCSRISUVAPjtFAxTgm/mIDC + p7HiTxQVvms37z/SuNDxt16jyXVJnvKH6UpiU40OK3Nw3PzocYFP892NuK0Tbxs+F79kdWnF + Nlfp1raWjl3Cut8eOQTu+VSmeuC3wY8VKzTWaHSEHfrQznZGYcpx8azpqWdVl2UtOZm6f9HG + 7SdPvbPe9uvs4r6HXb+ub5BmUGIpzkg01GIuKk4EAOp8ylPFAgAA +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: Thu, 29 Aug 2013 16:26:26 -0000 + +This defines a single, currently empty keymap that all other notmuch +mode maps inherit from. +--- + emacs/notmuch-hello.el | 10 ++++++++-- + emacs/notmuch-lib.el | 5 +++++ + emacs/notmuch-show.el | 1 + + emacs/notmuch.el | 1 + + 4 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el +index 147e2dd..7a31d73 100644 +--- a/emacs/notmuch-hello.el ++++ b/emacs/notmuch-hello.el +@@ -510,8 +510,14 @@ Such a list can be computed with `notmuch-hello-query-counts'." + + + (defvar notmuch-hello-mode-map +- (let ((map (make-sparse-keymap))) +- (set-keymap-parent map widget-keymap) ++ (let ((map (if (fboundp 'make-composed-keymap) ++ ;; Inherit both widget-keymap and notmuch-common-keymap ++ (make-composed-keymap widget-keymap) ++ ;; Before Emacs 24, keymaps didn't support multiple ++ ;; inheritance,, so just copy the widget keymap since ++ ;; it's unlikely to change. ++ (copy-keymap widget-keymap)))) ++ (set-keymap-parent map notmuch-common-keymap) + (define-key map "v" (lambda () "Display the notmuch version" (interactive) + (message "notmuch version %s" (notmuch-version)))) + (define-key map "?" 'notmuch-help) +diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el +index 782badb..2bf1d2f 100644 +--- a/emacs/notmuch-lib.el ++++ b/emacs/notmuch-lib.el +@@ -128,6 +128,11 @@ For example, if you wanted to remove an \"inbox\" tag and add an + :group 'notmuch-search + :group 'notmuch-show) + ++(defvar notmuch-common-keymap ++ (let ((map (make-sparse-keymap))) ++ map) ++ "Keymap shared by all notmuch modes.") ++ + ;; By default clicking on a button does not select the window + ;; containing the button (as opposed to clicking on a widget which + ;; does). This means that the button action is then executed in the +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 380df66..9f67340 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -1264,6 +1264,7 @@ reset based on the original query." + + (defvar notmuch-show-mode-map + (let ((map (make-sparse-keymap))) ++ (set-keymap-parent map notmuch-common-keymap) + (define-key map "?" 'notmuch-help) + (define-key map "q" 'notmuch-kill-this-buffer) + (define-key map (kbd "") 'widget-backward) +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 0304096..e098bd7 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -198,6 +198,7 @@ first line of documentation for the bound function." + + (defvar notmuch-search-mode-map + (let ((map (make-sparse-keymap))) ++ (set-keymap-parent map notmuch-common-keymap) + (define-key map "?" 'notmuch-help) + (define-key map "q" 'notmuch-kill-this-buffer) + (define-key map "x" 'notmuch-kill-this-buffer) +-- +1.7.10.4 + -- 2.26.2