texinfo-commits
[Top][All Lists]
Advanced

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

[5506] info_set_node_of_window


From: Gavin D. Smith
Subject: [5506] info_set_node_of_window
Date: Fri, 02 May 2014 08:47:31 +0000

Revision: 5506
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5506
Author:   gavin
Date:     2014-05-02 08:47:31 +0000 (Fri, 02 May 2014)
Log Message:
-----------
info_set_node_of_window

Modified Paths:
--------------
    trunk/info/indices.c
    trunk/info/indices.h
    trunk/info/info.c
    trunk/info/session.c
    trunk/info/session.h

Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c        2014-05-01 22:20:49 UTC (rev 5505)
+++ trunk/info/indices.c        2014-05-02 08:47:31 UTC (rev 5506)
@@ -171,29 +171,30 @@
 DECLARE_INFO_COMMAND (info_index_search,
    _("Look up a string in the index for this file"))
 {
-  do_info_index_search (window, count, 0);
+  do_info_index_search (window, file_buffer_of_window (window), count, 0);
 }
 
 /* Look up SEARCH_STRING in the index for this file.  If SEARCH_STRING
    is NULL, prompt user for input.  */ 
 void
-do_info_index_search (WINDOW *window, int count, char *search_string)
+do_info_index_search (WINDOW *window, FILE_BUFFER *fb,
+                      int count, char *search_string)
 {
-  FILE_BUFFER *fb;
   char *line;
 
   /* Reset the index offset, since this is not the info-index-next command. */
   index_offset = 0;
 
+  if (!fb)
+    return;
+
   /* The user is selecting a new search string, so flush the old one. */
   free (index_search);
   index_search = NULL;
 
-  /* If this window's file is not the same as the one that we last built an
+  /* If the file is not the same as the one that we last built an
      index for, build and remember an index now. */
-  fb = file_buffer_of_window (window);
   if (!initial_index_filename ||
-      !fb ||
       (FILENAME_CMP (initial_index_filename, fb->filename) != 0))
     {
       info_free_references (index_index);
@@ -494,7 +495,7 @@
       return;
     }
 
-  info_set_node_of_window (1, window, node);
+  info_set_node_of_window (window, node);
 
   {
     long loc;
@@ -947,7 +948,7 @@
   tfb = create_virtindex_file_buffer (fb->filename, text.base, text.off);
   node = create_virtindex_node (tfb);
   
-  info_set_node_of_window (1, window, node);
+  info_set_node_of_window (window, node);
   
   if (!info_error_was_printed)
     window_clear_echo_area ();
@@ -1002,7 +1003,7 @@
       return;
     }
 
-  info_set_node_of_window (1, window, allfiles_node);
+  info_set_node_of_window (window, allfiles_node);
 
   if (!info_error_was_printed)
     window_clear_echo_area ();

Modified: trunk/info/indices.h
===================================================================
--- trunk/info/indices.h        2014-05-01 22:20:49 UTC (rev 5505)
+++ trunk/info/indices.h        2014-05-02 08:47:31 UTC (rev 5506)
@@ -35,7 +35,7 @@
 extern void info_index_search (WINDOW *window, int count, unsigned char key);
 extern void info_next_index_match (WINDOW *window, int count, unsigned char 
key);
 extern void info_index_apropos (WINDOW *window, int count, unsigned char key);
-extern void do_info_index_search (WINDOW *window, int count, char 
*search_string);
+extern void do_info_index_search (WINDOW *window, FILE_BUFFER *fb, int count, 
char *search_string);
 extern int index_entry_exists (FILE_BUFFER *fb, char *string);
 
 NODE *allfiles_create_node (char *term, REFERENCE **fref);

Modified: trunk/info/info.c
===================================================================
--- trunk/info/info.c   2014-05-01 22:20:49 UTC (rev 5505)
+++ trunk/info/info.c   2014-05-02 08:47:31 UTC (rev 5506)
@@ -508,7 +508,7 @@
 #endif
   
   initialize_info_session ();
-  info_set_node_of_window (0, active_window, allfiles_create_node (argc ? 
argv[0] : fname, fref));;
+  info_set_node_of_window (active_window, allfiles_create_node (argc ? argv[0] 
: fname, fref));;
   display_startup_message ();
   info_session ();
   return EXIT_SUCCESS;
@@ -794,9 +794,7 @@
       if (initial_fb && index_entry_exists (initial_fb, index_search_string))
         {
           initialize_info_session ();
-          initial_node = info_get_node (initial_file, "Top", PARSE_NODE_DFLT);
-          info_set_node_of_window (0, active_window, initial_node);
-          do_info_index_search (windows, 0, index_search_string);
+          do_info_index_search (windows, initial_fb, 0, index_search_string);
         }
       else
         {

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-05-01 22:20:49 UTC (rev 5505)
+++ trunk/info/session.c        2014-05-02 08:47:31 UTC (rev 5506)
@@ -113,7 +113,7 @@
       NODE *node;   
 
       node = dir_node ();
-      info_set_node_of_window (0, active_window, node);
+      info_set_node_of_window (active_window, node);
       return;
     }
   
@@ -123,7 +123,7 @@
 
       node = get_manpage_node (nodenames[0]);
       if (node)
-        info_set_node_of_window (0, active_window, node);
+        info_set_node_of_window (active_window, node);
       return;
     }
 
