texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/info session.c


From: Sergey Poznyakoff
Subject: texinfo/info session.c
Date: Thu, 28 Jul 2011 07:15:20 +0000

CVSROOT:        /cvsroot/texinfo
Module name:    texinfo
Changes by:     Sergey Poznyakoff <gray>        11/07/28 07:15:20

Modified files:
        info           : session.c 

Log message:
        (info_menu_digit): Use ngettext.
        Remove extra arguments from calls to variadic functions.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/info/session.c?cvsroot=texinfo&r1=1.48&r2=1.49

Patches:
Index: session.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/info/session.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -b -r1.48 -r1.49
--- session.c   6 Apr 2011 21:18:03 -0000       1.48
+++ session.c   28 Jul 2011 07:15:20 -0000      1.49
@@ -1,5 +1,5 @@
 /* session.c -- user windowing interface to Info.
-   $Id: session.c,v 1.48 2011/04/06 21:18:03 gray Exp $
+   $Id: session.c,v 1.49 2011/07/28 07:15:20 gray Exp $
 
    Copyright (C) 1993, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
    2004, 2007, 2008, 2009 Free Software Foundation, Inc.
@@ -112,7 +112,7 @@
           if (!largest)
             {
               display_update_display (windows);
-              info_error (msg_cant_find_window, NULL, NULL);
+              info_error (msg_cant_find_window);
               info_session ();
               xexit (0);
             }
@@ -127,7 +127,7 @@
           else
             {
               display_update_display (windows);
-              info_error (msg_win_too_small, NULL, NULL);
+              info_error (msg_win_too_small);
               info_session ();
               xexit (0);
             }
@@ -257,7 +257,7 @@
       if (!term_name)
         term_name = "dumb";
 
-      info_error (msg_term_too_dumb, term_name, NULL);
+      info_error (msg_term_too_dumb, term_name);
       xexit (1);
     }
 
@@ -594,7 +594,7 @@
 {
   if (old == -1)
     {
-      info_error (msg_cant_find_point, NULL, NULL);
+      info_error (msg_cant_find_point);
     }
   else
     {
@@ -1142,14 +1142,14 @@
   switch (behaviour)
     {
     case IS_PageOnly:
-      info_error (msg_at_node_bottom, NULL, NULL);
+      info_error (msg_at_node_bottom);
       return 1;
 
     case IS_NextOnly:
       info_next_label_of_node (window->node);
       if (!info_parsed_nodename && !info_parsed_filename)
         {
-          info_error (msg_no_pointer, (char *) _("Next"), NULL);
+          info_error (msg_no_pointer, _("Next"));
           return 1;
         }
       else
@@ -1165,8 +1165,7 @@
            switch (scroll_last_node)
              {
              case SLN_Stop:
-               info_error (_("No more nodes within this document."),
-                           NULL, NULL);
+               info_error (_("No more nodes within this document."));
                return 1;
                
              case SLN_Scroll:
@@ -1290,8 +1289,7 @@
                   window->point = info_win->points[old_current];
                   recalculate_line_starts (window);
                   window->flags |= W_UpdateWindow;
-                  info_error (_("No more nodes within this document."),
-                      NULL, NULL);
+                  info_error (_("No more nodes within this document."));
                   return 1;
                 }
             }
@@ -1309,14 +1307,14 @@
   switch (behaviour)
     {
     case IS_PageOnly:
-      info_error (msg_at_node_top, NULL, NULL);
+      info_error (msg_at_node_top);
       return 1;
 
     case IS_NextOnly:
       info_prev_label_of_node (window->node);
       if (!info_parsed_nodename && !info_parsed_filename)
         {
-          info_error (_("No `Prev' for this node."), NULL, NULL);
+          info_error (_("No `Prev' for this node."));
           return 1;
         }
       else
@@ -1336,8 +1334,7 @@
                                         || is_dir_name (info_parsed_filename)))
             {
               info_error (
-                    _("No `Prev' or `Up' for this node within this document."),
-                          NULL, NULL);
+                    _("No `Prev' or `Up' for this node within this 
document."));
               return 1;
             }
           else
@@ -1695,7 +1692,7 @@
   /* If no other window, error now. */
   if (!windows->next && !echo_area_is_active)
     {
-      info_error (msg_one_window, NULL, NULL);
+      info_error (msg_one_window);
       return;
     }
 
