[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/01: [gnugo int] Use ‘loop ’ instead of ‘mapc’ + ‘apply’.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/01: [gnugo int] Use ‘loop ’ instead of ‘mapc’ + ‘apply’. |
Date: |
Wed, 19 Mar 2014 08:13:08 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit 37bcd5c7274fdeaeb7e18b64a51146e18c12488a
Author: Thien-Thi Nguyen <address@hidden>
Date: Wed Mar 19 09:17:11 2014 +0100
[gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’.
* packages/gnugo/gnugo.el (gnugo-board-mode): ...here.
---
packages/gnugo/gnugo.el | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 2d68780..4448877 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1777,22 +1777,22 @@ In this mode, keys do not self insert.
(gnugo-put :sgf-collection (list tree))
(gnugo-put :monkey (vector tree nil 0)))
(gnugo--SZ! board-size)
- (let ((g-blackp (string= "white" user-color)))
- (mapc (lambda (x) (apply 'gnugo-note x))
- `((:SZ ,board-size)
- (:DT ,(format-time-string "%Y-%m-%d"))
- (:RU ,(if (string-match "--chinese-rules" args)
- "Chinese"
- "Japanese"))
- (:AP ("gnugo.el" . ,gnugo-version))
- (:KM ,komi)
- (,(if g-blackp :PW :PB) ,(user-full-name))
- (,(if g-blackp :PB :PW) ,(concat "GNU Go "
- (gnugo-query "version")))
- ,@(when (not (zerop handicap))
- `((:HA ,handicap)
- (:AB ,(gnugo-lsquery "fixed_handicap %d" handicap)
- nil t)))))))
+ (loop with gb = (gnugo--blackp (gnugo-other user-color))
+ for (property value &optional mogrifyp) in
+ `((:SZ ,board-size)
+ (:DT ,(format-time-string "%Y-%m-%d"))
+ (:RU ,(if (string-match "--chinese-rules" args)
+ "Chinese"
+ "Japanese"))
+ (:AP ("gnugo.el" . ,gnugo-version))
+ (:KM ,komi)
+ (,(if gb :PW :PB) ,(user-full-name))
+ (,(if gb :PB :PW) ,(concat "GNU Go " (gnugo-query "version")))
+ ,@(when (not (zerop handicap))
+ `((:HA ,handicap)
+ (:AB ,(gnugo-lsquery "fixed_handicap %d" handicap)
+ t))))
+ do (gnugo-note property value mogrifyp)))
(gnugo-put :waiting-start (current-time))
(gnugo-put :hmul 1)
(gnugo-put :wmul 1)