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