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