3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
31 #include "graphics/GraphicsTypes.h"
33 #include "support/convert.h"
34 #include "support/debug.h"
35 #include "support/environment.h"
36 #include "support/FileName.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/Package.h"
42 #include "support/userinfo.h"
49 using namespace lyx::support;
53 namespace os = support::os;
57 static unsigned int const LYXRC_FILEFORMAT = 1;
59 // when adding something to this array keep it sorted!
60 LexerKeyword lyxrcTags[] = {
61 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
62 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
63 { "\\alternate_language", LyXRC::RC_ALT_LANG },
64 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
65 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
66 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
67 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
68 { "\\autosave", LyXRC::RC_AUTOSAVE },
69 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
70 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
71 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
72 { "\\bind_file", LyXRC::RC_BINDFILE },
73 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
74 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
75 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
76 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
77 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
78 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
79 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
80 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
81 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
82 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
83 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
84 { "\\converter", LyXRC::RC_CONVERTER },
85 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
86 { "\\copier", LyXRC::RC_COPIER },
87 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
88 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
89 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
90 { "\\def_file", LyXRC::RC_DEFFILE },
91 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
92 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
93 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
94 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
95 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
96 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
97 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
98 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
99 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
100 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
101 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
102 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
103 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
104 { "\\format", LyXRC::RC_FILEFORMAT },
105 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
106 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
107 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
108 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
109 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
110 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
111 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
112 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
113 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
114 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
115 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
116 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
117 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
118 { "\\input", LyXRC::RC_INPUT },
119 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
120 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
121 { "\\kbmap", LyXRC::RC_KBMAP },
122 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
123 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
124 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
125 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
126 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
127 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
128 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
129 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
130 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
131 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
132 { "\\load_session", LyXRC::RC_LOADSESSION },
133 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
134 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
135 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
136 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
137 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
138 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
139 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
140 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
141 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
142 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
143 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
144 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
145 { "\\preview", LyXRC::RC_PREVIEW },
146 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
147 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
148 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
149 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
150 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
151 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
152 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
153 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
154 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
155 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
156 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
157 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
158 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
159 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
160 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
161 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
162 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
163 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
164 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
165 { "\\printer", LyXRC::RC_PRINTER },
166 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
167 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
168 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
169 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
170 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
171 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
172 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
173 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
174 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
175 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
176 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
177 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
178 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
179 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
180 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
181 { "\\set_color", LyXRC::RC_SET_COLOR },
182 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
183 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
184 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
185 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
186 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
187 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
188 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
189 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
190 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
191 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
192 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
193 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
194 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
195 { "\\ui_file", LyXRC::RC_UIFILE },
196 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
197 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
198 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
201 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
202 { "\\user_email", LyXRC::RC_USER_EMAIL },
203 { "\\user_name", LyXRC::RC_USER_NAME },
204 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
205 // compatibility with versions older than 1.4.0 only
206 { "\\viewer", LyXRC::RC_VIEWER},
207 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
208 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
209 { "format", LyXRC::RC_LYXRCFORMAT }
212 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
223 void LyXRC::setDefaults()
226 def_file = "default";
228 // Get printer from the environment. If fail, use default "",
229 // assuming that everything is set up correctly.
230 printer = getEnv("PRINTER");
231 print_adapt_output = false;
232 print_command = "dvips";
233 print_evenpage_flag = "-B";
234 print_oddpage_flag = "-A";
235 print_pagerange_flag = "-pp";
236 print_copies_flag = "-c";
237 print_collcopies_flag = "-C";
238 print_reverse_flag = "-r";
239 print_landscape_flag = "-t landscape";
240 print_to_printer = "-P";
241 print_to_file = "-o ";
242 print_file_extension = ".ps";
243 print_paper_flag = "-t";
244 print_paper_dimension_flag = "-T";
245 document_path.erase();
246 view_dvi_paper_option.erase();
247 default_papersize = PAPER_DEFAULT;
248 default_view_format = "pdf2";
249 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
250 bibtex_command = "bibtex";
252 index_command = "makeindex -c -q";
253 nomencl_command = "makeindex -s nomencl.ist";
255 // Because a screen is typically wider than a piece of paper:
257 allow_geometry_session = true;
258 // Default LaTeX font size:
259 font_sizes[FONT_SIZE_TINY] = "5.0";
260 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
261 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
262 font_sizes[FONT_SIZE_SMALL] = "9.0";
263 font_sizes[FONT_SIZE_NORMAL] = "10.0";
264 font_sizes[FONT_SIZE_LARGE] = "12.0";
265 font_sizes[FONT_SIZE_LARGER] = "14.4";
266 font_sizes[FONT_SIZE_LARGEST] = "17.26";
267 font_sizes[FONT_SIZE_HUGE] = "20.74";
268 font_sizes[FONT_SIZE_HUGER] = "24.88";
269 use_scalable_fonts = true;
270 roman_font_name = "";
272 typewriter_font_name = "";
274 auto_region_delete = true;
275 auto_reset_options = false;
276 plaintext_linelen = 65;
277 mouse_wheel_speed = 1.0;
278 num_lastfiles = maxlastfiles;
279 check_lastfiles = true;
280 use_lastfilepos = true;
281 load_session = false;
283 save_compressed = false;
284 backupdir_path.erase();
285 display_graphics = true;
286 // Spellchecker settings:
287 // FIXME: this check should test the target platform (darwin)
288 #if defined(USE_MACOSX_PACKAGING)
289 spellchecker = "native";
290 #elif defined(USE_ASPELL)
291 spellchecker = "aspell";
292 #elif defined(USE_HUNSPELL)
293 spellchecker = "hunspell";
295 spellchecker = "aspell";
297 spellchecker_accept_compound = false;
298 spellcheck_continuously = false;
299 spellcheck_notes = true;
302 visual_cursor = false;
304 mark_foreign_language = true;
305 language_auto_begin = true;
306 language_auto_end = true;
307 language_global_options = true;
308 language_package_selection = LP_AUTO;
309 language_custom_package = "\\usepackage{babel}";
310 language_command_begin = "\\selectlanguage{$$lang}";
311 language_command_local = "\\foreignlanguage{$$lang}{";
312 sort_layouts = false;
313 group_layouts = true;
314 default_language = "english";
315 gui_language = "auto";
317 windows_style_tex_paths = false;
318 tex_allows_spaces = false;
319 date_insert_format = "%x";
320 cursor_follows_scrollbar = false;
321 scroll_below_document = false;
322 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
323 paragraph_markers = false;
324 mac_dontswap_ctrl_meta = false;
325 mac_like_word_movement = false;
326 macro_edit_style = MACRO_EDIT_INLINE_BOX;
327 dialogs_iconify_with_main = false;
328 preview = PREVIEW_OFF;
329 preview_hashed_labels = false;
330 preview_scale_factor = 1.0;
331 use_converter_cache = true;
332 use_system_colors = false;
334 use_pixmap_cache = false;
335 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
336 user_name = to_utf8(support::user_name());
337 user_email = to_utf8(support::user_email());
338 open_buffers_in_tabs = true;
339 single_close_tab_button = false;
340 single_instance = true;
341 forward_search_dvi = string();
342 forward_search_pdf = string();
343 export_overwrite = NO_FILES;
345 // Fullscreen settings
346 full_screen_limit = false;
347 full_screen_toolbars = true;
348 full_screen_tabbar = true;
349 full_screen_menubar = true;
350 full_screen_scrollbar = true;
351 full_screen_width = 700;
353 completion_cursor_text = true;
354 completion_popup_math = true;
355 completion_popup_text = false;
356 completion_popup_delay = 2.0;
357 completion_popup_after_complete = true;
358 autocorrection_math = false;
359 completion_inline_math = true;
360 completion_inline_text = false;
361 completion_inline_dots = -1;
362 completion_inline_delay = 0.2;
363 default_decimal_point = ".";
370 void oldFontFormat(string & family, string & foundry)
372 if (family.empty() || family[0] != '-')
374 foundry = token(family, '-', 1);
375 family = token(family, '-', 2);
383 bool LyXRC::read(FileName const & filename, bool check_format)
385 Lexer lexrc(lyxrcTags);
386 lexrc.setFile(filename);
387 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
388 ReturnValues retval = read(lexrc, check_format);
389 if (!check_format || retval != FormatMismatch)
390 return retval == ReadOK;
392 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
393 FileName const tempfile = FileName::tempName("convert_lyxrc");
394 bool const success = prefs2prefs(filename, tempfile, false);
396 LYXERR0 ("Unable to convert " << filename.absFileName() <<
397 " to format " << LYXRC_FILEFORMAT);
400 Lexer lexrc2(lyxrcTags);
401 lexrc2.setFile(tempfile);
402 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
403 retval = read(lexrc2, check_format);
404 tempfile.removeFile();
405 return retval == ReadOK;
409 // don't need to worry about conversion, because this is always
410 // from an internal source
411 bool LyXRC::read(istream & is)
413 Lexer lexrc(lyxrcTags);
415 LYXERR(Debug::LYXRC, "Reading istream...");
416 return read(lexrc, false) == ReadOK;
420 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
422 if (lyxerr.debugging(Debug::PARSER))
423 lexrc.printTable(lyxerr);
428 // default for current rowpainter capabilities
429 force_paint_single_char = true;
431 // format prior to 2.0 and introduction of format tag
432 unsigned int format = 0;
434 while (lexrc.isOK()) {
435 // By using two switches we take advantage of the compiler
436 // telling us if we have missed a LyXRCTags element in
437 // the second switch.
438 // Note that this also shows a problem with Lexer since it
439 // helps us avoid taking advantage of the strictness of the
442 int le = lexrc.lex();
444 case Lexer::LEX_UNDEF:
445 lexrc.printError("Unknown tag `$$Token'");
447 case Lexer::LEX_FEOF:
452 switch (static_cast<LyXRCTags>(le)) {
455 format = lexrc.getInteger();
457 case RC_INPUT: // Include file
460 libFileSearch(string(),
462 if (read(tmp, check_format)) {
464 "Error reading included file: " + tmp.absFileName());
470 bind_file = os::internal_path(lexrc.getString());
475 def_file = os::internal_path(lexrc.getString());
480 ui_file = os::internal_path(lexrc.getString());
483 case RC_AUTORESET_OPTIONS:
484 lexrc >> auto_reset_options;
487 case RC_DISPLAY_GRAPHICS:
489 display_graphics = lexrc.getString() == "true";
492 case RC_TEX_EXPECTS_WINDOWS_PATHS:
493 lexrc >> windows_style_tex_paths;
496 case RC_TEX_ALLOWS_SPACES:
497 lexrc >> tex_allows_spaces;
504 case RC_KBMAP_PRIMARY:
506 string const kmap(os::internal_path(lexrc.getString()));
507 if (!libFileSearch("kbd", kmap, "kmap").empty()
509 primary_kbmap = kmap;
511 lexrc.printError("LyX: Keymap `$$Token' not found");
516 case RC_KBMAP_SECONDARY:
518 string const kmap(os::internal_path(lexrc.getString()));
519 if (!libFileSearch("kbd", kmap, "kmap").empty()
521 secondary_kbmap = kmap;
523 lexrc.printError("LyX: Keymap `$$Token' not found");
528 case RC_FONT_ENCODING:
532 case RC_FORCE_PAINT_SINGLE_CHAR:
533 lexrc >> force_paint_single_char;
540 case RC_PRINT_COMMAND:
541 if (lexrc.next(true)) {
542 print_command = lexrc.getString();
546 case RC_PRINTEVENPAGEFLAG:
547 lexrc >> print_evenpage_flag;
550 case RC_PRINTODDPAGEFLAG:
551 lexrc >> print_oddpage_flag;
554 case RC_PRINTPAGERANGEFLAG:
555 lexrc >> print_pagerange_flag;
558 case RC_PRINTCOPIESFLAG:
559 lexrc >> print_copies_flag;
562 case RC_PRINTCOLLCOPIESFLAG:
563 lexrc >> print_collcopies_flag;
566 case RC_PRINTREVERSEFLAG:
567 lexrc >> print_reverse_flag;
570 case RC_PRINTLANDSCAPEFLAG:
571 lexrc >> print_landscape_flag;
574 case RC_PRINTTOPRINTER:
575 lexrc >> print_to_printer;
578 case RC_PRINT_ADAPTOUTPUT:
579 lexrc >> print_adapt_output;
584 print_to_file = os::internal_path(lexrc.getString());
588 case RC_PRINTFILEEXTENSION:
589 lexrc >> print_file_extension;
592 case RC_PRINTEXSTRAOPTIONS:
593 lexrc >> print_extra_options;
596 case RC_PRINTSPOOL_COMMAND:
597 if (lexrc.next(true)) {
598 print_spool_command = lexrc.getString();
602 case RC_PRINTSPOOL_PRINTERPREFIX:
603 lexrc >> print_spool_printerprefix;
606 case RC_PRINTPAPERDIMENSIONFLAG:
607 lexrc >> print_paper_dimension_flag;
610 case RC_PRINTPAPERFLAG:
611 lexrc >> print_paper_flag;
614 case RC_DEFAULT_PAPERSIZE:
616 string const size = ascii_lowercase(lexrc.getString());
617 if (size == "usletter")
618 default_papersize = PAPER_USLETTER;
619 else if (size == "legal")
620 default_papersize = PAPER_USLEGAL;
621 else if (size == "executive")
622 default_papersize = PAPER_USEXECUTIVE;
623 else if (size == "a3")
624 default_papersize = PAPER_A3;
625 else if (size == "a4")
626 default_papersize = PAPER_A4;
627 else if (size == "a5")
628 default_papersize = PAPER_A5;
629 else if (size == "b5")
630 default_papersize = PAPER_B5;
631 else if (size == "default")
632 default_papersize = PAPER_DEFAULT;
636 case RC_VIEWDVI_PAPEROPTION:
638 view_dvi_paper_option = lexrc.getString();
640 view_dvi_paper_option.erase();
643 case RC_CHKTEX_COMMAND:
644 if (lexrc.next(true)) {
645 chktex_command = lexrc.getString();
649 case RC_BIBTEX_ALTERNATIVES:
650 if (lexrc.next(true)) {
651 bibtex_alternatives.insert(lexrc.getString());
655 case RC_BIBTEX_COMMAND:
656 if (lexrc.next(true)) {
657 bibtex_command = lexrc.getString();
661 case RC_JBIBTEX_COMMAND:
662 if (lexrc.next(true)) {
663 jbibtex_command = lexrc.getString();
667 case RC_INDEX_ALTERNATIVES:
668 if (lexrc.next(true)) {
669 index_alternatives.insert(lexrc.getString());
673 case RC_INDEX_COMMAND:
674 if (lexrc.next(true)) {
675 index_command = lexrc.getString();
679 case RC_JINDEX_COMMAND:
680 if (lexrc.next(true)) {
681 jindex_command = lexrc.getString();
685 case RC_SPLITINDEX_COMMAND:
686 if (lexrc.next(true)) {
687 splitindex_command = lexrc.getString();
691 case RC_NOMENCL_COMMAND:
692 if (lexrc.next(true)) {
693 nomencl_command = lexrc.getString();
705 case RC_GEOMETRY_SESSION:
706 lexrc >> allow_geometry_session;
709 case RC_SCREEN_FONT_SIZES:
710 lexrc >> font_sizes[FONT_SIZE_TINY];
711 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
712 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
713 lexrc >> font_sizes[FONT_SIZE_SMALL];
714 lexrc >> font_sizes[FONT_SIZE_NORMAL];
715 lexrc >> font_sizes[FONT_SIZE_LARGE];
716 lexrc >> font_sizes[FONT_SIZE_LARGER];
717 lexrc >> font_sizes[FONT_SIZE_LARGEST];
718 lexrc >> font_sizes[FONT_SIZE_HUGE];
719 lexrc >> font_sizes[FONT_SIZE_HUGER];
722 case RC_SCREEN_FONT_SCALABLE:
723 lexrc >> use_scalable_fonts;
730 case RC_DOCUMENTPATH:
732 document_path = os::internal_path(lexrc.getString());
733 document_path = expandPath(document_path);
739 example_path = os::internal_path(lexrc.getString());
740 example_path = expandPath(example_path);
744 case RC_TEMPLATEPATH:
746 template_path = os::internal_path(lexrc.getString());
747 template_path = expandPath(template_path);
753 tempdir_path = os::internal_path(lexrc.getString());
754 tempdir_path = expandPath(tempdir_path);
758 case RC_THESAURUSDIRPATH:
760 thesaurusdir_path = os::internal_path(lexrc.getString());
761 thesaurusdir_path = expandPath(thesaurusdir_path);
765 case RC_HUNSPELLDIR_PATH:
767 hunspelldir_path = os::internal_path(lexrc.getString());
768 hunspelldir_path = expandPath(hunspelldir_path);
772 case RC_USELASTFILEPOS:
773 lexrc >> use_lastfilepos;
777 lexrc >> load_session;
780 case RC_MOUSE_WHEEL_SPEED:
781 lexrc >> mouse_wheel_speed;
784 case RC_COMPLETION_INLINE_DELAY:
785 lexrc >> completion_inline_delay;
788 case RC_COMPLETION_INLINE_MATH:
789 lexrc >> completion_inline_math;
792 case RC_COMPLETION_INLINE_TEXT:
793 lexrc >> completion_inline_text;
796 case RC_COMPLETION_INLINE_DOTS:
797 lexrc >> completion_inline_dots;
800 case RC_AUTOCORRECTION_MATH:
801 lexrc >> autocorrection_math;
804 case RC_COMPLETION_POPUP_DELAY:
805 lexrc >> completion_popup_delay;
808 case RC_COMPLETION_POPUP_MATH:
809 lexrc >> completion_popup_math;
812 case RC_COMPLETION_POPUP_TEXT:
813 lexrc >> completion_popup_text;
816 case RC_COMPLETION_CURSOR_TEXT:
817 lexrc >> completion_cursor_text;
820 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
821 lexrc >> completion_popup_after_complete;
824 case RC_NUMLASTFILES:
825 lexrc >> num_lastfiles;
828 case RC_CHECKLASTFILES:
829 lexrc >> check_lastfiles;
832 case RC_SCREEN_FONT_ROMAN:
834 roman_font_name = lexrc.getString();
835 oldFontFormat(roman_font_name,
840 case RC_SCREEN_FONT_SANS:
842 sans_font_name = lexrc.getString();
843 oldFontFormat(sans_font_name, sans_font_foundry);
847 case RC_SCREEN_FONT_TYPEWRITER:
849 typewriter_font_name = lexrc.getString();
850 oldFontFormat(typewriter_font_name,
851 typewriter_font_foundry);
855 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
856 lexrc >> roman_font_foundry;
859 case RC_SCREEN_FONT_SANS_FOUNDRY:
860 lexrc >> sans_font_foundry;
863 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
864 lexrc >> typewriter_font_foundry;
869 lexrc.printError("Missing color tag.");
872 string lyx_name = lexrc.getString();
875 lexrc.printError("Missing color name for color: `$$Token'");
878 string x11_name = lexrc.getString();
880 ColorCode const col =
881 lcolor.getFromLyXName(lyx_name);
882 if (col == Color_none ||
883 col == Color_inherit ||
887 if (!lcolor.setColor(col, x11_name))
888 LYXERR0("Bad lyxrc set_color for " << lyx_name);
892 case RC_AUTOREGIONDELETE:
893 // Auto region delete defaults to true
894 lexrc >> auto_region_delete;
899 lyxpipes = os::internal_path(lexrc.getString());
900 lyxpipes = expandPath(lyxpipes);
904 case RC_CURSOR_FOLLOWS_SCROLLBAR:
905 lexrc >> cursor_follows_scrollbar;
908 case RC_CURSOR_WIDTH:
909 lexrc >> cursor_width;
912 case RC_SCROLL_BELOW_DOCUMENT:
913 lexrc >> scroll_below_document;
916 case RC_PARAGRAPH_MARKERS:
917 lexrc >> paragraph_markers;
920 case RC_MAC_DONTSWAP_CTRL_META:
921 lexrc >> mac_dontswap_ctrl_meta;
924 case RC_MAC_LIKE_WORD_MOVEMENT:
925 lexrc >> mac_like_word_movement;
928 case RC_MACRO_EDIT_STYLE:
930 switch (lexrc.getInteger()) {
931 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
932 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
933 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
938 case RC_DIALOGS_ICONIFY_WITH_MAIN:
939 lexrc >> dialogs_iconify_with_main;
942 case RC_PLAINTEXT_LINELEN:
943 lexrc >> plaintext_linelen;
945 // Spellchecker settings:
946 case RC_ACCEPT_COMPOUND:
947 lexrc >> spellchecker_accept_compound;
949 case RC_USE_SYSTEM_COLORS:
950 lexrc >> use_system_colors;
953 lexrc >> use_tooltip;
955 case RC_USE_PIXMAP_CACHE:
956 lexrc >> use_pixmap_cache;
958 case RC_SPELLCHECKER:
959 lexrc >> spellchecker;
962 lexrc >> spellchecker_alt_lang;
965 lexrc >> spellchecker_esc_chars;
967 case RC_SPELLCHECK_CONTINUOUSLY:
968 lexrc >> spellcheck_continuously;
970 case RC_SPELLCHECK_NOTES:
971 lexrc >> spellcheck_notes;
974 lexrc >> make_backup;
976 case RC_SAVE_COMPRESSED:
977 lexrc >> save_compressed;
979 case RC_BACKUPDIR_PATH:
981 backupdir_path = os::internal_path(lexrc.getString());
982 backupdir_path = expandPath(backupdir_path);
985 case RC_DEFAULT_DECIMAL_POINT:
986 lexrc >> default_decimal_point;
988 case RC_DATE_INSERT_FORMAT:
989 lexrc >> date_insert_format;
991 case RC_LANGUAGE_CUSTOM_PACKAGE:
992 lexrc >> language_custom_package;
994 case RC_LANGUAGE_AUTO_BEGIN:
995 lexrc >> language_auto_begin;
997 case RC_LANGUAGE_AUTO_END:
998 lexrc >> language_auto_end;
1000 case RC_LANGUAGE_GLOBAL_OPTIONS:
1001 lexrc >> language_global_options;
1003 case RC_LANGUAGE_PACKAGE_SELECTION:
1005 switch (lexrc.getInteger()) {
1007 language_package_selection = LP_AUTO;
1010 language_package_selection = LP_BABEL;
1013 language_package_selection = LP_CUSTOM;
1016 language_package_selection = LP_NONE;
1021 case RC_LANGUAGE_COMMAND_BEGIN:
1022 lexrc >> language_command_begin;
1024 case RC_LANGUAGE_COMMAND_END:
1025 lexrc >> language_command_end;
1027 case RC_LANGUAGE_COMMAND_LOCAL:
1028 lexrc >> language_command_local;
1030 case RC_RTL_SUPPORT:
1031 lexrc >> rtl_support;
1033 case RC_VISUAL_CURSOR:
1034 lexrc >> visual_cursor;
1036 case RC_AUTO_NUMBER:
1037 lexrc >> auto_number;
1039 case RC_MARK_FOREIGN_LANGUAGE:
1040 lexrc >> mark_foreign_language;
1044 string fmt, command;
1046 fmt = lexrc.getString();
1047 if (lexrc.next(true))
1048 command = lexrc.getString();
1049 setMover(fmt, command);
1053 case RC_CONVERTER: {
1054 string from, to, command, flags;
1056 from = lexrc.getString();
1058 to = lexrc.getString();
1059 if (lexrc.next(true))
1060 command = lexrc.getString();
1062 flags = lexrc.getString();
1063 if (command.empty())
1064 theConverters().erase(from, to);
1066 theConverters().add(from, to, command, flags);
1069 // compatibility with versions older than 1.4.0 only
1071 string format, command;
1072 lexrc >> format >> command;
1073 formats.setViewer(format, command);
1076 case RC_FILEFORMAT: {
1077 string format, extension, prettyname, shortcut;
1078 lexrc >> format >> extension >> prettyname >> shortcut;
1079 string viewer, editor;
1080 if (lexrc.next(true))
1081 viewer = lexrc.getString();
1082 if (lexrc.next(true))
1083 editor = lexrc.getString();
1085 // Hack to ensure compatibility with versions older
1087 int le = lexrc.lex();
1088 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1089 flags = lexrc.getString();
1090 if (le != Lexer::LEX_DATA) {
1091 // We have got a known token.
1092 // Therefore this is an old style
1093 // format definition without
1095 lexrc.pushToken(flags);
1099 int flgs = Format::none;
1100 while (!flags.empty()) {
1102 flags = split(flags, flag, ',');
1103 if (flag == "document")
1104 flgs |= Format::document;
1105 else if (flag == "vector")
1106 flgs |= Format::vector;
1107 else if (flag == "menu=export")
1108 flgs |= Format::export_menu;
1110 LYXERR0("Ignoring unknown flag `"
1111 << flag << "' for format `"
1114 if (prettyname.empty()) {
1115 if (theConverters().formatIsUsed(format))
1116 LYXERR0("Can't delete format " << format);
1118 formats.erase(format);
1120 formats.add(format, extension, prettyname,
1121 shortcut, viewer, editor, flgs);
1125 case RC_VIEWER_ALTERNATIVES: {
1126 string format, command;
1128 format = lexrc.getString();
1129 if (lexrc.eatLine())
1130 command = lexrc.getString();
1131 viewer_alternatives[format].insert(command);
1134 case RC_EDITOR_ALTERNATIVES: {
1135 string format, command;
1136 lexrc >> format >> command;
1137 editor_alternatives[format].insert(command);
1141 case RC_DEFAULT_VIEW_FORMAT:
1142 lexrc >> default_view_format;
1145 case RC_DEFAULT_LANGUAGE:
1146 lexrc >> default_language;
1149 case RC_GUI_LANGUAGE:
1150 lexrc >> gui_language;
1153 case RC_SHOW_BANNER:
1154 lexrc >> show_banner;
1159 string const tmp = lexrc.getString();
1160 if (tmp == "true" || tmp == "on")
1161 preview = PREVIEW_ON;
1162 else if (tmp == "no_math")
1163 preview = PREVIEW_NO_MATH;
1165 preview = PREVIEW_OFF;
1166 if (tmp != "false" && tmp != "off")
1167 LYXERR0("Unrecognized preview status \""
1173 case RC_PREVIEW_HASHED_LABELS:
1174 lexrc >> preview_hashed_labels;
1177 case RC_PREVIEW_SCALE_FACTOR:
1178 lexrc >> preview_scale_factor;
1185 lexrc >> user_email;
1188 case RC_PATH_PREFIX:
1189 lexrc >> path_prefix;
1192 case RC_USE_CONVERTER_CACHE:
1193 lexrc >> use_converter_cache;
1195 case RC_CONVERTER_CACHE_MAXAGE:
1196 lexrc >> converter_cache_maxage;
1199 case RC_SORT_LAYOUTS:
1200 lexrc >> sort_layouts;
1202 case RC_GROUP_LAYOUTS:
1203 lexrc >> group_layouts;
1205 case RC_FULL_SCREEN_LIMIT:
1206 lexrc >> full_screen_limit;
1208 case RC_FULL_SCREEN_TOOLBARS:
1209 lexrc >> full_screen_toolbars;
1211 case RC_FULL_SCREEN_SCROLLBAR:
1212 lexrc >> full_screen_scrollbar;
1214 case RC_FULL_SCREEN_TABBAR:
1215 lexrc >> full_screen_tabbar;
1217 case RC_FULL_SCREEN_MENUBAR:
1218 lexrc >> full_screen_menubar;
1220 case RC_FULL_SCREEN_WIDTH:
1221 lexrc >> full_screen_width;
1223 case RC_OPEN_BUFFERS_IN_TABS:
1224 lexrc >> open_buffers_in_tabs;
1226 case RC_SINGLE_CLOSE_TAB_BUTTON:
1227 lexrc >> single_close_tab_button;
1229 case RC_SINGLE_INSTANCE:
1230 lexrc >> single_instance;
1231 if (run_mode == PREFERRED)
1232 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1234 case RC_FORWARD_SEARCH_DVI:
1235 if (lexrc.next(true))
1236 forward_search_dvi = lexrc.getString();
1238 case RC_FORWARD_SEARCH_PDF:
1239 if (lexrc.next(true))
1240 forward_search_pdf = lexrc.getString();
1242 case RC_EXPORT_OVERWRITE:
1244 string const tmp = lexrc.getString();
1245 if (tmp == "all" || tmp == "true")
1246 export_overwrite = ALL_FILES;
1247 else if (tmp == "main")
1248 export_overwrite = MAIN_FILE;
1250 export_overwrite = NO_FILES;
1251 if (tmp != "ask" && tmp != "false")
1252 LYXERR0("Unrecognized export_overwrite status \""
1257 case RC_SCROLL_WHEEL_ZOOM:
1259 string const tmp = lexrc.getString();
1261 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1262 else if (tmp == "shift")
1263 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1264 else if (tmp == "alt")
1265 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1267 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1268 if (tmp != "off" && tmp != "false")
1269 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1276 break; // this is just a dummy
1279 // This is triggered the first time through the loop unless
1280 // we hit a format tag.
1281 if (check_format && format != LYXRC_FILEFORMAT)
1282 return FormatMismatch;
1285 /// Update converters data-structures
1286 theConverters().update(formats);
1287 theConverters().buildGraph();
1293 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1295 ofstream ofs(filename.toFilesystemEncoding().c_str());
1297 write(ofs, ignore_system_lyxrc);
1301 void LyXRC::print() const
1303 if (lyxerr.debugging())
1304 write(lyxerr, false);
1312 typedef pair<string, SpecialisedMover> Data;
1314 SameMover(Data const & comparison)
1315 : comparison_(comparison) {}
1317 bool operator()(Data const & data) const
1319 return data.first == comparison_.first &&
1320 data.second.command() == comparison_.second.command();
1330 // Escape \ and " so that LyXLex can read the string later
1331 string escapeCommand(string const & str) {
1332 return subst(subst(str , "\\", "\\\\"),
1339 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1341 LyXRCTags tag = RC_LAST;
1343 if (!name.empty()) {
1344 for (int i = 0; i != lyxrcCount; ++i)
1345 if ("\\" + name == lyxrcTags[i].tag)
1346 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1350 os << "# LyX " << lyx_version
1351 << " generated this file. If you want to make your own\n"
1352 << "# modifications you should do them from inside LyX and save.\n\n"
1353 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1355 // Why the switch you might ask. It is a trick to ensure that all
1356 // the elements in the LyXRCTags enum are handled. As you can see
1357 // there are no breaks at all. So it is just a huge fall-through.
1358 // The nice thing is that we will get a warning from the compiler
1359 // if we forget an element.
1363 // input/include files are not done here
1364 case RC_LYXRCFORMAT:
1366 if (ignore_system_lyxrc ||
1367 bind_file != system_lyxrc.bind_file) {
1368 string const path = os::external_path(bind_file);
1369 os << "\\bind_file \"" << path << "\"\n";
1375 if (ignore_system_lyxrc ||
1376 def_file != system_lyxrc.def_file) {
1377 string const path = os::external_path(def_file);
1378 os << "\\def_file \"" << path << "\"\n";
1387 << "# MISC SECTION ######################################\n"
1389 // bind files are not done here.
1391 case RC_PATH_PREFIX:
1392 if (ignore_system_lyxrc ||
1393 path_prefix != system_lyxrc.path_prefix) {
1394 os << "\\path_prefix \"" << path_prefix << "\"\n";
1399 if (ignore_system_lyxrc ||
1400 ui_file != system_lyxrc.ui_file) {
1401 string const path = os::external_path(ui_file);
1402 os << "\\ui_file \"" << path << "\"\n";
1406 case RC_AUTOREGIONDELETE:
1407 if (ignore_system_lyxrc ||
1408 auto_region_delete != system_lyxrc.auto_region_delete) {
1409 os << "# Set to false to inhibit automatic replacement of\n"
1410 << "# the current selection.\n"
1411 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1416 case RC_AUTORESET_OPTIONS:
1417 if (ignore_system_lyxrc ||
1418 auto_reset_options != system_lyxrc.auto_reset_options) {
1419 os << "# Set to false to inhibit automatic reset of\n"
1420 << "# the class options to defaults on class change.\n"
1421 << "\\auto_reset_options "
1422 << convert<string>(auto_reset_options)
1428 if (ignore_system_lyxrc ||
1429 autosave != system_lyxrc.autosave) {
1430 os << "# The time interval between auto-saves in seconds.\n"
1431 << "\\autosave " << autosave << '\n';
1435 case RC_DISPLAY_GRAPHICS:
1436 if (ignore_system_lyxrc ||
1437 display_graphics != system_lyxrc.display_graphics) {
1438 os << "# Display graphics within LyX\n"
1440 << "\\display_graphics "
1441 << (display_graphics ? "true" : "false")
1446 case RC_SORT_LAYOUTS:
1447 if (ignore_system_lyxrc ||
1448 sort_layouts != system_lyxrc.sort_layouts) {
1449 os << "# Sort layouts alphabetically.\n"
1450 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1454 case RC_GROUP_LAYOUTS:
1455 if (ignore_system_lyxrc ||
1456 group_layouts != system_lyxrc.group_layouts) {
1457 os << "# Group layouts by their category.\n"
1458 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1462 case RC_VIEWDVI_PAPEROPTION:
1463 if (ignore_system_lyxrc ||
1464 view_dvi_paper_option
1465 != system_lyxrc.view_dvi_paper_option) {
1466 os << "# Options used to specify paper size to the\n"
1467 << "# view_dvi_command (e.g. -paper)\n"
1468 << "\\view_dvi_paper_option \""
1469 << view_dvi_paper_option << "\"\n";
1473 case RC_DEFAULT_PAPERSIZE:
1474 if (ignore_system_lyxrc ||
1475 default_papersize != system_lyxrc.default_papersize) {
1476 os << "# The default papersize to use.\n"
1477 << "\\default_papersize \"";
1478 switch (default_papersize) {
1480 os << "default"; break;
1481 case PAPER_USLETTER:
1482 os << "usletter"; break;
1484 os << "legal"; break;
1485 case PAPER_USEXECUTIVE:
1486 os << "executive"; break;
1519 case PAPER_JISB6: break;
1525 case RC_CHKTEX_COMMAND:
1526 if (ignore_system_lyxrc ||
1527 chktex_command != system_lyxrc.chktex_command) {
1528 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1532 case RC_BIBTEX_ALTERNATIVES: {
1533 CommandSet::const_iterator it = bibtex_alternatives.begin();
1534 CommandSet::const_iterator end = bibtex_alternatives.end();
1535 for ( ; it != end; ++it) {
1536 if (ignore_system_lyxrc
1537 || !system_lyxrc.bibtex_alternatives.count(*it))
1538 os << "\\bibtex_alternatives \""
1544 case RC_BIBTEX_COMMAND:
1545 if (ignore_system_lyxrc ||
1546 bibtex_command != system_lyxrc.bibtex_command) {
1547 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1551 case RC_JBIBTEX_COMMAND:
1552 if (ignore_system_lyxrc ||
1553 jbibtex_command != system_lyxrc.jbibtex_command) {
1554 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1558 case RC_INDEX_ALTERNATIVES: {
1559 CommandSet::const_iterator it = index_alternatives.begin();
1560 CommandSet::const_iterator end = index_alternatives.end();
1561 for ( ; it != end; ++it) {
1562 if (ignore_system_lyxrc
1563 || !system_lyxrc.index_alternatives.count(*it))
1564 os << "\\index_alternatives \""
1570 case RC_INDEX_COMMAND:
1571 if (ignore_system_lyxrc ||
1572 index_command != system_lyxrc.index_command) {
1573 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1577 case RC_JINDEX_COMMAND:
1578 if (ignore_system_lyxrc ||
1579 jindex_command != system_lyxrc.jindex_command) {
1580 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1584 case RC_SPLITINDEX_COMMAND:
1585 if (ignore_system_lyxrc ||
1586 splitindex_command != system_lyxrc.splitindex_command) {
1587 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1591 case RC_NOMENCL_COMMAND:
1592 if (ignore_system_lyxrc ||
1593 nomencl_command != system_lyxrc.nomencl_command) {
1594 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1598 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1599 if (ignore_system_lyxrc ||
1600 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1601 os << "\\tex_expects_windows_paths "
1602 << convert<string>(windows_style_tex_paths) << '\n';
1606 case RC_TEX_ALLOWS_SPACES:
1607 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1608 os << "\\tex_allows_spaces "
1609 << convert<string>(tex_allows_spaces) << '\n';
1614 if (ignore_system_lyxrc ||
1615 use_kbmap != system_lyxrc.use_kbmap) {
1616 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1620 case RC_KBMAP_PRIMARY:
1621 if (ignore_system_lyxrc ||
1622 primary_kbmap != system_lyxrc.primary_kbmap) {
1623 string const path = os::external_path(primary_kbmap);
1624 os << "\\kbmap_primary \"" << path << "\"\n";
1628 case RC_KBMAP_SECONDARY:
1629 if (ignore_system_lyxrc ||
1630 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1631 string const path = os::external_path(secondary_kbmap);
1632 os << "\\kbmap_secondary \"" << path << "\"\n";
1637 if (ignore_system_lyxrc ||
1638 lyxpipes != system_lyxrc.lyxpipes) {
1639 string const path = os::external_path(lyxpipes);
1640 os << "\\serverpipe \"" << path << "\"\n";
1644 case RC_DATE_INSERT_FORMAT:
1645 if (ignore_system_lyxrc ||
1646 date_insert_format != system_lyxrc.date_insert_format) {
1647 os << "\\date_insert_format \"" << date_insert_format
1654 os << "\\user_name \"" << user_name << "\"\n";
1659 os << "\\user_email \"" << user_email << "\"\n";
1663 case RC_SHOW_BANNER:
1664 if (ignore_system_lyxrc ||
1665 show_banner != system_lyxrc.show_banner) {
1666 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1672 if (ignore_system_lyxrc ||
1673 preview != system_lyxrc.preview) {
1679 case PREVIEW_NO_MATH:
1686 os << "\\preview " << status << '\n';
1691 case RC_PREVIEW_HASHED_LABELS:
1692 if (ignore_system_lyxrc ||
1693 preview_hashed_labels !=
1694 system_lyxrc.preview_hashed_labels) {
1695 os << "\\preview_hashed_labels "
1696 << convert<string>(preview_hashed_labels) << '\n';
1701 case RC_PREVIEW_SCALE_FACTOR:
1702 if (ignore_system_lyxrc ||
1703 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1704 os << "\\preview_scale_factor "
1705 << preview_scale_factor << '\n';
1710 case RC_USE_CONVERTER_CACHE:
1711 if (ignore_system_lyxrc ||
1712 use_converter_cache != system_lyxrc.use_converter_cache) {
1713 os << "\\use_converter_cache "
1714 << convert<string>(use_converter_cache) << '\n';
1719 case RC_CONVERTER_CACHE_MAXAGE:
1720 if (ignore_system_lyxrc ||
1721 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1722 os << "\\converter_cache_maxage "
1723 << converter_cache_maxage << '\n';
1729 << "# SCREEN & FONTS SECTION ############################\n"
1733 if (ignore_system_lyxrc ||
1734 dpi != system_lyxrc.dpi) {
1735 os << "\\screen_dpi " << dpi << '\n';
1739 case RC_SCREEN_ZOOM:
1740 if (ignore_system_lyxrc ||
1741 zoom != system_lyxrc.zoom) {
1742 os << "\\screen_zoom " << zoom << '\n';
1746 case RC_GEOMETRY_SESSION:
1747 if (ignore_system_lyxrc ||
1748 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1749 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1754 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1755 if (ignore_system_lyxrc ||
1756 cursor_follows_scrollbar
1757 != system_lyxrc.cursor_follows_scrollbar) {
1758 os << "\\cursor_follows_scrollbar "
1759 << convert<string>(cursor_follows_scrollbar) << '\n';
1763 case RC_CURSOR_WIDTH:
1764 if (ignore_system_lyxrc ||
1766 != system_lyxrc.cursor_width) {
1767 os << "\\cursor_width "
1768 << cursor_width << '\n';
1772 case RC_SCROLL_BELOW_DOCUMENT:
1773 if (ignore_system_lyxrc ||
1774 scroll_below_document
1775 != system_lyxrc.scroll_below_document) {
1776 os << "\\scroll_below_document "
1777 << convert<string>(scroll_below_document) << '\n';
1781 case RC_PARAGRAPH_MARKERS:
1782 if (ignore_system_lyxrc ||
1784 != system_lyxrc.paragraph_markers) {
1785 os << "\\paragraph_markers "
1786 << convert<string>(paragraph_markers) << '\n';
1790 case RC_MAC_DONTSWAP_CTRL_META:
1791 if (ignore_system_lyxrc ||
1792 mac_dontswap_ctrl_meta
1793 != system_lyxrc.mac_dontswap_ctrl_meta) {
1794 os << "\\mac_dontswap_ctrl_meta "
1795 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1799 case RC_MAC_LIKE_WORD_MOVEMENT:
1800 if (ignore_system_lyxrc ||
1801 mac_like_word_movement
1802 != system_lyxrc.mac_like_word_movement) {
1803 os << "\\mac_like_word_movement "
1804 << convert<string>(mac_like_word_movement) << '\n';
1808 case RC_MACRO_EDIT_STYLE:
1809 if (ignore_system_lyxrc ||
1811 != system_lyxrc.macro_edit_style) {
1812 os << "\\macro_edit_style ";
1813 switch (macro_edit_style) {
1814 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1815 case MACRO_EDIT_INLINE: os << "1\n"; break;
1816 case MACRO_EDIT_LIST: os << "2\n"; break;
1821 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1822 if (ignore_system_lyxrc ||
1823 dialogs_iconify_with_main
1824 != system_lyxrc.dialogs_iconify_with_main) {
1825 os << "\\dialogs_iconify_with_main "
1826 << convert<string>(dialogs_iconify_with_main) << '\n';
1830 case RC_SCREEN_FONT_ROMAN:
1831 if (ignore_system_lyxrc ||
1832 roman_font_name != system_lyxrc.roman_font_name) {
1833 os << "\\screen_font_roman \"" << roman_font_name
1838 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1839 if (ignore_system_lyxrc ||
1840 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1841 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1846 case RC_SCREEN_FONT_SANS:
1847 if (ignore_system_lyxrc ||
1848 sans_font_name != system_lyxrc.sans_font_name) {
1849 os << "\\screen_font_sans \"" << sans_font_name
1854 case RC_SCREEN_FONT_SANS_FOUNDRY:
1855 if (ignore_system_lyxrc ||
1856 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1857 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1862 case RC_SCREEN_FONT_TYPEWRITER:
1863 if (ignore_system_lyxrc ||
1864 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1865 os << "\\screen_font_typewriter \""
1866 << typewriter_font_name << "\"\n";
1870 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1871 if (ignore_system_lyxrc ||
1872 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1873 os << "\\screen_font_typewriter_foundry \""
1874 << typewriter_font_foundry << "\"\n";
1879 case RC_SCREEN_FONT_SCALABLE:
1880 if (ignore_system_lyxrc ||
1881 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1882 os << "\\screen_font_scalable "
1883 << convert<string>(use_scalable_fonts)
1888 case RC_SCREEN_FONT_SIZES:
1889 if (ignore_system_lyxrc ||
1890 font_sizes[FONT_SIZE_TINY]
1891 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1892 font_sizes[FONT_SIZE_SCRIPT]
1893 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1894 font_sizes[FONT_SIZE_FOOTNOTE]
1895 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1896 font_sizes[FONT_SIZE_SMALL]
1897 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1898 font_sizes[FONT_SIZE_NORMAL]
1899 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1900 font_sizes[FONT_SIZE_LARGE]
1901 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1902 font_sizes[FONT_SIZE_LARGER]
1903 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1904 font_sizes[FONT_SIZE_LARGEST]
1905 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1906 font_sizes[FONT_SIZE_HUGE]
1907 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1908 font_sizes[FONT_SIZE_HUGER]
1909 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1910 os.setf(ios::fixed);
1912 os << "\\screen_font_sizes"
1913 << ' ' << font_sizes[FONT_SIZE_TINY]
1914 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1915 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1916 << ' ' << font_sizes[FONT_SIZE_SMALL]
1917 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1918 << ' ' << font_sizes[FONT_SIZE_LARGE]
1919 << ' ' << font_sizes[FONT_SIZE_LARGER]
1920 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1921 << ' ' << font_sizes[FONT_SIZE_HUGE]
1922 << ' ' << font_sizes[FONT_SIZE_HUGER]
1927 case RC_FULL_SCREEN_LIMIT:
1928 if (ignore_system_lyxrc ||
1929 full_screen_limit != system_lyxrc.full_screen_limit) {
1930 os << "\\fullscreen_limit "
1931 << convert<string>(full_screen_limit)
1936 case RC_FULL_SCREEN_TOOLBARS:
1937 if (ignore_system_lyxrc ||
1938 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1939 os << "\\fullscreen_toolbars "
1940 << convert<string>(full_screen_toolbars)
1945 case RC_FULL_SCREEN_SCROLLBAR:
1946 if (ignore_system_lyxrc ||
1947 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1948 os << "\\fullscreen_scrollbar "
1949 << convert<string>(full_screen_scrollbar)
1954 case RC_FULL_SCREEN_TABBAR:
1955 if (ignore_system_lyxrc ||
1956 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1957 os << "\\fullscreen_tabbar "
1958 << convert<string>(full_screen_tabbar)
1963 case RC_FULL_SCREEN_MENUBAR:
1964 if (ignore_system_lyxrc ||
1965 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1966 os << "\\fullscreen_menubar "
1967 << convert<string>(full_screen_menubar)
1972 case RC_FULL_SCREEN_WIDTH:
1973 if (ignore_system_lyxrc ||
1974 full_screen_width != system_lyxrc.full_screen_width) {
1975 os << "\\fullscreen_width "
1976 << convert<string>(full_screen_width)
1981 case RC_OPEN_BUFFERS_IN_TABS:
1982 if (ignore_system_lyxrc ||
1983 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1984 os << "\\open_buffers_in_tabs "
1985 << convert<string>(open_buffers_in_tabs)
1990 case RC_SINGLE_CLOSE_TAB_BUTTON:
1991 if (ignore_system_lyxrc ||
1992 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1993 os << "\\single_close_tab_button "
1994 << convert<string>(single_close_tab_button)
1999 case RC_SINGLE_INSTANCE:
2000 if (ignore_system_lyxrc ||
2001 single_instance != system_lyxrc.single_instance) {
2002 os << "\\single_instance "
2003 << convert<string>(single_instance)
2008 case RC_FORWARD_SEARCH_DVI:
2009 if (ignore_system_lyxrc ||
2010 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2011 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2015 case RC_FORWARD_SEARCH_PDF:
2016 if (ignore_system_lyxrc ||
2017 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2018 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2024 << "# COLOR SECTION ###################################\n"
2028 for (int i = 0; i < Color_ignore; ++i) {
2029 ColorCode lc = static_cast<ColorCode>(i);
2030 string const col = lcolor.getX11Name(lc);
2031 if (ignore_system_lyxrc
2032 || col != system_lcolor.getX11Name(lc)) {
2033 os << "\\set_color \""
2034 << lcolor.getLyXName(lc) << "\" \""
2042 << "# PRINTER SECTION ###################################\n"
2046 if (ignore_system_lyxrc ||
2047 printer != system_lyxrc.printer) {
2048 os << "\\printer \"" << printer << "\"\n";
2052 case RC_PRINT_ADAPTOUTPUT:
2053 if (ignore_system_lyxrc ||
2054 print_adapt_output != system_lyxrc.print_adapt_output) {
2055 os << "\\print_adapt_output "
2056 << convert<string>(print_adapt_output)
2061 case RC_PRINT_COMMAND:
2062 if (ignore_system_lyxrc ||
2063 print_command != system_lyxrc.print_command) {
2064 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2068 case RC_PRINTEXSTRAOPTIONS:
2069 if (ignore_system_lyxrc ||
2070 print_extra_options != system_lyxrc.print_extra_options) {
2071 os << "\\print_extra_options \"" << print_extra_options
2076 case RC_PRINTSPOOL_COMMAND:
2077 if (ignore_system_lyxrc ||
2078 print_spool_command != system_lyxrc.print_spool_command) {
2079 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2084 case RC_PRINTSPOOL_PRINTERPREFIX:
2085 if (ignore_system_lyxrc ||
2086 print_spool_printerprefix
2087 != system_lyxrc.print_spool_printerprefix) {
2088 os << "\\print_spool_printerprefix \""
2089 << print_spool_printerprefix << "\"\n";
2093 case RC_PRINTEVENPAGEFLAG:
2094 if (ignore_system_lyxrc ||
2095 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2096 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2101 case RC_PRINTODDPAGEFLAG:
2102 if (ignore_system_lyxrc ||
2103 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2104 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2109 case RC_PRINTREVERSEFLAG:
2110 if (ignore_system_lyxrc ||
2111 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2112 os << "\\print_reverse_flag \"" << print_reverse_flag
2117 case RC_PRINTLANDSCAPEFLAG:
2118 if (ignore_system_lyxrc ||
2119 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2120 os << "\\print_landscape_flag \"" << print_landscape_flag
2125 case RC_PRINTPAGERANGEFLAG:
2126 if (ignore_system_lyxrc ||
2127 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2128 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2133 case RC_PRINTCOPIESFLAG:
2134 if (ignore_system_lyxrc ||
2135 print_copies_flag != system_lyxrc.print_copies_flag) {
2136 os << "\\print_copies_flag \"" << print_copies_flag
2141 case RC_PRINTCOLLCOPIESFLAG:
2142 if (ignore_system_lyxrc ||
2143 print_collcopies_flag
2144 != system_lyxrc.print_collcopies_flag) {
2145 os << "\\print_collcopies_flag \""
2146 << print_collcopies_flag
2151 case RC_PRINTPAPERFLAG:
2152 if (ignore_system_lyxrc ||
2153 print_paper_flag != system_lyxrc.print_paper_flag) {
2154 os << "\\print_paper_flag \"" << print_paper_flag
2159 case RC_PRINTPAPERDIMENSIONFLAG:
2160 if (ignore_system_lyxrc ||
2161 print_paper_dimension_flag
2162 != system_lyxrc.print_paper_dimension_flag) {
2163 os << "\\print_paper_dimension_flag \""
2164 << print_paper_dimension_flag << "\"\n";
2168 case RC_PRINTTOPRINTER:
2169 if (ignore_system_lyxrc ||
2170 print_to_printer != system_lyxrc.print_to_printer) {
2171 os << "\\print_to_printer \"" << print_to_printer
2176 case RC_PRINTTOFILE:
2177 if (ignore_system_lyxrc ||
2178 print_to_file != system_lyxrc.print_to_file) {
2179 string const path = os::external_path(print_to_file);
2180 os << "\\print_to_file \"" << path << "\"\n";
2184 case RC_PRINTFILEEXTENSION:
2185 if (ignore_system_lyxrc ||
2186 print_file_extension != system_lyxrc.print_file_extension) {
2187 os << "\\print_file_extension \""
2188 << print_file_extension
2195 << "# TEX SECTION #######################################\n"
2198 case RC_FONT_ENCODING:
2199 if (ignore_system_lyxrc ||
2200 fontenc != system_lyxrc.fontenc) {
2201 os << "\\font_encoding \"" << fontenc << "\"\n";
2206 case RC_FORCE_PAINT_SINGLE_CHAR:
2207 if (ignore_system_lyxrc ||
2208 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2209 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2215 << "# FILE SECTION ######################################\n"
2218 case RC_DOCUMENTPATH:
2219 if (ignore_system_lyxrc ||
2220 document_path != system_lyxrc.document_path) {
2221 string const path = os::external_path(document_path);
2222 os << "\\document_path \"" << path << "\"\n";
2226 case RC_USELASTFILEPOS:
2227 if (ignore_system_lyxrc ||
2228 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2229 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2234 case RC_LOADSESSION:
2235 if (ignore_system_lyxrc ||
2236 load_session != system_lyxrc.load_session) {
2237 os << "\\load_session " << convert<string>(load_session)
2242 case RC_MOUSE_WHEEL_SPEED:
2243 if (ignore_system_lyxrc ||
2244 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2245 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2249 case RC_COMPLETION_INLINE_DELAY:
2250 if (ignore_system_lyxrc ||
2251 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2252 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2256 case RC_COMPLETION_INLINE_MATH:
2257 if (ignore_system_lyxrc ||
2258 completion_inline_math != system_lyxrc.completion_inline_math) {
2259 os << "\\completion_inline_math "
2260 << convert<string>(completion_inline_math) << '\n';
2264 case RC_COMPLETION_INLINE_TEXT:
2265 if (ignore_system_lyxrc ||
2266 completion_inline_text != system_lyxrc.completion_inline_text) {
2267 os << "\\completion_inline_text "
2268 << convert<string>(completion_inline_text) << '\n';
2272 case RC_COMPLETION_INLINE_DOTS:
2273 if (ignore_system_lyxrc ||
2274 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2275 os << "\\completion_inline_dots "
2276 << convert<string>(completion_inline_dots) << '\n';
2280 case RC_AUTOCORRECTION_MATH:
2281 if (ignore_system_lyxrc ||
2282 autocorrection_math != system_lyxrc.autocorrection_math) {
2283 os << "\\autocorrection_math "
2284 << convert<string>(autocorrection_math) << '\n';
2288 case RC_COMPLETION_POPUP_DELAY:
2289 if (ignore_system_lyxrc ||
2290 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2291 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2295 case RC_COMPLETION_POPUP_MATH:
2296 if (ignore_system_lyxrc ||
2297 completion_popup_math != system_lyxrc.completion_popup_math) {
2298 os << "\\completion_popup_math "
2299 << convert<string>(completion_popup_math) << '\n';
2303 case RC_COMPLETION_POPUP_TEXT:
2304 if (ignore_system_lyxrc ||
2305 completion_popup_text != system_lyxrc.completion_popup_text) {
2306 os << "\\completion_popup_text "
2307 << convert<string>(completion_popup_text) << '\n';
2311 case RC_COMPLETION_CURSOR_TEXT:
2312 if (ignore_system_lyxrc ||
2313 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2314 os << "\\completion_cursor_text "
2315 << convert<string>(completion_cursor_text) << '\n';
2319 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2320 if (ignore_system_lyxrc ||
2321 completion_popup_after_complete
2322 != system_lyxrc.completion_popup_after_complete) {
2323 os << "\\completion_popup_after_complete "
2324 << convert<string>(completion_popup_after_complete) << '\n';
2328 case RC_NUMLASTFILES:
2329 if (ignore_system_lyxrc ||
2330 num_lastfiles != system_lyxrc.num_lastfiles) {
2331 os << "\\num_lastfiles " << num_lastfiles << '\n';
2335 case RC_CHECKLASTFILES:
2336 if (ignore_system_lyxrc ||
2337 check_lastfiles != system_lyxrc.check_lastfiles) {
2338 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2343 case RC_EXAMPLEPATH:
2344 if (ignore_system_lyxrc ||
2345 example_path != system_lyxrc.example_path) {
2346 string const path = os::external_path(example_path);
2347 os << "\\example_path \"" << path << "\"\n";
2351 case RC_TEMPLATEPATH:
2352 if (ignore_system_lyxrc ||
2353 template_path != system_lyxrc.template_path) {
2354 string const path = os::external_path(template_path);
2355 os << "\\template_path \"" << path << "\"\n";
2359 case RC_TEMPDIRPATH:
2360 if (ignore_system_lyxrc ||
2361 tempdir_path != system_lyxrc.tempdir_path) {
2362 string const path = os::external_path(tempdir_path);
2363 os << "\\tempdir_path \"" << path << "\"\n";
2367 case RC_THESAURUSDIRPATH:
2368 if (ignore_system_lyxrc ||
2369 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2370 string const path = os::external_path(thesaurusdir_path);
2371 os << "\\thesaurusdir_path \"" << path << "\"\n";
2375 case RC_HUNSPELLDIR_PATH:
2376 if (ignore_system_lyxrc ||
2377 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2378 string const path = os::external_path(hunspelldir_path);
2379 os << "\\hunspelldir_path \"" << path << "\"\n";
2383 case RC_PLAINTEXT_LINELEN:
2384 if (ignore_system_lyxrc ||
2385 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2386 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2390 case RC_MAKE_BACKUP:
2391 if (ignore_system_lyxrc ||
2392 make_backup != system_lyxrc.make_backup) {
2393 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2397 case RC_SAVE_COMPRESSED:
2398 if (ignore_system_lyxrc ||
2399 save_compressed != system_lyxrc.save_compressed) {
2400 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2404 case RC_BACKUPDIR_PATH:
2405 if (ignore_system_lyxrc ||
2406 backupdir_path != system_lyxrc.backupdir_path) {
2407 string const path = os::external_path(backupdir_path);
2408 os << "\\backupdir_path \"" << path << "\"\n";
2414 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2418 << "# SPELLCHECKER SECTION ##############################\n"
2421 case RC_ACCEPT_COMPOUND:
2422 if (ignore_system_lyxrc ||
2423 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2424 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2430 if (ignore_system_lyxrc ||
2431 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2432 os << "\\alternate_language \"" << spellchecker_alt_lang
2438 if (ignore_system_lyxrc ||
2439 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2440 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2444 case RC_USE_SYSTEM_COLORS:
2445 if (ignore_system_lyxrc ||
2446 use_system_colors != system_lyxrc.use_system_colors) {
2447 os << "\\use_system_colors "
2448 << convert<string>(use_system_colors)
2453 case RC_USE_TOOLTIP:
2454 if (ignore_system_lyxrc ||
2455 use_tooltip != system_lyxrc.use_tooltip) {
2456 os << "\\use_tooltip "
2457 << convert<string>(use_tooltip)
2462 case RC_USE_PIXMAP_CACHE:
2463 if (ignore_system_lyxrc ||
2464 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2465 os << "\\use_pixmap_cache "
2466 << convert<string>(use_pixmap_cache)
2473 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2478 case RC_DEFAULT_DECIMAL_POINT:
2479 if (ignore_system_lyxrc ||
2480 default_decimal_point != system_lyxrc.default_decimal_point) {
2481 os << "\\default_decimal_point " << default_decimal_point << '\n';
2486 case RC_SPELLCHECKER:
2487 if (ignore_system_lyxrc ||
2488 spellchecker != system_lyxrc.spellchecker) {
2489 os << "\\spellchecker " << spellchecker << '\n';
2494 case RC_SPELLCHECK_CONTINUOUSLY:
2495 if (ignore_system_lyxrc ||
2496 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2497 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2503 case RC_SPELLCHECK_NOTES:
2504 if (ignore_system_lyxrc ||
2505 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2506 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2512 case RC_RTL_SUPPORT:
2513 if (ignore_system_lyxrc ||
2514 rtl_support != system_lyxrc.rtl_support) {
2515 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2519 case RC_VISUAL_CURSOR:
2520 if (ignore_system_lyxrc ||
2521 visual_cursor != system_lyxrc.visual_cursor) {
2522 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2526 case RC_LANGUAGE_CUSTOM_PACKAGE:
2527 if (ignore_system_lyxrc ||
2528 language_custom_package != system_lyxrc.language_custom_package) {
2529 os << "\\language_custom_package \"" << language_custom_package
2534 case RC_LANGUAGE_GLOBAL_OPTIONS:
2535 if (ignore_system_lyxrc ||
2536 language_global_options
2537 != system_lyxrc.language_global_options) {
2538 os << "\\language_global_options \""
2539 << convert<string>(language_global_options)
2544 case RC_LANGUAGE_PACKAGE_SELECTION:
2545 if (ignore_system_lyxrc ||
2546 language_package_selection != system_lyxrc.language_package_selection) {
2547 os << "\\language_package_selection ";
2548 switch (language_package_selection) {
2565 case RC_LANGUAGE_COMMAND_BEGIN:
2566 if (ignore_system_lyxrc ||
2567 language_command_begin
2568 != system_lyxrc.language_command_begin) {
2569 os << "\\language_command_begin \""
2570 << language_command_begin
2575 case RC_LANGUAGE_COMMAND_END:
2576 if (ignore_system_lyxrc ||
2577 language_command_end
2578 != system_lyxrc.language_command_end) {
2579 os << "\\language_command_end \"" << language_command_end
2584 case RC_LANGUAGE_COMMAND_LOCAL:
2585 if (ignore_system_lyxrc ||
2586 language_command_local
2587 != system_lyxrc.language_command_local) {
2588 os << "\\language_command_local \""
2589 << language_command_local
2594 case RC_LANGUAGE_AUTO_BEGIN:
2595 if (ignore_system_lyxrc ||
2596 language_auto_begin != system_lyxrc.language_auto_begin) {
2597 os << "\\language_auto_begin "
2598 << convert<string>(language_auto_begin) << '\n';
2602 case RC_LANGUAGE_AUTO_END:
2603 if (ignore_system_lyxrc ||
2604 language_auto_end != system_lyxrc.language_auto_end) {
2605 os << "\\language_auto_end "
2606 << convert<string>(language_auto_end) << '\n';
2610 case RC_MARK_FOREIGN_LANGUAGE:
2611 if (ignore_system_lyxrc ||
2612 mark_foreign_language
2613 != system_lyxrc.mark_foreign_language) {
2614 os << "\\mark_foreign_language " <<
2615 convert<string>(mark_foreign_language) << '\n';
2621 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2624 case RC_AUTO_NUMBER:
2625 if (ignore_system_lyxrc ||
2626 auto_number != system_lyxrc.auto_number) {
2627 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2631 case RC_DEFAULT_LANGUAGE:
2632 if (ignore_system_lyxrc ||
2633 default_language != system_lyxrc.default_language) {
2634 os << "\\default_language " << default_language << '\n';
2638 case RC_GUI_LANGUAGE:
2639 if (ignore_system_lyxrc ||
2640 gui_language != system_lyxrc.gui_language) {
2641 os << "\\gui_language " << gui_language << '\n';
2645 case RC_EXPORT_OVERWRITE:
2646 if (ignore_system_lyxrc ||
2647 export_overwrite != system_lyxrc.export_overwrite) {
2649 switch (export_overwrite) {
2660 os << "\\export_overwrite " << status << '\n';
2665 case RC_SCROLL_WHEEL_ZOOM:
2666 if (ignore_system_lyxrc ||
2667 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2669 switch (scroll_wheel_zoom) {
2670 case SCROLL_WHEEL_ZOOM_OFF:
2673 case SCROLL_WHEEL_ZOOM_CTRL:
2676 case SCROLL_WHEEL_ZOOM_SHIFT:
2679 case SCROLL_WHEEL_ZOOM_ALT:
2683 os << "\\scroll_wheel_zoom " << status << '\n';
2689 << "# FORMATS SECTION ##########################\n"
2693 // New/modified formats
2694 for (Formats::const_iterator cit = formats.begin();
2695 cit != formats.end(); ++cit) {
2696 Format const * format =
2697 system_formats.getFormat(cit->name());
2699 format->extension() != cit->extension() ||
2700 format->prettyname() != cit->prettyname() ||
2701 format->shortcut() != cit->shortcut() ||
2702 format->viewer() != cit->viewer() ||
2703 format->editor() != cit->editor() ||
2704 format->documentFormat() != cit->documentFormat() ||
2705 format->vectorFormat() != cit->vectorFormat() ||
2706 format->inExportMenu() != cit->inExportMenu()) {
2707 os << "\\format \"" << cit->name() << "\" \""
2708 << cit->extension() << "\" \""
2709 << cit->prettyname() << "\" \""
2710 << cit->shortcut() << "\" \""
2711 << escapeCommand(cit->viewer()) << "\" \""
2712 << escapeCommand(cit->editor()) << "\" \"";
2713 vector<string> flags;
2714 if (cit->documentFormat())
2715 flags.push_back("document");
2716 if (cit->vectorFormat())
2717 flags.push_back("vector");
2718 if (cit->inExportMenu())
2719 flags.push_back("menu=export");
2721 os << getStringFromVector(flags);
2726 // Look for deleted formats
2727 for (Formats::const_iterator cit = system_formats.begin();
2728 cit != system_formats.end(); ++cit)
2729 if (!formats.getFormat(cit->name()))
2730 os << "\\format \"" << cit->name()
2731 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2734 case RC_VIEWER_ALTERNATIVES: {
2735 Alternatives::const_iterator it = viewer_alternatives.begin();
2736 Alternatives::const_iterator const en = viewer_alternatives.end();
2737 Alternatives::const_iterator const sysend =
2738 system_lyxrc.viewer_alternatives.end();
2739 for (; it != en; ++it) {
2740 string const & fmt = it->first;
2741 CommandSet const & cmd = it->second;
2742 CommandSet::const_iterator sit = cmd.begin();
2743 CommandSet::const_iterator const sen = cmd.end();
2744 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2745 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2746 system_lyxrc.viewer_alternatives.find(fmt);
2747 for (; sit != sen; ++sit) {
2748 string const & cmd = *sit;
2749 if (ignore_system_lyxrc
2750 || sysfmt == sysend // format not found
2751 || sysfmt->second.count(cmd) == 0 // this command not found
2753 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2759 case RC_EDITOR_ALTERNATIVES: {
2760 Alternatives::const_iterator it = editor_alternatives.begin();
2761 Alternatives::const_iterator const en = editor_alternatives.end();
2762 Alternatives::const_iterator const sysend =
2763 system_lyxrc.editor_alternatives.end();
2764 for (; it != en; ++it) {
2765 string const & fmt = it->first;
2766 CommandSet const & cmd = it->second;
2767 CommandSet::const_iterator sit = cmd.begin();
2768 CommandSet::const_iterator const sen = cmd.end();
2769 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2770 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2771 system_lyxrc.editor_alternatives.find(fmt);
2772 for (; sit != sen; ++sit) {
2773 string const & cmd = *sit;
2774 if (ignore_system_lyxrc
2775 || sysfmt == sysend // format not found
2776 || sysfmt->second.count(cmd) == 0 // this command not found
2778 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2784 case RC_DEFAULT_VIEW_FORMAT:
2785 if (ignore_system_lyxrc ||
2786 default_view_format != system_lyxrc.default_view_format) {
2787 os << "\\default_view_format " << default_view_format << '\n';
2797 << "# CONVERTERS SECTION ##########################\n"
2801 // Look for new converters
2802 for (Converters::const_iterator cit = theConverters().begin();
2803 cit != theConverters().end(); ++cit) {
2804 Converter const * converter =
2805 theSystemConverters().getConverter(cit->from,
2808 converter->command != cit->command ||
2809 converter->flags != cit->flags)
2810 os << "\\converter \"" << cit->from << "\" \""
2811 << cit->to << "\" \""
2812 << escapeCommand(cit->command) << "\" \""
2813 << cit->flags << "\"\n";
2816 // New/modifed converters
2817 for (Converters::const_iterator cit = theSystemConverters().begin();
2818 cit != theSystemConverters().end(); ++cit)
2819 if (!theConverters().getConverter(cit->from, cit->to))
2820 os << "\\converter \"" << cit->from
2821 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2828 << "# COPIERS SECTION ##########################\n"
2831 // Look for new movers
2832 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2833 Movers::const_iterator const sysend = theSystemMovers().end();
2834 Movers::const_iterator it = theMovers().begin();
2835 Movers::const_iterator end = theMovers().end();
2837 for (; it != end; ++it) {
2838 Movers::const_iterator const sysit =
2839 find_if(sysbegin, sysend, SameMover(*it));
2840 if (sysit == sysend) {
2841 string const & fmt = it->first;
2842 string const & command =
2843 it->second.command();
2845 os << "\\copier " << fmt
2846 << " \"" << escapeCommand(command) << "\"\n";
2852 // We don't actually delete SpecialisedMover(s) from the
2853 // map, just clear their 'command', so there's no need
2854 // to test for anything else.
2861 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2863 // Why the switch you might ask. It is a trick to ensure that all
2864 // the elements in the LyXRCTags enum is handled. As you can see
2865 // there are no breaks at all. So it is just a huge fall-through.
2866 // The nice thing is that we will get a warning from the compiler
2867 // if we forget an element.
2868 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2870 case LyXRC::RC_ACCEPT_COMPOUND:
2871 case LyXRC::RC_ALT_LANG:
2872 case LyXRC::RC_PLAINTEXT_LINELEN:
2873 case LyXRC::RC_AUTOCORRECTION_MATH:
2874 case LyXRC::RC_AUTOREGIONDELETE:
2875 case LyXRC::RC_AUTORESET_OPTIONS:
2876 case LyXRC::RC_AUTOSAVE:
2877 case LyXRC::RC_AUTO_NUMBER:
2878 case LyXRC::RC_BACKUPDIR_PATH:
2879 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2880 case LyXRC::RC_BIBTEX_COMMAND:
2881 case LyXRC::RC_BINDFILE:
2882 case LyXRC::RC_CHECKLASTFILES:
2883 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2884 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2885 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2886 case LyXRC::RC_COMPLETION_INLINE_MATH:
2887 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2888 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2889 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2890 case LyXRC::RC_COMPLETION_POPUP_MATH:
2891 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2892 case LyXRC::RC_USELASTFILEPOS:
2893 case LyXRC::RC_LOADSESSION:
2894 case LyXRC::RC_CHKTEX_COMMAND:
2895 case LyXRC::RC_CONVERTER:
2896 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2897 case LyXRC::RC_COPIER:
2898 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2899 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2900 case LyXRC::RC_DATE_INSERT_FORMAT:
2901 case LyXRC::RC_DEFAULT_LANGUAGE:
2902 case LyXRC::RC_GUI_LANGUAGE:
2903 case LyXRC::RC_DEFAULT_PAPERSIZE:
2904 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2905 case LyXRC::RC_DEFFILE:
2906 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2907 case LyXRC::RC_DISPLAY_GRAPHICS:
2908 case LyXRC::RC_DOCUMENTPATH:
2909 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2910 FileName path(lyxrc_new.document_path);
2911 if (path.exists() && path.isDirectory())
2912 package().document_dir() = FileName(lyxrc.document_path);
2914 case LyXRC::RC_EDITOR_ALTERNATIVES:
2915 case LyXRC::RC_ESC_CHARS:
2916 case LyXRC::RC_EXAMPLEPATH:
2917 case LyXRC::RC_FONT_ENCODING:
2918 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2919 case LyXRC::RC_FILEFORMAT:
2920 case LyXRC::RC_GROUP_LAYOUTS:
2921 case LyXRC::RC_HUNSPELLDIR_PATH:
2922 case LyXRC::RC_INDEX_ALTERNATIVES:
2923 case LyXRC::RC_INDEX_COMMAND:
2924 case LyXRC::RC_JBIBTEX_COMMAND:
2925 case LyXRC::RC_JINDEX_COMMAND:
2926 case LyXRC::RC_NOMENCL_COMMAND:
2927 case LyXRC::RC_INPUT:
2928 case LyXRC::RC_KBMAP:
2929 case LyXRC::RC_KBMAP_PRIMARY:
2930 case LyXRC::RC_KBMAP_SECONDARY:
2931 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2932 case LyXRC::RC_LANGUAGE_AUTO_END:
2933 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2934 case LyXRC::RC_LANGUAGE_COMMAND_END:
2935 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2936 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2937 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2938 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2939 case LyXRC::RC_LYXRCFORMAT:
2940 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2941 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2942 case LyXRC::RC_MACRO_EDIT_STYLE:
2943 case LyXRC::RC_MAKE_BACKUP:
2944 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2945 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2946 case LyXRC::RC_NUMLASTFILES:
2947 case LyXRC::RC_PARAGRAPH_MARKERS:
2948 case LyXRC::RC_PATH_PREFIX:
2949 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2950 prependEnvPath("PATH", lyxrc.path_prefix);
2952 case LyXRC::RC_PREVIEW:
2953 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2954 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2955 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2956 case LyXRC::RC_PRINTCOPIESFLAG:
2957 case LyXRC::RC_PRINTER:
2958 case LyXRC::RC_PRINTEVENPAGEFLAG:
2959 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2960 case LyXRC::RC_PRINTFILEEXTENSION:
2961 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2962 case LyXRC::RC_PRINTODDPAGEFLAG:
2963 case LyXRC::RC_PRINTPAGERANGEFLAG:
2964 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2965 case LyXRC::RC_PRINTPAPERFLAG:
2966 case LyXRC::RC_PRINTREVERSEFLAG:
2967 case LyXRC::RC_PRINTSPOOL_COMMAND:
2968 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2969 case LyXRC::RC_PRINTTOFILE:
2970 case LyXRC::RC_PRINTTOPRINTER:
2971 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2972 case LyXRC::RC_PRINT_COMMAND:
2973 case LyXRC::RC_RTL_SUPPORT:
2974 case LyXRC::RC_SAVE_COMPRESSED:
2975 case LyXRC::RC_SCREEN_DPI:
2976 case LyXRC::RC_SCREEN_FONT_ROMAN:
2977 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2978 case LyXRC::RC_SCREEN_FONT_SANS:
2979 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2980 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2981 case LyXRC::RC_SCREEN_FONT_SIZES:
2982 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2983 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2984 case LyXRC::RC_GEOMETRY_SESSION:
2985 case LyXRC::RC_SCREEN_ZOOM:
2986 case LyXRC::RC_SERVERPIPE:
2987 case LyXRC::RC_SET_COLOR:
2988 case LyXRC::RC_SHOW_BANNER:
2989 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2990 case LyXRC::RC_SPELLCHECKER:
2991 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2992 case LyXRC::RC_SPELLCHECK_NOTES:
2993 case LyXRC::RC_SPLITINDEX_COMMAND:
2994 case LyXRC::RC_TEMPDIRPATH:
2995 case LyXRC::RC_TEMPLATEPATH:
2996 case LyXRC::RC_TEX_ALLOWS_SPACES:
2997 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2998 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2999 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3001 case LyXRC::RC_THESAURUSDIRPATH:
3002 case LyXRC::RC_UIFILE:
3003 case LyXRC::RC_USER_EMAIL:
3004 case LyXRC::RC_USER_NAME:
3005 case LyXRC::RC_USE_CONVERTER_CACHE:
3006 case LyXRC::RC_USE_SYSTEM_COLORS:
3007 case LyXRC::RC_USE_TOOLTIP:
3008 case LyXRC::RC_USE_PIXMAP_CACHE:
3009 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3010 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3011 case LyXRC::RC_SINGLE_INSTANCE:
3012 case LyXRC::RC_SORT_LAYOUTS:
3013 case LyXRC::RC_FULL_SCREEN_LIMIT:
3014 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3015 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3016 case LyXRC::RC_FULL_SCREEN_TABBAR:
3017 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3018 case LyXRC::RC_FULL_SCREEN_WIDTH:
3019 case LyXRC::RC_VISUAL_CURSOR:
3020 case LyXRC::RC_VIEWER:
3021 case LyXRC::RC_VIEWER_ALTERNATIVES:
3022 case LyXRC::RC_FORWARD_SEARCH_DVI:
3023 case LyXRC::RC_FORWARD_SEARCH_PDF:
3024 case LyXRC::RC_EXPORT_OVERWRITE:
3025 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3026 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3027 case LyXRC::RC_CURSOR_WIDTH:
3028 case LyXRC::RC_LAST:
3035 string const LyXRC::getDescription(LyXRCTags tag)
3040 case RC_ACCEPT_COMPOUND:
3041 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3045 str = _("Specify an alternate language. The default is to use the language of the document.");
3048 case RC_PLAINTEXT_LINELEN:
3049 str = _("The maximum line length of exported plain text/LaTeX/SGML files. If set to 0, paragraphs are output in a single line; if the line length is > 0, paragraphs are separated by a blank line.");
3052 case RC_AUTOREGIONDELETE:
3053 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3056 case RC_AUTORESET_OPTIONS:
3057 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3061 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3064 case RC_AUTO_NUMBER:
3067 case RC_BACKUPDIR_PATH:
3068 str = _("The path for storing backup files. If it is an empty string, LyX will store the backup file in the same directory as the original file.");
3071 case RC_BIBTEX_COMMAND:
3072 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3075 case RC_JBIBTEX_COMMAND:
3076 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3080 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3083 case RC_CHECKLASTFILES:
3084 str = _("Select to check whether the lastfiles still exist.");
3087 case RC_CHKTEX_COMMAND:
3088 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3097 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3098 str = _("LyX normally doesn't update the cursor position if you move the scrollbar. Set to true if you'd prefer to always have the cursor on screen.");
3101 case RC_CURSOR_WIDTH:
3102 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3105 case RC_SCROLL_BELOW_DOCUMENT:
3106 str = _("LyX normally doesn't allow the user to scroll further than the bottom of the document. Set to true if you prefer to scroll the bottom of the document to the top of the screen");
3109 case RC_MAC_DONTSWAP_CTRL_META:
3110 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3113 case RC_MAC_LIKE_WORD_MOVEMENT:
3114 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3117 case RC_SHOW_MACRO_LABEL:
3118 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3121 case RC_DATE_INSERT_FORMAT:
3122 //xgettext:no-c-format
3123 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3127 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3130 case RC_DEFAULT_VIEW_FORMAT:
3131 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3134 case RC_DEFAULT_LANGUAGE:
3135 str = _("New documents will be assigned this language.");
3138 case RC_DEFAULT_PAPERSIZE:
3139 str = _("Specify the default paper size.");
3142 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3143 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3146 case RC_DISPLAY_GRAPHICS:
3147 str = _("Select how LyX will display any graphics.");
3150 case RC_DOCUMENTPATH:
3151 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3155 str = _("Specify additional chars that can be part of a word.");
3158 case RC_EXAMPLEPATH:
3159 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3162 case RC_FONT_ENCODING:
3163 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3166 case RC_FORCE_PAINT_SINGLE_CHAR:
3167 str = _("Disable any kerning and ligatures for text drawing on screen.");
3173 case RC_INDEX_COMMAND:
3174 str = _("Define the options of makeindex (cf. man makeindex) or select an alternative compiler. E.g., using xindy/make-rules, the command string would be \"makeindex.sh -m $$lang\".");
3177 case RC_JINDEX_COMMAND:
3178 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3181 case RC_NOMENCL_COMMAND:
3182 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3189 case RC_KBMAP_PRIMARY:
3190 case RC_KBMAP_SECONDARY:
3191 str = _("Use this to set the correct mapping file for your keyboard. You'll need this if you for instance want to type German documents on an American keyboard.");
3194 case RC_LANGUAGE_AUTO_BEGIN:
3195 str = _("Select if a language switching command is needed at the beginning of the document.");
3198 case RC_LANGUAGE_AUTO_END:
3199 str = _("Select if a language switching command is needed at the end of the document.");
3202 case RC_LANGUAGE_COMMAND_BEGIN:
3203 str = _("The LaTeX command for changing from the language of the document to another language. E.g. \\selectlanguage{$$lang} where $$lang is substituted by the name of the second language.");
3206 case RC_LANGUAGE_COMMAND_END:
3207 str = _("The LaTeX command for changing back to the language of the document.");
3210 case RC_LANGUAGE_COMMAND_LOCAL:
3211 str = _("The LaTeX command for local changing of the language.");
3214 case RC_LANGUAGE_GLOBAL_OPTIONS:
3215 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3218 case RC_LANGUAGE_CUSTOM_PACKAGE:
3219 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3222 case RC_LANGUAGE_PACKAGE_SELECTION:
3223 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3226 case RC_USELASTFILEPOS:
3227 str = _("De-select if you do not want LyX to scroll to saved position.");
3230 case RC_LOADSESSION:
3231 str = _("De-select to prevent loading files opened from the last LyX session.");
3234 case RC_MAKE_BACKUP:
3235 str = _("De-select if you don't want LyX to create backup files.");
3238 case RC_MARK_FOREIGN_LANGUAGE:
3239 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3242 case RC_MOUSE_WHEEL_SPEED:
3243 str = bformat(_("The scrolling speed of the mouse wheel."),
3247 case RC_COMPLETION_POPUP_DELAY:
3248 str = _("The completion popup delay.");
3251 case RC_COMPLETION_POPUP_MATH:
3252 str = _("Select to display the completion popup in math mode.");
3255 case RC_COMPLETION_POPUP_TEXT:
3256 str = _("Select to display the completion popup in text mode.");
3259 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3260 str = _("Show the completion popup without delay after non-unique completion attempt.");
3263 case RC_COMPLETION_POPUP_TEXT:
3264 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3267 case RC_COMPLETION_POPUP_DELAY:
3268 str = _("The inline completion delay.");
3271 case RC_COMPLETION_INLINE_MATH:
3272 str = _("Select to display the inline completion in math mode.");
3275 case RC_COMPLETION_INLINE_TEXT:
3276 str = _("Select to display the inline completion in text mode.");
3279 case RC_COMPLETION_INLINE_DOTS:
3280 str = _("Use \"...\" to shorten long completions.");
3283 case RC_AUTOCORRECTION_MATH:
3284 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3287 case RC_NUMLASTFILES:
3288 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3292 case RC_PATH_PREFIX:
3293 str = _("Specify those directories which should be "
3294 "prepended to the PATH environment variable. "
3295 "Use the OS native format.");
3299 str = _("Shows a typeset preview of things such as math");
3302 case RC_PREVIEW_HASHED_LABELS:
3303 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3306 case RC_PREVIEW_SCALE_FACTOR:
3307 str = _("Scale the preview size to suit.");
3310 case RC_PRINTCOLLCOPIESFLAG:
3311 str = _("The option for specifying whether the copies should be collated.");
3314 case RC_PRINTCOPIESFLAG:
3315 str = _("The option for specifying the number of copies to print.");
3319 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3322 case RC_PRINTEVENPAGEFLAG:
3323 str = _("The option to print only even pages.");
3326 case RC_PRINTEXSTRAOPTIONS:
3327 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3330 case RC_PRINTFILEEXTENSION:
3331 str = _("Extension of printer program output file. Usually \".ps\".");
3334 case RC_PRINTLANDSCAPEFLAG:
3335 str = _("The option to print out in landscape.");
3338 case RC_PRINTODDPAGEFLAG:
3339 str = _("The option to print only odd pages.");
3342 case RC_PRINTPAGERANGEFLAG:
3343 str = _("The option for specifying a comma-separated list of pages to print.");
3346 case RC_PRINTPAPERDIMENSIONFLAG:
3347 str = _("Option to specify the dimensions of the print paper.");
3350 case RC_PRINTPAPERFLAG:
3351 str = _("The option to specify paper type.");
3354 case RC_PRINTREVERSEFLAG:
3355 str = _("The option to reverse the order of the pages printed.");
3358 case RC_PRINTSPOOL_COMMAND:
3359 str = _("When set, this printer option automatically prints to a file and then calls a separate print spooling program on that file with the given name and arguments.");
3362 case RC_PRINTSPOOL_PRINTERPREFIX:
3363 str = _("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
3366 case RC_PRINTTOFILE:
3367 str = _("Option to pass to the print program to print to a file.");
3370 case RC_PRINTTOPRINTER:
3371 str = _("Option to pass to the print program to print on a specific printer.");
3374 case RC_PRINT_ADAPTOUTPUT:
3375 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3378 case RC_PRINT_COMMAND:
3379 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3382 case RC_RTL_SUPPORT:
3383 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3386 case RC_VISUAL_CURSOR:
3387 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3391 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3394 case RC_SCREEN_FONT_ROMAN:
3395 case RC_SCREEN_FONT_SANS:
3396 case RC_SCREEN_FONT_TYPEWRITER:
3397 str = _("The screen fonts used to display the text while editing.");
3400 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3401 case RC_SCREEN_FONT_SANS_FOUNDRY:
3402 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3405 case RC_SCREEN_FONT_SCALABLE:
3406 str = _("Allow bitmap fonts to be resized. If you are using a bitmap font, selecting this option may make some fonts look blocky in LyX. Deselecting this option makes LyX use the nearest bitmap font size available, instead of scaling.");
3409 case RC_SCREEN_FONT_SIZES:
3410 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3413 case RC_SCREEN_ZOOM:
3414 //xgettext:no-c-format
3415 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3418 case RC_GEOMETRY_SESSION:
3419 str = _("Allow session manager to save and restore windows geometry.");
3423 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3429 case RC_SHOW_BANNER:
3430 str = _("De-select if you don't want the startup banner.");
3433 case RC_TEMPDIRPATH:
3434 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3437 case RC_THESAURUSDIRPATH:
3438 str = _("This is the place where the files of the thesaurus library reside.");
3441 case RC_TEMPLATEPATH:
3442 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3445 case RC_TEX_ALLOWS_SPACES:
3448 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3452 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3461 case RC_USE_USE_SYSTEM_COLORS:
3462 str = _("Enable use the system colors for some things like main window background and selection.");
3465 case RC_USE_TOOLTIP:
3466 str = _("Enable the automatic appearance of tool tips in the work area.");
3469 case RC_USE_PIXMAP_CACHE:
3470 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3473 case RC_VIEWDVI_PAPEROPTION:
3474 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3489 // The global instance
3492 // The global copy of the system lyxrc entries (everything except preferences)