diff options
| -rw-r--r-- | lisp/play/gomoku.el | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lisp/play/gomoku.el b/lisp/play/gomoku.el index 61b67aeb70d..0a45885b875 100644 --- a/lisp/play/gomoku.el +++ b/lisp/play/gomoku.el | |||
| @@ -781,7 +781,7 @@ Use \\[describe-mode] for more info." | |||
| 781 | 781 | ||
| 782 | (defun gomoku-emacs-plays () | 782 | (defun gomoku-emacs-plays () |
| 783 | "Compute Emacs next move and play it." | 783 | "Compute Emacs next move and play it." |
| 784 | (interactive) | 784 | (interactive nil gomoku-mode) |
| 785 | (gomoku-switch-to-window) | 785 | (gomoku-switch-to-window) |
| 786 | (cond | 786 | (cond |
| 787 | (gomoku-emacs-is-computing | 787 | (gomoku-emacs-is-computing |
| @@ -814,7 +814,7 @@ Use \\[describe-mode] for more info." | |||
| 814 | ;; pixels, event's (X . Y) is a character's top-left corner. | 814 | ;; pixels, event's (X . Y) is a character's top-left corner. |
| 815 | (defun gomoku-click (click) | 815 | (defun gomoku-click (click) |
| 816 | "Position at the square where you click." | 816 | "Position at the square where you click." |
| 817 | (interactive "e") | 817 | (interactive "e" gomoku-mode) |
| 818 | (and (windowp (posn-window (setq click (event-end click)))) | 818 | (and (windowp (posn-window (setq click (event-end click)))) |
| 819 | (numberp (posn-point click)) | 819 | (numberp (posn-point click)) |
| 820 | (select-window (posn-window click)) | 820 | (select-window (posn-window click)) |
| @@ -843,7 +843,7 @@ Use \\[describe-mode] for more info." | |||
| 843 | 843 | ||
| 844 | (defun gomoku-mouse-play (click) | 844 | (defun gomoku-mouse-play (click) |
| 845 | "Play at the square where you click." | 845 | "Play at the square where you click." |
| 846 | (interactive "e") | 846 | (interactive "e" gomoku-mode) |
| 847 | (if (gomoku-click click) | 847 | (if (gomoku-click click) |
| 848 | (gomoku-human-plays))) | 848 | (gomoku-human-plays))) |
| 849 | 849 | ||
| @@ -851,7 +851,7 @@ Use \\[describe-mode] for more info." | |||
| 851 | "Signal to the Gomoku program that you have played. | 851 | "Signal to the Gomoku program that you have played. |
| 852 | You must have put the cursor on the square where you want to play. | 852 | You must have put the cursor on the square where you want to play. |
| 853 | If the game is finished, this command requests for another game." | 853 | If the game is finished, this command requests for another game." |
| 854 | (interactive) | 854 | (interactive nil gomoku-mode) |
| 855 | (gomoku-switch-to-window) | 855 | (gomoku-switch-to-window) |
| 856 | (cond | 856 | (cond |
| 857 | (gomoku-emacs-is-computing | 857 | (gomoku-emacs-is-computing |
| @@ -879,7 +879,7 @@ If the game is finished, this command requests for another game." | |||
| 879 | 879 | ||
| 880 | (defun gomoku-human-takes-back () | 880 | (defun gomoku-human-takes-back () |
| 881 | "Signal to the Gomoku program that you wish to take back your last move." | 881 | "Signal to the Gomoku program that you wish to take back your last move." |
| 882 | (interactive) | 882 | (interactive nil gomoku-mode) |
| 883 | (gomoku-switch-to-window) | 883 | (gomoku-switch-to-window) |
| 884 | (cond | 884 | (cond |
| 885 | (gomoku-emacs-is-computing | 885 | (gomoku-emacs-is-computing |
| @@ -903,7 +903,7 @@ If the game is finished, this command requests for another game." | |||
| 903 | 903 | ||
| 904 | (defun gomoku-human-resigns () | 904 | (defun gomoku-human-resigns () |
| 905 | "Signal to the Gomoku program that you may want to resign." | 905 | "Signal to the Gomoku program that you may want to resign." |
| 906 | (interactive) | 906 | (interactive nil gomoku-mode) |
| 907 | (gomoku-switch-to-window) | 907 | (gomoku-switch-to-window) |
| 908 | (cond | 908 | (cond |
| 909 | (gomoku-emacs-is-computing | 909 | (gomoku-emacs-is-computing |
| @@ -1161,20 +1161,20 @@ If the game is finished, this command requests for another game." | |||
| 1161 | ;; the screen. | 1161 | ;; the screen. |
| 1162 | (defun gomoku-move-right () | 1162 | (defun gomoku-move-right () |
| 1163 | "Move point right one column on the Gomoku board." | 1163 | "Move point right one column on the Gomoku board." |
| 1164 | (interactive) | 1164 | (interactive nil gomoku-mode) |
| 1165 | (when (< (gomoku-point-x) gomoku-board-width) | 1165 | (when (< (gomoku-point-x) gomoku-board-width) |
| 1166 | (forward-char gomoku-square-width))) | 1166 | (forward-char gomoku-square-width))) |
| 1167 | 1167 | ||
| 1168 | (defun gomoku-move-left () | 1168 | (defun gomoku-move-left () |
| 1169 | "Move point left one column on the Gomoku board." | 1169 | "Move point left one column on the Gomoku board." |
| 1170 | (interactive) | 1170 | (interactive nil gomoku-mode) |
| 1171 | (when (> (gomoku-point-x) 1) | 1171 | (when (> (gomoku-point-x) 1) |
| 1172 | (backward-char gomoku-square-width))) | 1172 | (backward-char gomoku-square-width))) |
| 1173 | 1173 | ||
| 1174 | ;; previous-line and next-line don't work right with intangible newlines | 1174 | ;; previous-line and next-line don't work right with intangible newlines |
| 1175 | (defun gomoku-move-down () | 1175 | (defun gomoku-move-down () |
| 1176 | "Move point down one row on the Gomoku board." | 1176 | "Move point down one row on the Gomoku board." |
| 1177 | (interactive) | 1177 | (interactive nil gomoku-mode) |
| 1178 | (when (< (gomoku-point-y) gomoku-board-height) | 1178 | (when (< (gomoku-point-y) gomoku-board-height) |
| 1179 | (let ((column (current-column))) | 1179 | (let ((column (current-column))) |
| 1180 | (forward-line gomoku-square-height) | 1180 | (forward-line gomoku-square-height) |
| @@ -1182,7 +1182,7 @@ If the game is finished, this command requests for another game." | |||
| 1182 | 1182 | ||
| 1183 | (defun gomoku-move-up () | 1183 | (defun gomoku-move-up () |
| 1184 | "Move point up one row on the Gomoku board." | 1184 | "Move point up one row on the Gomoku board." |
| 1185 | (interactive) | 1185 | (interactive nil gomoku-mode) |
| 1186 | (when (> (gomoku-point-y) 1) | 1186 | (when (> (gomoku-point-y) 1) |
| 1187 | (let ((column (current-column))) | 1187 | (let ((column (current-column))) |
| 1188 | (forward-line (- gomoku-square-height)) | 1188 | (forward-line (- gomoku-square-height)) |
| @@ -1190,36 +1190,36 @@ If the game is finished, this command requests for another game." | |||
| 1190 | 1190 | ||
| 1191 | (defun gomoku-move-ne () | 1191 | (defun gomoku-move-ne () |
| 1192 | "Move point North East on the Gomoku board." | 1192 | "Move point North East on the Gomoku board." |
| 1193 | (interactive) | 1193 | (interactive nil gomoku-mode) |
| 1194 | (gomoku-move-up) | 1194 | (gomoku-move-up) |
| 1195 | (gomoku-move-right)) | 1195 | (gomoku-move-right)) |
| 1196 | 1196 | ||
| 1197 | (defun gomoku-move-se () | 1197 | (defun gomoku-move-se () |
| 1198 | "Move point South East on the Gomoku board." | 1198 | "Move point South East on the Gomoku board." |
| 1199 | (interactive) | 1199 | (interactive nil gomoku-mode) |
| 1200 | (gomoku-move-down) | 1200 | (gomoku-move-down) |
| 1201 | (gomoku-move-right)) | 1201 | (gomoku-move-right)) |
| 1202 | 1202 | ||
| 1203 | (defun gomoku-move-nw () | 1203 | (defun gomoku-move-nw () |
| 1204 | "Move point North West on the Gomoku board." | 1204 | "Move point North West on the Gomoku board." |
| 1205 | (interactive) | 1205 | (interactive nil gomoku-mode) |
| 1206 | (gomoku-move-up) | 1206 | (gomoku-move-up) |
| 1207 | (gomoku-move-left)) | 1207 | (gomoku-move-left)) |
| 1208 | 1208 | ||
| 1209 | (defun gomoku-move-sw () | 1209 | (defun gomoku-move-sw () |
| 1210 | "Move point South West on the Gomoku board." | 1210 | "Move point South West on the Gomoku board." |
| 1211 | (interactive) | 1211 | (interactive nil gomoku-mode) |
| 1212 | (gomoku-move-down) | 1212 | (gomoku-move-down) |
| 1213 | (gomoku-move-left)) | 1213 | (gomoku-move-left)) |
| 1214 | 1214 | ||
| 1215 | (defun gomoku-beginning-of-line () | 1215 | (defun gomoku-beginning-of-line () |
| 1216 | "Move point to first square on the Gomoku board row." | 1216 | "Move point to first square on the Gomoku board row." |
| 1217 | (interactive) | 1217 | (interactive nil gomoku-mode) |
| 1218 | (move-to-column gomoku-x-offset)) | 1218 | (move-to-column gomoku-x-offset)) |
| 1219 | 1219 | ||
| 1220 | (defun gomoku-end-of-line () | 1220 | (defun gomoku-end-of-line () |
| 1221 | "Move point to last square on the Gomoku board row." | 1221 | "Move point to last square on the Gomoku board row." |
| 1222 | (interactive) | 1222 | (interactive nil gomoku-mode) |
| 1223 | (move-to-column (+ gomoku-x-offset | 1223 | (move-to-column (+ gomoku-x-offset |
| 1224 | (* gomoku-square-width (1- gomoku-board-width))))) | 1224 | (* gomoku-square-width (1- gomoku-board-width))))) |
| 1225 | 1225 | ||