[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gnugo 3540673 272/357: [gnugo] Make SGF I/O commands c
From: |
Stefan Monnier |
Subject: |
[elpa] externals/gnugo 3540673 272/357: [gnugo] Make SGF I/O commands change ‘default-directory’. |
Date: |
Sun, 29 Nov 2020 14:51:37 -0500 (EST) |
branch: externals/gnugo
commit 3540673fb224b0fbdb8bb1ff2036b66291410ad8
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[gnugo] Make SGF I/O commands change ‘default-directory’.
* packages/gnugo/gnugo.el (gnugo--ok-file): New func.
(gnugo-write-sgf-file, gnugo-read-sgf-file): Don't
clear buffer-modified state; instead, call ‘gnugo--ok-file’.
---
NEWS | 1 +
gnugo.el | 10 ++++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index 026d67d..1650be8 100644
--- a/NEWS
+++ b/NEWS
@@ -36,6 +36,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 I/O commands change ‘default-directory’
- performance improvements
- of interest to hackers (see source, BI => backward incompatible)
- dropped var: ‘gnugo-inhibit-refresh’ (BI)
diff --git a/gnugo.el b/gnugo.el
index a01ae63..4a6d002 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1897,6 +1897,12 @@ by how many stones)."
(message "Est.score ... B %s %s | W %s %s | %s"
black black-captures white white-captures est)))
+(defun gnugo--ok-file (filename)
+ (setq default-directory
+ (file-name-directory
+ (expand-file-name filename)))
+ (set-buffer-modified-p nil))
+
(defun gnugo-write-sgf-file (filename)
"Save the game history to FILENAME (even if unfinished).
If FILENAME already exists, Emacs confirms that you wish to overwrite it."
@@ -1905,7 +1911,7 @@ If FILENAME already exists, Emacs confirms that you wish
to overwrite it."
(not (y-or-n-p "File exists. Continue? ")))
(user-error "Not writing %s" filename))
(gnugo/sgf-write-file (gnugo-get :sgf-collection) filename)
- (set-buffer-modified-p nil))
+ (gnugo--ok-file filename))
(defun gnugo--dance-dance (karma)
(destructuring-bind (dance btw)
@@ -2000,7 +2006,7 @@ If FILENAME already exists, Emacs confirms that you wish
to overwrite it."
(gnugo-put :last-user-bpos
(gnugo-move-history 'bpos (gnugo-get :user-color)))
(gnugo-refresh t)
- (set-buffer-modified-p nil)
+ (gnugo--ok-file filename)
(gnugo--who-is-who wait play samep)))
(defun gnugo--mem-with-played-stone (pos &optional noerror)
- [elpa] externals/gnugo e644695 203/357: [gnugo] Increase S/N for ‘C-u F’ comment., (continued)
- [elpa] externals/gnugo e644695 203/357: [gnugo] Increase S/N for ‘C-u F’ comment., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7b29f73 219/357: [gnugo int] Decruft: Don't stash :proc-args., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 12d3d80 216/357: [gnugo] Keep GNUGO Board buffer read-only., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4b6e204 221/357: [gnugo int] Move some prop jamming to ‘gnugo-board-mode’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo d52bbc7 222/357: [gnugo int] Add abstraction: gnugo--nquery, Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e837853 226/357: [gnugo int] Declare ‘lexical-binding: t’., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo bc4abdc 238/357: [gnugo int] Centralize some "No stone at POS" errors., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 78edde4 247/357: [gnugo maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 52251ac 270/357: [gnugo int] Move karma state normalization down-chain., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5a201a8 286/357: [gnugo] Fix bug: For GTP "help COMMAND", leave point in right place., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 3540673 272/357: [gnugo] Make SGF I/O commands change ‘default-directory’.,
Stefan Monnier <=
- [elpa] externals/gnugo ac1adcd 276/357: [gnugo] Make ‘gnugo-xpms’ a normal var; drop it as feature., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 079b73c 279/357: [gnugo int] Commentary munging; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo de92f27 296/357: [gnugo imgen] Add autoload cookie., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 7db9d5e 295/357: [gnugo] Declare package keywords., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo ab69d4b 294/357: [gnugo frolic] Promote frolic mode/funcs to feature., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 91f2d79 318/357: [gnugo int] Avoid latent order-of-evaluation error., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo b086082 321/357: Add some THANKS files; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 4c07c67 320/357: [gnugo int] Revert bogus OoE avoidance fix, w/ better comment., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo 5383e47 326/357: [gnugo int] Shirk syntax, abbrev tables in Gnugo Board mode., Stefan Monnier, 2020/11/29
- [elpa] externals/gnugo e5cba8f 344/357: [gnugo] Formalize game-over "group"; use symbolic color., Stefan Monnier, 2020/11/29