Mercurial > emacs
comparison lisp/frame.el @ 83335:60208d3a0bb1
Handle and document that `delete-frame' may call functions in `delete-frame-functions' twice.
* src/frame.c (syms_of_frame): Add warning to `delete-frame-functions' description.
* lisp/frame.el (terminal-handle-delete-frame): Check that the frame is alive.
* lisp/server.el (server-handle-delete-frame): Ditto. Remove bogus comment.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-375
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Wed, 06 Jul 2005 01:41:56 +0000 |
parents | 40c0ee282254 |
children | 9216636c02fc |
comparison
equal
deleted
inserted
replaced
83334:6afa124501e6 | 83335:60208d3a0bb1 |
---|---|
1482 (defun terminal-handle-delete-frame (frame) | 1482 (defun terminal-handle-delete-frame (frame) |
1483 "Clean up terminal parameters of FRAME, if it's the last frame on its terminal." | 1483 "Clean up terminal parameters of FRAME, if it's the last frame on its terminal." |
1484 ;; XXX We assume that the display is closed immediately after the | 1484 ;; XXX We assume that the display is closed immediately after the |
1485 ;; last frame is deleted on it. It would be better to create a hook | 1485 ;; last frame is deleted on it. It would be better to create a hook |
1486 ;; called `delete-display-functions', and use it instead. | 1486 ;; called `delete-display-functions', and use it instead. |
1487 (when (= 1 (length (frames-on-display-list (frame-display frame)))) | 1487 (when (and (frame-live-p frame) |
1488 (= 1 (length (frames-on-display-list (frame-display frame))))) | |
1488 (setq terminal-parameter-alist | 1489 (setq terminal-parameter-alist |
1489 (assq-delete-all (frame-display frame) terminal-parameter-alist)))) | 1490 (assq-delete-all (frame-display frame) terminal-parameter-alist)))) |
1490 | 1491 |
1491 (add-hook 'delete-frame-functions 'terminal-handle-delete-frame) | 1492 (add-hook 'delete-frame-functions 'terminal-handle-delete-frame) |
1492 | 1493 |