[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 27/51: [gnugo int] Hang the sync-return-stash on the process obje
From: |
Thien-Thi Nguyen |
Subject: |
[elpa] 27/51: [gnugo int] Hang the sync-return-stash on the process object. |
Date: |
Mon, 24 Feb 2014 12:30:22 +0000 |
ttn pushed a commit to branch master
in repository elpa.
commit f47c15f844a812b108c964a953cfbf8298c2f0c3
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/gnugo.el | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
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)
- [elpa] 06/51: [gnugo] Presume working time-date.el., (continued)
- [elpa] 06/51: [gnugo] Presume working time-date.el., Thien-Thi Nguyen, 2014/02/24
- [elpa] 19/51: [gnugo maint] Revamp "ChangeLog discipline" in HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 17/51: [gnugo] Indicate buffer not modified after save., Thien-Thi Nguyen, 2014/02/24
- [elpa] 20/51: [gnugo int] Avoid variable FO RMAT for ‘message’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 14/51: [gnugo int] Use ‘displ ay’ property more., Thien-Thi Nguyen, 2014/02/24
- [elpa] 15/51: [gnugo int] Use ‘(spli t-string STR SEP t)’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 23/51: [gnugo int] Drop unused local var., Thien-Thi Nguyen, 2014/02/24
- [elpa] 24/51: [gnugo int] Use ‘numbe r-sequence’ more., Thien-Thi Nguyen, 2014/02/24
- [elpa] 18/51: [gnugo maint] Update a musing item in HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 25/51: [gnugo int] Use cl-{plus,minus}p more., Thien-Thi Nguyen, 2014/02/24
- [elpa] 27/51: [gnugo int] Hang the sync-return-stash on the process object.,
Thien-Thi Nguyen <=
- [elpa] 22/51: [gnugo maint] Add .dir-locals.el file, link in HACKING; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 29/51: [gnugo] Indicate buffer not modified after load., Thien-Thi Nguyen, 2014/02/24
- [elpa] 30/51: [gnugo maint] Update NEWS file; nfc., Thien-Thi Nguyen, 2014/02/24
- [elpa] 34/51: [gnugo int] Use ‘set-p rocess-query-on-exit-flag’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 33/51: [gnugo int] Zonk unused local var., Thien-Thi Nguyen, 2014/02/24
- [elpa] 35/51: [gnugo int] Use ‘dolis t’ and ‘destructuring-bind’., Thien-Thi Nguyen, 2014/02/24
- [elpa] 28/51: [gnugo int] Drop leading "*" in docstrings., Thien-Thi Nguyen, 2014/02/24
- [elpa] 26/51: [gnugo] Give names and docstr ings to ‘lambda’ commands., Thien-Thi Nguyen, 2014/02/24
- [elpa] 38/51: [gnugo] Fix bug: Relax sync regexp., Thien-Thi Nguyen, 2014/02/24
- [elpa] 39/51: [gnugo] Don't show underscore in group-animation message., Thien-Thi Nguyen, 2014/02/24