[Top][All Lists]

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

[elpa] master 7f1b6c8 1/6: [gnugo int] Add abstraction: gnugo--zonk-ovs

From: Thien-Thi Nguyen
Subject: [elpa] master 7f1b6c8 1/6: [gnugo int] Add abstraction: gnugo--zonk-ovs
Date: Tue, 14 Feb 2017 12:28:39 -0500 (EST)

branch: master
commit 7f1b6c8a612453fff0acbfb5558a6acba801af5f
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>

    [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’.
 packages/gnugo/gnugo.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 1503f72..f1f70ad 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/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]