unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: notmuch-hello: Use our own keymap.
@ 2010-05-14  2:46 Nelson Elhage
  2010-05-14  2:58 ` sebastian
  0 siblings, 1 reply; 4+ messages in thread
From: Nelson Elhage @ 2010-05-14  2:46 UTC (permalink / raw)
  To: notmuch

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-14 16:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-14  2:46 [PATCH] emacs: notmuch-hello: Use our own keymap Nelson Elhage
2010-05-14  2:58 ` sebastian
2010-05-14  3:34   ` Nelson Elhage
2010-05-14 16:53     ` Sebastian Spaeth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).