From 10108c219e6823c43e2e1de2d904ba8b1d4e42ab Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Wed, 2 Apr 2014 15:11:06 +0200 Subject: ICC seek removal was broken as well. --- chess-ics.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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))) -- cgit v1.2.3