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