[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo c164c40 092/357: [gnugo int] Add abstraction: gnu
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo c164c40 092/357: [gnugo int] Add abstraction: gnugo--passp |
Date: |
Sun, 29 Nov 2020 14:50:56 -0500 (EST) |
branch: externals/gnugo
commit c164c409664d6251f6e73050d15daa92af83b1ab
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Add abstraction: gnugo--passp
* packages/gnugo/gnugo.el (gnugo--passp): New defsubst.
(gnugo-note, gnugo-push-move, gnugo-magic-undo): Use it.
---
gnugo.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 4448877..c12c5e7 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -684,11 +684,14 @@ For all other values of RSEL, do nothing and return nil."
(while (gnugo-board-buffer-p)
(bury-buffer)))
+(defsubst gnugo--passp (string)
+ (string= "PASS" string))
+
(defun gnugo-note (property value &optional mogrifyp)
(when mogrifyp
(let ((sz (gnugo-get :SZ)))
(cl-labels
- ((mog (pos) (if (string= "PASS" pos)
+ ((mog (pos) (if (gnugo--passp pos)
"tt"
(let* ((col (aref pos 0))
(one (+ ?a (- col (if (< ?H col) 1 0) ?A)))
@@ -767,9 +770,9 @@ For all other values of RSEL, do nothing and return nil."
(start (gnugo-get :waiting-start))
(now (current-time))
(resignp (string= "resign" move))
- (passp (string= "PASS" move))
+ (passp (gnugo--passp move))
(head (gnugo-move-history 'car))
- (onep (and head (string= "PASS" head)))
+ (onep (and head (gnugo--passp head)))
(donep (or resignp (and onep passp))))
(unless passp
(gnugo-merge-showboard-results))
@@ -1419,7 +1422,7 @@ turn to play. Optional second arg NOALT non-nil inhibits
this."
(let* ((ulastp (string= (gnugo-get :last-mover) user-color))
(ubpos (gnugo-move-history (if ulastp 'car 'cadr))))
- (gnugo-put :last-user-bpos (if (and ubpos (not (string= "PASS" ubpos)))
+ (gnugo-put :last-user-bpos (if (and ubpos (not (gnugo--passp ubpos)))
ubpos
(gnugo-get :center-position)))
(gnugo-refresh t)
- [elpa] externals/gnugo 02926a1 049/357: [gnugo] Rename var to ‘gnugo-inhibit-refresh’., (continued)
- [elpa] externals/gnugo 02926a1 049/357: [gnugo] Rename var to ‘gnugo-inhibit-refresh’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5e4b5a8 051/357: [gnugo] Release: 2.3.0, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 400e27d 069/357: [gnugo int] Add abstraction: gnugo--who-is-who, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3547cbe 080/357: [gnugo int] Add abstraction: gnugo--set-root-prop, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 11e545d 082/357: [gnugo int] Use ‘loop’ instead of ‘dolist’ + ‘destructuring-bind’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5eeb99b 087/357: [gnugo int] Use ‘incf’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7293802 088/357: [gnugo int] Use ‘setq’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 35b1551 091/357: [gnugo int] Use ‘loop’ instead of ‘mapc’ + ‘apply’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b5990a0 085/357: [gnugo int] Use ‘gnugo-treeroot’ more., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f9668f0 090/357: [gnugo int] Add abstraction: gnugo--blackp, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c164c40 092/357: [gnugo int] Add abstraction: gnugo--passp,
Stefan Monnier <=
- [elpa] externals/gnugo bf04735 094/357: [gnugo] Fix bug: Don't misuse SGF prop ‘:EV’ for "resign" state., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e036fed 096/357: [gnugo] Fix bug: On load, follow mainline through subtrees., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eaaa7c8 102/357: [gnugo int] Invert gametree IR to hang by the leaves., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ed11a74 101/357: [gnugo int] Embrace (NODE[...] [SUBTREE...]) IR, for now., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b7843bf 103/357: [gnugo maint] Move hi-lock hint from NEWS to HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ae888ba 105/357: [gnugo] Add command ‘gnugo-oops’ and keybinding., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2c5e356 107/357: [gnugo maint] Add some debugging aids to HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a708759 110/357: [gnugo int] Use ‘cl-labels’ less., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a35f657 115/357: [gnugo] Support SGF[4] parsing from string data., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3d8db48 119/357: [gnugo] Declare dependency on ‘ascii-art-to-unicode’., Stefan Monnier, 2020/11/29