{
kill (-synch_process_pid, SIGINT);
message1 ("Waiting for process to die...(type C-g again to kill it instantly)");
+
+ /* This will quit on C-g. */
wait_for_termination (synch_process_pid, 0, 1);
+
synch_process_pid = 0;
message1 ("Waiting for process to die...done");
}
{
if (! NILP (Fequal (elt, XCAR (tail))))
return tail;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, list);
return Qnil;
{
if (EQ (XCAR (tail), elt))
return tail;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, list);
return Qnil;
Lisp_Object tem = XCAR (tail);
if (FLOATP (tem) && internal_equal (elt, tem, 0, 0, Qnil))
return tail;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, list);
return Qnil;
{
if (CONSP (XCAR (tail)) && EQ (XCAR (XCAR (tail)), key))
return XCAR (tail);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, list);
return Qnil;
if (CONSP (car)
&& (EQ (XCAR (car), key) || !NILP (Fequal (XCAR (car), key))))
return car;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, list);
return Qnil;
{
if (CONSP (XCAR (tail)) && EQ (XCDR (XCAR (tail)), key))
return XCAR (tail);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, list);
return Qnil;
if (CONSP (car)
&& (EQ (XCDR (car), key) || !NILP (Fequal (XCDR (car), key))))
return car;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, list);
return Qnil;
}
else
prev = tail;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, seq);
}
next = XCDR (tail);
Fsetcdr (tail, prev);
prev = tail;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, seq);
seq = prev;
for (new = Qnil; CONSP (seq); seq = XCDR (seq))
{
new = Fcons (XCAR (seq), new);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (seq, seq);
}
}
prev = tail;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
Lisp_Object newcell
= Fcons (prop, Fcons (val, NILP (prev) ? plist : XCDR (XCDR (prev))));
{
if (! NILP (Fequal (prop, XCAR (tail))))
return XCAR (XCDR (tail));
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
CHECK_LIST_END (tail, prop);
}
prev = tail;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
Lisp_Object newcell = list2 (prop, val);
if (NILP (prev))
unsigned short int quit_count = 0;
tail_recurse:
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
if (EQ (o1, o2))
return 1;
if (XTYPE (o1) != XTYPE (o2))
{
tail = tem;
tem = XCDR (tail);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
while (CONSP (tem));
{
plist = XCDR (plist);
plist = CDR (plist);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
return plist;
}
while (true)
{
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
while (pos == next_boundary)
{
pos_byte = CHAR_TO_BYTE (pos);
}
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
/* Handle right margin. */
pos = find_before_next_newline (pos, to, 1, &pos_byte);
if (pos < to)
INC_BOTH (pos, pos_byte);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
while (pos < to
&& indented_beyond_p (pos, pos_byte,
if (! (count & (QUIT_COUNT_HEURISTIC - 1)))
maybe_quit ();
}
-
-/* Increment *QUIT_COUNT and rarely quit. */
-
-INLINE void
-incr_rarely_quit (unsigned short int *quit_count)
-{
- rarely_quit (++*quit_count);
-}
\f
extern Lisp_Object Vascii_downcase_table;
extern Lisp_Object Vascii_canon_table;
error ("Stack overflow in regexp matcher");
}
+static void
+freeze_buffer_relocation (void)
+{
+#ifdef REL_ALLOC
+ /* Prevent ralloc.c from relocating the current buffer while
+ searching it. */
+ r_alloc_inhibit_buffer_relocation (1);
+ record_unwind_protect_int (r_alloc_inhibit_buffer_relocation, 0);
+#endif
+}
+
+static void
+thaw_buffer_relocation (void)
+{
+#ifdef REL_ALLOC
+ unbind_to (SPECPDL_INDEX () - 1, Qnil);
+#endif
+}
+
/* Compile a regexp and signal a Lisp error if anything goes wrong.
PATTERN is the pattern to compile.
CP is the place to put the result.
re_match_object = Qnil;
-#ifdef REL_ALLOC
- /* Prevent ralloc.c from relocating the current buffer while
- searching it. */
- r_alloc_inhibit_buffer_relocation (1);
-#endif
+ freeze_buffer_relocation ();
i = re_match_2 (bufp, (char *) p1, s1, (char *) p2, s2,
PT_BYTE - BEGV_BYTE,
(NILP (Vinhibit_changing_match_data)
? &search_regs : NULL),
ZV_BYTE - BEGV_BYTE);
-#ifdef REL_ALLOC
- r_alloc_inhibit_buffer_relocation (0);
-#endif
+ thaw_buffer_relocation ();
if (i == -2)
matcher_overflow ();
}
buf = compile_pattern (regexp, 0, Qnil, 0, multibyte);
-#ifdef REL_ALLOC
- /* Prevent ralloc.c from relocating the current buffer while
- searching it. */
- r_alloc_inhibit_buffer_relocation (1);
-#endif
+ freeze_buffer_relocation ();
len = re_match_2 (buf, (char *) p1, s1, (char *) p2, s2,
pos_byte, NULL, limit_byte);
-#ifdef REL_ALLOC
- r_alloc_inhibit_buffer_relocation (0);
-#endif
+ thaw_buffer_relocation ();
return len;
}
}
re_match_object = Qnil;
-#ifdef REL_ALLOC
- /* Prevent ralloc.c from relocating the current buffer while
- searching it. */
- r_alloc_inhibit_buffer_relocation (1);
-#endif
+ freeze_buffer_relocation ();
while (n < 0)
{
}
else
{
-#ifdef REL_ALLOC
- r_alloc_inhibit_buffer_relocation (0);
-#endif
+ thaw_buffer_relocation ();
return (n);
}
n++;
}
else
{
-#ifdef REL_ALLOC
- r_alloc_inhibit_buffer_relocation (0);
-#endif
+ thaw_buffer_relocation ();
return (0 - n);
}
n--;
maybe_quit ();
}
-#ifdef REL_ALLOC
- r_alloc_inhibit_buffer_relocation (0);
-#endif
+ thaw_buffer_relocation ();
return (pos);
}
else /* non-RE case */
find_defun_start (ptrdiff_t pos, ptrdiff_t pos_byte)
{
ptrdiff_t opoint = PT, opoint_byte = PT_BYTE;
- unsigned short int quit_count = 0;
/* Use previous finding, if it's valid and applies to this inquiry. */
if (current_buffer == find_start_buffer
}
/* Move to beg of previous line. */
scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1);
- incr_rarely_quit (&quit_count);
}
/* Record what we found, for the next try. */
that determines quote parity to the comment-end. */
while (from != stop)
{
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
ptrdiff_t temp_byte;
int prev_syntax;
defun_start_byte = CHAR_TO_BYTE (defun_start);
}
}
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
while (defun_start < comment_end);
nesting++;
}
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
*charpos_ptr = from;
*bytepos_ptr = from_byte;
INC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_FORWARD (from);
}
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
while (code == Swhitespace || (code == Sendcomment && c == '\n'));
}
else if (from == stop)
break;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
if (fence_found == 0)
{
return Qnil;
}
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
count1++;
{
while (from < stop)
{
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
bool comstart_first, prefix;
int syntax, other_syntax;
UPDATE_SYNTAX_TABLE_FORWARD (from);
goto done;
}
INC_BOTH (from, from_byte);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
goto done;
if (c_code == Scharquote || c_code == Sescape)
INC_BOTH (from, from_byte);
INC_BOTH (from, from_byte);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
INC_BOTH (from, from_byte);
if (!depth && sexpflag) goto done;
{
while (from > stop)
{
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
DEC_BOTH (from, from_byte);
UPDATE_SYNTAX_TABLE_BACKWARD (from);
c = FETCH_CHAR_AS_MULTIBYTE (from_byte);
default: goto done2;
}
DEC_BOTH (from, from_byte);
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
goto done2;
if (syntax_multibyte (c, multibyte_symbol_p) == code)
break;
}
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
if (code == Sstring_fence && !depth && sexpflag) goto done2;
break;
== Sstring))
break;
}
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
if (!depth && sexpflag) goto done2;
break;
while (from < end)
{
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
INC_FROM;
if ((from < end)
goto symdone;
}
INC_FROM;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
symdone:
curlevel->prev = curlevel->last;
break;
}
INC_FROM;
- incr_rarely_quit (&quit_count);
+ rarely_quit (++quit_count);
}
}
string_end:
#endif
/* Read from FD to a buffer BUF with size NBYTE.
- If interrupted, either quit or retry the read.
- Process any quits and pending signals immediately if INTERRUPTIBLE.
+ If interrupted, process any quits and pending signals immediately
+ if INTERRUPTIBLE, and then retry the read unless quitting.
Return the number of bytes read, which might be less than NBYTE.
On error, set errno to a value other than EINTR, and return -1. */
static ptrdiff_t
-emacs_nointr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible)
+emacs_intr_read (int fd, void *buf, ptrdiff_t nbyte, bool interruptible)
{
ssize_t result;
ptrdiff_t
emacs_read (int fd, void *buf, ptrdiff_t nbyte)
{
- return emacs_nointr_read (fd, buf, nbyte, false);
+ return emacs_intr_read (fd, buf, nbyte, false);
}
/* Like emacs_read, but also process quits and pending signals. */
ptrdiff_t
emacs_read_quit (int fd, void *buf, ptrdiff_t nbyte)
{
- return emacs_nointr_read (fd, buf, nbyte, true);
+ return emacs_intr_read (fd, buf, nbyte, true);
}
/* Write to FILEDES from a buffer BUF with size NBYTE, retrying if