[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo b0b18d0 254/357: [gnugo int] Decorate w/ plist in
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo b0b18d0 254/357: [gnugo int] Decorate w/ plist instead of alist. |
Date: |
Sun, 29 Nov 2020 14:51:33 -0500 (EST) |
branch: externals/gnugo
commit b0b18d013666b78a1f253a9c6f56cf41618ba1d0
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Decorate w/ plist instead of alist.
* packages/gnugo/gnugo.el (gnugo--decorate):
Rewrite; convert from defsubst to defun.
(gnugo-display-final-score, gnugo-comment)
(gnugo r!): Update accordingly.
---
gnugo.el | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 92ccf0b..6a7cf6c 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1226,9 +1226,15 @@ This fails if the monkey is on the current branch
(substring pos 1))))))
(format "%c%c" one two)))))
-(defsubst gnugo--decorate (node alist)
- ;; NB: ALIST should not have :B or :W keys.
- (setcdr (last node) alist))
+(defun gnugo--decorate (node &rest plist)
+ (loop with tp = (last node)
+ while plist
+ do (setf
+ fruit (list (cons ; DWR: LtR OoE assumed.
+ (pop plist)
+ (pop plist)))
+ (cdr tp) fruit
+ tp fruit)))
(defun gnugo-close-game (end-time resign)
(gnugo-put :game-end-time end-time)
@@ -2190,6 +2196,7 @@ to the last move, as a comment."
(let ((node (car (aref (gnugo-get :monkey) 0))))
(gnugo--decorate
(delq (assq :C node) node)
+ :C
(with-temp-buffer ; lame
(insert blurb)
(when (search-backward "\n\nGame start:" nil t)
@@ -2202,7 +2209,7 @@ to the last move, as a comment."
(rep "territory" "T")
(rep "captures" "C")
(rep "komi" "K"))
- `((:C . ,(buffer-string)))))))
+ (buffer-string)))))
(switch-to-buffer (format "%s*GNUGO Final Score*" (gnugo-get :diamond)))
(erase-buffer)
(insert blurb)))
@@ -2281,7 +2288,7 @@ If COMMENT is nil or the empty string, remove the
property entirely."
(cdr (assq :C node))))))
(setq node (delq (assq :C node) node))
(unless (zerop (length comment))
- (gnugo--decorate node `((:C . ,comment)))))
+ (gnugo--decorate node :C comment)))
(defun gnugo-toggle-abdication ()
"Toggle abdication, i.e., letting GNU Go play for you.
@@ -2503,13 +2510,7 @@ See `gnugo-board-mode' for a full list of commands."
(if filename
(gnugo-read-sgf-file (expand-file-name filename))
(cl-flet
- ((r! (&rest plist)
- (gnugo--decorate
- root (loop ; hmm, available elsewhere?
- while plist
- collect (let* ((k (pop plist))
- (v (pop plist)))
- (cons k v))))))
+ ((r! (&rest plist) (apply 'gnugo--decorate root plist)))
(gnugo--SZ!
(setq root (gnugo--root-node
(gnugo--plant-and-climb
- [elpa] externals/gnugo 7dbf4d7 305/357: [gnugo int] Use idiomatic ‘re-search-forward’ BOUND., (continued)
- [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
- [elpa] externals/gnugo d4a4afd 289/357: [gnugo int] Add section "Tip Jar" in Commentary; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c09c26a 304/357: [gnugo int] Use "%F" and "%T"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 53fe424 306/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 21e1d9a 303/357: [gnugo int] Expose function to byte-compiler., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0469947 322/357: [gnugo slog] Prefer Cursor Intangible mode, if available., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4930156 239/357: [gnugo int] Move ‘gnugo-position’ call down-chain., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 57faa71 256/357: [gnugo] Don't display "Abdication {en, dis}abled"., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6edd793 252/357: [gnugo] Make undo commands silently handle overkill., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b0b18d0 254/357: [gnugo int] Decorate w/ plist instead of alist.,
Stefan Monnier <=
- [elpa] externals/gnugo b07f602 248/357: [gnugo int] Move ‘gnugo--passp’ earlier in file., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5524a47 262/357: [gnugo int] Maintain current buffer in ‘gnugo--finish-move’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 2b8d5aa 258/357: [gnugo int] Compute "Abd" in mode-line at time of change., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 6a7af2a 274/357: [gnugo int] Decruft: Presume ‘display-images-p’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 35571e3 287/357: [gnugo int] Use private obarray for :all-yy elems, display props., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 0473d72 264/357: [gnugo int] Comment munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5b49aad 316/357: [gnugo int] Use ‘line-end-position’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7544ffe 311/357: [gnugo maint] Add copyright policy to HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 1ff7a11 307/357: [gnugo maint] Add ‘URL’ header; trim Hacking URL; drop Tip Jar URL., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 10d29a9 301/357: [gnugo] Only set AP for modified gametrees in the collection., Stefan Monnier, 2020/11/29