(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)
: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
(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)
(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)