diff options
| author | Richard M. Stallman | 1994-10-01 21:25:41 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-10-01 21:25:41 +0000 |
| commit | bbdc209278bfdd3bd1b32a743e8f99b9e0e8e75e (patch) | |
| tree | 12f00f673c1459054f76d6c64935ed53a3154917 /src | |
| parent | d134b17bcba3fa0818bfc7f3588c12ac16e01727 (diff) | |
| download | emacs-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.
Diffstat (limited to 'src')
| -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; | |||
| 393 | Lisp_Object Qmouse_movement; | 393 | Lisp_Object Qmouse_movement; |
| 394 | Lisp_Object Qscroll_bar_movement; | 394 | Lisp_Object Qscroll_bar_movement; |
| 395 | Lisp_Object Qswitch_frame; | 395 | Lisp_Object Qswitch_frame; |
| 396 | Lisp_Object Qdelete_frame; | ||
| 396 | 397 | ||
| 397 | /* Symbols to denote kinds of events. */ | 398 | /* Symbols to denote kinds of events. */ |
| 398 | Lisp_Object Qfunction_key; | 399 | Lisp_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\ | |||
| 5509 | If optional arg STUFFSTRING is non-nil, its characters are stuffed\n\ | 5494 | If optional arg STUFFSTRING is non-nil, its characters are stuffed\n\ |
| 5510 | to be read as terminal input by Emacs's parent, after suspension.\n\ | 5495 | to be read as terminal input by Emacs's parent, after suspension.\n\ |
| 5511 | \n\ | 5496 | \n\ |
| 5512 | Before suspending, call the functions in `suspend-hook' with no args.\n\ | 5497 | Before suspending, run the normal hook `suspend-hook'.\n\ |
| 5513 | If any of them returns nil, don't call the rest and don't suspend.\n\ | 5498 | After resumption run the normal hook `suspend-resume-hook'.\n\ |
| 5514 | Otherwise, 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\ |
| 5517 | Some operating systems cannot stop the Emacs process and resume it later.\n\ | 5500 | Some operating systems cannot stop the Emacs process and resume it later.\n\ |
| 5518 | On such systems, Emacs starts a subshell instead of suspending.") | 5501 | On 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 | ||
| 5942 | syms_of_keyboard () | 5926 | syms_of_keyboard () |