[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 07/07: [gnugo int] Use cl-{plus,minus}p more.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 07/07: [gnugo int] Use cl-{plus,minus}p more. |
Date: |
Thu, 06 Feb 2014 10:39:45 +0000 |
ttn pushed a commit to branch ttn-gnugo
in repository elpa.
commit 7e99f01a16aa0b82013d1b2c3f3b5861b5fb678b
Author: Thien-Thi Nguyen <address@hidden>
Date: Thu Feb 6 11:05:33 2014 +0100
[gnugo int] Use cl-{plus,minus}p more.
* packages/gnugo/gnugo.el (gnugo-merge-showboard-results)
(gnugo-venerate, gnugo-refresh, gnugo-magic-undo)
(gnugo-board-mode, gnugo, GTP undo, GTP gg-undo):
Use ‘cl-plusp’ and ‘cl-minusp’ instead of comparison against 0.
---
packages/gnugo/ChangeLog | 9 +++++++++
packages/gnugo/gnugo.el | 19 ++++++++++---------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/packages/gnugo/ChangeLog b/packages/gnugo/ChangeLog
index 0cc3d17..b66e6c6 100644
--- a/packages/gnugo/ChangeLog
+++ b/packages/gnugo/ChangeLog
@@ -1,5 +1,14 @@
2014-02-06 Thien-Thi Nguyen <address@hidden>
+ [gnugo int] Use cl-{plus,minus}p more.
+
+ * gnugo.el (gnugo-merge-showboard-results)
+ (gnugo-venerate, gnugo-refresh, gnugo-magic-undo)
+ (gnugo-board-mode, gnugo, GTP undo, GTP gg-undo):
+ Use ‘cl-plusp’ and ‘cl-minusp’ instead of comparison against 0.
+
+2014-02-06 Thien-Thi Nguyen <address@hidden>
+
[gnugo int] Use ‘number-sequence’ more.
* gnugo.el (gnugo-animate-group):
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 12b7e88..5673360 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -539,7 +539,7 @@ a format string applied to the rest of the args."
(while (numberp (setq mis (compare-strings bef bef-start nil
aft aft-start nil)))
(setq aft-sync-backtrack nil
- inc (if (> 0 mis)
+ inc (if (cl-minusp mis)
(- (+ 1 mis))
(- mis 1))
bef-idx (+ bef-start inc)
@@ -733,7 +733,8 @@ For all other values of RSEL, do nothing and return nil."
(when (string-match "\\([0-9]+\\)\\s-+[0-9]+\"," s)
(setq start (match-end 0))
(string-to-number (match-string 1 s)))))
- (while (and (<= 0 ncolors) (string-match ",\n" s start))
+ (while (and (not (cl-minusp ncolors))
+ (string-match ",\n" s start))
(setq start (match-end 0)
ncolors (1- ncolors)))
(string-match "\"" s start)
@@ -745,7 +746,7 @@ For all other values of RSEL, do nothing and return nil."
(color-key (aref new sx))) ; blech, heuristic
(while (< sx lx)
(when (and (not (= color-key (aref new sx)))
- (< 0 (random 4)))
+ (cl-plusp (random 4)))
(aset new sx (aref bg-data sb)))
(incf sx)
(incf sb))
@@ -860,7 +861,7 @@ its move."
(if under10p 2 4)
0))
2.0)))
- (dolist (pair `((tpad . ,(if (and h (< 0 h))
+ (dolist (pair `((tpad . ,(if (and h (cl-plusp h))
`(display ,(make-string h 10))
'(invisible :nogrid)))
(gpad . (display
@@ -1303,7 +1304,7 @@ turn to play. Optional second arg NOALT non-nil inhibits
this."
(mem (aref monkey 1))
(count (aref monkey 2))
done ans)
- (cond ((and (numberp spec) (< 0 spec))
+ (cond ((and (numberp spec) (cl-plusp spec))
(setq n spec done (lambda () (zerop n))))
((string-match "^[a-z]" spec)
(let ((pos (upcase spec)))
@@ -1626,8 +1627,8 @@ In this mode, keys do not self insert. Default
keybindings:
(h (or (car gnugo-option-history) "")))
(when (string-match "--mode" o)
(error "Found \"--mode\" in `gnugo-program'"))
- (when (and o (< 0 (length o))
- h (< 0 (length o))
+ (when (and o (cl-plusp (length o))
+ h (cl-plusp (length o))
(or (< (length h) (length o))
(not (string= (substring h 0 (length o))
o))))
@@ -1736,7 +1737,7 @@ starting a new one. See `gnugo-board-mode' documentation
for more info."
acc))
(n (length all)))
(if (and (not new-game)
- (< 0 n)
+ (cl-plusp n)
(y-or-n-p (format "GNU Go game%s in progress, resume play? "
(if (= 1 n) "" "s"))))
;; resume
@@ -1887,7 +1888,7 @@ starting a new one. See `gnugo-board-mode' documentation
for more info."
(lambda (sel) (gnugo-magic-undo
(let (n)
(cond ((not sel) 1)
- ((< 0 (setq n (string-to-number (car sel)))) n)
+ ((cl-plusp (setq n (string-to-number (car sel))))
n)
(t (car sel)))))))))
(provide 'gnugo)
- [elpa] branch ttn-gnugo updated (defe1ee -> 7e99f01), Thien-Thi Nguyen, 2014/02/06
- [elpa] 01/07: [gnugo maint] Revamp "ChangeLog discipline" in HACKING; nfc., Thien-Thi Nguyen, 2014/02/06
- [elpa] 03/07: [gnugo gtp int] Use :post-thunk instead of :post-hook., Thien-Thi Nguyen, 2014/02/06
- [elpa] 04/07: [gnugo maint] Add .dir-locals.el file, link in HACKING; nfc., Thien-Thi Nguyen, 2014/02/06
- [elpa] 05/07: [gnugo int] Drop unused local var., Thien-Thi Nguyen, 2014/02/06
- [elpa] 07/07: [gnugo int] Use cl-{plus,minus}p more.,
Thien-Thi Nguyen <=
- [elpa] 06/07: [gnugo int] Use ‘numbe r-sequence’ more., Thien-Thi Nguyen, 2014/02/06
- [elpa] 02/07: [gnugo int] Avoid variable FO RMAT for ‘message’., Thien-Thi Nguyen, 2014/02/06