using lyx::support::getEnv;
using lyx::support::libFileSearch;
using lyx::support::token;
+using lyx::support::tokenPos;
using std::cout;
using std::endl;
{ "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
{ "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
{ "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
- { "\\cygwin_path_fix_needed", LyXRC::RC_CYGWIN_PATH_FIX },
{ "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
{ "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
{ "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
{ "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
{ "\\template_path", LyXRC::RC_TEMPLATEPATH },
{ "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
+ { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
{ "\\ui_file", LyXRC::RC_UIFILE },
{ "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
{ "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
num_lastfiles = maxlastfiles;
check_lastfiles = true;
use_lastfilepos = true;
- load_session = true;
+ load_session = false;
make_backup = true;
backupdir_path.erase();
display_graphics = lyx::graphics::ColorDisplay;
language_command_local = "\\foreignlanguage{$$lang}{";
default_language = "english";
show_banner = true;
- cygwin_path_fix = false;
+ windows_style_tex_paths = false;
tex_allows_spaces = false;
date_insert_format = "%A, %e %B %Y";
cursor_follows_scrollbar = false;
}
break;
- case RC_CYGWIN_PATH_FIX:
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (lexrc.next()) {
- cygwin_path_fix = lexrc.getBool();
+ windows_style_tex_paths = lexrc.getBool();
}
break;
if (lexrc.next()) {
flags = lexrc.getString();
}
- if (command.empty()
- || token(command, ' ', 0) == "none") {
+ if (command.empty()) {
converters.erase(from, to);
} else {
converters.add(from, to, command, flags);
}
if (lexrc.next()) {
command = lexrc.getString();
- if (token(command, ' ', 0) == "none")
- command.erase();
}
formats.setViewer(format, command);
break;
shortcut = lexrc.getString();
}
string viewer, editor;
+ if (lexrc.next())
+ viewer = lexrc.getString();
+ if (lexrc.next())
+ editor = lexrc.getString();
+ // The only supported flag for now is "document".
+ // More flags could be added in the future.
+ // Therefore we use tokenPos below to read the flag.
+ string flags;
// Hack to ensure compatibility with versions older
- // than 1.4.0
+ // than 1.5.0
int le = lexrc.lex();
if (le != LyXLex::LEX_FEOF && le != LyXLex::LEX_UNDEF) {
- viewer = lexrc.getString();
- if (le == LyXLex::LEX_DATA) {
- if (token(viewer, ' ', 0) == "none")
- viewer.erase();
- if (lexrc.next()) {
- editor = lexrc.getString();
- if (token(editor, ' ', 0) == "none")
- editor.erase();
- }
- } else {
+ flags = lexrc.getString();
+ if (le != LyXLex::LEX_DATA) {
// We have got a known token.
// Therefore this is an old style
// format definition without
- // viewer and editor.
- lexrc.pushToken(viewer);
- viewer.erase();
+ // flags.
+ lexrc.pushToken(flags);
+ flags.erase();
}
}
+ bool const document =
+ (tokenPos(flags, ',', "document") >= 0);
+ if (!flags.empty() && flags != "document")
+ lyxerr << "Ignoring flags other than "
+ "`document' in `" << flags
+ << "' for format `" << format << "'."
+ << endl;
if (prettyname.empty()) {
if (converters.formatIsUsed(format)) {
lyxerr << "Can't delete format "
}
} else {
formats.add(format, extension, prettyname,
- shortcut, viewer, editor);
+ shortcut, viewer, editor, document);
}
break;
}
index_command != system_lyxrc.index_command) {
os << "\\index_command \"" << index_command << "\"\n";
}
- case RC_CYGWIN_PATH_FIX:
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
if (ignore_system_lyxrc ||
- cygwin_path_fix != system_lyxrc.cygwin_path_fix) {
- os << "\\cygwin_path_fix_needed "
- << convert<string>(cygwin_path_fix) << '\n';
+ windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
+ os << "\\tex_expects_windows_paths "
+ << convert<string>(windows_style_tex_paths) << '\n';
}
case RC_TEX_ALLOWS_SPACES:
if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
case RC_USELASTFILEPOS:
if (ignore_system_lyxrc ||
use_lastfilepos != system_lyxrc.use_lastfilepos) {
- os << "\\use_session " << convert<string>(use_lastfilepos)
+ os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
<< '\n';
}
case RC_LOADSESSION:
<< "#\n\n";
case RC_FORMAT:
- // New/modifed formats
+ // New/modified formats
for (Formats::const_iterator cit = formats.begin();
cit != formats.end(); ++cit) {
Format const * format =
format->prettyname() != cit->prettyname() ||
format->shortcut() != cit->shortcut() ||
format->viewer() != cit->viewer() ||
- format->editor() != cit->editor())
+ format->editor() != cit->editor() ||
+ format->documentFormat() != cit->documentFormat()) {
os << "\\format \"" << cit->name() << "\" \""
<< cit->extension() << "\" \""
<< cit->prettyname() << "\" \""
<< cit->shortcut() << "\" \""
<< cit->viewer() << "\" \""
- << cit->editor() << "\"\n";
+ << cit->editor() << "\" \"";
+ if (cit->documentFormat())
+ os << "document";
+ os << "\"\n";
+ }
}
// Look for deleted formats
cit != system_formats.end(); ++cit)
if (!formats.getFormat(cit->name()))
os << "\\format \"" << cit->name()
- << "\" \"\" \"\" \"\" \"\" \"\"\n";
+ << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
case RC_VIEWER:
// Ignore it
break;
case RC_ASCIIROFF_COMMAND:
- str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"none\" is specified, an internal routine is used.");
+ str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used.");
break;
case RC_ASCII_LINELEN:
case RC_CUSTOM_EXPORT_FORMAT:
break;
- case RC_CYGWIN_PATH_FIX:
- break;
-
case RC_DATE_INSERT_FORMAT:
//xgettext:no-c-format
str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
case RC_TEX_ALLOWS_SPACES:
break;
+ case RC_TEX_EXPECTS_WINDOWS_PATHS:
+ break;
+
case RC_UIFILE:
str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
break;