Source-Changes-HG archive

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

[src/trunk]: src/gnu/dist/texinfo merge texinfo-4.0



details:   https://anonhg.NetBSD.org/src/rev/5570b397fc73
branches:  trunk
changeset: 513168:5570b397fc73
user:      assar <assar%NetBSD.org@localhost>
date:      Wed Jul 25 16:46:19 2001 +0000

description:
merge texinfo-4.0

diffstat:

 gnu/dist/texinfo/info/info.c         |   447 +-
 gnu/dist/texinfo/info/terminal.c     |   107 +-
 gnu/dist/texinfo/lib/getopt.c        |    86 +-
 gnu/dist/texinfo/lib/system.h        |   131 +-
 gnu/dist/texinfo/makeinfo/makeinfo.c |  8719 +++++----------------------------
 gnu/dist/texinfo/util/install-info.c |  1429 +++-
 gnu/dist/texinfo/util/texi2dvi       |   746 +-
 gnu/dist/texinfo/util/texindex.c     |   190 +-
 8 files changed, 3326 insertions(+), 8529 deletions(-)

diffs (truncated from 14004 to 300 lines):

diff -r 457cc77fe67c -r 5570b397fc73 gnu/dist/texinfo/info/info.c
--- a/gnu/dist/texinfo/info/info.c      Wed Jul 25 16:20:30 2001 +0000
+++ b/gnu/dist/texinfo/info/info.c      Wed Jul 25 16:46:19 2001 +0000
@@ -1,7 +1,7 @@
 /* info.c -- Display nodes of Info files in multiple windows.
-   $Id: info.c,v 1.3 2000/11/01 02:06:24 itojun Exp $
+   $Id: info.c,v 1.4 2001/07/25 16:46:19 assar Exp $
 
-   Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc.
+   Copyright (C) 1993, 96, 97, 98, 99 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -27,12 +27,7 @@
 #  include "man.h"
 #endif /* HANDLE_MAN_PAGES */
 
-/* The version numbers of this version of Info. */
-int info_major_version = 2;
-int info_minor_version = 18;
-
-/* basename (argv[0]) */
-static char *program_name = NULL;
+static char *program_name = "info";
 
 /* Non-zero means search all indices for APROPOS_SEARCH_STRING. */
 static int apropos_p = 0;
@@ -44,8 +39,13 @@
    apropos, this puts the user at the node, running info. */
 static int index_search_p = 0;
 
+/* Non-zero means look for the node which describes the invocation
+   and command-line options of the program, and start the info
+   session at that node.  */
+static int goto_invocation_p = 0;
+
 /* Variable containing the string to search for when index_search_p is
-   non-zero. */ 
+   non-zero. */
 static char *index_search_string = (char *)NULL;
 
 /* Non-zero means print version info only. */
@@ -73,6 +73,18 @@
    dumped in the order encountered.  This basically can print a book. */
 int dump_subnodes = 0;
 
+/* Non-zero means make default keybindings be loosely modeled on vi(1).  */
+int vi_keys_p = 0;
+
+#ifdef __MSDOS__
+/* Non-zero indicates that screen output should be made 'speech-friendly'.
+   Since on MSDOS the usual behavior is to write directly to the video
+   memory, speech synthesizer software cannot grab the output.  Therefore,
+   we provide a user option which tells us to avoid direct screen output
+   and use stdout instead (which loses the color output).  */
+int speech_friendly = 0;
+#endif
+
 /* Structure describing the options that Info accepts.  We pass this structure
    to getopt_long ().  If you add or otherwise change this structure, you must
    also change the string which follows it. */
@@ -87,22 +99,33 @@
   { "file", 1, 0, 'f' },
   { "subnodes", 0, &dump_subnodes, 1 },
   { "output", 1, 0, 'o' },
+  { "show-options", 0, 0, 'O' },
+  { "usage", 0, 0, 'O' },
+  { "vi-keys", 0, &vi_keys_p, 1 },
   { "help", 0, &print_help_p, 1 },
   { "version", 0, &print_version_p, 1 },
   { "dribble", 1, 0, DRIBBLE_OPTION },
   { "restore", 1, 0, RESTORE_OPTION },
+#ifdef __MSDOS__
+  { "speech-friendly", 0, &speech_friendly, 1 },
+#endif
   { "index-search", 1, 0, IDXSRCH_OPTION },
   {NULL, 0, NULL, 0}
 };
 
 /* String describing the shorthand versions of the long options found above. */
-static char *short_options = "d:n:f:o:s";
+#ifdef __MSDOS__
+static char *short_options = "d:n:f:o:Osb";
+#else
+static char *short_options = "d:n:f:o:Os";
+#endif
 
 /* When non-zero, the Info window system has been initialized. */
 int info_windows_initialized_p = 0;
 
 /* Some "forward" declarations. */
 static void info_short_help (), remember_info_program_name ();
+static void init_messages ();
 
 
 /* **************************************************************** */
@@ -119,8 +142,6 @@
   int getopt_long_index;        /* Index returned by getopt_long (). */
   NODE *initial_node;           /* First node loaded by Info. */
 
-  remember_info_program_name (argv[0]);
-
 #ifdef HAVE_SETLOCALE
   /* Set locale via LC_ALL.  */
   setlocale (LC_ALL, "");
@@ -132,6 +153,8 @@
   textdomain (PACKAGE);
 #endif
 
