# HG changeset patch # User John W. Eaton # Date 1264038700 18000 # Node ID 9f9eb9d2eefd06d363a3eb7e12e500df2c4cc6d2 # Parent 6a88b00c5ad644b50f5e67cca4efba3575d966cc doc/interpreter/munge-texi.cc: untabify and delete emacs local variable settings diff --git a/doc/ChangeLog b/doc/ChangeLog --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2010-01-20 John W. Eaton + + * interpreter/munge-texi.cc: Delete Emacs local-variable settings. + Untabify. + 2010-01-17 Thorsten Meyer * interpreter/container.txi (Creating Cell Arrays): Add diff --git a/doc/interpreter/munge-texi.cc b/doc/interpreter/munge-texi.cc --- a/doc/interpreter/munge-texi.cc +++ b/doc/interpreter/munge-texi.cc @@ -113,7 +113,7 @@ break; // get function name - std::string function_name; + std::string function_name; do function_name += static_cast (c); while ((c = is.get ()) != EOF @@ -129,11 +129,11 @@ else doc += ", "; - if (function_name[0] == '@') - function_name = "@" + function_name; + if (function_name[0] == '@') + function_name = "@" + function_name; doc += "@ref{doc-" + function_name + ",," - + function_name + "}"; + + function_name + "}"; // test for end of @seealso if (c == '}') @@ -164,14 +164,14 @@ while ((c = is.get ()) != EOF) { if (c == '#') - in_comment = true; + in_comment = true; else if (c == '\n') - in_comment = false; + in_comment = false; else if (! (in_comment || ::isspace (c))) - { - is.putback (c); - break; - } + { + is.putback (c); + break; + } } } @@ -185,25 +185,25 @@ skip_comments (infile); if (infile.get () != doc_delim) - fatal ("invalid doc file format"); + fatal ("invalid doc file format"); std::string symbol_name; do - { - symbol_name = extract_symbol_name (infile); + { + symbol_name = extract_symbol_name (infile); - if (! symbol_name.empty ()) - { - std::string doc_string = extract_docstring (infile); + if (! symbol_name.empty ()) + { + std::string doc_string = extract_docstring (infile); - if (help_text.find (symbol_name) != help_text.end ()) - std::cerr << "ignoring duplicate entry for " - << symbol_name << "\n"; - else - help_text[symbol_name] = doc_string; - } - } + if (help_text.find (symbol_name) != help_text.end ()) + std::cerr << "ignoring duplicate entry for " + << symbol_name << "\n"; + else + help_text[symbol_name] = doc_string; + } + } while (! symbol_name.empty ()); } else @@ -237,13 +237,13 @@ int clast = 0; while ((c = infile.get ()) != EOF) - { - os << static_cast (c); - clast = c; - } + { + os << static_cast (c); + clast = c; + } if (clast != '\n') - os << "\n"; + os << "\n"; os << "@end verbatim\n"; } @@ -262,20 +262,20 @@ while ((c = is.get ()) != EOF) { if (bol) - { - if (c == '@') - { - char buf[16]; - int i = 0; - buf[i++] = static_cast (c); + { + if (c == '@') + { + char buf[16]; + int i = 0; + buf[i++] = static_cast (c); - buf[i++] = c = static_cast (is.get ()); + buf[i++] = c = static_cast (is.get ()); - if (c == 'D') - { - std::string symbol_name; + if (c == 'D') + { + std::string symbol_name; - if ( (buf[i++] = static_cast (is.get ())) == 'O' + if ( (buf[i++] = static_cast (is.get ())) == 'O' && (buf[i++] = static_cast (is.get ())) == 'C' && (buf[i++] = static_cast (is.get ())) == 'S' && (buf[i++] = static_cast (is.get ())) == 'T' @@ -284,66 +284,66 @@ && (buf[i++] = static_cast (is.get ())) == 'N' && (buf[i++] = static_cast (is.get ())) == 'G' && (buf[i++] = static_cast (is.get ())) == '(') - { - while ((c = is.get ()) != EOF && c != ')') - symbol_name += static_cast (c); + { + while ((c = is.get ()) != EOF && c != ')') + symbol_name += static_cast (c); - if (is.eof ()) - fatal ("end of file while reading @DOCSTRING command"); - else - { - std::string doc_string = help_text[symbol_name]; + if (is.eof ()) + fatal ("end of file while reading @DOCSTRING command"); + else + { + std::string doc_string = help_text[symbol_name]; - size_t len = doc_string.length (); + size_t len = doc_string.length (); - int j = 0; + int j = 0; - // If there is a leading comment with the file - // name, copy it to the output. - if (len > 1 - && doc_string[j] == '@' - && doc_string[j+1] == 'c') - { - j = 2; - while (doc_string[j++] != '\n') - /* find eol */; + // If there is a leading comment with the file + // name, copy it to the output. + if (len > 1 + && doc_string[j] == '@' + && doc_string[j+1] == 'c') + { + j = 2; + while (doc_string[j++] != '\n') + /* find eol */; - os << doc_string.substr (0, j); - } + os << doc_string.substr (0, j); + } - while (doc_string[j] == ' ') - j++; + while (doc_string[j] == ' ') + j++; - if (doc_string.substr (j, 15) == "-*- texinfo -*-") - { - j += 15; + if (doc_string.substr (j, 15) == "-*- texinfo -*-") + { + j += 15; - while (isspace (doc_string[j])) - j++; + while (isspace (doc_string[j])) + j++; - // Make `see also' references in functions - // possible using @anchor{TAG} (new with - // Texinfo 4.0). + // Make `see also' references in functions + // possible using @anchor{TAG} (new with + // Texinfo 4.0). - if (symbol_name[0] == '@') - symbol_name = "@" + symbol_name; + if (symbol_name[0] == '@') + symbol_name = "@" + symbol_name; - os << "@anchor{doc-" << symbol_name << "}\n"; + os << "@anchor{doc-" << symbol_name << "}\n"; - os << doc_string.substr (j); - } - else - os << doc_string; - } - } - else - bol = recover_from_macro (os, buf, i); - } - else if (c == 'E') - { - std::string file_name; + os << doc_string.substr (j); + } + else + os << doc_string; + } + } + else + bol = recover_from_macro (os, buf, i); + } + else if (c == 'E') + { + std::string file_name; - if ( (buf[i++] = static_cast (is.get ())) == 'X' + if ( (buf[i++] = static_cast (is.get ())) == 'X' && (buf[i++] = static_cast (is.get ())) == 'A' && (buf[i++] = static_cast (is.get ())) == 'M' && (buf[i++] = static_cast (is.get ())) == 'P' @@ -354,30 +354,30 @@ && (buf[i++] = static_cast (is.get ())) == 'L' && (buf[i++] = static_cast (is.get ())) == 'E' && (buf[i++] = static_cast (is.get ())) == '(') - { - while ((c = is.get ()) != EOF && c != ')') - file_name += static_cast (c); + { + while ((c = is.get ()) != EOF && c != ')') + file_name += static_cast (c); - file_name = top_srcdir + "/examples/" + file_name; + file_name = top_srcdir + "/examples/" + file_name; - process_example_file (file_name, os); - } - else - bol = recover_from_macro (os, buf, i); - } - else - bol = recover_from_macro (os, buf, i); - } - else - os.put (static_cast (c)); - } + process_example_file (file_name, os); + } + else + bol = recover_from_macro (os, buf, i); + } + else + bol = recover_from_macro (os, buf, i); + } + else + os.put (static_cast (c)); + } else - { - if (c == '\n') - bol = true; + { + if (c == '\n') + bol = true; - os.put (static_cast (c)); - } + os.put (static_cast (c)); + } } } @@ -405,9 +405,3 @@ return retval; } - -/* -;;; Local Variables: *** -;;; mode: C++ *** -;;; End: *** -*/