aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Walters <markwalters1009@gmail.com>2015-11-12 11:02:19 +0000
committerDavid Bremner <david@tethera.net>2015-11-23 08:36:52 -0400
commit3270eea39f048bc72df1f16bfa1300d7db169a1b (patch)
treef119a095554d28f2495e86ece3b97bbefa8a29f6
parent1432a4f946e0f236179b53ac71d03764da725f33 (diff)
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.
-rw-r--r--emacs/notmuch-hello.el8
1 files 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.