]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Try to deal with one of the big problems here, namely, that we
[lyx.git] / src / Buffer.cpp
index ffad9411bfce31a2cd1e3d606e3e31cddc94ddab..11c9231bb651b4be4cc1a87c67feae6cbd6f7920 100644 (file)
@@ -42,6 +42,7 @@
 #include "Lexer.h"
 #include "LyXAction.h"
 #include "LyX.h"
+#include "LyXFunc.h"
 #include "LyXRC.h"
 #include "LyXVC.h"
 #include "output_docbook.h"
@@ -1391,7 +1392,7 @@ void Buffer::makeLyXHTMLFile(FileName const & fname,
                              OutputParams const & runparams,
                              bool const body_only) const
 {
-       LYXERR(Debug::LATEX, "makeLYXHTMLFile...");
+       LYXERR(Debug::LATEX, "makeLyXHTMLFile...");
 
        ofdocstream ofs;
        if (!openFileWrite(ofs, fname))
@@ -1741,6 +1742,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
        string const argument = to_utf8(func.argument());
        // We'll set this back to false if need be.
        bool dispatched = true;
+       undo().beginUndoGroup();
 
        switch (func.action) {
        case LFUN_BUFFER_TOGGLE_READ_ONLY:
@@ -2064,6 +2066,7 @@ void Buffer::dispatch(FuncRequest const & func, DispatchResult & dr)
                break;
        }
        dr.dispatched(dispatched);
+       undo().endUndoGroup();
 }
 
 
@@ -3121,10 +3124,11 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir,
        // Plain text backend
        if (backend_format == "text")
                writePlaintextFile(*this, FileName(filename), runparams);
-       // no backend
-       else if (backend_format == "xhtml")
+       // HTML backend
+       else if (backend_format == "xhtml") {
+               runparams.flavor = OutputParams::HTML;
                makeLyXHTMLFile(FileName(filename), runparams);
-       else if (backend_format == "lyx")
+       }       else if (backend_format == "lyx")
                writeFile(FileName(filename));
        // Docbook backend
        else if (isDocBook()) {
@@ -3299,7 +3303,8 @@ bool Buffer::readFileHelper(FileName const & s)
                                str = _("Document was successfully recovered.");
                        else
                                str = _("Document was NOT successfully recovered.");
-                       str += "\n\n" + _("Remove emergency file now?");
+                       str += "\n\n" + bformat(_("Remove emergency file now?\n(%1$s)"),
+                                               from_utf8(e.absFilename()));
 
                        if (!Alert::prompt(_("Delete emergency file?"), str, 1, 1,
                                        _("&Remove"), _("&Keep it"))) {