@@ -1735,7 +1732,7 @@
 
   if (!windows->next && !echo_area_is_active)
     {
-      info_error (msg_one_window, NULL, NULL);
+      info_error (msg_one_window);
       return;
     }
 
@@ -1791,7 +1788,7 @@
 
   if (!split)
     {
-      info_error (msg_win_too_small, NULL, NULL);
+      info_error (msg_win_too_small);
     }
   else
     {
@@ -1859,11 +1856,11 @@
 {
   if (!windows->next)
     {
-      info_error (msg_cant_kill_last, NULL, NULL);
+      info_error (msg_cant_kill_last);
     }
   else if (window->flags & W_WindowIsPerm)
     {
-      info_error (_("Cannot delete a permanent window"), NULL, NULL);
+      info_error (_("Cannot delete a permanent window"));
     }
   else
     {
@@ -1948,7 +1945,7 @@
   /* If only one window, give up. */
   if (!windows->next)
     {
-      info_error (msg_one_window, NULL, NULL);
+      info_error (msg_one_window);
       return;
     }
 
@@ -1998,8 +1995,7 @@
   use_regex = 1 - use_regex;
   window_message_in_echo_area (use_regex
                                ? _("Using regular expressions for searches.")
-                               : _("Using literal strings for searches."),
-                               NULL, NULL);
+                               : _("Using literal strings for searches."));
 }
 
 /* **************************************************************** */
@@ -2077,9 +2073,9 @@
   if (!node)
     {
       if (file_system_error)
-        info_error (file_system_error, NULL, NULL);
+        info_error (file_system_error);
       else
-        info_error (msg_cant_find_node, nodename, NULL);
+        info_error (msg_cant_find_node, nodename);
     }
 
   maybe_free (file_system_error);
@@ -2153,7 +2149,7 @@
       else
         {
           if (info_recent_file_error)
-            info_error (info_recent_file_error, NULL, NULL);
+            info_error (info_recent_file_error);
           else
             info_error (msg_cant_file_node, filename, nodename);
         }
@@ -2163,7 +2159,7 @@
     }
   else
     {
-      info_error (msg_no_pointer, label, NULL);
+      info_error (msg_no_pointer, label);
     }
 }
 
@@ -2219,7 +2215,7 @@
     }
 
   if (!node)
-    info_error (_("This window has no additional nodes"), NULL, NULL);
+    info_error (_("This window has no additional nodes"));
   else
     info_set_node_of_window (1, window, node);
 }
@@ -2252,7 +2248,7 @@
     }
 
   if (!node)
-    info_error (_("This window has no additional nodes"), NULL, NULL);
+    info_error (_("This window has no additional nodes"));
   else
     info_set_node_of_window (1, window, node);
 }
@@ -2274,7 +2270,7 @@
 
   if (!menu)
     {
-      info_error (msg_no_menu_node, NULL, NULL);
+      info_error (msg_no_menu_node);
       return;
     }
 
@@ -2298,8 +2294,10 @@
         internal_next_line (window, menu[i]->line_number - 1, key);
     }
   else
-    info_error (_("There aren't %d items in this menu."),
-                (void *) (long) item, NULL);
+    info_error (ngettext ("There isn't %d item in this menu.",
+                         "There aren't %d items in this menu.",
+                         item),
+               item);
 
   info_free_references (menu);
   return;
@@ -2387,9 +2385,9 @@
   if (!menu)
     {
       if (builder == info_menu_of_node)
-        info_error (msg_no_menu_node, NULL, NULL);
+        info_error (msg_no_menu_node);
       else
-        info_error (msg_no_xref_node, NULL, NULL);
+        info_error (msg_no_xref_node);
       return;
     }
 
@@ -2585,7 +2583,7 @@
         }
 
       if (!entry && defentry)
-        info_error (_("The reference disappeared! (%s)."), line, NULL);
+        info_error (_("The reference disappeared! (%s)."), line);
       else
         {
           NODE *orig = window->node;
@@ -2667,7 +2665,7 @@
       window->flags |= W_UpdateWindow;
     }
   else
-    info_error (msg_no_menu_node, NULL, NULL);
+    info_error (msg_no_menu_node);
 }
 
 /* Visit as many menu items as is possible, each in a separate window. */
