summaryrefslogtreecommitdiff
path: root/lisp/frame.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1994-09-29 04:48:59 +0000
committerRichard M. Stallman <rms@gnu.org>1994-09-29 04:48:59 +0000
commita4e0ab2942a7712ee5e6839a8475e5e9b2289345 (patch)
tree530ba1b5e9300713d282943e1999c4743ef03d51 /lisp/frame.el
parentd8408314cc9d5dbef9b1912d7abc3294f3be27c1 (diff)
downloademacs-a4e0ab2942a7712ee5e6839a8475e5e9b2289345.tar.gz
(handle-delete-frame): New function.
Diffstat (limited to 'lisp/frame.el')
-rw-r--r--lisp/frame.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisp/frame.el b/lisp/frame.el
index f71a0a22e53..39cb483acc3 100644
--- a/lisp/frame.el
+++ b/lisp/frame.el
@@ -105,6 +105,21 @@ These supersede the values given in `default-frame-alist'.")
(frame-selected-window frame))))))
(setq special-display-function 'special-display-popup-frame)
+
+;; Handle delete-frame events from the X server.
+(defun handle-delete-frame (event)
+ (interactive "e")
+ (let ((frame (posn-window (event-start event)))
+ (i 0)
+ (tail (frame-list)))
+ (while tail
+ (and (frame-visible-p (car tail))
+ (not (eq (car tail) frame))
+ (setq i (1+ i)))
+ (setq tail (cdr tail)))
+ (if (> i 0)
+ (delete-frame frame t)
+ (kill-emacs))))
;;;; Arrangement of frames at startup