diff options
| author | Richard M. Stallman <rms@gnu.org> | 1990-12-12 05:12:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1990-12-12 05:12:45 +0000 |
| commit | b53d289e7aa61b4abdb9d068d8fcb434c688258a (patch) | |
| tree | 7580562c2caf1eb9db2ce87591c169530024e38c /lisp | |
| parent | 82febc13c38f2178346365e8cb20f6e93a4ae7df (diff) | |
| download | emacs-b53d289e7aa61b4abdb9d068d8fcb434c688258a.tar.gz | |
*** empty log message ***
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/server.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/server.el b/lisp/server.el index ea2defdd161..f6518777d2c 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -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 @@ Prefix arg means just kill any existing server communications subprocess." ;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)) |
