[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 64bd753 327/357: [gnugo int] Simplify SGF-write s
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 64bd753 327/357: [gnugo int] Simplify SGF-write subroutine. |
Date: |
Sun, 29 Nov 2020 14:51:50 -0500 (EST) |
branch: externals/gnugo
commit 64bd75309452003fcf4b2e3eff17e4e0645080f5
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo int] Simplify SGF-write subroutine.
* packages/gnugo/gnugo.el (gnugo/sgf-write-file esc):
Drop 2nd arg FMT; rename remaining 2nd arg from ARG to VAL;
don't bother w/ ‘list-to-string’; if ARG is already a
string, use it directly; otherwise ‘format "%s"’ as before.
(gnugo/sgf-write-file >>one): Update call to ‘esc’.
(gnugo/sgf-write-file >>two): Likewise.
---
gnugo.el | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/gnugo.el b/gnugo.el
index 7245a3d..ddfc953 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -2680,7 +2680,7 @@ A collection is a list of gametrees, each a vector of
four elements:
gnugo/sgf-*r4-properties*))
p name v spec)
(cl-labels
- ((esc (composed fmt arg)
+ ((esc (composed val)
(mapconcat (lambda (c)
(cl-case c
;; ‘?\[’ is not strictly required
@@ -2688,13 +2688,15 @@ A collection is a list of gametrees, each a vector of
four elements:
((?\[ ?\] ?\\) (format "\\%c" c))
(?: (concat (if composed "\\" "") ":"))
(t (string c))))
- (string-to-list (format fmt arg))
+ ;; ‘list-to-string’ unnecessary; ‘mapconcat’ DTRT
+ (if (stringp val)
+ val
+ (format "%s" val))
""))
- (>>one (v) (insert "[" (esc nil "%s" v) "]"))
- (>>two (v) (insert "["
- (esc t "%s" (car v))
- ":"
- (esc t "%s" (cdr v))
+ (>>one (v) (insert "[" (esc nil v)
+ "]"))
+ (>>two (v) (insert "[" (esc t (car v))
+ ":" (esc t (cdr v))
"]"))
(>>nl () (cond ((memq name aft-newline-appreciated)
(insert "\n"))
- [elpa] externals/gnugo 11543e5 232/357: [gnugo] Reduce modifier key bouncing for "quick peek" frolics., (continued)
- [elpa] externals/gnugo 11543e5 232/357: [gnugo] Reduce modifier key bouncing for "quick peek" frolics., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo dae8f08 231/357: [gnugo] Fix bug: DTRT for :last-user-bpos in undo-one-move ME-NEXT., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f102d7f 240/357: [gnugo] Allow user to move for GNU Go., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 9969838 260/357: [gnugo int] Drop abstractions: gnugo--{ERR-wait, gate-game-over}, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b9fa668 265/357: [gnugo int] Drop redundant ‘gnugo-gate’ calls., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a766f0c 282/357: [gnugo] Replace ‘gnugo-toggle-grid’ w/ ‘gnugo-grid-mode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4028102 271/357: [gnugo] Make climb-to-root "GNU Go to play" reaction customizable., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 46eec46 285/357: [gnugo int] Simplify COND expression., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo eaae57d 324/357: [gnugo int] Add Juanma Barranquero to THANKS; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bb986d7 323/357: [gnugo] Release: 3.0.2, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 64bd753 327/357: [gnugo int] Simplify SGF-write subroutine.,
Stefan Monnier <=
- [elpa] externals/gnugo c6eb3d1 325/357: [gnugo maint] Add people from ttn-pers-elisp THANKS file; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 981d75e 341/357: [gnugo] Fix bug: Don't clobber dead-group indication on refresh., Stefan Monnier, 2020/11/29
- [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