+  init_messages ();
+  
   while (1)
     {
       int option_character;
@@ -179,12 +202,25 @@
           user_output_filename = xstrdup (optarg);
           break;
 
+         /* User has specified that she wants to find the "Options"
+             or "Invocation" node for the program.  */
+        case 'O':
+          goto_invocation_p = 1;
+          break;
+
           /* User is specifying that she wishes to dump the subnodes of
              the node that she is dumping. */
         case 's':
           dump_subnodes = 1;
           break;
 
+#ifdef __MSDOS__
+         /* User specifies that she wants speech-friendly output.  */
+       case 'b':
+         speech_friendly = 1;
+         break;
+#endif /* __MSDOS__ */
+
           /* User has specified a string to search all indices for. */
         case APROPOS_OPTION:
           apropos_p = 1;
@@ -211,9 +247,8 @@
           break;
 
         default:
-          fprintf (stderr, _("Try --help for more information."));
-         fputc('\n', stderr);
-          exit (1);
+          fprintf (stderr, _("Try --help for more information.\n"));
+          xexit (1);
         }
     }
 
@@ -229,23 +264,23 @@
   /* If the user specified --version, then show the version and exit. */
   if (print_version_p)
     {
-      printf ("%s (GNU %s %s) %s\n", program_name, PACKAGE, VERSION, 
-              version_string ());
+      printf ("%s (GNU %s) %s\n", program_name, PACKAGE, VERSION);
+      puts ("");
       printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
 There is NO warranty.  You may redistribute this software\n\
 under the terms of the GNU General Public License.\n\
 For more information about these matters, see the files named COPYING.\n"),
-                 "1998");
-      exit (0);
+                 "1999");
+      xexit (0);
     }
 
   /* If the `--help' option was present, show the help and exit. */
   if (print_help_p)
     {
       info_short_help ();
-      exit (0);
+      xexit (0);
     }
-  
+
   /* If the user hasn't specified a path for Info files, default it.
      Lowest priority is our messy hardwired list in filesys.h.
      Then comes the user's INFODIR from the Makefile.
@@ -258,7 +293,7 @@
         {
           unsigned len = strlen (path_from_env);
           /* Trailing : on INFOPATH means insert the default path.  */
-          if (len && path_from_env[len - 1] == ':')
+          if (len && path_from_env[len - 1] == PATH_SEP[0])
             {
               path_from_env[len - 1] = 0;
               info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
@@ -286,7 +321,14 @@
 
       if (temp != directory_name)
         {
-          *temp = 0;
+         if (HAVE_DRIVE (directory_name) && temp == directory_name + 2)
+           {
+             /* The directory of "d:foo" is stored as "d:.", to avoid
+                mixing it with "d:/" when a slash is appended.  */
+             *temp = '.';
+             temp += 2;
+           }
+          temp[-1] = 0;
           info_add_path (directory_name, INFOPATH_PREPEND);
         }
 
@@ -298,13 +340,13 @@
   if (apropos_p)
     {
       info_apropos (apropos_search_string);
-      exit (0);
+      xexit (0);
     }
 
   /* Get the initial Info node.  It is either "(dir)Top", or what the user
      specifed with values in user_filename and user_nodenames. */
   initial_node = info_get_node (user_filename,
-                                user_nodenames ? user_nodenames[0] : NULL);
+                                user_nodenames ? user_nodenames[0] : 0);
 
   /* If we couldn't get the initial node, this user is in trouble. */
   if (!initial_node)
@@ -312,9 +354,9 @@
       if (info_recent_file_error)
         info_error (info_recent_file_error);
       else
-        info_error
-          (CANT_FIND_NODE, user_nodenames ? user_nodenames[0] : "Top");
-      exit (1);
+        info_error (msg_cant_find_node,
+                    user_nodenames ? user_nodenames[0] : "Top");
+      xexit (1);
     }
 
   /* Special cases for when the user specifies multiple nodes.  If we
@@ -331,7 +373,7 @@
       else
         begin_multiple_window_info_session (user_filename, user_nodenames);
 
-      exit (0);
+      xexit (0);
     }
 
   /* If the user specified `--index-search=STRING', start the info
@@ -375,184 +417,105 @@
      in sequential info files starting from the first one loaded.  That
      file name is either "dir", or the contents of user_filename if one
      was specified. */
-  while (optind != argc)
-    {
-      REFERENCE **menu;
-      REFERENCE *entry;
-      NODE *node;
-      char *arg;
-      static char *first_arg = (char *)NULL;
-
-      /* Remember the name of the menu entry we want. */
-      arg = argv[optind++];
-
-      if (!first_arg)
-        first_arg = arg;
-
-      /* Build and return a list of the menu items in this node. */
-      menu = info_menu_of_node (initial_node);
-
-      /* If there wasn't a menu item in this node, stop here, but let
-         the user continue to use Info.  Perhaps they wanted this node
-         and didn't realize it. */
-      if (!menu)
-        {
-#if defined (HANDLE_MAN_PAGES)
-          if (first_arg == arg)
-            {
-              node = make_manpage_node (first_arg);
-              if (node)
-                goto maybe_got_node;
-            }
-#endif /* HANDLE_MAN_PAGES */
-          begin_info_session_with_error
-            (initial_node, _("There is no menu in this node."));
-          exit (0);
-        }
-
-      /* Find the specified menu item. */
-      entry = info_get_labeled_reference (arg, menu);
+  {
+    char *errstr, *errarg1, *errarg2;
+    NODE *new_initial_node = info_follow_menus (initial_node, argv + optind,
+                                                &errstr, &errarg1, &errarg2);
+    if (new_initial_node && new_initial_node != initial_node)
+      initial_node = new_initial_node;
 
-      /* If the item wasn't found, search the list sloppily.  Perhaps this
-         user typed "buffer" when they really meant "Buffers". */
-      if (!entry)
-        {
-          register int i;
-          int best_guess = -1;
-



Home | Main Index | Thread Index | Old Index