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

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

[elpa] externals/gnugo d6f3956 089/357: [gnugo int] Decruft: Infer MOVEP


From: Stefan Monnier
Subject: [elpa] externals/gnugo d6f3956 089/357: [gnugo int] Decruft: Infer MOVEP from PROPERTY.
Date: Sun, 29 Nov 2020 14:50:55 -0500 (EST)

branch: externals/gnugo
commit d6f395684d3014a87e3dcb73d34cfe107e50b881
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo int] Decruft: Infer MOVEP from PROPERTY.
    
    * packages/gnugo/gnugo.el (gnugo-note):
    Don't take optional arg MOVEP; instead, infer that
    the operation is a move if PROPERTY is ‘:B’ or ‘:W’.
    (gnugo-push-move): Update call to ‘gnugo-note’.
---
 gnugo.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index e2d9fa0..bc5b2e9 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -681,7 +681,7 @@ For all other values of RSEL, do nothing and return nil."
   (while (gnugo-board-buffer-p)
     (bury-buffer)))
 
-(defun gnugo-note (property value &optional movep mogrifyp)
+(defun gnugo-note (property value &optional mogrifyp)
   (when mogrifyp
     (let ((sz (gnugo-get :SZ)))
       (cl-labels
@@ -698,7 +698,7 @@ For all other values of RSEL, do nothing and return nil."
   (let* ((fruit (list (cons property value)))
          (monkey (gnugo-get :monkey))
          (loc (aref monkey 0)))
-    (if movep
+    (if (memq property '(:B :W))
         (let ((mem (aref monkey 1)))
           ;; todo: do variation check/merge/branch here.
           (setcdr loc (list fruit))
@@ -773,7 +773,7 @@ For all other values of RSEL, do nothing and return nil."
     (gnugo-put :last-mover color)
     (when userp
       (gnugo-put :last-user-bpos (and (not passp) (not resignp) move)))
-    (gnugo-note (if (string= "black" color) :B :W) move t (not resignp))
+    (gnugo-note (if (string= "black" color) :B :W) move (not resignp))
     (when resignp
       (gnugo-note :EV "resignation"))
     (when start



reply via email to

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