[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 25/51: [gnugo int] Use cl-{plus,minus}p more.
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 25/51: [gnugo int] Use cl-{plus,minus}p more. |
Date: |
Mon, 24 Feb 2014 12:30:21 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit f6b370512c97b0056a525ec345a8c61a134f33ae
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/gnugo.el | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
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] 07/51: [gnugo] Presume "modern" GNU Emacs., (continued)
- [elpa] 07/51: [gnugo] Presume "modern" GNU Emacs., Thien-Thi Nguyen, 2014/02/24
- [elpa] 06/51: [gnugo] Presume working time-date.el., Thien-Thi Nguyen, 2014/02/24
- [elpa] 19/51: [gnugo maint] Revamp "ChangeLog discipline" in HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 17/51: [gnugo] Indicate buffer not modified after save., Thien-Thi Nguyen, 2014/02/24
- [elpa] 20/51: [gnugo int] Avoid variable FO RMAT for ‘message’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 14/51: [gnugo int] Use ‘displ ay’ property more., Thien-Thi Nguyen, 2014/02/24
- [elpa] 15/51: [gnugo int] Use ‘(spli t-string STR SEP t)’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 23/51: [gnugo int] Drop unused local var., Thien-Thi Nguyen, 2014/02/24
- [elpa] 24/51: [gnugo int] Use ‘numbe r-sequence’ more., Thien-Thi Nguyen, 2014/02/24
- [elpa] 18/51: [gnugo maint] Update a musing item in HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 25/51: [gnugo int] Use cl-{plus,minus}p more.,
Thien-Thi Nguyen <=
- [elpa] 27/51: [gnugo int] Hang the sync-return-stash on the process object., Thien-Thi Nguyen, 2014/02/24
- [elpa] 22/51: [gnugo maint] Add .dir-locals.el file, link in HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 29/51: [gnugo] Indicate buffer not modified after load., Thien-Thi Nguyen, 2014/02/24
- [elpa] 30/51: [gnugo maint] Update NEWS file; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 34/51: [gnugo int] Use ‘set-p rocess-query-on-exit-flag’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 33/51: [gnugo int] Zonk unused local var., Thien-Thi Nguyen, 2014/02/24
- [elpa] 35/51: [gnugo int] Use ‘dolis t’ and ‘destructuring-bind’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 28/51: [gnugo int] Drop leading "*" in docstrings., Thien-Thi Nguyen, 2014/02/24
- [elpa] 26/51: [gnugo] Give names and docstr ings to ‘lambda’ commands., Thien-Thi Nguyen, 2014/02/24
- [elpa] 38/51: [gnugo] Fix bug: Relax sync regexp., Thien-Thi Nguyen, 2014/02/24