/[emacs]/emacs/src/keyboard.c
ViewVC logotype

Diff of /emacs/src/keyboard.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.626.4.3 by eliz, Thu May 16 16:11:41 2002 UTC revision 1.626.4.4 by rms, Sun Sep 29 17:50:27 2002 UTC
# Line 2091  static void record_char (); Line 2091  static void record_char ();
2091  static jmp_buf wrong_kboard_jmpbuf;  static jmp_buf wrong_kboard_jmpbuf;
2092  #endif  #endif
2093    
2094    #define STOP_POLLING                                    \
2095    do { if (! polling_stopped_here) stop_polling ();       \
2096           polling_stopped_here = 1; } while (0)
2097    
2098    #define RESUME_POLLING                                  \
2099    do { if (polling_stopped_here) start_polling ();        \
2100           polling_stopped_here = 0; } while (0)
2101    
2102  /* read a character from the keyboard; call the redisplay if needed */  /* read a character from the keyboard; call the redisplay if needed */
2103  /* commandflag 0 means do not do auto-saving, but do do redisplay.  /* commandflag 0 means do not do auto-saving, but do do redisplay.
2104     -1 means do not do redisplay, but do do autosaving.     -1 means do not do redisplay, but do do autosaving.
# Line 2130  read_char (commandflag, nmaps, maps, pre Line 2138  read_char (commandflag, nmaps, maps, pre
2138    volatile int reread;    volatile int reread;
2139    struct gcpro gcpro1, gcpro2;    struct gcpro gcpro1, gcpro2;
2140    EMACS_TIME last_idle_start;    EMACS_TIME last_idle_start;
2141      int polling_stopped_here = 0;
2142    
2143    also_record = Qnil;    also_record = Qnil;
2144    
# Line 2231  read_char (commandflag, nmaps, maps, pre Line 2240  read_char (commandflag, nmaps, maps, pre
2240            || executing_macro_index >= XFASTINT (Flength (Vexecuting_macro)))            || executing_macro_index >= XFASTINT (Flength (Vexecuting_macro)))
2241          {          {
2242            XSETINT (c, -1);            XSETINT (c, -1);
2243            RETURN_UNGCPRO (c);            goto exit;
2244          }          }
2245    
2246        c = Faref (Vexecuting_macro, make_number (executing_macro_index));        c = Faref (Vexecuting_macro, make_number (executing_macro_index));
# Line 2457  read_char (commandflag, nmaps, maps, pre Line 2466  read_char (commandflag, nmaps, maps, pre
2466        /* Now that we have read an event, Emacs is not idle.  */        /* Now that we have read an event, Emacs is not idle.  */
2467        timer_stop_idle ();        timer_stop_idle ();
2468    
2469        RETURN_UNGCPRO (c);        goto exit;
2470      }      }
2471    
2472    /* Maybe autosave and/or garbage collect due to idleness.  */    /* Maybe autosave and/or garbage collect due to idleness.  */
# Line 2564  read_char (commandflag, nmaps, maps, pre Line 2573  read_char (commandflag, nmaps, maps, pre
2573    
2574   wrong_kboard:   wrong_kboard:
2575    
2576    stop_polling ();    STOP_POLLING;
2577    
2578    /* Finally, we read from the main queue,    /* Finally, we read from the main queue,
2579       and if that gives us something we can't use yet, we put it on the       and if that gives us something we can't use yet, we put it on the
# Line 2627  read_char (commandflag, nmaps, maps, pre Line 2636  read_char (commandflag, nmaps, maps, pre
2636       should the next event read be a help-echo.  */       should the next event read be a help-echo.  */
2637    last_idle_start = timer_idleness_start_time;    last_idle_start = timer_idleness_start_time;
2638    timer_stop_idle ();    timer_stop_idle ();
2639    start_polling ();    RESUME_POLLING;
2640    
2641    if (NILP (c))    if (NILP (c))
2642      {      {
# Line 2644  read_char (commandflag, nmaps, maps, pre Line 2653  read_char (commandflag, nmaps, maps, pre
2653       so don't show them to the user.       so don't show them to the user.
2654       Also, don't record a key if we already did.  */       Also, don't record a key if we already did.  */
2655    if (BUFFERP (c) || key_already_recorded)    if (BUFFERP (c) || key_already_recorded)
2656      RETURN_UNGCPRO (c);      goto exit;
2657    
2658    /* Process special events within read_char    /* Process special events within read_char
2659       and loop around to read another event.  */       and loop around to read another event.  */
# Line 2672  read_char (commandflag, nmaps, maps, pre Line 2681  read_char (commandflag, nmaps, maps, pre
2681      {      {
2682        /* If kbd_buffer_get_event gave us an EOF, return that.  */        /* If kbd_buffer_get_event gave us an EOF, return that.  */
2683        if (XINT (c) == -1)        if (XINT (c) == -1)
2684          RETURN_UNGCPRO (c);          goto exit;
2685    
2686        if ((STRINGP (Vkeyboard_translate_table)        if ((STRINGP (Vkeyboard_translate_table)
2687             && XSTRING (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))             && XSTRING (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
# Line 2908  read_char (commandflag, nmaps, maps, pre Line 2917  read_char (commandflag, nmaps, maps, pre
2917          }          }
2918      }      }
2919    
2920     exit:
2921      RESUME_POLLING;
2922    RETURN_UNGCPRO (c);    RETURN_UNGCPRO (c);
2923  }  }
2924    

Legend:
Removed from v.1.626.4.3  
changed lines
  Added in v.1.626.4.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26