From 3270eea39f048bc72df1f16bfa1300d7db169a1b Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Thu, 12 Nov 2015 11:02:19 +0000 Subject: [PATCH] emacs: hello: fix accidental modification of widget-keymap In emacs24 we use make-composed-keymap. It seems that if only a single map is specified then emacs just resuses it rather than creating a copy of it. Thus use make-sparse-keymap to force a copy. --- emacs/notmuch-hello.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 8bde808f..b42e0f24 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -652,8 +652,12 @@ with `notmuch-hello-query-counts'." (defvar notmuch-hello-mode-map (let ((map (if (fboundp 'make-composed-keymap) - ;; Inherit both widget-keymap and notmuch-common-keymap - (make-composed-keymap widget-keymap) + ;; Inherit both widget-keymap and + ;; notmuch-common-keymap. We have to use + ;; make-sparse-keymap to force this to be a new + ;; keymap (so that when we modify map it does not + ;; modify widget-keymap). + (make-composed-keymap (list (make-sparse-keymap) widget-keymap)) ;; Before Emacs 24, keymaps didn't support multiple ;; inheritance,, so just copy the widget keymap since ;; it's unlikely to change.