texinfo-commits
[Top][All Lists]
Advanced

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

[5323] The -x option takes a numeric argument.


From: Sergey Poznyakoff
Subject: [5323] The -x option takes a numeric argument.
Date: Sat, 17 Aug 2013 19:00:30 +0000

Revision: 5323
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5323
Author:   gray
Date:     2013-08-17 19:00:28 +0000 (Sat, 17 Aug 2013)
Log Message:
-----------
The -x option takes a numeric argument.

* NEWS: Document -a.
* doc/info-stnd.texi: Document existing debugging levels.
Document -x -1.
* info/info.c (debug_level): Change type to unsigned.
(long_options, short_options): -x now requires argument.
(set_debug_level): New function.
(main): Change -x handling.
* info/info.h (debug_level): Change declaration.

Minor fixes:

* info/echo-area.c (ea_possible_completions)
[SPLIT_BEFORE_ACTIVE]: Declare start here.
(ea_scroll_completions_window): Remove unused variable.
(pause_or_input): Likewise.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/NEWS
    trunk/doc/info-stnd.texi
    trunk/info/echo-area.c
    trunk/info/info.c
    trunk/info/info.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2013-08-17 13:07:09 UTC (rev 5322)
+++ trunk/ChangeLog     2013-08-17 19:00:28 UTC (rev 5323)
@@ -1,5 +1,25 @@
 2013-08-17  Sergey Poznyakoff  <address@hidden>
 
+       The -x option takes a numeric argument.
+
+       * NEWS: Document -a.
+       * doc/info-stnd.texi: Document existing debugging levels.
+       Document -x -1.
+       * info/info.c (debug_level): Change type to unsigned.
+       (long_options, short_options): -x now requires argument.
+       (set_debug_level): New function.
+       (main): Change -x handling.
+       * info/info.h (debug_level): Change declaration.
+
+       Minor fixes:
+
+       * info/echo-area.c (ea_possible_completions)
+       [SPLIT_BEFORE_ACTIVE]: Declare start here.
+       (ea_scroll_completions_window): Remove unused variable.
+       (pause_or_input): Likewise.
+
+2013-08-17  Sergey Poznyakoff  <address@hidden>
+
        Fix -a functionality.
 
        * info/info.c (all_files): Clear cached data to avoid

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS  2013-08-17 13:07:09 UTC (rev 5322)
+++ trunk/NEWS  2013-08-17 19:00:28 UTC (rev 5323)
@@ -26,6 +26,10 @@
   . new option -x (--debug) enables additional debugging output.
   . new option -v (--variable) assigns a value to an Info variable.
     The syntax is the same as for many other GNU utilities: -v VARIABLE=VALUE
+  . new option -a (--all) instructs info to display all documents
+    matching the command line arguments, not just the first.  In
+    conjunction with the -w option, it shows full names of the info
+    files matching the command line arguments.
   . new variable search-skip-screen controls the starting position for
     repeated search commands ({ and }).  When set to On, repeated
     searches skip the lines displayed on the screen, i.e.,

Modified: trunk/doc/info-stnd.texi
===================================================================
--- trunk/doc/info-stnd.texi    2013-08-17 13:07:09 UTC (rev 5322)
+++ trunk/doc/info-stnd.texi    2013-08-17 19:00:28 UTC (rev 5323)
@@ -181,11 +181,22 @@
 @ref{Searching Commands}.
 
 @cindex debugging
address@hidden -x
address@hidden --debug
-Print additional debugging information.  Each subsequent occurrence of
-this option increases the debugging output verbosity.
address@hidden address@hidden
address@hidden -x @var{number} 
+Print additional debugging information.  The argument specifies the
+requested verbosity level.  To request maximum level, use
address@hidden -1}.
 
+The version @value{VERSION} of GNU info defines two verbosity levels:
+
address@hidden @asis
address@hidden 1
+Print information about file lookups.
+
address@hidden 2
+Print operations over the @env{INFOPATH}.
address@hidden table
+
 Unless the window system is initialized, debugging output goes to the
 standard error.  When it is initialized, it is diverted to the file
 @file{infodebug} in the current working directory.

