[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: while-no-input
From: |
Kim F. Storm |
Subject: |
Re: while-no-input |
Date: |
Tue, 30 Nov 2004 15:56:02 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
Richard Stallman <address@hidden> writes:
> So here's my simpler proposal for how to implement this.
I tried it -- but I don't have SYNC_INPUT defined, so I used this:
#define QUIT \
do { \
if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \
{ \
Lisp_Object flag = Vquit_flag; \
Vquit_flag = Qnil; \
if (EQ (Vthrow_on_input, flag)) \
Fthrow (Vthrow_on_input, Qnil); \
Fsignal (Qquit, Qnil); \
} \
} while (0)
I then ran this code (in my normal emacs with cua-mode enabled):
(while-no-input
(while t
(prin1 "x")
(sit-for 0)))
and hit space after a few seconds. Got a crash:
Breakpoint 1, abort () at emacs.c:442
(gdb) xbacktrace
"cua--post-command-handler"
"run-hooks"
(gdb) bt
#0 abort () at emacs.c:442
#1 0x08182ae9 in Feval (form=140121845) at eval.c:2015
#2 0x081819e0 in Fcondition_case (args=145132605) at eval.c:1329
#3 0x081b7204 in Fbyte_code (bytestr=144710763, vector=144806556, maxdepth=24)
at bytecode.c:864
#4 0x08184383 in funcall_lambda (fun=144661804, nargs=0,
arg_vector=0xbfffd608) at eval.c:2959
#5 0x08183dcb in Ffuncall (nargs=1, args=0xbfffd604) at eval.c:2820
#6 0x081836c8 in run_hook_with_args (nargs=1, args=0xbfffd604,
cond=to_completion) at eval.c:2440
#7 0x081834bc in Frun_hooks (nargs=1, args=0xbfffd6d4) at eval.c:2308
#8 0x08183b46 in Ffuncall (nargs=2, args=0xbfffd6d0) at eval.c:2753
#9 0x0818386b in call1 (fn=137798905, arg1=137754665) at eval.c:2566
#10 0x0810cf01 in safe_run_hooks_1 (hook=0) at keyboard.c:2034
#11 0x08181b06 in internal_condition_case (bfun=0x810cee7 <safe_run_hooks_1>,
handlers=137698537, hfun=0x810cf06 <safe_run_hooks_error>) at eval.c:1382
#12 0x0810cf9c in safe_run_hooks (hook=137754665) at keyboard.c:2062
#13 0x0810c25b in command_loop_1 () at keyboard.c:1801
#14 0x08181b06 in internal_condition_case (bfun=0x810adbb <command_loop_1>,
handlers=137764305, hfun=0x810a900 <cmd_error>) at eval.c:1382
#15 0x0810ac33 in command_loop_2 () at keyboard.c:1309
#16 0x081815cc in internal_catch (tag=137756753, func=0x810ac14
<command_loop_2>, arg=137698489) at eval.c:1143
#17 0x0810abe6 in command_loop () at keyboard.c:1288
#18 0x0810a67f in recursive_edit_1 () at keyboard.c:981
#19 0x0810a7c0 in Frecursive_edit () at keyboard.c:1042
#20 0x0810911b in main (argc=3, argv=0xbfffdf04) at emacs.c:1742
#21 0x42015574 in __libc_start_main () from /lib/tls/libc.so.6
(gdb) p handling_signal
$1 = 1
(gdb) p interrupt_input_blocked
$2 = 0
(gdb)
Seems that we can break out of XTread_socket without restoring
handling_signal.
I don't know if it is sufficient to unwind protect it.
--
Kim F. Storm <address@hidden> http://www.cua.dk