# HG changeset patch # User Richard M. Stallman # Date 660978765 0 # Node ID f3f3651d2520425124163152d15c46ec378787d7 # Parent 6e5406a8359dbc2c3f2995d02950182433e60279 *** empty log message *** diff -r 6e5406a8359d -r f3f3651d2520 lisp/server.el --- a/lisp/server.el Tue Dec 11 22:39:57 1990 +0000 +++ b/lisp/server.el Wed Dec 12 05:12:45 1990 +0000 @@ -75,6 +75,8 @@ (defvar server-process nil "the current server process") +(defvar server-previous-string "") + (defvar server-clients nil "List of current server clients. Each element is (CLIENTID FILES...) where CLIENTID is a string @@ -144,9 +146,14 @@ ;Format of STRING is "Client: CLIENTID PATH PATH PATH... \n" (defun server-process-filter (proc string) (server-log string) - (if (not (eq 0 (string-match "Client: " string))) - nil + (setq string (concat server-previous-string string)) + (if (not (and (eq ?\n (aref string (1- (length string)))) + (eq 0 (string-match "Client: " string)))) + ;; If input is not complete, save it for later. + (setq server-previous-string string) + ;; If it is complete, process it now, and discard what was saved. (setq string (substring string (match-end 0))) + (setq server-previous-string "") (let ((client (list (substring string 0 (string-match " " string)))) (files nil) (lineno 1))