texinfo-commits
[Top][All Lists]
Advanced

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

[5776] info variable 'mouse'


From: Gavin D. Smith
Subject: [5776] info variable 'mouse'
Date: Sat, 23 Aug 2014 16:16:42 +0000

Revision: 5776
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5776
Author:   gavin
Date:     2014-08-23 16:16:39 +0000 (Sat, 23 Aug 2014)
Log Message:
-----------
info variable 'mouse'

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/NEWS
    trunk/doc/info-stnd.texi
    trunk/info/terminal.c
    trunk/info/terminal.h
    trunk/info/variables.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-08-23 11:38:42 UTC (rev 5775)
+++ trunk/ChangeLog     2014-08-23 16:16:39 UTC (rev 5776)
@@ -1,3 +1,15 @@
+2014-08-23  Gavin Smith  <address@hidden>
+
+       * info/variables.c (info_variables): New user variable 'mouse'.
+       * info/terminal.c (mouse_protocol): New variable.
+       * info/terminal.h (MP_NONE, MP_NORMAL_TRACKING): New preprocessor
+       definitions.
+       * info/terminal.c (terminal_initialize_terminal): Check if
+       mouse tracking was turned off.
+       * info/variables.c (describe_variable): Allow arbitarily long values
+       for variables.
+       * doc/info-stnd.texi (Variables): Document 'mouse' variable.
+
 2014-08-23  Karl Berry  <address@hidden>
 
        * Texinfo/Convert/Plaintext.pm (converter_initialize): put 

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS  2014-08-23 11:38:42 UTC (rev 5775)
+++ trunk/NEWS  2014-08-23 16:16:39 UTC (rev 5776)
@@ -41,7 +41,7 @@
     not found as a top-level menu item.
   . invoking info with an absolute or explicitly relative file name
     (./foo.info, /tmp/foo.info, etc.) just visits that file.
-  . new option --init-file allows overriding ~/.info.
+  . new option --init-file allows overriding ~/.infokey.
   . new command M-x info-version.
   . the M-x kill-node command has been removed.
   . new variable infopath-no-defaults allows omitting the compile-time
@@ -50,6 +50,7 @@
   . separate `infokey' program has been removed - the .infokey file is now
     read directly by info.
   . new variable `highlight-searches' allows highlighting results from a search
+  . support for mouse scrollwheel, controlled by 'mouse' variable
 
 * install-info:
   . handle compressed input file names containing spaces.

Modified: trunk/doc/info-stnd.texi
===================================================================
--- trunk/doc/info-stnd.texi    2014-08-23 11:38:42 UTC (rev 5775)
+++ trunk/doc/info-stnd.texi    2014-08-23 16:16:39 UTC (rev 5776)
@@ -2177,6 +2177,13 @@
 search for a string (or regular expression) shorter than this value,
 result in an error.
 
address@hidden mouse
address@hidden mouse
+What method to use to get input from a mouse device.  The default value is
address@hidden, which makes Info use ``normal tracking mode'' if
+it detects that the terminal supports it.  If the value is @code{Off},
+mouse tracking is disabled.
+
 @anchor{scroll-behavior}
 @item scroll-behavior
 @itemx scroll-behaviour

Modified: trunk/info/terminal.c
===================================================================
--- trunk/info/terminal.c       2014-08-23 11:38:42 UTC (rev 5775)
+++ trunk/info/terminal.c       2014-08-23 16:16:39 UTC (rev 5776)
@@ -70,6 +70,9 @@
 VFunction *terminal_write_chars_hook = NULL;
 VFunction *terminal_scroll_terminal_hook = NULL;
 
+/* User variable 'mouse'.  Values can be MP_* constants in terminal.h. */
+int mouse_protocol = MP_NORMAL_TRACKING;
+
 /* **************************************************************** */
 /*                                                                  */
 /*                      Terminal and Termcap                        */
@@ -143,8 +146,11 @@
      xterm.  The presence of the Km capability may not be a reliable way to
      tell whether this mode exists, but sending the following sequence is
      probably harmless if it doesn't.  */
-  if (term_Km && !strcmp (term_Km, "\033[M"))
+  if (mouse_protocol == MP_NORMAL_TRACKING
+      && term_Km && !strcmp (term_Km, "\033[M"))
     send_to_terminal ("\033[?1000h");
+  else
+    term_Km = 0;
 
   if (term_keypad_on)
       send_to_terminal (term_keypad_on);
@@ -755,7 +761,7 @@
 
   term_bt = tgetstr ("bt", &buffer);
 
-  /* String introducing a mosue event. */
+  /* String introducing a mouse event. */
   term_Km = tgetstr ("Km", &buffer);
 
   initialize_byte_map ();

Modified: trunk/info/terminal.h
===================================================================
--- trunk/info/terminal.h       2014-08-23 11:38:42 UTC (rev 5775)
+++ trunk/info/terminal.h       2014-08-23 16:16:39 UTC (rev 5776)
@@ -128,4 +128,8 @@
 
 extern char *term_so, *term_se;
 
+#define MP_NONE 0
+#define MP_NORMAL_TRACKING 1
+extern int mouse_protocol;
+
 #endif /* !TERMINAL_H */

Modified: trunk/info/variables.c
===================================================================
--- trunk/info/variables.c      2014-08-23 11:38:42 UTC (rev 5775)
+++ trunk/info/variables.c      2014-08-23 16:16:39 UTC (rev 5776)
@@ -32,6 +32,8 @@
    a variable. */
 static char *on_off_choices[] = { "Off", "On", NULL };
 
+static char *mouse_choices[] = { "Off", "normal-tracking", NULL };
+
 /* Note that the 'where_set' field of each element in the array is
    not given and defaults to 0. */
 VARIABLE_ALIST info_variables[] = {
@@ -108,6 +110,10 @@
       N_("Highlight search matches"),
     &highlight_searches_p, (char **)on_off_choices },
 
+  { "mouse",
+      N_("Method to use to track mouse events"),
+    &mouse_protocol, (char **)mouse_choices },
+
   { NULL }
 };
 
@@ -118,19 +124,15 @@
 
   /* Get the variable's name. */
   var = read_variable_name (_("Describe variable: "), window);
-
   if (!var)
     return;
 
-  description = xmalloc (20 + strlen (var->name)
-                        + strlen (_(var->doc)));
-
   if (var->choices)
-    sprintf (description, "%s (%s): %s.",
-             var->name, var->choices[*(var->value)], _(var->doc));
+    asprintf (&description, "%s (%s): %s.",
+             var->name, var->choices[*var->value], _(var->doc));
   else
-    sprintf (description, "%s (%d): %s.",
-            var->name, *(var->value), _(var->doc));
+    asprintf (&description, "%s (%d): %s.",
+            var->name, *var->value, _(var->doc));
 
   window_message_in_echo_area ("%s", description);
   free (description);




reply via email to

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