[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 225/255: quit observing IGS game w/o closing connection
From: |
Eric Schulte |
Subject: |
[elpa] 225/255: quit observing IGS game w/o closing connection |
Date: |
Sun, 16 Mar 2014 01:02:53 +0000 |
eschulte pushed a commit to branch go
in repository elpa.
commit bdf78fe9e2b585dbf5f95bc190de0c1158ab742c
Author: Eric Schulte <address@hidden>
Date: Thu Aug 8 11:12:38 2013 -0600
quit observing IGS game w/o closing connection
---
back-ends/igs.el | 18 +++++++++++++-----
go-board.el | 1 -
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/back-ends/igs.el b/back-ends/igs.el
index 1eaa281..4f08780 100644
--- a/back-ends/igs.el
+++ b/back-ends/igs.el
@@ -332,9 +332,11 @@ This is used to re-send messages to keep the IGS server
from timing out.")
(setq *igs-current-game* number)
(unless (aget (igs-current-game) :board)
(setf (aget (igs-current-game) :board)
- (save-excursion (make-instance 'board
- :buffer (go-board *igs-instance*
- (make-instance 'sgf)))))
+ (save-excursion
+ (setf (number *igs-instance*) number)
+ (make-instance 'board
+ :buffer (go-board *igs-instance*
+ (make-instance 'sgf)))))
(when (aget (igs-current-game) :board)
(igs-send (format "moves %s" number)))))
@@ -388,7 +390,9 @@ This is used to re-send messages to keep the IGS server
from timing out.")
;;; Class and interface
(defclass igs ()
- ((buffer :initarg :buffer :accessor buffer :initform nil)))
+ ((buffer :initarg :buffer :accessor buffer :initform nil)
+ ;; number of an observed IGS game
+ (number :initarg :number :accessor number :initform nil)))
(defmethod go-connect ((igs igs)) (igs-connect igs))
@@ -478,7 +482,11 @@ This is used to re-send messages to keep the IGS server
from timing out.")
(signal 'unsupported-back-end-command (list igs :reset)))
(defmethod go-quit ((igs igs))
- (with-igs igs (igs-send "quit")))
+ (with-igs igs
+ (if (number igs)
+ (progn (igs-send (format "observe %d" (number igs)))
+ (setf (number igs) nil))
+ (igs-send "quit"))))
(defmethod go-score ((igs igs))
(signal 'unsupported-back-end-command (list igs :score)))
diff --git a/go-board.el b/go-board.el
index a4f8c67..c521aeb 100644
--- a/go-board.el
+++ b/go-board.el
@@ -445,7 +445,6 @@
(defun go-board-quit ()
(interactive)
(when (y-or-n-p "quit: ")
- (with-backends tr (go-quit tr))
(kill-buffer (current-buffer))))
(defun go-board-safe-quit ()
- [elpa] 205/255: update the README, (continued)
- [elpa] 205/255: update the README, Eric Schulte, 2014/03/15
- [elpa] 206/255: ensure prisoners are 0 at the start of a new game, Eric Schulte, 2014/03/15
- [elpa] 208/255: support for viewing lists in a buffer, Eric Schulte, 2014/03/15
- [elpa] 207/255: robustly handle prematurely quitting process, Eric Schulte, 2014/03/15
- [elpa] 209/255: adding curry, rcurry and compose helpers, Eric Schulte, 2014/03/15
- [elpa] 213/255: include headers in width calculation, Eric Schulte, 2014/03/15
- [elpa] 215/255: smaller ldots, Eric Schulte, 2014/03/15
- [elpa] 200/255: refresh the go board, Eric Schulte, 2014/03/15
- [elpa] 214/255: refresh list every time the buffer changes size, Eric Schulte, 2014/03/15
- [elpa] 212/255: bug fix, wrong function name, Eric Schulte, 2014/03/15
- [elpa] 225/255: quit observing IGS game w/o closing connection,
Eric Schulte <=
- [elpa] 171/255: bigger stones, Eric Schulte, 2014/03/15
- [elpa] 219/255: updated igs backend, Eric Schulte, 2014/03/15
- [elpa] 222/255: asynchronous IGS game listing, Eric Schulte, 2014/03/15
- [elpa] 220/255: list buffer navigation, Eric Schulte, 2014/03/15
- [elpa] 217/255: sorting columns, Eric Schulte, 2014/03/15
- [elpa] 216/255: small list buffer tweaks, Eric Schulte, 2014/03/15
- [elpa] 238/255: wrap go-re-cond in save-match-data, Eric Schulte, 2014/03/15
- [elpa] 223/255: use igs-re-cond to handle prompts, Eric Schulte, 2014/03/15
- [elpa] 224/255: handle IGS shouts, Eric Schulte, 2014/03/15
- [elpa] 226/255: remove shouts from comments, Eric Schulte, 2014/03/15