[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[5641] better traversal of index nodes
From: |
Gavin D. Smith |
Subject: |
[5641] better traversal of index nodes |
Date: |
Thu, 05 Jun 2014 00:39:15 +0000 |
Revision: 5641
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5641
Author: gavin
Date: 2014-06-05 00:39:13 +0000 (Thu, 05 Jun 2014)
Log Message:
-----------
better traversal of index nodes
Modified Paths:
--------------
trunk/ChangeLog
trunk/info/info-utils.c
trunk/info/nodes.h
trunk/info/session.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2014-06-05 00:08:15 UTC (rev 5640)
+++ trunk/ChangeLog 2014-06-05 00:39:13 UTC (rev 5641)
@@ -1,8 +1,16 @@
2014-06-05 Gavin Smith <address@hidden>
+ * info/nodes.h (N_IsIndex): New macro.
+ * info/info-utils.c (scan_node_contents): Record if an index tag
+ was seen.
+ * info/session.c (forward_move_node_structure)
+ (backward_move_node_structure): Don't go down menus in index nodes.
+
+2014-06-05 Gavin Smith <address@hidden>
+
* info/nodes.c: Check if return value of file_buffer_of_window
is null.
- (INFO_NO_TAGS, INFO_GET_TAGS): Removed. Uses updated
+ (INFO_NO_TAGS, INFO_GET_TAGS): Removed. Uses updated.
2014-06-05 Gavin Smith <address@hidden>
Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c 2014-06-05 00:08:15 UTC (rev 5640)
+++ trunk/info/info-utils.c 2014-06-05 00:39:13 UTC (rev 5641)
@@ -1622,6 +1622,9 @@
text_buffer_off (expansion));
/* Skip past body of tag. */
skip_input (p1 - inptr);
+
+ if (in_index)
+ node->flags |= N_IsIndex;
}
else
{
Modified: trunk/info/nodes.h
===================================================================
--- trunk/info/nodes.h 2014-06-05 00:08:15 UTC (rev 5640)
+++ trunk/info/nodes.h 2014-06-05 00:39:13 UTC (rev 5641)
@@ -77,6 +77,7 @@
#define N_IsManPage 0x40 /* This node is a manpage. */
#define N_FromAnchor 0x80 /* Synthesized for an anchor reference. */
#define N_WasRewritten 0x100 /* NODE->contents can be passed to free(). */
+#define N_IsIndex 0x200 /* An index node. */
/* String constants. */
#define INFO_FILE_LABEL "File:"
Modified: trunk/info/session.c
===================================================================
--- trunk/info/session.c 2014-06-05 00:08:15 UTC (rev 5640)
+++ trunk/info/session.c 2014-06-05 00:39:13 UTC (rev 5641)
@@ -1618,16 +1618,18 @@
}
}
- /* If this node contains a menu, select its first entry. */
- {
- REFERENCE *entry;
+ /* If this node contains a menu, select its first entry. Indices
+ are an exception, as their menus lead nowhere meaningful. */
+ if (!(window->node->flags & N_IsIndex))
+ {
+ REFERENCE *entry;
- if (entry = select_menu_digit (window, '1'))
- {
- info_select_reference (window, entry);
- return 0;
- }
- }
+ if (entry = select_menu_digit (window, '1'))
+ {
+ info_select_reference (window, entry);
+ return 0;
+ }
+ }
/* Okay, this node does not contain a menu. If it contains a
"Next:" pointer, use that. */
@@ -1726,8 +1728,6 @@
case IS_Continuous:
if (window->node->up)
{
- int traverse_menus = 0;
-
/* If up is the dir node, we are at the top node.
Don't do anything. */
if ( !strcmp ("(dir)", window->node->up)
@@ -1748,33 +1748,24 @@
in the menus as far as possible. */
else if (window->node->prev)
{
- traverse_menus = 1;
info_handle_pointer ("Prev", window);
- }
- else /* 'Up' but no 'Prev' */
- {
- info_handle_pointer ("Up", window);
- }
-
- /* Repeatedly select last item of menus */
- if (traverse_menus)
- {
- REFERENCE *entry;
- while (!info_error_was_printed)
+ if (!(window->node->flags & N_IsIndex))
{
- if (entry = select_menu_digit (window, '0'))
+ while (!info_error_was_printed)
{
- info_select_reference (window, entry);
+ REFERENCE *entry = select_menu_digit (window, '0');
+ if (entry)
+ info_select_reference (window, entry);
+ else
+ break;
}
- else
- break;
}
}
+ else /* 'Up' but no 'Prev' */
+ info_handle_pointer ("Up", window);
}
else if (window->node->prev) /* 'Prev' but no 'Up' */
- {
- info_handle_pointer ("Prev", window);
- }
+ info_handle_pointer ("Prev", window);
else
{
info_error ("%s",
@@ -1782,7 +1773,6 @@
return 1;
}
-
break;
}
return 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [5641] better traversal of index nodes,
Gavin D. Smith <=