[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master a6c204b 2/6: [gnugo int] Lift redundant pall of death comp
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] master a6c204b 2/6: [gnugo int] Lift redundant pall of death computation. |
Date: |
Tue, 14 Feb 2017 12:28:39 -0500 (EST) |
branch: master
commit a6c204b5d1108851408b343b58cfbd7aee406842
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>
[gnugo int] Lift redundant pall of death computation.
* packages/gnugo/gnugo.el (gnugo-refresh) [pall of death]:
Check :display-using-images exactly once; compute as much
of the overlay ‘display’ object as possible prior to looping.
---
packages/gnugo/gnugo.el | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index f1f70ad..e21d35a 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1033,6 +1033,7 @@ its move."
(interactive "P")
(let* ((move (gnugo-move-history 'car))
(game-over (gnugo-get :game-over))
+ (using-images (gnugo-get :display-using-images))
(inhibit-read-only t)
window last)
(when (and nocache (not (gnugo-get :waiting)))
@@ -1085,20 +1086,27 @@ its move."
do (setcdr
head
(cl-loop
- with c = (if (gnugo--blackp (car head))
- "x"
- "o")
+ with color = (car head)
+ with shown = (if using-images
+ (gnugo-yang (if (gnugo--blackp color)
+ ?X
+ ?O))
+ (propertize (if (gnugo--blackp color)
+ "x"
+ "o")
+ 'face
+ 'font-lock-warning-face))
for p in (mapcar #'gnugo-goto-pos positions)
collect
(let ((ov (make-overlay p (1+ p))))
(overlay-put
ov 'display
- (if (gnugo-get :display-using-images)
+ (if using-images
;; respect the dead individually; it takes more time
;; but that's not a problem (for them)
(gnugo-venerate (get-text-property p 'gnugo-yin)
- (gnugo-yang (aref (upcase c) 0)))
- (propertize c 'face 'font-lock-warning-face)))
+ shown)
+ shown))
ov))))))
;; window update
(when (setq window (get-buffer-window (current-buffer)))
- [elpa] master updated (88e48d8 -> a8d009f), Thien-Thi Nguyen, 2017/02/14
- [elpa] master a6c204b 2/6: [gnugo int] Lift redundant pall of death computation.,
Thien-Thi Nguyen <=
- [elpa] master 7f1b6c8 1/6: [gnugo int] Add abstraction: gnugo--zonk-ovs, Thien-Thi Nguyen, 2017/02/14
- [elpa] master 16cbc80 4/6: [gnugo] Include seki groups in game-over data., Thien-Thi Nguyen, 2017/02/14
- [elpa] master a8d009f 6/6: [gnugo] Make ‘C-u F’ store additional SGF properties., Thien-Thi Nguyen, 2017/02/14
- [elpa] master ebbb70a 3/6: [gnugo] Formalize game-over "group"; use symbolic color., Thien-Thi Nguyen, 2017/02/14
- [elpa] master 818f8c6 5/6: [gnugo] Indicate seki groups on the board., Thien-Thi Nguyen, 2017/02/14