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 56A934196F4 for ; Thu, 13 May 2010 19:46:45 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] autolearn=ham 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 DL5rxnRTLs+G for ; Thu, 13 May 2010 19:46:31 -0700 (PDT) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id CA9AE4196F0 for ; Thu, 13 May 2010 19:46:31 -0700 (PDT) X-AuditID: 1209190c-b7bd2ae000005d05-c7-4becb98740f1 Received: from mailhub-auth-3.mit.edu (MAILHUB-AUTH-3.MIT.EDU [18.9.21.43]) by dmz-mailsec-scanner-1.mit.edu (Symantec Brightmail Gateway) with SMTP id A3.44.23813.789BCEB4; Thu, 13 May 2010 22:46:31 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id o4E2kVb9030879; Thu, 13 May 2010 22:46:31 -0400 Received: from PHANATIQUE.MIT.EDU (c-71-192-160-118.hsd1.nh.comcast.net [71.192.160.118]) (authenticated bits=0) (User authenticated as nelhage@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id o4E2kTjc023163 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 13 May 2010 22:46:30 -0400 (EDT) From: Nelson Elhage To: notmuch@notmuchmail.org Subject: [PATCH] emacs: notmuch-hello: Use our own keymap. Date: Thu, 13 May 2010 22:46:15 -0400 Message-Id: <1273805175-6660-1-git-send-email-nelhage@ksplice.com> X-Mailer: git-send-email 1.6.6.30.g1e6fd X-Brightmail-Tracker: AAAAARQpM2I= 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: Fri, 14 May 2010 02:46:45 -0000 Previously, we were adding our bindings directly to `widget-keymap', resulting in them being shared by anything else that used that keymap. --- emacs/notmuch-hello.el | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 6a1c56e..56906c8 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -70,6 +70,19 @@ (defvar notmuch-hello-recent-searches nil) +(defvar notmuch-hello-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map widget-keymap) + (define-key map "=" 'notmuch-hello-update) + (define-key map "G" 'notmuch-hello-poll-and-update) + (define-key map "m" 'notmuch-mua-mail) + (define-key map "q" '(lambda () (interactive) (kill-buffer (current-buffer)))) + (define-key map "s" 'notmuch-hello-goto-search) + (define-key map "v" '(lambda () (interactive) + (message "notmuch version %s" (notmuch-version)))) + map) + "Keymap for notmuch-hello buffer") + (defun notmuch-hello-remember-search (search) (if (not (member search notmuch-hello-recent-searches)) (push search notmuch-hello-recent-searches)) @@ -397,14 +410,7 @@ diagonal." (let ((fill-column (- (window-width) notmuch-hello-indent))) (center-region start (point)))) - (use-local-map widget-keymap) - (local-set-key "=" 'notmuch-hello-update) - (local-set-key "G" 'notmuch-hello-poll-and-update) - (local-set-key "m" 'notmuch-mua-mail) - (local-set-key "q" '(lambda () (interactive) (kill-buffer (current-buffer)))) - (local-set-key "s" 'notmuch-hello-goto-search) - (local-set-key "v" '(lambda () (interactive) - (message "notmuch version %s" (notmuch-version)))) + (use-local-map notmuch-hello-mode-map) (widget-setup) -- 1.6.6.30.g1e6fd