@@ -2680,7 +2678,7 @@
   menu = info_menu_of_node (window->node);
 
   if (!menu)
-    info_error (msg_no_menu_node, NULL, NULL);
+    info_error (msg_no_menu_node);
 
   for (i = 0; (!info_error_was_printed) && (entry = menu[i]); i++)
     {
@@ -2690,7 +2688,7 @@
       window_tile_windows (TILE_INTERNALS);
 
       if (!new)
-        info_error (msg_win_too_small, NULL, NULL);
+        info_error (msg_win_too_small);
       else
         {
           active_window = new;
@@ -2988,7 +2986,7 @@
       /* If we still cannot find the starting point, give up.
          We cannot allow a NULL pointer inside info_follow_menus.  */
       if (!dir_node)
-        info_error (msg_cant_find_node, "Top", NULL);
+        info_error (msg_cant_find_node, "Top");
       else
         node = info_follow_menus (dir_node, nodes, &err_node);
 
@@ -3180,7 +3178,7 @@
      from the Top node.  */
   top_node = info_get_node (file_name, NULL);
   if (!top_node)
-    info_error (msg_cant_find_node, "Top", NULL);
+    info_error (msg_cant_find_node, "Top");
 
   info_intuit_options_node (window, top_node, program_name);
   free (line);
@@ -3299,7 +3297,7 @@
   if (!info_win)
     {
       if (*nodename)
-        info_error (_("Cannot kill node `%s'"), nodename, NULL);
+        info_error (_("Cannot kill node `%s'"), nodename);
       else
         window_clear_echo_area ();
 
@@ -3309,7 +3307,7 @@
   /* If there are no more nodes left anywhere to view, complain and exit. */
   if (info_windows_index == 1 && info_windows[0]->nodes_index == 1)
     {
-      info_error (_("Cannot kill the last node"), NULL, NULL);
+      info_error (_("Cannot kill the last node"));
       return;
     }
 
@@ -3428,9 +3426,9 @@
       if (!node)
         {
           if (info_recent_file_error)
-            info_error (info_recent_file_error, NULL, NULL);
+            info_error (info_recent_file_error);
           else
-            info_error (_("Cannot find `%s'."), line, NULL);
+            info_error (_("Cannot find `%s'."), line);
         }
       else
         info_set_node_of_window (1, window, node);
@@ -3473,8 +3471,7 @@
 
   if (!output_stream)
     {
-      info_error (_("Could not create output file `%s'."),
-          output_filename, NULL);
+      info_error (_("Could not create output file `%s'."), output_filename);
       return;
     }
 
@@ -3487,7 +3484,7 @@
     fclose (output_stream);
 
 #if defined (VERBOSE_NODE_DUMPING)
-  info_error (_("Done."), NULL, NULL);
+  info_error (_("Done."));
 #endif /* VERBOSE_NODE_DUMPING */
 }
 
@@ -3517,7 +3514,7 @@
   if (!node)
     {
       if (info_recent_file_error)
-        info_error (info_recent_file_error, NULL, NULL);
+        info_error (info_recent_file_error);
       else
         {
           if (filename && *nodename != '(')
@@ -3525,7 +3522,7 @@
                 filename_non_directory (filename),
                 nodename);
           else
-            info_error (msg_cant_find_node, nodename, NULL);
+            info_error (msg_cant_find_node, nodename);
         }
       return;
     }
@@ -3542,7 +3539,7 @@
 
 #if defined (VERBOSE_NODE_DUMPING)
   /* Maybe we should print some information about the node being output. */
-  info_error (_("Writing node %s..."), node_printed_rep (node), NULL);
+  info_error (_("Writing node %s..."), node_printed_rep (node));
 #endif /* VERBOSE_NODE_DUMPING */
 
   write_node_to_stream (node, stream);
@@ -3591,8 +3588,7 @@
 
   if (!output_stream)
     {
-      info_error (_("Could not create output file `%s'."), filename,
-          NULL);
+      info_error (_("Could not create output file `%s'."), filename);
       return;
     }
 
@@ -3609,7 +3605,7 @@
     fclose (output_stream);
 
 #if defined (VERBOSE_NODE_DUMPING)
-  info_error (_("Done."), NULL, NULL);
+  info_error (_("Done."));
 #endif /* VERBOSE_NODE_DUMPING */
 }
 
