+
+ if (exit_status || pimpl_->batch_commands.empty() || pimpl_->buffer_list_.empty()) {
+ prepareExit();
+ return exit_status;
+ }
+
+ // Iterate through the buffers that were specified on the command line
+ bool final_success = false;
+ vector<Buffer *>::iterator buf_it = command_line_buffers.begin();
+ for (; buf_it != command_line_buffers.end(); ++buf_it) {
+ Buffer * buf = *buf_it;
+ vector<string>::const_iterator bcit = pimpl_->batch_commands.begin();
+ vector<string>::const_iterator bcend = pimpl_->batch_commands.end();
+ DispatchResult dr;
+ for (; bcit != bcend; ++bcit) {
+ LYXERR(Debug::ACTION, "Buffer::dispatch: cmd: " << *bcit);
+ buf->dispatch(*bcit, dr);
+ final_success |= !dr.error();
+ }
+ }
+ prepareExit();
+ return !final_success;