[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo bf04735 094/357: [gnugo] Fix bug: Don't misuse S
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo bf04735 094/357: [gnugo] Fix bug: Don't misuse SGF prop ‘:EV’ for "resign" state. |
Date: |
Sun, 29 Nov 2020 14:50:57 -0500 (EST) |
branch: externals/gnugo
commit bf04735ebed0cad4c7c8f8dff2a6f808aa53bf96
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Fix bug: Don't misuse SGF prop ‘:EV’ for "resign" state.
* packages/gnugo/gnugo.el (gnugo-push-move): ...here.
(gnugo-display-final-score): Detect resignation
via ‘gnugo-move-history’; use ‘:last-mover’ directly.
---
NEWS | 1 +
gnugo.el | 8 ++------
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/NEWS b/NEWS
index f891f09..0726540 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,7 @@ Hint: (highlight-phrase
"[0-9][.][0-9][.][0-9]+\\|[0-9]+[.][.][0-9]+"
- don't special-case property value type ‘none’
- handle subtrees on write
- display "resign" as "resign" in move history (amazing!)
+ - avoid clobbering SGF property ‘EV’ on resignation
- new keybinding for ‘gnugo-undo-one-move’: M-u
- ‘gnugo-undo-one-move’ can optionally switch colors
- ‘gnugo-move-history’ returns last two moves w/ RSEL ‘two’
diff --git a/gnugo.el b/gnugo.el
index c60df4b..f52bf37 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -783,8 +783,6 @@ For all other values of RSEL, do nothing and return nil."
(when userp
(gnugo-put :last-user-bpos (and (not passp) (not resignp) move)))
(gnugo-note (if (gnugo--blackp color) :B :W) move (not resignp))
- (when resignp
- (gnugo-note :EV "resignation"))
(when start
(gnugo-put :last-waiting (cadr (time-subtract now start))))
(when donep
@@ -1490,10 +1488,8 @@ Also, add the `:RE' SGF property to the root node of the
game tree."
(sit-for 3)))
(let ((b= " Black = ")
(w= " White = ")
- (res (let* ((node (car (aref (gnugo-get :monkey) 0)))
- (event (and node (cdr (assq :EV node)))))
- (and event (string= "resignation" event)
- (if (assq :B node) "black" "white"))))
+ (res (when (string= "resign" (gnugo-move-history 'car))
+ (gnugo-get :last-mover)))
blurb result)
(if res
(setq blurb (list
- [elpa] externals/gnugo 5e4b5a8 051/357: [gnugo] Release: 2.3.0, (continued)
- [elpa] externals/gnugo 5e4b5a8 051/357: [gnugo] Release: 2.3.0, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 400e27d 069/357: [gnugo int] Add abstraction: gnugo--who-is-who, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3547cbe 080/357: [gnugo int] Add abstraction: gnugo--set-root-prop, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 11e545d 082/357: [gnugo int] Use ‘loop’ instead of ‘dolist’ + ‘destructuring-bind’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5eeb99b 087/357: [gnugo int] Use ‘incf’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7293802 088/357: [gnugo int] Use ‘setq’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 35b1551 091/357: [gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b5990a0 085/357: [gnugo int] Use ‘gnugo-treeroot’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f9668f0 090/357: [gnugo int] Add abstraction: gnugo--blackp, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c164c40 092/357: [gnugo int] Add abstraction: gnugo--passp, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bf04735 094/357: [gnugo] Fix bug: Don't misuse SGF prop ‘:EV’ for "resign" state.,
Stefan Monnier <=
- [elpa] externals/gnugo e036fed 096/357: [gnugo] Fix bug: On load, follow mainline through subtrees., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eaaa7c8 102/357: [gnugo int] Invert gametree IR to hang by the leaves., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ed11a74 101/357: [gnugo int] Embrace (NODE[...] [SUBTREE...]) IR, for now., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b7843bf 103/357: [gnugo maint] Move hi-lock hint from NEWS to HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ae888ba 105/357: [gnugo] Add command ‘gnugo-oops’ and keybinding., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2c5e356 107/357: [gnugo maint] Add some debugging aids to HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a708759 110/357: [gnugo int] Use ‘cl-labels’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a35f657 115/357: [gnugo] Support SGF[4] parsing from string data., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3d8db48 119/357: [gnugo] Declare dependency on ‘ascii-art-to-unicode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4b866c7 127/357: [gnugo int] Avoid lower move-num candidates in déjà-vu search., Stefan Monnier, 2020/11/29