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

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

[elpa] externals/gnugo a4b96a1 024/357: [gnugo int] Use ‘number-sequenc


From: Stefan Monnier
Subject: [elpa] externals/gnugo a4b96a1 024/357: [gnugo int] Use ‘number-sequence’ more.
Date: Sun, 29 Nov 2020 14:50:39 -0500 (EST)

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

    [gnugo int] Use ‘number-sequence’ more.
    
    * packages/gnugo/gnugo.el (gnugo-animate-group):
    For image display ‘spec’ handling, don't map over
    an exploded string, ignoring the individual characters,
    and manually toggling the state; instead, map over an
    integer, using the number's divisibility by two to select.
---
 gnugo.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 0297ed2..12b7e88 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1055,12 +1055,11 @@ To start a game try M-x gnugo."
                           (let* ((yin (get-text-property (point) 'gnugo-yin))
                                  (yang (gnugo-yang (char-after)))
                                  (up (get (gnugo-yy yin yang t) 'display))
-                                 (dn (get (gnugo-yy yin yang) 'display))
-                                 flip-flop)
-                            (mapcar (lambda (c)
-                                      (if (setq flip-flop (not flip-flop))
+                                 (dn (get (gnugo-yy yin yang) 'display)))
+                            (mapcar (lambda (n)
+                                      (if (cl-oddp n)
                                           dn up))
-                                    (mapcar 'string-to-char spec))))
+                                    (number-sequence 1 (length spec)))))
                          (t spec))))
            (cell (list spec))
            (ovs (save-excursion



reply via email to

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