diff options
| author | Richard M. Stallman <rms@gnu.org> | 1994-10-01 21:25:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman <rms@gnu.org> | 1994-10-01 21:25:41 +0000 |
| commit | bbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e (patch) | |
| tree | 12f00f673c1459054f76d6c64935ed53a3154917 | |
| parent | d134b17bcba3fa0818bfc7f3588c12ac16e01727 (diff) | |
| download | emacs-bbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e.tar.gz | |
(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.c | 30 |
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; Lisp_Object Qmouse_movement; Lisp_Object Qscroll_bar_movement; Lisp_Object Qswitch_frame; +Lisp_Object Qdelete_frame; /* Symbols to denote kinds of events. */ Lisp_Object Qfunction_key; @@ -2130,25 +2131,9 @@ kbd_buffer_get_event () #ifdef HAVE_X11 else if (event->kind == delete_window_event) { - Lisp_Object tail, frame; - struct frame *f; - - /* If the user destroys the only frame, Emacs should exit. - Count visible frames and iconified frames. */ - for (tail = Vframe_list; CONSP (tail); tail = XCONS (tail)->cdr) - { - frame = XCONS (tail)->car; - if (!FRAMEP (frame) || EQ (frame, event->frame_or_window)) - continue; - f = XFRAME (frame); - if (FRAME_VISIBLE_P (f) || FRAME_ICONIFIED_P (f)) - break; - } - - if (! CONSP (tail)) - Fkill_emacs (Qnil); - - Fdelete_frame (event->frame_or_window, Qt); + /* Make an event (delete-frame (FRAME)). */ + obj = Fcons (event->frame_or_window, Qnil); + obj = Fcons (intern ("delete-frame"), Fcons (obj, Qnil)); kbd_fetch_ptr = event + 1; } #endif @@ -5509,10 +5494,8 @@ control, run a subshell instead.\n\n\ If optional arg STUFFSTRING is non-nil, its characters are stuffed\n\ to be read as terminal input by Emacs's parent, after suspension.\n\ \n\ -Before suspending, call the functions in `suspend-hook' with no args.\n\ -If any of them returns nil, don't call the rest and don't suspend.\n\ -Otherwise, suspend normally and after resumption run the normal hook\n\ -`suspend-resume-hook' if that is bound and non-nil.\n\ +Before suspending, run the normal hook `suspend-hook'.\n\ +After resumption run the normal hook `suspend-resume-hook'.\n\ \n\ Some operating systems cannot stop the Emacs process and resume it later.\n\ On such systems, Emacs starts a subshell instead of suspending.") @@ -5937,6 +5920,7 @@ struct event_head head_table[] = { &Qmouse_movement, "mouse-movement", &Qmouse_movement, &Qscroll_bar_movement, "scroll-bar-movement", &Qmouse_movement, &Qswitch_frame, "switch-frame", &Qswitch_frame, + &Qdelete_frame, "delete-frame", &Qdelete_frame, }; syms_of_keyboard () |
