diff options
| author | Karoly Lorentey | 2003-12-30 17:42:02 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2003-12-30 17:42:02 +0000 |
| commit | 22de1e79e7773ca95c6a6dddcdd408f3a3b7d5b2 (patch) | |
| tree | be0d75dec626a2c90029544d450adcbc3875c2ee | |
| parent | 7c3a26158711d76ee77b0bd75fa9df56db5eb57d (diff) | |
| download | emacs-22de1e79e7773ca95c6a6dddcdd408f3a3b7d5b2.tar.gz emacs-22de1e79e7773ca95c6a6dddcdd408f3a3b7d5b2.zip | |
Delete server frames on server restart.
lisp/server.el (server-start): Delete any remaining opened frames of
the previous server.
(server-sentinel, server-process-filter): Force deleting the frame.
(server-buffer-done): Ditto.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-25
| -rw-r--r-- | README.multi-tty | 24 | ||||
| -rw-r--r-- | lisp/server.el | 11 |
2 files changed, 20 insertions, 15 deletions
diff --git a/README.multi-tty b/README.multi-tty index 4d225a50c9c..0a938a555ad 100644 --- a/README.multi-tty +++ b/README.multi-tty | |||
| @@ -248,22 +248,10 @@ THINGS TO DO | |||
| 248 | Update: Some of these errors may have been caused by having more | 248 | Update: Some of these errors may have been caused by having more |
| 249 | file handles than FD_SETSIZE. | 249 | file handles than FD_SETSIZE. |
| 250 | 250 | ||
| 251 | ** Make parts of struct tty_output accessible from Lisp. The device | ||
| 252 | name and the type is sufficient. | ||
| 253 | |||
| 254 | ** Export delete_tty to the Lisp environment, for emacsclient. | ||
| 255 | |||
| 256 | ** Make sure C-g goes to the right frame. This is hard, as SIGINT | ||
| 257 | doesn't have a tty parameter. :-( | ||
| 258 | |||
| 259 | ** Find out why does Emacs abort when it wants to close its | 251 | ** Find out why does Emacs abort when it wants to close its |
| 260 | controlling tty. Hint: chan_process[] array. Hey, maybe | 252 | controlling tty. Hint: chan_process[] array. Hey, maybe |
| 261 | noninterrupt-IO would work, too? | 253 | noninterrupt-IO would work, too? |
| 262 | 254 | ||
| 263 | ** Implement support for starting an interactive Emacs session without | ||
| 264 | an initial frame. (The user would connect to it and open frames | ||
| 265 | later, with emacsclient.) Not necessarily a good idea. | ||
| 266 | |||
| 267 | ** Support raw secondary terminals. (Note that SIGIO works only on | 255 | ** Support raw secondary terminals. (Note that SIGIO works only on |
| 268 | the controlling terminal.) Hint: extend read_input_waiting() for | 256 | the controlling terminal.) Hint: extend read_input_waiting() for |
| 269 | multiple ttys and hopefully this will be fixed. | 257 | multiple ttys and hopefully this will be fixed. |
| @@ -274,6 +262,18 @@ THINGS TO DO | |||
| 274 | ** Issue with SIGIO: it needs to be disabled during redisplay. See if | 262 | ** Issue with SIGIO: it needs to be disabled during redisplay. See if |
| 275 | fcntl() kernel behaviour could be emulated by emacsclient. | 263 | fcntl() kernel behaviour could be emulated by emacsclient. |
| 276 | 264 | ||
| 265 | ** Make parts of struct tty_output accessible from Lisp. The device | ||
| 266 | name and the type is sufficient. | ||
| 267 | |||
| 268 | ** Export delete_tty to the Lisp environment, for emacsclient. | ||
| 269 | |||
| 270 | ** Make sure C-g goes to the right frame. This is hard, as SIGINT | ||
| 271 | doesn't have a tty parameter. :-( | ||
| 272 | |||
| 273 | ** Implement support for starting an interactive Emacs session without | ||
| 274 | an initial frame. (The user would connect to it and open frames | ||
| 275 | later, with emacsclient.) Not necessarily a good idea. | ||
| 276 | |||
| 277 | ** Move optimalization parameters (costs) from union output_data to | 277 | ** Move optimalization parameters (costs) from union output_data to |
| 278 | a backend-neutral per-device structure. | 278 | a backend-neutral per-device structure. |
| 279 | 279 | ||
diff --git a/lisp/server.el b/lisp/server.el index 401668138c4..9c841071a99 100644 --- a/lisp/server.el +++ b/lisp/server.el | |||
| @@ -187,7 +187,7 @@ are done with it in the server.") | |||
| 187 | (setq server-clients (delq client server-clients)) | 187 | (setq server-clients (delq client server-clients)) |
| 188 | (let ((frame (assq (car client) server-frames))) | 188 | (let ((frame (assq (car client) server-frames))) |
| 189 | (setq server-frames (delq frame server-frames)) | 189 | (setq server-frames (delq frame server-frames)) |
| 190 | (when (frame-live-p (cadr frame)) (delete-frame (cadr frame)))) | 190 | (when (frame-live-p (cadr frame)) (delete-frame (cadr frame) 'force))) |
| 191 | (dolist (buf (cdr client)) | 191 | (dolist (buf (cdr client)) |
| 192 | (with-current-buffer buf | 192 | (with-current-buffer buf |
| 193 | ;; Remove PROC from the clients of each buffer. | 193 | ;; Remove PROC from the clients of each buffer. |
| @@ -267,6 +267,11 @@ Prefix arg means just kill any existing server communications subprocess." | |||
| 267 | (while server-clients | 267 | (while server-clients |
| 268 | (let ((buffer (nth 1 (car server-clients)))) | 268 | (let ((buffer (nth 1 (car server-clients)))) |
| 269 | (server-buffer-done buffer))) | 269 | (server-buffer-done buffer))) |
| 270 | ;; Delete any remaining opened frames of the previous server. | ||
| 271 | (while server-frames | ||
| 272 | (let ((frame (cadar server-frames))) | ||
| 273 | (setq server-frames (cdr server-frames)) | ||
| 274 | (when frame-live-p frame (delete-frame frame 'force)))) | ||
| 270 | (unless leave-dead | 275 | (unless leave-dead |
| 271 | (if server-process | 276 | (if server-process |
| 272 | (server-log (message "Restarting server"))) | 277 | (server-log (message "Restarting server"))) |
| @@ -382,7 +387,7 @@ PROC is the server process. Format of STRING is \"PATH PATH PATH... \\n\"." | |||
| 382 | (progn | 387 | (progn |
| 383 | (let ((frame (assq (car client) server-frames))) | 388 | (let ((frame (assq (car client) server-frames))) |
| 384 | (setq server-frames (delq frame server-frames)) | 389 | (setq server-frames (delq frame server-frames)) |
| 385 | (when (frame-live-p (cadr frame)) (delete-frame (cadr frame)))) | 390 | (when (frame-live-p (cadr frame)) (delete-frame (cadr frame) 'force))) |
| 386 | (delete-process proc) | 391 | (delete-process proc) |
| 387 | (server-log "Close empty client" proc)) | 392 | (server-log "Close empty client" proc)) |
| 388 | ;; We visited some buffer for this client. | 393 | ;; We visited some buffer for this client. |
| @@ -471,7 +476,7 @@ FOR-KILLING if non-nil indicates that we are called from `kill-buffer'." | |||
| 471 | (unless (cdr client) | 476 | (unless (cdr client) |
| 472 | (let ((frame (assq (car client) server-frames))) | 477 | (let ((frame (assq (car client) server-frames))) |
| 473 | (setq server-frames (delq frame server-frames)) | 478 | (setq server-frames (delq frame server-frames)) |
| 474 | (when (frame-live-p (cadr frame)) (delete-frame (cadr frame)))) | 479 | (when (frame-live-p (cadr frame)) (delete-frame (cadr frame) 'force))) |
| 475 | (delete-process (car client)) | 480 | (delete-process (car client)) |
| 476 | (server-log "Close" (car client)) | 481 | (server-log "Close" (car client)) |
| 477 | (setq server-clients (delq client server-clients)))) | 482 | (setq server-clients (delq client server-clients)))) |