[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 31/51: [gnugo int] Add abstraction: gnugo--unclose-game
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 31/51: [gnugo int] Add abstraction: gnugo--unclose-game |
Date: |
Mon, 24 Feb 2014 12:30:23 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit d5a79924ce4314f21a59dbfca333b66be563d816
Author: Thien-Thi Nguyen <address@hidden>
Date: Thu Feb 13 12:29:19 2014 +0100
[gnugo int] Add abstraction: gnugo--unclose-game
* packages/gnugo/gnugo.el (gnugo--unclose-game): New func.
(gnugo-magic-undo): Use it.
(boardsize, clear_board, fixed_handicap):
Likewise, in the value of the ‘:post-thunk’ property.
---
packages/gnugo/gnugo.el | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 593aba2..8777864 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -695,6 +695,19 @@ For all other values of RSEL, do nothing and return nil."
`((live ,@live)
(dead ,@dead))))))
+(defun gnugo--unclose-game ()
+ (dolist (prop '(:game-over ; all those in -close-game
+ :scoring-seed
+ :game-end-time))
+ (gnugo-put prop nil))
+ (let* ((root (car (gnugo-get :sgf-gametree)))
+ (cur (assq :RE root)))
+ (when cur
+ (assert (not (eq cur (car root))) nil
+ ":RE at head of root node: %S"
+ root)
+ (delq cur root))))
+
(defun gnugo-push-move (userp move)
(let* ((color (gnugo-get (if userp :user-color :gnugo-color)))
(start (gnugo-get :waiting-start))
@@ -1325,7 +1338,7 @@ turn to play. Optional second arg NOALT non-nil inhibits
this."
(error "%s not occupied by %s" pos u)))))
(t (error "Bad spec: %S" spec)))
(when (gnugo-get :game-over)
- (gnugo-put :game-over nil))
+ (gnugo--unclose-game))
(while (not (funcall done))
(setq ans (cdr (gnugo-synchronous-send/return "undo")))
(unless (= ?= (aref ans 0))
@@ -1904,7 +1917,7 @@ starting a new one. See `gnugo-board-mode' documentation
for more info."
fixed_handicap)
:output :discard
:post-thunk (lambda ()
- (gnugo-put :game-over nil)
+ (gnugo--unclose-game)
(gnugo-put :last-mover nil)
(gnugo-refresh t)))
- [elpa] 28/51: [gnugo int] Drop leading "*" in docstrings., (continued)
- [elpa] 28/51: [gnugo int] Drop leading "*" in docstrings., Thien-Thi Nguyen, 2014/02/24
- [elpa] 26/51: [gnugo] Give names and docstr ings to ‘lambda’ commands., Thien-Thi Nguyen, 2014/02/24
- [elpa] 38/51: [gnugo] Fix bug: Relax sync regexp., Thien-Thi Nguyen, 2014/02/24
- [elpa] 39/51: [gnugo] Don't show underscore in group-animation message., Thien-Thi Nguyen, 2014/02/24
- [elpa] 36/51: [gnugo int] Revamp gnugo-{put, get} doc / indentation decl., Thien-Thi Nguyen, 2014/02/24
- [elpa] 37/51: [gnugo maint] Update "next" in HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 32/51: [gnugo] Use ‘user-erro r’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 02/51: Import gnugo.el from ttn-pers-elisp 1.59., Thien-Thi Nguyen, 2014/02/24
- [elpa] 40/51: [gnugo] Use special constructs for keybindings in docstrings., Thien-Thi Nguyen, 2014/02/24
- [elpa] 21/51: [gnugo gtp int] Use :post-thunk instead of :post-hook., Thien-Thi Nguyen, 2014/02/24
- [elpa] 31/51: [gnugo int] Add abstraction: gnugo--unclose-game,
Thien-Thi Nguyen <=
- [elpa] 45/51: [gnugo] New command: ‘ A’ (gnugo-switch-to-another), Thien-Thi Nguyen, 2014/02/24
- [elpa] 42/51: [gnugo int] Use internal macros more., Thien-Thi Nguyen, 2014/02/24
- [elpa] 46/51: [gnugo] New command: ‘ _’ and ‘M-_’ (gnugo-boss-is-near), Thien-Thi Nguyen, 2014/02/24
- [elpa] 43/51: [gnugo maint] Update HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 50/51: [gnugo maint] Update NEWS, HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 41/51: [gnugo] Make proc-status change mode-line elem more informative., Thien-Thi Nguyen, 2014/02/24
- [elpa] 47/51: [gnugo maint] Update NEWS; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 48/51: [gnugo] Fix bug: Compute grid spacing using offset math., Thien-Thi Nguyen, 2014/02/24
- [elpa] 49/51: [gnugo] Rename var to ‘gnugo-inhibit-refresh’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 51/51: [gnugo] Release: 2.3.0, Thien-Thi Nguyen, 2014/02/24