texinfo-commits
[Top][All Lists]
Advanced

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

[5793] info_move_to_xref behaviour changed to what it was before


From: Gavin D. Smith
Subject: [5793] info_move_to_xref behaviour changed to what it was before
Date: Mon, 01 Sep 2014 15:03:42 +0000

Revision: 5793
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5793
Author:   gavin
Date:     2014-09-01 15:03:41 +0000 (Mon, 01 Sep 2014)
Log Message:
-----------
info_move_to_xref behaviour changed to what it was before

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/session.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-08-31 18:52:06 UTC (rev 5792)
+++ trunk/ChangeLog     2014-09-01 15:03:41 UTC (rev 5793)
@@ -1,3 +1,11 @@
+2014-09-01  Gavin Smith  <address@hidden>
+
+       * info/session.c (info_move_to_prev_xref, info_move_to_next_xref):
+       Skip nodes if no references in previous or next node, as was done
+       before.  Cycle round the node's references when
+       cursor-movement-scrolls=Off.
+       (info_move_to_xref): Handling of cursor-movement-scrolls removed.
+
 2014-08-30  Gavin Smith  <address@hidden>
 
        * info/session.c (incremental_search): Update an automatic footnotes

Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c        2014-08-31 18:52:06 UTC (rev 5792)
+++ trunk/info/session.c        2014-09-01 15:03:41 UTC (rev 5793)
@@ -2052,7 +2052,8 @@
   return 0;
 }
 
-/* Move Prev, Up or error in WINDOW depending on BEHAVIOUR. */
+/* Move to earlier node in node hierarchy in WINDOW depending on BEHAVIOUR.
+   Display an error message if node wasn't changed. */
 static int
 backward_move_node_structure (WINDOW *window, int behaviour)
 {
@@ -2648,11 +2649,7 @@
     {
       /* There was neither a menu or xref entry appearing in this node
          after point. */
-      if (cursor_movement_scrolls_p)
-        return 0;
-      else
-        /* Choose the first menu or xref entry appearing in this node. */
-        placement = node->references[0]->start;
+      return 0;
     }
 
   window->point = placement;
@@ -2667,19 +2664,38 @@
     info_move_to_next_xref (window, -count, key);
   else
     {
-      if (!info_move_to_xref (window, -1))
+      while (1)
         {
+          if (info_move_to_xref (window, -1))
+            return;
+
+          /* When cursor-movement-scrolls=Off, cycle round the node's
+             references. */
           if (!cursor_movement_scrolls_p)
-            info_error ("%s", msg_no_xref_node);
-          else
             {
-              if (backward_move_node_structure (window, info_scroll_behaviour)
-                  == 0)
+              REFERENCE **r = window->node->references;
+              if (r && r[0])
                 {
-                  window->point = window->node->nodelen - 1;
-                  info_move_to_xref (window, -1);
+                  int i = 0;
+                  /* Choose the last menu or xref entry appearing in this
+                     node. */
+                  while (r[i + 1])
+                    i++;
+                  window->point = r[i]->start;
+                  window_adjust_pagetop (window);
                 }
+              else
+                info_error ("%s", msg_no_xref_node);
+
+              return;
             }
+
+          if (backward_move_node_structure (window, info_scroll_behaviour)
+                  != 0)
+            {
+              return; /* No earlier nodes in file. */
+            }
+          window->point = window->node->nodelen - 1;
         }
     }
 }
@@ -2691,15 +2707,34 @@
     info_move_to_prev_xref (window, -count, key);
   else
     {
-      if (!info_move_to_xref (window, 1))
+      while (1)
         {
+          if (info_move_to_xref (window, 1))
+            return;
+
+          /* When cursor-movement-scrolls=Off, cycle round the node's
+             references. */
           if (!cursor_movement_scrolls_p)
-            info_error ("%s", msg_no_xref_node);
-          else
             {
-              forward_move_node_structure (window, info_scroll_behaviour);
-              info_move_to_xref (window, 1);
+              REFERENCE **r = window->node->references;
+              if (r && r[0])
+                {
+                  /* Choose the first menu or xref entry appearing in this
+                     node. */
+                  window->point = r[0]->start;
+                  window_adjust_pagetop (window);
+                }
+              else
+                info_error ("%s", msg_no_xref_node);
+
+              return;
             }
+
+          if (forward_move_node_structure (window, info_scroll_behaviour)
+                   != 0)
+            {
+              return; /* No later nodes in file. */
+            }
         }
     }
 }




reply via email to

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