emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 02/02: [gnugo] Handle ‘(gnugo -move-history 'two)’.


From: Thien-Thi Nguyen
Subject: [elpa] 02/02: [gnugo] Handle ‘(gnugo -move-history 'two)’.
Date: Tue, 18 Mar 2014 10:57:10 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 3577567a8593317eb7e28d55262b077be7f171f8
Author: Thien-Thi Nguyen <address@hidden>
Date:   Tue Mar 18 12:01:10 2014 +0100

    [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’.
---
 packages/gnugo/NEWS     |    1 +
 packages/gnugo/gnugo.el |   12 +++---------
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/packages/gnugo/NEWS b/packages/gnugo/NEWS
index 7ca102b..799cb56 100644
--- a/packages/gnugo/NEWS
+++ b/packages/gnugo/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/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 65d5e32..dda41b2 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]