@@ -140,7 +140,7 @@
       if (!window)
         {
           window = active_window;
-          info_set_node_of_window (0, window, node);
+          info_set_node_of_window (window, node);
         }
       else
         {
@@ -170,7 +170,6 @@
           if (window)
             {
               window_tile_windows (TILE_INTERNALS);
-              remember_window_and_node (window, node);
             }
           else
             {
@@ -508,10 +507,9 @@
    the footnotes for this window.  If REMEMBER is nonzero, first call
    set_remembered_pagetop_and_point.  */
 void
-info_set_node_of_window (int remember, WINDOW *window, NODE *node)
+info_set_node_of_window (WINDOW *window, NODE *node)
 {
-  if (remember)
-    set_remembered_pagetop_and_point (window);
+  set_remembered_pagetop_and_point (window);
 
   /* Put this node into the window. */
   window_set_node_of_window (window, node);
@@ -1803,7 +1801,7 @@
   free (file_system_error);
 
   if (node)
-    info_set_node_of_window (1, window, node);
+    info_set_node_of_window (window, node);
 }
 
 /* Parse the node specification in LINE using WINDOW to default the filename.
@@ -1893,7 +1891,7 @@
       info_win->pagetops[info_win->current] = window->pagetop;
       info_win->points[info_win->current] = window->point;
     }
-  info_set_node_of_window (1, window, node);
+  info_set_node_of_window (window, node);
 }
 
 /* Make WINDOW display the "Next:" node of the node currently being
@@ -1948,7 +1946,7 @@
   if (!node)
     info_error ("%s", _("This window has no additional nodes"));
   else
-    info_set_node_of_window (1, window, node);
+    info_set_node_of_window (window, node);
 }
 
 /* Make WINDOW display the first node of this info file. */
@@ -1982,7 +1980,7 @@
   if (!node)
     info_error ("%s", _("This window has no additional nodes"));
   else
-    info_set_node_of_window (1, window, node);
+    info_set_node_of_window (window, node);
 }
 
 /* Move to 1st menu item, Next, Up/Next, or error in this window. */
@@ -2971,7 +2969,7 @@
         {
           NODE *n;
           n = info_get_node_with_defaults (0, node, PARSE_NODE_DFLT, window);
-          info_set_node_of_window (1, window, n);
+          info_set_node_of_window (window, n);
         }
     }
 
@@ -3165,7 +3163,7 @@
 
       node = info_get_node_with_defaults (0, invocation_node,
                                                   PARSE_NODE_DFLT, window);
-      info_set_node_of_window (1, window, node);
+      info_set_node_of_window (window, node);
     }
 
   if (!info_error_was_printed)
@@ -3192,7 +3190,7 @@
     {
       NODE *manpage = info_get_node (MANPAGE_FILE_BUFFER_NAME, line, 0);
       if (manpage)
-        info_set_node_of_window (1, window, manpage);
+        info_set_node_of_window (window, manpage);
     }
 
   free (line);
@@ -3400,7 +3398,7 @@
             info_error (_("Cannot find `%s'."), line);
         }
       else
-        info_set_node_of_window (1, window, node);
+        info_set_node_of_window (window, node);
 
       free (line);
     }

Modified: trunk/info/session.h
===================================================================
--- trunk/info/session.h        2014-05-01 22:20:49 UTC (rev 5505)
+++ trunk/info/session.h        2014-05-02 08:47:31 UTC (rev 5506)
@@ -81,8 +81,7 @@
 extern void remember_window_and_node (WINDOW *window, NODE *node);
 extern void set_remembered_pagetop_and_point (WINDOW *window);
 extern void set_window_pagetop (WINDOW *window, int desired_top);
-extern void info_set_node_of_window (int remember, WINDOW *window,
-    NODE *node);
+extern void info_set_node_of_window (WINDOW *window, NODE *node);
 extern void initialize_keyseq (void);
 extern void add_char_to_keyseq (char character);
 extern void info_gather_typeahead (void);




reply via email to

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