texinfo-commits
[Top][All Lists]
Advanced

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

[5726] user variable for multi-byte key delay


From: Gavin D. Smith
Subject: [5726] user variable for multi-byte key delay
Date: Sun, 27 Jul 2014 18:55:03 +0000

Revision: 5726
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5726
Author:   gavin
Date:     2014-07-27 18:55:01 +0000 (Sun, 27 Jul 2014)
Log Message:
-----------
user variable for multi-byte key delay

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/session.c
    trunk/info/variables.c
    trunk/info/variables.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-07-27 17:05:12 UTC (rev 5725)
+++ trunk/ChangeLog     2014-07-27 18:55:01 UTC (rev 5726)
@@ -15,6 +15,10 @@
        * info/t/anchor-positions.sh: New test.
        * info/t/infodir/anchor-positions.info: New file.
 
+       * info/session.c (key_time): New variable.
+       (get_input_key_internal): Use it instead of hardcoded value.
+       (info_variables): Add 'key-time' user variable.
+
 2014-07-26  Gavin Smith  <address@hidden>
 
        * info/session.c (info_search_1): Unused 'key' argument removed.

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-07-27 17:05:12 UTC (rev 5725)
+++ trunk/info/session.c        2014-07-27 18:55:01 UTC (rev 5726)
@@ -595,6 +595,11 @@
   return ret;
 }
 
+/* Time in milliseconds to wait for the next byte of a byte sequence
+   corresponding to a key or key chord.  Settable with the 'key-time' user
+   variable. */
+int key_time = 100;
+
 /* Read bytes from input and return what key has been pressed.  Return -1 on
    reading an unrecognized key. */
 static int
@@ -643,8 +648,7 @@
         break;
 
       /* If we read an incomplete byte sequence, pause a short while to
-         see if more bytes follow.  We should probably allow the length
-         of this delay to be settable by the user. */
+         see if more bytes follow. */
       if (in_map && pop_index == push_index)
         {
           int ready = 0;
@@ -655,7 +659,7 @@
           FD_ZERO (&readfds);
           FD_SET (fileno (info_input_stream), &readfds);
           timer.tv_sec = 0;
-          timer.tv_usec = 10000;
+          timer.tv_usec = key_time * 1000;
           ready = select (fileno(info_input_stream)+1, &readfds,
                           NULL, NULL, &timer);
 #else

Modified: trunk/info/variables.c
===================================================================
--- trunk/info/variables.c      2014-07-27 17:05:12 UTC (rev 5725)
+++ trunk/info/variables.c      2014-07-27 18:55:01 UTC (rev 5726)
@@ -100,6 +100,10 @@
       N_("Remove Info file syntax from the text of nodes"),
     &preprocess_nodes_p, (char **)on_off_choices },
 
+  { "key-time",
+      N_("Length of time in milliseconds to wait for the next byte in a 
sequence indicating that a key has been pressed"),
+    &key_time, NULL },
+
   { NULL }
 };
 

Modified: trunk/info/variables.h
===================================================================
--- trunk/info/variables.h      2014-07-27 17:05:12 UTC (rev 5725)
+++ trunk/info/variables.h      2014-07-27 18:55:01 UTC (rev 5726)
@@ -76,5 +76,6 @@
 extern int search_skip_screen_p;
 extern int infopath_no_defaults_p;
 extern int preprocess_nodes_p;
+extern int key_time;
 
 #endif /* not INFO_VARIABLES_H */




reply via email to

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