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