[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 0c7bc82 025/357: [gnugo int] Use cl-{plus, minus}
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 0c7bc82 025/357: [gnugo int] Use cl-{plus, minus}p more. |
Date: |
Sun, 29 Nov 2020 14:50:40 -0500 (EST) |
branch: externals/gnugo
commit 0c7bc8245d19e00263e2af2a1c65130f7144b9d8
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[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.
---
gnugo.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 12b7e88..5673360 100644
--- a/gnugo.el
+++ b/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] externals/gnugo f09af15 058/357: [gnugo maint] Reindent; nfc., (continued)
- [elpa] externals/gnugo f09af15 058/357: [gnugo maint] Reindent; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 052ea8a 045/357: [gnugo] New command: ‘A’ (gnugo-switch-to-another), Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6e26e76 061/357: [gnugo int] Add abstraction: gnugo--begin-exchange, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b6bb24d 057/357: [gnugo int] Use ‘eq’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ae25c81 050/357: [gnugo maint] Update NEWS, HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f282ec7 063/357: [gnugo int] Associate process w/ buffer immediately., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8e3f44e 070/357: [gnugo] Make ‘C-u M-u’ switch roles., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d02a500 095/357: [gnugo maint] NEWS futzing; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 273da4b 098/357: [gnugo sgf] Normalize PASS internal rep on read, as ""., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 61be18a 022/357: [gnugo maint] Add .dir-locals.el file, link in HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0c7bc82 025/357: [gnugo int] Use cl-{plus, minus}p more.,
Stefan Monnier <=
- [elpa] externals/gnugo 6d835b3 023/357: [gnugo int] Drop unused local var., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2a75447 034/357: [gnugo int] Use ‘set-process-query-on-exit-flag’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bd4d40f 028/357: [gnugo int] Drop leading "*" in docstrings., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7ef5c66 036/357: [gnugo int] Revamp gnugo-{put, get} doc / indentation decl., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d41a581 029/357: [gnugo] Indicate buffer not modified after load., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 80a22a5 032/357: [gnugo] Use ‘user-error’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 423683d 055/357: [gnugo int] Use ‘dolist’, ‘destructuring-bind’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7c3a30f 100/357: [gnugo int] Use ‘pop’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a35692a 106/357: [gnugo int] Add abstraction: gnugo--move-prop, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6ee477d 112/357: [gnugo int] Remove abstraction: continue-on, Stefan Monnier, 2020/11/29