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