[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo cedd448 227/357: [gnugo int] Add abstraction: gnu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo cedd448 227/357: [gnugo int] Add abstraction: gnugo--prop<-color |
Date: |
Sun, 29 Nov 2020 14:51:27 -0500 (EST) |
branch: externals/gnugo
commit cedd4480f84867bbb148cb37386afe79c64bb6de
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Add abstraction: gnugo--prop<-color
* packages/gnugo/gnugo.el (gnugo--prop<-color): New defsubst.
(gnugo-push-move, gnugo-okay): Use ‘gnugo--prop<-color’.
---
gnugo.el | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 5ce9564..e4774c4 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -344,6 +344,9 @@ Handle the big, slow-to-render, and/or uninteresting ones
specially."
"Return the current player, either \"black\" or \"white\"."
(gnugo-other (gnugo-get :last-mover)))
+(defsubst gnugo--prop<-color (color)
+ (if (gnugo--blackp color) :B :W))
+
(defsubst gnugo--gate-game-over (enable)
(when (and enable (gnugo-get :game-over))
(user-error "Sorry, game over")))
@@ -1282,8 +1285,7 @@ This fails if the monkey is on the current branch
(string= ucolor color))
(gnugo-put :last-user-bpos (and (not passp) (not resignp) move)))
;; update :sgf-gametree and :monkey
- (let* ((property (if (gnugo--blackp color)
- :B :W))
+ (let* ((property (gnugo--prop<-color color))
(pair (cons property (cond (resignp move)
(passp "")
(t (funcall (gnugo--as-cc-func)
@@ -2047,8 +2049,7 @@ Prefix arg means to redo all the undone moves."
(bidx (aref monkey 1))
(end (aref ends bidx))
(ucolor (gnugo-get :user-color))
- (uprop (if (gnugo--blackp ucolor)
- :B :W)))
+ (uprop (gnugo--prop<-color ucolor)))
(cl-flet ((mvno (node) (gethash node mnum)))
(loop
with ok = (if full
- [elpa] externals/gnugo 7c7d43c 261/357: [gnugo int] Avoid superfluous ‘gnugo-other’ call., (continued)
- [elpa] externals/gnugo 7c7d43c 261/357: [gnugo int] Avoid superfluous ‘gnugo-other’ call., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6ddf38f 269/357: [gnugo int] Add abstraction: gnugo--assist-state, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d48adca 244/357: [gnugo] On disable, transform in-flight user-move into suggestion., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 764251b 259/357: [gnugo int] Fix bug: Use correct color for "Not your turn yet"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 16da062 284/357: [gnugo int] Use ‘loop ... collect’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e2f7c7b 212/357: [gnugo int] Consolidate display scaling factors access., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2bde4bc 207/357: [gnugo] Add hook: gnugo-start-game-hook, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 714d3c9 201/357: [gnugo int] Commentary munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e019871 206/357: [gnugo] Add abstraction: gnugo-current-player, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 40f7299 225/357: [gnugo] Fix bug: Ensure gametree sync for -l/--infile., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cedd448 227/357: [gnugo int] Add abstraction: gnugo--prop<-color,
Stefan Monnier <=
- [elpa] externals/gnugo dfe75eb 281/357: [gnugo] Replace ‘gnugo-toggle-image-display-command’ w/ ‘gnugo-image-display-mode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 88620df 278/357: [gnugo int] Decruft: Drop :local-xpms support., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo cacb0c7 275/357: [gnugo] Publicize ‘gnugo-undo-reaction’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 48913fd 313/357: [gnugo maint] Update years in copyright notice; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 844189b 308/357: [gnugo] Release: 3.0.0, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9928736 299/357: * packages/gnugo: Add `cl-lib' as dependency; require it and use its names., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 67c82c1 309/357: Fix some quoting problems in doc strings, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6bf46ba 290/357: [gnugo maint] Add ‘Maintainer’ header per top-level README; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7dbf4d7 305/357: [gnugo int] Use idiomatic ‘re-search-forward’ BOUND., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 289e336 310/357: [gnugo int] Use ‘setq-local’., Stefan Monnier, 2020/11/29