texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5912] read entire key sequence in info_dispatch_on_key


From: Gavin D. Smith
Subject: [5912] read entire key sequence in info_dispatch_on_key
Date: Fri, 07 Nov 2014 10:49:15 +0000

Revision: 5912
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5912
Author:   gavin
Date:     2014-11-07 10:49:13 +0000 (Fri, 07 Nov 2014)
Log Message:
-----------
read entire key sequence in info_dispatch_on_key

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/echo-area.c
    trunk/info/echo-area.h
    trunk/info/indices.c
    trunk/info/indices.h
    trunk/info/info.h
    trunk/info/infodoc.c
    trunk/info/infomap.c
    trunk/info/m-x.c
    trunk/info/makedoc.c
    trunk/info/nodemenu.c
    trunk/info/session.c
    trunk/info/session.h
    trunk/info/terminal.c
    trunk/info/variables.c
    trunk/info/variables.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/ChangeLog     2014-11-07 10:49:13 UTC (rev 5912)
@@ -1,3 +1,69 @@
+2014-11-07  Gavin Smith  <address@hidden>
+
+       * info/session.c (info_dispatch_on_key, read_key_sequence):
+       Renamed.  Call initialize_keyseq.  Read initial key of key 
+       sequence.  Merge in functionality of info_numeric_arg_digit_loop 
+       - read in keys giving a numeric argument at start of key 
+       sequence.  Call function implementing some commands depending on 
+       arguments.  Allow 8-bit input in echo area if 'ISO-Latin' is 
+       'On'.
+       (display_info_keyseq): Check for empty keyseq.
+
+       * info/terminal.c (initialize_byte_map): 8th bit in an inputted 
+       byte only represents Meta if 'ISO-Latin' is off.
+
+       * info/echo-area.c (ea_insert): Don't declare with 
+       DECLARE_INFO_COMMAND.
+       * info/infomap.c (add_function_keyseq),
+       * info/infodoc.c (dump_map_to_text_buffer): Don't check for 
+       ea_insert key bindings.
+       * info/infomap.c (read_init_file): Don't bind printable 
+       characters to ea_insert.
+
+       * info/session.c (info_menu_digit): Function body is empty.
+       (menu_digit): New function.
+
+       * info/echo-area.c (ea_possible_completions, ea_complete): Don't 
+       check what key launched this command.  Don't insert the key if 
+       not completing.
+       (echo_area_completion_items): No longer static.
+
+       * info/session.c (info_numeric_arg, info_numeric_arg_sign)
+       (ea_numeric_arg, ea_numeric_arg_sign): Deleted.
+       (info_initialize_numeric_arg): Don't set info_numeric_arg or 
+       other deleted variables.
+       (info_add_digit_to_numeric_arg, info_universal_argument): Bodies 
+       of functions removed - declare with DECLARE_INFO_COMMAND only.
+
+       * info/session.c (mouse_reporting_on, mouse_reporting_off)
+       (mouse_reporting): Deleted.
+       (get_input_key): If mouse event detected always return 
+       KEY_MOUSE.
+       * info/infodoc.c (pretty_keyname): More descriptive text for 
+       KEY_MOUSE or unknown key in case they are output by mistake.
+
+       * info/session.c (info_read_and_dispatch),
+       * info/echo-area.c (read_and_dispatch_in_echo_area): Calls to 
+       info_dispatch_on_key updated.  Don't call initialize_keyseq or 
+       read first key of key sequence.  Pass count to 
+       command-implementing function.  Clear ea_last_executed_command 
+       if info_dispatch_on_key could have executed a command itself.
+
+       * info/info.h (DECLARE_INFO_COMMAND),
+       * info/makedoc.c (process_one_file): Remove 'key' argument from 
+       declarations of command-implementing functions.  All function 
+       declarations and calls updated.
+       * info/session.c (info_menu_or_ref_item): Unused argument 
+       removed.
+
+       * info/session.c (info_read_and_dispatch): Don't check for ESC 
+       <key> input.
+       * info/infomap.c (section_to_keymaps): Copy key bindings M-<key> 
+       to ESC <key>.
+       (default_emacs_like_info_keys) (default_vi_like_info_keys): 
+       Refer to key sequences ESC <special key> with a sequence 
+       beginning with ESC instead of using KEYMAP_META.
+
 2014-11-06  Karl Berry  <address@hidden>
 
        * info/pseudotty.c: localize variables, main signature, formatting.
@@ -20,7 +86,7 @@
 
        * doc/texinfo.texi: no leading @ characters in command index.
 
-2014-10-03  Gavin Smith  <address@hidden>
+2014-11-03  Gavin Smith  <address@hidden>
 
        * info/man.c (get_manpage_node): Make returned node safely 
        free-able with free_history_node.

