aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1994-10-01 21:25:41 +0000
committerRichard M. Stallman1994-10-01 21:25:41 +0000
commitbbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e (patch)
tree12f00f673c1459054f76d6c64935ed53a3154917
parentd134b17bcba3fa0818bfc7f3588c12ac16e01727 (diff)
downloademacs-bbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e.tar.gz
emacs-bbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e.zip
(head_table): Set up Qdelete_frame.
(kbd_buffer_get_event): Handle delete_window_event by making a delete-frame event.
-rw-r--r--src/keyboard.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 0edf29bd3bd..a4552f9e2b9 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -393,6 +393,7 @@ int mouse_moved;
393Lisp_Object Qmouse_movement; 393Lisp_Object Qmouse_movement;
394Lisp_Object Qscroll_bar_movement; 394Lisp_Object Qscroll_bar_movement;
395Lisp_Object Qswitch_frame; 395Lisp_Object Qswitch_frame;
396Lisp_Object Qdelete_frame;
396 397
397/* Symbols to denote kinds of events. */ 398/* Symbols to denote kinds of events. */
398Lisp_Object Qfunction_key; 399Lisp_Object Qfunction_key;
@@ -2130,25 +2131,9 @@ kbd_buffer_get_event ()
2130#ifdef HAVE_X11 2131#ifdef HAVE_X11
2131 else if (event->kind == delete_window_event) 2132 else if (event->kind == delete_window_event)
2132 { 2133 {
2133 Lisp_Object tail, frame; 2134 /* Make an event (delete-frame (FRAME)). */
2134 struct frame *f; 2135 obj = Fcons (event->frame_or_window, Qnil);
2135 2136 obj = Fcons (intern ("delete-frame"), Fcons (obj, Qnil));
2136 /* If the user destroys the only frame, Emacs should exit.
2137 Count visible frames and iconified frames. */
2138 for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr)
2139 {
2140 frame = XCONS (tail)->car;
2141 if (!FRAMEP (frame) || EQ (frame, event->frame_or_window))
2142 continue;
2143 f = XFRAME (frame);
2144 if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f))
2145 break;
2146 }
2147
2148 if (! CONSP (tail))
2149 Fkill_emacs (Qnil);
2150
2151 Fdelete_frame (event->frame_or_window, Qt);
2152 kbd_fetch_ptr = event + 1; 2137 kbd_fetch_ptr = event + 1;
2153 } 2138 }
2154#endif 2139#endif
@@ -5509,10 +5494,8 @@ control, run a subshell instead.\n\n\
5509If optional arg STUFFSTRING is non-nil, its characters are stuffed\n\ 5494If optional arg STUFFSTRING is non-nil, its characters are stuffed\n\
5510to be read as terminal input by Emacs's parent, after suspension.\n\ 5495to be read as terminal input by Emacs's parent, after suspension.\n\
5511\n\ 5496\n\
5512Before suspending, call the functions in `suspend-hook' with no args.\n\ 5497Before suspending, run the normal hook `suspend-hook'.\n\
5513If any of them returns nil, don't call the rest and don't suspend.\n\ 5498After resumption run the normal hook `suspend-resume-hook'.\n\
5514Otherwise, suspend normally and after resumption run the normal hook\n\
5515`suspend-resume-hook' if that is bound and non-nil.\n\
5516\n\ 5499\n\
5517Some operating systems cannot stop the Emacs process and resume it later.\n\ 5500Some operating systems cannot stop the Emacs process and resume it later.\n\
5518On such systems, Emacs starts a subshell instead of suspending.") 5501On such systems, Emacs starts a subshell instead of suspending.")
@@ -5937,6 +5920,7 @@ struct event_head head_table[] = {
5937 &Qmouse_movement, "mouse-movement", &Qmouse_movement, 5920 &Qmouse_movement, "mouse-movement", &Qmouse_movement,
5938 &Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement, 5921 &Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement,
5939 &Qswitch_frame, "switch-frame", &Qswitch_frame, 5922 &Qswitch_frame, "switch-frame", &Qswitch_frame,
5923 &Qdelete_frame, "delete-frame", &Qdelete_frame,
5940}; 5924};
5941 5925
5942syms_of_keyboard () 5926syms_of_keyboard ()