emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/gnugo 08b2a66 017/357: [gnugo] Indicate buffer not modi


From: Stefan Monnier
Subject: [elpa] externals/gnugo 08b2a66 017/357: [gnugo] Indicate buffer not modified after save.
Date: Sun, 29 Nov 2020 14:50:38 -0500 (EST)

branch: externals/gnugo
commit 08b2a6664ad5b7d4b0dad02a8d7ad819d6c80f56
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [gnugo] Indicate buffer not modified after save.
    
    * packages/gnugo/gnugo.el (gnugo-animate-group): Use current
    value of ‘buffer-modified-p’ in loop instead of ‘t’.
    (gnugo-write-sgf-file): Clear buffer-modified state.
---
 gnugo.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnugo.el b/gnugo.el
index 17cb428..f69078b 100644
--- a/gnugo.el
+++ b/gnugo.el
@@ -1045,6 +1045,7 @@ To start a game try M-x gnugo."
 (defun gnugo-animate-group (command)
   (message "Computing %s ..." command)
   (let* ((pos (gnugo-position))
+         (orig-b-m-p (buffer-modified-p))
          (stones (if (memq (char-after) '(?X ?O))
                      (gnugo-lsquery "%s %s" command pos)
                    (error "No stone at %s" pos))))
@@ -1076,7 +1077,8 @@ To start a game try M-x gnugo."
       (while (and (cdr spec)            ; let last linger lest levity lost
                   (sit-for 0.08675309)) ; jenny jenny i got your number...
         (setcar cell (setq spec (cdr spec)))
-        (set-buffer-modified-p t))
+        ;; Force redisplay of overlays.
+        (set-buffer-modified-p orig-b-m-p))
       (sit-for 5)
       (mapc 'delete-overlay ovs)
       t)))
@@ -1199,7 +1201,8 @@ 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? ")))
     (error "Not writing %s" filename))
-  (gnugo/sgf-write-file (gnugo-get :sgf-collection) filename))
+  (gnugo/sgf-write-file (gnugo-get :sgf-collection) filename)
+  (set-buffer-modified-p nil))
 
 (defun gnugo-read-sgf-file (filename)
   "Load the first game tree from FILENAME, a file in SGF format."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]