# HG changeset patch # User Mike Miller # Date 1376451750 14400 # Node ID 3f4091dddc13088cb535be42a2f8c9b7dbef117c # Parent 03a666018e0f2bed9d53da61166aa82c56dcfd21 doc: Update doc cache delimiter to work with Texinfo 5.0 (bug #39778) * doc/interpreter/mk_doc_cache.m: Change doc delimiter to ASCII 30 (record separator) because Texinfo 5.0 uses ASCII 31 (unit separator). Use hexadecimal representation for consistency with other scripts. * libinterp/corefcn/help.cc (install_built_in_docstrings): Change doc delimiter to ASCII 30 (record separator). * doc/interpreter/munge-texi.pl, libinterp/gendoc.pl, scripts/mkdoc.pl: Change doc delimiter to ASCII 30 (record separator). Use hexadecimal escape sequence for consistency and to avoid using literal control characters. diff -r 03a666018e0f -r 3f4091dddc13 doc/interpreter/mk_doc_cache.m --- a/doc/interpreter/mk_doc_cache.m Tue Aug 13 21:38:12 2013 -0400 +++ b/doc/interpreter/mk_doc_cache.m Tue Aug 13 23:42:30 2013 -0400 @@ -24,7 +24,7 @@ docstrings_files = args(2:end); ## Special character used as break between DOCSTRINGS -doc_delim = char (31); +doc_delim = char (0x1e); ## Read the contents of all the DOCSTRINGS files into TEXT. ## It is more efficient to fork to shell for makeinfo only once on large data @@ -52,7 +52,7 @@ ## Strip Texinfo markers and docstring separators. text = regexprep (text, "-\\*- texinfo -\\*-[ \t]*[\r\n]*", ""); -text = strrep (text, '@', "@@"); +text = strrep (text, [doc_delim "@"], [doc_delim "@@"]); ## Write data to temporary file for input to makeinfo [fid, name, msg] = mkstemp ("octave_doc_XXXXXX", true); diff -r 03a666018e0f -r 3f4091dddc13 doc/interpreter/munge-texi.pl --- a/doc/interpreter/munge-texi.pl Tue Aug 13 21:38:12 2013 -0400 +++ b/doc/interpreter/munge-texi.pl Tue Aug 13 23:42:30 2013 -0400 @@ -6,7 +6,7 @@ $top_srcdir = shift (@ARGV); # Constant patterns -$doc_delim = qr/^\c_/; +$doc_delim = qr/^\x{1e}/; $tex_delim = qr/\Q-*- texinfo -*-\E/; $comment_line = qr/^\s*(?:$|#)/; # Pre-declare hash size for efficiency diff -r 03a666018e0f -r 3f4091dddc13 libinterp/corefcn/help.cc --- a/libinterp/corefcn/help.cc Tue Aug 13 21:38:12 2013 -0400 +++ b/libinterp/corefcn/help.cc Tue Aug 13 23:42:30 2013 -0400 @@ -967,7 +967,7 @@ if (file) { // Ignore header; - file.ignore (1000, 0x1f); + file.ignore (1000, 0x1e); if (file.gcount () == 1000) { @@ -988,7 +988,7 @@ while (! file.eof ()) { - file.getline (buf, bufsize, 0x1f); + file.getline (buf, bufsize, 0x1e); std::string tmp (buf); diff -r 03a666018e0f -r 3f4091dddc13 libinterp/gendoc.pl --- a/libinterp/gendoc.pl Tue Aug 13 21:38:12 2013 -0400 +++ b/libinterp/gendoc.pl Tue Aug 13 23:42:30 2013 -0400 @@ -64,7 +64,7 @@ foreach $i (0 .. $#func_list) { $func = $func_list[$i]; - print "$func\n"; + print "\x{1e}$func\n"; print "\@c $func $src_fname\n"; print $docstr[$i],"\n"; } diff -r 03a666018e0f -r 3f4091dddc13 scripts/mkdoc.pl --- a/scripts/mkdoc.pl Tue Aug 13 21:38:12 2013 -0400 +++ b/scripts/mkdoc.pl Tue Aug 13 23:42:30 2013 -0400 @@ -52,7 +52,7 @@ @help_txt = gethelp ($fcn, $full_fname); next MFILE if ($help_txt[0] eq ""); - print "$fcn\n"; + print "\x{1e}$fcn\n"; print "\@c $fcn scripts/$m_fname\n"; foreach $_ (@help_txt)