]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Move ?, q, s, m, =, and G to the common keymap
authorAustin Clements <amdragon@MIT.EDU>
Tue, 3 Sep 2013 21:45:25 +0000 (17:45 -0400)
committerDavid Bremner <bremner@debian.org>
Tue, 10 Sep 2013 11:07:38 +0000 (08:07 -0300)
The only user-visible effect of this should be that "G" now works in
show mode (previously it was unbound for no apparent reason).

This shared keymap gives us one place to put global commands, which
both forces us to think about what commands should be global, and
ensures their bindings can't diverge (like the missing "G" in show).

emacs/notmuch-hello.el
emacs/notmuch-lib.el
emacs/notmuch-show.el
emacs/notmuch.el

index 46baf559c237a83dba02057d18b1dde386fa1969..55c416ac5e9f328f9523cb44c928c2248f2a13b1 100644 (file)
@@ -525,13 +525,7 @@ Such a list can be computed with `notmuch-hello-query-counts'."
     (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)
-    (define-key map "q" 'notmuch-kill-this-buffer)
-    (define-key map "=" 'notmuch-refresh-this-buffer)
-    (define-key map "G" 'notmuch-poll-and-refresh-this-buffer)
     (define-key map (kbd "<C-tab>") 'widget-backward)
-    (define-key map "m" 'notmuch-mua-new-mail)
-    (define-key map "s" 'notmuch-search)
     map)
   "Keymap for \"notmuch hello\" buffers.")
 (fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
index 2bf1d2f69ccec3516fdf2a8f9838764db385ae16..58f3313d0bb92102bb1841fa3320ead9e68f36d7 100644 (file)
@@ -130,6 +130,12 @@ For example, if you wanted to remove an \"inbox\" tag and add an
 
 (defvar notmuch-common-keymap
   (let ((map (make-sparse-keymap)))
+    (define-key map "?" 'notmuch-help)
+    (define-key map "q" 'notmuch-kill-this-buffer)
+    (define-key map "s" 'notmuch-search)
+    (define-key map "m" 'notmuch-mua-new-mail)
+    (define-key map "=" 'notmuch-refresh-this-buffer)
+    (define-key map "G" 'notmuch-poll-and-refresh-this-buffer)
     map)
   "Keymap shared by all notmuch modes.")
 
index 53ccc39d1e91486f79c68a1407ec6750134fed65..5d7e24b20f8b0b84fefbabb77221d137de919760 100644 (file)
@@ -1244,14 +1244,10 @@ 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 "<C-tab>") 'widget-backward)
        (define-key map (kbd "M-TAB") 'notmuch-show-previous-button)
        (define-key map (kbd "<backtab>") 'notmuch-show-previous-button)
        (define-key map (kbd "TAB") 'notmuch-show-next-button)
-       (define-key map "s" 'notmuch-search)
-       (define-key map "m" 'notmuch-mua-new-mail)
        (define-key map "f" 'notmuch-show-forward-message)
        (define-key map "r" 'notmuch-show-reply-sender)
        (define-key map "R" 'notmuch-show-reply)
@@ -1259,7 +1255,6 @@ reset based on the original query."
        (define-key map "w" 'notmuch-show-save-attachments)
        (define-key map "V" 'notmuch-show-view-raw-message)
        (define-key map "c" 'notmuch-show-stash-map)
-       (define-key map "=" 'notmuch-refresh-this-buffer)
        (define-key map "h" 'notmuch-show-toggle-visibility-headers)
        (define-key map "*" 'notmuch-show-tag-all)
        (define-key map "-" 'notmuch-show-remove-tag)
index e098bd7bb1b98a8a3d700b2ce8ed69c7452707da..4de6229d0c6471660b094e815da831d2d7e33566 100644 (file)
@@ -199,8 +199,6 @@ 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)
     (define-key map (kbd "<DEL>") 'notmuch-search-scroll-down)
     (define-key map "b" 'notmuch-search-scroll-down)
@@ -211,12 +209,8 @@ first line of documentation for the bound function."
     (define-key map "n" 'notmuch-search-next-thread)
     (define-key map "r" 'notmuch-search-reply-to-thread-sender)
     (define-key map "R" 'notmuch-search-reply-to-thread)
-    (define-key map "m" 'notmuch-mua-new-mail)
-    (define-key map "s" 'notmuch-search)
     (define-key map "o" 'notmuch-search-toggle-order)
     (define-key map "c" 'notmuch-search-stash-map)
-    (define-key map "=" 'notmuch-refresh-this-buffer)
-    (define-key map "G" 'notmuch-poll-and-refresh-this-buffer)
     (define-key map "t" 'notmuch-search-filter-by-tag)
     (define-key map "f" 'notmuch-search-filter)
     (define-key map [mouse-1] 'notmuch-search-show-thread)