diff --git a/development/FORMAT b/development/FORMAT index 79540c6053..2b44241452 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,6 +1,10 @@ LyX file-format changes ----------------------- +2003-07-28 José Matos + + * \the_end is replaced with \end_document + 2003-07-28 José Matos * \layout is replaced with \begin_layout diff --git a/lib/ChangeLog b/lib/ChangeLog index e1092cf5b6..73fc77f4e2 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,7 +1,12 @@ 2003-07-28 José Matos - * lyx2lyx (parse_options): support gziped files. - * parser_tools.py (set_format): output correct version. + * lyx2lyx/lyxconvert_224.py (end_document): + replace \the_end with \end_document. + +2003-07-28 José Matos + + * lyx2lyx/lyx2lyx (parse_options): support gziped files. + * lyx2lyx/parser_tools.py (set_format): output correct version. 2003-07-28 José Matos diff --git a/lib/lyx2lyx/lyxconvert_224.py b/lib/lyx2lyx/lyxconvert_224.py index a64fc7be2a..db4148f372 100644 --- a/lib/lyx2lyx/lyxconvert_224.py +++ b/lib/lyx2lyx/lyxconvert_224.py @@ -78,9 +78,17 @@ def layout2begin_layout(lines): lines[i]= replace(lines[i], '\\layout', '\\begin_layout') i = i + 1 +def end_document(lines): + i = find_token(lines, "\\the_end", 0) + if i == -1: + lines.append("\\end_document") + return + lines[i] = "\\end_document" + def convert(header, body): add_end_layout(body) layout2begin_layout(body) + end_document(body) if __name__ == "__main__": pass diff --git a/src/ChangeLog b/src/ChangeLog index 49b6ed8817..19b6b481e2 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-07-28 José Matos + + * buffer.C (readBody, do_writeFile): + * paragraph.C(readParagraph): \end_document replaces \the_end. 2003-07-29 André Pönitz diff --git a/src/buffer.C b/src/buffer.C index 95fc968d37..3c82bc2f48 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -295,7 +295,7 @@ int Buffer::readHeader(LyXLex & lex) // changed to be public and have one parameter // if par = 0 normal behavior // else insert behavior -// Returns false if "\the_end" is not read (Asger) +// Returns false if "\end_document" is not read (Asger) bool Buffer::readBody(LyXLex & lex, ParagraphList::iterator pit) { Paragraph::depth_type depth = 0; @@ -329,7 +329,7 @@ bool Buffer::readBody(LyXLex & lex, ParagraphList::iterator pit) lyxerr[Debug::PARSER] << "Handling token: `" << token << '\'' << endl; - if (token == "\\the_end") { + if (token == "\\end_document") { the_end_read = true; continue; } @@ -698,7 +698,7 @@ bool Buffer::do_writeFile(ostream & ofs) const pit->write(this, ofs, params, depth); // Write marker that shows file is complete - ofs << "\n\\the_end" << endl; + ofs << "\n\\end_document" << endl; // Shouldn't really be needed.... //ofs.close(); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index be593a33a1..17bf436503 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,7 @@ +2003-07-28 José Matos + + * insetext.C (read): \end_document replaces \the_end. + 2003-07-28 José Matos * insetert.C (write): \layout -> \begin_layout. diff --git a/src/insets/insettext.C b/src/insets/insettext.C index 1f22e6987e..78bb89071e 100644 --- a/src/insets/insettext.C +++ b/src/insets/insettext.C @@ -252,8 +252,8 @@ void InsetText::read(Buffer const * buf, LyXLex & lex) break; } - if (token == "\\the_end") { - lex.printError("\\the_end read in inset! Error in document!"); + if (token == "\\end_document") { + lex.printError("\\end_document read in inset! Error in document!"); return; } diff --git a/src/paragraph_funcs.C b/src/paragraph_funcs.C index c3eaec30cd..916c8b6669 100644 --- a/src/paragraph_funcs.C +++ b/src/paragraph_funcs.C @@ -988,7 +988,7 @@ int readParagraph(Buffer & buf, Paragraph & par, LyXLex & lex) lyxerr[Debug::PARSER] << "Handling paragraph token: `" << token << '\'' << endl; - if (token == "\\begin_layout" || token == "\\the_end" + if (token == "\\begin_layout" || token == "\\end_document" || token == "\\end_inset" || token == "\\begin_deeper" || token == "\\end_deeper") { lex.pushToken(token);