[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 3541ccf 343/357: [gnugo int] Lift redundant pall
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 3541ccf 343/357: [gnugo int] Lift redundant pall of death computation. |
Date: |
Sun, 29 Nov 2020 14:51:53 -0500 (EST) |
branch: externals/gnugo
commit 3541ccf577baef04d8922844e5a5b4ca55adb962
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[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.
---
gnugo.el | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index f1f70ad..e21d35a 100644
--- a/gnugo.el
+++ b/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] externals/gnugo e4344ac 350/357: [gnugo] Release: 3.1.0, (continued)
- [elpa] externals/gnugo e4344ac 350/357: [gnugo] Release: 3.1.0, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo af82527 356/357: [gnugo] Release: 3.1.1, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 53da06f 329/357: [gnugo] Make ‘gnugo-comment’ fall back to root node., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 781a385 332/357: [gnugo] Drop trailing fullstop for "... done" messages., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c5ef13d 334/357: [gnugo] Make ‘gnugo-goto-pos’ return buffer position., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6170d2a 333/357: [gnugo] Make ‘C-c C-p’ output more spacious., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0320a5c 335/357: [gnugo int] Decruft: Don't bother w/ ‘group’ text property., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 8123275 338/357: [gnugo] Drop trailing fullstop in animation message., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 08f11af 339/357: [gnugo int] Incorporate ‘gnugo-toggle-image-display’ into unique caller., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1e01c65 340/357: [gnugo] When sorry, say "Sorry" first., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3541ccf 343/357: [gnugo int] Lift redundant pall of death computation.,
Stefan Monnier <=
- [elpa] externals/gnugo 38b2529 124/357: [gnugo int] Add abstraction: gnugo--mkht, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0f9f540 125/357: [gnugo int] Maintain tree MNUM., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7211950 346/357: [gnugo] Indicate seki groups on the board., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 35c4645 347/357: [gnugo] Make ‘C-u F’ store additional SGF properties., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0c4b37b 349/357: [gnugo] Document new ‘C-u F’ behavior., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e66bfa0 352/357: [gnugo int] Gate ‘cursor-intangible-mode’ call precisely, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2f73382 353/357: [gnugo] Add some docstrings to some vars/funcs., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eb9748f 355/357: [gnugo maint] Update years in copyright notice; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2dd0aca 357/357: * .gitignore: New file, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ee905ef 048/357: [gnugo] Fix bug: Compute grid spacing using offset math., Stefan Monnier, 2020/11/29