[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 622b1eb 084/357: [gnugo] Handle ‘(gnugo-move-his
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 622b1eb 084/357: [gnugo] Handle ‘(gnugo-move-history 'two)’. |
Date: |
Sun, 29 Nov 2020 14:50:54 -0500 (EST) |
branch: externals/gnugo
commit 622b1eb355832d137c82edc90eabe10fa3c77e85
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Handle ‘(gnugo-move-history 'two)’.
* packages/gnugo/gnugo.el (gnugo-move-history):
If RSEL is ‘two’, return the last two moves as a list.
(gnugo-read-sgf-file): Use ‘gnugo-move-history’.
---
NEWS | 1 +
gnugo.el | 12 +++---------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/NEWS b/NEWS
index 7ca102b..799cb56 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Hint: (highlight-phrase
"[0-9][.][0-9][.][0-9]+\\|[0-9]+[.][.][0-9]+"
- handle subtrees on write
- 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’
- performance improvements
- 2.3.1 | 2014-02-27
diff --git a/gnugo.el b/gnugo.el
index 65d5e32..dda41b2 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -633,7 +633,7 @@ interactively with a prefix arg (i.e., RSEL is `(4)'),
display
similarly, but suffix with the mover (either \":B\" or \":W\").
If RSEL is the symbol `car' return the most-recent move; if
`cadr', the next-to-most-recent move; if `count' the number of
-moves thus far.
+moves thus far; if `two' the last two moves as a list, oldest last.
For all other values of RSEL, do nothing and return nil."
(interactive "P")
@@ -670,6 +670,7 @@ For all other values of RSEL, do nothing and return nil."
(`car (car (nn)))
(`cadr (nn) (car (nn)))
(`count (aref monkey 2))
+ (`two (nn) (nn) acc)
(_ nil)))))
(defun gnugo-boss-is-near ()
@@ -1343,14 +1344,7 @@ If FILENAME already exists, Emacs confirms that you wish
to overwrite it."
(setq game-over
(or (cdr (assq :RE (car tree)))
(and (cdr mem)
- (equal '("tt" "tt")
- (let ((order (if (string= "black" wait)
- '(:B :W)
- '(:W :B))))
- (mapcar (lambda (pk)
- (cdr (assq (funcall pk order)
- (car (funcall pk mem)))))
- '(car cadr))))
+ (equal '("PASS" "PASS") (gnugo-move-history 'two))
'two-passes))))
(gnugo-put :monkey
(vector (or (car mem) tree)
- [elpa] externals/gnugo 2d4c9ad 046/357: [gnugo] New command: ‘_’ and ‘M-_’ (gnugo-boss-is-near), (continued)
- [elpa] externals/gnugo 2d4c9ad 046/357: [gnugo] New command: ‘_’ and ‘M-_’ (gnugo-boss-is-near), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 02c55b7 054/357: [gnugo] Release: 2.3.1, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c479509 044/357: [gnugo] Bind ‘DEL’ to ‘gnugo-undo-two-moves’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9748703 060/357: [gnugo int] Elide single-use local var., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6573d16 065/357: [gnugo int] Add abstraction: gnugo--compare-strings, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a949e26 071/357: [gnugo int] Rename arg from SWITCH to ME-NEXT., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 558d778 072/357: [gnugo] Fix bug: Handle property value type ‘none’ normally., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9469952 075/357: fixup! [gnugo sgf] Move gratuitous newline from after to before (sub)trees., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4f96ca6 076/357: [gnugo sgf int] Add abstractions: seek, seek-into, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 98414ca 086/357: [gnugo int] Add abstractions: gnugo{--root-node, /sgf-root-node}, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 622b1eb 084/357: [gnugo] Handle ‘(gnugo-move-history 'two)’.,
Stefan Monnier <=
- [elpa] externals/gnugo 06586e9 093/357: [gnugo] Fix bug: Don't bother translating move "resign"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7f380e4 006/357: [gnugo] Presume working time-date.el., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 74b839a 066/357: [gnugo int] Use ‘incf’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ad774f4 074/357: [gnugo sgf] Move gratuitous newline from after to before (sub)trees., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a44da1b 073/357: [gnugo sgf int] Add abstractions: >>prop, >>node, >>tree, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a7f01be 083/357: [gnugo int] Add abstraction: nn, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a07cf7c 109/357: [gnugo int] Use ‘gnugo--as-pos-func’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 71f163d 111/357: [gnugo int] Support growth also off of main line., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0b08017 114/357: [gnugo int] Avoid double list-reverse., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 08c3378 116/357: [gnugo int] Use ‘gnugo/sgf-create’ more., Stefan Monnier, 2020/11/29