[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/03: [gnugo frolic int] Regularize keymap decl + init.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/03: [gnugo frolic int] Regularize keymap decl + init. |
Date: |
Wed, 09 Apr 2014 12:17:14 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 0e5ee233370266ffd1c2605987b212b46f8e0778
Author: Thien-Thi Nguyen <address@hidden>
Date: Wed Apr 9 09:19:27 2014 +0200
[gnugo frolic int] Regularize keymap decl + init.
* packages/gnugo/gnugo.el (gnugo-frolic-mode-map): New defvar.
<top-level>: Conditionalize ‘gnugo-frolic-mode-map’
init; use same idiom as for ‘gnugo-board-mode-map’.
---
packages/gnugo/gnugo.el | 32 +++++++++++++++++++-------------
1 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 7bab636..f042e7a 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -102,6 +102,9 @@ http://www.gnu.org/software/gnugo")
(defvar gnugo-board-mode-map nil
"Keymap for GNUGO Board mode.")
+(defvar gnugo-frolic-mode-map nil
+ "Keymap for GNUGO Frolic mode.")
+
(defvar gnugo-board-mode-hook nil
"Hook run when entering GNUGO Board mode.")
@@ -2305,19 +2308,22 @@ starting a new one. See `gnugo-board-mode'
documentation for more info."
;;;---------------------------------------------------------------------------
;;; Load-time actions
-(mapc (lambda (pair)
- (define-key gnugo-frolic-mode-map (car pair) (cdr pair)))
- '(("q" . gnugo-frolic-quit)
- ("C" . gnugo-frolic-quit) ; like ‘View-kill-and-leave’
- ("\C-b" . gnugo-frolic-backward-branch)
- ("\C-f" . gnugo-frolic-forward-branch)
- ("j" . gnugo-frolic-exchange-left)
- ("J" . gnugo-frolic-rotate-left)
- ("k" . gnugo-frolic-exchange-right)
- ("K" . gnugo-frolic-rotate-right)
- ("\C-m" . gnugo-frolic-set-as-main-line)
- ("\C-\M-p" . gnugo-frolic-prune-branch)
- ("o" . gnugo-frolic-return-to-origin)))
+(unless gnugo-frolic-mode-map
+ (setq gnugo-frolic-mode-map (make-sparse-keymap))
+ (suppress-keymap gnugo-frolic-mode-map)
+ (mapc (lambda (pair)
+ (define-key gnugo-frolic-mode-map (car pair) (cdr pair)))
+ '(("q" . gnugo-frolic-quit)
+ ("C" . gnugo-frolic-quit) ; like ‘View-kill-and-leave’
+ ("\C-b" . gnugo-frolic-backward-branch)
+ ("\C-f" . gnugo-frolic-forward-branch)
+ ("j" . gnugo-frolic-exchange-left)
+ ("J" . gnugo-frolic-rotate-left)
+ ("k" . gnugo-frolic-exchange-right)
+ ("K" . gnugo-frolic-rotate-right)
+ ("\C-m" . gnugo-frolic-set-as-main-line)
+ ("\C-\M-p" . gnugo-frolic-prune-branch)
+ ("o" . gnugo-frolic-return-to-origin))))
(unless gnugo-board-mode-map
(setq gnugo-board-mode-map (make-sparse-keymap))