]> code.delx.au - gnu-emacs/blobdiff - src/keyboard.c
Merge from emacs--rel--22
[gnu-emacs] / src / keyboard.c
index bcd3b536c57a3571a2e75fa3ffb46071af17a760..8afc81554aef917fcf77172805575af80c2420ca 100644 (file)
@@ -1,7 +1,7 @@
 /* Keyboard and mouse input; editor command loop.
    Copyright (C) 1985, 1986, 1987, 1988, 1989, 1993, 1994, 1995,
                  1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007 Free Software Foundation, Inc.
+                 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -95,18 +95,7 @@ volatile int interrupt_input_blocked;
    during the current critical section.  */
 int interrupt_input_pending;
 
-
-#ifdef HAVE_WINDOW_SYSTEM
-/* Make all keyboard buffers much bigger when using X windows.  */
-#ifdef MAC_OS8
-/* But not too big (local data > 32K error) if on Mac OS Classic.  */
-#define KBD_BUFFER_SIZE 512
-#else
-#define KBD_BUFFER_SIZE 4096
-#endif
-#else  /* No X-windows, character input */
 #define KBD_BUFFER_SIZE 4096
-#endif /* No X-windows */
 
 #ifdef MULTI_KBOARD
 KBOARD *initial_kboard;
@@ -2365,6 +2354,9 @@ make_ctrl_char (c)
   /* Save the upper bits here.  */
   int upper = c & ~0177;
 
+  if (! ASCII_BYTE_P (c))
+    return c |= ctrl_modifier;
+
   c &= 0177;
 
   /* Everything in the columns containing the upper-case letters
@@ -2715,6 +2707,8 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
   /* if redisplay was requested */
   if (commandflag >= 0)
     {
+      int echo_current = EQ (echo_message_buffer, echo_area_buffer[0]);
+
        /* If there is pending input, process any events which are not
           user-visible, such as X selection_request events.  */
       if (input_pending
@@ -2738,6 +2732,12 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu, end_time)
          swallow_events (0);
          /* If that cleared input_pending, try again to redisplay.  */
        }
+
+      /* Prevent the redisplay we just did
+        from messing up echoing of the input after the prompt.  */
+      if (commandflag == 0 && echo_current)
+       echo_message_buffer = echo_area_buffer[0];
+
     }
 
   /* Message turns off echoing unless more keystrokes turn it on again.
@@ -7234,7 +7234,7 @@ tty_read_avail_input (struct terminal *terminal,
   if (n_to_read > sizeof cbuf)
     n_to_read = sizeof cbuf;
 #else /* no FIONREAD */
-#if defined (USG) || defined (DGUX) || defined(CYGWIN)
+#if defined (USG) || defined(CYGWIN)
   /* Read some input if available, but don't wait.  */
   n_to_read = sizeof cbuf;
   fcntl (fileno (tty->input), F_SETFL, O_NDELAY);
@@ -7284,9 +7284,9 @@ tty_read_avail_input (struct terminal *terminal,
          );
 
 #ifndef FIONREAD
-#if defined (USG) || defined (DGUX) || defined (CYGWIN)
+#if defined (USG) || defined (CYGWIN)
   fcntl (fileno (tty->input), F_SETFL, 0);
-#endif /* USG or DGUX or CYGWIN */
+#endif /* USG or CYGWIN */
 #endif /* no FIONREAD */
 
   if (nread <= 0)
@@ -8110,7 +8110,8 @@ parse_menu_item (item, notreal, inmenubar)
   tem = XCDR (cachelist);
   if (newcache && !NILP (tem))
     {
-      tem = concat3 (build_string ("  ("), tem, build_string (")"));
+      tem = concat2 (build_string ("  "), tem);
+      // tem = concat3 (build_string ("  ("), tem, build_string (")"));
       XSETCDR (cachelist, tem);
     }
 
@@ -10099,8 +10100,8 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
          if (modifiers & shift_modifier
              /* Treat uppercase keys as shifted.  */
              || (INTEGERP (key)
-                 & (KEY_TO_CHAR (key)
-                    < XCHAR_TABLE (current_buffer->downcase_table)->size)
+                 && (KEY_TO_CHAR (key)
+                     < XCHAR_TABLE (current_buffer->downcase_table)->size)
                  && UPPERCASEP (KEY_TO_CHAR (key))))
            {
              Lisp_Object new_key