summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Lang <mlang@delysid.org>2014-04-02 15:11:06 +0200
committerMario Lang <mlang@delysid.org>2014-04-02 15:11:06 +0200
commit10108c219e6823c43e2e1de2d904ba8b1d4e42ab (patch)
tree0d31a232d10462da7cf17862bfa3d9055d3897a5
parent07bc0bdd7aa4b071463181943bcc0ee0b769c993 (diff)
ICC seek removal was broken as well.
-rw-r--r--chess-ics.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/chess-ics.el b/chess-ics.el
index 0e0fbea..ec710f4 100644
--- a/chess-ics.el
+++ b/chess-ics.el
@@ -916,7 +916,12 @@ This function should be put on `comint-preoutput-filter-functions'."
(accept-process-output (get-buffer-process (current-buffer)) 0 100)))
(switch-to-buffer buf)))
+;;; ICC datagrams
+
+;; See http://www.chessclub.com/resources/formats/formats.txt
+
(defvar chess-icc-unprocessed nil)
+
(defun chess-icc-datagram-handler (string)
(if (not (string-match "^\\([0-9]+\\) \\(.*\\)$" string))
(format "\nUnknown datagram format: %s\n" string)
@@ -996,13 +1001,14 @@ This function should be put on `comint-preoutput-filter-functions'."
(with-current-buffer buf
(let ((here (point)))
(goto-char (point-min))
- (when (re-search-forward (concat "^" id " ") nil t)
+ (when (re-search-forward (concat "^\\s-*" id " ") nil t)
(delete-region (line-beginning-position)
(1+ (line-end-position))))
(goto-char here)))))
"")
(t
(format "\nIgnoring datagram DG%03d: %s\n" dg args))))))
+
(defun chess-icc-preoutput-filter (string)
(if chess-icc-unprocessed
(let ((string (concat chess-icc-unprocessed string)))