From: Mark Walters Date: Thu, 12 Nov 2015 11:02:19 +0000 (+0000) Subject: emacs: hello: fix accidental modification of widget-keymap X-Git-Url: http://rtime.felk.cvut.cz/gitweb/notmuch.git/commitdiff_plain/3270eea39f048bc72df1f16bfa1300d7db169a1b 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. --- 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.