[Top][All Lists]

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

[elpa] externals/gnugo 1eb43f1 342/357: [gnugo int] Add abstraction: gnu

From: Stefan Monnier
Subject: [elpa] externals/gnugo 1eb43f1 342/357: [gnugo int] Add abstraction: gnugo--zonk-ovs
Date: Sun, 29 Nov 2020 14:51:53 -0500 (EST)

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

    [gnugo int] Add abstraction: gnugo--zonk-ovs
    * packages/gnugo/gnugo.el (gnugo--zonk-ovs): New defsubst.
    (gnugo-refresh, gnugo-animate-group): Use ‘gnugo--zonk-ovs’.
 gnugo.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 1503f72..f1f70ad 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1015,6 +1015,9 @@ For all other values of RSEL, do nothing and return nil."
                              (list :color-symbols
+(defsubst gnugo--zonk-ovs (ovs)
+  (mapc 'delete-overlay ovs))
 (defun gnugo-refresh (&optional nocache)
   "Update GNUGO Board buffer display.
 While a game is in progress, parenthesize the last-played stone (no parens
@@ -1035,14 +1038,14 @@ its move."
     (when (and nocache (not (gnugo-get :waiting)))
       ;; (search-forward "pall of death")
       (dolist (group (gnugo-aqr 'dead game-over))
-        (mapc 'delete-overlay (cdar group))
+        (gnugo--zonk-ovs (cdar group))
         (setcdr (car group) nil))
     ;; last move
     (when move
       (cl-destructuring-bind (l-ov . r-ov) (gnugo-get :paren-ov)
         (if (member move '("PASS" "resign"))
-            (mapc 'delete-overlay (list l-ov r-ov))
+            (gnugo--zonk-ovs (list l-ov r-ov))
           (let* ((p (gnugo-goto-pos move))
                  (hspec (gnugo-get :highlight-last-move-spec))
                  (display-value (nth 0 hspec))
@@ -1074,7 +1077,7 @@ its move."
                     (gnugo-aqr sel game-over))
                   '(live dead))
         (dolist (head (mapcar #'car live))
-          (mapc 'delete-overlay (cdr head))
+          (gnugo--zonk-ovs (cdr head))
           (setcdr head nil))
          for (head . positions) in dead
@@ -1411,7 +1414,7 @@ To start a game try M-x gnugo."
         ;; Force redisplay of overlays.
         (set-buffer-modified-p orig-b-m-p))
       (sit-for 5)
-      (mapc 'delete-overlay ovs)
+      (gnugo--zonk-ovs ovs)
 (defun gnugo-display-group-data (command buffer-name)

reply via email to

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