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