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