diff options
| author | Stefan Monnier | 2010-03-05 18:08:18 -0500 |
|---|---|---|
| committer | Stefan Monnier | 2010-03-05 18:08:18 -0500 |
| commit | c0335e02ec7778c10fa110d8953f15990110e04b (patch) | |
| tree | 5590b260ef5def04995f56862de4cde46f19ef59 /src | |
| parent | e8defde36d0d4ab3dadd7f4a561a8c47ce110f9b (diff) | |
| download | emacs-c0335e02ec7778c10fa110d8953f15990110e04b.tar.gz emacs-c0335e02ec7778c10fa110d8953f15990110e04b.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/bytecode.c | 1 | ||||
| -rw-r--r-- | src/lisp.h | 23 |
3 files changed, 12 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index f7226d6fc6f..ce4fe1cd7b4 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2010-03-05 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2010-03-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | Make it possible to C-g in a tight bytecode loop again (bug#5680). | ||
| 4 | * lisp.h (ELSE_PENDING_SIGNALS): New macro. | ||
| 5 | (QUIT): Use it to consolidate code and remove redundancy. | ||
| 6 | * bytecode.c (BYTE_CODE_QUIT): Use it as well. | ||
| 7 | |||
| 3 | * regex.c (regex_compile): Setup gl_state as well. | 8 | * regex.c (regex_compile): Setup gl_state as well. |
| 4 | 9 | ||
| 5 | * syntax.c (skip_chars): Setup gl_state (bug#3823). | 10 | * syntax.c (skip_chars): Setup gl_state (bug#3823). |
diff --git a/src/bytecode.c b/src/bytecode.c index 31df65fd303..e95614c72a9 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -393,6 +393,7 @@ unmark_byte_stack () | |||
| 393 | Fsignal (Qquit, Qnil); \ | 393 | Fsignal (Qquit, Qnil); \ |
| 394 | AFTER_POTENTIAL_GC (); \ | 394 | AFTER_POTENTIAL_GC (); \ |
| 395 | } \ | 395 | } \ |
| 396 | ELSE_PENDING_SIGNALS \ | ||
| 396 | } while (0) | 397 | } while (0) |
| 397 | 398 | ||
| 398 | 399 | ||
diff --git a/src/lisp.h b/src/lisp.h index 7032a3f48f4..7f5d5df66c6 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1933,22 +1933,12 @@ extern char *stack_bottom; | |||
| 1933 | #ifdef SYNC_INPUT | 1933 | #ifdef SYNC_INPUT |
| 1934 | extern void process_pending_signals P_ ((void)); | 1934 | extern void process_pending_signals P_ ((void)); |
| 1935 | extern int pending_signals; | 1935 | extern int pending_signals; |
| 1936 | 1936 | #define ELSE_PENDING_SIGNALS \ | |
| 1937 | #define QUIT \ | 1937 | else if (pending_signals) \ |
| 1938 | do { \ | 1938 | process_pending_signals (); |
| 1939 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ | ||
| 1940 | { \ | ||
| 1941 | Lisp_Object flag = Vquit_flag; \ | ||
| 1942 | Vquit_flag = Qnil; \ | ||
| 1943 | if (EQ (Vthrow_on_input, flag)) \ | ||
| 1944 | Fthrow (Vthrow_on_input, Qt); \ | ||
| 1945 | Fsignal (Qquit, Qnil); \ | ||
| 1946 | } \ | ||
| 1947 | else if (pending_signals) \ | ||
| 1948 | process_pending_signals (); \ | ||
| 1949 | } while (0) | ||
| 1950 | |||
| 1951 | #else /* not SYNC_INPUT */ | 1939 | #else /* not SYNC_INPUT */ |
| 1940 | #define ELSE_PENDING_SIGNALS | ||
| 1941 | #endif /* not SYNC_INPUT */ | ||
| 1952 | 1942 | ||
| 1953 | #define QUIT \ | 1943 | #define QUIT \ |
| 1954 | do { \ | 1944 | do { \ |
| @@ -1960,10 +1950,9 @@ extern int pending_signals; | |||
| 1960 | Fthrow (Vthrow_on_input, Qt); \ | 1950 | Fthrow (Vthrow_on_input, Qt); \ |
| 1961 | Fsignal (Qquit, Qnil); \ | 1951 | Fsignal (Qquit, Qnil); \ |
| 1962 | } \ | 1952 | } \ |
| 1953 | ELSE_PENDING_SIGNALS \ | ||
| 1963 | } while (0) | 1954 | } while (0) |
| 1964 | 1955 | ||
| 1965 | #endif /* not SYNC_INPUT */ | ||
| 1966 | |||
| 1967 | 1956 | ||
| 1968 | /* Nonzero if ought to quit now. */ | 1957 | /* Nonzero if ought to quit now. */ |
| 1969 | 1958 | ||