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

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

[elpa] 02/03: [gnugo int] Hang the sync-return-stash on the process obje


From: Thien-Thi Nguyen
Subject: [elpa] 02/03: [gnugo int] Hang the sync-return-stash on the process object.
Date: Sat, 08 Feb 2014 09:57:23 +0000

ttn pushed a commit to branch ttn-gnugo
in repository elpa.

commit 1ce0c7a1e5c06cd4723359f0e80f49bdaa646178
Author: Thien-Thi Nguyen <address@hidden>
Date:   Fri Feb 7 10:34:22 2014 +0100

    [gnugo int] Hang the sync-return-stash on the process object.
    
    * packages/gnugo/gnugo.el (gnugo-synchronous-send/return):
    Don't use ‘gnugo-put’, ‘gnugo-get’; instead, use
    ‘process-put’, ‘process-get’ with property ‘:srs’.
---
 packages/gnugo/ChangeLog |    8 ++++++++
 packages/gnugo/gnugo.el  |   15 ++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/packages/gnugo/ChangeLog b/packages/gnugo/ChangeLog
index 742b059..228fc3d 100644
--- a/packages/gnugo/ChangeLog
+++ b/packages/gnugo/ChangeLog
@@ -1,5 +1,13 @@
 2014-02-07  Thien-Thi Nguyen  <address@hidden>
 
+       [gnugo int] Hang the sync-return-stash on the process object.
+
+       * gnugo.el (gnugo-synchronous-send/return):
+       Don't use ‘gnugo-put’, ‘gnugo-get’; instead, use
+       ‘process-put’, ‘process-get’ with property ‘:srs’.
+
+2014-02-07  Thien-Thi Nguyen  <address@hidden>
+
        [gnugo] Give names and docstrings to ‘lambda’ commands.
 
        * gnugo.el (gnugo-quit, gnugo-leave-me-alone)
diff --git a/packages/gnugo/gnugo.el b/packages/gnugo/gnugo.el
index 4ca0da0..dfa557f 100644
--- a/packages/gnugo/gnugo.el
+++ b/packages/gnugo/gnugo.el
@@ -326,22 +326,23 @@ Handle the big, slow-to-render, and/or uninteresting ones 
specially."
 STRING omits the two trailing newlines.  See also `gnugo-query'."
   (when (gnugo-get :waitingp)
     (error "Sorry, still waiting for %s to play" (gnugo-get :gnugo-color)))
-  (gnugo-put :sync-return "")
   (let ((proc (gnugo-get :proc)))
+    (process-put proc :srs "")          ; synchronous return stash
     (set-process-filter
      proc (lambda (proc string)
-            (let* ((so-far (gnugo-get :sync-return))
+            (let* ((so-far (process-get proc :srs))
                    (start  (max 0 (- (length so-far) 2))) ; backtrack a little
-                   (full   (gnugo-put :sync-return (concat so-far string))))
+                   (full   (concat so-far string)))
+              (process-put proc :srs full)
               (when (string-match "\n\n" full start)
-                (gnugo-put :sync-return
-                  (cons (current-time) (substring full 0 -2)))))))
+                (process-put proc :srs (cons (current-time)
+                                             (substring full 0 -2)))))))
     (gnugo-send-line message)
     (let (rv)
       ;; type change => break
-      (while (stringp (setq rv (gnugo-get :sync-return)))
+      (while (stringp (setq rv (process-get proc :srs)))
         (accept-process-output proc 30))
-      (gnugo-put :sync-return "")
+      (process-put proc :srs "")
       rv)))
 
 (defun gnugo-query (message-format &rest args)



reply via email to

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