]> git.lyx.org Git - lyx.git/blob - src/LyXRC.cpp
* UI changes in anticipation of polyglossia support:
[lyx.git] / src / LyXRC.cpp
1 /**
2  * \file LyXRC.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  * \author Jean-Marc Lasgouttes
8  * \author Angus Leeming
9  * \author John Levon
10  * \author André Pönitz
11  * \author Allan Rae
12  * \author Dekel Tsur
13  *
14  * Full author contact details are available in file CREDITS.
15  */
16
17 #include <config.h>
18
19 #include "LyXRC.h"
20
21 #include "ColorSet.h"
22 #include "Converter.h"
23 #include "FontEnums.h"
24 #include "Format.h"
25 #include "Lexer.h"
26 #include "LyX.h"
27 #include "Mover.h"
28 #include "Session.h"
29 #include "version.h"
30
31 #include "graphics/GraphicsTypes.h"
32
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"
43
44 #include <fstream>
45 #include <iostream>
46 #include <algorithm>
47
48 using namespace std;
49 using namespace lyx::support;
50
51 namespace lyx {
52
53 namespace os = support::os;
54
55 namespace {
56
57 // when adding something to this array keep it sorted!
58 LexerKeyword lyxrcTags[] = {
59         { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
60         { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
61         { "\\alternate_language", LyXRC::RC_ALT_LANG },
62         { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
63         { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
64         { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
65         { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
66         { "\\autosave", LyXRC::RC_AUTOSAVE },
67         { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
68         { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
69         { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
70         { "\\bind_file", LyXRC::RC_BINDFILE },
71         { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
72         { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
73         { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
74         { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
75         { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
76         { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
77         { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
78         { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
79         { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
80         { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
81         { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
82         { "\\converter", LyXRC::RC_CONVERTER },
83         { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
84         { "\\copier", LyXRC::RC_COPIER },
85         { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
86         { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
87         { "\\def_file", LyXRC::RC_DEFFILE },
88         { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
89         { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
90         { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
91         { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
92         { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
93         { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
94         { "\\document_path", LyXRC::RC_DOCUMENTPATH },
95         { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
96         { "\\escape_chars", LyXRC::RC_ESC_CHARS },
97         { "\\example_path", LyXRC::RC_EXAMPLEPATH },
98         { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
99         { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
100         { "\\format", LyXRC::RC_FORMAT },
101         { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
102         { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
103         { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
104         { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
105         { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
106         { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
107         { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
108         { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
109         { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
110         { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
111         { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
112         { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
113         { "\\index_command", LyXRC::RC_INDEX_COMMAND },
114         { "\\input", LyXRC::RC_INPUT },
115         { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
116         { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
117         { "\\kbmap", LyXRC::RC_KBMAP },
118         { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
119         { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
120         { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
121         { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
122         { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
123         { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
124         { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
125         { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
126         { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
127         { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
128         { "\\load_session", LyXRC::RC_LOADSESSION },
129         { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
130         { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
131         { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
132         { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
133         { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
134         { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
135         { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
136         { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
137         { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
138         { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
139         { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
140         { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
141         { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
142         { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
143         { "\\preview", LyXRC::RC_PREVIEW },
144         { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
145         { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
146         { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
147         { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
148         { "\\print_command", LyXRC::RC_PRINT_COMMAND },
149         { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
150         { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
151         { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
152         { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
153         { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
154         { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
155         { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
156         { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
157         { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
158         { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
159         { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
160         { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
161         { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
162         { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
163         { "\\printer", LyXRC::RC_PRINTER },
164         { "\\rtl", LyXRC::RC_RTL_SUPPORT },
165         { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
166         { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
167         { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
168         { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
169         { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
170         { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
171         { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
172         { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
173         { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
174         { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
175         { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
176         { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
177         { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
178         { "\\serverpipe", LyXRC::RC_SERVERPIPE },
179         { "\\set_color", LyXRC::RC_SET_COLOR },
180         { "\\show_banner", LyXRC::RC_SHOW_BANNER },
181         { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
182         { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
183         { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
184         { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
185         { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
186         { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
187         { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
188         { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
189         { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
190         { "\\template_path", LyXRC::RC_TEMPLATEPATH },
191         { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
192         { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
193         { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
194         { "\\ui_file", LyXRC::RC_UIFILE },
195         { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
196         { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
197         { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
198         { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
199         { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
200         { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
201         { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
202         // compatibility with versions older than 1.4.0 only
203         { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
204         { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
205         // compatibility with versions older than 1.4.0 only
206         { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
207         { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
208         { "\\user_email", LyXRC::RC_USER_EMAIL },
209         { "\\user_name", LyXRC::RC_USER_NAME },
210         { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
211         // compatibility with versions older than 1.4.0 only
212         { "\\viewer", LyXRC::RC_VIEWER},
213         { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
214         { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
215 };
216
217 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
218
219 } // namespace anon
220
221
222 LyXRC::LyXRC()
223 {
224         setDefaults();
225 }
226
227
228 void LyXRC::setDefaults()
229 {
230         bind_file = "cua";
231         def_file = "default";
232         ui_file = "default";
233         // Get printer from the environment. If fail, use default "",
234         // assuming that everything is set up correctly.
235         printer = getEnv("PRINTER");
236         print_adapt_output = false;
237         print_command = "dvips";
238         print_evenpage_flag = "-B";
239         print_oddpage_flag = "-A";
240         print_pagerange_flag = "-pp";
241         print_copies_flag = "-c";
242         print_collcopies_flag = "-C";
243         print_reverse_flag = "-r";
244         print_landscape_flag = "-t landscape";
245         print_to_printer = "-P";
246         print_to_file = "-o ";
247         print_file_extension = ".ps";
248         print_paper_flag = "-t";
249         print_paper_dimension_flag = "-T";
250         document_path.erase();
251         view_dvi_paper_option.erase();
252         default_papersize = PAPER_DEFAULT;
253         default_view_format = "pdf2";
254         chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
255         bibtex_command = "bibtex";
256         fontenc = "default";
257         index_command = "makeindex -c -q";
258         nomencl_command = "makeindex -s nomencl.ist";
259         dpi = 75;
260         // Because a screen is typically wider than a piece of paper:
261         zoom = 150;
262         allow_geometry_session = true;
263         // Default LaTeX font size:
264         font_sizes[FONT_SIZE_TINY] = "5.0";
265         font_sizes[FONT_SIZE_SCRIPT] = "7.0";
266         font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
267         font_sizes[FONT_SIZE_SMALL] = "9.0";
268         font_sizes[FONT_SIZE_NORMAL] = "10.0";
269         font_sizes[FONT_SIZE_LARGE] = "12.0";
270         font_sizes[FONT_SIZE_LARGER] = "14.4";
271         font_sizes[FONT_SIZE_LARGEST] = "17.26";
272         font_sizes[FONT_SIZE_HUGE] = "20.74";
273         font_sizes[FONT_SIZE_HUGER] = "24.88";
274         use_scalable_fonts = true;
275         roman_font_name = "";
276         sans_font_name = "";
277         typewriter_font_name = "";
278         autosave = 300;
279         auto_region_delete = true;
280         auto_reset_options = false;
281         plaintext_linelen = 65;
282         mouse_wheel_speed = 1.0;
283         num_lastfiles = maxlastfiles;
284         check_lastfiles = true;
285         use_lastfilepos = true;
286         load_session = false;
287         make_backup = true;
288         save_compressed = false;
289         backupdir_path.erase();
290         display_graphics = true;
291         // Spellchecker settings:
292 // FIXME: this check should test the target platform (darwin)
293 #if defined(USE_MACOSX_PACKAGING)
294         spellchecker = "native";
295 #elif defined(USE_ASPELL)
296         spellchecker = "aspell";
297 #elif defined(USE_HUNSPELL)
298         spellchecker = "hunspell";
299 #else
300         spellchecker = "aspell";
301 #endif
302         spellchecker_accept_compound = false;
303         spellcheck_continuously = false;
304         spellcheck_notes = true;
305         use_kbmap = false;
306         rtl_support = true;
307         visual_cursor = false;
308         auto_number = true;
309         mark_foreign_language = true;
310         language_auto_begin = true;
311         language_auto_end = true;
312         language_global_options = true;
313         language_package_selection = LP_AUTO;
314         language_custom_package = "\\usepackage{babel}";
315         language_command_begin = "\\selectlanguage{$$lang}";
316         language_command_local = "\\foreignlanguage{$$lang}{";
317         sort_layouts = false;
318         group_layouts = true;
319         default_language = "english";
320         gui_language = "auto";
321         show_banner = true;
322         windows_style_tex_paths = false;
323         tex_allows_spaces = false;
324         date_insert_format = "%x";
325         cursor_follows_scrollbar = false;
326         scroll_below_document = false;
327         scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
328         paragraph_markers = false;
329         mac_dontswap_ctrl_meta = false;
330         mac_like_word_movement = false;
331         macro_edit_style = MACRO_EDIT_INLINE_BOX;
332         dialogs_iconify_with_main = false;
333         preview = PREVIEW_OFF;
334         preview_hashed_labels  = false;
335         preview_scale_factor = 1.0;
336         use_converter_cache = true;
337         use_system_colors = false;
338         use_tooltip = true;
339         use_pixmap_cache = false;
340         converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
341         user_name = to_utf8(support::user_name());
342         user_email = to_utf8(support::user_email());
343         open_buffers_in_tabs = true;
344         single_close_tab_button = false;
345         single_instance = true;
346         forward_search_dvi = string();
347         forward_search_pdf = string();
348         export_overwrite = NO_FILES;
349
350         // Fullscreen settings
351         full_screen_limit = false;
352         full_screen_toolbars = true;
353         full_screen_tabbar = true;
354         full_screen_menubar = true;
355         full_screen_scrollbar = true;
356         full_screen_width = 700;
357
358         completion_cursor_text = true;
359         completion_popup_math = true;
360         completion_popup_text = false;
361         completion_popup_delay = 2.0;
362         completion_popup_after_complete = true;
363         autocorrection_math = false;
364         completion_inline_math = true;
365         completion_inline_text = false;
366         completion_inline_dots = -1;
367         completion_inline_delay = 0.2;
368         default_decimal_point = ".";
369 }
370
371
372 namespace {
373
374 void oldFontFormat(string & family, string & foundry)
375 {
376         if (family.empty() || family[0] != '-')
377                 return;
378         foundry = token(family, '-', 1);
379         family = token(family, '-', 2);
380         if (foundry == "*")
381                 foundry.erase();
382 }
383
384 } // namespace anon
385
386
387 int LyXRC::read(FileName const & filename)
388 {
389         Lexer lexrc(lyxrcTags);
390         if (lyxerr.debugging(Debug::PARSER))
391                 lexrc.printTable(lyxerr);
392
393         lexrc.setFile(filename);
394         if (!lexrc.isOK())
395                 return -2;
396
397         LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
398
399         return read(lexrc);
400 }
401
402
403 int LyXRC::read(istream & is)
404 {
405         Lexer lexrc(lyxrcTags);
406         if (lyxerr.debugging(Debug::PARSER))
407                 lexrc.printTable(lyxerr);
408
409         lexrc.setStream(is);
410         if (!lexrc.isOK())
411                 return -2;
412
413         LYXERR(Debug::LYXRC, "Reading istream...");
414
415         return read(lexrc);
416 }
417
418
419 int LyXRC::read(Lexer & lexrc)
420 {
421         if (!lexrc.isOK())
422                 return -2;
423
424         while (lexrc.isOK()) {
425                 // By using two switches we take advantage of the compiler
426                 // telling us if we have missed a LyXRCTags element in
427                 // the second switch.
428                 // Note that this also shows a problem with Lexer since it
429                 // helps us avoid taking advantage of the strictness of the
430                 // compiler.
431
432                 int le = lexrc.lex();
433                 switch (le) {
434                 case Lexer::LEX_UNDEF:
435                         lexrc.printError("Unknown tag `$$Token'");
436                         continue;
437                 case Lexer::LEX_FEOF:
438                         continue;
439                 default:
440                         break;
441                 }
442                 switch (static_cast<LyXRCTags>(le)) {
443                 case RC_INPUT: // Include file
444                         if (lexrc.next()) {
445                                 FileName const tmp =
446                                         libFileSearch(string(),
447                                                       lexrc.getString());
448                                 if (read(tmp)) {
449                                         lexrc.printError("Error reading "
450                                                          "included file: " + tmp.absFileName());
451                                 }
452                         }
453                         break;
454                 case RC_BINDFILE:
455                         if (lexrc.next())
456                                 bind_file = os::internal_path(lexrc.getString());
457                         break;
458
459                 case RC_DEFFILE:
460                         if (lexrc.next())
461                                 def_file = os::internal_path(lexrc.getString());
462                         break;
463
464                 case RC_UIFILE:
465                         if (lexrc.next())
466                                 ui_file = os::internal_path(lexrc.getString());
467                         break;
468
469                 case RC_AUTORESET_OPTIONS:
470                         lexrc >> auto_reset_options;
471                         break;
472
473                 case RC_DISPLAY_GRAPHICS:
474                         if (lexrc.next())
475                                 display_graphics = lexrc.getString() == "true";
476                         break;
477
478                 case RC_TEX_EXPECTS_WINDOWS_PATHS:
479                         lexrc >> windows_style_tex_paths;
480                         break;
481
482                 case RC_TEX_ALLOWS_SPACES:
483                         lexrc >> tex_allows_spaces;
484                         break;
485
486                 case RC_KBMAP:
487                         lexrc >> use_kbmap;
488                         break;
489
490                 case RC_KBMAP_PRIMARY:
491                         if (lexrc.next()) {
492                                 string const kmap(os::internal_path(lexrc.getString()));
493                                 if (!libFileSearch("kbd", kmap, "kmap").empty()
494                                           || kmap.empty()) {
495                                         primary_kbmap = kmap;
496                                 } else {
497                                         lexrc.printError("LyX: Keymap `$$Token' not found");
498                                 }
499                         }
500                         break;
501
502                 case RC_KBMAP_SECONDARY:
503                         if (lexrc.next()) {
504                                 string const kmap(os::internal_path(lexrc.getString()));
505                                 if (!libFileSearch("kbd", kmap, "kmap").empty()
506                                           || kmap.empty()) {
507                                         secondary_kbmap = kmap;
508                                 } else {
509                                         lexrc.printError("LyX: Keymap `$$Token' not found");
510                                 }
511                         }
512                         break;
513
514                 case RC_FONT_ENCODING:
515                         lexrc >> fontenc;
516                         break;
517
518                 case RC_PRINTER:
519                         lexrc >> printer;
520                         break;
521
522                 case RC_PRINT_COMMAND:
523                         if (lexrc.next(true)) {
524                                 print_command = lexrc.getString();
525                         }
526                         break;
527
528                 case RC_PRINTEVENPAGEFLAG:
529                         lexrc >> print_evenpage_flag;
530                         break;
531
532                 case RC_PRINTODDPAGEFLAG:
533                         lexrc >> print_oddpage_flag;
534                         break;
535
536                 case RC_PRINTPAGERANGEFLAG:
537                         lexrc >> print_pagerange_flag;
538                         break;
539
540                 case RC_PRINTCOPIESFLAG:
541                         lexrc >> print_copies_flag;
542                         break;
543
544                 case RC_PRINTCOLLCOPIESFLAG:
545                         lexrc >> print_collcopies_flag;
546                         break;
547
548                 case RC_PRINTREVERSEFLAG:
549                         lexrc >> print_reverse_flag;
550                         break;
551
552                 case RC_PRINTLANDSCAPEFLAG:
553                         lexrc >> print_landscape_flag;
554                         break;
555
556                 case RC_PRINTTOPRINTER:
557                         lexrc >> print_to_printer;
558                         break;
559
560                 case RC_PRINT_ADAPTOUTPUT:
561                         lexrc >> print_adapt_output;
562                         break;
563
564                 case RC_PRINTTOFILE:
565                         if (lexrc.next()) {
566                                 print_to_file = os::internal_path(lexrc.getString());
567                         }
568                         break;
569
570                 case RC_PRINTFILEEXTENSION:
571                         lexrc >> print_file_extension;
572                         break;
573
574                 case RC_PRINTEXSTRAOPTIONS:
575                         lexrc >> print_extra_options;
576                         break;
577
578                 case RC_PRINTSPOOL_COMMAND:
579                         if (lexrc.next(true)) {
580                                 print_spool_command = lexrc.getString();
581                         }
582                         break;
583
584                 case RC_PRINTSPOOL_PRINTERPREFIX:
585                         lexrc >> print_spool_printerprefix;
586                         break;
587
588                 case RC_PRINTPAPERDIMENSIONFLAG:
589                         lexrc >> print_paper_dimension_flag;
590                         break;
591
592                 case RC_PRINTPAPERFLAG:
593                         lexrc >> print_paper_flag;
594                         break;
595
596                 case RC_DEFAULT_PAPERSIZE:
597                         if (lexrc.next()) {
598                                 string const size = ascii_lowercase(lexrc.getString());
599                                 if (size == "usletter")
600                                         default_papersize = PAPER_USLETTER;
601                                 else if (size == "legal")
602                                         default_papersize = PAPER_USLEGAL;
603                                 else if (size == "executive")
604                                         default_papersize = PAPER_USEXECUTIVE;
605                                 else if (size == "a3")
606                                         default_papersize = PAPER_A3;
607                                 else if (size == "a4")
608                                         default_papersize = PAPER_A4;
609                                 else if (size == "a5")
610                                         default_papersize = PAPER_A5;
611                                 else if (size == "b5")
612                                         default_papersize = PAPER_B5;
613                                 else if (size == "default")
614                                         default_papersize = PAPER_DEFAULT;
615                         }
616                         break;
617
618                 case RC_VIEWDVI_PAPEROPTION:
619                         if (lexrc.next())
620                                 view_dvi_paper_option = lexrc.getString();
621                         else
622                                 view_dvi_paper_option.erase();
623                         break;
624
625                 case RC_CHKTEX_COMMAND:
626                         if (lexrc.next(true)) {
627                                 chktex_command = lexrc.getString();
628                         }
629                         break;
630
631                 case RC_BIBTEX_ALTERNATIVES:
632                         if (lexrc.next(true)) {
633                                 bibtex_alternatives.insert(lexrc.getString());
634                         }
635                         break;
636
637                 case RC_BIBTEX_COMMAND:
638                         if (lexrc.next(true)) {
639                                 bibtex_command = lexrc.getString();
640                         }
641                         break;
642
643                 case RC_JBIBTEX_COMMAND:
644                         if (lexrc.next(true)) {
645                                 jbibtex_command = lexrc.getString();
646                         }
647                         break;
648
649                 case RC_INDEX_ALTERNATIVES:
650                         if (lexrc.next(true)) {
651                                 index_alternatives.insert(lexrc.getString());
652                         }
653                         break;
654
655                 case RC_INDEX_COMMAND:
656                         if (lexrc.next(true)) {
657                                 index_command = lexrc.getString();
658                         }
659                         break;
660
661                 case RC_JINDEX_COMMAND:
662                         if (lexrc.next(true)) {
663                                 jindex_command = lexrc.getString();
664                         }
665                         break;
666
667                 case RC_SPLITINDEX_COMMAND:
668                         if (lexrc.next(true)) {
669                                 splitindex_command = lexrc.getString();
670                         }
671                         break;
672
673                 case RC_NOMENCL_COMMAND:
674                         if (lexrc.next(true)) {
675                                 nomencl_command = lexrc.getString();
676                         }
677                         break;
678
679                 case RC_SCREEN_DPI:
680                         lexrc >> dpi;
681                         break;
682
683                 case RC_SCREEN_ZOOM:
684                         lexrc >> zoom;
685                         break;
686
687                 case RC_GEOMETRY_SESSION:
688                         lexrc >> allow_geometry_session;
689                         break;
690
691                 case RC_SCREEN_FONT_SIZES:
692                         lexrc >> font_sizes[FONT_SIZE_TINY];
693                         lexrc >> font_sizes[FONT_SIZE_SCRIPT];
694                         lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
695                         lexrc >> font_sizes[FONT_SIZE_SMALL];
696                         lexrc >> font_sizes[FONT_SIZE_NORMAL];
697                         lexrc >> font_sizes[FONT_SIZE_LARGE];
698                         lexrc >> font_sizes[FONT_SIZE_LARGER];
699                         lexrc >> font_sizes[FONT_SIZE_LARGEST];
700                         lexrc >> font_sizes[FONT_SIZE_HUGE];
701                         lexrc >> font_sizes[FONT_SIZE_HUGER];
702                         break;
703
704                 case RC_SCREEN_FONT_SCALABLE:
705                         lexrc >> use_scalable_fonts;
706                         break;
707
708                 case RC_AUTOSAVE:
709                         lexrc >> autosave;
710                         break;
711
712                 case RC_DOCUMENTPATH:
713                         if (lexrc.next()) {
714                                 document_path = os::internal_path(lexrc.getString());
715                                 document_path = expandPath(document_path);
716                         }
717                         break;
718
719                 case RC_EXAMPLEPATH:
720                         if (lexrc.next()) {
721                                 example_path = os::internal_path(lexrc.getString());
722                                 example_path = expandPath(example_path);
723                         }
724                         break;
725
726                 case RC_TEMPLATEPATH:
727                         if (lexrc.next()) {
728                                 template_path = os::internal_path(lexrc.getString());
729                                 template_path = expandPath(template_path);
730                         }
731                         break;
732
733                 case RC_TEMPDIRPATH:
734                         if (lexrc.next()) {
735                                 tempdir_path = os::internal_path(lexrc.getString());
736                                 tempdir_path = expandPath(tempdir_path);
737                         }
738                         break;
739
740                 case RC_THESAURUSDIRPATH:
741                         if (lexrc.next()) {
742                                 thesaurusdir_path = os::internal_path(lexrc.getString());
743                                 thesaurusdir_path = expandPath(thesaurusdir_path);
744                         }
745                         break;
746
747                 case RC_HUNSPELLDIR_PATH:
748                         if (lexrc.next()) {
749                                 hunspelldir_path = os::internal_path(lexrc.getString());
750                                 hunspelldir_path = expandPath(hunspelldir_path);
751                         }
752                         break;
753
754                 case RC_USELASTFILEPOS:
755                         lexrc >> use_lastfilepos;
756                         break;
757
758                 case RC_LOADSESSION:
759                         lexrc >> load_session;
760                         break;
761
762                 case RC_MOUSE_WHEEL_SPEED:
763                         lexrc >> mouse_wheel_speed;
764                         break;
765
766                 case RC_COMPLETION_INLINE_DELAY:
767                         lexrc >> completion_inline_delay;
768                         break;
769
770                 case RC_COMPLETION_INLINE_MATH:
771                         lexrc >> completion_inline_math;
772                         break;
773
774                 case RC_COMPLETION_INLINE_TEXT:
775                         lexrc >> completion_inline_text;
776                         break;
777
778                 case RC_COMPLETION_INLINE_DOTS:
779                         lexrc >> completion_inline_dots;
780                         break;
781
782                 case RC_AUTOCORRECTION_MATH:
783                         lexrc >> autocorrection_math;
784                         break;
785
786                 case RC_COMPLETION_POPUP_DELAY:
787                         lexrc >> completion_popup_delay;
788                         break;
789
790                 case RC_COMPLETION_POPUP_MATH:
791                         lexrc >> completion_popup_math;
792                         break;
793
794                 case RC_COMPLETION_POPUP_TEXT:
795                         lexrc >> completion_popup_text;
796                         break;
797
798                 case RC_COMPLETION_CURSOR_TEXT:
799                         lexrc >> completion_cursor_text;
800                         break;
801
802                 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
803                         lexrc >> completion_popup_after_complete;
804                         break;
805
806                 case RC_NUMLASTFILES:
807                         lexrc >> num_lastfiles;
808                         break;
809
810                 case RC_CHECKLASTFILES:
811                         lexrc >> check_lastfiles;
812                         break;
813
814                 case RC_SCREEN_FONT_ROMAN:
815                         if (lexrc.next()) {
816                                 roman_font_name = lexrc.getString();
817                                 oldFontFormat(roman_font_name,
818                                               roman_font_foundry);
819                         }
820                         break;
821
822                 case RC_SCREEN_FONT_SANS:
823                         if (lexrc.next()) {
824                                 sans_font_name = lexrc.getString();
825                                 oldFontFormat(sans_font_name, sans_font_foundry);
826                         }
827                         break;
828
829                 case RC_SCREEN_FONT_TYPEWRITER:
830                         if (lexrc.next()) {
831                                 typewriter_font_name = lexrc.getString();
832                                 oldFontFormat(typewriter_font_name,
833                                               typewriter_font_foundry);
834                         }
835                         break;
836
837                 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
838                         lexrc >> roman_font_foundry;
839                         break;
840
841                 case RC_SCREEN_FONT_SANS_FOUNDRY:
842                         lexrc >> sans_font_foundry;
843                         break;
844
845                 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
846                         lexrc >> typewriter_font_foundry;
847                         break;
848
849                 case RC_SET_COLOR: {
850                         if (!lexrc.next()) {
851                                 lexrc.printError("Missing color tag.");
852                                 break;
853                         }
854                         string lyx_name = lexrc.getString();
855
856                         if (!lexrc.next()) {
857                                 lexrc.printError("Missing color name for color: `$$Token'");
858                                 break;
859                         }
860                         string x11_name = lexrc.getString();
861
862                         ColorCode const col =
863                                 lcolor.getFromLyXName(lyx_name);
864                         if (col == Color_none ||
865                             col == Color_inherit ||
866                             col == Color_ignore)
867                                 break;
868
869                         if (!lcolor.setColor(col, x11_name))
870                                 LYXERR0("Bad lyxrc set_color for " << lyx_name);
871                         break;
872                 }
873
874                 case RC_AUTOREGIONDELETE:
875                         // Auto region delete defaults to true
876                         lexrc >> auto_region_delete;
877                         break;
878
879                 case RC_SERVERPIPE:
880                         if (lexrc.next()) {
881                                 lyxpipes = os::internal_path(lexrc.getString());
882                                 lyxpipes = expandPath(lyxpipes);
883                         }
884                         break;
885
886                 case RC_CURSOR_FOLLOWS_SCROLLBAR:
887                         lexrc >> cursor_follows_scrollbar;
888                         break;
889
890                 case RC_SCROLL_BELOW_DOCUMENT:
891                         lexrc >> scroll_below_document;
892                         break;
893
894                 case RC_PARAGRAPH_MARKERS:
895                         lexrc >> paragraph_markers;
896                         break;
897
898                 case RC_MAC_DONTSWAP_CTRL_META:
899                         lexrc >> mac_dontswap_ctrl_meta;
900                         break;
901
902                 case RC_MAC_LIKE_WORD_MOVEMENT:
903                         lexrc >> mac_like_word_movement;
904                         break;
905
906                 case RC_MACRO_EDIT_STYLE:
907                         if (lexrc.next()) {
908                                 switch (lexrc.getInteger()) {
909                                 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
910                                 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
911                                 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
912                                 }
913                         }
914                         break;
915
916                 case RC_DIALOGS_ICONIFY_WITH_MAIN:
917                         lexrc >> dialogs_iconify_with_main;
918                         break;
919
920                 case RC_PLAINTEXT_LINELEN:
921                         lexrc >> plaintext_linelen;
922                         break;
923                         // Spellchecker settings:
924                 case RC_ACCEPT_COMPOUND:
925                         lexrc >> spellchecker_accept_compound;
926                         break;
927                 case RC_USE_SYSTEM_COLORS:
928                         lexrc >> use_system_colors;
929                         break;
930                 case RC_USE_TOOLTIP:
931                         lexrc >> use_tooltip;
932                         break;
933                 case RC_USE_PIXMAP_CACHE:
934                         lexrc >> use_pixmap_cache;
935                         break;
936                 case RC_SPELLCHECKER:
937                         lexrc >> spellchecker;
938                         break;
939                 case RC_ALT_LANG:
940                         lexrc >> spellchecker_alt_lang;
941                         break;
942                 case RC_ESC_CHARS:
943                         lexrc >> spellchecker_esc_chars;
944                         break;
945                 case RC_SPELLCHECK_CONTINUOUSLY:
946                         lexrc >> spellcheck_continuously;
947                         break;
948                 case RC_SPELLCHECK_NOTES:
949                         lexrc >> spellcheck_notes;
950                         break;
951                 case RC_MAKE_BACKUP:
952                         lexrc >> make_backup;
953                         break;
954                 case RC_SAVE_COMPRESSED:
955                         lexrc >> save_compressed;
956                         break;
957                 case RC_BACKUPDIR_PATH:
958                         if (lexrc.next()) {
959                                 backupdir_path = os::internal_path(lexrc.getString());
960                                 backupdir_path = expandPath(backupdir_path);
961                         }
962                         break;
963                 case RC_DEFAULT_DECIMAL_POINT:
964                         lexrc >> default_decimal_point;
965                         break;
966                 case RC_DATE_INSERT_FORMAT:
967                         lexrc >> date_insert_format;
968                         break;
969                 case RC_LANGUAGE_CUSTOM_PACKAGE:
970                         lexrc >> language_custom_package;
971                         break;
972                 case RC_LANGUAGE_AUTO_BEGIN:
973                         lexrc >> language_auto_begin;
974                         break;
975                 case RC_LANGUAGE_AUTO_END:
976                         lexrc >> language_auto_end;
977                         break;
978                 case RC_LANGUAGE_GLOBAL_OPTIONS:
979                         lexrc >> language_global_options;
980                         break;
981                 case RC_LANGUAGE_PACKAGE_SELECTION:
982                         if (lexrc.next()) {
983                                 switch (lexrc.getInteger()) {
984                                 case 0:
985                                         language_package_selection = LP_AUTO;
986                                         break;
987                                 case 1:
988                                         language_package_selection = LP_BABEL;
989                                         break;
990                                 case 2:
991                                         language_package_selection = LP_CUSTOM;
992                                         break;
993                                 case 3:
994                                         language_package_selection = LP_NONE;
995                                         break;
996                                 }
997                         }
998                         break;
999                 case RC_LANGUAGE_COMMAND_BEGIN:
1000                         lexrc >> language_command_begin;
1001                         break;
1002                 case RC_LANGUAGE_COMMAND_END:
1003                         lexrc >> language_command_end;
1004                         break;
1005                 case RC_LANGUAGE_COMMAND_LOCAL:
1006                         lexrc >> language_command_local;
1007                         break;
1008                 case RC_RTL_SUPPORT:
1009                         lexrc >> rtl_support;
1010                         break;
1011                 case RC_VISUAL_CURSOR:
1012                         lexrc >> visual_cursor;
1013                         break;
1014                 case RC_AUTO_NUMBER:
1015                         lexrc >> auto_number;
1016                         break;
1017                 case RC_MARK_FOREIGN_LANGUAGE:
1018                         lexrc >> mark_foreign_language;
1019                         break;
1020
1021                 case RC_COPIER: {
1022                         string fmt, command;
1023                         if (lexrc.next())
1024                                 fmt = lexrc.getString();
1025                         if (lexrc.next(true))
1026                                 command = lexrc.getString();
1027                         setMover(fmt, command);
1028                         break;
1029                 }
1030
1031                 case RC_CONVERTER: {
1032                         string from, to, command, flags;
1033                         if (lexrc.next())
1034                                 from = lexrc.getString();
1035                         if (lexrc.next())
1036                                 to = lexrc.getString();
1037                         if (lexrc.next(true))
1038                                 command = lexrc.getString();
1039                         if (lexrc.next())
1040                                 flags = lexrc.getString();
1041                         if (command.empty())
1042                                 theConverters().erase(from, to);
1043                         else
1044                                 theConverters().add(from, to, command, flags);
1045                         break;
1046                 }
1047                 // compatibility with versions older than 1.4.0 only
1048                 case RC_VIEWER: {
1049                         string format, command;
1050                         lexrc >> format >> command;
1051                         formats.setViewer(format, command);
1052                         break;
1053                 }
1054                 case RC_FORMAT: {
1055                         string format, extension, prettyname, shortcut;
1056                         lexrc >> format >> extension >> prettyname >> shortcut;
1057                         string viewer, editor;
1058                         if (lexrc.next(true))
1059                                 viewer = lexrc.getString();
1060                         if (lexrc.next(true))
1061                                 editor = lexrc.getString();
1062                         string flags;
1063                         // Hack to ensure compatibility with versions older
1064                         // than 1.5.0
1065                         int le = lexrc.lex();
1066                         if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1067                                 flags = lexrc.getString();
1068                                 if (le != Lexer::LEX_DATA) {
1069                                         // We have got a known token.
1070                                         // Therefore this is an old style
1071                                         // format definition without
1072                                         // flags.
1073                                         lexrc.pushToken(flags);
1074                                         flags.erase();
1075                                 }
1076                         }
1077                         int flgs = Format::none;
1078                         while (!flags.empty()) {
1079                                 string flag;
1080                                 flags = split(flags, flag, ',');
1081                                 if (flag == "document")
1082                                         flgs |= Format::document;
1083                                 else if (flag == "vector")
1084                                         flgs |= Format::vector;
1085                                 else
1086                                         LYXERR0("Ignoring unknown flag `"
1087                                                << flag << "' for format `"
1088                                                << format << "'.");
1089                         }
1090                         if (prettyname.empty()) {
1091                                 if (theConverters().formatIsUsed(format))
1092                                         LYXERR0("Can't delete format " << format);
1093                                 else
1094                                         formats.erase(format);
1095                         } else {
1096                                 formats.add(format, extension, prettyname,
1097                                             shortcut, viewer, editor, flgs);
1098                         }
1099                         break;
1100                 }
1101                 case RC_VIEWER_ALTERNATIVES:  {
1102                         string format, command;
1103                         if (lexrc.next())
1104                                 format = lexrc.getString();
1105                         if (lexrc.eatLine())
1106                                 command = lexrc.getString();
1107                         viewer_alternatives[format].insert(command);
1108                         break;
1109                 }
1110                 case RC_EDITOR_ALTERNATIVES:  {
1111                         string format, command;
1112                         lexrc >> format >> command;
1113                         editor_alternatives[format].insert(command);
1114                         break;
1115                 }
1116
1117                 case RC_DEFAULT_VIEW_FORMAT:
1118                         lexrc >> default_view_format;
1119                         break;
1120                         
1121                 case RC_DEFAULT_LANGUAGE:
1122                         lexrc >> default_language;
1123                         break;
1124
1125                 case RC_GUI_LANGUAGE:
1126                         lexrc >> gui_language;
1127                         break;
1128
1129                 case RC_SHOW_BANNER:
1130                         lexrc >> show_banner;
1131                         break;
1132
1133                 case RC_PREVIEW:
1134                         if (lexrc.next()) {
1135                                 string const tmp = lexrc.getString();
1136                                 if (tmp == "true" || tmp == "on")
1137                                         preview = PREVIEW_ON;
1138                                 else if (tmp == "no_math")
1139                                         preview = PREVIEW_NO_MATH;
1140                                 else {
1141                                         preview = PREVIEW_OFF;
1142                                         if (tmp != "false" && tmp != "off")
1143                                                 LYXERR0("Unrecognized preview status \""
1144                                                        << tmp << '\n');
1145                                 }
1146                         }
1147                         break;
1148
1149                 case RC_PREVIEW_HASHED_LABELS:
1150                         lexrc >> preview_hashed_labels;
1151                         break;
1152
1153                 case RC_PREVIEW_SCALE_FACTOR:
1154                         lexrc >> preview_scale_factor;
1155                         break;
1156
1157                 case RC_USER_NAME:
1158                         lexrc >> user_name;
1159                         break;
1160                 case RC_USER_EMAIL:
1161                         lexrc >> user_email;
1162                         break;
1163
1164                 case RC_PATH_PREFIX:
1165                         lexrc >> path_prefix;
1166                         break;
1167
1168                 case RC_USE_CONVERTER_CACHE:
1169                         lexrc >> use_converter_cache;
1170                         break;
1171                 case RC_CONVERTER_CACHE_MAXAGE:
1172                         lexrc >> converter_cache_maxage;
1173                         break;
1174
1175                 case RC_SORT_LAYOUTS:
1176                         lexrc >> sort_layouts;
1177                         break;
1178                 case RC_GROUP_LAYOUTS:
1179                         lexrc >> group_layouts;
1180                         break;
1181                 case RC_FULL_SCREEN_LIMIT:
1182                         lexrc >> full_screen_limit;
1183                         break;
1184                 case RC_FULL_SCREEN_TOOLBARS:
1185                         lexrc >> full_screen_toolbars;
1186                         break;
1187                 case RC_FULL_SCREEN_SCROLLBAR:
1188                         lexrc >> full_screen_scrollbar;
1189                         break;
1190                 case RC_FULL_SCREEN_TABBAR:
1191                         lexrc >> full_screen_tabbar;
1192                         break;
1193                 case RC_FULL_SCREEN_MENUBAR:
1194                         lexrc >> full_screen_menubar;
1195                         break;
1196                 case RC_FULL_SCREEN_WIDTH:
1197                         lexrc >> full_screen_width;
1198                         break;
1199                 case RC_OPEN_BUFFERS_IN_TABS:
1200                         lexrc >> open_buffers_in_tabs;
1201                         break;
1202                 case RC_SINGLE_CLOSE_TAB_BUTTON:
1203                         lexrc >> single_close_tab_button;
1204                         break;
1205                 case RC_SINGLE_INSTANCE:
1206                         lexrc >> single_instance;
1207                         if (run_mode == PREFERRED)
1208                                 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1209                         break;
1210                 case RC_FORWARD_SEARCH_DVI:
1211                         if (lexrc.next(true)) 
1212                                 forward_search_dvi = lexrc.getString();
1213                         break;
1214                 case RC_FORWARD_SEARCH_PDF:
1215                         if (lexrc.next(true)) 
1216                                 forward_search_pdf = lexrc.getString();
1217                         break;
1218                 case RC_EXPORT_OVERWRITE:
1219                         if (lexrc.next()) {
1220                                 string const tmp = lexrc.getString();
1221                                 if (tmp == "all" || tmp == "true")
1222                                         export_overwrite = ALL_FILES;
1223                                 else if (tmp == "main")
1224                                         export_overwrite = MAIN_FILE;
1225                                 else {
1226                                         export_overwrite = NO_FILES;
1227                                         if (tmp != "ask" && tmp != "false")
1228                                                 LYXERR0("Unrecognized export_overwrite status \""
1229                                                        << tmp << '"');
1230                                 }
1231                         }
1232                         break;
1233                 case RC_SCROLL_WHEEL_ZOOM:
1234                         if (lexrc.next()) {
1235                                 string const tmp = lexrc.getString();
1236                                 if (tmp == "ctrl")
1237                                         scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1238                                 else if (tmp == "shift")
1239                                         scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1240                                 else if (tmp == "alt")
1241                                         scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1242                                 else {
1243                                         scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1244                                         if (tmp != "off" && tmp != "false")
1245                                                 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1246                                                        << tmp << '"');
1247                                 }
1248                         }
1249                         break;
1250
1251                 // Obsoteted in 1.4.0
1252                 case RC_USETEMPDIR:
1253                 // Obsoleted in 2.0
1254                 case RC_SPELL_COMMAND:
1255                 case RC_PERS_DICT:
1256                 case RC_PLAINTEXT_ROFF_COMMAND: 
1257                 case RC_USE_ALT_LANG:
1258                 case RC_USE_ESC_CHARS:
1259                 case RC_USE_INP_ENC:
1260                 case RC_USE_PERS_DICT:
1261                 case RC_USE_SPELL_LIB:
1262                         LYXERR(Debug::LYXRC, "Skipping obsolete tag `" 
1263                                << lexrc.getString() << "'.");
1264                         lexrc.next(true);
1265                         break;
1266
1267                 case RC_LAST:
1268                         break; // this is just a dummy
1269                 }
1270         }
1271
1272         /// Update converters data-structures
1273         theConverters().update(formats);
1274         theConverters().buildGraph();
1275
1276         return 0;
1277 }
1278
1279
1280 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1281 {
1282         ofstream ofs(filename.toFilesystemEncoding().c_str());
1283         if (ofs)
1284                 write(ofs, ignore_system_lyxrc);
1285 }
1286
1287
1288 void LyXRC::print() const
1289 {
1290         if (lyxerr.debugging())
1291                 write(lyxerr, false);
1292         else
1293                 write(cout, false);
1294 }
1295
1296
1297 class SameMover {
1298 public:
1299         typedef pair<string, SpecialisedMover> Data;
1300
1301         SameMover(Data const & comparison)
1302                 : comparison_(comparison) {}
1303
1304         bool operator()(Data const & data) const
1305         {
1306                 return data.first == comparison_.first &&
1307                         data.second.command() == comparison_.second.command();
1308         }
1309
1310 private:
1311         Data comparison_;
1312 };
1313
1314
1315 namespace {
1316
1317         // Escape \ and " so that LyXLex can read the string later
1318         string escapeCommand(string const & str) {
1319                 return subst(subst(str , "\\", "\\\\"), 
1320                              "\"", "\\\"");
1321         }
1322
1323 }
1324
1325
1326 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1327 {
1328         LyXRCTags tag = RC_LAST;
1329         
1330         if (!name.empty()) {
1331                 for (int i = 0; i != lyxrcCount; ++i)
1332                         if ("\\" + name == lyxrcTags[i].tag)
1333                                 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1334         }
1335
1336         if (tag == RC_LAST)
1337                 os << "# LyX " << lyx_version
1338                    << " generated this file. If you want to make your own\n"
1339                    << "# modifications you should do them from inside LyX and save.\n"
1340                    << "\n";
1341
1342         // Why the switch you might ask. It is a trick to ensure that all
1343         // the elements in the LyXRCTags enum are handled. As you can see
1344         // there are no breaks at all. So it is just a huge fall-through.
1345         // The nice thing is that we will get a warning from the compiler
1346         // if we forget an element.
1347         switch (tag) {
1348         case RC_LAST:
1349         case RC_INPUT:
1350                 // input/include files are not done here
1351         case RC_BINDFILE:
1352                 if (ignore_system_lyxrc ||
1353                     bind_file != system_lyxrc.bind_file) {
1354                         string const path = os::external_path(bind_file);
1355                         os << "\\bind_file \"" << path << "\"\n";
1356                 }
1357                 if (tag != RC_LAST)
1358                         break;
1359
1360         case RC_DEFFILE:
1361                 if (ignore_system_lyxrc ||
1362                     def_file != system_lyxrc.def_file) {
1363                         string const path = os::external_path(def_file);
1364                         os << "\\def_file \"" << path << "\"\n";
1365                 }
1366                 if (tag != RC_LAST)
1367                         break;
1368
1369                 //
1370                 // Misc Section
1371                 //
1372                 os << "\n#\n"
1373                    << "# MISC SECTION ######################################\n"
1374                    << "#\n\n";
1375                 // bind files are not done here.
1376
1377         case RC_PATH_PREFIX:
1378                 if (ignore_system_lyxrc ||
1379                     path_prefix != system_lyxrc.path_prefix) {
1380                         os << "\\path_prefix \"" << path_prefix << "\"\n";
1381                 }
1382                 if (tag != RC_LAST)
1383                         break;
1384         case RC_UIFILE:
1385                 if (ignore_system_lyxrc ||
1386                     ui_file != system_lyxrc.ui_file) {
1387                         string const path = os::external_path(ui_file);
1388                         os << "\\ui_file \"" << path << "\"\n";
1389                 }
1390                 if (tag != RC_LAST)
1391                         break;
1392         case RC_AUTOREGIONDELETE:
1393                 if (ignore_system_lyxrc ||
1394                     auto_region_delete != system_lyxrc.auto_region_delete) {
1395                         os << "# Set to false to inhibit automatic replacement of\n"
1396                            << "# the current selection.\n"
1397                            << "\\auto_region_delete " << convert<string>(auto_region_delete)
1398                            << '\n';
1399                 }
1400                 if (tag != RC_LAST)
1401                         break;
1402         case RC_AUTORESET_OPTIONS:
1403                 if (ignore_system_lyxrc ||
1404                     auto_reset_options != system_lyxrc.auto_reset_options) {
1405                         os << "# Set to false to inhibit automatic reset of\n"
1406                            << "# the class options to defaults on class change.\n"
1407                            << "\\auto_reset_options "
1408                            << convert<string>(auto_reset_options)
1409                            << '\n';
1410                 }
1411                 if (tag != RC_LAST)
1412                         break;
1413         case RC_AUTOSAVE:
1414                 if (ignore_system_lyxrc ||
1415                     autosave != system_lyxrc.autosave) {
1416                         os << "# The time interval between auto-saves in seconds.\n"
1417                            << "\\autosave " << autosave << '\n';
1418                 }
1419                 if (tag != RC_LAST)
1420                         break;
1421         case RC_DISPLAY_GRAPHICS:
1422                 if (ignore_system_lyxrc ||
1423                     display_graphics != system_lyxrc.display_graphics) {
1424                         os << "# Display graphics within LyX\n"
1425                            << "# true|false\n"
1426                            << "\\display_graphics "
1427                            << (display_graphics ? "true" : "false")
1428                            << '\n';
1429                 }
1430                 if (tag != RC_LAST)
1431                         break;
1432         case RC_SORT_LAYOUTS:
1433                 if (ignore_system_lyxrc ||
1434                     sort_layouts != system_lyxrc.sort_layouts) {
1435                         os << "# Sort layouts alphabetically.\n"
1436                            << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1437                 }
1438                 if (tag != RC_LAST)
1439                         break;
1440         case RC_GROUP_LAYOUTS:
1441                 if (ignore_system_lyxrc ||
1442                     group_layouts != system_lyxrc.group_layouts) {
1443                         os << "# Group layouts by their category.\n"
1444                            << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1445                 }
1446                 if (tag != RC_LAST)
1447                         break;
1448         case RC_VIEWDVI_PAPEROPTION:
1449                 if (ignore_system_lyxrc ||
1450                     view_dvi_paper_option
1451                     != system_lyxrc.view_dvi_paper_option) {
1452                         os << "# Options used to specify paper size to the\n"
1453                            << "# view_dvi_command (e.g. -paper)\n"
1454                            << "\\view_dvi_paper_option \""
1455                            << view_dvi_paper_option << "\"\n";
1456                 }
1457                 if (tag != RC_LAST)
1458                         break;
1459         case RC_DEFAULT_PAPERSIZE:
1460                 if (ignore_system_lyxrc ||
1461                     default_papersize != system_lyxrc.default_papersize) {
1462                         os << "# The default papersize to use.\n"
1463                            << "\\default_papersize \"";
1464                         switch (default_papersize) {
1465                         case PAPER_DEFAULT:
1466                                 os << "default"; break;
1467                         case PAPER_USLETTER:
1468                                 os << "usletter"; break;
1469                         case PAPER_USLEGAL:
1470                                 os << "legal"; break;
1471                         case PAPER_USEXECUTIVE:
1472                                 os << "executive"; break;
1473                         case PAPER_A3:
1474                                 os << "a3"; break;
1475                         case PAPER_A4:
1476                                 os << "a4"; break;
1477                         case PAPER_A5:
1478                                 os << "a5"; break;
1479                         case PAPER_B5:
1480                                 os << "b5"; break;
1481                         case PAPER_CUSTOM:
1482                         case PAPER_A0:
1483                         case PAPER_A1:
1484                         case PAPER_A2:
1485                         case PAPER_A6:
1486                         case PAPER_B0:
1487                         case PAPER_B1:
1488                         case PAPER_B2:
1489                         case PAPER_B3:
1490                         case PAPER_B4:
1491                         case PAPER_B6:
1492                         case PAPER_C0:
1493                         case PAPER_C1:
1494                         case PAPER_C2:
1495                         case PAPER_C3:
1496                         case PAPER_C4:
1497                         case PAPER_C5:
1498                         case PAPER_C6:
1499                         case PAPER_JISB0:
1500                         case PAPER_JISB1:
1501                         case PAPER_JISB2:
1502                         case PAPER_JISB3:
1503                         case PAPER_JISB4:
1504                         case PAPER_JISB5:
1505                         case PAPER_JISB6: break;
1506                         }
1507                         os << "\"\n";
1508                 }
1509                 if (tag != RC_LAST)
1510                         break;
1511         case RC_CHKTEX_COMMAND:
1512                 if (ignore_system_lyxrc ||
1513                     chktex_command != system_lyxrc.chktex_command) {
1514                         os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1515                 }
1516                 if (tag != RC_LAST)
1517                         break;
1518         case RC_BIBTEX_ALTERNATIVES: {
1519                 CommandSet::const_iterator it = bibtex_alternatives.begin();
1520                 CommandSet::const_iterator end = bibtex_alternatives.end();
1521                 for ( ; it != end; ++it) {
1522                         if (ignore_system_lyxrc
1523                             || !system_lyxrc.bibtex_alternatives.count(*it))
1524                                 os << "\\bibtex_alternatives \""
1525                                    << *it << "\"\n";
1526                 }
1527                 if (tag != RC_LAST)
1528                         break;
1529         }
1530         case RC_BIBTEX_COMMAND:
1531                 if (ignore_system_lyxrc ||
1532                     bibtex_command != system_lyxrc.bibtex_command) {
1533                         os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1534                 }
1535                 if (tag != RC_LAST)
1536                         break;
1537         case RC_JBIBTEX_COMMAND:
1538                 if (ignore_system_lyxrc ||
1539                     jbibtex_command != system_lyxrc.jbibtex_command) {
1540                         os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1541                 }
1542                 if (tag != RC_LAST)
1543                         break;
1544         case RC_INDEX_ALTERNATIVES: {
1545                 CommandSet::const_iterator it = index_alternatives.begin();
1546                 CommandSet::const_iterator end = index_alternatives.end();
1547                 for ( ; it != end; ++it) {
1548                         if (ignore_system_lyxrc
1549                             || !system_lyxrc.index_alternatives.count(*it))
1550                                 os << "\\index_alternatives \""
1551                                    << *it << "\"\n";
1552                 }
1553                 if (tag != RC_LAST)
1554                         break;
1555         }
1556         case RC_INDEX_COMMAND:
1557                 if (ignore_system_lyxrc ||
1558                     index_command != system_lyxrc.index_command) {
1559                         os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1560                 }
1561                 if (tag != RC_LAST)
1562                         break;
1563         case RC_JINDEX_COMMAND:
1564                 if (ignore_system_lyxrc ||
1565                     jindex_command != system_lyxrc.jindex_command) {
1566                         os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1567                 }
1568                 if (tag != RC_LAST)
1569                         break;
1570         case RC_SPLITINDEX_COMMAND:
1571                 if (ignore_system_lyxrc ||
1572                     splitindex_command != system_lyxrc.splitindex_command) {
1573                         os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1574                 }
1575                 if (tag != RC_LAST)
1576                         break;
1577         case RC_NOMENCL_COMMAND:
1578                 if (ignore_system_lyxrc ||
1579                     nomencl_command != system_lyxrc.nomencl_command) {
1580                         os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1581                 }
1582                 if (tag != RC_LAST)
1583                         break;
1584         case RC_TEX_EXPECTS_WINDOWS_PATHS:
1585                 if (ignore_system_lyxrc ||
1586                     windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1587                         os << "\\tex_expects_windows_paths "
1588                            << convert<string>(windows_style_tex_paths) << '\n';
1589                 }
1590                 if (tag != RC_LAST)
1591                         break;
1592         case RC_TEX_ALLOWS_SPACES:
1593                 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1594                         os << "\\tex_allows_spaces "
1595                            << convert<string>(tex_allows_spaces) << '\n';
1596                 }
1597                 if (tag != RC_LAST)
1598                         break;
1599         case RC_KBMAP:
1600                 if (ignore_system_lyxrc ||
1601                     use_kbmap != system_lyxrc.use_kbmap) {
1602                         os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1603                 }
1604                 if (tag != RC_LAST)
1605                         break;
1606         case RC_KBMAP_PRIMARY:
1607                 if (ignore_system_lyxrc ||
1608                     primary_kbmap != system_lyxrc.primary_kbmap) {
1609                         string const path = os::external_path(primary_kbmap);
1610                         os << "\\kbmap_primary \"" << path << "\"\n";
1611                 }
1612                 if (tag != RC_LAST)
1613                         break;
1614         case RC_KBMAP_SECONDARY:
1615                 if (ignore_system_lyxrc ||
1616                     secondary_kbmap != system_lyxrc.secondary_kbmap) {
1617                         string const path = os::external_path(secondary_kbmap);
1618                         os << "\\kbmap_secondary \"" << path << "\"\n";
1619                 }
1620                 if (tag != RC_LAST)
1621                         break;
1622         case RC_SERVERPIPE:
1623                 if (ignore_system_lyxrc ||
1624                     lyxpipes != system_lyxrc.lyxpipes) {
1625                         string const path = os::external_path(lyxpipes);
1626                         os << "\\serverpipe \"" << path << "\"\n";
1627                 }
1628                 if (tag != RC_LAST)
1629                         break;
1630         case RC_DATE_INSERT_FORMAT:
1631                 if (ignore_system_lyxrc ||
1632                     date_insert_format != system_lyxrc.date_insert_format) {
1633                         os << "\\date_insert_format \"" << date_insert_format
1634                            << "\"\n";
1635                 }
1636                 if (tag != RC_LAST)
1637                         break;
1638
1639         case RC_USER_NAME:
1640                 os << "\\user_name \"" << user_name << "\"\n";
1641                 if (tag != RC_LAST)
1642                         break;
1643
1644         case RC_USER_EMAIL:
1645                 os << "\\user_email \"" << user_email << "\"\n";
1646                 if (tag != RC_LAST)
1647                         break;
1648
1649         case RC_SHOW_BANNER:
1650                 if (ignore_system_lyxrc ||
1651                     show_banner != system_lyxrc.show_banner) {
1652                         os << "\\show_banner " << convert<string>(show_banner) << '\n';
1653                 }
1654                 if (tag != RC_LAST)
1655                         break;
1656
1657         case RC_PREVIEW:
1658                 if (ignore_system_lyxrc ||
1659                     preview != system_lyxrc.preview) {
1660                         string status;
1661                         switch (preview) {
1662                         case PREVIEW_ON:
1663                                 status = "on";
1664                                 break;
1665                         case PREVIEW_NO_MATH:
1666                                 status = "no_math";
1667                                 break;
1668                         case PREVIEW_OFF:
1669                                 status = "off";
1670                                 break;
1671                         }
1672                         os << "\\preview " << status << '\n';
1673                 }
1674                 if (tag != RC_LAST)
1675                         break;
1676
1677         case RC_PREVIEW_HASHED_LABELS:
1678                 if (ignore_system_lyxrc ||
1679                     preview_hashed_labels !=
1680                     system_lyxrc.preview_hashed_labels) {
1681                         os << "\\preview_hashed_labels "
1682                            << convert<string>(preview_hashed_labels) << '\n';
1683                 }
1684                 if (tag != RC_LAST)
1685                         break;
1686
1687         case RC_PREVIEW_SCALE_FACTOR:
1688                 if (ignore_system_lyxrc ||
1689                     preview_scale_factor != system_lyxrc.preview_scale_factor) {
1690                         os << "\\preview_scale_factor "
1691                            << preview_scale_factor << '\n';
1692                 }
1693                 if (tag != RC_LAST)
1694                         break;
1695
1696         case RC_USE_CONVERTER_CACHE:
1697                 if (ignore_system_lyxrc ||
1698                     use_converter_cache != system_lyxrc.use_converter_cache) {
1699                         os << "\\use_converter_cache "
1700                            << convert<string>(use_converter_cache) << '\n';
1701                 }
1702                 if (tag != RC_LAST)
1703                         break;
1704
1705         case RC_CONVERTER_CACHE_MAXAGE:
1706                 if (ignore_system_lyxrc ||
1707                     converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1708                         os << "\\converter_cache_maxage "
1709                            << converter_cache_maxage << '\n';
1710                 }
1711                 if (tag != RC_LAST)
1712                         break;
1713
1714                 os << "\n#\n"
1715                    << "# SCREEN & FONTS SECTION ############################\n"
1716                    << "#\n\n";
1717
1718         case RC_SCREEN_DPI:
1719                 if (ignore_system_lyxrc ||
1720                     dpi != system_lyxrc.dpi) {
1721                         os << "\\screen_dpi " << dpi << '\n';
1722                 }
1723                 if (tag != RC_LAST)
1724                         break;
1725         case RC_SCREEN_ZOOM:
1726                 if (ignore_system_lyxrc ||
1727                     zoom != system_lyxrc.zoom) {
1728                         os << "\\screen_zoom " << zoom << '\n';
1729                 }
1730                 if (tag != RC_LAST)
1731                         break;
1732         case RC_GEOMETRY_SESSION:
1733                 if (ignore_system_lyxrc ||
1734                     allow_geometry_session != system_lyxrc.allow_geometry_session) {
1735                         os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1736                            << '\n';
1737                 }
1738                 if (tag != RC_LAST)
1739                         break;
1740         case RC_CURSOR_FOLLOWS_SCROLLBAR:
1741                 if (ignore_system_lyxrc ||
1742                     cursor_follows_scrollbar
1743                     != system_lyxrc.cursor_follows_scrollbar) {
1744                         os << "\\cursor_follows_scrollbar "
1745                            << convert<string>(cursor_follows_scrollbar) << '\n';
1746                 }
1747                 if (tag != RC_LAST)
1748                         break;
1749         case RC_SCROLL_BELOW_DOCUMENT:
1750                 if (ignore_system_lyxrc ||
1751                     scroll_below_document
1752                     != system_lyxrc.scroll_below_document) {
1753                         os << "\\scroll_below_document "
1754                            << convert<string>(scroll_below_document) << '\n';
1755                 }
1756                 if (tag != RC_LAST)
1757                         break;
1758         case RC_PARAGRAPH_MARKERS:
1759                 if (ignore_system_lyxrc ||
1760                         paragraph_markers
1761                     != system_lyxrc.paragraph_markers) {
1762                         os << "\\paragraph_markers "
1763                            << convert<string>(paragraph_markers) << '\n';
1764                 }
1765                 if (tag != RC_LAST)
1766                         break;
1767         case RC_MAC_DONTSWAP_CTRL_META:
1768                 if (ignore_system_lyxrc ||
1769                     mac_dontswap_ctrl_meta
1770                     != system_lyxrc.mac_dontswap_ctrl_meta) {
1771                         os << "\\mac_dontswap_ctrl_meta "
1772                            << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1773                 }
1774                 if (tag != RC_LAST)
1775                         break;
1776         case RC_MAC_LIKE_WORD_MOVEMENT:
1777                 if (ignore_system_lyxrc ||
1778                     mac_like_word_movement
1779                     != system_lyxrc.mac_like_word_movement) {
1780                         os << "\\mac_like_word_movement "
1781                            << convert<string>(mac_like_word_movement) << '\n';
1782                 }
1783                 if (tag != RC_LAST)
1784                         break;
1785         case RC_MACRO_EDIT_STYLE:
1786                 if (ignore_system_lyxrc ||
1787                     macro_edit_style
1788                     != system_lyxrc.macro_edit_style) {
1789                         os << "\\macro_edit_style ";
1790                         switch (macro_edit_style) {
1791                         case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1792                         case MACRO_EDIT_INLINE: os << "1\n"; break;
1793                         case MACRO_EDIT_LIST: os << "2\n"; break;
1794                         }
1795                 }
1796                 if (tag != RC_LAST)
1797                         break;
1798         case RC_DIALOGS_ICONIFY_WITH_MAIN:
1799                 if (ignore_system_lyxrc ||
1800                     dialogs_iconify_with_main
1801                    != system_lyxrc.dialogs_iconify_with_main) {
1802                         os << "\\dialogs_iconify_with_main "
1803                           <<  convert<string>(dialogs_iconify_with_main) << '\n';
1804                 }
1805                 if (tag != RC_LAST)
1806                         break;
1807         case RC_SCREEN_FONT_ROMAN:
1808                 if (ignore_system_lyxrc ||
1809                     roman_font_name != system_lyxrc.roman_font_name) {
1810                         os << "\\screen_font_roman \"" << roman_font_name
1811                            << "\"\n";
1812                 }
1813                 if (tag != RC_LAST)
1814                         break;
1815         case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1816                 if (ignore_system_lyxrc ||
1817                     roman_font_foundry != system_lyxrc.roman_font_foundry) {
1818                         os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1819                            << "\"\n";
1820                 }
1821                 if (tag != RC_LAST)
1822                         break;
1823         case RC_SCREEN_FONT_SANS:
1824                 if (ignore_system_lyxrc ||
1825                     sans_font_name != system_lyxrc.sans_font_name) {
1826                         os << "\\screen_font_sans \"" << sans_font_name
1827                            << "\"\n";
1828                 }
1829                 if (tag != RC_LAST)
1830                         break;
1831         case RC_SCREEN_FONT_SANS_FOUNDRY:
1832                 if (ignore_system_lyxrc ||
1833                     sans_font_foundry != system_lyxrc.sans_font_foundry) {
1834                         os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1835                            << "\"\n";
1836                 }
1837                 if (tag != RC_LAST)
1838                         break;
1839         case RC_SCREEN_FONT_TYPEWRITER:
1840                 if (ignore_system_lyxrc ||
1841                     typewriter_font_name != system_lyxrc.typewriter_font_name) {
1842                         os << "\\screen_font_typewriter \""
1843                            << typewriter_font_name << "\"\n";
1844                 }
1845                 if (tag != RC_LAST)
1846                         break;
1847         case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1848                 if (ignore_system_lyxrc ||
1849                     typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1850                         os << "\\screen_font_typewriter_foundry \""
1851                            << typewriter_font_foundry << "\"\n";
1852                 }
1853                 if (tag != RC_LAST)
1854                         break;
1855
1856         case RC_SCREEN_FONT_SCALABLE:
1857                 if (ignore_system_lyxrc ||
1858                     use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1859                         os << "\\screen_font_scalable "
1860                            << convert<string>(use_scalable_fonts)
1861                            << '\n';
1862                 }
1863                 if (tag != RC_LAST)
1864                         break;
1865         case RC_SCREEN_FONT_SIZES:
1866                 if (ignore_system_lyxrc ||
1867                     font_sizes[FONT_SIZE_TINY]
1868                     != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1869                     font_sizes[FONT_SIZE_SCRIPT]
1870                     != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1871                     font_sizes[FONT_SIZE_FOOTNOTE]
1872                     != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1873                     font_sizes[FONT_SIZE_SMALL]
1874                     != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1875                     font_sizes[FONT_SIZE_NORMAL]
1876                     != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1877                     font_sizes[FONT_SIZE_LARGE]
1878                     != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1879                     font_sizes[FONT_SIZE_LARGER]
1880                     != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1881                     font_sizes[FONT_SIZE_LARGEST]
1882                     != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1883                     font_sizes[FONT_SIZE_HUGE]
1884                     != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1885                     font_sizes[FONT_SIZE_HUGER]
1886                     != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1887                         os.setf(ios::fixed);
1888                         os.precision(2);
1889                         os << "\\screen_font_sizes"
1890                            << ' ' << font_sizes[FONT_SIZE_TINY]
1891                            << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1892                            << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1893                            << ' ' << font_sizes[FONT_SIZE_SMALL]
1894                            << ' ' << font_sizes[FONT_SIZE_NORMAL]
1895                            << ' ' << font_sizes[FONT_SIZE_LARGE]
1896                            << ' ' << font_sizes[FONT_SIZE_LARGER]
1897                            << ' ' << font_sizes[FONT_SIZE_LARGEST]
1898                            << ' ' << font_sizes[FONT_SIZE_HUGE]
1899                            << ' ' << font_sizes[FONT_SIZE_HUGER]
1900                            << '\n';
1901                 }
1902                 if (tag != RC_LAST)
1903                         break;
1904         case RC_FULL_SCREEN_LIMIT:
1905                 if (ignore_system_lyxrc ||
1906                     full_screen_limit != system_lyxrc.full_screen_limit) {
1907                         os << "\\fullscreen_limit "
1908                            << convert<string>(full_screen_limit)
1909                            << '\n';
1910                 }
1911                 if (tag != RC_LAST)
1912                         break;
1913         case RC_FULL_SCREEN_TOOLBARS:
1914                 if (ignore_system_lyxrc ||
1915                     full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1916                         os << "\\fullscreen_toolbars "
1917                            << convert<string>(full_screen_toolbars)
1918                            << '\n';
1919                 }
1920                 if (tag != RC_LAST)
1921                         break;
1922         case RC_FULL_SCREEN_SCROLLBAR:
1923                 if (ignore_system_lyxrc ||
1924                     full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1925                         os << "\\fullscreen_scrollbar "
1926                            << convert<string>(full_screen_scrollbar)
1927                            << '\n';
1928                 }
1929                 if (tag != RC_LAST)
1930                         break;
1931         case RC_FULL_SCREEN_TABBAR:
1932                 if (ignore_system_lyxrc ||
1933                     full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1934                         os << "\\fullscreen_tabbar "
1935                            << convert<string>(full_screen_tabbar)
1936                            << '\n';
1937                 }
1938                 if (tag != RC_LAST)
1939                         break;
1940         case RC_FULL_SCREEN_MENUBAR:
1941                 if (ignore_system_lyxrc ||
1942                     full_screen_menubar != system_lyxrc.full_screen_menubar) {
1943                         os << "\\fullscreen_menubar "
1944                            << convert<string>(full_screen_menubar)
1945                            << '\n';
1946                 }
1947                 if (tag != RC_LAST)
1948                         break;
1949         case RC_FULL_SCREEN_WIDTH:
1950                 if (ignore_system_lyxrc ||
1951                     full_screen_width != system_lyxrc.full_screen_width) {
1952                         os << "\\fullscreen_width "
1953                            << convert<string>(full_screen_width)
1954                            << '\n';
1955                 }
1956                 if (tag != RC_LAST)
1957                         break;
1958         case RC_OPEN_BUFFERS_IN_TABS:
1959                 if (ignore_system_lyxrc ||
1960                     open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1961                         os << "\\open_buffers_in_tabs "
1962                            << convert<string>(open_buffers_in_tabs)
1963                            << '\n';
1964                 }
1965                 if (tag != RC_LAST)
1966                         break;
1967         case RC_SINGLE_CLOSE_TAB_BUTTON:
1968                 if (ignore_system_lyxrc ||
1969                     single_close_tab_button != system_lyxrc.single_close_tab_button) {
1970                         os << "\\single_close_tab_button "
1971                            << convert<string>(single_close_tab_button)
1972                            << '\n';
1973                 }
1974                 if (tag != RC_LAST)
1975                         break;
1976         case RC_SINGLE_INSTANCE:
1977                 if (ignore_system_lyxrc ||
1978                     single_instance != system_lyxrc.single_instance) {
1979                         os << "\\single_instance "
1980                            << convert<string>(single_instance)
1981                            << '\n';
1982                 }
1983                 if (tag != RC_LAST)
1984                         break;
1985         case RC_FORWARD_SEARCH_DVI:
1986                 if (ignore_system_lyxrc ||
1987                     forward_search_dvi != system_lyxrc.forward_search_dvi) {
1988                         os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1989                 }
1990                 if (tag != RC_LAST)
1991                         break;
1992         case RC_FORWARD_SEARCH_PDF:
1993                 if (ignore_system_lyxrc ||
1994                     forward_search_pdf != system_lyxrc.forward_search_pdf) {
1995                         os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1996                 }
1997                 if (tag != RC_LAST)
1998                         break;
1999
2000         os << "\n#\n"
2001                         << "# COLOR SECTION ###################################\n"
2002                         << "#\n\n";
2003
2004         case RC_SET_COLOR:
2005                 for (int i = 0; i < Color_ignore; ++i) {
2006                         ColorCode lc = static_cast<ColorCode>(i);
2007                         string const col = lcolor.getX11Name(lc);
2008                         if (ignore_system_lyxrc
2009                             || col != system_lcolor.getX11Name(lc)) {
2010                                 os << "\\set_color \""
2011                                    << lcolor.getLyXName(lc) << "\" \""
2012                                    << col << "\"\n";
2013                         }
2014                 }
2015                 if (tag != RC_LAST)
2016                         break;
2017
2018                 os << "\n#\n"
2019                    << "# PRINTER SECTION ###################################\n"
2020                    << "#\n\n";
2021
2022         case RC_PRINTER:
2023                 if (ignore_system_lyxrc ||
2024                     printer != system_lyxrc.printer) {
2025                         os << "\\printer \"" << printer << "\"\n";
2026                 }
2027                 if (tag != RC_LAST)
2028                         break;
2029         case RC_PRINT_ADAPTOUTPUT:
2030                 if (ignore_system_lyxrc ||
2031                     print_adapt_output != system_lyxrc.print_adapt_output) {
2032                         os << "\\print_adapt_output "
2033                            << convert<string>(print_adapt_output)
2034                            << '\n';
2035                 }
2036                 if (tag != RC_LAST)
2037                         break;
2038         case RC_PRINT_COMMAND:
2039                 if (ignore_system_lyxrc ||
2040                     print_command != system_lyxrc.print_command) {
2041                         os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2042                 }
2043                 if (tag != RC_LAST)
2044                         break;
2045         case RC_PRINTEXSTRAOPTIONS:
2046                 if (ignore_system_lyxrc ||
2047                     print_extra_options != system_lyxrc.print_extra_options) {
2048                         os << "\\print_extra_options \"" << print_extra_options
2049                            << "\"\n";
2050                 }
2051                 if (tag != RC_LAST)
2052                         break;
2053         case RC_PRINTSPOOL_COMMAND:
2054                 if (ignore_system_lyxrc ||
2055                     print_spool_command != system_lyxrc.print_spool_command) {
2056                         os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2057                            << "\"\n";
2058                 }
2059                 if (tag != RC_LAST)
2060                         break;
2061         case RC_PRINTSPOOL_PRINTERPREFIX:
2062                 if (ignore_system_lyxrc ||
2063                     print_spool_printerprefix
2064                     != system_lyxrc.print_spool_printerprefix) {
2065                         os << "\\print_spool_printerprefix \""
2066                            << print_spool_printerprefix << "\"\n";
2067                 }
2068                 if (tag != RC_LAST)
2069                         break;
2070         case RC_PRINTEVENPAGEFLAG:
2071                 if (ignore_system_lyxrc ||
2072                     print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2073                         os << "\\print_evenpage_flag \"" << print_evenpage_flag
2074                            << "\"\n";
2075                 }
2076                 if (tag != RC_LAST)
2077                         break;
2078         case RC_PRINTODDPAGEFLAG:
2079                 if (ignore_system_lyxrc ||
2080                     print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2081                         os << "\\print_oddpage_flag \"" << print_oddpage_flag
2082                            << "\"\n";
2083                 }
2084                 if (tag != RC_LAST)
2085                         break;
2086         case RC_PRINTREVERSEFLAG:
2087                 if (ignore_system_lyxrc ||
2088                     print_reverse_flag != system_lyxrc.print_reverse_flag) {
2089                         os << "\\print_reverse_flag \"" << print_reverse_flag
2090                            << "\"\n";
2091                 }
2092                 if (tag != RC_LAST)
2093                         break;
2094         case RC_PRINTLANDSCAPEFLAG:
2095                 if (ignore_system_lyxrc ||
2096                     print_landscape_flag != system_lyxrc.print_landscape_flag) {
2097                         os << "\\print_landscape_flag \"" << print_landscape_flag
2098                            << "\"\n";
2099                 }
2100                 if (tag != RC_LAST)
2101                         break;
2102         case RC_PRINTPAGERANGEFLAG:
2103                 if (ignore_system_lyxrc ||
2104                     print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2105                         os << "\\print_pagerange_flag \"" << print_pagerange_flag
2106                            << "\"\n";
2107                 }
2108                 if (tag != RC_LAST)
2109                         break;
2110         case RC_PRINTCOPIESFLAG:
2111                 if (ignore_system_lyxrc ||
2112                     print_copies_flag != system_lyxrc.print_copies_flag) {
2113                         os << "\\print_copies_flag \"" << print_copies_flag
2114                            << "\"\n";
2115                 }
2116                 if (tag != RC_LAST)
2117                         break;
2118         case RC_PRINTCOLLCOPIESFLAG:
2119                 if (ignore_system_lyxrc ||
2120                     print_collcopies_flag
2121                     != system_lyxrc.print_collcopies_flag) {
2122                         os << "\\print_collcopies_flag \""
2123                            << print_collcopies_flag
2124                            << "\"\n";
2125                 }
2126                 if (tag != RC_LAST)
2127                         break;
2128         case RC_PRINTPAPERFLAG:
2129                 if (ignore_system_lyxrc ||
2130                     print_paper_flag != system_lyxrc.print_paper_flag) {
2131                         os << "\\print_paper_flag \"" << print_paper_flag
2132                            << "\"\n";
2133                 }
2134                 if (tag != RC_LAST)
2135                         break;
2136         case RC_PRINTPAPERDIMENSIONFLAG:
2137                 if (ignore_system_lyxrc ||
2138                     print_paper_dimension_flag
2139                     != system_lyxrc.print_paper_dimension_flag) {
2140                         os << "\\print_paper_dimension_flag \""
2141                            << print_paper_dimension_flag << "\"\n";
2142                 }
2143                 if (tag != RC_LAST)
2144                         break;
2145         case RC_PRINTTOPRINTER:
2146                 if (ignore_system_lyxrc ||
2147                     print_to_printer != system_lyxrc.print_to_printer) {
2148                         os << "\\print_to_printer \"" << print_to_printer
2149                            << "\"\n";
2150                 }
2151                 if (tag != RC_LAST)
2152                         break;
2153         case RC_PRINTTOFILE:
2154                 if (ignore_system_lyxrc ||
2155                     print_to_file != system_lyxrc.print_to_file) {
2156                         string const path = os::external_path(print_to_file);
2157                         os << "\\print_to_file \"" << path << "\"\n";
2158                 }
2159                 if (tag != RC_LAST)
2160                         break;
2161         case RC_PRINTFILEEXTENSION:
2162                 if (ignore_system_lyxrc ||
2163                     print_file_extension != system_lyxrc.print_file_extension) {
2164                         os << "\\print_file_extension \""
2165                            << print_file_extension
2166                            << "\"\n";
2167                 }
2168                 if (tag != RC_LAST)
2169                         break;
2170
2171                 os << "\n#\n"
2172                    << "# TEX SECTION #######################################\n"
2173                    << "#\n\n";
2174
2175         case RC_FONT_ENCODING:
2176                 if (ignore_system_lyxrc ||
2177                     fontenc != system_lyxrc.fontenc) {
2178                         os << "\\font_encoding \"" << fontenc << "\"\n";
2179                 }
2180                 if (tag != RC_LAST)
2181                         break;
2182
2183                 os << "\n#\n"
2184                    << "# FILE SECTION ######################################\n"
2185                    << "#\n\n";
2186
2187         case RC_DOCUMENTPATH:
2188                 if (ignore_system_lyxrc ||
2189                     document_path != system_lyxrc.document_path) {
2190                         string const path = os::external_path(document_path);
2191                         os << "\\document_path \"" << path << "\"\n";
2192                 }
2193                 if (tag != RC_LAST)
2194                         break;
2195         case RC_USELASTFILEPOS:
2196                 if (ignore_system_lyxrc ||
2197                     use_lastfilepos != system_lyxrc.use_lastfilepos) {
2198                         os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2199                            << '\n';
2200                 }
2201                 if (tag != RC_LAST)
2202                         break;
2203         case RC_LOADSESSION:
2204                 if (ignore_system_lyxrc ||
2205                     load_session != system_lyxrc.load_session) {
2206                         os << "\\load_session " << convert<string>(load_session)
2207                            << "\n";
2208                 }
2209                 if (tag != RC_LAST)
2210                         break;
2211         case RC_MOUSE_WHEEL_SPEED:
2212                 if (ignore_system_lyxrc ||
2213                     mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2214                         os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2215                 }
2216                 if (tag != RC_LAST)
2217                         break;
2218         case RC_COMPLETION_INLINE_DELAY:
2219                 if (ignore_system_lyxrc ||
2220                     completion_inline_delay != system_lyxrc.completion_inline_delay) {
2221                         os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2222                 }
2223                 if (tag != RC_LAST)
2224                         break;
2225         case RC_COMPLETION_INLINE_MATH:
2226                 if (ignore_system_lyxrc ||
2227                     completion_inline_math != system_lyxrc.completion_inline_math) {
2228                         os << "\\completion_inline_math "
2229                                 << convert<string>(completion_inline_math) << '\n';
2230                 }
2231                 if (tag != RC_LAST)
2232                         break;
2233         case RC_COMPLETION_INLINE_TEXT:
2234                 if (ignore_system_lyxrc ||
2235                     completion_inline_text != system_lyxrc.completion_inline_text) {
2236                         os << "\\completion_inline_text "
2237                                 << convert<string>(completion_inline_text) << '\n';
2238                 }
2239                 if (tag != RC_LAST)
2240                         break;
2241         case RC_COMPLETION_INLINE_DOTS:
2242                 if (ignore_system_lyxrc ||
2243                     completion_inline_dots != system_lyxrc.completion_inline_dots) {
2244                         os << "\\completion_inline_dots "
2245                                 << convert<string>(completion_inline_dots) << '\n';
2246                 }
2247                 if (tag != RC_LAST)
2248                         break;
2249         case RC_AUTOCORRECTION_MATH:
2250                 if (ignore_system_lyxrc ||
2251                     autocorrection_math != system_lyxrc.autocorrection_math) {
2252                         os << "\\autocorrection_math "
2253                                 << convert<string>(autocorrection_math) << '\n';
2254                 }
2255                 if (tag != RC_LAST)
2256                         break;
2257         case RC_COMPLETION_POPUP_DELAY:
2258                 if (ignore_system_lyxrc ||
2259                     completion_popup_delay != system_lyxrc.completion_popup_delay) {
2260                         os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2261                 }
2262                 if (tag != RC_LAST)
2263                         break;
2264         case RC_COMPLETION_POPUP_MATH:
2265                 if (ignore_system_lyxrc ||
2266                     completion_popup_math != system_lyxrc.completion_popup_math) {
2267                         os << "\\completion_popup_math "
2268                                 << convert<string>(completion_popup_math) << '\n';
2269                 }
2270                 if (tag != RC_LAST)
2271                         break;
2272         case RC_COMPLETION_POPUP_TEXT:
2273                 if (ignore_system_lyxrc ||
2274                     completion_popup_text != system_lyxrc.completion_popup_text) {
2275                         os << "\\completion_popup_text "
2276                                 << convert<string>(completion_popup_text) << '\n';
2277                 }
2278                 if (tag != RC_LAST)
2279                         break;
2280         case RC_COMPLETION_CURSOR_TEXT:
2281                 if (ignore_system_lyxrc ||
2282                     completion_cursor_text != system_lyxrc.completion_cursor_text) {
2283                         os << "\\completion_cursor_text "
2284                            << convert<string>(completion_cursor_text) << '\n';
2285                 }
2286                 if (tag != RC_LAST)
2287                         break;
2288         case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2289                 if (ignore_system_lyxrc ||
2290                     completion_popup_after_complete
2291                     != system_lyxrc.completion_popup_after_complete) {
2292                         os << "\\completion_popup_after_complete "
2293                                 << convert<string>(completion_popup_after_complete) << '\n';
2294                 }
2295                 if (tag != RC_LAST)
2296                         break;
2297         case RC_NUMLASTFILES:
2298                 if (ignore_system_lyxrc ||
2299                     num_lastfiles != system_lyxrc.num_lastfiles) {
2300                         os << "\\num_lastfiles " << num_lastfiles << '\n';
2301                 }
2302                 if (tag != RC_LAST)
2303                         break;
2304         case RC_CHECKLASTFILES:
2305                 if (ignore_system_lyxrc ||
2306                     check_lastfiles != system_lyxrc.check_lastfiles) {
2307                         os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2308                            << '\n';
2309                 }
2310                 if (tag != RC_LAST)
2311                         break;
2312         case RC_EXAMPLEPATH:
2313                 if (ignore_system_lyxrc ||
2314                     example_path != system_lyxrc.example_path) {
2315                         string const path = os::external_path(example_path);
2316                         os << "\\example_path \"" << path << "\"\n";
2317                 }
2318                 if (tag != RC_LAST)
2319                         break;
2320         case RC_TEMPLATEPATH:
2321                 if (ignore_system_lyxrc ||
2322                     template_path != system_lyxrc.template_path) {
2323                         string const path = os::external_path(template_path);
2324                         os << "\\template_path \"" << path << "\"\n";
2325                 }
2326                 if (tag != RC_LAST)
2327                         break;
2328         case RC_TEMPDIRPATH:
2329                 if (ignore_system_lyxrc ||
2330                     tempdir_path != system_lyxrc.tempdir_path) {
2331                         string const path = os::external_path(tempdir_path);
2332                         os << "\\tempdir_path \"" << path << "\"\n";
2333                 }
2334                 if (tag != RC_LAST)
2335                         break;
2336         case RC_THESAURUSDIRPATH:
2337                 if (ignore_system_lyxrc ||
2338                     thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2339                         string const path = os::external_path(thesaurusdir_path);
2340                         os << "\\thesaurusdir_path \"" << path << "\"\n";
2341                 }
2342                 if (tag != RC_LAST)
2343                         break;
2344         case RC_HUNSPELLDIR_PATH:
2345                 if (ignore_system_lyxrc ||
2346                     hunspelldir_path != system_lyxrc.hunspelldir_path) {
2347                         string const path = os::external_path(hunspelldir_path);
2348                         os << "\\hunspelldir_path \"" << path << "\"\n";
2349                 }
2350                 if (tag != RC_LAST)
2351                         break;
2352         case RC_USETEMPDIR:
2353                 if (tag != RC_LAST)
2354                         break;
2355                 // Ignore it
2356         case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2357                 if (tag != RC_LAST)
2358                         break;
2359         case RC_PLAINTEXT_LINELEN:
2360                 if (ignore_system_lyxrc ||
2361                     plaintext_linelen != system_lyxrc.plaintext_linelen) {
2362                         os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2363                 }
2364                 if (tag != RC_LAST)
2365                         break;
2366         case RC_MAKE_BACKUP:
2367                 if (ignore_system_lyxrc ||
2368                     make_backup != system_lyxrc.make_backup) {
2369                         os << "\\make_backup " << convert<string>(make_backup) << '\n';
2370                 }
2371                 if (tag != RC_LAST)
2372                         break;
2373         case RC_SAVE_COMPRESSED:
2374                 if (ignore_system_lyxrc ||
2375                     save_compressed != system_lyxrc.save_compressed) {
2376                         os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2377                 }
2378                 if (tag != RC_LAST)
2379                         break;
2380         case RC_BACKUPDIR_PATH:
2381                 if (ignore_system_lyxrc ||
2382                     backupdir_path != system_lyxrc.backupdir_path) {
2383                         string const path = os::external_path(backupdir_path);
2384                         os << "\\backupdir_path \"" << path << "\"\n";
2385                 }
2386                 if (tag != RC_LAST)
2387                         break;
2388
2389                 os << "\n#\n"
2390                    << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2391                    << "#\n\n";
2392
2393                 os << "\n#\n"
2394                    << "# SPELLCHECKER SECTION ##############################\n"
2395                    << "#\n\n";
2396
2397         case RC_SPELL_COMMAND:
2398         case RC_USE_SPELL_LIB:
2399                 // Obsoleted in 2.0
2400                 if (tag != RC_LAST)
2401                         break;
2402         case RC_ACCEPT_COMPOUND:
2403                 if (ignore_system_lyxrc ||
2404                     spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2405                         os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2406                            << '\n';
2407                 }
2408                 if (tag != RC_LAST)
2409                         break;
2410         case RC_USE_ALT_LANG:
2411                 // Obsoleted in 2.0
2412                 if (tag != RC_LAST)
2413                         break;
2414         case RC_ALT_LANG:
2415                 if (ignore_system_lyxrc ||
2416                     spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2417                         os << "\\alternate_language \"" << spellchecker_alt_lang
2418                            << "\"\n";
2419                 }
2420                 if (tag != RC_LAST)
2421                         break;
2422         case RC_USE_ESC_CHARS:
2423                 if (tag != RC_LAST)
2424                         break;
2425         case RC_ESC_CHARS:
2426                 if (ignore_system_lyxrc ||
2427                     spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2428                         os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2429                 }
2430                 if (tag != RC_LAST)
2431                         break;
2432         case RC_USE_PERS_DICT:
2433                 // obsoleted in 2.0
2434                 if (tag != RC_LAST)
2435                         break;
2436         case RC_USE_SYSTEM_COLORS:
2437                 if (ignore_system_lyxrc ||
2438                     use_system_colors != system_lyxrc.use_system_colors) {
2439                         os << "\\use_system_colors "
2440                            << convert<string>(use_system_colors)
2441                            << '\n';
2442                 }
2443                 if (tag != RC_LAST)
2444                         break;
2445         case RC_USE_TOOLTIP:
2446                 if (ignore_system_lyxrc ||
2447                     use_tooltip != system_lyxrc.use_tooltip) {
2448                         os << "\\use_tooltip "
2449                            << convert<string>(use_tooltip)
2450                            << '\n';
2451                 }
2452                 if (tag != RC_LAST)
2453                         break;
2454         case RC_USE_PIXMAP_CACHE:
2455                 if (ignore_system_lyxrc ||
2456                     use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2457                         os << "\\use_pixmap_cache "
2458                            << convert<string>(use_pixmap_cache)
2459                            << '\n';
2460                 }
2461                 if (tag != RC_LAST)
2462                         break;
2463         case RC_PERS_DICT:
2464                 // obsoleted in 2.0
2465                 if (tag != RC_LAST)
2466                         break;
2467         case RC_USE_INP_ENC:
2468                 // obsoleted in 2.0
2469                 if (tag != RC_LAST)
2470                         break;
2471
2472                 os << "\n#\n"
2473                    << "# LANGUAGE SUPPORT SECTION ##########################\n"
2474                    << "#\n\n";
2475                 if (tag != RC_LAST)
2476                         break;
2477
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';
2482                 }
2483                 if (tag != RC_LAST)
2484                         break;
2485
2486         case RC_SPELLCHECKER:
2487                 if (ignore_system_lyxrc ||
2488                     spellchecker != system_lyxrc.spellchecker) {
2489                         os << "\\spellchecker " << spellchecker << '\n';
2490                 }
2491                 if (tag != RC_LAST)
2492                         break;
2493
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)
2498                            << '\n';
2499                 }
2500                 if (tag != RC_LAST)
2501                         break;
2502
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)
2507                            << '\n';
2508                 }
2509                 if (tag != RC_LAST)
2510                         break;
2511
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';
2516                 }
2517                 if (tag != RC_LAST)
2518                         break;
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';
2523                 }
2524                 if (tag != RC_LAST)
2525                         break;
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
2530                            << "\"\n";
2531                 }
2532                 if (tag != RC_LAST)
2533                         break;
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)
2540                            << "\"\n";
2541                 }
2542                 if (tag != RC_LAST)
2543                         break;
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) {
2549                         case LP_AUTO: 
2550                                 os << "0\n";
2551                                 break;
2552                         case LP_BABEL:
2553                                 os << "1\n";
2554                                 break;
2555                         case LP_CUSTOM:
2556                                 os << "2\n";
2557                                 break;
2558                         case LP_NONE:
2559                                 os << "3\n";
2560                                 break;
2561                         }
2562                 }
2563                 if (tag != RC_LAST)
2564                         break;
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
2571                            << "\"\n";
2572                 }
2573                 if (tag != RC_LAST)
2574                         break;
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
2580                            << "\"\n";
2581                 }
2582                 if (tag != RC_LAST)
2583                         break;
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
2590                            << "\"\n";
2591                 }
2592                 if (tag != RC_LAST)
2593                         break;
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';
2599                 }
2600                 if (tag != RC_LAST)
2601                         break;
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';
2607                 }
2608                 if (tag != RC_LAST)
2609                         break;
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';
2616                 }
2617                 if (tag != RC_LAST)
2618                         break;
2619
2620                 os << "\n#\n"
2621                    << "# 2nd MISC SUPPORT SECTION ##########################\n"
2622                    << "#\n\n";
2623
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';
2628                 }
2629                 if (tag != RC_LAST)
2630                         break;
2631         case RC_DEFAULT_LANGUAGE:
2632                 if (ignore_system_lyxrc ||
2633                     default_language != system_lyxrc.default_language) {
2634                         os << "\\default_language " << default_language << '\n';
2635                 }
2636                 if (tag != RC_LAST)
2637                         break;
2638         case RC_GUI_LANGUAGE:
2639                 if (ignore_system_lyxrc ||
2640                     gui_language != system_lyxrc.gui_language) {
2641                         os << "\\gui_language " << gui_language << '\n';
2642                 }
2643                 if (tag != RC_LAST)
2644                         break;
2645         case RC_EXPORT_OVERWRITE:
2646                 if (ignore_system_lyxrc ||
2647                     export_overwrite != system_lyxrc.export_overwrite) {
2648                         string status;
2649                         switch (export_overwrite) {
2650                         case NO_FILES:
2651                                 status = "ask";
2652                                 break;
2653                         case MAIN_FILE:
2654                                 status = "main";
2655                                 break;
2656                         case ALL_FILES:
2657                                 status = "all";
2658                                 break;
2659                         }
2660                         os << "\\export_overwrite " << status << '\n';
2661                 }
2662                 if (tag != RC_LAST)
2663                         break;
2664
2665         case RC_SCROLL_WHEEL_ZOOM:
2666                 if (ignore_system_lyxrc ||
2667                         scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2668                         string status;
2669                         switch (scroll_wheel_zoom) {
2670                         case SCROLL_WHEEL_ZOOM_OFF:
2671                                 status = "off";
2672                                 break;
2673                         case SCROLL_WHEEL_ZOOM_CTRL:
2674                                 status = "ctrl";
2675                                 break;
2676                         case SCROLL_WHEEL_ZOOM_SHIFT:
2677                                 status = "shift";
2678                                 break;
2679                         case SCROLL_WHEEL_ZOOM_ALT:
2680                                 status = "alt";
2681                                 break;
2682                         }
2683                         os << "\\scroll_wheel_zoom " << status << '\n';
2684                 }
2685                 if (tag != RC_LAST)
2686                         break;
2687
2688                 os << "\n#\n"
2689                    << "# FORMATS SECTION ##########################\n"
2690                    << "#\n\n";
2691
2692         case RC_FORMAT:
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());
2698                         if (!format ||
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                                 os << "\\format \"" << cit->name() << "\" \""
2707                                    << cit->extension() << "\" \""
2708                                    << cit->prettyname() << "\" \""
2709                                    << cit->shortcut() << "\" \""
2710                                    << escapeCommand(cit->viewer()) << "\" \""
2711                                    << escapeCommand(cit->editor()) << "\" \"";
2712                                 vector<string> flags;
2713                                 if (cit->documentFormat())
2714                                         flags.push_back("document");
2715                                 if (cit->vectorFormat())
2716                                         flags.push_back("vector");
2717                                 os << getStringFromVector(flags);
2718                                 os << "\"\n";
2719                         }
2720                 }
2721
2722                 // Look for deleted formats
2723                 for (Formats::const_iterator cit = system_formats.begin();
2724                      cit != system_formats.end(); ++cit)
2725                         if (!formats.getFormat(cit->name()))
2726                                 os << "\\format \"" << cit->name()
2727                                    << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2728                 if (tag != RC_LAST)
2729                         break;
2730         case RC_VIEWER_ALTERNATIVES: {
2731                 Alternatives::const_iterator it = viewer_alternatives.begin();
2732                 Alternatives::const_iterator const en = viewer_alternatives.end();
2733                 Alternatives::const_iterator const sysend = 
2734                                 system_lyxrc.viewer_alternatives.end();
2735                 for (; it != en; ++it) {
2736                         string const & fmt = it->first;
2737                         CommandSet const & cmd = it->second;
2738                         CommandSet::const_iterator sit = cmd.begin();
2739                         CommandSet::const_iterator const sen = cmd.end();
2740                         Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ? 
2741                                         system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2742                                         system_lyxrc.viewer_alternatives.find(fmt);
2743                         for (; sit != sen; ++sit) {
2744                                 string const & cmd = *sit;
2745                                 if (ignore_system_lyxrc 
2746                                     || sysfmt == sysend               // format not found
2747                                          || sysfmt->second.count(cmd) == 0 // this command not found
2748                                    )
2749                                         os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2750                         }
2751                 }
2752                 if (tag != RC_LAST)
2753                         break;
2754         }
2755         case RC_EDITOR_ALTERNATIVES: {
2756                 Alternatives::const_iterator it = editor_alternatives.begin();
2757                 Alternatives::const_iterator const en = editor_alternatives.end();
2758                 Alternatives::const_iterator const sysend = 
2759                                 system_lyxrc.editor_alternatives.end();
2760                 for (; it != en; ++it) {
2761                         string const & fmt = it->first;
2762                         CommandSet const & cmd = it->second;
2763                         CommandSet::const_iterator sit = cmd.begin();
2764                         CommandSet::const_iterator const sen = cmd.end();
2765                         Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ? 
2766                                         system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2767                                         system_lyxrc.editor_alternatives.find(fmt);
2768                         for (; sit != sen; ++sit) {
2769                                 string const & cmd = *sit;
2770                                 if (ignore_system_lyxrc 
2771                                     || sysfmt == sysend               // format not found
2772                                     || sysfmt->second.count(cmd) == 0 // this command not found
2773                                    )
2774                                         os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2775                         }
2776                 }
2777                 if (tag != RC_LAST)
2778                         break;
2779         }
2780         case RC_DEFAULT_VIEW_FORMAT:
2781                 if (ignore_system_lyxrc ||
2782                     default_view_format != system_lyxrc.default_view_format) {
2783                         os << "\\default_view_format " << default_view_format << '\n';
2784                 }
2785                 if (tag != RC_LAST)
2786                         break;
2787         case RC_VIEWER:
2788                 // Ignore it
2789                 if (tag != RC_LAST)
2790                         break;
2791
2792                 os << "\n#\n"
2793                    << "# CONVERTERS SECTION ##########################\n"
2794                    << "#\n\n";
2795
2796         case RC_CONVERTER:
2797                 // Look for new converters
2798                 for (Converters::const_iterator cit = theConverters().begin();
2799                      cit != theConverters().end(); ++cit) {
2800                         Converter const * converter =
2801                                 theSystemConverters().getConverter(cit->from,
2802                                                                cit->to);
2803                         if (!converter ||
2804                             converter->command != cit->command ||
2805                             converter->flags != cit->flags)
2806                                 os << "\\converter \"" << cit->from << "\" \""
2807                                    << cit->to << "\" \""
2808                                    << escapeCommand(cit->command) << "\" \""
2809                                    << cit->flags << "\"\n";
2810                 }
2811
2812                 // New/modifed converters
2813                 for (Converters::const_iterator cit = theSystemConverters().begin();
2814                      cit != theSystemConverters().end(); ++cit)
2815                         if (!theConverters().getConverter(cit->from, cit->to))
2816                                 os << "\\converter \"" << cit->from
2817                                    << "\" \"" << cit->to << "\" \"\" \"\"\n";
2818                 if (tag != RC_LAST)
2819                         break;
2820         
2821         case RC_COPIER:
2822                 if (tag == RC_LAST)
2823                         os << "\n#\n"
2824                            << "# COPIERS SECTION ##########################\n"
2825                            << "#\n\n";
2826
2827                 // Look for new movers
2828                 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2829                 Movers::const_iterator const sysend = theSystemMovers().end();
2830                 Movers::const_iterator it = theMovers().begin();
2831                 Movers::const_iterator end = theMovers().end();
2832
2833                 for (; it != end; ++it) {
2834                         Movers::const_iterator const sysit =
2835                                 find_if(sysbegin, sysend, SameMover(*it));
2836                         if (sysit == sysend) {
2837                                 string const & fmt = it->first;
2838                                 string const & command =
2839                                         it->second.command();
2840
2841                                 os << "\\copier " << fmt
2842                                    << " \"" << escapeCommand(command) << "\"\n";
2843                         }
2844                 }
2845                 if (tag != RC_LAST)
2846                         break;
2847
2848                 // We don't actually delete SpecialisedMover(s) from the
2849                 // map, just clear their 'command', so there's no need
2850                 // to test for anything else.
2851         }
2852
2853         os.flush();
2854 }
2855
2856
2857 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2858 {
2859         // Why the switch you might ask. It is a trick to ensure that all
2860         // the elements in the LyXRCTags enum is handled. As you can see
2861         // there are no breaks at all. So it is just a huge fall-through.
2862         // The nice thing is that we will get a warning from the compiler
2863         // if we forget an element.
2864         LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2865         switch (tag) {
2866         case LyXRC::RC_ACCEPT_COMPOUND:
2867         case LyXRC::RC_ALT_LANG:
2868         case LyXRC::RC_PLAINTEXT_LINELEN:
2869         case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2870         case LyXRC::RC_AUTOCORRECTION_MATH:
2871         case LyXRC::RC_AUTOREGIONDELETE:
2872         case LyXRC::RC_AUTORESET_OPTIONS:
2873         case LyXRC::RC_AUTOSAVE:
2874         case LyXRC::RC_AUTO_NUMBER:
2875         case LyXRC::RC_BACKUPDIR_PATH:
2876         case LyXRC::RC_BIBTEX_ALTERNATIVES:
2877         case LyXRC::RC_BIBTEX_COMMAND:
2878         case LyXRC::RC_BINDFILE:
2879         case LyXRC::RC_CHECKLASTFILES:
2880         case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2881         case LyXRC::RC_COMPLETION_INLINE_DELAY:
2882         case LyXRC::RC_COMPLETION_INLINE_DOTS:
2883         case LyXRC::RC_COMPLETION_INLINE_MATH:
2884         case LyXRC::RC_COMPLETION_INLINE_TEXT:
2885         case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2886         case LyXRC::RC_COMPLETION_POPUP_DELAY:
2887         case LyXRC::RC_COMPLETION_POPUP_MATH:
2888         case LyXRC::RC_COMPLETION_POPUP_TEXT:
2889         case LyXRC::RC_USELASTFILEPOS:
2890         case LyXRC::RC_LOADSESSION:
2891         case LyXRC::RC_CHKTEX_COMMAND:
2892         case LyXRC::RC_CONVERTER:
2893         case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2894         case LyXRC::RC_COPIER:
2895         case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2896         case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2897         case LyXRC::RC_DATE_INSERT_FORMAT:
2898         case LyXRC::RC_DEFAULT_LANGUAGE:
2899         case LyXRC::RC_GUI_LANGUAGE:
2900         case LyXRC::RC_DEFAULT_PAPERSIZE:
2901         case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2902         case LyXRC::RC_DEFFILE:
2903         case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2904         case LyXRC::RC_DISPLAY_GRAPHICS:
2905         case LyXRC::RC_DOCUMENTPATH:
2906                 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2907                         FileName path(lyxrc_new.document_path);
2908                         if (path.exists() && path.isDirectory())
2909                                 package().document_dir() = FileName(lyxrc.document_path);
2910                 }
2911         case LyXRC::RC_EDITOR_ALTERNATIVES:
2912         case LyXRC::RC_ESC_CHARS:
2913         case LyXRC::RC_EXAMPLEPATH:
2914         case LyXRC::RC_FONT_ENCODING:
2915         case LyXRC::RC_FORMAT:
2916         case LyXRC::RC_GROUP_LAYOUTS:
2917         case LyXRC::RC_HUNSPELLDIR_PATH:
2918         case LyXRC::RC_INDEX_ALTERNATIVES:
2919         case LyXRC::RC_INDEX_COMMAND:
2920         case LyXRC::RC_JBIBTEX_COMMAND:
2921         case LyXRC::RC_JINDEX_COMMAND:
2922         case LyXRC::RC_NOMENCL_COMMAND:
2923         case LyXRC::RC_INPUT:
2924         case LyXRC::RC_KBMAP:
2925         case LyXRC::RC_KBMAP_PRIMARY:
2926         case LyXRC::RC_KBMAP_SECONDARY:
2927         case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2928         case LyXRC::RC_LANGUAGE_AUTO_END:
2929         case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2930         case LyXRC::RC_LANGUAGE_COMMAND_END:
2931         case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2932         case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2933         case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2934         case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2935         case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2936         case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2937         case LyXRC::RC_MACRO_EDIT_STYLE:
2938         case LyXRC::RC_MAKE_BACKUP:
2939         case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2940         case LyXRC::RC_MOUSE_WHEEL_SPEED:
2941         case LyXRC::RC_NUMLASTFILES:
2942         case LyXRC::RC_PARAGRAPH_MARKERS:
2943         case LyXRC::RC_PATH_PREFIX:
2944                 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2945                         prependEnvPath("PATH", lyxrc.path_prefix);
2946                 }
2947         case LyXRC::RC_PERS_DICT:
2948         case LyXRC::RC_PREVIEW:
2949         case LyXRC::RC_PREVIEW_HASHED_LABELS:
2950         case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2951         case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2952         case LyXRC::RC_PRINTCOPIESFLAG:
2953         case LyXRC::RC_PRINTER:
2954         case LyXRC::RC_PRINTEVENPAGEFLAG:
2955         case LyXRC::RC_PRINTEXSTRAOPTIONS:
2956         case LyXRC::RC_PRINTFILEEXTENSION:
2957         case LyXRC::RC_PRINTLANDSCAPEFLAG:
2958         case LyXRC::RC_PRINTODDPAGEFLAG:
2959         case LyXRC::RC_PRINTPAGERANGEFLAG:
2960         case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2961         case LyXRC::RC_PRINTPAPERFLAG:
2962         case LyXRC::RC_PRINTREVERSEFLAG:
2963         case LyXRC::RC_PRINTSPOOL_COMMAND:
2964         case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2965         case LyXRC::RC_PRINTTOFILE:
2966         case LyXRC::RC_PRINTTOPRINTER:
2967         case LyXRC::RC_PRINT_ADAPTOUTPUT:
2968         case LyXRC::RC_PRINT_COMMAND:
2969         case LyXRC::RC_RTL_SUPPORT:
2970         case LyXRC::RC_SAVE_COMPRESSED:
2971         case LyXRC::RC_SCREEN_DPI:
2972         case LyXRC::RC_SCREEN_FONT_ROMAN:
2973         case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2974         case LyXRC::RC_SCREEN_FONT_SANS:
2975         case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2976         case LyXRC::RC_SCREEN_FONT_SCALABLE:
2977         case LyXRC::RC_SCREEN_FONT_SIZES:
2978         case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2979         case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2980         case LyXRC::RC_GEOMETRY_SESSION:
2981         case LyXRC::RC_SCREEN_ZOOM:
2982         case LyXRC::RC_SERVERPIPE:
2983         case LyXRC::RC_SET_COLOR:
2984         case LyXRC::RC_SHOW_BANNER:
2985         case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2986         case LyXRC::RC_SPELL_COMMAND:
2987         case LyXRC::RC_SPELLCHECKER:
2988         case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2989         case LyXRC::RC_SPELLCHECK_NOTES:
2990         case LyXRC::RC_SPLITINDEX_COMMAND:
2991         case LyXRC::RC_TEMPDIRPATH:
2992         case LyXRC::RC_TEMPLATEPATH:
2993         case LyXRC::RC_TEX_ALLOWS_SPACES:
2994         case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2995                 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2996                         os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2997                 }
2998         case LyXRC::RC_THESAURUSDIRPATH:
2999         case LyXRC::RC_UIFILE:
3000         case LyXRC::RC_USER_EMAIL:
3001         case LyXRC::RC_USER_NAME:
3002         case LyXRC::RC_USETEMPDIR:
3003         case LyXRC::RC_USE_ALT_LANG:
3004         case LyXRC::RC_USE_CONVERTER_CACHE:
3005         case LyXRC::RC_USE_ESC_CHARS:
3006         case LyXRC::RC_USE_INP_ENC:
3007         case LyXRC::RC_USE_PERS_DICT:
3008         case LyXRC::RC_USE_SYSTEM_COLORS:
3009         case LyXRC::RC_USE_TOOLTIP:
3010         case LyXRC::RC_USE_PIXMAP_CACHE:
3011         case LyXRC::RC_USE_SPELL_LIB:
3012         case LyXRC::RC_VIEWDVI_PAPEROPTION:
3013         case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3014         case LyXRC::RC_SINGLE_INSTANCE:
3015         case LyXRC::RC_SORT_LAYOUTS:
3016         case LyXRC::RC_FULL_SCREEN_LIMIT:
3017         case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3018         case LyXRC::RC_FULL_SCREEN_MENUBAR:
3019         case LyXRC::RC_FULL_SCREEN_TABBAR:
3020         case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3021         case LyXRC::RC_FULL_SCREEN_WIDTH:
3022         case LyXRC::RC_VISUAL_CURSOR:
3023         case LyXRC::RC_VIEWER:
3024         case LyXRC::RC_VIEWER_ALTERNATIVES:
3025         case LyXRC::RC_FORWARD_SEARCH_DVI:
3026         case LyXRC::RC_FORWARD_SEARCH_PDF:
3027         case LyXRC::RC_EXPORT_OVERWRITE:
3028         case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3029         case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3030         case LyXRC::RC_LAST:
3031                 break;
3032         }
3033 }
3034
3035
3036 #if 0
3037 string const LyXRC::getDescription(LyXRCTags tag)
3038 {
3039         docstring str;
3040
3041         switch (tag) {
3042         case RC_ACCEPT_COMPOUND:
3043                 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3044                 break;
3045
3046         case RC_ALT_LANG:
3047         case RC_USE_ALT_LANG:
3048                 str = _("Specify an alternate language. The default is to use the language of the document.");
3049                 break;
3050
3051         case RC_PLAINTEXT_ROFF_COMMAND:
3052                 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.");
3053                 break;
3054
3055         case RC_PLAINTEXT_LINELEN:
3056                 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.");
3057                 break;
3058
3059         case RC_AUTOREGIONDELETE:
3060                 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3061                 break;
3062
3063         case RC_AUTORESET_OPTIONS:
3064                 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3065                 break;
3066
3067         case RC_AUTOSAVE:
3068                 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3069                 break;
3070
3071         case RC_AUTO_NUMBER:
3072                 break;
3073
3074         case RC_BACKUPDIR_PATH:
3075                 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.");
3076                 break;
3077
3078         case RC_BIBTEX_COMMAND:
3079                 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3080                 break;
3081
3082         case RC_JBIBTEX_COMMAND:
3083                 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3084                 break;
3085
3086         case RC_BINDFILE:
3087                 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3088                 break;
3089
3090         case RC_CHECKLASTFILES:
3091                 str = _("Select to check whether the lastfiles still exist.");
3092                 break;
3093
3094         case RC_CHKTEX_COMMAND:
3095                 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3096                 break;
3097
3098         case RC_CONVERTER:
3099                 break;
3100
3101         case RC_COPIER:
3102                 break;
3103
3104         case RC_CURSOR_FOLLOWS_SCROLLBAR:
3105                 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.");
3106                 break;
3107
3108         case RC_SCROLL_BELOW_DOCUMENT:
3109                 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");
3110                 break;
3111
3112         case RC_MAC_DONTSWAP_CTRL_META:
3113                 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3114                 break;
3115
3116         case RC_MAC_LIKE_WORD_MOVEMENT:
3117                 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3118                 break;
3119
3120         case RC_SHOW_MACRO_LABEL:
3121                 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3122                 break;
3123
3124         case RC_DATE_INSERT_FORMAT:
3125                 //xgettext:no-c-format
3126                 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3127                 break;
3128
3129         case RC_DEFFILE:
3130                 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3131                 break;
3132
3133         case RC_DEFAULT_VIEW_FORMAT:
3134                 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3135                 break;
3136
3137         case RC_DEFAULT_LANGUAGE:
3138                 str = _("New documents will be assigned this language.");
3139                 break;
3140
3141         case RC_DEFAULT_PAPERSIZE:
3142                 str = _("Specify the default paper size.");
3143                 break;
3144
3145         case RC_DIALOGS_ICONIFY_WITH_MAIN:
3146                 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3147                 break;
3148
3149         case RC_DISPLAY_GRAPHICS:
3150                 str = _("Select how LyX will display any graphics.");
3151                 break;
3152
3153         case RC_DOCUMENTPATH:
3154                 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3155                 break;
3156
3157         case RC_ESC_CHARS:
3158         case RC_USE_ESC_CHARS:
3159                 str = _("Specify additional chars that can be part of a word.");
3160                 break;
3161
3162         case RC_EXAMPLEPATH:
3163                 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3164                 break;
3165
3166         case RC_FONT_ENCODING:
3167                 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3168                 break;
3169
3170         case RC_FORMAT:
3171                 break;
3172
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\".");
3175                 break;
3176
3177         case RC_JINDEX_COMMAND:
3178                 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3179                 break;
3180
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.");
3183                 break;
3184
3185         case RC_INPUT:
3186                 break;
3187
3188         case RC_KBMAP:
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.");
3192                 break;
3193
3194         case RC_LANGUAGE_AUTO_BEGIN:
3195                 str = _("Select if a language switching command is needed at the beginning of the document.");
3196                 break;
3197
3198         case RC_LANGUAGE_AUTO_END:
3199                 str = _("Select if a language switching command is needed at the end of the document.");
3200                 break;
3201
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.");
3204                 break;
3205
3206         case RC_LANGUAGE_COMMAND_END:
3207                 str = _("The LaTeX command for changing back to the language of the document.");
3208                 break;
3209
3210         case RC_LANGUAGE_COMMAND_LOCAL:
3211                 str = _("The LaTeX command for local changing of the language.");
3212                 break;
3213
3214         case RC_LANGUAGE_GLOBAL_OPTIONS:
3215                 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3216                 break;
3217
3218         case RC_LANGUAGE_CUSTOM_PACKAGE:
3219                 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3220                 break;
3221
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.");
3224                 break;
3225
3226         case RC_USELASTFILEPOS:
3227                 str = _("De-select if you do not want LyX to scroll to saved position.");
3228                 break;
3229
3230         case RC_LOADSESSION:
3231                 str = _("De-select to prevent loading files opened from the last LyX session.");
3232                 break;
3233
3234         case RC_MAKE_BACKUP:
3235                 str = _("De-select if you don't want LyX to create backup files.");
3236                 break;
3237
3238         case RC_MARK_FOREIGN_LANGUAGE:
3239                 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3240                 break;
3241
3242         case RC_MOUSE_WHEEL_SPEED:
3243                 str = bformat(_("The scrolling speed of the mouse wheel."),
3244                       maxlastfiles);
3245                 break;
3246
3247         case RC_COMPLETION_POPUP_DELAY:
3248                 str = _("The completion popup delay.");
3249                 break;
3250
3251         case RC_COMPLETION_POPUP_MATH:
3252                 str = _("Select to display the completion popup in math mode.");
3253                 break;
3254
3255         case RC_COMPLETION_POPUP_TEXT:
3256                 str = _("Select to display the completion popup in text mode.");
3257                 break;
3258
3259         case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3260                 str = _("Show the completion popup without delay after non-unique completion attempt.");
3261                 break;
3262
3263         case RC_COMPLETION_POPUP_TEXT:
3264                 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3265                 break;
3266
3267         case RC_COMPLETION_POPUP_DELAY:
3268                 str = _("The inline completion delay.");
3269                 break;
3270
3271         case RC_COMPLETION_INLINE_MATH:
3272                 str = _("Select to display the inline completion in math mode.");
3273                 break;
3274
3275         case RC_COMPLETION_INLINE_TEXT:
3276                 str = _("Select to display the inline completion in text mode.");
3277                 break;
3278
3279         case RC_COMPLETION_INLINE_DOTS:
3280                 str = _("Use \"...\" to shorten long completions.");
3281                 break;
3282
3283         case RC_AUTOCORRECTION_MATH:
3284                 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3285                 break;
3286
3287         case RC_NUMLASTFILES:
3288                 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3289                         maxlastfiles);
3290                 break;
3291
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.");
3296                 break;
3297
3298         case RC_PREVIEW:
3299                 str = _("Shows a typeset preview of things such as math");
3300                 break;
3301
3302         case RC_PREVIEW_HASHED_LABELS:
3303                 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3304                 break;
3305
3306         case RC_PREVIEW_SCALE_FACTOR:
3307                 str = _("Scale the preview size to suit.");
3308                 break;
3309
3310         case RC_PRINTCOLLCOPIESFLAG:
3311                 str = _("The option for specifying whether the copies should be collated.");
3312                 break;
3313
3314         case RC_PRINTCOPIESFLAG:
3315                 str = _("The option for specifying the number of copies to print.");
3316                 break;
3317
3318         case RC_PRINTER:
3319                 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3320                 break;
3321
3322         case RC_PRINTEVENPAGEFLAG:
3323                 str = _("The option to print only even pages.");
3324                 break;
3325
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.");
3328                 break;
3329
3330         case RC_PRINTFILEEXTENSION:
3331                 str = _("Extension of printer program output file. Usually \".ps\".");
3332                 break;
3333
3334         case RC_PRINTLANDSCAPEFLAG:
3335                 str = _("The option to print out in landscape.");
3336                 break;
3337
3338         case RC_PRINTODDPAGEFLAG:
3339                 str = _("The option to print only odd pages.");
3340                 break;
3341
3342         case RC_PRINTPAGERANGEFLAG:
3343                 str = _("The option for specifying a comma-separated list of pages to print.");
3344                 break;
3345
3346         case RC_PRINTPAPERDIMENSIONFLAG:
3347                                    str = _("Option to specify the dimensions of the print paper.");
3348                 break;
3349
3350         case RC_PRINTPAPERFLAG:
3351                 str = _("The option to specify paper type.");
3352                 break;
3353
3354         case RC_PRINTREVERSEFLAG:
3355                 str = _("The option to reverse the order of the pages printed.");
3356                 break;
3357
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.");
3360                 break;
3361
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.");
3364                 break;
3365
3366         case RC_PRINTTOFILE:
3367                 str = _("Option to pass to the print program to print to a file.");
3368                 break;
3369
3370         case RC_PRINTTOPRINTER:
3371                 str = _("Option to pass to the print program to print on a specific printer.");
3372                 break;
3373
3374         case RC_PRINT_ADAPTOUTPUT:
3375                 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3376                 break;
3377
3378         case RC_PRINT_COMMAND:
3379                 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3380                 break;
3381
3382         case RC_RTL_SUPPORT:
3383                 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3384                 break;
3385
3386         case RC_VISUAL_CURSOR:
3387                 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3388                 break;
3389
3390         case RC_SCREEN_DPI:
3391                 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3392                 break;
3393
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.");
3398                 break;
3399
3400         case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3401         case RC_SCREEN_FONT_SANS_FOUNDRY:
3402         case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3403                 break;
3404
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.");
3407                 break;
3408
3409         case RC_SCREEN_FONT_SIZES:
3410                 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3411                 break;
3412
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.");
3416                 break;
3417
3418         case RC_GEOMETRY_SESSION:
3419                 str = _("Allow session manager to save and restore windows geometry.");
3420                 break;
3421
3422         case RC_SERVERPIPE:
3423                 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3424                 break;
3425
3426         case RC_SET_COLOR:
3427                 break;
3428
3429         case RC_SHOW_BANNER:
3430                 str = _("De-select if you don't want the startup banner.");
3431                 break;
3432
3433         case RC_TEMPDIRPATH:
3434                 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3435                 break;
3436
3437         case RC_THESAURUSDIRPATH:
3438                 str = _("This is the place where the files of the thesaurus library reside.");
3439                 break;
3440
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.");
3443                 break;
3444
3445         case RC_TEX_ALLOWS_SPACES:
3446                 break;
3447
3448         case RC_TEX_EXPECTS_WINDOWS_PATHS:
3449                 break;
3450
3451         case RC_UIFILE:
3452                 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3453                 break;
3454
3455         case RC_USER_EMAIL:
3456                 break;
3457
3458         case RC_USER_NAME:
3459                 break;
3460
3461         case RC_USETEMPDIR:
3462                 break;
3463
3464         case RC_USE_USE_SYSTEM_COLORS:
3465                 str = _("Enable use the system colors for some things like main window background and selection.");
3466                 break;
3467
3468         case RC_USE_TOOLTIP:
3469                 str = _("Enable the automatic appearance of tool tips in the work area.");
3470                 break;
3471
3472         case RC_USE_PIXMAP_CACHE:
3473                 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3474                 break;
3475
3476         case RC_USE_SPELL_LIB:
3477                 break;
3478
3479         case RC_VIEWDVI_PAPEROPTION:
3480                 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3481                 break;
3482
3483         case RC_VIEWER:
3484                 break;
3485
3486         case RC_LAST:
3487                 break;
3488         }
3489
3490         return str;
3491 }
3492 #endif
3493
3494
3495 // The global instance
3496 LyXRC lyxrc;
3497
3498 // The global copy of the system lyxrc entries (everything except preferences)
3499 LyXRC system_lyxrc;
3500
3501
3502 } // namespace lyx