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