From 3c8de623457f3044114f65fa20f56cee92743b43 Mon Sep 17 00:00:00 2001 From: Chris Mann Date: Sat, 6 Sep 2008 18:58:16 +0930 Subject: [PATCH] * wesnoth-mode.el (wesnoth-mode-map): Modify the way in which the keymap is set to allow bindings from hooks to be used in conjunction with default bindings. --- wesnoth-mode.el | 60 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/wesnoth-mode.el b/wesnoth-mode.el index c15d8ab..9f732c0 100644 --- a/wesnoth-mode.el +++ b/wesnoth-mode.el @@ -141,37 +141,37 @@ indent the line." (defvar wesnoth-mode-hook nil) -(defvar wesnoth-mode-map () +(defvar wesnoth-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-\M-a" 'wesnoth-backward-element) + (define-key map "\C-\M-e" 'wesnoth-forward-element) + (define-key map "\C-c\C-m" 'wesnoth-jump-to-matching) + (define-key map "\C-cm" 'wesnoth-jump-to-matching) + (define-key map "\C-m" 'wesnoth-newline) + (define-key map "\C-j" 'wesnoth-newline-and-indent) + (define-key map "\C-c\C-c" 'wesnoth-check-structure) + (define-key map "\C-cc" 'wesnoth-check-structure) + (define-key map "\C-c\C-n" 'wesnoth-check-tag-names) + (define-key map "\C-cn" 'wesnoth-check-tag-names) + (define-key map "\C-c\C-e" 'wesnoth-insert-tag) + (define-key map "\C-ce" 'wesnoth-insert-tag) + (define-key map (kbd "C-c C-/") 'wesnoth-insert-missing-closing) + (define-key map (kbd "C-c /") 'wesnoth-insert-missing-closing) + ;; Menu + (define-key map [menu-bar wesnoth] + (cons "WML" (make-sparse-keymap "WML"))) + (define-key map [menu-bar wesnoth insert-tag] + '("Insert Tag" . wesnoth-insert-tag)) + (define-key map [menu-bar wesnoth check-names] + '("Check Tag Names" . wesnoth-check-tag-names)) + (define-key map [menu-bar wesnoth check-structure] + '("Check Structure" . wesnoth-check-structure)) + (define-key map [menu-bar wesnoth jump-to-matching] + '("Jump to Matching" . wesnoth-jump-to-matching)) + (define-key map [menu-bar wesnoth insert-missing-closing] + '("Insert Missing Tag" . wesnoth-insert-missing-closing)) + map) "Keymap used in wesnoth mode.") -(unless wesnoth-mode-map - (setq wesnoth-mode-map (make-sparse-keymap)) - (define-key wesnoth-mode-map "\C-\M-a" 'wesnoth-backward-element) - (define-key wesnoth-mode-map "\C-\M-e" 'wesnoth-forward-element) - (define-key wesnoth-mode-map "\C-c\C-m" 'wesnoth-jump-to-matching) - (define-key wesnoth-mode-map "\C-cm" 'wesnoth-jump-to-matching) - (define-key wesnoth-mode-map "\C-m" 'wesnoth-newline) - (define-key wesnoth-mode-map "\C-j" 'wesnoth-newline-and-indent) - (define-key wesnoth-mode-map "\C-c\C-c" 'wesnoth-check-structure) - (define-key wesnoth-mode-map "\C-cc" 'wesnoth-check-structure) - (define-key wesnoth-mode-map "\C-c\C-n" 'wesnoth-check-tag-names) - (define-key wesnoth-mode-map "\C-cn" 'wesnoth-check-tag-names) - (define-key wesnoth-mode-map "\C-c\C-e" 'wesnoth-insert-tag) - (define-key wesnoth-mode-map "\C-ce" 'wesnoth-insert-tag) - (define-key wesnoth-mode-map (kbd "C-c C-/") 'wesnoth-insert-missing-closing) - (define-key wesnoth-mode-map (kbd "C-c /") 'wesnoth-insert-missing-closing) - ;; Menu - (define-key wesnoth-mode-map [menu-bar wesnoth] - (cons "WML" (make-sparse-keymap "WML"))) - (define-key wesnoth-mode-map [menu-bar wesnoth insert-tag] - '("Insert Tag" . wesnoth-insert-tag)) - (define-key wesnoth-mode-map [menu-bar wesnoth check-names] - '("Check Tag Names" . wesnoth-check-tag-names)) - (define-key wesnoth-mode-map [menu-bar wesnoth check-structure] - '("Check Structure" . wesnoth-check-structure)) - (define-key wesnoth-mode-map [menu-bar wesnoth jump-to-matching] - '("Jump to Matching" . wesnoth-jump-to-matching)) - (define-key wesnoth-mode-map [menu-bar wesnoth insert-missing-closing] - '("Insert Missing Tag" . wesnoth-insert-missing-closing))) (defvar wesnoth-syntax-table (let ((wesnoth-syntax-table (make-syntax-table))) -- 2.11.4.GIT