[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 10d29a9 301/357: [gnugo] Only set AP for modified
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 10d29a9 301/357: [gnugo] Only set AP for modified gametrees in the collection. |
Date: |
Sun, 29 Nov 2020 14:51:44 -0500 (EST) |
branch: externals/gnugo
commit 10d29a987dfa0b8709a83ac55e92a4f66ce3af95
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Only set AP for modified gametrees in the collection.
* packages/gnugo/gnugo.el (gnugo-write-sgf-file):
Set root node property :AP here, but only if buffer-modified.
(gnugo, gnugo/sgf-write-file): Don't set root node property :AP.
---
NEWS | 1 +
gnugo.el | 7 +++----
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/NEWS b/NEWS
index da45ca6..91047fb 100644
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,7 @@ NB: "RCS: X..Y " means that the particular release includes
- GNUGO Board mode now derived from Special mode
- position arg validated for direct GTP commands ‘undo’, ‘gg-undo’
- undo commands no longer signal error on overkill
+ - SGF prop ‘AP’ set only for modified gametrees
- SGF I/O commands change ‘default-directory’
- performance improvements
- of interest to hackers (see source, BI => backward incompatible)
diff --git a/gnugo.el b/gnugo.el
index 3097ce1..e42db33 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1561,6 +1561,9 @@ If FILENAME already exists, Emacs confirms that you wish
to overwrite it."
(when (and (file-exists-p filename)
(not (y-or-n-p "File exists. Continue? ")))
(user-error "Not writing %s" filename))
+ (when (buffer-modified-p)
+ ;; take responsibility for our actions
+ (gnugo--set-root-prop :AP (cons "gnugo.el" gnugo-version)))
(gnugo/sgf-write-file (gnugo-get :sgf-collection) filename)
(gnugo--ok-file filename))
@@ -2280,7 +2283,6 @@ See `gnugo-board-mode' for a full list of commands."
:RU (if (member "--chinese-rules" args)
"Chinese"
"Japanese")
- :AP (cons "gnugo.el" gnugo-version)
:KM komi)
(let ((ub (gnugo--blackp user-color)))
(r! (if ub :PW :PB) (concat "GNU Go " (gnugo-query "version"))
@@ -2655,7 +2657,6 @@ A collection is a list of gametrees, each a vector of
four elements:
(defun gnugo/sgf-write-file (collection filename)
(let ((aft-newline-appreciated '(:AP :GN :PB :PW :HA :KM :RU :RE))
- (me (cons "gnugo.el" gnugo-version))
(specs (mapcar (lambda (full)
(cons (intern (format ":%s" (car full)))
(cl-cdddr full)))
@@ -2723,8 +2724,6 @@ A collection is a list of gametrees, each a vector of
four elements:
(insert ")")))
(with-temp-buffer
(dolist (tree collection)
- ;; take responsibility for our actions
- (gnugo--set-root-prop :AP me tree)
;; write it out
(let ((ht (gnugo--mkht))
(leaves (append (gnugo--tree-ends tree) nil)))
- [elpa] externals/gnugo b0b18d0 254/357: [gnugo int] Decorate w/ plist instead of alist., (continued)
- [elpa] externals/gnugo b0b18d0 254/357: [gnugo int] Decorate w/ plist instead of alist., Stefan Monnier, 2020/11/29
- [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 <=
- [elpa] externals/gnugo da98bc8 288/357: [gnugo int] Replace COND expression w/ IF., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 26c849f 330/357: [gnugo int] Decruft: Don't declare hook and keymap vars., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b5b3fd6 337/357: [gnugo int] Reduce ‘setq’ usage., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo c885c9c 020/357: [gnugo int] Avoid variable FORMAT for ‘message’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo fce1fb0 077/357: [gnugo sgf] Fix bug: Output subtrees correctly., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5ca7efb 099/357: [gnugo int] Remove redundant game-over condition check., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7fee3b2 104/357: [gnugo] Move "1 or 2" calculation into ‘gnugo-magic-undo’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a86327a 108/357: [gnugo] Add command ‘gnugo-frolic-in-the-leaves’ and keybinding., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo f5fbba3 153/357: [gnugo int] Fix bug: Update local var ‘ends’ when branching., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo a4dcef8 150/357: [gnugo frolic int] Parameterize, centralize awakening., Stefan Monnier, 2020/11/29