comparison src/xterm.c @ 93369:ed10c3092847

* keyboard.c (pending_funcalls): New var. (timer_check): Run it. (syms_of_keyboard): Initialize it. * terminal.c (Qrun_hook_with_args, Qdelete_terminal_functions) (Vdelete_terminal_functions): New vars. (syms_of_terminal): Initialize them. (Fdelete_terminal): Run delete-terminal-functions. * xdisp.c (safe_eval): Rewrite. (safe_call2): New fun. * frame.c (Qdelete_frame_functions): New var. (syms_of_frame): Initialize it. (Fdelete_frame): Use it and use safe_call2 and pending_funcalls. * lisp.h (safe_call2, pending_funcalls): Declare.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Sat, 29 Mar 2008 01:46:10 +0000
parents e3c5f1568f5c
children 5901a9d70af5
comparison
equal deleted inserted replaced
93368:411d7b7dfe32 93369:ed10c3092847
8142 dpyinfo->terminal->reference_count--; 8142 dpyinfo->terminal->reference_count--;
8143 if (dpyinfo->reference_count != 0) 8143 if (dpyinfo->reference_count != 0)
8144 /* We have just closed all frames on this display. */ 8144 /* We have just closed all frames on this display. */
8145 abort (); 8145 abort ();
8146 8146
8147 x_delete_display (dpyinfo); 8147 {
8148 Lisp_Object tmp;
8149 XSETTERMINAL (tmp, dpyinfo->terminal);
8150 Fdelete_terminal (tmp, Qnoelisp);
8151 }
8148 } 8152 }
8149 8153
8150 x_uncatch_errors (); 8154 x_uncatch_errors ();
8151 8155
8152 if (terminal_list == 0) 8156 if (terminal_list == 0)
8163 sigunblock (sigmask (SIGALRM)); 8167 sigunblock (sigmask (SIGALRM));
8164 TOTALLY_UNBLOCK_INPUT; 8168 TOTALLY_UNBLOCK_INPUT;
8165 8169
8166 unbind_to (index, Qnil); 8170 unbind_to (index, Qnil);
8167 clear_waiting_for_input (); 8171 clear_waiting_for_input ();
8168 /* FIXME: This is an asynchronous interrupt w.r.t elisp, so signalling an 8172 /* Here, we absolutely have to use a non-local exit (e.g. signal, throw,
8169 error might not be the best thing to do. I'd vote for creating an 8173 longjmp), because returning from this function would get us back into
8170 elisp event and stuffing it in the queue so people can bind to it via 8174 Xlib's code which will directly call `exit'. */
8171 the global map. --Stef */
8172 error ("%s", error_msg); 8175 error ("%s", error_msg);
8173 } 8176 }
8174 8177
8175 /* We specifically use it before defining it, so that gcc doesn't inline it, 8178 /* We specifically use it before defining it, so that gcc doesn't inline it,
8176 otherwise gdb doesn't know how to properly put a breakpoint on it. */ 8179 otherwise gdb doesn't know how to properly put a breakpoint on it. */