Modified: trunk/info/echo-area.c
===================================================================
--- trunk/info/echo-area.c      2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/echo-area.c      2014-11-07 10:49:13 UTC (rev 5912)
@@ -163,10 +163,9 @@
 static void
 read_and_dispatch_in_echo_area (void)
 {
-  int key;
-
   while (1)
     {
+      int count;
       VFunction *cmd;
       int lk = 0;
 
@@ -183,18 +182,16 @@
       the_echo_area->line_map.used = 0;
 
       display_cursor_at_point (active_window);
-      info_initialize_numeric_arg ();
 
-      initialize_keyseq ();
-      key = get_input_key ();
-
       /* Do the selected command. */
-      cmd = info_dispatch_on_key (key, echo_area_keymap);
+      cmd = read_key_sequence (echo_area_keymap, 0, 0, 1, &count);
       if (cmd)
         {
-          (*cmd) (the_echo_area, 1, key);
+          (*cmd) (the_echo_area, count);
           ea_last_executed_command = cmd;
         }
+      else
+        ea_last_executed_command = 0;
 
       /* Echo area commands that do killing increment the value of
          ECHO_AREA_LAST_COMMAND_WAS_KILL.  Thus, if there is no
@@ -300,7 +297,7 @@
 DECLARE_INFO_COMMAND (ea_forward, _("Move forward a character"))
 {
   if (count < 0)
-    ea_backward (window, -count, key);
+    ea_backward (window, -count);
   else
     {
       input_line_point += count;
@@ -312,7 +309,7 @@
 DECLARE_INFO_COMMAND (ea_backward, _("Move backward a character"))
 {
   if (count < 0)
-    ea_forward (window, -count, key);
+    ea_forward (window, -count);
   else
     {
       input_line_point -= count;
@@ -339,7 +336,7 @@
   int c;
 
   if (count < 0)
-    ea_backward_word (window, -count, key);
+    ea_backward_word (window, -count);
   else
     {
       while (count--)
@@ -379,7 +376,7 @@
   int c;
 
   if (count < 0)
-    ea_forward_word (window, -count, key);
+    ea_forward_word (window, -count);
   else
     {
       while (count--)
@@ -419,7 +416,7 @@
   register int i;
 
   if (count < 0)
-    ea_rubout (window, -count, key);
+    ea_rubout (window, -count);
   else
     {
       if (input_line_point == input_line_end)
@@ -430,7 +427,7 @@
           int orig_point;
 
           orig_point = input_line_point;
-          ea_forward (window, count, key);
+          ea_forward (window, count);
           ea_kill_text (orig_point, input_line_point);
           input_line_point = orig_point;
         }
@@ -447,7 +444,7 @@
 DECLARE_INFO_COMMAND (ea_rubout, _("Delete the character behind the cursor"))
 {
   if (count < 0)
-    ea_delete (window, -count, key);
+    ea_delete (window, -count);
   else
     {
       int start;
@@ -456,12 +453,12 @@
         return;
 
       start = input_line_point;
-      ea_backward (window, count, key);
+      ea_backward (window, count);
 
       if (ea_explicit_arg || count > 1)
         ea_kill_text (start, input_line_point);
       else
-        ea_delete (window, count, key);
+        ea_delete (window, count);
     }
 }
 
@@ -497,7 +494,8 @@
   ea_insert (window, count, character);
 }
 
-DECLARE_INFO_COMMAND (ea_insert, _("Insert this character"))
+void
+ea_insert (WINDOW *window, int count, int key)
 {
   register int i;
 
@@ -623,7 +621,7 @@
   if (kill_ring_loc < 0)
     kill_ring_loc = kill_ring_index - 1;
 
-  ea_yank (window, count, key);
+  ea_yank (window, count);
 }
 
 /* Delete the text from point to end of line. */
@@ -657,10 +655,10 @@
   int orig_point = input_line_point;
 
   if (count < 0)
-    ea_backward_kill_word (window, -count, key);
+    ea_backward_kill_word (window, -count);
   else
     {
-      ea_forward_word (window, count, key);
+      ea_forward_word (window, count);
 
       if (input_line_point != orig_point)
         ea_kill_text (orig_point, input_line_point);
@@ -677,10 +675,10 @@
   int orig_point = input_line_point;
 
   if (count < 0)
-    ea_kill_word (window, -count, key);
+    ea_kill_word (window, -count);
   else
     {
-      ea_backward_word (window, count, key);
+      ea_backward_word (window, count);
 
       if (input_line_point != orig_point)
         ea_kill_text (orig_point, input_line_point);
@@ -786,7 +784,7 @@
 /* **************************************************************** */
 
 /* Pointer to an array of REFERENCE to complete over. */
-static REFERENCE **echo_area_completion_items = NULL;
+REFERENCE **echo_area_completion_items = NULL;
 
 /* Sorted array of REFERENCE * which is the possible completions found in
    the variable echo_area_completion_items.  If there is only one element,
@@ -948,14 +946,6 @@
 
 DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions"))
 {
-  if (!echo_area_completion_items
-      || (isprint (key)
-         && ea_last_executed_command == (VFunction *) ea_possible_completions))
-    {
-      ea_insert (window, count, key);
-      return;
-    }
-
   build_completions ();
 
   if (!completions_found_index)
@@ -963,7 +953,7 @@
       terminal_ring_bell ();
       inform_in_echo_area (_("No completions"));
     }
-  else if ((completions_found_index == 1) && (key != '?'))
+  else if (completions_found_index == 1)
     {
       inform_in_echo_area (_("Sole completion"));
     }
@@ -1093,59 +1083,19 @@
 
 DECLARE_INFO_COMMAND (ea_complete, _("Insert completion"))
 {
-  if (!echo_area_completion_items)
+  if (ea_last_executed_command == (VFunction *) ea_complete)
     {
-      ea_insert (window, count, key);
+      ea_possible_completions (window, count);
       return;
     }
 
-  /* If KEY is SPC, and we are not forcing completion to take place, simply
-     insert the key. */
-  if (!echo_area_must_complete_p && key == SPC)
-    {
-      ea_insert (window, count, key);
-      return;
-    }
-
-  if (ea_last_executed_command == (VFunction *) ea_complete)
-    {
-      /* If the keypress is a SPC character, and we have already tried
-         completing once, and there are several completions, then check
-         the batch of completions to see if any continue with a space.
-         If there are some, insert the space character and continue. */
-      if (key == SPC && completions_found_index > 1)
-        {
-          size_t i;
-         int offset;
-
-          offset = input_line_end - input_line_beg;
-
-          for (i = 0; i < completions_found_index; i++)
-            if (completions_found[i]->label[offset] == ' ')
-              break;
-
-          if (completions_found[i])
-            ea_insert (window, 1, ' ');
-          else
-            {
-              ea_possible_completions (window, count, key);
-              return;
-            }
-        }
-      else
-        {
-          ea_possible_completions (window, count, key);
-          return;
-        }
-    }
-
   input_line_point = input_line_end;
   build_completions ();
 
   if (!completions_found_index)
     terminal_ring_bell ();
   else if (LCD_completion->label[0] == '\0')
-    ea_possible_completions (window, count, key);
+    ea_possible_completions (window, count);
   else
     {
       register int i;
@@ -1363,7 +1313,7 @@
 
   /* Let info_scroll_forward () do the work, and print any messages that
      need to be displayed. */
-  info_scroll_forward (compwin, count, key);
+  info_scroll_forward (compwin, count);
 }
 
 /* Function which gets called when an Info window is deleted while the

Modified: trunk/info/echo-area.h
===================================================================
--- trunk/info/echo-area.h      2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/echo-area.h      2014-11-07 10:49:13 UTC (rev 5912)
@@ -30,6 +30,8 @@
    killed some text. */
 extern int echo_area_last_command_was_kill;
 
+extern REFERENCE **echo_area_completion_items;
+
 extern void inform_in_echo_area (const char *message);
 extern void echo_area_inform_of_deleted_window (WINDOW *window);
 extern void echo_area_prep_read (void);
@@ -60,27 +62,27 @@
     REFERENCE **completions, reference_bool_fn exclude);
 
 extern void ea_insert (WINDOW *window, int count, int key);
-extern void ea_quoted_insert (WINDOW *window, int count, int key);
-extern void ea_beg_of_line (WINDOW *window, int count, int key);
-extern void ea_backward (WINDOW *window, int count, int key);
-extern void ea_delete (WINDOW *window, int count, int key);
-extern void ea_end_of_line (WINDOW *window, int count, int key);
-extern void ea_forward (WINDOW *window, int count, int key);
-extern void ea_abort (WINDOW *window, int count, int key);
-extern void ea_rubout (WINDOW *window, int count, int key);
-extern void ea_complete (WINDOW *window, int count, int key);
-extern void ea_newline (WINDOW *window, int count, int key);
-extern void ea_kill_line (WINDOW *window, int count, int key);
-extern void ea_backward_kill_line (WINDOW *window, int count, int key);
-extern void ea_transpose_chars (WINDOW *window, int count, int key);
-extern void ea_yank (WINDOW *window, int count, int key);
-extern void ea_tab_insert (WINDOW *window, int count, int key);
-extern void ea_possible_completions (WINDOW *window, int count, int key);
-extern void ea_backward_word (WINDOW *window, int count, int key);
-extern void ea_kill_word (WINDOW *window, int count, int key);
-extern void ea_forward_word (WINDOW *window, int count, int key);
-extern void ea_yank_pop (WINDOW *window, int count, int key);
-extern void ea_backward_kill_word (WINDOW *window, int count, int key);
-extern void ea_scroll_completions_window (WINDOW *window, int count, int key);
+extern void ea_quoted_insert (WINDOW *window, int count);
+extern void ea_beg_of_line (WINDOW *window, int count);
+extern void ea_backward (WINDOW *window, int count);
+extern void ea_delete (WINDOW *window, int count);
+extern void ea_end_of_line (WINDOW *window, int count);
+extern void ea_forward (WINDOW *window, int count);
+extern void ea_abort (WINDOW *window, int count);
+extern void ea_rubout (WINDOW *window, int count);
+extern void ea_complete (WINDOW *window, int count);
+extern void ea_newline (WINDOW *window, int count);
+extern void ea_kill_line (WINDOW *window, int count);
+extern void ea_backward_kill_line (WINDOW *window, int count);
+extern void ea_transpose_chars (WINDOW *window, int count);
+extern void ea_yank (WINDOW *window, int count);
+extern void ea_tab_insert (WINDOW *window, int count);
+extern void ea_possible_completions (WINDOW *window, int count);
+extern void ea_backward_word (WINDOW *window, int count);
+extern void ea_kill_word (WINDOW *window, int count);
+extern void ea_forward_word (WINDOW *window, int count);
+extern void ea_yank_pop (WINDOW *window, int count);
+extern void ea_backward_kill_word (WINDOW *window, int count);
+extern void ea_scroll_completions_window (WINDOW *window, int count);
 
 #endif /* not INFO_ECHO_AREA_H */

Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c        2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/indices.c        2014-11-07 10:49:13 UTC (rev 5912)
@@ -197,7 +197,7 @@
     window_clear_echo_area ();
 }
 
-void info_next_index_match (WINDOW *window, int count, int key);
+void info_next_index_match (WINDOW *window, int count);
 
 DECLARE_INFO_COMMAND (info_index_search,
    _("Look up a string in the index for this file"))
@@ -221,7 +221,7 @@
   /* User aborted? */
   if (!line)
     {
-      info_abort_key (window, 1, 0);
+      info_abort_key (window, 1);
       return;
     }
 
@@ -265,7 +265,7 @@
 
   /* Find an exact match, or, failing that, the first index entry containing
      the partial string. */
-  info_next_index_match (window, count, 0);
+  info_next_index_match (window, count);
 
   /* If the search failed, return the index offset to where it belongs. */
   if (index_offset == old_offset)
@@ -623,7 +623,7 @@
   /* User aborted? */
   if (!line)
     {
-      info_abort_key (window, 1, 1);
+      info_abort_key (window, 1);
       return;
     }
 
@@ -795,7 +795,7 @@
   /* User aborted? */
   if (!line)
     {
-      info_abort_key (window, 1, 1);
+      info_abort_key (window, 1);
       return;
     }
 

Modified: trunk/info/indices.h
===================================================================
--- trunk/info/indices.h        2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/indices.h        2014-11-07 10:49:13 UTC (rev 5912)
@@ -29,8 +29,8 @@
 REFERENCE **apropos_in_all_indices (char *search_string, int inform);
 
 /* User visible functions declared in indices.c. */
-extern void info_index_search (WINDOW *window, int count, int key);
-extern void info_index_apropos (WINDOW *window, int count, int key);
+extern void info_index_search (WINDOW *window, int count);
+extern void info_index_apropos (WINDOW *window, int count);
 void next_index_match (FILE_BUFFER *fb, char *string, int offset, int dir,
                   REFERENCE **result, int *found_offset, int *match_offset);
 void report_index_match (int i, int match_offset);

Modified: trunk/info/info.h
===================================================================
--- trunk/info/info.h   2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/info.h   2014-11-07 10:49:13 UTC (rev 5912)
@@ -71,7 +71,7 @@
    utility program `makedoc', which is also responsible for making
    the documentation/function-pointer maps. */
 #define DECLARE_INFO_COMMAND(name, doc) \
-void name (WINDOW *window, int count, int key)
+void name (WINDOW *window, int count)
 
 
 /* For handling errors.  If you initialize the window system, you should

Modified: trunk/info/infodoc.c
===================================================================
--- trunk/info/infodoc.c        2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/infodoc.c        2014-11-07 10:49:13 UTC (rev 5912)
@@ -118,12 +118,9 @@
           register int last;
           char *doc, *name;
 
-          /* Hide some key mappings.  Do not display "Run command bound to
-             this key's lowercase variant" in help window, and omit lines
-             like "M-: .. M->(echo-area-insert)    Insert this character". */
+          /* Hide some key mappings. */
           if (map[i].function
-              && (map[i].function->func == info_do_lowercase_version
-                  || map[i].function->func == ea_insert))
+              && (map[i].function->func == info_do_lowercase_version))
             continue;
 
           doc = function_documentation (map[i].function);
@@ -600,8 +597,10 @@
         rep = "INS"; break;
       case KEY_BACK_TAB:
         rep = "BackTab"; break;
+      case KEY_MOUSE:
+        rep = "(mouse event)"; break;
       default:
-        rep = "shouldn't see this"; break;
+        rep = "(unknown key)"; break; /* This shouldn't be displayed. */
       }
   else
     {
@@ -888,7 +887,7 @@
 
   if (!command_name)
     {
-      info_abort_key (active_window, count, key);
+      info_abort_key (active_window, count);
       return;
     }
 

Modified: trunk/info/infomap.c
===================================================================
--- trunk/info/infomap.c        2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/infomap.c        2014-11-07 10:49:13 UTC (rev 5912)
@@ -56,8 +56,7 @@
   int len;
 
   if (function == NULL ||
-      function == InfoCmd (info_do_lowercase_version) ||
-      function == InfoCmd (ea_insert))
+      function == InfoCmd (info_do_lowercase_version))
     return;
 
   /* If there is already a key sequence recorded for this key map,
@@ -253,13 +252,12 @@
   KEY_LEFT_ARROW, NUL,          A_info_backward_char,
   KEY_DELETE, NUL,                A_info_scroll_backward,
   
-  /* These must be accessed as ESC PgUp, etc. */
-  KEYMAP_META(KEY_PAGE_UP), NUL,        A_info_scroll_other_window_backward,
-  KEYMAP_META(KEY_PAGE_DOWN), NUL,      A_info_scroll_other_window,
-  KEYMAP_META(KEY_UP_ARROW), NUL,       A_info_prev_line,
-  KEYMAP_META(KEY_DOWN_ARROW), NUL,     A_info_next_line,
-  KEYMAP_META(KEY_RIGHT_ARROW), NUL,    A_info_forward_word,
-  KEYMAP_META(KEY_LEFT_ARROW), NUL,     A_info_backward_word,
+  ESC, KEY_PAGE_UP, NUL,        A_info_scroll_other_window_backward,
+  ESC, KEY_PAGE_DOWN, NUL,      A_info_scroll_other_window,
+  ESC, KEY_UP_ARROW, NUL,       A_info_prev_line,
+  ESC, KEY_DOWN_ARROW, NUL,     A_info_next_line,
+  ESC, KEY_RIGHT_ARROW, NUL,    A_info_forward_word,
+  ESC, KEY_LEFT_ARROW, NUL,     A_info_backward_word,
   KEY_BACK_TAB, NUL,            A_info_move_to_prev_xref,
   
 };
@@ -475,13 +473,13 @@
   KEY_LEFT_ARROW, NUL,          A_info_scroll_backward_page_only,
   KEY_HOME, NUL,                A_info_beginning_of_node,
   KEY_END, NUL,                 A_info_end_of_node,
-  KEYMAP_META(KEY_PAGE_DOWN), NUL,      A_info_scroll_other_window,
-  KEYMAP_META(KEY_PAGE_UP), NUL,        A_info_scroll_other_window_backward,
-  KEYMAP_META(KEY_DELETE), NUL,         A_info_scroll_other_window_backward,
-  KEYMAP_META(KEY_UP_ARROW), NUL,       A_info_prev_node,
-  KEYMAP_META(KEY_DOWN_ARROW), NUL,     A_info_next_node,
-  KEYMAP_META(KEY_RIGHT_ARROW), NUL,    A_info_xref_item,
-  KEYMAP_META(KEY_LEFT_ARROW), NUL,     A_info_beginning_of_node,
+  ESC, KEY_PAGE_DOWN, NUL,      A_info_scroll_other_window,
+  ESC, KEY_PAGE_UP, NUL,        A_info_scroll_other_window_backward,
+  ESC, KEY_DELETE, NUL,         A_info_scroll_other_window_backward,
+  ESC, KEY_UP_ARROW, NUL,       A_info_prev_node,
+  ESC, KEY_DOWN_ARROW, NUL,     A_info_next_node,
+  ESC, KEY_RIGHT_ARROW, NUL,    A_info_xref_item,
+  ESC, KEY_LEFT_ARROW, NUL,     A_info_beginning_of_node,
   CONTROL('x'), KEY_DELETE, NUL, A_ea_backward_kill_line,
   
 };
@@ -611,6 +609,9 @@
 static void
 section_to_keymaps (Keymap map, int *table, unsigned int len)
 {
+  int k;
+  Keymap esc_map;
+
   int *p;
   int *seq;
   enum { getseq, gotseq, getaction } state = getseq;
@@ -650,6 +651,28 @@
     }
   if (state != getseq)
     abort ();
+
+  /* Go through map and bind ESC x to the same function as M-x if it is not 
+     bound already. */
+  if (!map[ESC].function)
+    {
+      map[ESC].type = ISKMAP;
+      map[ESC].function = (InfoCommand *)keymap_make_keymap ();
+    }
+
+  if (map[ESC].type != ISKMAP)
+    return; /* ESC is bound to a command. */
+
+  esc_map = (Keymap) map[ESC].function;
+  for (k = 1; k < KEYMAP_META_BASE; k++)
+    {
+      if (map[k + KEYMAP_META_BASE].type == ISFUNC
+          && esc_map[k].function == 0)
+        {
+          esc_map[k].type = ISFUNC;
+          esc_map[k].function = map[k + KEYMAP_META_BASE].function;
+        }
+    }
   return;
 }
 
@@ -669,11 +692,6 @@
       echo_area_keymap = keymap_make_keymap ();
     }
 
-  /* Bind the echo area insert routines. */
-  for (i = 0; i < 256; i++)
-    if (isprint (i))
-      echo_area_keymap[i].function = InfoCmd (ea_insert);
-
   if (!vi_keys_p)
     {
       info_keys = default_emacs_like_info_keys;

Modified: trunk/info/m-x.c
===================================================================
--- trunk/info/m-x.c    2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/m-x.c    2014-11-07 10:49:13 UTC (rev 5912)
@@ -71,7 +71,7 @@
 
   if (!line)
     {
-      info_abort_key (active_window, count, key);
+      info_abort_key (active_window, count);
       return;
     }
 
@@ -114,7 +114,7 @@
   /* User aborted? */
   if (!line)
     {
-      info_abort_key (active_window, count, key);
+      info_abort_key (active_window, count);
       return;
     }
 
@@ -172,7 +172,7 @@
       /* If the user aborted, do that now. */
       if (!line)
         {
-          info_abort_key (active_window, count, 0);
+          info_abort_key (active_window, count);
           return;
         }
 

Modified: trunk/info/makedoc.c
===================================================================
--- trunk/info/makedoc.c        2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/makedoc.c        2014-11-07 10:49:13 UTC (rev 5912)
@@ -441,7 +441,7 @@
 
       fprintf (funs_stream, "#define A_%s %u\n", func, next_func_key());
       fprintf (funs_stream,
-          "extern void %s (WINDOW *window, int count, int key);\n",
+          "extern void %s (WINDOW *window, int count);\n",
           func);
       free (func);
       free (doc);

Modified: trunk/info/nodemenu.c
===================================================================
--- trunk/info/nodemenu.c       2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/nodemenu.c       2014-11-07 10:49:13 UTC (rev 5912)
@@ -262,7 +262,7 @@
 
   if (!line)
     /* User aborts, just quit. */
-    info_abort_key (window, 0, 0);
+    info_abort_key (window, 0);
   else if (*line)
     {
       REFERENCE *entry;

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/session.c        2014-11-07 10:49:13 UTC (rev 5912)
@@ -217,13 +217,15 @@
   close_info_session ();
 }
 
-void mouse_reporting_on (void);
-void mouse_reporting_off (void);
+void info_next_line (WINDOW *, int count);
+void info_prev_line (WINDOW *, int count);
+static int info_keyseq_displayed_p;
 
 void
 info_read_and_dispatch (void)
 {
-  int key;
+  VFunction *cmd;
+  int count;
 
   for (quit_info_immediately = 0; !quit_info_immediately; )
     {
@@ -231,46 +233,21 @@
         display_update_display ();
 
       display_cursor_at_point (active_window);
-      info_initialize_numeric_arg ();
 
-      initialize_keyseq ();
-      mouse_reporting_on ();
-      key = get_input_key ();
-      mouse_reporting_off ();
-      if (key == -1)
-        continue;
+      cmd = read_key_sequence (info_keymap, 1, 1, 0, &count);
+      if (!info_keyseq_displayed_p)
+        window_clear_echo_area ();
 
-      /* Make key chord sequences ESC <key> equivalent to Meta-<key>. */
-      if (key == ESC)
+      if (cmd)
         {
-          int another_key;
-          another_key = get_input_key ();
-          if (another_key < KEYMAP_META_BASE)
-            another_key += KEYMAP_META_BASE;
-          key = another_key;
-        }
 
-      window_clear_echo_area ();
+          (*cmd) (active_window, count);
 
-      if (key == KEY_MOUSE)
-        mouse_event_handler ();
-      else
-        {
-          /* Do the selected command. */
-          VFunction *cmd = info_dispatch_on_key (key, info_keymap);
-          if (cmd)
-            {
-              void info_next_line (WINDOW *, int count, int key);
-              void info_prev_line (WINDOW *, int count, int key);
-
-              (*cmd) (active_window, 1, key);
-
-              /* Don't change the goal column when going up and down.  This 
-                 means we can go from a long line to a short line and back to
-                 a long line and end back in the same column. */
-              if (!(cmd == &info_next_line || cmd == &info_prev_line))
-                active_window->goal_column = -1; /* Goal is current column. */
-            }
+          /* Don't change the goal column when going up and down.  This 
+             means we can go from a long line to a short line and back to
+             a long line and end back in the same column. */
+          if (!(cmd == &info_next_line || cmd == &info_prev_line))
+            active_window->goal_column = -1; /* Goal is current column. */
         }
     }
 }
@@ -561,51 +538,38 @@
 static int get_input_key_internal (void);
 
 /* Whether to process or skip mouse events in the input stream. */
-static int mouse_reporting = 0;
 unsigned char mouse_cb, mouse_cx, mouse_cy;
 
 /* Handle mouse event given that mouse_cb, mouse_cx and mouse_cy contain the
    data from the event.  See the "XTerm Control Sequences" document for their
    meanings. */
-static void
+void
 mouse_event_handler (void)
 {
   if (mouse_cb & 0x40)
     {
-      void info_up_line (WINDOW *, int count, int key);
-      void info_down_line (WINDOW *, int count, int key);
+      void info_up_line (WINDOW *, int count);
+      void info_down_line (WINDOW *, int count);
 
       switch (mouse_cb & 0x03)
         {
         case 0: /* Mouse button 4 (scroll up). */
-          info_up_line (active_window, 3, KEY_MOUSE);
+          info_up_line (active_window, 3);
           break;
         case 1: /* Mouse button 5 (scroll down). */
-          info_down_line (active_window, 3, KEY_MOUSE);
+          info_down_line (active_window, 3);
           break;
         }
     }
 }
 
-void
-mouse_reporting_on (void)
-{
-  mouse_reporting = 1;
-}
-
-void
-mouse_reporting_off (void)
-{
-  mouse_reporting = 0;
-}
-
 /* Return number representing a key that has been pressed, which is an index
    into info_keymap and echo_area_keymap. */
 int
 get_input_key (void)
 {
   int ret = -1;
-
+  
   while (ret == -1)
     {
       ret = get_input_key_internal ();
@@ -615,9 +579,6 @@
           get_byte_from_input_buffer (&mouse_cb);
           get_byte_from_input_buffer (&mouse_cx);
           get_byte_from_input_buffer (&mouse_cy);
-
-          if (!mouse_reporting)
-            ret = -1;
         }
     }
   return ret;
@@ -1234,7 +1195,7 @@
     }
 }
 
-void info_prev_line (WINDOW *, int count, int key);
+void info_prev_line (WINDOW *, int count);
 
 /* Move to goal column, or end of line. */
 static void
@@ -1253,7 +1214,7 @@
 DECLARE_INFO_COMMAND (info_next_line, _("Move down to the next line"))
 {
   if (count < 0)
-    info_prev_line (window, -count, key);
+    info_prev_line (window, -count);
   else
     {
       if (window->goal_column == -1)
@@ -1268,7 +1229,7 @@
 DECLARE_INFO_COMMAND (info_prev_line, _("Move up to the previous line"))
 {
   if (count < 0)
-    info_next_line (window, -count, key);
+    info_next_line (window, -count);
   else
     {
       if (window->goal_column == -1)
@@ -1360,13 +1321,13 @@
     window->point = old_point;
 }
 
-void info_backward_char (WINDOW *, int count, int key);
+void info_backward_char (WINDOW *, int count);
 
 /* Move point forward in the node. */
 DECLARE_INFO_COMMAND (info_forward_char, _("Move forward a character"))
 {
   if (count < 0)
-    info_backward_char (window, -count, key);
+    info_backward_char (window, -count);
   else
     {
       while (count--)
@@ -1379,7 +1340,7 @@
 DECLARE_INFO_COMMAND (info_backward_char, _("Move backward a character"))
 {
   if (count < 0)
-    info_forward_char (window, -count, key);
+    info_forward_char (window, -count);
   else
     {
       while (count--)
@@ -1388,14 +1349,14 @@
     }
 }
 
-void info_backward_word (WINDOW *, int count, int key);
+void info_backward_word (WINDOW *, int count);
 
 /* Move forward a word in this node. */
 DECLARE_INFO_COMMAND (info_forward_word, _("Move forward a word"))
 {
   if (count < 0)
     {
-      info_backward_word (window, -count, key);
+      info_backward_word (window, -count);
       return;
     }
 
@@ -1409,7 +1370,7 @@
 {
   if (count < 0)
     {
-      info_forward_word (window, -count, key);
+      info_forward_word (window, -count);
       return;
     }
 
@@ -1493,7 +1454,7 @@
                  another node. */
               if (backward_move_node_structure (window, info_scroll_behaviour)
                   == 0)
-                info_end_of_node (window, 1, 0);
+                info_end_of_node (window, 1);
             }
           return;
         }
@@ -1525,7 +1486,7 @@
 /* Show the previous screen of WINDOW's node. */
 DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this 
window"))
 {
-  info_scroll_forward (window, -count, key);
+  info_scroll_forward (window, -count);
 }
 
 /* Like info_scroll_forward, but sets default_window_size as a side
@@ -1540,7 +1501,7 @@
         default_window_size *= -1;
     }
 
-  info_scroll_forward (window, count, key);
+  info_scroll_forward (window, count);
 }
 
 /* Like info_scroll_backward, but sets default_window_size as a side
@@ -1548,7 +1509,7 @@
 DECLARE_INFO_COMMAND (info_scroll_backward_set_window,
                       _("Scroll backward in this window and set default window 
size"))
 {
-  info_scroll_forward_set_window (window, -count, key);
+  info_scroll_forward_set_window (window, -count);
 }
 
 /* Show the next screen of WINDOW's node but never advance to next node. */
@@ -1569,7 +1530,7 @@
    node. */
 DECLARE_INFO_COMMAND (info_scroll_backward_page_only, _("Scroll backward in 
this window staying within node"))
 {
-  info_scroll_forward_page_only (window, -count, key);
+  info_scroll_forward_page_only (window, -count);
 }
 
 /* Like info_scroll_forward_page_only, but sets default_window_size as a side
@@ -1604,7 +1565,7 @@
 DECLARE_INFO_COMMAND (info_scroll_backward_page_only_set_window,
                       _("Scroll backward in this window staying within node 
and set default window size"))
 {
-  info_scroll_forward_page_only_set_window (window, -count, key);
+  info_scroll_forward_page_only_set_window (window, -count);
 }
 
 /* Scroll the window forward by N lines.  */
@@ -1655,7 +1616,7 @@
 DECLARE_INFO_COMMAND (info_scroll_half_screen_up,
                       _("Scroll up by half screen size"))
 {
-  info_scroll_half_screen_down (window, -count, key);
+  info_scroll_half_screen_down (window, -count);
 }
 
 /* Scroll the "other" window of WINDOW. */
@@ -1675,14 +1636,14 @@
   if (!other)
     other = window->prev;
 
-  info_scroll_forward (other, count, key);
+  info_scroll_forward (other, count);
 }
 
 /* Scroll the "other" window of WINDOW. */
 DECLARE_INFO_COMMAND (info_scroll_other_window_backward,
                       _("Scroll the other window backward"))
 {
-  info_scroll_other_window (window, -count, key);
+  info_scroll_other_window (window, -count);
 }
 
 
@@ -1777,14 +1738,14 @@
 /*                                                                  */
 /* **************************************************************** */
 
-void info_prev_window (WINDOW *, int count, int key);
+void info_prev_window (WINDOW *, int count);
 
 /* Make the next window in the chain be the active window. */
 DECLARE_INFO_COMMAND (info_next_window, _("Select the next window"))
 {
   if (count < 0)
     {
-      info_prev_window (window, -count, key);
+      info_prev_window (window, -count);
       return;
     }
 
@@ -1821,7 +1782,7 @@
 {
   if (count < 0)
     {
-      info_next_window (window, -count, key);
+      info_next_window (window, -count);
       return;
     }
 
@@ -2151,8 +2112,12 @@
   return menu[i];
 }
 
-/* Use KEY (a digit) to select the Nth menu item in WINDOW->node. */
 DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item"))
+{} /* Declaration only. */
+
+/* Use KEY (a digit) to select the Nth menu item in WINDOW->node. */
+void
+menu_digit (WINDOW *window, int count, int key)
 {
   int item = key - '0';
   REFERENCE *entry;
@@ -2188,7 +2153,7 @@
 DECLARE_INFO_COMMAND (info_last_menu_item,
    _("Select the last item in this node's menu"))
 {
-  info_menu_digit (window, 1, '0');
+  menu_digit (window, 1, '0');
 }
 
 static int exclude_cross_references (REFERENCE *r)
@@ -2213,8 +2178,7 @@
    and XREF control whether menu items and cross-references are eligible
    for selection. */
 static void
-info_menu_or_ref_item (WINDOW *window, unsigned char key,
-                       int menu_item, int xref, int ask_p)
+info_menu_or_ref_item (WINDOW *window, int menu_item, int xref, int ask_p)
 {
   REFERENCE *defentry = NULL; /* Default link */
   REFERENCE **refs = window->node->references;
@@ -2323,7 +2287,7 @@
       /* User aborts, just quit. */
       if (!line)
         {
-          info_abort_key (window, 0, 0);
+          info_abort_key (window, 0);
           return;
         }
 
@@ -2413,7 +2377,7 @@
 
       if (*r)
         {
-          info_menu_or_ref_item (window, key, 1, 0, 1);
+          info_menu_or_ref_item (window, 1, 0, 1);
           return;
         }
     }
@@ -2427,7 +2391,7 @@
 DECLARE_INFO_COMMAND
   (info_xref_item, _("Read a footnote or cross reference and select its node"))
 {
-  info_menu_or_ref_item (window, key, 0, 1, 1);
+  info_menu_or_ref_item (window, 0, 1, 1);
 }
 
 /* Position the cursor at the start of this node's menu. */
@@ -2531,13 +2495,13 @@
   return 1;
 }
 
-void info_move_to_next_xref (WINDOW *, int count, int key);
+void info_move_to_next_xref (WINDOW *, int count);
 
 DECLARE_INFO_COMMAND (info_move_to_prev_xref,
                       _("Move to the previous cross reference"))
 {
   if (count < 0)
-    info_move_to_next_xref (window, -count, key);
+    info_move_to_next_xref (window, -count);
   else
     {
       while (count > 0)
@@ -2584,7 +2548,7 @@
                       _("Move to the next cross reference"))
 {
   if (count < 0)
-    info_move_to_prev_xref (window, -count, key);
+    info_move_to_prev_xref (window, -count);
   else
     {
       while (count > 0)
@@ -2631,7 +2595,7 @@
 
   if (!ref || !*ref) return; /* No references in node */
 
-  info_menu_or_ref_item (window, key, 1, 1, 0);
+  info_menu_or_ref_item (window, 1, 1, 0);
 }
 
 /* Follow the menu list in MENUS (list of strings terminated by a NULL
@@ -2763,7 +2727,7 @@
   /* If the user aborted, quit now. */
   if (!line)
     {
-      info_abort_key (window, 0, 0);
+      info_abort_key (window, 0);
       return;
     }
 
@@ -3129,14 +3093,14 @@
   return 0;
 }
 
-void info_global_prev_node (WINDOW *, int count, int key);
+void info_global_prev_node (WINDOW *, int count);
 
 /* Move continuously forward through the node structure of this info file. */
 DECLARE_INFO_COMMAND (info_global_next_node,
                       _("Move forwards or down through node structure"))
 {
   if (count < 0)
-    info_global_prev_node (window, -count, key);
+    info_global_prev_node (window, -count);
   else
     {
       while (count)
@@ -3153,7 +3117,7 @@
                       _("Move backwards or up through node structure"))
 {
   if (count < 0)
-    info_global_next_node (window, -count, key);
+    info_global_next_node (window, -count);
   else
     {
       while (count)
@@ -3237,7 +3201,7 @@
   /* If the user aborted, quit now. */
   if (!line)
     {
-      info_abort_key (window, 0, 0);
+      info_abort_key (window, 0);
       return;
     }
 
@@ -3379,7 +3343,7 @@
   free (prompt);
   if (!line)
     {
-      info_abort_key (window, 0, 0);
+      info_abort_key (window, 0);
       return;
     }
   if (*line)
@@ -3411,7 +3375,7 @@
 
   if (!line)
     {
-      info_abort_key (window, 0, 0);
+      info_abort_key (window, 0);
       return;
     }
 
@@ -3473,7 +3437,7 @@
   line = info_read_in_echo_area (_("Find file: "));
   if (!line)
     {
-      info_abort_key (active_window, 1, 0);
+      info_abort_key (active_window, 1);
       return;
     }
 
@@ -4784,11 +4748,9 @@
 /*                                                                  */
 /* **************************************************************** */
 
-/* Declaration only.  Special cased in info_dispatch_on_key ().
-   Doc string is to avoid ugly results with describe_key etc.  */
 DECLARE_INFO_COMMAND (info_do_lowercase_version,
                       _("Run command bound to this key's lowercase variant"))
-{}
+{} /* Declaration only. */
 
 static void
 dispatch_error (int *keyseq)
@@ -4843,6 +4805,9 @@
 {
   char *rep;
 
+  if (!info_keyseq || info_keyseq_index == 0)
+    return;
+
   rep = pretty_keyseq (info_keyseq);
   if (expecting_future_input)
     strcat (rep, "-");
@@ -4895,11 +4860,97 @@
   return get_input_key ();
 }
 
-/* Look up the command associated with KEY in MAP.  If the associated command 
-   is really a keymap, then read another key, and dispatch into that map. */
+/* Non-zero means that an explicit argument has been passed to this
+   command, as in C-u C-v. */
+int info_explicit_arg = 0;
+
+/* As above, but used when C-u is typed in the echo area to avoid
+   overwriting this information when "C-u ARG M-x" is typed. */
+int ea_explicit_arg = 0;
+
+void info_universal_argument (WINDOW *, int count);
+void info_add_digit_to_numeric_arg (WINDOW *, int count);
+
+/* Read a key sequence and look up its command in MAP.  Handle C-u style 
+   numeric args, as well as M--, and M-digits.  Return argument in COUNT if it 
+   is non-null.
+
+   Some commands can be executed directly, in which case null is returned
+   instead:
+
+   If MENU, call info_menu_digit on ACTIVE_WINDOW if a number key was 
+   pressed.
+
+   If MOUSE, call mouse_event_handler if a mouse event occurred.
+
+   If INSERT, call ea_insert if a printable character was input.
+ */
 VFunction *
-info_dispatch_on_key (int key, Keymap map)
+read_key_sequence (Keymap map, int menu, int mouse,
+                   int insert, int *count)
 {
+  int key;
+  int reading_universal_argument = 0;
+
+  int numeric_arg = 1, numeric_arg_sign = 1, *which_explicit_arg;
+
+  info_initialize_numeric_arg ();
+
+  /* Process the right numeric argument. */
+  if (!echo_area_is_active)
+    which_explicit_arg = &info_explicit_arg;
+  else
+    which_explicit_arg = &ea_explicit_arg;
+
+  initialize_keyseq ();
+
+  key = get_input_key ();
+  if (key == KEY_MOUSE)
+    {
+      if (mouse)
+        mouse_event_handler ();
+      return 0;
+    }
+
+  if (insert
+      && (key >= 040 && key < 0200
+          || ISO_Latin_p && key >= 0200 && key < 0400))
+    {
+      ea_insert (the_echo_area, 1, key);
+      return 0;
+    }
+
+  goto begin2;
+begin:
+  if (display_was_interrupted_p && !info_any_buffered_input_p ())
+    display_update_display ();
+
+  if (active_window != the_echo_area)
+    display_cursor_at_point (active_window);
+
+  key = get_another_input_key ();
+
+begin2:
+  /* If reading a universal argument, both <digit> and M-<digit> help form the 
+     argument. */
+  if (reading_universal_argument)
+    {
+      int k = key;
+      if (k >= KEYMAP_META_BASE)
+        k -= KEYMAP_META_BASE;
+      if (k == '-')
+        {
+          goto dash;
+        }
+      else if (isdigit (k))
+        {
+          goto digit;
+        }
+      else
+        /* Note: we may still read another C-u after this. */
+        reading_universal_argument = 0;
+    }
+
   switch (map[key].type)
     {
     case ISFUNC:
@@ -4907,48 +4958,99 @@
         VFunction *func;
 
         func = map[key].function ? map[key].function->func : 0;
-        if (func != NULL)
+        if (!func)
           {
-            if (func == info_do_lowercase_version)
+            add_char_to_keyseq (key);
+            dispatch_error (info_keyseq);
+            return 0;
+          }
+        if (func == info_do_lowercase_version)
+          {
+            int lowerkey;
+
+            if (key >= KEYMAP_META_BASE)
               {
-                int lowerkey;
+                lowerkey = key;
+                lowerkey -= KEYMAP_META_BASE;
+                lowerkey = tolower (lowerkey);
+                lowerkey += KEYMAP_META_BASE;
+              }
+            else
+              lowerkey = tolower (key);
 
-                if (key >= KEYMAP_META_BASE)
-                  {
-                    lowerkey = key;
-                    lowerkey -= KEYMAP_META_BASE;
-                    lowerkey = tolower (lowerkey);
-                    lowerkey += KEYMAP_META_BASE;
-                  }
-                else
-                  lowerkey = tolower (key);
+            /* TODO: Point of this? */
+            if (lowerkey == key)
+              {
+                add_char_to_keyseq (key);
+                dispatch_error (info_keyseq);
+                return 0;
+              }
+            key = lowerkey;
+            goto begin;
+          }
 
-                if (lowerkey == key)
+        add_char_to_keyseq (key);
+
+        if (func == &info_universal_argument)
+          {
+            /* This means multiply by 4. */
+            /* info_explicit_arg seems to be doing double duty so that
+               C-u 2 doesn't mean 42. */
+            numeric_arg *= 4;
+            reading_universal_argument = 1;
+            goto begin;
+          }
+
+        if (func == &info_add_digit_to_numeric_arg)
+          {
+            reading_universal_argument = 1;
+            if (key == '-')
+              {
+dash:
+                add_char_to_keyseq (key);
+                if (!*which_explicit_arg)
                   {
-                    add_char_to_keyseq (key);
-                    dispatch_error (info_keyseq);
-                    return 0;
+                    numeric_arg_sign = -1;
+                    numeric_arg = 1;
                   }
-                return info_dispatch_on_key (lowerkey, map);
+
               }
+            else if (isdigit (key))
+              {
+digit:
+                add_char_to_keyseq (key);
+                if (*which_explicit_arg)
+                  numeric_arg = numeric_arg * 10 + (key - '0');
+                else
+                  numeric_arg = (key - '0');
+                *which_explicit_arg = 1;
+              }
+            goto begin;
+          }
 
-            add_char_to_keyseq (key);
+        /* Don't update the key sequence if reading a key sequence in the echo 
+           area.  This means that a key sequence like "C-u 2 Left"
+           appears to take effect immediately, instead of there being a 
+           delay while the message is displayed. */
+        if (!echo_area_is_active && info_keyseq_displayed_p)
+          display_info_keyseq (0);
 
-            /* Don't update the key sequence if reading a key sequence in the 
-               echo area.  This means that a key sequence like "C-u 2 Left"
-               appears to take effect immediately, instead of there being a 
-               delay while the message is displayed. */
-            if (!echo_area_is_active && info_keyseq_displayed_p)
-              display_info_keyseq (0);
-
-            return func;
-          }
-        else
+        if (menu && func == &info_menu_digit)
           {
-            add_char_to_keyseq (key);
-            dispatch_error (info_keyseq);
+            /* key can either be digit, or M-digit for --vi-keys. */
+            menu_digit (active_window, 1, key);
             return 0;
           }
+
+        if (insert
+            && (func == &ea_possible_completions || func == &ea_complete)
+            && !echo_area_completion_items)
+          {
+            ea_insert (the_echo_area, 1, key);
+          }
+        if (count)
+          *count = numeric_arg * numeric_arg_sign;
+        return func;
       }
       break;
 
@@ -4956,10 +5058,12 @@
       add_char_to_keyseq (key);
       if (map[key].function != NULL)
         {
-          int newkey;
+          map = (Keymap)map[key].function;
+          do
+            key = get_another_input_key ();
+          while (key == KEY_MOUSE);
 
-          newkey = get_another_input_key ();
-          return info_dispatch_on_key (newkey, (Keymap)map[key].function);
+          goto begin;
         }
       else
         {
@@ -4970,151 +5074,29 @@
     }
   return 0;
 }
-
-/* **************************************************************** */
-/*                                                                  */
-/*                      Numeric Arguments                           */
-/*                                                                  */
-/* **************************************************************** */
 
-/* Handle C-u style numeric args, as well as M--, and M-digits. */
-
-/* Non-zero means that an explicit argument has been passed to this
-   command, as in C-u C-v. */
-int info_explicit_arg = 0;
-
-/* The sign of the numeric argument. */
-int info_numeric_arg_sign = 1;
-
-/* The value of the argument itself. */
-int info_numeric_arg = 1;
-
-/* As above, but used when C-u is typed in the echo area to avoid
-   overwriting this information when "C-u ARG M-x" is typed. */
-int ea_explicit_arg = 0;
-int ea_numeric_arg_sign = 1;
-int ea_numeric_arg = 1;
-
-void info_universal_argument (WINDOW *, int count, int key);
-
-void
-info_numeric_arg_digit_loop (WINDOW *window, int count, int key)
-{
-  int pure_key;
-  Keymap keymap;
-
-  int *which_numeric_arg, *which_numeric_arg_sign, *which_explicit_arg;
-
-  /* Process the right numeric argument. */
-  if (!echo_area_is_active)
-    {
-      which_explicit_arg =     &info_explicit_arg;
-      which_numeric_arg_sign = &info_numeric_arg_sign;
-      which_numeric_arg =      &info_numeric_arg;
-      keymap = info_keymap;
-    }
-  else
-    {
-      which_explicit_arg =     &ea_explicit_arg;
-      which_numeric_arg_sign = &ea_numeric_arg_sign;
-      which_numeric_arg =      &ea_numeric_arg;
-      keymap = echo_area_keymap;
-    }
-
-  while (1)
-    {
-      if (key)
-        pure_key = key;
-      else
-        {
-          if (display_was_interrupted_p && !info_any_buffered_input_p ())
-            display_update_display ();
-
-          if (active_window != the_echo_area)
-            display_cursor_at_point (active_window);
-
-          pure_key = key = get_another_input_key ();
-
-          add_char_to_keyseq (key);
-        }
-
-      if (keymap[key].type == ISFUNC && keymap[key].function
-          && keymap[key].function->func == info_universal_argument)
-        {
-          *which_numeric_arg *= 4;
-          key = 0;
-          continue;
-        }
-
-      if (key >= KEYMAP_META_BASE)
-        key -= KEYMAP_META_BASE;
-
-      if (isdigit (key))
-        {
-          if (*which_explicit_arg)
-            *which_numeric_arg = (*which_numeric_arg * 10) + (key - '0');
-          else
-            *which_numeric_arg = (key - '0');
-          *which_explicit_arg = 1;
-        }
-      else
-        {
-          if (key == '-' && !*which_explicit_arg)
-            {
-              *which_numeric_arg_sign = -1;
-              *which_numeric_arg = 1;
-            }
-          else
-            {
-              VFunction *cmd;
-              info_keyseq_index--;
-              cmd = info_dispatch_on_key (pure_key, keymap);
-              if (cmd)
-                {
-                  (*cmd) (active_window,
-                          *which_numeric_arg * *which_numeric_arg_sign,
-                          key);
-                }
-              return;
-            }
-        }
-      key = 0;
-    }
-}
-
 /* Add the current digit to the argument in progress. */
 DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg,
                       _("Add this digit to the current numeric argument"))
-{
-  info_numeric_arg_digit_loop (window, 0, key);
-}
+{}
 
 /* C-u, universal argument.  Multiply the current argument by 4.
    Read a key.  If the key has nothing to do with arguments, then
    dispatch on it.  If the key is the abort character then abort. */
 DECLARE_INFO_COMMAND (info_universal_argument,
                       _("Start (or multiply by 4) the current numeric 
argument"))
-{
-  if (!echo_area_is_active)
-    info_numeric_arg *= 4;
-  else
-    ea_numeric_arg *= 4;
+{}
 
-  info_numeric_arg_digit_loop (window, 0, 0);
-}
-
 /* Create a default argument. */
 void
 info_initialize_numeric_arg (void)
 {
   if (!echo_area_is_active)
     {
-      info_numeric_arg = info_numeric_arg_sign = 1;
       info_explicit_arg = 0;
     }
   else
     {
-      ea_numeric_arg = ea_numeric_arg_sign = 1;
       ea_explicit_arg = 0;
     }
 }

Modified: trunk/info/session.h
===================================================================
--- trunk/info/session.h        2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/session.h        2014-11-07 10:49:13 UTC (rev 5912)
@@ -60,8 +60,8 @@
 int get_input_key (void);
 int get_another_input_key (void);
 
-/* Utility functions found in session.c */
-extern VFunction *info_dispatch_on_key (int key, Keymap map);
+VFunction *read_key_sequence (Keymap map, int menu, int mouse,
+                              int insert, int *count);
 extern unsigned char info_input_pending_p (void);
 extern void info_set_node_of_window (WINDOW *window, NODE *node);
 extern void initialize_keyseq (void);
@@ -112,15 +112,15 @@
 extern void initialize_terminal_and_keymaps (char *init_file);
 extern REFERENCE *info_intuit_options_node (NODE *initial_node, char *program);
 
-void info_scroll_forward (WINDOW *window, int count, int key);
-void info_abort_key (WINDOW *window, int count, int key);
+void info_scroll_forward (WINDOW *window, int count);
+void info_abort_key (WINDOW *window, int count);
 
 NODE *info_follow_menus (NODE *initial_node, char **menus,
                          char **error_msg, int strict);
 
 /* Adding numeric arguments. */
-extern int info_explicit_arg, info_numeric_arg, info_numeric_arg_sign;
-extern int ea_explicit_arg, ea_numeric_arg, ea_numeric_arg_sign;
+extern int info_explicit_arg;
+extern int ea_explicit_arg;
 extern void info_initialize_numeric_arg (void);
 
 /* Found in m-x.c.  */

Modified: trunk/info/terminal.c
===================================================================
--- trunk/info/terminal.c       2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/terminal.c       2014-11-07 10:49:13 UTC (rev 5912)
@@ -24,6 +24,7 @@
 #include "terminal.h"
 #include "termdep.h"
 #include "doc.h"
+#include "variables.h"
 
 #include <sys/types.h>
 #include <signal.h>
@@ -665,13 +666,17 @@
       byte_seq_to_key[i].next = 0;
     }
 
-  /* Map each byte to the meta key. */
-  for (i = 128; i < 256; i++)
-    {
-      byte_seq_to_key[i].type = BYTEMAP_KEY;
-      byte_seq_to_key[i].key = (i - 128) + KEYMAP_META_BASE;
-      byte_seq_to_key[i].next = 0;
-    }
+  /* Use 'ISO-Latin' variable to decide whether bytes with the 8th bit set 
+     represent the Meta key being pressed.  Maybe we should have another 
+     variable to enable 8-bit input.  If 'ISO-Latin' is set this allows input 
+     of non-ASCII characters in the echo area. */
+  if (!ISO_Latin_p)
+    for (i = 128; i < 256; i++)
+      {
+        byte_seq_to_key[i].type = BYTEMAP_KEY;
+        byte_seq_to_key[i].key = (i - 128) + KEYMAP_META_BASE;
+        byte_seq_to_key[i].next = 0;
+      }
 
   /* Hard-code octal 177 = delete.  Either 177 or the term_kD sequence will
      result in a delete key being registered. */

Modified: trunk/info/variables.c
===================================================================
--- trunk/info/variables.c      2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/variables.c      2014-11-07 10:49:13 UTC (rev 5912)
@@ -216,7 +216,7 @@
       /* User aborted? */
       if (!line)
         {
-          info_abort_key (active_window, 0, 0);
+          info_abort_key (active_window, 0);
           return;
         }
 
@@ -267,7 +267,7 @@
   /* User aborted? */
   if (!line)
     {
-      info_abort_key (active_window, 0, 0);
+      info_abort_key (active_window, 0);
       return NULL;
     }
 

Modified: trunk/info/variables.h
===================================================================
--- trunk/info/variables.h      2014-11-06 18:35:46 UTC (rev 5911)
+++ trunk/info/variables.h      2014-11-07 10:49:13 UTC (rev 5912)
@@ -58,10 +58,10 @@
 extern REFERENCE **make_variable_completions_array (void);
 
 /* Set the value of an info variable. */
-extern void set_variable (WINDOW *window, int count, int key);
+extern void set_variable (WINDOW *window, int count);
 extern int set_variable_to_value (VARIABLE_ALIST *var, char *value, int where);
 
-extern void describe_variable (WINDOW *window, int count, int key);
+extern void describe_variable (WINDOW *window, int count);
 
 /* The list of user-visible variables. */
 extern int auto_footnotes_p;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]