diff options
| -rw-r--r-- | lisp/server.el | 40 |
1 files changed, 24 insertions, 16 deletions
diff --git a/lisp/server.el b/lisp/server.el index f94fb7e3ebb..d614e9c789b 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -185,7 +185,7 @@ Prefix arg means just kill any existing server communications subprocess." | |||
| 185 | ;; process each line individually. | 185 | ;; process each line individually. |
| 186 | (while (string-match "\n" string) | 186 | (while (string-match "\n" string) |
| 187 | (let ((request (substring string 0 (match-beginning 0))) | 187 | (let ((request (substring string 0 (match-beginning 0))) |
| 188 | client | 188 | client nowait |
| 189 | (files nil) | 189 | (files nil) |
| 190 | (lineno 1)) | 190 | (lineno 1)) |
| 191 | ;; Remove this line from STRING. | 191 | ;; Remove this line from STRING. |
| @@ -197,23 +197,27 @@ Prefix arg means just kill any existing server communications subprocess." | |||
| 197 | (setq request (substring request (match-end 0))) | 197 | (setq request (substring request (match-end 0))) |
| 198 | (setq client (list (substring request 0 (string-match " " request)))) | 198 | (setq client (list (substring request 0 (string-match " " request)))) |
| 199 | (setq request (substring request (match-end 0))) | 199 | (setq request (substring request (match-end 0))) |
| 200 | (setq foofoo request) | ||
| 200 | (while (string-match "[^ ]+ " request) | 201 | (while (string-match "[^ ]+ " request) |
| 201 | (let ((arg | 202 | (let ((arg |
| 202 | (substring request (match-beginning 0) (1- (match-end 0))))) | 203 | (substring request (match-beginning 0) (1- (match-end 0))))) |
| 203 | (setq request (substring request (match-end 0))) | 204 | (setq request (substring request (match-end 0))) |
| 204 | (if (string-match "\\`\\+[0-9]+\\'" arg) | 205 | (if (string-match "\\`-nowait" arg) |
| 205 | ;; ARG is a line number option. | 206 | (setq nowait t) |
| 206 | (setq lineno (read (substring arg 1))) | 207 | (if (string-match "\\`\\+[0-9]+\\'" arg) |
| 207 | ;; ARG is a file name. | 208 | ;; ARG is a line number option. |
| 208 | ;; Collapse multiple slashes to single slashes. | 209 | (setq lineno (read (substring arg 1))) |
| 209 | (setq arg (command-line-normalize-file-name arg)) | 210 | ;; ARG is a file name. |
| 210 | (setq files | 211 | ;; Collapse multiple slashes to single slashes. |
| 211 | (cons (list arg lineno) | 212 | (setq arg (command-line-normalize-file-name arg)) |
| 212 | files)) | 213 | (setq files |
| 213 | (setq lineno 1)))) | 214 | (cons (list arg lineno) |
| 214 | (server-visit-files files client) | 215 | files)) |
| 216 | (setq lineno 1))))) | ||
| 217 | (server-visit-files files client nowait) | ||
| 215 | ;; CLIENT is now a list (CLIENTNUM BUFFERS...) | 218 | ;; CLIENT is now a list (CLIENTNUM BUFFERS...) |
| 216 | (setq server-clients (cons client server-clients)) | 219 | (or nowait |
| 220 | (setq server-clients (cons client server-clients))) | ||
| 217 | (server-switch-buffer (nth 1 client)) | 221 | (server-switch-buffer (nth 1 client)) |
| 218 | (run-hooks 'server-switch-hook) | 222 | (run-hooks 'server-switch-hook) |
| 219 | (message (substitute-command-keys | 223 | (message (substitute-command-keys |
| @@ -221,9 +225,11 @@ Prefix arg means just kill any existing server communications subprocess." | |||
| 221 | ;; Save for later any partial line that remains. | 225 | ;; Save for later any partial line that remains. |
| 222 | (setq server-previous-string string)) | 226 | (setq server-previous-string string)) |
| 223 | 227 | ||
| 224 | (defun server-visit-files (files client) | 228 | (defun server-visit-files (files client &optional nowait) |
| 225 | "Finds FILES and returns the list CLIENT with the buffers nconc'd. | 229 | "Finds FILES and returns the list CLIENT with the buffers nconc'd. |
| 226 | FILES is an alist whose elements are (FILENAME LINENUMBER)." | 230 | FILES is an alist whose elements are (FILENAME LINENUMBER). |
| 231 | NOWAIT non-nil means this client is not waiting for the results, | ||
| 232 | so don't mark these buffers specially, just visit them normally." | ||
| 227 | ;; Bind last-nonmenu-event to force use of keyboard, not mouse, for queries. | 233 | ;; Bind last-nonmenu-event to force use of keyboard, not mouse, for queries. |
| 228 | (let (client-record (last-nonmenu-event t) (obuf (current-buffer))) | 234 | (let (client-record (last-nonmenu-event t) (obuf (current-buffer))) |
| 229 | ;; Restore the current buffer afterward, but not using save-excursion, | 235 | ;; Restore the current buffer afterward, but not using save-excursion, |
| @@ -249,7 +255,9 @@ FILES is an alist whose elements are (FILENAME LINENUMBER)." | |||
| 249 | (set-buffer (find-file-noselect filen)) | 255 | (set-buffer (find-file-noselect filen)) |
| 250 | (run-hooks 'server-visit-hook))) | 256 | (run-hooks 'server-visit-hook))) |
| 251 | (goto-line (nth 1 (car files))) | 257 | (goto-line (nth 1 (car files))) |
| 252 | (setq server-buffer-clients (cons (car client) server-buffer-clients)) | 258 | (if (not nowait) |
| 259 | (setq server-buffer-clients | ||
| 260 | (cons (car client) server-buffer-clients))) | ||
| 253 | (setq client-record (cons (current-buffer) client-record)) | 261 | (setq client-record (cons (current-buffer) client-record)) |
| 254 | (setq files (cdr files))) | 262 | (setq files (cdr files))) |
| 255 | (set-buffer obuf)) | 263 | (set-buffer obuf)) |