Make it possible to C-g in a tight bytecode loop again (bug#5680).

* lisp.h (ELSE_PENDING_SIGNALS): New macro.
(QUIT): Use it to consolidate code and remove redundancy.
* bytecode.c (BYTE_CODE_QUIT): Use it as well.
This commit is contained in:
Stefan Monnier 2010-03-05 18:08:18 -05:00
parent e8defde36d
commit c0335e02ec
3 changed files with 12 additions and 17 deletions

View file

@ -1,5 +1,10 @@
2010-03-05 Stefan Monnier <monnier@iro.umontreal.ca>
Make it possible to C-g in a tight bytecode loop again (bug#5680).
* lisp.h (ELSE_PENDING_SIGNALS): New macro.
(QUIT): Use it to consolidate code and remove redundancy.
* bytecode.c (BYTE_CODE_QUIT): Use it as well.
* regex.c (regex_compile): Setup gl_state as well.
* syntax.c (skip_chars): Setup gl_state (bug#3823).

View file

@ -393,6 +393,7 @@ unmark_byte_stack ()
Fsignal (Qquit, Qnil); \
AFTER_POTENTIAL_GC (); \
} \
ELSE_PENDING_SIGNALS \
} while (0)

View file

@ -1933,22 +1933,12 @@ extern char *stack_bottom;
#ifdef SYNC_INPUT
extern void process_pending_signals P_ ((void));
extern int pending_signals;
#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, Qt); \
Fsignal (Qquit, Qnil); \
} \
else if (pending_signals) \
process_pending_signals (); \
} while (0)
#define ELSE_PENDING_SIGNALS \
else if (pending_signals) \
process_pending_signals ();
#else /* not SYNC_INPUT */
#define ELSE_PENDING_SIGNALS
#endif /* not SYNC_INPUT */
#define QUIT \
do { \
@ -1960,10 +1950,9 @@ extern int pending_signals;
Fthrow (Vthrow_on_input, Qt); \
Fsignal (Qquit, Qnil); \
} \
ELSE_PENDING_SIGNALS \
} while (0)
#endif /* not SYNC_INPUT */
/* Nonzero if ought to quit now. */