bug-texinfo
[Top][All Lists]
Advanced

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

patch: warn on illegal colon in index entry


From: Kenneth Lorber
Subject: patch: warn on illegal colon in index entry
Date: Tue, 15 Jan 2002 13:14:16 -0500 (EST)

Shield the user from a silent error that makeinfo can easily catch:
doc/texinfo.txi:
@strong{Caution:} Do not use a colon in an index entry.  In Info, a
colon separates the menu entry name from the node name, so a colon in
the entry itself confuses Info.

Proposed ChangeLog entry:
        * makeinfo/index.c (index_add_arg) error if index entry contains a
        colon

Patch cut against texinfo-4.0.

Demo texi file follows the patch.  Without the patch, file is accepted.
With the patch, produces the following message:
  doc/bug.texi:5: Colon in index entry `This colon: is a problem.'.

If this is going to break something I've missed, please let me know.

Thanks,
keni

*** index.c     2001/12/18 18:43:31     1.1
--- index.c     2002/01/15 16:54:52
***************
*** 226,231 ****
--- 226,236 ----
           (see the findexerr test).  */
        new->defining_file = xstrdup (input_filename);
        the_indices[which] = new;
+       /* The index breaks if there are colons in the entry. */
+       if( strchr (new->entry_text, ':') )
+       {
+         line_error (_("Colon in index entry `%s'"), new->entry_text);
+       }
      }
  }
  

\input texinfo
@node Top
@top
@cindex This colon: is a problem.
Go to Concept Index, try to select the index entry.

@menu
* Concept Index::
@end menu

@node Concept Index
@unnumbered Concept Index
@printindex cp

@bye





reply via email to

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