@@ -3653,13 +3649,13 @@
 
   if (!printer_pipe)
     {
-      info_error (_("Cannot open pipe to `%s'."), print_command, NULL);
+      info_error (_("Cannot open pipe to `%s'."), print_command);
       return;
     }
 
 #if defined (VERBOSE_NODE_DUMPING)
   /* Maybe we should print some information about the node being output. */
-  info_error (_("Printing node %s..."), node_printed_rep (node), NULL);
+  info_error (_("Printing node %s..."), node_printed_rep (node));
 #endif /* VERBOSE_NODE_DUMPING */
 
   write_node_to_stream (node, printer_pipe);
@@ -3669,7 +3665,7 @@
     fclose (printer_pipe);
 
 #if defined (VERBOSE_NODE_DUMPING)
-  info_error (_("Done."), NULL, NULL);
+  info_error (_("Done."));
 #endif /* VERBOSE_NODE_DUMPING */
 }
 
@@ -3974,7 +3970,7 @@
             {
               window_message_in_echo_area
                 (_("Searching subfile %s ..."),
-                 filename_non_directory (tag->filename), NULL);
+                 filename_non_directory (tag->filename));
 
               last_subfile = tag->filename;
             }
@@ -3987,7 +3983,7 @@
               if (!echo_area_is_active)
                 {
                   if (info_recent_file_error)
-                    info_error (info_recent_file_error, NULL, NULL);
+                    info_error (info_recent_file_error);
                   else
                     info_error (msg_cant_file_node,
                                 filename_non_directory (file_buffer->filename),
@@ -4011,7 +4007,7 @@
               if (!echo_area_is_active)
                {
                  if (msg)
-                   window_message_in_echo_area ("%s", (char *) _(msg), NULL);
+                   window_message_in_echo_area ("%s", _(msg));
                  else
                    window_clear_echo_area ();
                }
@@ -4131,7 +4127,7 @@
                                   NULL);
 
   if (result != 0 && !info_error_was_printed)
-    info_error (_("Search failed."), NULL, NULL);
+    info_error (_("Search failed."));
   else if (old_pagetop != active_window->pagetop)
     {
       int new_pagetop;
@@ -4152,7 +4148,7 @@
                       _("Repeat last search in the same direction"))
 {
   if (!last_search_direction)
-    info_error (_("No previous search string"), NULL, NULL);
+    info_error (_("No previous search string"));
   else
     info_search_1 (window, last_search_direction * count,
                    key, last_search_case_sensitive, 0);
@@ -4162,7 +4158,7 @@
                       _("Repeat last search in the reverse direction"))
 {
   if (!last_search_direction)
-    info_error (_("No previous search string"), NULL, NULL);
+    info_error (_("No previous search string"));
   else
     info_search_1 (window, -last_search_direction * count,
                    key, last_search_case_sensitive, 0);
@@ -4298,7 +4294,7 @@
   sprintf (prompt, "%s%s%s", failing_p ? _("Failing ") : "", prefix,
            p_rep ? p_rep : "");
 
-  window_message_in_echo_area ("%s", prompt, NULL);
+  window_message_in_echo_area ("%s", prompt);
   maybe_free (p_rep);
   free (prompt);
   display_cursor_at_point (active_window);
@@ -4709,7 +4705,7 @@
   if (firstmenu == -1 && firstxref == -1)
     {
       if (!cursor_movement_scrolls_p)
-        info_error (msg_no_xref_node, NULL, NULL);
+        info_error (msg_no_xref_node);
       use_regex = save_use_regex;
       return cursor_movement_scrolls_p;
     }
@@ -4856,7 +4852,7 @@
      do it. */
   if (!info_error_rings_bell_p)
     terminal_ring_bell ();
-  info_error (_("Quit"), NULL, NULL);
+  info_error (_("Quit"));
 
   info_initialize_numeric_arg ();
   info_clear_pending_input ();
@@ -4958,7 +4954,7 @@
   rep = pretty_keyseq (keyseq);
 
   if (!echo_area_is_active)
-    info_error (_("Unknown command (%s)."), rep, NULL);
+    info_error (_("Unknown command (%s)."), rep);
   else
     {
       char *temp = xmalloc (1 + strlen (rep) + strlen (_("\"%s\" is 
invalid")));



reply via email to

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