--- /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 D3D96429E45\r
+ for <notmuch@notmuchmail.org>; Tue, 3 Sep 2013 14:45:57 -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 fveB9nO3PtuG for <notmuch@notmuchmail.org>;\r
+ Tue, 3 Sep 2013 14:45:53 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu\r
+ [18.7.68.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 8F7EC431E62\r
+ for <notmuch@notmuchmail.org>; Tue, 3 Sep 2013 14:45:34 -0700 (PDT)\r
+X-AuditID: 12074422-b7ef78e000000935-00-5226587ca042\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+ by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id 2B.AC.02357.C7856225; Tue, 3 Sep 2013 17:45:32 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+ by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id r83LjU0f023522; \r
+ Tue, 3 Sep 2013 17:45:30 -0400\r
+Received: from drake.dyndns.org (26-4-182.dynamic.csail.mit.edu [18.26.4.182])\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 r83LjRj3026860\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Tue, 3 Sep 2013 17:45:28 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1VGyPe-0004yC-WA; Tue, 03 Sep 2013 17:45:26 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 8/9] emacs: Define a common shared keymap for all of\r
+ notmuch\r
+Date: Tue, 3 Sep 2013 17:45:24 -0400\r
+Message-Id: <1378244725-18846-9-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1378244725-18846-1-git-send-email-amdragon@mit.edu>\r
+References: <1378244725-18846-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFjrGIsWRmVeSWpSXmKPExsUixCmqrVsToRZkcOaJlkXTdGeL1XN5LK7f\r
+ nMnswOyxc9Zddo9b91+zezxbdYs5gDmKyyYlNSezLLVI3y6BK2Pms/+MBTPFKt5PPsDSwNgm\r
+ 1MXIySEhYCLx+PEURghbTOLCvfVsXYxcHEIC+xgl9i68xAzhbGCUONF9FipzmEniyKzNUM5c\r
+ RolZFy6wgvSzCWhIbNu/HGyWiIC0xM67s8HizALREkcuz2ADsYUF/CX2PrwJFmcRUJV48foc\r
+ WJxXwEHi0fV57BB3KEp0P5sAFucUcJToXbAILC4EVNO08jL7BEb+BYwMqxhlU3KrdHMTM3OK\r
+ U5N1i5MT8/JSi3RN9XIzS/RSU0o3MYKCi91FaQfjz4NKhxgFOBiVeHgZHqkGCbEmlhVX5h5i\r
+ lORgUhLlPRKqFiTEl5SfUpmRWJwRX1Sak1p8iFGCg1lJhDfBByjHm5JYWZValA+TkuZgURLn\r
+ ffb0bKCQQHpiSWp2ampBahFMVoaDQ0mCtzwcqFGwKDU9tSItM6cEIc3EwQkynAdo+M8wkOHF\r
+ BYm5xZnpEPlTjIpS4rzzQZoFQBIZpXlwvbDof8UoDvSKMG8PSBUPMHHAdb8CGswENDjtsyrI\r
+ 4JJEhJRUA6Ogi/uiVW/nTSxIPebB4rRfUUGR9/BxEb5/868abb4scFTya9HPCO6Du947H75z\r
+ +fWls97hz7LeXXRaG9VsvHJtzaq89xahV059aheb/+Hgnt+fF7ZZvG+XittecSMnQHdLxsvv\r
+ Py8vNPhX/S55t8ruE1sPszJ8DOY30n5woyujQGDWJOWrOVc2K7EUZyQaajEXFScCAATGEMbZ AgAA\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: Tue, 03 Sep 2013 21:45:58 -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 6a7b884..46baf55 100644\r
+--- a/emacs/notmuch-hello.el\r
++++ b/emacs/notmuch-hello.el\r
+@@ -515,8 +515,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