+ case LFUN_BUILD_PROGRAM:
+ doExport("program", true, false);
+ break;
+
+ case LFUN_BUFFER_CHKTEX:
+ runChktex();
+ break;
+
+ case LFUN_BUFFER_EXPORT_CUSTOM: {
+ string format_name;
+ string command = split(argument, format_name, ' ');
+ Format const * format = formats.getFormat(format_name);
+ if (!format) {
+ lyxerr << "Format \"" << format_name
+ << "\" not recognized!"
+ << endl;
+ break;
+ }
+
+ // The name of the file created by the conversion process
+ string filename;
+
+ // Output to filename
+ if (format->name() == "lyx") {
+ string const latexname = latexName(false);
+ filename = changeExtension(latexname,
+ format->extension());
+ filename = addName(temppath(), filename);
+
+ if (!writeFile(FileName(filename)))
+ break;
+
+ } else {
+ doExport(format_name, true, false, filename);
+ }
+
+ // Substitute $$FName for filename
+ if (!contains(command, "$$FName"))
+ command = "( " + command + " ) < $$FName";
+ command = subst(command, "$$FName", filename);
+
+ // Execute the command in the background
+ Systemcall call;
+ call.startscript(Systemcall::DontWait, command);
+ break;
+ }
+
+ // FIXME: There is need for a command-line import.
+ /*
+ case LFUN_BUFFER_IMPORT:
+ doImport(argument);
+ break;
+ */
+
+ case LFUN_BUFFER_AUTO_SAVE:
+ autoSave();
+ break;
+