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

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

[elpa] 03/04: [gnugo int] Couple :center-position and :SZ jamming.


From: Thien-Thi Nguyen
Subject: [elpa] 03/04: [gnugo int] Couple :center-position and :SZ jamming.
Date: Sat, 19 Apr 2014 18:33:34 +0000

ttn pushed a commit to branch master
in repository elpa.

commit 865029c41ee73c7b4ff310bb626009a8762b9e1d
Author: Thien-Thi Nguyen <address@hidden>
Date:   Sat Apr 19 19:35:27 2014 +0200

    [gnugo int] Couple :center-position and :SZ jamming.
    
    * packages/gnugo/gnugo.el (gnugo--SZ!):
    Convert to ‘defun’; also compute/assign :center-position.
    (gnugo): Don't compute :center-position explicitly,
    but do move point to it, after the refresh.
---
 packages/gnugo/gnugo.el |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 006fad5..06cabac 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -1850,8 +1850,12 @@ If FILENAME already exists, Emacs confirms that you wish 
to overwrite it."
 (defsubst gnugo--nodep (x)
   (keywordp (caar x)))
 
-(defsubst gnugo--SZ! (size)
-  (gnugo-put :SZ size))
+(defun gnugo--SZ! (size)
+  (gnugo-put :SZ size)
+  (gnugo-put :center-position
+    (funcall (gnugo--as-pos-func)
+             (let ((c (+ -1 ?a (truncate (1+ size) 2))))
+               (string c c)))))
 
 (defun gnugo--plant-and-climb (collection &optional sel)
   (gnugo-put :sgf-collection collection)
@@ -2510,11 +2514,7 @@ starting a new one.  See `gnugo-board-mode' 
documentation for more info."
                                              handicap)))))))
       (gnugo-put :waiting-start (current-time))
       (gnugo-refresh t)
-      (let ((half (truncate (1+ (gnugo-get :SZ)) 2)))
-        (gnugo-goto-pos (format "A%d" half))
-        (forward-char (* 2 (1- half)))
-        (gnugo-put :center-position
-          (get-text-property (point) 'gnugo-position)))
+      (gnugo-goto-pos (gnugo-get :center-position))
       ;; first move
       (gnugo-put :game-start-time (current-time))
       (let ((g (gnugo-get :gnugo-color))



reply via email to

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