- // Execute batch commands if available
- if (!batch_command.empty()) {
-
- lyxerr[Debug::INIT] << "About to handle -x '"
- << batch_command << '\'' << endl;
-
- Buffer * last_loaded = 0;
-
- vector<string>::const_iterator it = files.begin();
- vector<string>::const_iterator end = files.end();
-
- for (; it != end; ++it) {
- // get absolute path of file and add ".lyx" to
- // the filename if necessary
- string s = fileSearch(string(), *it, "lyx");
- if (s.empty()) {
- Buffer * const b = newFile(*it, string(), true);
- if (b)
- last_loaded = b;
- } else {
- Buffer * buf = pimpl_->buffer_list_.newBuffer(s, false);
- if (loadLyXFile(buf, s)) {
- last_loaded = buf;
- ErrorList const & el = buf->errorList("Parse");
- if (!el.empty())
- for_each(el.begin(), el.end(),
- boost::bind(&LyX::printError, this, _1));
- }
- else
- pimpl_->buffer_list_.release(buf);
- }
- }
+ Buffer * last_loaded = 0;
+
+ vector<FileName>::const_iterator it = files.begin();
+ vector<FileName>::const_iterator end = files.end();