diff options
| -rw-r--r-- | lisp/server.el | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/lisp/server.el b/lisp/server.el index 321a61ed8bd..39c183a3fc5 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -100,8 +100,6 @@ | |||
| 100 | (defvar server-process nil | 100 | (defvar server-process nil |
| 101 | "The current server process.") | 101 | "The current server process.") |
| 102 | 102 | ||
| 103 | (defvar server-previous-strings nil) | ||
| 104 | |||
| 105 | (defvar server-clients nil | 103 | (defvar server-clients nil |
| 106 | "List of current server clients. | 104 | "List of current server clients. |
| 107 | Each element is (CLIENTID BUFFERS...) where CLIENTID is a string | 105 | Each element is (CLIENTID BUFFERS...) where CLIENTID is a string |
| @@ -179,9 +177,6 @@ are done with it in the server.") | |||
| 179 | (or (bolp) (newline))))) | 177 | (or (bolp) (newline))))) |
| 180 | 178 | ||
| 181 | (defun server-sentinel (proc msg) | 179 | (defun server-sentinel (proc msg) |
| 182 | ;; Purge server-previous-strings of the now irrelevant entry. | ||
| 183 | (setq server-previous-strings | ||
| 184 | (delq (assq proc server-previous-strings) server-previous-strings)) | ||
| 185 | (let ((client (assq proc server-clients))) | 180 | (let ((client (assq proc server-clients))) |
| 186 | ;; Remove PROC from the list of clients. | 181 | ;; Remove PROC from the list of clients. |
| 187 | (when client | 182 | (when client |
| @@ -282,10 +277,10 @@ Server mode runs a process that accepts commands from the | |||
| 282 | "Process a request from the server to edit some files. | 277 | "Process a request from the server to edit some files. |
| 283 | PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"." | 278 | PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"." |
| 284 | (server-log string proc) | 279 | (server-log string proc) |
| 285 | (let ((ps (assq proc server-previous-strings))) | 280 | (let ((prev (process-get proc 'previous-string))) |
| 286 | (when (cdr ps) | 281 | (when prev |
| 287 | (setq string (concat (cdr ps) string)) | 282 | (setq string (concat prev string)) |
| 288 | (setcdr ps nil))) | 283 | (process-put proc 'previous-string nil))) |
| 289 | ;; If the input is multiple lines, | 284 | ;; If the input is multiple lines, |
| 290 | ;; process each line individually. | 285 | ;; process each line individually. |
| 291 | (while (string-match "\n" string) | 286 | (while (string-match "\n" string) |
| @@ -362,9 +357,7 @@ PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"." | |||
| 362 | "When done with a buffer, type \\[server-edit]"))))))) | 357 | "When done with a buffer, type \\[server-edit]"))))))) |
| 363 | ;; Save for later any partial line that remains. | 358 | ;; Save for later any partial line that remains. |
| 364 | (when (> (length string) 0) | 359 | (when (> (length string) 0) |
| 365 | (let ((ps (assq proc server-previous-strings))) | 360 | (process-put proc 'previous-string string))) |
| 366 | (if ps (setcdr ps string) | ||
| 367 | (push (cons proc string) server-previous-strings))))) | ||
| 368 | 361 | ||
| 369 | (defun server-goto-line-column (file-line-col) | 362 | (defun server-goto-line-column (file-line-col) |
| 370 | (goto-line (nth 1 file-line-col)) | 363 | (goto-line (nth 1 file-line-col)) |