]> git.eshelyaron.com Git - emacs.git/commitdiff
Move mouse key bindings to gametree-mode-map
authorStefan Kangas <stefan@marxist.se>
Sat, 25 Dec 2021 04:02:59 +0000 (05:02 +0100)
committerStefan Kangas <stefan@marxist.se>
Sat, 25 Dec 2021 04:04:33 +0000 (05:04 +0100)
* lisp/play/gametree.el (gametree-mode-map): Move mouse key
bindings here.

lisp/play/gametree.el

index cc9a6b7a4f0726a1ff4127d986f8e146f0c4e77c..ff4b97d884c4a6fb790b592f952f2f13c716b6e5 100644 (file)
@@ -554,7 +554,32 @@ buffer, it is replaced by the new value.  See the documentation for
     (gametree-hack-file-layout))
   nil)
 
+\f
+;;;; Mouse commands
+
+(defun gametree-mouse-break-line-here (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (gametree-break-line-here))
+
+(defun gametree-mouse-show-children-and-entry (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (gametree-show-children-and-entry))
+
+(defun gametree-mouse-show-subtree (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (outline-show-subtree))
+
+(defun gametree-mouse-hide-subtree (event)
+  (interactive "e")
+  (mouse-set-point event)
+  (outline-hide-subtree))
+
+\f
 ;;;; Key bindings
+
 (defvar gametree-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map "\C-c\C-j" 'gametree-break-line-here)
@@ -566,6 +591,14 @@ buffer, it is replaced by the new value.  See the documentation for
     (define-key map "\C-c\C-y" 'gametree-save-and-hack-layout)
     (define-key map "\C-c;" 'gametree-insert-score)
     (define-key map "\C-c^" 'gametree-compute-and-insert-score)
+    (define-key map [M-down-mouse-2 M-mouse-2]
+                #'gametree-mouse-break-line-here)
+    (define-key map [S-down-mouse-1 S-mouse-1]
+                #'gametree-mouse-show-children-and-entry)
+    (define-key map [S-down-mouse-2 S-mouse-2]
+                #'gametree-mouse-show-subtree)
+    (define-key map [S-down-mouse-3 S-mouse-3]
+                #'gametree-mouse-hide-subtree)
     map))
 
 (define-derived-mode gametree-mode outline-mode "GameTree"
@@ -577,32 +610,6 @@ shogi, etc.) players, it is a slightly modified version of Outline mode.
   (auto-fill-mode 0)
   (add-hook 'write-contents-functions 'gametree-save-and-hack-layout nil t))
 
-;;;; Goodies for mousing users
-(defun gametree-mouse-break-line-here (event)
-  (interactive "e")
-  (mouse-set-point event)
-  (gametree-break-line-here))
-(defun gametree-mouse-show-children-and-entry (event)
-  (interactive "e")
-  (mouse-set-point event)
-  (gametree-show-children-and-entry))
-(defun gametree-mouse-show-subtree (event)
-  (interactive "e")
-  (mouse-set-point event)
-  (outline-show-subtree))
-(defun gametree-mouse-hide-subtree (event)
-  (interactive "e")
-  (mouse-set-point event)
-  (outline-hide-subtree))
-(define-key gametree-mode-map [M-down-mouse-2 M-mouse-2]
-  'gametree-mouse-break-line-here)
-(define-key gametree-mode-map [S-down-mouse-1 S-mouse-1]
-  'gametree-mouse-show-children-and-entry)
-(define-key gametree-mode-map [S-down-mouse-2 S-mouse-2]
-  'gametree-mouse-show-subtree)
-(define-key gametree-mode-map [S-down-mouse-3 S-mouse-3]
-  'gametree-mouse-hide-subtree)
-
 (provide 'gametree)
 
 ;;; gametree.el ends here