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

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

[elpa] 154/255: don't quit main back-end when quitting a board


From: Eric Schulte
Subject: [elpa] 154/255: don't quit main back-end when quitting a board
Date: Sun, 16 Mar 2014 01:02:38 +0000

eschulte pushed a commit to branch go
in repository elpa.

commit 08ad8cdde661fd9dda33566920c42466db6b0111
Author: Eric Schulte <address@hidden>
Date:   Sun Jun 3 11:44:21 2012 -0600

    don't quit main back-end when quitting a board
---
 go-board.el |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/go-board.el b/go-board.el
index a946a92..a36884a 100644
--- a/go-board.el
+++ b/go-board.el
@@ -251,11 +251,16 @@
 
 
 ;;; User input
+(defmacro with-trackers (sym &rest body)
+  (declare (indent 1))
+  `(ignoring-unsupported
+    (mapcar (lambda (tr) (let ((,sym tr)) ,@body)) *trackers*)))
+
 (defmacro with-backends (sym &rest body)
   (declare (indent 1))
   `(ignoring-unsupported
     (prog1 (let ((,sym *back-end*)) ,@body)
-      (mapcar (lambda (tr) (let ((,sym tr)) ,@body)) *trackers*))))
+      (with-trackers ,sym ,@body))))
 
 (defvar go-board-actions '(move resign undo comment)
   "List of actions which may be taken on an GO board.")
@@ -323,7 +328,7 @@
           (message "pass")
         (apply-turn-to-board
          (cons move (ignoring-unsupported (go-labels *back-end*)))))
-      (mapcar (lambda (tr) (setf (go-move tr) move)) *trackers*)
+      (with-trackers tr (setf (go-move tr) move))
       (goto-char (point-of-pos (cddr move))))
     (setf *turn* (other-color *turn*))))
 
@@ -333,7 +338,7 @@
 
 (defun go-board-quit ()
   (interactive)
-  (with-backends back (go-quit back))
+  (with-trackers tr (go-quit tr))
   (kill-buffer (current-buffer)))
 
 
@@ -383,7 +388,7 @@
   (with-board board
     (apply-turn-to-board (list move))
     (goto-char (point-of-pos (cddr move)))
-    (mapcar (lambda (tr) (setf (go-move tr) move)) *trackers*)
+    (with-trackers tr (setf (go-move tr) move))
     (setf *turn* (other-color *turn*))))
 
 (defmethod go-labels ((board board))



reply via email to

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