[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 01/04: [gnugo int] Add abstraction: gnugo--nquery
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 01/04: [gnugo int] Add abstraction: gnugo--nquery |
Date: |
Sat, 19 Apr 2014 18:33:33 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit c5805655a06c8cb82bd52dcc806b8e742c5cda76
Author: Thien-Thi Nguyen <address@hidden>
Date: Sat Apr 19 18:45:45 2014 +0200
[gnugo int] Add abstraction: gnugo--nquery
* packages/gnugo/gnugo.el (gnugo--nquery): New func.
(gnugo): Use ‘gnugo--nquery’.
(:gnugo-gtp-command-spec): Likewise.
---
packages/gnugo/gnugo.el | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 1063ebd..60a1270 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -425,6 +425,9 @@ when you are sure the command cannot fail."
(substring (apply 'gnugo--q message-format args)
2))
+(defun gnugo--nquery (cmd)
+ (string-to-number (gnugo-query cmd)))
+
(defun gnugo-lsquery (message-format &rest args)
(split-string (apply 'gnugo-query message-format args)))
@@ -2475,7 +2478,7 @@ starting a new one. See `gnugo-board-mode' documentation
for more info."
in '((board-size "query_boardsize")
(komi "get_komi")
(handicap "get_handicap"))
- do (set prop (string-to-number (gnugo-query q)))))
+ do (set prop (gnugo--nquery q))))
(gnugo-put :diamond (substring (process-name proc) 5))
(gnugo-put :gnugo-color (gnugo-other user-color))
(gnugo--SZ! board-size)
@@ -2660,9 +2663,7 @@ starting a new one. See `gnugo-board-mode' documentation
for more info."
(gnugo--unclose-game)
(gnugo--forget :last-mover)
;; ugh
- (gnugo--SZ! (string-to-number
- (gnugo-query
- "query_boardsize")))
+ (gnugo--SZ! (gnugo--nquery "query_boardsize"))
(gnugo-refresh t)))
(deffull loadsgf