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

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

[elpa] externals/gnugo 443903e 249/357: [gnugo int] Drop abstraction: pr


From: Stefan Monnier
Subject: [elpa] externals/gnugo 443903e 249/357: [gnugo int] Drop abstraction: pretty
Date: Sun, 29 Nov 2020 14:51:32 -0500 (EST)

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

    [gnugo int] Drop abstraction: pretty
    
    * packages/gnugo/gnugo.el (gnugo-move-history pretty):
    Delete internal func.
    (gnugo-move-history next): Revert to pre-‘pretty’ code.
    (gnugo-move-history): For ‘bpos’ RSEL, convert search
    condition from two negated string comparisons to one
    "normal CC" position detection, and delay ‘as-pos’
    call to rv computation.
---
 gnugo.el | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index ac0d79b..f0c9dda 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -742,9 +742,8 @@ For all other values of RSEL, do nothing and return nil."
                              (funcall as-pos x)))
          (remem () (setq node (pop mem)
                          mprop (gnugo--move-prop node)))
-         (pretty () (setq move (as-pos-maybe (cdr mprop))))
          (next (byp) (when (remem)
-                       (pretty)
+                       (setq move (as-pos-maybe (cdr mprop)))
                        (push (if byp
                                  (format "%s%s" move (car mprop))
                                move)
@@ -761,12 +760,13 @@ For all other values of RSEL, do nothing and return nil."
         (`cadr  (nn) (car (nn)))
         (`two (nn) (nn) acc)
         (`bpos (loop with prop = (gnugo--prop<-color color)
+                     while mem
                      when (and (remem)
                                (eq prop (car mprop))
-                               (pretty)
-                               (not (string= "resign" move))
-                               (not (gnugo--passp move)))
-                     return move))
+                               (setq move (cdr mprop))
+                               ;; i.e., "normal CC" position
+                               (= 2 (length move)))
+                     return (funcall as-pos move)))
         (_ nil)))))
 
 (define-derived-mode gnugo-frolic-mode special-mode "GNUGO Frolic"



reply via email to

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