aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
authorPaul Eggert2017-02-01 15:18:43 -0800
committerPaul Eggert2017-02-01 15:23:19 -0800
commit33be50037c2b4cdb002538534e9915c6bad253b7 (patch)
tree04a387a7afb86c86c4eaea71175d6d9fd1c37047 /src/syntax.c
parent94ad13b93c6fc099a353c8eb27c00a68ee79a952 (diff)
downloademacs-33be50037c2b4cdb002538534e9915c6bad253b7.tar.gz
emacs-33be50037c2b4cdb002538534e9915c6bad253b7.zip
Remove immediate_quit.
The old code that sets and clears immediate_quit was ineffective except when Emacs is running in terminal mode, and has problematic race conditions anyway, so remove it. This will introduce some hangs when Emacs runs in terminal mode, and these hangs should be fixed in followup patches. * src/keyboard.c (immediate_quit): Remove. All uses removed.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/syntax.c b/src/syntax.c
index f9e4093765c..e713922bf10 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1426,7 +1426,6 @@ scan_words (register ptrdiff_t from, register EMACS_INT count)
1426 int ch0, ch1; 1426 int ch0, ch1;
1427 Lisp_Object func, pos; 1427 Lisp_Object func, pos;
1428 1428
1429 immediate_quit = true;
1430 maybe_quit (); 1429 maybe_quit ();
1431 1430
1432 SETUP_SYNTAX_TABLE (from, count); 1431 SETUP_SYNTAX_TABLE (from, count);
@@ -1436,10 +1435,7 @@ scan_words (register ptrdiff_t from, register EMACS_INT count)
1436 while (1) 1435 while (1)
1437 { 1436 {
1438 if (from == end) 1437 if (from == end)
1439 { 1438 return 0;
1440 immediate_quit = false;
1441 return 0;
1442 }
1443 UPDATE_SYNTAX_TABLE_FORWARD (from); 1439 UPDATE_SYNTAX_TABLE_FORWARD (from);
1444 ch0 = FETCH_CHAR_AS_MULTIBYTE (from_byte); 1440 ch0 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
1445 code = SYNTAX (ch0); 1441 code = SYNTAX (ch0);
@@ -1486,10 +1482,7 @@ scan_words (register ptrdiff_t from, register EMACS_INT count)
1486 while (1) 1482 while (1)
1487 { 1483 {
1488 if (from == beg) 1484 if (from == beg)
1489 { 1485 return 0;
1490 immediate_quit = false;
1491 return 0;
1492 }
1493 DEC_BOTH (from, from_byte); 1486 DEC_BOTH (from, from_byte);
1494 UPDATE_SYNTAX_TABLE_BACKWARD (from); 1487 UPDATE_SYNTAX_TABLE_BACKWARD (from);
1495 ch1 = FETCH_CHAR_AS_MULTIBYTE (from_byte); 1488 ch1 = FETCH_CHAR_AS_MULTIBYTE (from_byte);
@@ -1536,8 +1529,6 @@ scan_words (register ptrdiff_t from, register EMACS_INT count)
1536 count++; 1529 count++;
1537 } 1530 }
1538 1531
1539 immediate_quit = false;
1540
1541 return from; 1532 return from;
1542} 1533}
1543 1534
@@ -1921,7 +1912,6 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
1921 stop = (pos >= GPT && GPT > XINT (lim)) ? GAP_END_ADDR : endp; 1912 stop = (pos >= GPT && GPT > XINT (lim)) ? GAP_END_ADDR : endp;
1922 } 1913 }
1923 1914
1924 immediate_quit = true;
1925 /* This code may look up syntax tables using functions that rely on the 1915 /* This code may look up syntax tables using functions that rely on the
1926 gl_state object. To make sure this object is not out of date, 1916 gl_state object. To make sure this object is not out of date,
1927 let's initialize it manually. 1917 let's initialize it manually.
@@ -2064,7 +2054,6 @@ skip_chars (bool forwardp, Lisp_Object string, Lisp_Object lim,
2064 } 2054 }
2065 2055
2066 SET_PT_BOTH (pos, pos_byte); 2056 SET_PT_BOTH (pos, pos_byte);
2067 immediate_quit = false;
2068 2057
2069 SAFE_FREE (); 2058 SAFE_FREE ();
2070 return make_number (PT - start_point); 2059 return make_number (PT - start_point);
@@ -2138,7 +2127,6 @@ skip_syntaxes (bool forwardp, Lisp_Object string, Lisp_Object lim)
2138 ptrdiff_t pos_byte = PT_BYTE; 2127 ptrdiff_t pos_byte = PT_BYTE;
2139 unsigned char *p, *endp, *stop; 2128 unsigned char *p, *endp, *stop;
2140 2129
2141 immediate_quit = true;
2142 SETUP_SYNTAX_TABLE (pos, forwardp ? 1 : -1); 2130 SETUP_SYNTAX_TABLE (pos, forwardp ? 1 : -1);
2143 2131
2144 if (forwardp) 2132 if (forwardp)
@@ -2224,7 +2212,6 @@ skip_syntaxes (bool forwardp, Lisp_Object string, Lisp_Object lim)
2224 2212
2225 done: 2213 done:
2226 SET_PT_BOTH (pos, pos_byte); 2214 SET_PT_BOTH (pos, pos_byte);
2227 immediate_quit = false;
2228 2215
2229 return make_number (PT - start_point); 2216 return make_number (PT - start_point);
2230 } 2217 }
@@ -2412,7 +2399,6 @@ between them, return t; otherwise return nil. */)
2412 count1 = XINT (count); 2399 count1 = XINT (count);
2413 stop = count1 > 0 ? ZV : BEGV; 2400 stop = count1 > 0 ? ZV : BEGV;
2414 2401
2415 immediate_quit = true;
2416 maybe_quit (); 2402 maybe_quit ();
2417 2403
2418 from = PT; 2404 from = PT;
@@ -2429,7 +2415,6 @@ between them, return t; otherwise return nil. */)
2429 if (from == stop) 2415 if (from == stop)
2430 { 2416 {
2431 SET_PT_BOTH (from, from_byte); 2417 SET_PT_BOTH (from, from_byte);
2432 immediate_quit = false;
2433 return Qnil; 2418 return Qnil;
2434 } 2419 }
2435 c = FETCH_CHAR_AS_MULTIBYTE (from_byte); 2420 c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
@@ -2463,7 +2448,6 @@ between them, return t; otherwise return nil. */)
2463 comstyle = ST_COMMENT_STYLE; 2448 comstyle = ST_COMMENT_STYLE;
2464 else if (code != Scomment) 2449 else if (code != Scomment)
2465 { 2450 {
2466 immediate_quit = false;
2467 DEC_BOTH (from, from_byte); 2451 DEC_BOTH (from, from_byte);
2468 SET_PT_BOTH (from, from_byte); 2452 SET_PT_BOTH (from, from_byte);
2469 return Qnil; 2453 return Qnil;
@@ -2474,7 +2458,6 @@ between them, return t; otherwise return nil. */)
2474 from = out_charpos; from_byte = out_bytepos; 2458 from = out_charpos; from_byte = out_bytepos;
2475 if (!found) 2459 if (!found)
2476 { 2460 {
2477 immediate_quit = false;
2478 SET_PT_BOTH (from, from_byte); 2461 SET_PT_BOTH (from, from_byte);
2479 return Qnil; 2462 return Qnil;
2480 } 2463 }
@@ -2494,7 +2477,6 @@ between them, return t; otherwise return nil. */)
2494 if (from <= stop) 2477 if (from <= stop)
2495 { 2478 {
2496 SET_PT_BOTH (BEGV, BEGV_BYTE); 2479 SET_PT_BOTH (BEGV, BEGV_BYTE);
2497 immediate_quit = false;
2498 return Qnil; 2480 return Qnil;
2499 } 2481 }
2500 2482
@@ -2587,7 +2569,6 @@ between them, return t; otherwise return nil. */)
2587 else if (code != Swhitespace || quoted) 2569 else if (code != Swhitespace || quoted)
2588 { 2570 {
2589 leave: 2571 leave:
2590 immediate_quit = false;
2591 INC_BOTH (from, from_byte); 2572 INC_BOTH (from, from_byte);
2592 SET_PT_BOTH (from, from_byte); 2573 SET_PT_BOTH (from, from_byte);
2593 return Qnil; 2574 return Qnil;
@@ -2598,7 +2579,6 @@ between them, return t; otherwise return nil. */)
2598 } 2579 }
2599 2580
2600 SET_PT_BOTH (from, from_byte); 2581 SET_PT_BOTH (from, from_byte);
2601 immediate_quit = false;
2602 return Qt; 2582 return Qt;
2603} 2583}
2604 2584
@@ -2640,7 +2620,6 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
2640 2620
2641 from_byte = CHAR_TO_BYTE (from); 2621 from_byte = CHAR_TO_BYTE (from);
2642 2622
2643 immediate_quit = true;
2644 maybe_quit (); 2623 maybe_quit ();
2645 2624
2646 SETUP_SYNTAX_TABLE (from, count); 2625 SETUP_SYNTAX_TABLE (from, count);
@@ -2801,7 +2780,6 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
2801 if (depth) 2780 if (depth)
2802 goto lose; 2781 goto lose;
2803 2782
2804 immediate_quit = false;
2805 return Qnil; 2783 return Qnil;
2806 2784
2807 /* End of object reached */ 2785 /* End of object reached */
@@ -2984,7 +2962,6 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
2984 if (depth) 2962 if (depth)
2985 goto lose; 2963 goto lose;
2986 2964
2987 immediate_quit = false;
2988 return Qnil; 2965 return Qnil;
2989 2966
2990 done2: 2967 done2:
@@ -2992,7 +2969,6 @@ scan_lists (EMACS_INT from, EMACS_INT count, EMACS_INT depth, bool sexpflag)
2992 } 2969 }
2993 2970
2994 2971
2995 immediate_quit = false;
2996 XSETFASTINT (val, from); 2972 XSETFASTINT (val, from);
2997 return val; 2973 return val;
2998 2974
@@ -3173,7 +3149,6 @@ do { prev_from = from; \
3173 UPDATE_SYNTAX_TABLE_FORWARD (from); \ 3149 UPDATE_SYNTAX_TABLE_FORWARD (from); \
3174 } while (0) 3150 } while (0)
3175 3151
3176 immediate_quit = true;
3177 maybe_quit (); 3152 maybe_quit ();
3178 3153
3179 depth = state->depth; 3154 depth = state->depth;
@@ -3432,7 +3407,6 @@ do { prev_from = from; \
3432 state->levelstarts); 3407 state->levelstarts);
3433 state->prev_syntax = (SYNTAX_FLAGS_COMSTARTEND_FIRST (prev_from_syntax) 3408 state->prev_syntax = (SYNTAX_FLAGS_COMSTARTEND_FIRST (prev_from_syntax)
3434 || state->quoted) ? prev_from_syntax : Smax; 3409 || state->quoted) ? prev_from_syntax : Smax;
3435 immediate_quit = false;
3436} 3410}
3437 3411
3438/* Convert a (lisp) parse state to the internal form used in 3412/* Convert a (lisp) parse state to the internal form used in