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