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.
This commit is contained in:
Mark Walters 2015-11-12 11:02:19 +00:00 committed by David Bremner
parent 1432a4f946
commit 3270eea39f

View file

@ -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.