summaryrefslogtreecommitdiffstats
path: root/contrib/texinfo/makeinfo/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/texinfo/makeinfo/node.c')
-rw-r--r--contrib/texinfo/makeinfo/node.c45
1 files changed, 33 insertions, 12 deletions
diff --git a/contrib/texinfo/makeinfo/node.c b/contrib/texinfo/makeinfo/node.c
index 10f4c3a..2215d4c 100644
--- a/contrib/texinfo/makeinfo/node.c
+++ b/contrib/texinfo/makeinfo/node.c
@@ -1,8 +1,8 @@
/* node.c -- nodes for Texinfo.
- $Id: node.c,v 1.6 2003/01/18 17:16:17 karl Exp $
+ $Id: node.c,v 1.12 2003/05/01 00:30:07 karl Exp $
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
+ Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -595,7 +595,7 @@ cm_node ()
filling_enabled = indented_fill = 0;
if (!html || (html && splitting))
current_footnote_number = 1;
-
+
if (verbose_mode)
printf (_("Formatting node %s...\n"), node);
@@ -609,7 +609,7 @@ cm_node ()
xml_begin_node ();
if (!docbook)
{
- xml_insert_element (NODENAME, START);
+ xml_insert_element (NODENAME, START);
if (macro_expansion_output_stream && !executing_string)
me_execute_string (node);
else
@@ -924,7 +924,7 @@ cm_node ()
add_word ("<div class=\"node\">\n");
/* The <p> avoids the links area running on with old Lynxen. */
add_word_args ("<p>%s\n", splitting ? "" : "<hr>");
- add_word_args ("%s<a name=\"", _("Node:"));
+ add_word_args ("%s%s<a name=\"", _("Node:"), "&nbsp;");
tem = expand_node_name (node);
add_anchor_name (tem, 0);
add_word_args ("\">%s</a>", tem);
@@ -935,6 +935,7 @@ cm_node ()
tem = expansion (next, 0);
add_word (",\n");
add_word (_("Next:"));
+ add_word ("&nbsp;");
add_word ("<a rel=\"next\" accesskey=\"n\" href=\"");
add_anchor_name (tem, 1);
add_word_args ("\">%s</a>", tem);
@@ -945,6 +946,7 @@ cm_node ()
tem = expansion (prev, 0);
add_word (",\n");
add_word (_("Previous:"));
+ add_word ("&nbsp;");
add_word ("<a rel=\"previous\" accesskey=\"p\" href=\"");
add_anchor_name (tem, 1);
add_word_args ("\">%s</a>", tem);
@@ -955,6 +957,7 @@ cm_node ()
tem = expansion (up, 0);
add_word (",\n");
add_word (_("Up:"));
+ add_word ("&nbsp;");
add_word ("<a rel=\"up\" accesskey=\"u\" href=\"");
add_anchor_name (tem, 1);
add_word_args ("\">%s</a>", tem);
@@ -979,7 +982,7 @@ cm_node ()
if (prev)
{
xml_insert_element (NODEPREV, START);
- execute_string ("%s", prev);
+ execute_string ("%s", prev);
xml_insert_element (NODEPREV, END);
}
if (up)
@@ -1042,6 +1045,9 @@ cm_anchor (arg)
/* Parse the anchor text. */
anchor = get_xref_token (1);
+ /* Force all versions of "top" to be "Top". */
+ normalize_node_name (anchor);
+
/* In HTML mode, need to actually produce some output. */
if (html)
{
@@ -1292,7 +1298,7 @@ validate (tag, line, label)
/* The strings here are followed in the message by `reference to...' in
the `validate' routine. They are only used in messages, thus are
translated. */
-static char *
+static const char *
reftype_type_string (type)
enum reftype type;
{
@@ -1598,7 +1604,7 @@ last_node_p (tags)
break;
}
}
-
+
return last;
}
@@ -1628,8 +1634,8 @@ split_file (filename, size)
if (size == 0)
size = DEFAULT_SPLIT_SIZE;
- if ((stat (filename, &fileinfo) != 0) ||
- (((long) fileinfo.st_size) < SPLIT_SIZE_THRESHOLD))
+ if ((stat (filename, &fileinfo) != 0)
+ || (((long) fileinfo.st_size) < size))
return;
file_size = (long) fileinfo.st_size;
@@ -1656,6 +1662,10 @@ split_file (filename, size)
TAG_ENTRY *tags = tag_table;
char *indirect_info = NULL;
+ /* Maybe we want a Local Variables section. */
+ char *trailer = info_trailer ();
+ int trailer_len = trailer ? strlen (trailer) : 0;
+
/* Remember the `header' of this file. The first tag in the file is
the bottom of the header; the top of the file is the start. */
the_header = xmalloc (1 + (header_size = tags->position));
@@ -1777,7 +1787,9 @@ split_file (filename, size)
|| write (fd, the_header, header_size) != header_size
|| write (fd, the_file + file_top, file_bot - file_top)
!= (file_bot - file_top)
- || (close (fd)) < 0)
+ || (trailer_len
+ && write (fd, trailer, trailer_len) != trailer_len)
+ || close (fd) < 0)
{
perror (split_filename);
if (fd != -1)
@@ -1822,7 +1834,16 @@ split_file (filename, size)
/* Inhibit newlines. */
paragraph_is_open = 0;
+ /* Write the indirect tag table. */
write_tag_table_indirect ();
+
+ /* preserve local variables in info output. */
+ if (trailer)
+ {
+ insert_string (trailer);
+ free (trailer);
+ }
+
fclose (output_stream);
free (the_header);
free (the_file);
OpenPOWER on IntegriCloud