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

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

[elpa] externals/gnugo 5ca5b0a 097/357: [gnugo int] Add abstraction: gnu


From: Stefan Monnier
Subject: [elpa] externals/gnugo 5ca5b0a 097/357: [gnugo int] Add abstraction: gnugo--nodep
Date: Sun, 29 Nov 2020 14:50:57 -0500 (EST)

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

    [gnugo int] Add abstraction: gnugo--nodep
    
    * packages/gnugo/gnugo.el (gnugo--nodep): New defsubst.
    (gnugo-read-sgf-file, gnugo/sgf-write-file): Use it.
---
 gnugo.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 053d8aa..4ff6621 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1293,6 +1293,9 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
                          "as before"
                        "NOTE: this is a switch!")))
 
+(defsubst gnugo--nodep (x)
+  (keywordp (caar x)))
+
 (defsubst gnugo--SZ! (size)
   (gnugo-put :SZ size))
 
@@ -1342,7 +1345,7 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
       (while (setq node (car loc))
         ;; A gametree must have at least one node prior to the first
         ;; sub-gametree (if any), so we need check the CAR only once.
-        (unless (symbolp (caar node))
+        (unless (gnugo--nodep node)
           (setq loc node
                 node (car loc)))
         (when (setq play (or (assq :B node)
@@ -2250,7 +2253,7 @@ starting a new one.  See `gnugo-board-mode' documentation 
for more info."
                  ;; requires this somewhat-funky border search.
                  (let (x subtrees)
                    (while (setq x (pop tree))
-                     (if (symbolp (caar x))
+                     (if (gnugo--nodep x)
                          (>>node x)
                        (setq
                         ;; Add back the first subtree.



reply via email to

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