]> code.delx.au - gnu-emacs/blobdiff - src/keyboard.c
Merge from emacs--devo--0
[gnu-emacs] / src / keyboard.c
index 72e6844d8414e0caeb3b6ee529ee86576e2daea8..d843b8fb348934b25c16b7025bc53fc4ad83d8c7 100644 (file)
@@ -33,7 +33,7 @@ Boston, MA 02110-1301, USA.  */
 #include "window.h"
 #include "commands.h"
 #include "buffer.h"
-#include "charset.h"
+#include "character.h"
 #include "disptab.h"
 #include "dispextern.h"
 #include "syntax.h"
@@ -100,9 +100,6 @@ int interrupt_input_pending;
 /* File descriptor to use for input.  */
 extern int input_fd;
 
-/* Nonzero if we are executing from the SIGIO signal handler. */
-int in_sighandler;
-
 #ifdef HAVE_WINDOW_SYSTEM
 /* Make all keyboard buffers much bigger when using X windows.  */
 #ifdef MAC_OS8
@@ -1737,7 +1734,7 @@ command_loop_1 ()
                          : (lose >= 0x20 && lose < 0x7f))
                      /* To extract the case of continuation on
                          wide-column characters.  */
-                     && (WIDTH_BY_CHAR_HEAD (FETCH_BYTE (PT_BYTE)) == 1)
+                     && ASCII_BYTE_P (lose)
                      && (XFASTINT (XWINDOW (selected_window)->last_modified)
                          >= MODIFF)
                      && (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
@@ -1794,7 +1791,7 @@ command_loop_1 ()
                {
                  unsigned int c
                    = translate_char (Vtranslation_table_for_input,
-                                     XFASTINT (last_command_char), 0, 0, 0);
+                                     XFASTINT (last_command_char));
                  int value;
                  if (NILP (Vexecuting_kbd_macro)
                      && !EQ (minibuf_window, selected_window))
@@ -1970,7 +1967,7 @@ adjust_point_for_property (last_pt, modified)
      int last_pt;
      int modified;
 {
-  int beg, end;
+  EMACS_INT beg, end;
   Lisp_Object val, overlay, tmp;
   int check_composition = 1, check_display = 1, check_invisible = 1;
   int orig_pt = PT;
@@ -3075,7 +3072,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
          || (VECTORP (Vkeyboard_translate_table)
              && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c))
          || (CHAR_TABLE_P (Vkeyboard_translate_table)
-             && CHAR_VALID_P (XINT (c), 0)))
+             && CHARACTERP (c)))
        {
          Lisp_Object d;
          d = Faref (Vkeyboard_translate_table, c);
@@ -4555,7 +4552,7 @@ timer_check (do_it_now)
 }
 
 DEFUN ("current-idle-time", Fcurrent_idle_time, Scurrent_idle_time, 0, 0, 0,
-       /* Return the current length of Emacs idleness.
+       doc: /* Return the current length of Emacs idleness.
 The value is returned as a list of three integers.  The first has the
 most significant 16 bits of the seconds, while the second has the
 least significant 16 bits.  The third integer gives the microsecond
@@ -4565,19 +4562,16 @@ The microsecond count is zero on systems that do not provide
 resolution finer than a second.  */)
   ()
 {
-  EMACS_TIME now, idleness_now;
-  Lisp_Object result[3];
-
-  EMACS_GET_TIME (now);
   if (! EMACS_TIME_NEG_P (timer_idleness_start_time))
     {
-      EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time);
+      EMACS_TIME now, idleness_now;
 
-      XSETINT (result[0], (EMACS_SECS (idleness_now) >> 16) & 0xffff);
-      XSETINT (result[1], (EMACS_SECS (idleness_now) >> 0)  & 0xffff);
-      XSETINT (result[2], EMACS_USECS (idleness_now));
+      EMACS_GET_TIME (now);
+      EMACS_SUB_TIME (idleness_now, now, timer_idleness_start_time);
 
-      return Flist (3, result);
+      return list3 (make_number ((EMACS_SECS (idleness_now) >> 16) & 0xffff),
+                   make_number ((EMACS_SECS (idleness_now) >> 0)  & 0xffff),
+                   make_number (EMACS_USECS (idleness_now)));
     }
 
   return Qnil;
@@ -6975,8 +6969,6 @@ input_available_signal (signo)
   SIGNAL_THREAD_CHECK (signo);
 #endif
 
-  in_sighandler = 1;
-
   if (input_available_clear_time)
     EMACS_SET_SECS_USECS (*input_available_clear_time, 0, 0);
 
@@ -6988,7 +6980,6 @@ input_available_signal (signo)
   sigfree ();
 #endif
   errno = old_errno;
-  in_sighandler = 0;
 }
 #endif /* SIGIO */
 
@@ -9501,9 +9492,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
       if (first_binding >= nmaps
          && fkey.start >= t && keytran.start >= t
          && INTEGERP (key)
-         && ((((XINT (key) & 0x3ffff)
-               < XCHAR_TABLE (current_buffer->downcase_table)->size)
-              && UPPERCASEP (XINT (key) & 0x3ffff))
+         && ((CHARACTERP (make_number (XINT (key) & ~CHAR_MODIFIER_MASK))
+              && UPPERCASEP (XINT (key) & ~CHAR_MODIFIER_MASK))
              || (XINT (key) & shift_modifier)))
        {
          Lisp_Object new_key;
@@ -9514,8 +9504,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
          if (XINT (key) & shift_modifier)
            XSETINT (new_key, XINT (key) & ~shift_modifier);
          else
-           XSETINT (new_key, (DOWNCASE (XINT (key) & 0x3ffff)
-                              | (XINT (key) & ~0x3ffff)));
+           XSETINT (new_key, (DOWNCASE (XINT (key) & ~CHAR_MODIFIER_MASK)
+                              | (XINT (key) & ~CHAR_MODIFIER_MASK)));
 
          /* We have to do this unconditionally, regardless of whether
             the lower-case char is defined in the keymaps, because they
@@ -10856,7 +10846,6 @@ init_keyboard ()
   do_mouse_tracking = Qnil;
 #endif
   input_pending = 0;
-  in_sighandler = 0;
 
   /* This means that command_loop_1 won't try to select anything the first
      time through.  */