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