[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/keyboard.c
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/src/keyboard.c |
Date: |
Sun, 29 Sep 2002 13:50:28 -0400 |
Index: emacs/src/keyboard.c
diff -c emacs/src/keyboard.c:1.707 emacs/src/keyboard.c:1.708
*** emacs/src/keyboard.c:1.707 Tue Sep 10 21:58:54 2002
--- emacs/src/keyboard.c Fri Sep 27 13:03:46 2002
***************
*** 2144,2149 ****
--- 2144,2157 ----
static jmp_buf wrong_kboard_jmpbuf;
#endif
+ #define STOP_POLLING \
+ do { if (! polling_stopped_here) stop_polling (); \
+ polling_stopped_here = 1; } while (0)
+
+ #define RESUME_POLLING \
+ do { if (polling_stopped_here) start_polling (); \
+ polling_stopped_here = 0; } while (0)
+
/* read a character from the keyboard; call the redisplay if needed */
/* commandflag 0 means do not do auto-saving, but do do redisplay.
-1 means do not do redisplay, but do do autosaving.
***************
*** 2183,2188 ****
--- 2191,2197 ----
volatile int reread;
struct gcpro gcpro1, gcpro2;
EMACS_TIME last_idle_start;
+ int polling_stopped_here = 0;
also_record = Qnil;
***************
*** 2284,2290 ****
|| executing_macro_index >= XFASTINT (Flength (Vexecuting_macro)))
{
XSETINT (c, -1);
! RETURN_UNGCPRO (c);
}
c = Faref (Vexecuting_macro, make_number (executing_macro_index));
--- 2293,2299 ----
|| executing_macro_index >= XFASTINT (Flength (Vexecuting_macro)))
{
XSETINT (c, -1);
! goto exit;
}
c = Faref (Vexecuting_macro, make_number (executing_macro_index));
***************
*** 2516,2522 ****
/* Now that we have read an event, Emacs is not idle. */
timer_stop_idle ();
! RETURN_UNGCPRO (c);
}
/* Maybe autosave and/or garbage collect due to idleness. */
--- 2525,2531 ----
/* Now that we have read an event, Emacs is not idle. */
timer_stop_idle ();
! goto exit;
}
/* Maybe autosave and/or garbage collect due to idleness. */
***************
*** 2623,2629 ****
wrong_kboard:
! stop_polling ();
/* Finally, we read from the main queue,
and if that gives us something we can't use yet, we put it on the
--- 2632,2638 ----
wrong_kboard:
! STOP_POLLING;
/* Finally, we read from the main queue,
and if that gives us something we can't use yet, we put it on the
***************
*** 2692,2698 ****
should the next event read be a help-echo. */
last_idle_start = timer_idleness_start_time;
timer_stop_idle ();
! start_polling ();
if (NILP (c))
{
--- 2701,2707 ----
should the next event read be a help-echo. */
last_idle_start = timer_idleness_start_time;
timer_stop_idle ();
! RESUME_POLLING;
if (NILP (c))
{
***************
*** 2709,2715 ****
so don't show them to the user.
Also, don't record a key if we already did. */
if (BUFFERP (c) || key_already_recorded)
! RETURN_UNGCPRO (c);
/* Process special events within read_char
and loop around to read another event. */
--- 2718,2724 ----
so don't show them to the user.
Also, don't record a key if we already did. */
if (BUFFERP (c) || key_already_recorded)
! goto exit;
/* Process special events within read_char
and loop around to read another event. */
***************
*** 2744,2750 ****
{
/* If kbd_buffer_get_event gave us an EOF, return that. */
if (XINT (c) == -1)
! RETURN_UNGCPRO (c);
if ((STRINGP (Vkeyboard_translate_table)
&& SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
--- 2753,2759 ----
{
/* If kbd_buffer_get_event gave us an EOF, return that. */
if (XINT (c) == -1)
! goto exit;
if ((STRINGP (Vkeyboard_translate_table)
&& SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c))
***************
*** 2986,2991 ****
--- 2995,3002 ----
}
}
+ exit:
+ RESUME_POLLING;
RETURN_UNGCPRO (c);
}