Modified: trunk/info/echo-area.c
===================================================================
--- trunk/info/echo-area.c      2013-08-17 13:07:09 UTC (rev 5322)
+++ trunk/info/echo-area.c      2013-08-17 19:00:28 UTC (rev 5323)
@@ -1028,15 +1028,17 @@
             if (calling_window->height > (iterations * 2)
                && calling_window->height / 2 >= WINDOW_MIN_SIZE)
               {
-                int start, pagetop;
+                int pagetop;
 #ifdef SPLIT_BEFORE_ACTIVE
-                int end;
+                int start, end;
 #endif
 
                 active_window = calling_window;
 
                 /* Perhaps we can scroll this window on redisplay. */
+#ifdef SPLIT_BEFORE_ACTIVE
                 start = calling_window->first_row;
+#endif
                 pagetop = calling_window->pagetop;
 
                 compwin =
@@ -1343,15 +1345,12 @@
 DECLARE_INFO_COMMAND (ea_scroll_completions_window, _("Scroll the completions 
window"))
 {
   WINDOW *compwin;
-  int old_pagetop;
 
   compwin = get_internal_info_window (compwin_name);
 
   if (!compwin)
     compwin = calling_window;
 
-  old_pagetop = compwin->pagetop;
-
   /* Let info_scroll_forward () do the work, and print any messages that
      need to be displayed. */
   info_scroll_forward (compwin, count, key);
@@ -1488,13 +1487,12 @@
 #ifdef FD_SET
   struct timeval timer;
   fd_set readfds;
-  int ready;
 
   FD_ZERO (&readfds);
   FD_SET (fileno (stdin), &readfds);
   timer.tv_sec = 2;
   timer.tv_usec = 0;
-  ready = select (fileno (stdin) + 1, &readfds, NULL, NULL, &timer);
+  select (fileno (stdin) + 1, &readfds, NULL, NULL, &timer);
 #endif /* FD_SET */
 }
 

Modified: trunk/info/info.c
===================================================================
--- trunk/info/info.c   2013-08-17 13:07:09 UTC (rev 5322)
+++ trunk/info/info.c   2013-08-17 19:00:28 UTC (rev 5323)
@@ -87,7 +87,7 @@
 static int print_where_p = 0;
 
 /* Debugging level */
-int debug_level;
+unsigned debug_level;
 
 /* Non-zero means don't try to be smart when searching for nodes.  */
 int strict_node_location_p = 0;
@@ -110,7 +110,7 @@
 static struct option long_options[] = {
   { "all", 0, 0, 'a' },
   { "apropos", 1, 0, 'k' },
-  { "debug", 0, 0, 'x' },
+  { "debug", 1, 0, 'x' },
   { "directory", 1, 0, 'd' },
   { "dribble", 1, 0, DRIBBLE_OPTION },
   { "file", 1, 0, 'f' },
@@ -140,9 +140,9 @@
 
 /* String describing the shorthand versions of the long options found above. */
 #if defined(__MSDOS__) || defined(__MINGW32__)
-static char *short_options = "ak:d:n:f:ho:ORsv:wbx";
+static char *short_options = "ak:d:n:f:ho:ORsv:wbx:";
 #else
-static char *short_options = "ak:d:n:f:ho:ORv:wsx";
+static char *short_options = "ak:d:n:f:ho:ORv:wsx:";
 #endif
 
 /* When non-zero, the Info window system has been initialized. */
@@ -462,8 +462,24 @@
   begin_info_session (allfiles_create_node (argc ? argv[0] : fname, fref));
   return EXIT_SUCCESS;
 }
-
 
+static void
+set_debug_level (const char *arg)
+{
+  char *p;
+  long n = strtol (arg, &p, 10);
+  if (*p)
+    {
+      fprintf (stderr, _("invalid number: %s\n"), arg);
+      exit (EXIT_FAILURE);
+    }
+  if (n < 0 || n > UINT_MAX)
+    debug_level = UINT_MAX;
+  else
+    debug_level = n;
+}
+      
+
 /* **************************************************************** */
 /*                                                                  */
 /*                Main Entry Point to the Info Program              */
@@ -631,7 +647,7 @@
          break;
          
        case 'x':
-         debug_level++;
+         set_debug_level (optarg);
          break;
          
         default:
@@ -876,7 +892,7 @@
       --vi-keys                use vi-like and less-like key bindings.\n\
       --version                display version information and exit.\n\
   -w, --where, --location      print physical location of Info file.\n\
-  -x, --debug                  increase debugging level.\n"));
+  -x, --debug=NUMBER           set debugging level.\n"));
 
   puts (_("\n\
 The first non-option argument, if present, is the menu entry to start from;\n\

Modified: trunk/info/info.h
===================================================================
--- trunk/info/info.h   2013-08-17 13:07:09 UTC (rev 5322)
+++ trunk/info/info.h   2013-08-17 19:00:28 UTC (rev 5323)
@@ -129,7 +129,7 @@
 /* Non-zero means don't try to be smart when searching for nodes.  */
 extern int strict_node_location_p;
 
-extern int debug_level;
+extern unsigned debug_level;
 
 #define debug(n,c)                                                     \
   do                                                                   \




reply via email to

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