add simple restart for errors during Qt event processing

This commit is contained in:
pls.153 2022-01-17 17:03:13 +01:00
parent cb968f2d92
commit 50ec472e30
5 changed files with 37 additions and 7 deletions

View file

@ -68,15 +68,26 @@ int main(int argc, char* argv[]) {
LQML::eval("(x:when-it (probe-file \"~/.eclrc\") (load x:it))");
}
bool slime = false;
if (arguments.contains("-slime")) {
arguments.removeAll("-slime");
slime = true;
}
// load Lisp file
if (arguments.length() > 1) {
QString arg1(QDir::fromNativeSeparators(arguments.at(1)));
if (arg1.endsWith(".lisp")) {
LQML::eval(QString("(load \"%1\")").arg(arg1));
//LQML::eval("(loop (with-simple-restart (restart-qt-events \"Restart Qt event processing.\") (qexec)))");
}
}
if (slime) {
LQML::eval("(loop (with-simple-restart (restart-qt-events \"Restart Qt event processing.\") (qexec)))",
true);
return 0;
}
return catch_all_qexec();
}