[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/info info-utils.c,1.1.1.1,1.2 session.c,1.2,1.3 info-utils.h,1.1
From: |
dirt |
Subject: |
texinfo/info info-utils.c,1.1.1.1,1.2 session.c,1.2,1.3 info-utils.h,1.1.1.1,1.2 |
Date: |
Tue, 3 Feb 2004 13:04:51 +0100 |
Update of /cvsroot/texinfo/texinfo/info
In directory sheep:/tmp/cvs-serv29228/info
Modified Files:
info-utils.c session.c info-utils.h
Log Message:
2004-02-03 Alper Ersoy <address@hidden>
* info/info-utils.h: new line_number member in REFERENCE struct.
* info/info-utils.c (info_parse_node): parse (line ...) strings
from menu items.
(info_references_internal): save parsed line number in the entry.
* info/session.c (info_menu_of_ref_item): if selected entry has a line
number associated with it, jump to that line after updating window.
Index: info-utils.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/info/info-utils.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** info-utils.c 6 Dec 2003 01:32:44 -0000 1.1.1.1
--- info-utils.c 3 Feb 2004 12:04:49 -0000 1.2
***************
*** 38,41 ****
--- 38,45 ----
char *info_parsed_nodename = (char *)NULL;
+ /* Variable which holds the most recent line number parsed as a result of
+ calling info_parse_xxx (). */
+ int info_parsed_line_number = 0;
+
/* Functions to remember a filename or nodename for later return. */
static void save_filename (), saven_filename ();
***************
*** 97,100 ****
--- 101,135 ----
info_parsed_nodename = (char *)NULL;
}
+
+ /* Parse ``(line ...)'' here. This only reads digits inside
+ the parenthesis, so translated documents should work ok
+ (provided that translated ``line'' does not contain digits,
+ of course.) */
+ {
+ char *rest = (char *) (string + i + 1);
+
+ /* Skip any whitespace first, and then a newline in case the item
+ was so long to contain the ``(line ...)'' string in the same
+ physical line. */
+ while (whitespace(*rest))
+ rest++;
+ if (*rest == '\n')
+ {
+ rest++;
+ while (whitespace(*rest))
+ rest++;
+ }
+
+ /* Are we looking at an opening parenthesis? That can only mean
+ we have a winner. :) */
+ if (*rest == '(')
+ {
+ while (strchr ("0123456789", *rest) == NULL)
+ rest++;
+ info_parsed_line_number = strtol (rest, NULL, 0);
+ }
+ else
+ info_parsed_line_number = 0;
+ }
}
***************
*** 291,294 ****
--- 326,331 ----
if (info_parsed_nodename)
entry->nodename = xstrdup (info_parsed_nodename);
+
+ entry->line_number = info_parsed_line_number;
}
Index: session.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/info/session.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** session.c 8 Dec 2003 19:18:55 -0000 1.2
--- session.c 3 Feb 2004 12:04:49 -0000 1.3
***************
*** 2179,2182 ****
--- 2179,2183 ----
defentry->filename = refs[which]->filename;
defentry->nodename = refs[which]->nodename;
+ defentry->line_number = refs[which]->line_number;
if (defentry->filename)
***************
*** 2296,2299 ****
--- 2297,2301 ----
NODE *orig = window->node;
info_select_reference (window, entry);
+
if (builder == info_xrefs_of_node && window->node != orig
&& !(window->node->flags & N_FromAnchor))
***************
*** 2316,2319 ****
--- 2318,2324 ----
}
}
+
+ if (entry->line_number > 0)
+ info_next_line (window, entry->line_number, key);
}
Index: info-utils.h
===================================================================
RCS file: /cvsroot/texinfo/texinfo/info/info-utils.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** info-utils.h 6 Dec 2003 01:32:44 -0000 1.1.1.1
--- info-utils.h 3 Feb 2004 12:04:49 -0000 1.2
***************
*** 35,38 ****
--- 35,39 ----
char *nodename; /* Name of the node. */
int start, end; /* Offsets within the containing node of LABEL. */
+ int line_number; /* Specific line number a menu item points to. */
} REFERENCE;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/info info-utils.c,1.1.1.1,1.2 session.c,1.2,1.3 info-utils.h,1.1.1.1,1.2,
dirt <=