(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)
(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"
(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