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

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

[elpa] externals/gnugo 891a97a 177/357: [gnugo int] Add abstraction: gnu


From: Stefan Monnier
Subject: [elpa] externals/gnugo 891a97a 177/357: [gnugo int] Add abstraction: gnugo--decorate
Date: Sun, 29 Nov 2020 14:51:16 -0500 (EST)

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

    [gnugo int] Add abstraction: gnugo--decorate
    
    * packages/gnugo/gnugo.el (gnugo--decorate): New defsubst.
    (gnugo-note): Use ‘gnugo--decorate’.
---
 gnugo.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnugo.el b/gnugo.el
index ced9868..cb122ef 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1174,6 +1174,10 @@ This fails if the monkey is on the current branch
                                  (substring pos 1))))))
         (format "%c%c" one two)))))
 
+(defsubst gnugo--decorate (node alist)
+  ;; NB: ALIST should not have :B or :W keys.
+  (setcdr (last node) alist))
+
 (defun gnugo-note (property value &optional mogrifyp)
   (when mogrifyp
     (let ((as-cc (gnugo--as-cc-func)))
@@ -1252,7 +1256,7 @@ This fails if the monkey is on the current branch
              (push fruit mem)
              (aset ends bidx mem)))
           (setf (aref monkey 0) mem))
-      (setcdr (last tip) fruit))))
+      (gnugo--decorate tip fruit))))
 
 (defun gnugo-close-game (end-time resign)
   (gnugo-put :game-end-time end-time)



reply via email to

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