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