[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo c78119f 191/357: [gnugo int] Add abstraction: gnu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo c78119f 191/357: [gnugo int] Add abstraction: gnugo--finish-move |
Date: |
Sun, 29 Nov 2020 14:51:19 -0500 (EST) |
branch: externals/gnugo
commit c78119f1b9e1138f06dbb604eebbc3792a608d4b
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Add abstraction: gnugo--finish-move
* packages/gnugo/gnugo.el (gnugo--finish-move): New func.
(gnugo-get-move-insertion-filter, gnugo-move, gnugo-pass): Use it.
---
gnugo.el | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 4991040..b15e0bb 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1546,6 +1546,11 @@ its move."
(when (setq last (gnugo-get :last-user-bpos))
(gnugo-goto-pos last))))
+(defun gnugo--finish-move (buf)
+ (run-hooks 'gnugo-post-move-hook)
+ (with-current-buffer buf
+ (gnugo-refresh)))
+
;;;---------------------------------------------------------------------------
;;; Game play actions
@@ -1560,10 +1565,7 @@ its move."
(gnugo-put :waiting nil)
(gnugo-push-move (string= color (gnugo-get :user-color))
pos-or-pass)
- (let ((buf (current-buffer)))
- (run-hooks 'gnugo-post-move-hook)
- (with-current-buffer buf
- (gnugo-refresh))))))))
+ (gnugo--finish-move (current-buffer)))))))
(defun gnugo-get-move (color)
(gnugo-put :waiting color)
@@ -1608,9 +1610,8 @@ To start a game try M-x gnugo."
(let* ((buf (current-buffer))
(pos (gnugo-position)))
(gnugo-push-move t pos) ; value always nil for non-pass move
- (run-hooks 'gnugo-post-move-hook)
+ (gnugo--finish-move buf)
(with-current-buffer buf
- (gnugo-refresh)
(gnugo-get-move (gnugo-get :gnugo-color)))))
(defun gnugo-mouse-move (e)
@@ -1628,9 +1629,7 @@ To start a game try M-x gnugo."
(gnugo-gate t)
(let ((donep (gnugo-push-move t "PASS"))
(buf (current-buffer)))
- (run-hooks 'gnugo-post-move-hook)
- (with-current-buffer buf
- (gnugo-refresh))
+ (gnugo--finish-move buf)
(unless donep
(with-current-buffer buf
(gnugo-get-move (gnugo-get :gnugo-color))))))
- [elpa] externals/gnugo a35692a 106/357: [gnugo int] Add abstraction: gnugo--move-prop, (continued)
- [elpa] externals/gnugo a35692a 106/357: [gnugo int] Add abstraction: gnugo--move-prop, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6ee477d 112/357: [gnugo int] Remove abstraction: continue-on, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 58d4d6d 117/357: [gnugo int] Add abstractions: gnugo--{, set-}tree-ends, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f107328 122/357: [gnugo int] Expand gametree IR: MNUM, KIDS, ROOT., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c3b3c3f 123/357: [gnugo int] Fix bug: Detect case for KIDS addition correctly., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a63d31b 128/357: [gnugo int] Comment munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3a7f75e 132/357: [gnugo] Define "GNUGO Frolic" mode., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cb78651 138/357: [gnugo frolic] Add command to prune a branch., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7025924 156/357: [gnugo sgf] Fix bug: Add ‘\’-escapes on write., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e64f1ae 170/357: [gnugo frolic] Add previous/next move navigation commands., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c78119f 191/357: [gnugo int] Add abstraction: gnugo--finish-move,
Stefan Monnier <=
- [elpa] externals/gnugo a3d90aa 189/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5dcf9f6 185/357: [gnugo int] Add abstraction: gnugo--node-with-played-stone, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1367651 173/357: [gnugo int] Make ‘gnugo-gate’ slightly faster., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a4c246e 188/357: [gnugo frolic] Display "!" for comment; add as ‘help-echo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8203f46 194/357: [gnugo int] Centralize some constant strings., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b1f2856 183/357: [gnugo] Fix bug: Keep subproc informed of forced PASS., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3112192 056/357: [gnugo int] Streamline subproc (de-)marshalling., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 294bdc1 047/357: [gnugo maint] Update NEWS; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b5f47cb 059/357: [gnugo int] Use ‘pcase’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8cabdfa 042/357: [gnugo int] Use internal macros more., Stefan Monnier, 2020/11/29