[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 9f5fcfc 250/357: [gnugo int] Add abstraction: gnu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 9f5fcfc 250/357: [gnugo int] Add abstraction: gnugo--resignp |
Date: |
Sun, 29 Nov 2020 14:51:32 -0500 (EST) |
branch: externals/gnugo
commit 9f5fcfc3a63e7b4f9473ccc7bed7804b325da5a7
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Add abstraction: gnugo--resignp
* packages/gnugo/gnugo.el (gnugo--resignp): New defsubst.
(gnugo-move-history, gnugo-push-move, gnugo-refresh)
(gnugo-display-final-score): Use ‘gnugo--resignp’.
---
gnugo.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index f0c9dda..7fdfaaf 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -715,6 +715,9 @@ when you are sure the command cannot fail."
(+ ?A (- (if (> ?i col) col (1+ col)) ?a))
(- size (- (aref cc 1) ?a))))))))
+(defsubst gnugo--resignp (string)
+ (string= "resign" string))
+
(defsubst gnugo--passp (string)
(string= "PASS" string))
@@ -737,7 +740,7 @@ For all other values of RSEL, do nothing and return nil."
(as-pos (gnugo--as-pos-func))
acc node mprop move)
(cl-flet*
- ((as-pos-maybe (x) (if (string= "resign" x)
+ ((as-pos-maybe (x) (if (gnugo--resignp x)
x
(funcall as-pos x)))
(remem () (setq node (pop mem)
@@ -1285,7 +1288,7 @@ This fails if the monkey is on the current branch
who))
(start (gnugo-get :waiting-start))
(now (current-time))
- (resignp (string= "resign" move))
+ (resignp (gnugo--resignp move))
(passp (gnugo--passp move))
(head (gnugo-move-history 'car))
(onep (and head (gnugo--passp head)))
@@ -1455,7 +1458,7 @@ its move."
(rename-buffer (concat (gnugo-get :diamond)
(if game-over
(format "%s(game over)"
- (if (string= move "resign")
+ (if (gnugo--resignp move)
(concat move "ation ")
""))
(format "%s(%s to play)"
@@ -2099,7 +2102,7 @@ to the last move, as a comment."
(sit-for 3)))
(let ((b= " Black = ")
(w= " White = ")
- (res (when (string= "resign" (gnugo-move-history 'car))
+ (res (when (gnugo--resignp (gnugo-move-history 'car))
(gnugo-get :last-mover)))
blurb result)
(if res
- [elpa] externals/gnugo 3f3af4b 208/357: [gnugo int] Remove from ‘gnugo-state’ instead of setting to nil., (continued)
- [elpa] externals/gnugo 3f3af4b 208/357: [gnugo int] Remove from ‘gnugo-state’ instead of setting to nil., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f28d241 223/357: [gnugo int] Decruft: Don't set provisional :last-user-bpos., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8211cb9 224/357: [gnugo int] Couple :center-position and :SZ jamming., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 536960c 230/357: [gnugo int] Fix bug: On -l/--infile, inhibit first move if game over., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 50cc2b3 233/357: [gnugo int] Add abstraction: gnugo--q/ue, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3903907 235/357: [gnugo] Validate position arg of GTP commands ‘undo’, ‘gg-undo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ab1f4c2 242/357: [gnugo] Fix bug: DTRT for suggestion ‘nowarp’ check., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e814724 243/357: [gnugo] Allow user to request suggestion for GNU Go., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5157534 241/357: [gnugo int] Use ‘destructuring-bind’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6c99d78 251/357: [gnugo int] Add abstraction: gnugo--no-worries, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9f5fcfc 250/357: [gnugo int] Add abstraction: gnugo--resignp,
Stefan Monnier <=
- [elpa] externals/gnugo 2612c6b 263/357: [gnugo] Replace abdication w/ Assist and Zombie minor modes., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b586e0c 268/357: [gnugo] Refuse to climb towards root when in Assist mode., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo af7aa4a 267/357: [gnugo] Fix bug: On role switch, flip karma after roles., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b6ac4ac 283/357: [gnugo frolic] Add command to navigate to end of branch., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5414994 277/357: [gnugo] Handle function for ‘gnugo-xpms’ value., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f42837f 280/357: [gnugo int] Mention ‘gnugo-frolic-mode-map’ in Commentary; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ef2bfa7 273/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 407ca43 266/357: [gnugo int] Move some ‘gnugo-gate’ calls down-chain., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1ce9fbb 312/357: [gnugo slog] Clear ‘inhibit-point-motion-hooks’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9208a24 317/357: * gnugo/gnugo.el (gnugo-refresh): Fix unknown function `pushnew`, Stefan Monnier, 2020/11/29