]> git.lyx.org Git - lyx.git/blob - src/LyXRC.cpp
* store all available viewers/editors and allow for an alternative selection in the...
[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                         lexrc >> format >> command;
1040                         viewer_alternatives.push_back(make_pair(format, command));
1041                         break;
1042                 }
1043                 case RC_EDITOR_ALTERNATIVES:  {
1044                         string format, command;
1045                         lexrc >> format >> command;
1046                         editor_alternatives.push_back(make_pair(format, command));
1047                         break;
1048                 }
1049
1050                 case RC_DEFAULT_VIEW_FORMAT:
1051                         lexrc >> default_view_format;
1052                         break;
1053                         
1054                 case RC_DEFAULT_LANGUAGE:
1055                         lexrc >> default_language;
1056                         break;
1057
1058                 case RC_GUI_LANGUAGE:
1059                         lexrc >> gui_language;
1060                         break;
1061
1062                 case RC_LABEL_INIT_LENGTH:
1063                         lexrc >> label_init_length;
1064                         break;
1065
1066                 case RC_SHOW_BANNER:
1067                         lexrc >> show_banner;
1068                         break;
1069
1070                 case RC_PREVIEW:
1071                         if (lexrc.next()) {
1072                                 string const tmp = lexrc.getString();
1073                                 if (tmp == "true" || tmp == "on")
1074                                         preview = PREVIEW_ON;
1075                                 else if (tmp == "no_math")
1076                                         preview = PREVIEW_NO_MATH;
1077                                 else {
1078                                         preview = PREVIEW_OFF;
1079                                         if (tmp != "false" && tmp != "off")
1080                                                 LYXERR0("Unrecognized preview status \""
1081                                                        << tmp << '\n');
1082                                 }
1083                         }
1084                         break;
1085
1086                 case RC_PREVIEW_HASHED_LABELS:
1087                         lexrc >> preview_hashed_labels;
1088                         break;
1089
1090                 case RC_PREVIEW_SCALE_FACTOR:
1091                         lexrc >> preview_scale_factor;
1092                         break;
1093
1094                 case RC_USER_NAME:
1095                         lexrc >> user_name;
1096                         break;
1097                 case RC_USER_EMAIL:
1098                         lexrc >> user_email;
1099                         break;
1100
1101                 case RC_PATH_PREFIX:
1102                         lexrc >> path_prefix;
1103                         break;
1104
1105                 case RC_USE_CONVERTER_CACHE:
1106                         lexrc >> use_converter_cache;
1107                         break;
1108                 case RC_CONVERTER_CACHE_MAXAGE:
1109                         lexrc >> converter_cache_maxage;
1110                         break;
1111
1112                 case RC_SORT_LAYOUTS:
1113                         lexrc >> sort_layouts;
1114                         break;
1115                 case RC_GROUP_LAYOUTS:
1116                         lexrc >> group_layouts;
1117                         break;
1118                 case RC_FULL_SCREEN_LIMIT:
1119                         lexrc >> full_screen_limit;
1120                         break;
1121                 case RC_FULL_SCREEN_TOOLBARS:
1122                         lexrc >> full_screen_toolbars;
1123                         break;
1124                 case RC_FULL_SCREEN_SCROLLBAR:
1125                         lexrc >> full_screen_scrollbar;
1126                         break;
1127                 case RC_FULL_SCREEN_TABBAR:
1128                         lexrc >> full_screen_tabbar;
1129                         break;
1130                 case RC_FULL_SCREEN_MENUBAR:
1131                         lexrc >> full_screen_menubar;
1132                         break;
1133                 case RC_FULL_SCREEN_WIDTH:
1134                         lexrc >> full_screen_width;
1135                         break;
1136                 case RC_OPEN_BUFFERS_IN_TABS:
1137                         lexrc >> open_buffers_in_tabs;
1138                         break;
1139
1140                 // Obsoteted in 1.4.0
1141                 case RC_USETEMPDIR:
1142                 // Obsoleted in 2.0
1143                 case RC_SPELL_COMMAND:
1144                 case RC_PERS_DICT:
1145                 case RC_PLAINTEXT_ROFF_COMMAND: 
1146                 case RC_USE_ALT_LANG:
1147                 case RC_USE_ESC_CHARS:
1148                 case RC_USE_INP_ENC:
1149                 case RC_USE_PERS_DICT:
1150                 case RC_USE_SPELL_LIB:
1151                         LYXERR(Debug::LYXRC, "Skipping obsolete tag `" 
1152                                << lexrc.getString() << "'.");
1153                         lexrc.next(true);
1154                         break;
1155
1156                 case RC_LAST:
1157                         break; // this is just a dummy
1158                 }
1159         }
1160
1161         /// Update converters data-structures
1162         theConverters().update(formats);
1163         theConverters().buildGraph();
1164
1165         return 0;
1166 }
1167
1168
1169 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1170 {
1171         ofstream ofs(filename.toFilesystemEncoding().c_str());
1172         if (ofs)
1173                 write(ofs, ignore_system_lyxrc);
1174 }
1175
1176
1177 void LyXRC::print() const
1178 {
1179         if (lyxerr.debugging())
1180                 write(lyxerr, false);
1181         else
1182                 write(cout, false);
1183 }
1184
1185
1186 class SameMover {
1187 public:
1188         typedef pair<string, SpecialisedMover> Data;
1189
1190         SameMover(Data const & comparison)
1191                 : comparison_(comparison) {}
1192
1193         bool operator()(Data const & data) const
1194         {
1195                 return data.first == comparison_.first &&
1196                         data.second.command() == comparison_.second.command();
1197         }
1198
1199 private:
1200         Data comparison_;
1201 };
1202
1203
1204 namespace {
1205
1206         // Escape \ and " so that LyXLex can read the string later
1207         string escapeCommand(string const & str) {
1208                 return subst(subst(str , "\\", "\\\\"), 
1209                              "\"", "\\\"");
1210         }
1211
1212 }
1213
1214
1215 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1216 {
1217         LyXRCTags tag = RC_LAST;
1218         
1219         if (!name.empty()) {
1220                 for (int i = 0; i != lyxrcCount; ++i)
1221                         if ("\\" + name == lyxrcTags[i].tag)
1222                                 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1223         }
1224
1225         if (tag == RC_LAST)
1226                 os << "# LyX " << lyx_version
1227                    << " generated this file. If you want to make your own\n"
1228                    << "# modifications you should do them from inside LyX and save.\n"
1229                    << "\n";
1230
1231         // Why the switch you might ask. It is a trick to ensure that all
1232         // the elements in the LyXRCTags enum are handled. As you can see
1233         // there are no breaks at all. So it is just a huge fall-through.
1234         // The nice thing is that we will get a warning from the compiler
1235         // if we forget an element.
1236         switch (tag) {
1237         case RC_LAST:
1238         case RC_INPUT:
1239                 // input/include files are not done here
1240         case RC_BINDFILE:
1241                 if (ignore_system_lyxrc ||
1242                     bind_file != system_lyxrc.bind_file) {
1243                         string const path = os::external_path(bind_file);
1244                         os << "\\bind_file \"" << path << "\"\n";
1245                 }
1246                 if (tag != RC_LAST)
1247                         break;
1248
1249         case RC_DEFFILE:
1250                 if (ignore_system_lyxrc ||
1251                     def_file != system_lyxrc.def_file) {
1252                         string const path = os::external_path(def_file);
1253                         os << "\\def_file \"" << path << "\"\n";
1254                 }
1255                 if (tag != RC_LAST)
1256                         break;
1257
1258                 //
1259                 // Misc Section
1260                 //
1261                 os << "\n#\n"
1262                    << "# MISC SECTION ######################################\n"
1263                    << "#\n\n";
1264                 // bind files are not done here.
1265
1266         case RC_PATH_PREFIX:
1267                 if (ignore_system_lyxrc ||
1268                     path_prefix != system_lyxrc.path_prefix) {
1269                         os << "\\path_prefix \"" << path_prefix << "\"\n";
1270                 }
1271                 if (tag != RC_LAST)
1272                         break;
1273         case RC_UIFILE:
1274                 if (ignore_system_lyxrc ||
1275                     ui_file != system_lyxrc.ui_file) {
1276                         string const path = os::external_path(ui_file);
1277                         os << "\\ui_file \"" << path << "\"\n";
1278                 }
1279                 if (tag != RC_LAST)
1280                         break;
1281         case RC_AUTOREGIONDELETE:
1282                 if (ignore_system_lyxrc ||
1283                     auto_region_delete != system_lyxrc.auto_region_delete) {
1284                         os << "# Set to false to inhibit automatic replacement of\n"
1285                            << "# the current selection.\n"
1286                            << "\\auto_region_delete " << convert<string>(auto_region_delete)
1287                            << '\n';
1288                 }
1289                 if (tag != RC_LAST)
1290                         break;
1291         case RC_AUTORESET_OPTIONS:
1292                 if (ignore_system_lyxrc ||
1293                     auto_reset_options != system_lyxrc.auto_reset_options) {
1294                         os << "# Set to false to inhibit automatic reset of\n"
1295                            << "# the class options to defaults on class change.\n"
1296                            << "\\auto_reset_options "
1297                            << convert<string>(auto_reset_options)
1298                            << '\n';
1299                 }
1300                 if (tag != RC_LAST)
1301                         break;
1302         case RC_AUTOSAVE:
1303                 if (ignore_system_lyxrc ||
1304                     autosave != system_lyxrc.autosave) {
1305                         os << "# The time interval between auto-saves in seconds.\n"
1306                            << "\\autosave " << autosave << '\n';
1307                 }
1308                 if (tag != RC_LAST)
1309                         break;
1310         case RC_DISPLAY_GRAPHICS:
1311                 if (ignore_system_lyxrc ||
1312                     display_graphics != system_lyxrc.display_graphics) {
1313                         os << "# Display graphics within LyX\n"
1314                            << "# true|false\n"
1315                            << "\\display_graphics "
1316                            << (display_graphics ? "true" : "false")
1317                            << '\n';
1318                 }
1319                 if (tag != RC_LAST)
1320                         break;
1321         case RC_SORT_LAYOUTS:
1322                 if (ignore_system_lyxrc ||
1323                     sort_layouts != system_lyxrc.sort_layouts) {
1324                         os << "# Sort layouts alphabetically.\n"
1325                            << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1326                 }
1327                 if (tag != RC_LAST)
1328                         break;
1329         case RC_GROUP_LAYOUTS:
1330                 if (ignore_system_lyxrc ||
1331                     group_layouts != system_lyxrc.group_layouts) {
1332                         os << "# Group layouts by their category.\n"
1333                            << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1334                 }
1335                 if (tag != RC_LAST)
1336                         break;
1337         case RC_VIEWDVI_PAPEROPTION:
1338                 if (ignore_system_lyxrc ||
1339                     view_dvi_paper_option
1340                     != system_lyxrc.view_dvi_paper_option) {
1341                         os << "# Options used to specify paper size to the\n"
1342                            << "# view_dvi_command (e.g. -paper)\n"
1343                            << "\\view_dvi_paper_option \""
1344                            << view_dvi_paper_option << "\"\n";
1345                 }
1346                 if (tag != RC_LAST)
1347                         break;
1348         case RC_DEFAULT_PAPERSIZE:
1349                 if (ignore_system_lyxrc ||
1350                     default_papersize != system_lyxrc.default_papersize) {
1351                         os << "# The default papersize to use.\n"
1352                            << "\\default_papersize \"";
1353                         switch (default_papersize) {
1354                         case PAPER_DEFAULT:
1355                                 os << "default"; break;
1356                         case PAPER_USLETTER:
1357                                 os << "usletter"; break;
1358                         case PAPER_USLEGAL:
1359                                 os << "legal"; break;
1360                         case PAPER_USEXECUTIVE:
1361                                 os << "executive"; break;
1362                         case PAPER_A3:
1363                                 os << "a3"; break;
1364                         case PAPER_A4:
1365                                 os << "a4"; break;
1366                         case PAPER_A5:
1367                                 os << "a5"; break;
1368                         case PAPER_B5:
1369                                 os << "b5"; break;
1370                         case PAPER_CUSTOM:
1371                         case PAPER_B3:
1372                         case PAPER_B4: break;
1373                         }
1374                         os << "\"\n";
1375                 }
1376                 if (tag != RC_LAST)
1377                         break;
1378         case RC_CHKTEX_COMMAND:
1379                 if (ignore_system_lyxrc ||
1380                     chktex_command != system_lyxrc.chktex_command) {
1381                         os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1382                 }
1383                 if (tag != RC_LAST)
1384                         break;
1385         case RC_BIBTEX_ALTERNATIVES: {
1386                 set<string>::const_iterator it = bibtex_alternatives.begin();
1387                 set<string>::const_iterator end = bibtex_alternatives.end();
1388                 for ( ; it != end; ++it) {
1389                         if (ignore_system_lyxrc
1390                             || !system_lyxrc.bibtex_alternatives.count(*it))
1391                                 os << "\\bibtex_alternatives \""
1392                                    << *it << "\"\n";
1393                 }
1394                 if (tag != RC_LAST)
1395                         break;
1396         }
1397         case RC_BIBTEX_COMMAND:
1398                 if (ignore_system_lyxrc ||
1399                     bibtex_command != system_lyxrc.bibtex_command) {
1400                         os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1401                 }
1402                 if (tag != RC_LAST)
1403                         break;
1404         case RC_JBIBTEX_COMMAND:
1405                 if (ignore_system_lyxrc ||
1406                     jbibtex_command != system_lyxrc.jbibtex_command) {
1407                         os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1408                 }
1409                 if (tag != RC_LAST)
1410                         break;
1411         case RC_INDEX_ALTERNATIVES: {
1412                 set<string>::const_iterator it = index_alternatives.begin();
1413                 set<string>::const_iterator end = index_alternatives.end();
1414                 for ( ; it != end; ++it) {
1415                         if (ignore_system_lyxrc
1416                             || !system_lyxrc.index_alternatives.count(*it))
1417                                 os << "\\index_alternatives \""
1418                                    << *it << "\"\n";
1419                 }
1420                 if (tag != RC_LAST)
1421                         break;
1422         }
1423         case RC_INDEX_COMMAND:
1424                 if (ignore_system_lyxrc ||
1425                     index_command != system_lyxrc.index_command) {
1426                         os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1427                 }
1428                 if (tag != RC_LAST)
1429                         break;
1430         case RC_JINDEX_COMMAND:
1431                 if (ignore_system_lyxrc ||
1432                     jindex_command != system_lyxrc.jindex_command) {
1433                         os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1434                 }
1435                 if (tag != RC_LAST)
1436                         break;
1437         case RC_SPLITINDEX_COMMAND:
1438                 if (ignore_system_lyxrc ||
1439                     splitindex_command != system_lyxrc.splitindex_command) {
1440                         os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1441                 }
1442                 if (tag != RC_LAST)
1443                         break;
1444         case RC_NOMENCL_COMMAND:
1445                 if (ignore_system_lyxrc ||
1446                     nomencl_command != system_lyxrc.nomencl_command) {
1447                         os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1448                 }
1449                 if (tag != RC_LAST)
1450                         break;
1451         case RC_TEX_EXPECTS_WINDOWS_PATHS:
1452                 if (ignore_system_lyxrc ||
1453                     windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1454                         os << "\\tex_expects_windows_paths "
1455                            << convert<string>(windows_style_tex_paths) << '\n';
1456                 }
1457                 if (tag != RC_LAST)
1458                         break;
1459         case RC_TEX_ALLOWS_SPACES:
1460                 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1461                         os << "\\tex_allows_spaces "
1462                            << convert<string>(tex_allows_spaces) << '\n';
1463                 }
1464                 if (tag != RC_LAST)
1465                         break;
1466         case RC_KBMAP:
1467                 if (ignore_system_lyxrc ||
1468                     use_kbmap != system_lyxrc.use_kbmap) {
1469                         os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1470                 }
1471                 if (tag != RC_LAST)
1472                         break;
1473         case RC_KBMAP_PRIMARY:
1474                 if (ignore_system_lyxrc ||
1475                     primary_kbmap != system_lyxrc.primary_kbmap) {
1476                         string const path = os::external_path(primary_kbmap);
1477                         os << "\\kbmap_primary \"" << path << "\"\n";
1478                 }
1479                 if (tag != RC_LAST)
1480                         break;
1481         case RC_KBMAP_SECONDARY:
1482                 if (ignore_system_lyxrc ||
1483                     secondary_kbmap != system_lyxrc.secondary_kbmap) {
1484                         string const path = os::external_path(secondary_kbmap);
1485                         os << "\\kbmap_secondary \"" << path << "\"\n";
1486                 }
1487                 if (tag != RC_LAST)
1488                         break;
1489         case RC_SERVERPIPE:
1490                 if (ignore_system_lyxrc ||
1491                     lyxpipes != system_lyxrc.lyxpipes) {
1492                         string const path = os::external_path(lyxpipes);
1493                         os << "\\serverpipe \"" << path << "\"\n";
1494                 }
1495                 if (tag != RC_LAST)
1496                         break;
1497         case RC_DATE_INSERT_FORMAT:
1498                 if (ignore_system_lyxrc ||
1499                     date_insert_format != system_lyxrc.date_insert_format) {
1500                         os << "\\date_insert_format \"" << date_insert_format
1501                            << "\"\n";
1502                 }
1503                 if (tag != RC_LAST)
1504                         break;
1505         case RC_LABEL_INIT_LENGTH:
1506                 if (ignore_system_lyxrc ||
1507                     label_init_length != system_lyxrc.label_init_length) {
1508                         os << "\\label_init_length " << label_init_length
1509                            << '\n';
1510                 }
1511                 if (tag != RC_LAST)
1512                         break;
1513
1514         case RC_USER_NAME:
1515                 os << "\\user_name \"" << user_name << "\"\n";
1516                 if (tag != RC_LAST)
1517                         break;
1518
1519         case RC_USER_EMAIL:
1520                 os << "\\user_email \"" << user_email << "\"\n";
1521                 if (tag != RC_LAST)
1522                         break;
1523
1524         case RC_SHOW_BANNER:
1525                 if (ignore_system_lyxrc ||
1526                     show_banner != system_lyxrc.show_banner) {
1527                         os << "\\show_banner " << convert<string>(show_banner) << '\n';
1528                 }
1529                 if (tag != RC_LAST)
1530                         break;
1531
1532         case RC_PREVIEW:
1533                 if (ignore_system_lyxrc ||
1534                     preview != system_lyxrc.preview) {
1535                         string status;
1536                         switch (preview) {
1537                         case PREVIEW_ON:
1538                                 status = "on";
1539                                 break;
1540                         case PREVIEW_NO_MATH:
1541                                 status = "no_math";
1542                                 break;
1543                         case PREVIEW_OFF:
1544                                 status = "off";
1545                                 break;
1546                         }
1547                         os << "\\preview " << status << '\n';
1548                 }
1549                 if (tag != RC_LAST)
1550                         break;
1551
1552         case RC_PREVIEW_HASHED_LABELS:
1553                 if (ignore_system_lyxrc ||
1554                     preview_hashed_labels !=
1555                     system_lyxrc.preview_hashed_labels) {
1556                         os << "\\preview_hashed_labels "
1557                            << convert<string>(preview_hashed_labels) << '\n';
1558                 }
1559                 if (tag != RC_LAST)
1560                         break;
1561
1562         case RC_PREVIEW_SCALE_FACTOR:
1563                 if (ignore_system_lyxrc ||
1564                     preview_scale_factor != system_lyxrc.preview_scale_factor) {
1565                         os << "\\preview_scale_factor "
1566                            << preview_scale_factor << '\n';
1567                 }
1568                 if (tag != RC_LAST)
1569                         break;
1570
1571         case RC_USE_CONVERTER_CACHE:
1572                 if (ignore_system_lyxrc ||
1573                     use_converter_cache != system_lyxrc.use_converter_cache) {
1574                         os << "\\use_converter_cache "
1575                            << convert<string>(use_converter_cache) << '\n';
1576                 }
1577                 if (tag != RC_LAST)
1578                         break;
1579
1580         case RC_CONVERTER_CACHE_MAXAGE:
1581                 if (ignore_system_lyxrc ||
1582                     converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1583                         os << "\\converter_cache_maxage "
1584                            << converter_cache_maxage << '\n';
1585                 }
1586                 if (tag != RC_LAST)
1587                         break;
1588
1589                 os << "\n#\n"
1590                    << "# SCREEN & FONTS SECTION ############################\n"
1591                    << "#\n\n";
1592
1593         case RC_SCREEN_DPI:
1594                 if (ignore_system_lyxrc ||
1595                     dpi != system_lyxrc.dpi) {
1596                         os << "\\screen_dpi " << dpi << '\n';
1597                 }
1598                 if (tag != RC_LAST)
1599                         break;
1600         case RC_SCREEN_ZOOM:
1601                 if (ignore_system_lyxrc ||
1602                     zoom != system_lyxrc.zoom) {
1603                         os << "\\screen_zoom " << zoom << '\n';
1604                 }
1605                 if (tag != RC_LAST)
1606                         break;
1607         case RC_GEOMETRY_SESSION:
1608                 if (ignore_system_lyxrc ||
1609                     allow_geometry_session != system_lyxrc.allow_geometry_session) {
1610                         os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1611                            << '\n';
1612                 }
1613                 if (tag != RC_LAST)
1614                         break;
1615         case RC_CURSOR_FOLLOWS_SCROLLBAR:
1616                 if (ignore_system_lyxrc ||
1617                     cursor_follows_scrollbar
1618                     != system_lyxrc.cursor_follows_scrollbar) {
1619                         os << "\\cursor_follows_scrollbar "
1620                            << convert<string>(cursor_follows_scrollbar) << '\n';
1621                 }
1622                 if (tag != RC_LAST)
1623                         break;
1624         case RC_SCROLL_BELOW_DOCUMENT:
1625                 if (ignore_system_lyxrc ||
1626                     scroll_below_document
1627                     != system_lyxrc.scroll_below_document) {
1628                         os << "\\scroll_below_document "
1629                            << convert<string>(scroll_below_document) << '\n';
1630                 }
1631                 if (tag != RC_LAST)
1632                         break;
1633         case RC_PARAGRAPH_MARKERS:
1634                 if (ignore_system_lyxrc ||
1635                         paragraph_markers
1636                     != system_lyxrc.paragraph_markers) {
1637                         os << "\\paragraph_markers "
1638                            << convert<string>(paragraph_markers) << '\n';
1639                 }
1640                 if (tag != RC_LAST)
1641                         break;
1642         case RC_MAC_LIKE_WORD_MOVEMENT:
1643                 if (ignore_system_lyxrc ||
1644                     mac_like_word_movement
1645                     != system_lyxrc.mac_like_word_movement) {
1646                         os << "\\mac_like_word_movement "
1647                            << convert<string>(mac_like_word_movement) << '\n';
1648                 }
1649                 if (tag != RC_LAST)
1650                         break;
1651         case RC_MACRO_EDIT_STYLE:
1652                 if (ignore_system_lyxrc ||
1653                     macro_edit_style
1654                     != system_lyxrc.macro_edit_style) {
1655                         os << "\\macro_edit_style ";
1656                         switch (macro_edit_style) {
1657                         case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1658                         case MACRO_EDIT_INLINE: os << "1\n"; break;
1659                         case MACRO_EDIT_LIST: os << "2\n"; break;
1660                         }
1661                 }
1662                 if (tag != RC_LAST)
1663                         break;
1664         case RC_DIALOGS_ICONIFY_WITH_MAIN:
1665                 if (ignore_system_lyxrc ||
1666                     dialogs_iconify_with_main
1667                    != system_lyxrc.dialogs_iconify_with_main) {
1668                         os << "\\dialogs_iconify_with_main "
1669                           <<  convert<string>(dialogs_iconify_with_main) << '\n';
1670                 }
1671                 if (tag != RC_LAST)
1672                         break;
1673         case RC_SCREEN_FONT_ROMAN:
1674                 if (ignore_system_lyxrc ||
1675                     roman_font_name != system_lyxrc.roman_font_name) {
1676                         os << "\\screen_font_roman \"" << roman_font_name
1677                            << "\"\n";
1678                 }
1679                 if (tag != RC_LAST)
1680                         break;
1681         case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1682                 if (ignore_system_lyxrc ||
1683                     roman_font_foundry != system_lyxrc.roman_font_foundry) {
1684                         os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1685                            << "\"\n";
1686                 }
1687                 if (tag != RC_LAST)
1688                         break;
1689         case RC_SCREEN_FONT_SANS:
1690                 if (ignore_system_lyxrc ||
1691                     sans_font_name != system_lyxrc.sans_font_name) {
1692                         os << "\\screen_font_sans \"" << sans_font_name
1693                            << "\"\n";
1694                 }
1695                 if (tag != RC_LAST)
1696                         break;
1697         case RC_SCREEN_FONT_SANS_FOUNDRY:
1698                 if (ignore_system_lyxrc ||
1699                     sans_font_foundry != system_lyxrc.sans_font_foundry) {
1700                         os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1701                            << "\"\n";
1702                 }
1703                 if (tag != RC_LAST)
1704                         break;
1705         case RC_SCREEN_FONT_TYPEWRITER:
1706                 if (ignore_system_lyxrc ||
1707                     typewriter_font_name != system_lyxrc.typewriter_font_name) {
1708                         os << "\\screen_font_typewriter \""
1709                            << typewriter_font_name << "\"\n";
1710                 }
1711                 if (tag != RC_LAST)
1712                         break;
1713         case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1714                 if (ignore_system_lyxrc ||
1715                     typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1716                         os << "\\screen_font_typewriter_foundry \""
1717                            << typewriter_font_foundry << "\"\n";
1718                 }
1719                 if (tag != RC_LAST)
1720                         break;
1721
1722         case RC_SCREEN_FONT_SCALABLE:
1723                 if (ignore_system_lyxrc ||
1724                     use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1725                         os << "\\screen_font_scalable "
1726                            << convert<string>(use_scalable_fonts)
1727                            << '\n';
1728                 }
1729                 if (tag != RC_LAST)
1730                         break;
1731         case RC_SCREEN_FONT_SIZES:
1732                 if (ignore_system_lyxrc ||
1733                     font_sizes[FONT_SIZE_TINY]
1734                     != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1735                     font_sizes[FONT_SIZE_SCRIPT]
1736                     != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1737                     font_sizes[FONT_SIZE_FOOTNOTE]
1738                     != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1739                     font_sizes[FONT_SIZE_SMALL]
1740                     != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1741                     font_sizes[FONT_SIZE_NORMAL]
1742                     != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1743                     font_sizes[FONT_SIZE_LARGE]
1744                     != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1745                     font_sizes[FONT_SIZE_LARGER]
1746                     != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1747                     font_sizes[FONT_SIZE_LARGEST]
1748                     != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1749                     font_sizes[FONT_SIZE_HUGE]
1750                     != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1751                     font_sizes[FONT_SIZE_HUGER]
1752                     != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1753                         os.setf(ios::fixed);
1754                         os.precision(2);
1755                         os << "\\screen_font_sizes"
1756                            << ' ' << font_sizes[FONT_SIZE_TINY]
1757                            << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1758                            << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1759                            << ' ' << font_sizes[FONT_SIZE_SMALL]
1760                            << ' ' << font_sizes[FONT_SIZE_NORMAL]
1761                            << ' ' << font_sizes[FONT_SIZE_LARGE]
1762                            << ' ' << font_sizes[FONT_SIZE_LARGER]
1763                            << ' ' << font_sizes[FONT_SIZE_LARGEST]
1764                            << ' ' << font_sizes[FONT_SIZE_HUGE]
1765                            << ' ' << font_sizes[FONT_SIZE_HUGER]
1766                            << '\n';
1767                 }
1768                 if (tag != RC_LAST)
1769                         break;
1770         case RC_FULL_SCREEN_LIMIT:
1771                 if (ignore_system_lyxrc ||
1772                     full_screen_limit != system_lyxrc.full_screen_limit) {
1773                         os << "\\fullscreen_limit "
1774                            << convert<string>(full_screen_limit)
1775                            << '\n';
1776                 }
1777                 if (tag != RC_LAST)
1778                         break;
1779         case RC_FULL_SCREEN_TOOLBARS:
1780                 if (ignore_system_lyxrc ||
1781                     full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1782                         os << "\\fullscreen_toolbars "
1783                            << convert<string>(full_screen_toolbars)
1784                            << '\n';
1785                 }
1786                 if (tag != RC_LAST)
1787                         break;
1788         case RC_FULL_SCREEN_SCROLLBAR:
1789                 if (ignore_system_lyxrc ||
1790                     full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1791                         os << "\\fullscreen_scrollbar "
1792                            << convert<string>(full_screen_scrollbar)
1793                            << '\n';
1794                 }
1795                 if (tag != RC_LAST)
1796                         break;
1797         case RC_FULL_SCREEN_TABBAR:
1798                 if (ignore_system_lyxrc ||
1799                     full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1800                         os << "\\fullscreen_tabbar "
1801                            << convert<string>(full_screen_tabbar)
1802                            << '\n';
1803                 }
1804                 if (tag != RC_LAST)
1805                         break;
1806         case RC_FULL_SCREEN_MENUBAR:
1807                 if (ignore_system_lyxrc ||
1808                     full_screen_menubar != system_lyxrc.full_screen_menubar) {
1809                         os << "\\fullscreen_menubar "
1810                            << convert<string>(full_screen_menubar)
1811                            << '\n';
1812                 }
1813                 if (tag != RC_LAST)
1814                         break;
1815         case RC_FULL_SCREEN_WIDTH:
1816                 if (ignore_system_lyxrc ||
1817                     full_screen_width != system_lyxrc.full_screen_width) {
1818                         os << "\\fullscreen_width "
1819                            << convert<string>(full_screen_width)
1820                            << '\n';
1821                 }
1822                 if (tag != RC_LAST)
1823                         break;
1824         case RC_OPEN_BUFFERS_IN_TABS:
1825                 if (ignore_system_lyxrc ||
1826                     open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1827                         os << "\\open_buffers_in_tabs "
1828                            << convert<string>(open_buffers_in_tabs)
1829                            << '\n';
1830                 }
1831                 if (tag != RC_LAST)
1832                         break;
1833
1834         os << "\n#\n"
1835                         << "# COLOR SECTION ###################################\n"
1836                         << "#\n\n";
1837
1838         case RC_SET_COLOR:
1839                 for (int i = 0; i < Color_ignore; ++i) {
1840                         ColorCode lc = static_cast<ColorCode>(i);
1841                         string const col = lcolor.getX11Name(lc);
1842                         if (ignore_system_lyxrc
1843                             || col != system_lcolor.getX11Name(lc)) {
1844                                 os << "\\set_color \""
1845                                    << lcolor.getLyXName(lc) << "\" \""
1846                                    << col << "\"\n";
1847                         }
1848                 }
1849                 if (tag != RC_LAST)
1850                         break;
1851
1852                 os << "\n#\n"
1853                    << "# PRINTER SECTION ###################################\n"
1854                    << "#\n\n";
1855
1856         case RC_PRINTER:
1857                 if (ignore_system_lyxrc ||
1858                     printer != system_lyxrc.printer) {
1859                         os << "\\printer \"" << printer << "\"\n";
1860                 }
1861                 if (tag != RC_LAST)
1862                         break;
1863         case RC_PRINT_ADAPTOUTPUT:
1864                 if (ignore_system_lyxrc ||
1865                     print_adapt_output != system_lyxrc.print_adapt_output) {
1866                         os << "\\print_adapt_output "
1867                            << convert<string>(print_adapt_output)
1868                            << '\n';
1869                 }
1870                 if (tag != RC_LAST)
1871                         break;
1872         case RC_PRINT_COMMAND:
1873                 if (ignore_system_lyxrc ||
1874                     print_command != system_lyxrc.print_command) {
1875                         os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1876                 }
1877                 if (tag != RC_LAST)
1878                         break;
1879         case RC_PRINTEXSTRAOPTIONS:
1880                 if (ignore_system_lyxrc ||
1881                     print_extra_options != system_lyxrc.print_extra_options) {
1882                         os << "\\print_extra_options \"" << print_extra_options
1883                            << "\"\n";
1884                 }
1885                 if (tag != RC_LAST)
1886                         break;
1887         case RC_PRINTSPOOL_COMMAND:
1888                 if (ignore_system_lyxrc ||
1889                     print_spool_command != system_lyxrc.print_spool_command) {
1890                         os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1891                            << "\"\n";
1892                 }
1893                 if (tag != RC_LAST)
1894                         break;
1895         case RC_PRINTSPOOL_PRINTERPREFIX:
1896                 if (ignore_system_lyxrc ||
1897                     print_spool_printerprefix
1898                     != system_lyxrc.print_spool_printerprefix) {
1899                         os << "\\print_spool_printerprefix \""
1900                            << print_spool_printerprefix << "\"\n";
1901                 }
1902                 if (tag != RC_LAST)
1903                         break;
1904         case RC_PRINTEVENPAGEFLAG:
1905                 if (ignore_system_lyxrc ||
1906                     print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1907                         os << "\\print_evenpage_flag \"" << print_evenpage_flag
1908                            << "\"\n";
1909                 }
1910                 if (tag != RC_LAST)
1911                         break;
1912         case RC_PRINTODDPAGEFLAG:
1913                 if (ignore_system_lyxrc ||
1914                     print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1915                         os << "\\print_oddpage_flag \"" << print_oddpage_flag
1916                            << "\"\n";
1917                 }
1918                 if (tag != RC_LAST)
1919                         break;
1920         case RC_PRINTREVERSEFLAG:
1921                 if (ignore_system_lyxrc ||
1922                     print_reverse_flag != system_lyxrc.print_reverse_flag) {
1923                         os << "\\print_reverse_flag \"" << print_reverse_flag
1924                            << "\"\n";
1925                 }
1926                 if (tag != RC_LAST)
1927                         break;
1928         case RC_PRINTLANDSCAPEFLAG:
1929                 if (ignore_system_lyxrc ||
1930                     print_landscape_flag != system_lyxrc.print_landscape_flag) {
1931                         os << "\\print_landscape_flag \"" << print_landscape_flag
1932                            << "\"\n";
1933                 }
1934                 if (tag != RC_LAST)
1935                         break;
1936         case RC_PRINTPAGERANGEFLAG:
1937                 if (ignore_system_lyxrc ||
1938                     print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1939                         os << "\\print_pagerange_flag \"" << print_pagerange_flag
1940                            << "\"\n";
1941                 }
1942                 if (tag != RC_LAST)
1943                         break;
1944         case RC_PRINTCOPIESFLAG:
1945                 if (ignore_system_lyxrc ||
1946                     print_copies_flag != system_lyxrc.print_copies_flag) {
1947                         os << "\\print_copies_flag \"" << print_copies_flag
1948                            << "\"\n";
1949                 }
1950                 if (tag != RC_LAST)
1951                         break;
1952         case RC_PRINTCOLLCOPIESFLAG:
1953                 if (ignore_system_lyxrc ||
1954                     print_collcopies_flag
1955                     != system_lyxrc.print_collcopies_flag) {
1956                         os << "\\print_collcopies_flag \""
1957                            << print_collcopies_flag
1958                            << "\"\n";
1959                 }
1960                 if (tag != RC_LAST)
1961                         break;
1962         case RC_PRINTPAPERFLAG:
1963                 if (ignore_system_lyxrc ||
1964                     print_paper_flag != system_lyxrc.print_paper_flag) {
1965                         os << "\\print_paper_flag \"" << print_paper_flag
1966                            << "\"\n";
1967                 }
1968                 if (tag != RC_LAST)
1969                         break;
1970         case RC_PRINTPAPERDIMENSIONFLAG:
1971                 if (ignore_system_lyxrc ||
1972                     print_paper_dimension_flag
1973                     != system_lyxrc.print_paper_dimension_flag) {
1974                         os << "\\print_paper_dimension_flag \""
1975                            << print_paper_dimension_flag << "\"\n";
1976                 }
1977                 if (tag != RC_LAST)
1978                         break;
1979         case RC_PRINTTOPRINTER:
1980                 if (ignore_system_lyxrc ||
1981                     print_to_printer != system_lyxrc.print_to_printer) {
1982                         os << "\\print_to_printer \"" << print_to_printer
1983                            << "\"\n";
1984                 }
1985                 if (tag != RC_LAST)
1986                         break;
1987         case RC_PRINTTOFILE:
1988                 if (ignore_system_lyxrc ||
1989                     print_to_file != system_lyxrc.print_to_file) {
1990                         string const path = os::external_path(print_to_file);
1991                         os << "\\print_to_file \"" << path << "\"\n";
1992                 }
1993                 if (tag != RC_LAST)
1994                         break;
1995         case RC_PRINTFILEEXTENSION:
1996                 if (ignore_system_lyxrc ||
1997                     print_file_extension != system_lyxrc.print_file_extension) {
1998                         os << "\\print_file_extension \""
1999                            << print_file_extension
2000                            << "\"\n";
2001                 }
2002                 if (tag != RC_LAST)
2003                         break;
2004
2005                 os << "\n#\n"
2006                    << "# TEX SECTION #######################################\n"
2007                    << "#\n\n";
2008
2009         case RC_FONT_ENCODING:
2010                 if (ignore_system_lyxrc ||
2011                     fontenc != system_lyxrc.fontenc) {
2012                         os << "\\font_encoding \"" << fontenc << "\"\n";
2013                 }
2014                 if (tag != RC_LAST)
2015                         break;
2016
2017                 os << "\n#\n"
2018                    << "# FILE SECTION ######################################\n"
2019                    << "#\n\n";
2020
2021         case RC_DOCUMENTPATH:
2022                 if (ignore_system_lyxrc ||
2023                     document_path != system_lyxrc.document_path) {
2024                         string const path = os::external_path(document_path);
2025                         os << "\\document_path \"" << path << "\"\n";
2026                 }
2027                 if (tag != RC_LAST)
2028                         break;
2029         case RC_USELASTFILEPOS:
2030                 if (ignore_system_lyxrc ||
2031                     use_lastfilepos != system_lyxrc.use_lastfilepos) {
2032                         os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2033                            << '\n';
2034                 }
2035                 if (tag != RC_LAST)
2036                         break;
2037         case RC_LOADSESSION:
2038                 if (ignore_system_lyxrc ||
2039                     load_session != system_lyxrc.load_session) {
2040                         os << "\\load_session " << convert<string>(load_session)
2041                            << "\n";
2042                 }
2043                 if (tag != RC_LAST)
2044                         break;
2045         case RC_MOUSE_WHEEL_SPEED:
2046                 if (ignore_system_lyxrc ||
2047                     mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2048                         os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2049                 }
2050                 if (tag != RC_LAST)
2051                         break;
2052         case RC_COMPLETION_INLINE_DELAY:
2053                 if (ignore_system_lyxrc ||
2054                     completion_inline_delay != system_lyxrc.completion_inline_delay) {
2055                         os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2056                 }
2057                 if (tag != RC_LAST)
2058                         break;
2059         case RC_COMPLETION_INLINE_MATH:
2060                 if (ignore_system_lyxrc ||
2061                     completion_inline_math != system_lyxrc.completion_inline_math) {
2062                         os << "\\completion_inline_math "
2063                                 << convert<string>(completion_inline_math) << '\n';
2064                 }
2065                 if (tag != RC_LAST)
2066                         break;
2067         case RC_COMPLETION_INLINE_TEXT:
2068                 if (ignore_system_lyxrc ||
2069                     completion_inline_text != system_lyxrc.completion_inline_text) {
2070                         os << "\\completion_inline_text "
2071                                 << convert<string>(completion_inline_text) << '\n';
2072                 }
2073                 if (tag != RC_LAST)
2074                         break;
2075         case RC_COMPLETION_INLINE_DOTS:
2076                 if (ignore_system_lyxrc ||
2077                     completion_inline_dots != system_lyxrc.completion_inline_dots) {
2078                         os << "\\completion_inline_dots "
2079                                 << convert<string>(completion_inline_dots) << '\n';
2080                 }
2081                 if (tag != RC_LAST)
2082                         break;
2083         case RC_AUTOCORRECTION_MATH:
2084                 if (ignore_system_lyxrc ||
2085                     autocorrection_math != system_lyxrc.autocorrection_math) {
2086                         os << "\\autocorrection_math "
2087                                 << convert<string>(autocorrection_math) << '\n';
2088                 }
2089                 if (tag != RC_LAST)
2090                         break;
2091         case RC_COMPLETION_POPUP_DELAY:
2092                 if (ignore_system_lyxrc ||
2093                     completion_popup_delay != system_lyxrc.completion_popup_delay) {
2094                         os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2095                 }
2096                 if (tag != RC_LAST)
2097                         break;
2098         case RC_COMPLETION_POPUP_MATH:
2099                 if (ignore_system_lyxrc ||
2100                     completion_popup_math != system_lyxrc.completion_popup_math) {
2101                         os << "\\completion_popup_math "
2102                                 << convert<string>(completion_popup_math) << '\n';
2103                 }
2104                 if (tag != RC_LAST)
2105                         break;
2106         case RC_COMPLETION_POPUP_TEXT:
2107                 if (ignore_system_lyxrc ||
2108                     completion_popup_text != system_lyxrc.completion_popup_text) {
2109                         os << "\\completion_popup_text "
2110                                 << convert<string>(completion_popup_text) << '\n';
2111                 }
2112                 if (tag != RC_LAST)
2113                         break;
2114         case RC_COMPLETION_CURSOR_TEXT:
2115                 if (ignore_system_lyxrc ||
2116                     completion_cursor_text != system_lyxrc.completion_cursor_text) {
2117                         os << "\\completion_cursor_text "
2118                            << convert<string>(completion_cursor_text) << '\n';
2119                 }
2120                 if (tag != RC_LAST)
2121                         break;
2122         case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2123                 if (ignore_system_lyxrc ||
2124                     completion_popup_after_complete
2125                     != system_lyxrc.completion_popup_after_complete) {
2126                         os << "\\completion_popup_after_complete "
2127                                 << convert<string>(completion_popup_after_complete) << '\n';
2128                 }
2129                 if (tag != RC_LAST)
2130                         break;
2131         case RC_NUMLASTFILES:
2132                 if (ignore_system_lyxrc ||
2133                     num_lastfiles != system_lyxrc.num_lastfiles) {
2134                         os << "\\num_lastfiles " << num_lastfiles << '\n';
2135                 }
2136                 if (tag != RC_LAST)
2137                         break;
2138         case RC_CHECKLASTFILES:
2139                 if (ignore_system_lyxrc ||
2140                     check_lastfiles != system_lyxrc.check_lastfiles) {
2141                         os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2142                            << '\n';
2143                 }
2144                 if (tag != RC_LAST)
2145                         break;
2146         case RC_EXAMPLEPATH:
2147                 if (ignore_system_lyxrc ||
2148                     example_path != system_lyxrc.example_path) {
2149                         string const path = os::external_path(example_path);
2150                         os << "\\example_path \"" << path << "\"\n";
2151                 }
2152                 if (tag != RC_LAST)
2153                         break;
2154         case RC_TEMPLATEPATH:
2155                 if (ignore_system_lyxrc ||
2156                     template_path != system_lyxrc.template_path) {
2157                         string const path = os::external_path(template_path);
2158                         os << "\\template_path \"" << path << "\"\n";
2159                 }
2160                 if (tag != RC_LAST)
2161                         break;
2162         case RC_TEMPDIRPATH:
2163                 if (ignore_system_lyxrc ||
2164                     tempdir_path != system_lyxrc.tempdir_path) {
2165                         string const path = os::external_path(tempdir_path);
2166                         os << "\\tempdir_path \"" << path << "\"\n";
2167                 }
2168                 if (tag != RC_LAST)
2169                         break;
2170         case RC_THESAURUSDIRPATH:
2171                 if (ignore_system_lyxrc ||
2172                     thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2173                         string const path = os::external_path(thesaurusdir_path);
2174                         os << "\\thesaurusdir_path \"" << path << "\"\n";
2175                 }
2176                 if (tag != RC_LAST)
2177                         break;
2178         case RC_HUNSPELLDIR_PATH:
2179                 if (ignore_system_lyxrc ||
2180                     hunspelldir_path != system_lyxrc.hunspelldir_path) {
2181                         string const path = os::external_path(hunspelldir_path);
2182                         os << "\\hunspelldir_path \"" << path << "\"\n";
2183                 }
2184                 if (tag != RC_LAST)
2185                         break;
2186         case RC_USETEMPDIR:
2187                 if (tag != RC_LAST)
2188                         break;
2189                 // Ignore it
2190         case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2191                 if (tag != RC_LAST)
2192                         break;
2193         case RC_PLAINTEXT_LINELEN:
2194                 if (ignore_system_lyxrc ||
2195                     plaintext_linelen != system_lyxrc.plaintext_linelen) {
2196                         os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2197                 }
2198                 if (tag != RC_LAST)
2199                         break;
2200         case RC_MAKE_BACKUP:
2201                 if (ignore_system_lyxrc ||
2202                     make_backup != system_lyxrc.make_backup) {
2203                         os << "\\make_backup " << convert<string>(make_backup) << '\n';
2204                 }
2205                 if (tag != RC_LAST)
2206                         break;
2207         case RC_BACKUPDIR_PATH:
2208                 if (ignore_system_lyxrc ||
2209                     backupdir_path != system_lyxrc.backupdir_path) {
2210                         string const path = os::external_path(backupdir_path);
2211                         os << "\\backupdir_path \"" << path << "\"\n";
2212                 }
2213                 if (tag != RC_LAST)
2214                         break;
2215
2216                 os << "\n#\n"
2217                    << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2218                    << "#\n\n";
2219
2220                 os << "\n#\n"
2221                    << "# SPELLCHECKER SECTION ##############################\n"
2222                    << "#\n\n";
2223
2224         case RC_SPELL_COMMAND:
2225         case RC_USE_SPELL_LIB:
2226                 // Obsoleted in 2.0
2227                 if (tag != RC_LAST)
2228                         break;
2229         case RC_ACCEPT_COMPOUND:
2230                 if (ignore_system_lyxrc ||
2231                     spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2232                         os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2233                            << '\n';
2234                 }
2235                 if (tag != RC_LAST)
2236                         break;
2237         case RC_USE_ALT_LANG:
2238                 // Obsoleted in 2.0
2239                 if (tag != RC_LAST)
2240                         break;
2241         case RC_ALT_LANG:
2242                 if (ignore_system_lyxrc ||
2243                     spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2244                         os << "\\alternate_language \"" << spellchecker_alt_lang
2245                            << "\"\n";
2246                 }
2247                 if (tag != RC_LAST)
2248                         break;
2249         case RC_USE_ESC_CHARS:
2250                 if (tag != RC_LAST)
2251                         break;
2252         case RC_ESC_CHARS:
2253                 if (ignore_system_lyxrc ||
2254                     spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2255                         os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2256                 }
2257                 if (tag != RC_LAST)
2258                         break;
2259         case RC_USE_PERS_DICT:
2260                 // obsoleted in 2.0
2261                 if (tag != RC_LAST)
2262                         break;
2263         case RC_USE_TOOLTIP:
2264                 if (ignore_system_lyxrc ||
2265                     use_tooltip != system_lyxrc.use_tooltip) {
2266                         os << "\\use_tooltip "
2267                            << convert<string>(use_tooltip)
2268                            << '\n';
2269                 }
2270                 if (tag != RC_LAST)
2271                         break;
2272         case RC_USE_PIXMAP_CACHE:
2273                 if (ignore_system_lyxrc ||
2274                     use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2275                         os << "\\use_pixmap_cache "
2276                            << convert<string>(use_pixmap_cache)
2277                            << '\n';
2278                 }
2279                 if (tag != RC_LAST)
2280                         break;
2281         case RC_PERS_DICT:
2282                 // obsoleted in 2.0
2283                 if (tag != RC_LAST)
2284                         break;
2285         case RC_USE_INP_ENC:
2286                 // obsoleted in 2.0
2287                 if (tag != RC_LAST)
2288                         break;
2289
2290                 os << "\n#\n"
2291                    << "# LANGUAGE SUPPORT SECTION ##########################\n"
2292                    << "#\n\n";
2293                 if (tag != RC_LAST)
2294                         break;
2295
2296         case RC_SPELLCHECKER:
2297                 if (ignore_system_lyxrc ||
2298                     spellchecker != system_lyxrc.spellchecker) {
2299                         os << "\\spellchecker " << spellchecker << '\n';
2300                 }
2301                 if (tag != RC_LAST)
2302                         break;
2303
2304         case RC_SPELLCHECK_CONTINUOUSLY:
2305                 if (ignore_system_lyxrc ||
2306                     spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2307                         os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2308                            << '\n';
2309                 }
2310                 if (tag != RC_LAST)
2311                         break;
2312
2313         case RC_RTL_SUPPORT:
2314                 if (ignore_system_lyxrc ||
2315                     rtl_support != system_lyxrc.rtl_support) {
2316                         os << "\\rtl " << convert<string>(rtl_support) << '\n';
2317                 }
2318                 if (tag != RC_LAST)
2319                         break;
2320         case RC_VISUAL_CURSOR:
2321                 if (ignore_system_lyxrc ||
2322                         visual_cursor != system_lyxrc.visual_cursor) {
2323                         os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2324                 }
2325                 if (tag != RC_LAST)
2326                         break;
2327         case RC_LANGUAGE_PACKAGE:
2328                 if (ignore_system_lyxrc ||
2329                     language_package != system_lyxrc.language_package) {
2330                         os << "\\language_package \"" << language_package
2331                            << "\"\n";
2332                 }
2333                 if (tag != RC_LAST)
2334                         break;
2335         case RC_LANGUAGE_GLOBAL_OPTIONS:
2336                 if (ignore_system_lyxrc ||
2337                     language_global_options
2338                     != system_lyxrc.language_global_options) {
2339                         os << "\\language_global_options \""
2340                            << convert<string>(language_global_options)
2341                            << "\"\n";
2342                 }
2343                 if (tag != RC_LAST)
2344                         break;
2345         case RC_LANGUAGE_USE_BABEL:
2346                 if (ignore_system_lyxrc ||
2347                     language_use_babel != system_lyxrc.language_use_babel) {
2348                         os << "\\language_use_babel \""
2349                            << convert<string>(language_use_babel)
2350                            << "\"\n";
2351                 }
2352                 if (tag != RC_LAST)
2353                         break;
2354         case RC_LANGUAGE_COMMAND_BEGIN:
2355                 if (ignore_system_lyxrc ||
2356                     language_command_begin
2357                     != system_lyxrc.language_command_begin) {
2358                         os << "\\language_command_begin \""
2359                            << language_command_begin
2360                            << "\"\n";
2361                 }
2362                 if (tag != RC_LAST)
2363                         break;
2364         case RC_LANGUAGE_COMMAND_END:
2365                 if (ignore_system_lyxrc ||
2366                     language_command_end
2367                     != system_lyxrc.language_command_end) {
2368                         os << "\\language_command_end \"" << language_command_end
2369                            << "\"\n";
2370                 }
2371                 if (tag != RC_LAST)
2372                         break;
2373         case RC_LANGUAGE_COMMAND_LOCAL:
2374                 if (ignore_system_lyxrc ||
2375                     language_command_local
2376                     != system_lyxrc.language_command_local) {
2377                         os << "\\language_command_local \""
2378                            << language_command_local
2379                            << "\"\n";
2380                 }
2381                 if (tag != RC_LAST)
2382                         break;
2383         case RC_LANGUAGE_AUTO_BEGIN:
2384                 if (ignore_system_lyxrc ||
2385                     language_auto_begin != system_lyxrc.language_auto_begin) {
2386                         os << "\\language_auto_begin "
2387                            << convert<string>(language_auto_begin) << '\n';
2388                 }
2389                 if (tag != RC_LAST)
2390                         break;
2391         case RC_LANGUAGE_AUTO_END:
2392                 if (ignore_system_lyxrc ||
2393                     language_auto_end != system_lyxrc.language_auto_end) {
2394                         os << "\\language_auto_end "
2395                            << convert<string>(language_auto_end) << '\n';
2396                 }
2397                 if (tag != RC_LAST)
2398                         break;
2399         case RC_MARK_FOREIGN_LANGUAGE:
2400                 if (ignore_system_lyxrc ||
2401                     mark_foreign_language
2402                     != system_lyxrc.mark_foreign_language) {
2403                         os << "\\mark_foreign_language " <<
2404                                 convert<string>(mark_foreign_language) << '\n';
2405                 }
2406                 if (tag != RC_LAST)
2407                         break;
2408
2409                 os << "\n#\n"
2410                    << "# 2nd MISC SUPPORT SECTION ##########################\n"
2411                    << "#\n\n";
2412
2413         case RC_AUTO_NUMBER:
2414                 if (ignore_system_lyxrc ||
2415                     auto_number != system_lyxrc.auto_number) {
2416                         os << "\\auto_number " << convert<string>(auto_number) << '\n';
2417                 }
2418                 if (tag != RC_LAST)
2419                         break;
2420         case RC_DEFAULT_LANGUAGE:
2421                 if (ignore_system_lyxrc ||
2422                     default_language != system_lyxrc.default_language) {
2423                         os << "\\default_language " << default_language << '\n';
2424                 }
2425                 if (tag != RC_LAST)
2426                         break;
2427         case RC_GUI_LANGUAGE:
2428                 if (ignore_system_lyxrc ||
2429                     gui_language != system_lyxrc.gui_language) {
2430                         os << "\\gui_language " << gui_language << '\n';
2431                 }
2432                 if (tag != RC_LAST)
2433                         break;
2434
2435                 os << "\n#\n"
2436                    << "# FORMATS SECTION ##########################\n"
2437                    << "#\n\n";
2438
2439         case RC_FORMAT:
2440                 // New/modified formats
2441                 for (Formats::const_iterator cit = formats.begin();
2442                      cit != formats.end(); ++cit) {
2443                         Format const * format =
2444                                 system_formats.getFormat(cit->name());
2445                         if (!format ||
2446                             format->extension() != cit->extension() ||
2447                             format->prettyname() != cit->prettyname() ||
2448                             format->shortcut() != cit->shortcut() ||
2449                             format->viewer() != cit->viewer() ||
2450                             format->editor() != cit->editor() ||
2451                             format->documentFormat() != cit->documentFormat() ||
2452                             format->vectorFormat() != cit->vectorFormat()) {
2453                                 os << "\\format \"" << cit->name() << "\" \""
2454                                    << cit->extension() << "\" \""
2455                                    << cit->prettyname() << "\" \""
2456                                    << cit->shortcut() << "\" \""
2457                                    << escapeCommand(cit->viewer()) << "\" \""
2458                                    << escapeCommand(cit->editor()) << "\" \"";
2459                                 vector<string> flags;
2460                                 if (cit->documentFormat())
2461                                         flags.push_back("document");
2462                                 if (cit->vectorFormat())
2463                                         flags.push_back("vector");
2464                                 os << getStringFromVector(flags);
2465                                 os << "\"\n";
2466                         }
2467                 }
2468
2469                 // Look for deleted formats
2470                 for (Formats::const_iterator cit = system_formats.begin();
2471                      cit != system_formats.end(); ++cit)
2472                         if (!formats.getFormat(cit->name()))
2473                                 os << "\\format \"" << cit->name()
2474                                    << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2475                 if (tag != RC_LAST)
2476                         break;
2477         case RC_VIEWER_ALTERNATIVES:
2478                 if (ignore_system_lyxrc ||
2479                     viewer_alternatives != system_lyxrc.viewer_alternatives) {
2480                         for (vector<pair<string, string> >::const_iterator it = viewer_alternatives.begin();
2481                              it != viewer_alternatives.end(); ++it)
2482                         os << "\\viewer_alternatives "
2483                            << it->first << " " << it->second << "\n";
2484                 }
2485                 if (tag != RC_LAST)
2486                         break;
2487         case RC_EDITOR_ALTERNATIVES:
2488                 if (ignore_system_lyxrc ||
2489                     editor_alternatives != system_lyxrc.editor_alternatives) {
2490                         for (vector<pair<string, string> >::const_iterator it = editor_alternatives.begin();
2491                              it != editor_alternatives.end(); ++it)
2492                         os << "\\editor_alternatives "
2493                            << it->first << " " << it->second << "\n";
2494                 }
2495                 if (tag != RC_LAST)
2496                         break;
2497         case RC_DEFAULT_VIEW_FORMAT:
2498                 if (ignore_system_lyxrc ||
2499                     default_view_format != system_lyxrc.default_view_format) {
2500                         os << "\\default_view_format " << default_view_format << '\n';
2501                 }
2502                 if (tag != RC_LAST)
2503                         break;
2504         case RC_VIEWER:
2505                 // Ignore it
2506                 if (tag != RC_LAST)
2507                         break;
2508
2509                 os << "\n#\n"
2510                    << "# CONVERTERS SECTION ##########################\n"
2511                    << "#\n\n";
2512
2513         case RC_CONVERTER:
2514                 // Look for new converters
2515                 for (Converters::const_iterator cit = theConverters().begin();
2516                      cit != theConverters().end(); ++cit) {
2517                         Converter const * converter =
2518                                 theSystemConverters().getConverter(cit->from,
2519                                                                cit->to);
2520                         if (!converter ||
2521                             converter->command != cit->command ||
2522                             converter->flags != cit->flags)
2523                                 os << "\\converter \"" << cit->from << "\" \""
2524                                    << cit->to << "\" \""
2525                                    << escapeCommand(cit->command) << "\" \""
2526                                    << cit->flags << "\"\n";
2527                 }
2528
2529                 // New/modifed converters
2530                 for (Converters::const_iterator cit = theSystemConverters().begin();
2531                      cit != theSystemConverters().end(); ++cit)
2532                         if (!theConverters().getConverter(cit->from, cit->to))
2533                                 os << "\\converter \"" << cit->from
2534                                    << "\" \"" << cit->to << "\" \"\" \"\"\n";
2535                 if (tag != RC_LAST)
2536                         break;
2537         
2538         case RC_COPIER:
2539                 if (tag == RC_LAST)
2540                         os << "\n#\n"
2541                            << "# COPIERS SECTION ##########################\n"
2542                            << "#\n\n";
2543
2544                 // Look for new movers
2545                 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2546                 Movers::const_iterator const sysend = theSystemMovers().end();
2547                 Movers::const_iterator it = theMovers().begin();
2548                 Movers::const_iterator end = theMovers().end();
2549
2550                 for (; it != end; ++it) {
2551                         Movers::const_iterator const sysit =
2552                                 find_if(sysbegin, sysend, SameMover(*it));
2553                         if (sysit == sysend) {
2554                                 string const & fmt = it->first;
2555                                 string const & command =
2556                                         it->second.command();
2557
2558                                 os << "\\copier " << fmt
2559                                    << " \"" << escapeCommand(command) << "\"\n";
2560                         }
2561                 }
2562                 if (tag != RC_LAST)
2563                         break;
2564
2565                 // We don't actually delete SpecialisedMover(s) from the
2566                 // map, just clear their 'command', so there's no need
2567                 // to test for anything else.
2568         }
2569
2570         os.flush();
2571 }
2572
2573
2574 #if 0
2575 string const LyXRC::getDescription(LyXRCTags tag)
2576 {
2577         docstring str;
2578
2579         switch (tag) {
2580         case RC_ACCEPT_COMPOUND:
2581                 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2582                 break;
2583
2584         case RC_ALT_LANG:
2585         case RC_USE_ALT_LANG:
2586                 str = _("Specify an alternate language. The default is to use the language of the document.");
2587                 break;
2588
2589         case RC_PLAINTEXT_ROFF_COMMAND:
2590                 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.");
2591                 break;
2592
2593         case RC_PLAINTEXT_LINELEN:
2594                 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.");
2595                 break;
2596
2597         case RC_AUTOREGIONDELETE:
2598                 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2599                 break;
2600
2601         case RC_AUTORESET_OPTIONS:
2602                 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2603                 break;
2604
2605         case RC_AUTOSAVE:
2606                 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2607                 break;
2608
2609         case RC_AUTO_NUMBER:
2610                 break;
2611
2612         case RC_BACKUPDIR_PATH:
2613                 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.");
2614                 break;
2615
2616         case RC_BIBTEX_COMMAND:
2617                 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2618                 break;
2619
2620         case RC_JBIBTEX_COMMAND:
2621                 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2622                 break;
2623
2624         case RC_BINDFILE:
2625                 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2626                 break;
2627
2628         case RC_CHECKLASTFILES:
2629                 str = _("Select to check whether the lastfiles still exist.");
2630                 break;
2631
2632         case RC_CHKTEX_COMMAND:
2633                 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2634                 break;
2635
2636         case RC_CONVERTER:
2637                 break;
2638
2639         case RC_COPIER:
2640                 break;
2641
2642         case RC_CURSOR_FOLLOWS_SCROLLBAR:
2643                 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.");
2644                 break;
2645
2646         case RC_SCROLL_BELOW_DOCUMENT:
2647                 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");
2648                 break;
2649
2650         case RC_MAC_LIKE_WORD_MOVEMENT:
2651                 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2652                 break;
2653
2654         case RC_SHOW_MACRO_LABEL:
2655                 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2656                 break;
2657
2658         case RC_DATE_INSERT_FORMAT:
2659                 //xgettext:no-c-format
2660                 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2661                 break;
2662
2663         case RC_DEFFILE:
2664                 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2665                 break;
2666
2667         case RC_DEFAULT_VIEW_FORMAT:
2668                 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2669                 break;
2670
2671         case RC_DEFAULT_LANGUAGE:
2672                 str = _("New documents will be assigned this language.");
2673                 break;
2674
2675         case RC_DEFAULT_PAPERSIZE:
2676                 str = _("Specify the default paper size.");
2677                 break;
2678
2679         case RC_DIALOGS_ICONIFY_WITH_MAIN:
2680                 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2681                 break;
2682
2683         case RC_DISPLAY_GRAPHICS:
2684                 str = _("Select how LyX will display any graphics.");
2685                 break;
2686
2687         case RC_DOCUMENTPATH:
2688                 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2689                 break;
2690
2691         case RC_ESC_CHARS:
2692         case RC_USE_ESC_CHARS:
2693                 str = _("Specify additional chars that can be part of a word.");
2694                 break;
2695
2696         case RC_EXAMPLEPATH:
2697                 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2698                 break;
2699
2700         case RC_FONT_ENCODING:
2701                 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2702                 break;
2703
2704         case RC_FORMAT:
2705                 break;
2706
2707         case RC_INDEX_COMMAND:
2708                 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\".");
2709                 break;
2710
2711         case RC_JINDEX_COMMAND:
2712                 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2713                 break;
2714
2715         case RC_NOMENCL_COMMAND:
2716                 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2717                 break;
2718
2719         case RC_INPUT:
2720                 break;
2721
2722         case RC_KBMAP:
2723         case RC_KBMAP_PRIMARY:
2724         case RC_KBMAP_SECONDARY:
2725                 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.");
2726                 break;
2727
2728         case RC_LABEL_INIT_LENGTH:
2729                 str = _("Maximum number of words in the initialization string for a new label");
2730                 break;
2731
2732         case RC_LANGUAGE_AUTO_BEGIN:
2733                 str = _("Select if a language switching command is needed at the beginning of the document.");
2734                 break;
2735
2736         case RC_LANGUAGE_AUTO_END:
2737                 str = _("Select if a language switching command is needed at the end of the document.");
2738                 break;
2739
2740         case RC_LANGUAGE_COMMAND_BEGIN:
2741                 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.");
2742                 break;
2743
2744         case RC_LANGUAGE_COMMAND_END:
2745                 str = _("The LaTeX command for changing back to the language of the document.");
2746                 break;
2747
2748         case RC_LANGUAGE_COMMAND_LOCAL:
2749                 str = _("The LaTeX command for local changing of the language.");
2750                 break;
2751
2752         case RC_LANGUAGE_GLOBAL_OPTIONS:
2753                 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2754                 break;
2755
2756         case RC_LANGUAGE_PACKAGE:
2757                 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2758                 break;
2759
2760         case RC_LANGUAGE_USE_BABEL:
2761                 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2762                 break;
2763
2764         case RC_USELASTFILEPOS:
2765                 str = _("De-select if you do not want LyX to scroll to saved position.");
2766                 break;
2767
2768         case RC_LOADSESSION:
2769                 str = _("De-select to prevent loading files opened from the last LyX session.");
2770                 break;
2771
2772         case RC_MAKE_BACKUP:
2773                 str = _("De-select if you don't want LyX to create backup files.");
2774                 break;
2775
2776         case RC_MARK_FOREIGN_LANGUAGE:
2777                 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2778                 break;
2779
2780         case RC_MOUSE_WHEEL_SPEED:
2781                 str = bformat(_("The scrolling speed of the mouse wheel."),
2782                       maxlastfiles);
2783                 break;
2784
2785         case RC_COMPLETION_POPUP_DELAY:
2786                 str = _("The completion popup delay.");
2787                 break;
2788
2789         case RC_COMPLETION_POPUP_MATH:
2790                 str = _("Select to display the completion popup in math mode.");
2791                 break;
2792
2793         case RC_COMPLETION_POPUP_TEXT:
2794                 str = _("Select to display the completion popup in text mode.");
2795                 break;
2796
2797         case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2798                 str = _("Show the completion popup without delay after non-unique completion attempt.");
2799                 break;
2800
2801         case RC_COMPLETION_POPUP_TEXT:
2802                 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2803                 break;
2804
2805         case RC_COMPLETION_POPUP_DELAY:
2806                 str = _("The inline completion delay.");
2807                 break;
2808
2809         case RC_COMPLETION_INLINE_MATH:
2810                 str = _("Select to display the inline completion in math mode.");
2811                 break;
2812
2813         case RC_COMPLETION_INLINE_TEXT:
2814                 str = _("Select to display the inline completion in text mode.");
2815                 break;
2816
2817         case RC_COMPLETION_INLINE_DOTS:
2818                 str = _("Use \"...\" to shorten long completions.");
2819                 break;
2820
2821         case RC_AUTOCORRECTION_MATH:
2822                 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2823                 break;
2824
2825         case RC_NUMLASTFILES:
2826                 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2827                         maxlastfiles);
2828                 break;
2829
2830         case RC_PATH_PREFIX:
2831                 str = _("Specify those directories which should be "
2832                          "prepended to the PATH environment variable. "
2833                          "Use the OS native format.");
2834                 break;
2835
2836         case RC_PREVIEW:
2837                 str = _("Shows a typeset preview of things such as math");
2838                 break;
2839
2840         case RC_PREVIEW_HASHED_LABELS:
2841                 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2842                 break;
2843
2844         case RC_PREVIEW_SCALE_FACTOR:
2845                 str = _("Scale the preview size to suit.");
2846                 break;
2847
2848         case RC_PRINTCOLLCOPIESFLAG:
2849                 str = _("The option for specifying whether the copies should be collated.");
2850                 break;
2851
2852         case RC_PRINTCOPIESFLAG:
2853                 str = _("The option for specifying the number of copies to print.");
2854                 break;
2855
2856         case RC_PRINTER:
2857                 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2858                 break;
2859
2860         case RC_PRINTEVENPAGEFLAG:
2861                 str = _("The option to print only even pages.");
2862                 break;
2863
2864         case RC_PRINTEXSTRAOPTIONS:
2865                 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2866                 break;
2867
2868         case RC_PRINTFILEEXTENSION:
2869                 str = _("Extension of printer program output file. Usually \".ps\".");
2870                 break;
2871
2872         case RC_PRINTLANDSCAPEFLAG:
2873                 str = _("The option to print out in landscape.");
2874                 break;
2875
2876         case RC_PRINTODDPAGEFLAG:
2877                 str = _("The option to print only odd pages.");
2878                 break;
2879
2880         case RC_PRINTPAGERANGEFLAG:
2881                 str = _("The option for specifying a comma-separated list of pages to print.");
2882                 break;
2883
2884         case RC_PRINTPAPERDIMENSIONFLAG:
2885                                    str = _("Option to specify the dimensions of the print paper.");
2886                 break;
2887
2888         case RC_PRINTPAPERFLAG:
2889                 str = _("The option to specify paper type.");
2890                 break;
2891
2892         case RC_PRINTREVERSEFLAG:
2893                 str = _("The option to reverse the order of the pages printed.");
2894                 break;
2895
2896         case RC_PRINTSPOOL_COMMAND:
2897                 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.");
2898                 break;
2899
2900         case RC_PRINTSPOOL_PRINTERPREFIX:
2901                 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.");
2902                 break;
2903
2904         case RC_PRINTTOFILE:
2905                 str = _("Option to pass to the print program to print to a file.");
2906                 break;
2907
2908         case RC_PRINTTOPRINTER:
2909                 str = _("Option to pass to the print program to print on a specific printer.");
2910                 break;
2911
2912         case RC_PRINT_ADAPTOUTPUT:
2913                 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2914                 break;
2915
2916         case RC_PRINT_COMMAND:
2917                 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2918                 break;
2919
2920         case RC_RTL_SUPPORT:
2921                 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2922                 break;
2923
2924         case RC_VISUAL_CURSOR:
2925                 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2926                 break;
2927
2928         case RC_SCREEN_DPI:
2929                 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2930                 break;
2931
2932         case RC_SCREEN_FONT_ROMAN:
2933         case RC_SCREEN_FONT_SANS:
2934         case RC_SCREEN_FONT_TYPEWRITER:
2935                 str = _("The screen fonts used to display the text while editing.");
2936                 break;
2937
2938         case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2939         case RC_SCREEN_FONT_SANS_FOUNDRY:
2940         case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2941                 break;
2942
2943         case RC_SCREEN_FONT_SCALABLE:
2944                 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.");
2945                 break;
2946
2947         case RC_SCREEN_FONT_SIZES:
2948                 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2949                 break;
2950
2951         case RC_SCREEN_ZOOM:
2952                 //xgettext:no-c-format
2953                 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2954                 break;
2955
2956         case RC_GEOMETRY_SESSION:
2957                 str = _("Allow session manager to save and restore windows geometry.");
2958                 break;
2959
2960         case RC_SERVERPIPE:
2961                 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2962                 break;
2963
2964         case RC_SET_COLOR:
2965                 break;
2966
2967         case RC_SHOW_BANNER:
2968                 str = _("De-select if you don't want the startup banner.");
2969                 break;
2970
2971         case RC_TEMPDIRPATH:
2972                 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2973                 break;
2974
2975         case RC_THESAURUSDIRPATH:
2976                 str = _("This is the place where the files of the thesaurus library reside.");
2977                 break;
2978
2979         case RC_TEMPLATEPATH:
2980                 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2981                 break;
2982
2983         case RC_TEX_ALLOWS_SPACES:
2984                 break;
2985
2986         case RC_TEX_EXPECTS_WINDOWS_PATHS:
2987                 break;
2988
2989         case RC_UIFILE:
2990                 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2991                 break;
2992
2993         case RC_USER_EMAIL:
2994                 break;
2995
2996         case RC_USER_NAME:
2997                 break;
2998
2999         case RC_USETEMPDIR:
3000                 break;
3001
3002         case RC_USE_TOOLTIP:
3003                 str = _("Enable the automatic appearance of tool tips in the work area.");
3004                 break;
3005
3006         case RC_USE_PIXMAP_CACHE:
3007                 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3008                 break;
3009
3010         case RC_USE_SPELL_LIB:
3011                 break;
3012
3013         case RC_VIEWDVI_PAPEROPTION:
3014                 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3015                 break;
3016
3017         case RC_VIEWER:
3018                 break;
3019
3020         case RC_LAST:
3021                 break;
3022         }
3023
3024         return str;
3025 }
3026 #endif
3027
3028
3029 // The global instance
3030 LyXRC lyxrc;
3031
3032 // The global copy of the system lyxrc entries (everything except preferences)
3033 LyXRC system_lyxrc;
3034
3035
3036 } // namespace lyx