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