]> git.lyx.org Git - lyx.git/blob - src/lyxrc.C
remove lyxrc variables that where only used by xforms
[lyx.git] / src / lyxrc.C
1 /**
2  * \file lyxrc.C
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 <fstream>
20 #include <iostream>
21
22 #include "lyxrc.h"
23
24 #include "debug.h"
25 #include "converter.h"
26 #include "format.h"
27 #include "gettext.h"
28 #include "session.h"
29 #include "LColor.h"
30 #include "lyxlex.h"
31 #include "lyxfont.h"
32 #include "mover.h"
33
34 #include "graphics/GraphicsTypes.h"
35
36 #include "support/convert.h"
37 #include "support/environment.h"
38 #include "support/filetools.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
42
43
44 namespace lyx {
45
46 namespace os = support::os;
47
48 using support::ascii_lowercase;
49 using support::bformat;
50 using support::expandPath;
51 using support::FileName;
52 using support::getEnv;
53 using support::libFileSearch;
54 using support::token;
55
56 using std::cout;
57 using std::endl;
58
59 using std::ios;
60 using std::ofstream;
61 using std::ostream;
62 using std::string;
63
64
65 namespace {
66
67 // when adding something to this array keep it sorted!
68 keyword_item lyxrcTags[] = {
69         { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
70         { "\\alternate_language", LyXRC::RC_ALT_LANG },
71         { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
72         { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
73         { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
74         { "\\autosave", LyXRC::RC_AUTOSAVE },
75         { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
76         { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77         { "\\bind_file", LyXRC::RC_BINDFILE },
78         { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79         { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80         { "\\converter", LyXRC::RC_CONVERTER },
81         { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
82         { "\\copier", LyXRC::RC_COPIER },
83         { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
84         { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
85         { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
86         { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
87         { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
88         { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
89         { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
90         { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
91         { "\\document_path", LyXRC::RC_DOCUMENTPATH },
92         { "\\escape_chars", LyXRC::RC_ESC_CHARS },
93         { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
94         { "\\format", LyXRC::RC_FORMAT },
95         { "\\index_command", LyXRC::RC_INDEX_COMMAND },
96         { "\\input", LyXRC::RC_INPUT },
97         { "\\kbmap", LyXRC::RC_KBMAP },
98         { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
99         { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
100         { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
101         { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
102         { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
103         { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
104         { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
105         { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
106         { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
107         { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
108         { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
109         { "\\load_session", LyXRC::RC_LOADSESSION },
110         { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
111         { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
112         { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
113         { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
114         { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
115         { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
116         { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
117         { "\\preview", LyXRC::RC_PREVIEW },
118         { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
119         { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
120         { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
121         { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
122         { "\\print_command", LyXRC::RC_PRINT_COMMAND },
123         { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
124         { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
125         { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
126         { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
127         { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
128         { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
129         { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
130         { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
131         { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
132         { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
133         { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
134         { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
135         { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
136         { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
137         { "\\printer", LyXRC::RC_PRINTER },
138         { "\\rtl", LyXRC::RC_RTL_SUPPORT },
139         { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
140         { "\\screen_font_encoding", LyXRC::RC_SCREEN_FONT_ENCODING },
141         { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
142         { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
143         { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
144         { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
145         { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
146         { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
147         { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
148         { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
149         { "\\screen_geometry_height", LyXRC::RC_SCREEN_GEOMETRY_HEIGHT },
150         { "\\screen_geometry_width", LyXRC::RC_SCREEN_GEOMETRY_WIDTH },
151         { "\\screen_geometry_xysaved", LyXRC::RC_SCREEN_GEOMETRY_XYSAVED },
152         { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
153         { "\\serverpipe", LyXRC::RC_SERVERPIPE },
154         { "\\set_color", LyXRC::RC_SET_COLOR },
155         { "\\show_banner", LyXRC::RC_SHOW_BANNER },
156         { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
157         { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
158         { "\\template_path", LyXRC::RC_TEMPLATEPATH },
159         { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
160         { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
161         { "\\ui_file", LyXRC::RC_UIFILE },
162         { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
163         { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
164         { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
165         { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
166         { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
167         { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
168         // compatibility with versions older than 1.4.0 only
169         { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
170         { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
171         // compatibility with versions older than 1.4.0 only
172         { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
173         { "\\user_email", LyXRC::RC_USER_EMAIL },
174         { "\\user_name", LyXRC::RC_USER_NAME },
175         { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
176         // compatibility with versions older than 1.4.0 only
177         { "\\viewer" ,LyXRC::RC_VIEWER}
178 };
179
180 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
181
182 } // namespace anon
183
184
185 LyXRC::LyXRC()
186 {
187         setDefaults();
188 }
189
190
191 void LyXRC::setDefaults() {
192         bind_file = "cua";
193         ui_file = "default";
194         // Get printer from the environment. If fail, use default "",
195         // assuming that everything is set up correctly.
196         printer = getEnv("PRINTER");
197         print_adapt_output = false;
198         print_command = "dvips";
199         print_evenpage_flag = "-B";
200         print_oddpage_flag = "-A";
201         print_pagerange_flag = "-pp";
202         print_copies_flag = "-c";
203         print_collcopies_flag = "-C";
204         print_reverse_flag = "-r";
205         print_landscape_flag = "-t landscape";
206         print_to_printer = "-P";
207         print_to_file = "-o ";
208         print_file_extension = ".ps";
209         print_paper_flag = "-t";
210         print_paper_dimension_flag = "-T";
211         document_path.erase();
212         view_dvi_paper_option.erase();
213         default_papersize = PAPER_DEFAULT;
214         custom_export_format = "ps";
215         chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
216         bibtex_command = "bibtex";
217         fontenc = "default";
218         index_command = "makeindex -c -q";
219         dpi = 75;
220         // Because a screen typically is wider than a piece of paper:
221         zoom = 150;
222         geometry_width = 0;
223         geometry_height = 0;
224         geometry_xysaved = true;
225         // Default LaTeX font size:
226         font_sizes[LyXFont::SIZE_TINY] = "5.0";
227         font_sizes[LyXFont::SIZE_SCRIPT] = "7.0";
228         font_sizes[LyXFont::SIZE_FOOTNOTE] = "8.0";
229         font_sizes[LyXFont::SIZE_SMALL] = "9.0";
230         font_sizes[LyXFont::SIZE_NORMAL] = "10.0";
231         font_sizes[LyXFont::SIZE_LARGE] = "12.0";
232         font_sizes[LyXFont::SIZE_LARGER] = "14.4";
233         font_sizes[LyXFont::SIZE_LARGEST] = "17.26";
234         font_sizes[LyXFont::SIZE_HUGE] = "20.74";
235         font_sizes[LyXFont::SIZE_HUGER] = "24.88";
236         use_scalable_fonts = true;
237         roman_font_name = "";
238         sans_font_name = "";
239         typewriter_font_name = "";
240         font_norm = "iso8859-1";
241         font_norm_type = ISO_8859_1;
242         autosave = 300;
243         auto_region_delete = true;
244         auto_reset_options = false;
245         plaintext_linelen = 65;
246         num_lastfiles = maxlastfiles;
247         check_lastfiles = true;
248         use_lastfilepos = true;
249         load_session = false;
250         make_backup = true;
251         backupdir_path.erase();
252         display_graphics = graphics::ColorDisplay;
253         // Spellchecker settings:
254         use_spell_lib = true;
255         isp_command = "ispell";
256         isp_accept_compound = false;
257         isp_use_input_encoding = false;
258         isp_use_alt_lang = false;
259         isp_use_pers_dict = false;
260         isp_use_esc_chars = false;
261         use_kbmap = false;
262         rtl_support = false;
263         auto_number = true;
264         mark_foreign_language = true;
265         language_auto_begin = true;
266         language_auto_end = true;
267         language_global_options = true;
268         language_use_babel = true;
269         language_package = "\\usepackage{babel}";
270         language_command_begin = "\\selectlanguage{$$lang}";
271         language_command_local = "\\foreignlanguage{$$lang}{";
272         default_language = "english";
273         show_banner = true;
274         windows_style_tex_paths = false;
275         tex_allows_spaces = false;
276         date_insert_format = "%x";
277         cursor_follows_scrollbar = false;
278         dialogs_iconify_with_main = false;
279         label_init_length = 3;
280         preview = PREVIEW_OFF;
281         preview_hashed_labels  = false;
282         preview_scale_factor = "0.9";
283         use_converter_cache = false;
284         converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
285
286         user_name = to_utf8(support::user_name());
287
288         user_email = to_utf8(support::user_email());
289 }
290
291
292 namespace {
293
294 void oldFontFormat(string & family, string & foundry)
295 {
296         if (family.empty() || family[0] != '-')
297                 return;
298         foundry = token(family, '-', 1);
299         family = token(family, '-', 2);
300         if (foundry == "*")
301                 foundry.erase();
302 }
303
304 } // namespace anon
305
306
307 int LyXRC::read(FileName const & filename)
308 {
309         LyXLex lexrc(lyxrcTags, lyxrcCount);
310         if (lyxerr.debugging(Debug::PARSER))
311                 lexrc.printTable(lyxerr);
312
313         lexrc.setFile(filename);
314         if (!lexrc.isOK()) return -2;
315
316         lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
317
318         return read(lexrc);
319 }
320
321
322 int LyXRC::read(std::istream & is)
323 {
324         LyXLex lexrc(lyxrcTags, lyxrcCount);
325         if (lyxerr.debugging(Debug::PARSER))
326                 lexrc.printTable(lyxerr);
327
328         lexrc.setStream(is);
329         if (!lexrc.isOK()) return -2;
330
331         lyxerr[Debug::LYXRC] << "Reading istream..." << endl;
332
333         return read(lexrc);
334 }
335
336
337 int LyXRC::read(LyXLex & lexrc)
338 {
339         if (!lexrc.isOK()) return -2;
340
341         while (lexrc.isOK()) {
342                 // By using two switches we take advantage of the compiler
343                 // telling us if we have missed a LyXRCTags element in
344                 // the second switch.
345                 // Note that this also shows a problem with LyXLex since it
346                 // helps us avoid taking advantage of the strictness of the
347                 // compiler.
348
349                 int le = lexrc.lex();
350                 switch (le) {
351                 case LyXLex::LEX_UNDEF:
352                         lexrc.printError("Unknown tag `$$Token'");
353                         continue;
354                 case LyXLex::LEX_FEOF:
355                         continue;
356                 default: break;
357                 }
358                 switch (static_cast<LyXRCTags>(le)) {
359                 case RC_INPUT: // Include file
360                         if (lexrc.next()) {
361                                 FileName const tmp =
362                                         libFileSearch(string(),
363                                                       lexrc.getString());
364                                 if (read(tmp)) {
365                                         lexrc.printError("Error reading "
366                                                          "included file: " + tmp.absFilename());
367                                 }
368                         }
369                         break;
370                 case RC_BINDFILE:
371                         if (lexrc.next()) {
372                                 bind_file = os::internal_path(lexrc.getString());
373                         }
374                         break;
375
376                 case RC_UIFILE:
377                         if (lexrc.next()) {
378                                 ui_file = os::internal_path(lexrc.getString());
379                         }
380                         break;
381
382                 case RC_AUTORESET_OPTIONS:
383                         if (lexrc.next()) {
384                                 auto_reset_options = lexrc.getBool();
385                         }
386                         break;
387
388                 case RC_DISPLAY_GRAPHICS:
389                         if (lexrc.next()) {
390                                 display_graphics = graphics::displayTranslator().find(lexrc.getString());
391                         }
392                         break;
393
394                 case RC_TEX_EXPECTS_WINDOWS_PATHS:
395                         if (lexrc.next()) {
396                                 windows_style_tex_paths = lexrc.getBool();
397                         }
398                         break;
399
400                 case RC_TEX_ALLOWS_SPACES:
401                         if (lexrc.next()) {
402                                 tex_allows_spaces = lexrc.getBool();
403                         }
404                         break;
405
406                 case RC_KBMAP:
407                         if (lexrc.next()) {
408                                 use_kbmap = lexrc.getBool();
409                         }
410                         break;
411
412                 case RC_KBMAP_PRIMARY:
413                         if (lexrc.next()) {
414                                 string const kmap(os::internal_path(lexrc.getString()));
415                                 if (kmap.empty()) {
416                                         // nothing
417                                 } else if (!libFileSearch("kbd", kmap,
418                                                           "kmap").empty()) {
419                                         primary_kbmap = kmap;
420                                 } else {
421                                         lexrc.printError("LyX: Keymap `$$Token' not found");
422                                 }
423                         }
424                         break;
425
426                 case RC_KBMAP_SECONDARY:
427                         if (lexrc.next()) {
428                                 string const kmap(os::internal_path(lexrc.getString()));
429                                 if (kmap.empty()) {
430                                         // nothing
431                                 } else if (!libFileSearch("kbd", kmap,
432                                                           "kmap").empty()) {
433                                         secondary_kbmap = kmap;
434                                 } else {
435                                         lexrc.printError("LyX: Keymap `$$Token' not found");
436                                 }
437                         }
438                         break;
439
440                 case RC_FONT_ENCODING:
441                         if (lexrc.next()) {
442                                 fontenc = lexrc.getString();
443                         }
444                         break;
445
446                 case RC_PRINTER:
447                         if (lexrc.next()) {
448                                 printer = lexrc.getString();
449                         }
450                         break;
451
452                 case RC_PRINT_COMMAND:
453                         if (lexrc.next()) {
454                                 print_command = lexrc.getString();
455                         }
456                         break;
457
458                 case RC_PRINTEVENPAGEFLAG:
459                         if (lexrc.next()) {
460                                 print_evenpage_flag = lexrc.getString();
461                         }
462                         break;
463
464                 case RC_PRINTODDPAGEFLAG:
465                         if (lexrc.next()) {
466                                 print_oddpage_flag = lexrc.getString();
467                         }
468                         break;
469
470                 case RC_PRINTPAGERANGEFLAG:
471                         if (lexrc.next()) {
472                                 print_pagerange_flag = lexrc.getString();
473                         }
474                         break;
475
476                 case RC_PRINTCOPIESFLAG:
477                         if (lexrc.next()) {
478                                 print_copies_flag = lexrc.getString();
479                         }
480                         break;
481
482                 case RC_PRINTCOLLCOPIESFLAG:
483                         if (lexrc.next()) {
484                                 print_collcopies_flag = lexrc.getString();
485                         }
486                         break;
487
488                 case RC_PRINTREVERSEFLAG:
489                         if (lexrc.next()) {
490                                 print_reverse_flag = lexrc.getString();
491                         }
492                         break;
493
494                 case RC_PRINTLANDSCAPEFLAG:
495                         if (lexrc.next()) {
496                                 print_landscape_flag = lexrc.getString();
497                         }
498                         break;
499
500                 case RC_PRINTTOPRINTER:
501                         if (lexrc.next()) {
502                                 print_to_printer = lexrc.getString();
503                         }
504                         break;
505
506                 case RC_PRINT_ADAPTOUTPUT:
507                         if (lexrc.next()) {
508                                 print_adapt_output = lexrc.getBool();
509                         }
510                         break;
511
512                 case RC_PRINTTOFILE:
513                         if (lexrc.next()) {
514                                 print_to_file = os::internal_path(lexrc.getString());
515                         }
516                         break;
517
518                 case RC_PRINTFILEEXTENSION:
519                         if (lexrc.next()) {
520                                 print_file_extension = lexrc.getString();
521                         }
522                         break;
523
524                 case RC_PRINTEXSTRAOPTIONS:
525                         if (lexrc.next()) {
526                                 print_extra_options = lexrc.getString();
527                         }
528                         break;
529
530                 case RC_PRINTSPOOL_COMMAND:
531                         if (lexrc.next()) {
532                                 print_spool_command = lexrc.getString();
533                         }
534                         break;
535
536                 case RC_PRINTSPOOL_PRINTERPREFIX:
537                         if (lexrc.next()) {
538                                 print_spool_printerprefix = lexrc.getString();
539                         }
540                         break;
541
542                 case RC_PRINTPAPERDIMENSIONFLAG:
543                         if (lexrc.next()) {
544                                 print_paper_dimension_flag = lexrc.getString();
545                         }
546                         break;
547
548                 case RC_PRINTPAPERFLAG:
549                         if (lexrc.next()) {
550                                 print_paper_flag = lexrc.getString();
551                         }
552                         break;
553
554                 case RC_CUSTOM_EXPORT_COMMAND:
555                         if (lexrc.next()) {
556                                 custom_export_command = lexrc.getString();
557                         }
558                         break;
559
560                 case RC_CUSTOM_EXPORT_FORMAT:
561                         if (lexrc.next()) {
562                                 custom_export_format = lexrc.getString();
563                         }
564                         break;
565
566                 case RC_DEFAULT_PAPERSIZE:
567                         if (lexrc.next()) {
568                                 string const size =
569                                         ascii_lowercase(lexrc.getString());
570                                 if (size == "usletter")
571                                         default_papersize =
572                                                 PAPER_USLETTER;
573                                 else if (size == "legal")
574                                         default_papersize =
575                                                 PAPER_USLEGAL;
576                                 else if (size == "executive")
577                                         default_papersize =
578                                                 PAPER_USEXECUTIVE;
579                                 else if (size == "a3")
580                                         default_papersize =
581                                                 PAPER_A3;
582                                 else if (size == "a4")
583                                         default_papersize =
584                                                 PAPER_A4;
585                                 else if (size == "a5")
586                                         default_papersize =
587                                                 PAPER_A5;
588                                 else if (size == "b5")
589                                         default_papersize =
590                                                 PAPER_B5;
591                                 else if (size == "default")
592                                         default_papersize =
593                                                 PAPER_DEFAULT;
594                         }
595                         break;
596
597                 case RC_VIEWDVI_PAPEROPTION:
598                         if (lexrc.next()) {
599                                 view_dvi_paper_option = lexrc.getString();
600                         } else {
601                                 view_dvi_paper_option.erase();
602                         }
603                         break;
604
605                 case RC_CHKTEX_COMMAND:
606                         if (lexrc.next()) {
607                                 chktex_command = lexrc.getString();
608                         }
609                         break;
610
611                 case RC_BIBTEX_COMMAND:
612                         if (lexrc.next()) {
613                                 bibtex_command = lexrc.getString();
614                         }
615                         break;
616
617                 case RC_INDEX_COMMAND:
618                         if (lexrc.next()) {
619                                 index_command = lexrc.getString();
620                         }
621                         break;
622
623                 case RC_SCREEN_DPI:
624                         if (lexrc.next()) {
625                                 dpi = lexrc.getInteger();
626                         }
627                         break;
628
629                 case RC_SCREEN_ZOOM:
630                         if (lexrc.next()) {
631                                 zoom = lexrc.getInteger();
632                         }
633                         break;
634
635                 case RC_SCREEN_GEOMETRY_HEIGHT:
636                         if (lexrc.next()) {
637                                 geometry_height = lexrc.getInteger();
638                         }
639                         break;
640
641                 case RC_SCREEN_GEOMETRY_WIDTH:
642                         if (lexrc.next()) {
643                                 geometry_width = lexrc.getInteger();
644                         }
645                         break;
646
647                 case RC_SCREEN_GEOMETRY_XYSAVED:
648                         if (lexrc.next()) {
649                                 geometry_xysaved = lexrc.getBool();
650                         }
651                         break;
652
653                 case RC_SCREEN_FONT_SIZES:
654                         if (lexrc.next()) {
655                                 font_sizes[LyXFont::SIZE_TINY] =
656                                         lexrc.getString();
657                         }
658                         if (lexrc.next()) {
659                                 font_sizes[LyXFont::SIZE_SCRIPT] =
660                                         lexrc.getString();
661                         }
662                         if (lexrc.next()) {
663                                 font_sizes[LyXFont::SIZE_FOOTNOTE] =
664                                         lexrc.getString();
665                         }
666                         if (lexrc.next()) {
667                                 font_sizes[LyXFont::SIZE_SMALL] =
668                                         lexrc.getString();
669                         }
670                         if (lexrc.next()) {
671                                 font_sizes[LyXFont::SIZE_NORMAL] =
672                                         lexrc.getString();
673                         }
674                         if (lexrc.next()) {
675                                 font_sizes[LyXFont::SIZE_LARGE] =
676                                         lexrc.getString();
677                         }
678                         if (lexrc.next()) {
679                                 font_sizes[LyXFont::SIZE_LARGER] =
680                                         lexrc.getString();
681                         }
682                         if (lexrc.next()) {
683                                 font_sizes[LyXFont::SIZE_LARGEST] =
684                                         lexrc.getString();
685                         }
686                         if (lexrc.next()) {
687                                 font_sizes[LyXFont::SIZE_HUGE] =
688                                         lexrc.getString();
689                         }
690                         if (lexrc.next()) {
691                                 font_sizes[LyXFont::SIZE_HUGER] =
692                                         lexrc.getString();
693                         }
694                         break;
695
696                 case RC_SCREEN_FONT_SCALABLE:
697                         if (lexrc.next()) {
698                                 use_scalable_fonts = lexrc.getBool();
699                         }
700                         break;
701
702                 case RC_AUTOSAVE:
703                         if (lexrc.next()) {
704                                 autosave = lexrc.getInteger();
705                         }
706                         break;
707
708                 case RC_DOCUMENTPATH:
709                         if (lexrc.next()) {
710                                 document_path = os::internal_path(lexrc.getString());
711                                 document_path = expandPath(document_path);
712                         }
713                         break;
714
715                 case RC_TEMPLATEPATH:
716                         if (lexrc.next()) {
717                                 template_path = os::internal_path(lexrc.getString());
718                                 template_path = expandPath(template_path);
719                         }
720                         break;
721
722                 case RC_TEMPDIRPATH:
723                         if (lexrc.next()) {
724                                 tempdir_path = os::internal_path(lexrc.getString());
725                                 tempdir_path = expandPath(tempdir_path);
726                         }
727                         break;
728
729                 case RC_USETEMPDIR:
730                         if (lexrc.next()) {
731                                 lyxerr << "Ignoring obsolete use_tempdir flag." << endl;
732                         }
733                         break;
734
735                 case RC_USELASTFILEPOS:
736                         if (lexrc.next()) {
737                                 use_lastfilepos = lexrc.getBool();
738                         }
739                         break;
740
741                 case RC_LOADSESSION:
742                         if (lexrc.next()) {
743                                 load_session = lexrc.getBool();
744                         }
745                         break;
746
747                 case RC_NUMLASTFILES:
748                         if (lexrc.next()) {
749                                 num_lastfiles = lexrc.getInteger();
750                         }
751                         break;
752
753                 case RC_CHECKLASTFILES:
754                         if (lexrc.next()) {
755                                 check_lastfiles = lexrc.getBool();
756                         }
757                         break;
758
759                 case RC_SCREEN_FONT_ROMAN:
760                         if (lexrc.next()) {
761                                 roman_font_name = lexrc.getString();
762                                 oldFontFormat(roman_font_name,
763                                               roman_font_foundry);
764                         }
765                         break;
766
767                 case RC_SCREEN_FONT_SANS:
768                         if (lexrc.next()) {
769                                 sans_font_name = lexrc.getString();
770                                 oldFontFormat(sans_font_name, sans_font_foundry);
771                         }
772                         break;
773
774                 case RC_SCREEN_FONT_TYPEWRITER:
775                         if (lexrc.next()) {
776                                 typewriter_font_name = lexrc.getString();
777                                 oldFontFormat(typewriter_font_name,
778                                               typewriter_font_foundry);
779                         }
780                         break;
781
782                 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
783                         if (lexrc.next()) {
784                                 roman_font_foundry = lexrc.getString();
785                         }
786                         break;
787
788                 case RC_SCREEN_FONT_SANS_FOUNDRY:
789                         if (lexrc.next()) {
790                                 sans_font_foundry = lexrc.getString();
791                         }
792                         break;
793
794                 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
795                         if (lexrc.next()) {
796                                 typewriter_font_foundry = lexrc.getString();
797                         }
798                         break;
799
800                 case RC_SCREEN_FONT_ENCODING:
801                         if (lexrc.next()) {
802                                 font_norm = lexrc.getString();
803                                 set_font_norm_type();
804                         }
805                         break;
806
807                 case RC_SET_COLOR:
808                 {
809                         string lyx_name, x11_name;
810
811                         if (lexrc.next()) {
812                                 lyx_name = lexrc.getString();
813                         } else {
814                                 lexrc.printError("Missing color tag.");
815                                 break;
816                         }
817
818                         if (lexrc.next()) {
819                                 x11_name = lexrc.getString();
820                         } else {
821                                 lexrc.printError("Missing color name for color: `$$Token'");
822                                 break;
823                         }
824
825                         LColor::color const col =
826                                 lcolor.getFromLyXName(lyx_name);
827                         if (col == LColor::none ||
828                             col == LColor::inherit ||
829                             col == LColor::ignore)
830                                 break;
831
832                         if (!lcolor.setColor(col, x11_name)) {
833                                 lyxerr << "Bad lyxrc set_color for "
834                                         << lyx_name << endl;
835
836                         }
837                         break;
838                 }
839                 case RC_AUTOREGIONDELETE:
840                         // Auto region delete defaults to true
841                         if (lexrc.next()) {
842                                 auto_region_delete = lexrc.getBool();
843                         }
844                         break;
845
846                 case RC_SERVERPIPE:
847                         if (lexrc.next()) {
848                                 lyxpipes = os::internal_path(lexrc.getString());
849                                 lyxpipes = expandPath(lyxpipes);
850                         }
851                         break;
852
853                 case RC_CURSOR_FOLLOWS_SCROLLBAR:
854                         if (lexrc.next()) {
855                                 cursor_follows_scrollbar = lexrc.getBool();
856                         }
857                         break;
858
859                 case RC_DIALOGS_ICONIFY_WITH_MAIN:
860                         if (lexrc.next()) {
861                                 dialogs_iconify_with_main = lexrc.getBool();
862                         }
863                         break;
864
865                 case RC_PLAINTEXT_ROFF_COMMAND:
866                         if (lexrc.next()) {
867                                 plaintext_roff_command = lexrc.getString();
868                         }
869                         break;
870                 case RC_PLAINTEXT_LINELEN:
871                         if (lexrc.next()) {
872                                 plaintext_linelen = lexrc.getInteger();
873                         }
874                         break;
875                         // Spellchecker settings:
876                 case RC_USE_SPELL_LIB:
877                         if (lexrc.next()) {
878                                 use_spell_lib = lexrc.getBool();
879                         }
880                         break;
881                 case RC_SPELL_COMMAND:
882                         if (lexrc.next()) {
883                                 isp_command = lexrc.getString();
884                         }
885                         break;
886                 case RC_ACCEPT_COMPOUND:
887                         if (lexrc.next()) {
888                                 isp_accept_compound = lexrc.getBool();
889                         }
890                         break;
891                 case RC_USE_INP_ENC:
892                         if (lexrc.next()) {
893                                 isp_use_input_encoding = lexrc.getBool();
894                         }
895                         break;
896                 case RC_USE_ALT_LANG:
897                         if (lexrc.next()) {
898                                 isp_use_alt_lang = lexrc.getBool();
899                         }
900                         break;
901                 case RC_USE_PERS_DICT:
902                         if (lexrc.next()) {
903                                 isp_use_pers_dict = lexrc.getBool();
904                         }
905                         break;
906                 case RC_USE_ESC_CHARS:
907                         if (lexrc.next()) {
908                                 isp_use_esc_chars = lexrc.getBool();
909                         }
910                         break;
911                 case RC_ALT_LANG:
912                         if (lexrc.next()) {
913                                 isp_alt_lang = lexrc.getString();
914                         }
915                         break;
916                 case RC_PERS_DICT:
917                         if (lexrc.next()) {
918                                 isp_pers_dict = os::internal_path(lexrc.getString());
919                         }
920                         break;
921                 case RC_ESC_CHARS:
922                         if (lexrc.next()) {
923                                 isp_esc_chars = lexrc.getString();
924                         }
925                         break;
926                 case RC_MAKE_BACKUP:
927                         if (lexrc.next()) {
928                                 make_backup = lexrc.getBool();
929                         }
930                         break;
931                 case RC_BACKUPDIR_PATH:
932                         if (lexrc.next()) {
933                                 backupdir_path = os::internal_path(lexrc.getString());
934                                 backupdir_path = expandPath(backupdir_path);
935                         }
936                         break;
937                 case RC_DATE_INSERT_FORMAT:
938                         if (lexrc.next()) {
939                                 date_insert_format = lexrc.getString();
940                         }
941                         break;
942                 case RC_LANGUAGE_PACKAGE:
943                         if (lexrc.next()) {
944                                 language_package = lexrc.getString();
945                         }
946                         break;
947                 case RC_LANGUAGE_AUTO_BEGIN:
948                         if (lexrc.next()) {
949                                 language_auto_begin = lexrc.getBool();
950                         }
951                         break;
952                 case RC_LANGUAGE_AUTO_END:
953                         if (lexrc.next()) {
954                                 language_auto_end = lexrc.getBool();
955                         }
956                         break;
957                 case RC_LANGUAGE_GLOBAL_OPTIONS:
958                         if (lexrc.next()) {
959                                 language_global_options = lexrc.getBool();
960                         }
961                         break;
962                 case RC_LANGUAGE_USE_BABEL:
963                         if (lexrc.next()) {
964                                 language_use_babel = lexrc.getBool();
965                         }
966                         break;
967                 case RC_LANGUAGE_COMMAND_BEGIN:
968                         if (lexrc.next()) {
969                                 language_command_begin = lexrc.getString();
970                         }
971                         break;
972                 case RC_LANGUAGE_COMMAND_END:
973                         if (lexrc.next()) {
974                                 language_command_end = lexrc.getString();
975                         }
976                         break;
977                 case RC_LANGUAGE_COMMAND_LOCAL:
978                         if (lexrc.next()) {
979                                 language_command_local = lexrc.getString();
980                         }
981                         break;
982                 case RC_RTL_SUPPORT:
983                         if (lexrc.next()) {
984                                 rtl_support = lexrc.getBool();
985                         }
986                         break;
987                 case RC_AUTO_NUMBER:
988                         if (lexrc.next()) {
989                                 auto_number = lexrc.getBool();
990                         }
991                         break;
992                 case RC_MARK_FOREIGN_LANGUAGE:
993                         if (lexrc.next()) {
994                                 mark_foreign_language = lexrc.getBool();
995                         }
996                         break;
997
998                 case RC_COPIER: {
999                         string fmt, command;
1000                         if (lexrc.next()) {
1001                                 fmt = lexrc.getString();
1002                         }
1003                         if (lexrc.next()) {
1004                                 command = lexrc.getString();
1005                         }
1006                         setMover(fmt, command);
1007                         break;
1008                 }
1009
1010                 case RC_CONVERTER: {
1011                         string from, to, command, flags;
1012                         if (lexrc.next()) {
1013                                 from = lexrc.getString();
1014                         }
1015                         if (lexrc.next()) {
1016                                 to = lexrc.getString();
1017                         }
1018                         if (lexrc.next()) {
1019                                 command = lexrc.getString();
1020                         }
1021                         if (lexrc.next()) {
1022                                 flags = lexrc.getString();
1023                         }
1024                         if (command.empty()) {
1025                                 theConverters().erase(from, to);
1026                         } else {
1027                                 theConverters().add(from, to, command, flags);
1028                         }
1029                         break;
1030                 }
1031                 // compatibility with versions older than 1.4.0 only
1032                 case RC_VIEWER: {
1033                         string format, command;
1034                         if (lexrc.next()) {
1035                                 format = lexrc.getString();
1036                         }
1037                         if (lexrc.next()) {
1038                                 command = lexrc.getString();
1039                         }
1040                         formats.setViewer(format, command);
1041                         break;
1042                 }
1043                 case RC_FORMAT: {
1044                         string format, extension, prettyname, shortcut;
1045                         if (lexrc.next()) {
1046                                 format = lexrc.getString();
1047                         }
1048                         if (lexrc.next()) {
1049                                 extension = lexrc.getString();
1050                         }
1051                         if (lexrc.next()) {
1052                                 prettyname = lexrc.getString();
1053                         }
1054                         if (lexrc.next()) {
1055                                 shortcut = lexrc.getString();
1056                         }
1057                         string viewer, editor;
1058                         if (lexrc.next())
1059                                 viewer = lexrc.getString();
1060                         if (lexrc.next())
1061                                 editor = lexrc.getString();
1062                         string flags;
1063                         // Hack to ensure compatibility with versions older
1064                         // than 1.5.0
1065                         int le = lexrc.lex();
1066                         if (le != LyXLex::LEX_FEOF && le != LyXLex::LEX_UNDEF) {
1067                                 flags = lexrc.getString();
1068                                 if (le != LyXLex::LEX_DATA) {
1069                                         // We have got a known token.
1070                                         // Therefore this is an old style
1071                                         // format definition without
1072                                         // flags.
1073                                         lexrc.pushToken(flags);
1074                                         flags.erase();
1075                                 }
1076                         }
1077                         int flgs = Format::none;
1078                         while (!flags.empty()) {
1079                                 string flag;
1080                                 flags = support::split(flags, flag, ',');
1081                                 if (flag == "document")
1082                                         flgs |= Format::document;
1083                                 else if (flag == "vector")
1084                                         flgs |= Format::vector;
1085                                 else
1086                                         lyxerr << "Ignoring unknown flag `"
1087                                                << flag << "' for format `"
1088                                                << format << "'." << endl;
1089                         }
1090                         if (prettyname.empty()) {
1091                                 if (theConverters().formatIsUsed(format)) {
1092                                         lyxerr << "Can't delete format "
1093                                                << format << endl;
1094                                 } else {
1095                                         formats.erase(format);
1096                                 }
1097                         } else {
1098                                 formats.add(format, extension, prettyname,
1099                                             shortcut, viewer, editor, flgs);
1100                         }
1101                         break;
1102                 }
1103                 case RC_DEFAULT_LANGUAGE:
1104                         if (lexrc.next()) {
1105                                 default_language = lexrc.getString();
1106                         }
1107                         break;
1108
1109                 case RC_LABEL_INIT_LENGTH:
1110                         if (lexrc.next()) {
1111                                 label_init_length = lexrc.getInteger();
1112                         }
1113                         break;
1114
1115                 case RC_SHOW_BANNER:
1116                         if (lexrc.next()) {
1117                                 show_banner = lexrc.getBool();
1118                         }
1119                         break;
1120
1121                 case RC_PREVIEW:
1122                         if (lexrc.next()) {
1123                                 string const tmp = lexrc.getString();
1124                                 if (tmp == "true" || tmp == "on")
1125                                         preview = PREVIEW_ON;
1126                                 else if (tmp == "no_math")
1127                                         preview = PREVIEW_NO_MATH;
1128                                 else {
1129                                         preview = PREVIEW_OFF;
1130                                         if (tmp != "false" && tmp != "off")
1131                                                 lyxerr << "Unrecognized "
1132                                                         "preview status \""
1133                                                        << tmp << '\n' << endl;
1134                                 }
1135                         }
1136                         break;
1137
1138                 case RC_PREVIEW_HASHED_LABELS:
1139                         if (lexrc.next()) {
1140                                 preview_hashed_labels = lexrc.getBool();
1141                         }
1142                         break;
1143
1144                 case RC_PREVIEW_SCALE_FACTOR:
1145                         if (lexrc.next()) {
1146                                 preview_scale_factor = lexrc.getString();
1147                         }
1148                         break;
1149
1150                 case RC_USER_NAME:
1151                         if (lexrc.next())
1152                                 user_name = lexrc.getString();
1153                         break;
1154
1155                 case RC_USER_EMAIL:
1156                         if (lexrc.next())
1157                                 user_email = lexrc.getString();
1158                         break;
1159
1160                 case RC_PATH_PREFIX:
1161                         if (lexrc.next())
1162                                 path_prefix = lexrc.getString();
1163                         break;
1164
1165                 case RC_USE_CONVERTER_CACHE:
1166                         if (lexrc.next())
1167                                 use_converter_cache = lexrc.getBool();
1168                         break;
1169
1170                 case RC_CONVERTER_CACHE_MAXAGE:
1171                         if (lexrc.next())
1172                                 converter_cache_maxage =
1173                                         convert<unsigned int>(lexrc.getString());
1174                         break;
1175
1176                 case RC_LAST: break; // this is just a dummy
1177                 }
1178         }
1179
1180         /// Update converters data-structures
1181         theConverters().update(formats);
1182         theConverters().buildGraph();
1183
1184         return 0;
1185 }
1186
1187
1188 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1189 {
1190         ofstream ofs(filename.toFilesystemEncoding().c_str());
1191         if (ofs)
1192                 write(ofs, ignore_system_lyxrc);
1193 }
1194
1195
1196 void LyXRC::print() const
1197 {
1198         if (lyxerr.debugging())
1199                 write(lyxerr, false);
1200         else
1201                 write(cout, false);
1202 }
1203
1204
1205 class SameMover {
1206 public:
1207         typedef std::pair<std::string, SpecialisedMover> Data;
1208
1209         SameMover(Data const & comparison)
1210                 : comparison_(comparison) {}
1211
1212         bool operator()(Data const & data) const
1213         {
1214                 return data.first == comparison_.first &&
1215                         data.second.command() == comparison_.second.command();
1216         }
1217
1218 private:
1219         Data comparison_;
1220 };
1221
1222
1223 void LyXRC::write(ostream & os, bool ignore_system_lyxrc) const
1224 {
1225         os << "### This file is part of\n"
1226            << "### ========================================================\n"
1227            << "###          LyX, The Document Processor\n"
1228            << "###\n"
1229            << "###          Copyright 1995 Matthias Ettrich\n"
1230            << "###          Copyright 1995-2001 The LyX Team.\n"
1231            << "###\n"
1232            << "### ========================================================\n"
1233            << "\n"
1234            << "# This file is written by LyX, if you want to make your own\n"
1235            << "# modifications you should do them from inside LyX and save\n"
1236            << "\n";
1237
1238         // Why the switch you might ask. It is a trick to ensure that all
1239         // the elements in the LyXRCTags enum is handled. As you can see
1240         // there are no breaks at all. So it is just a huge fall-through.
1241         // The nice thing is that we will get a warning from the compiler
1242         // if we forget an element.
1243         LyXRCTags tag = RC_LAST;
1244         switch (tag) {
1245         case RC_LAST:
1246         case RC_INPUT:
1247                 // input/include files are not done here
1248         case RC_BINDFILE:
1249                 if (ignore_system_lyxrc ||
1250                     bind_file != system_lyxrc.bind_file) {
1251                         string const path = os::external_path(bind_file);
1252                         os << "\\bind_file \"" << path << "\"\n";
1253                 }
1254                 //
1255                 // Misc Section
1256                 //
1257                 os << "\n#\n"
1258                    << "# MISC SECTION ######################################\n"
1259                    << "#\n\n";
1260
1261                 // bind files are not done here.
1262
1263         case RC_PATH_PREFIX:
1264                 if (ignore_system_lyxrc ||
1265                     path_prefix != system_lyxrc.path_prefix) {
1266                         os << "\\path_prefix \"" << path_prefix << "\"\n";
1267                 }
1268
1269         case RC_UIFILE:
1270                 if (ignore_system_lyxrc ||
1271                     ui_file != system_lyxrc.ui_file) {
1272                         string const path = os::external_path(ui_file);
1273                         os << "\\ui_file \"" << path << "\"\n";
1274                 }
1275         case RC_AUTOREGIONDELETE:
1276                 if (ignore_system_lyxrc ||
1277                     auto_region_delete != system_lyxrc.auto_region_delete) {
1278                         os << "# Set to false to inhibit automatic replacement of\n"
1279                            << "# the current selection.\n"
1280                            << "\\auto_region_delete " << convert<string>(auto_region_delete)
1281                            << '\n';
1282                 }
1283         case RC_AUTORESET_OPTIONS:
1284                 if (ignore_system_lyxrc ||
1285                     auto_reset_options != system_lyxrc.auto_reset_options) {
1286                         os << "# Set to false to inhibit automatic reset of\n"
1287                            << "# the class options to defaults on class change.\n"
1288                            << "\\auto_reset_options "
1289                            << convert<string>(auto_reset_options)
1290                            << '\n';
1291                 }
1292         case RC_AUTOSAVE:
1293                 if (ignore_system_lyxrc ||
1294                     autosave != system_lyxrc.autosave) {
1295                         os << "# The time interval between auto-saves in seconds.\n"
1296                            << "\\autosave " << autosave << '\n';
1297                 }
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                            << "# monochrome|grayscale|color|none\n"
1303                            << "\\display_graphics "
1304                            << graphics::displayTranslator().find(display_graphics)
1305                            << '\n';
1306                 }
1307
1308         case RC_VIEWDVI_PAPEROPTION:
1309                 if (ignore_system_lyxrc ||
1310                     view_dvi_paper_option
1311                     != system_lyxrc.view_dvi_paper_option) {
1312                         os << "# Options used to specify paper size to the\n"
1313                            << "# view_dvi_command (e.g. -paper)\n"
1314                            << "\\view_dvi_paper_option \""
1315                            << view_dvi_paper_option << "\"\n";
1316                 }
1317         case RC_DEFAULT_PAPERSIZE:
1318                 if (ignore_system_lyxrc ||
1319                     default_papersize != system_lyxrc.default_papersize) {
1320                         os << "# The default papersize to use.\n"
1321                            << "\\default_papersize \"";
1322                         switch (default_papersize) {
1323                         case PAPER_DEFAULT:
1324                                 os << "default"; break;
1325                         case PAPER_USLETTER:
1326                                 os << "usletter"; break;
1327                         case PAPER_USLEGAL:
1328                                 os << "legal"; break;
1329                         case PAPER_USEXECUTIVE:
1330                                 os << "executive"; break;
1331                         case PAPER_A3:
1332                                 os << "a3"; break;
1333                         case PAPER_A4:
1334                                 os << "a4"; break;
1335                         case PAPER_A5:
1336                                 os << "a5"; break;
1337                         case PAPER_B5:
1338                                 os << "b5"; break;
1339                         case PAPER_CUSTOM:
1340                         case PAPER_B3:
1341                         case PAPER_B4: break;
1342                         }
1343                         os << "\"\n";
1344                 }
1345         case RC_CHKTEX_COMMAND:
1346                 if (ignore_system_lyxrc ||
1347                     chktex_command != system_lyxrc.chktex_command) {
1348                         os << "\\chktex_command \"" << chktex_command << "\"\n";
1349                 }
1350         case RC_BIBTEX_COMMAND:
1351                 if (ignore_system_lyxrc ||
1352                     bibtex_command != system_lyxrc.bibtex_command) {
1353                         os << "\\bibtex_command \"" << bibtex_command << "\"\n";
1354                 }
1355         case RC_INDEX_COMMAND:
1356                 if (ignore_system_lyxrc ||
1357                     index_command != system_lyxrc.index_command) {
1358                         os << "\\index_command \"" << index_command << "\"\n";
1359                 }
1360         case RC_TEX_EXPECTS_WINDOWS_PATHS:
1361                 if (ignore_system_lyxrc ||
1362                     windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1363                         os << "\\tex_expects_windows_paths "
1364                            << convert<string>(windows_style_tex_paths) << '\n';
1365                 }
1366         case RC_TEX_ALLOWS_SPACES:
1367                 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1368                         os << "\\tex_allows_spaces "
1369                            << convert<string>(tex_allows_spaces) << '\n';
1370                 }
1371         case RC_KBMAP:
1372                 if (ignore_system_lyxrc ||
1373                     use_kbmap != system_lyxrc.use_kbmap) {
1374                         os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1375                 }
1376         case RC_KBMAP_PRIMARY:
1377                 if (ignore_system_lyxrc ||
1378                     primary_kbmap != system_lyxrc.primary_kbmap) {
1379                         string const path = os::external_path(primary_kbmap);
1380                         os << "\\kbmap_primary \"" << path << "\"\n";
1381                 }
1382         case RC_KBMAP_SECONDARY:
1383                 if (ignore_system_lyxrc ||
1384                     secondary_kbmap != system_lyxrc.secondary_kbmap) {
1385                         string const path = os::external_path(secondary_kbmap);
1386                         os << "\\kbmap_secondary \"" << path << "\"\n";
1387                 }
1388         case RC_SERVERPIPE:
1389                 if (ignore_system_lyxrc ||
1390                     lyxpipes != system_lyxrc.lyxpipes) {
1391                         string const path = os::external_path(lyxpipes);
1392                         os << "\\serverpipe \"" << path << "\"\n";
1393                 }
1394         case RC_DATE_INSERT_FORMAT:
1395                 if (ignore_system_lyxrc ||
1396                     date_insert_format != system_lyxrc.date_insert_format) {
1397                         os << "\\date_insert_format \"" << date_insert_format
1398                            << "\"\n";
1399                 }
1400         case RC_LABEL_INIT_LENGTH:
1401                 if (ignore_system_lyxrc ||
1402                     label_init_length != system_lyxrc.label_init_length) {
1403                         os << "\\label_init_length " << label_init_length
1404                            << '\n';
1405                 }
1406
1407         case RC_USER_NAME:
1408                 os << "\\user_name \"" << user_name << "\"\n";
1409
1410         case RC_USER_EMAIL:
1411                 os << "\\user_email \"" << user_email << "\"\n";
1412
1413         case RC_SHOW_BANNER:
1414                 if (ignore_system_lyxrc ||
1415                     show_banner != system_lyxrc.show_banner) {
1416                         os << "\\show_banner " << convert<string>(show_banner) << '\n';
1417                 }
1418
1419         case RC_PREVIEW:
1420                 if (ignore_system_lyxrc ||
1421                     preview != system_lyxrc.preview) {
1422                         string status;
1423                         switch (preview) {
1424                         case PREVIEW_ON:
1425                                 status = "on";
1426                                 break;
1427                         case PREVIEW_NO_MATH:
1428                                 status = "no_math";
1429                                 break;
1430                         case PREVIEW_OFF:
1431                                 status = "off";
1432                                 break;
1433                         }
1434                         os << "\\preview " << status << '\n';
1435                 }
1436
1437         case RC_PREVIEW_HASHED_LABELS:
1438                 if (ignore_system_lyxrc ||
1439                     preview_hashed_labels !=
1440                     system_lyxrc.preview_hashed_labels) {
1441                         os << "\\preview_hashed_labels "
1442                            << convert<string>(preview_hashed_labels) << '\n';
1443                 }
1444
1445         case RC_PREVIEW_SCALE_FACTOR:
1446                 if (ignore_system_lyxrc ||
1447                     preview_scale_factor != system_lyxrc.preview_scale_factor) {
1448                         os << "\\preview_scale_factor "
1449                            << preview_scale_factor << '\n';
1450                 }
1451
1452         case RC_USE_CONVERTER_CACHE:
1453                 if (ignore_system_lyxrc ||
1454                     use_converter_cache != system_lyxrc.use_converter_cache) {
1455                         os << "\\use_converter_cache "
1456                            << convert<string>(use_converter_cache) << '\n';
1457                 }
1458
1459         case RC_CONVERTER_CACHE_MAXAGE:
1460                 if (ignore_system_lyxrc ||
1461                     converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1462                         os << "\\converter_cache_maxage "
1463                            << converter_cache_maxage << '\n';
1464                 }
1465
1466                 os << "\n#\n"
1467                    << "# SCREEN & FONTS SECTION ############################\n"
1468                    << "#\n\n";
1469
1470         case RC_SCREEN_DPI:
1471                 if (ignore_system_lyxrc ||
1472                     dpi != system_lyxrc.dpi) {
1473                         os << "\\screen_dpi " << dpi << '\n';
1474                 }
1475         case RC_SCREEN_ZOOM:
1476                 if (ignore_system_lyxrc ||
1477                     zoom != system_lyxrc.zoom) {
1478                         os << "\\screen_zoom " << zoom << '\n';
1479                 }
1480         case RC_SCREEN_GEOMETRY_HEIGHT:
1481                 if (ignore_system_lyxrc ||
1482                     geometry_height != system_lyxrc.geometry_height) {
1483                         os << "\\screen_geometry_height " << geometry_height
1484                            << '\n';
1485                 }
1486         case RC_SCREEN_GEOMETRY_WIDTH:
1487                 if (ignore_system_lyxrc ||
1488                     geometry_width != system_lyxrc.geometry_width) {
1489                         os << "\\screen_geometry_width " << geometry_width
1490                            << '\n';
1491                 }
1492         case RC_SCREEN_GEOMETRY_XYSAVED:
1493                 if (ignore_system_lyxrc ||
1494                     geometry_xysaved != system_lyxrc.geometry_xysaved) {
1495                         os << "\\screen_geometry_xysaved " << convert<string>(geometry_xysaved)
1496                            << '\n';
1497                 }
1498         case RC_CURSOR_FOLLOWS_SCROLLBAR:
1499                 if (ignore_system_lyxrc ||
1500                     cursor_follows_scrollbar
1501                     != system_lyxrc.cursor_follows_scrollbar) {
1502                         os << "\\cursor_follows_scrollbar "
1503                            << convert<string>(cursor_follows_scrollbar) << '\n';
1504                 }
1505         case RC_DIALOGS_ICONIFY_WITH_MAIN:
1506                 if (ignore_system_lyxrc ||
1507                     dialogs_iconify_with_main
1508                    != system_lyxrc.dialogs_iconify_with_main) {
1509                         os << "\\dialogs_iconify_with_main "
1510                           <<  convert<string>(dialogs_iconify_with_main) << '\n';
1511                 }
1512         case RC_SCREEN_FONT_ROMAN:
1513                 if (ignore_system_lyxrc ||
1514                     roman_font_name != system_lyxrc.roman_font_name) {
1515                         os << "\\screen_font_roman \"" << roman_font_name
1516                            << "\"\n";
1517                 }
1518         case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1519                 if (ignore_system_lyxrc ||
1520                     roman_font_foundry != system_lyxrc.roman_font_foundry) {
1521                         os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1522                            << "\"\n";
1523                 }
1524         case RC_SCREEN_FONT_SANS:
1525                 if (ignore_system_lyxrc ||
1526                     sans_font_name != system_lyxrc.sans_font_name) {
1527                         os << "\\screen_font_sans \"" << sans_font_name
1528                            << "\"\n";
1529                 }
1530         case RC_SCREEN_FONT_SANS_FOUNDRY:
1531                 if (ignore_system_lyxrc ||
1532                     sans_font_foundry != system_lyxrc.sans_font_foundry) {
1533                         os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1534                            << "\"\n";
1535                 }
1536         case RC_SCREEN_FONT_TYPEWRITER:
1537                 if (ignore_system_lyxrc ||
1538                     typewriter_font_name != system_lyxrc.typewriter_font_name) {
1539                         os << "\\screen_font_typewriter \""
1540                            << typewriter_font_name << "\"\n";
1541                 }
1542         case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1543                 if (ignore_system_lyxrc ||
1544                     typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1545                         os << "\\screen_font_typewriter_foundry \""
1546                            << typewriter_font_foundry << "\"\n";
1547                 }
1548
1549         case RC_SCREEN_FONT_SCALABLE:
1550                 if (ignore_system_lyxrc ||
1551                     use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1552                         os << "\\screen_font_scalable "
1553                            << convert<string>(use_scalable_fonts)
1554                            << '\n';
1555                 }
1556         case RC_SCREEN_FONT_ENCODING:
1557                 if (ignore_system_lyxrc ||
1558                     font_norm != system_lyxrc.font_norm) {
1559                         os << "\\screen_font_encoding \"" << font_norm
1560                            << "\"\n";
1561                 }
1562         case RC_SCREEN_FONT_SIZES:
1563                 if (ignore_system_lyxrc ||
1564                     font_sizes[LyXFont::SIZE_TINY]
1565                     != system_lyxrc.font_sizes[LyXFont::SIZE_TINY] ||
1566                     font_sizes[LyXFont::SIZE_SCRIPT]
1567                     != system_lyxrc.font_sizes[LyXFont::SIZE_SCRIPT] ||
1568                     font_sizes[LyXFont::SIZE_FOOTNOTE]
1569                     != system_lyxrc.font_sizes[LyXFont::SIZE_FOOTNOTE] ||
1570                     font_sizes[LyXFont::SIZE_SMALL]
1571                     != system_lyxrc.font_sizes[LyXFont::SIZE_SMALL] ||
1572                     font_sizes[LyXFont::SIZE_NORMAL]
1573                     != system_lyxrc.font_sizes[LyXFont::SIZE_NORMAL] ||
1574                     font_sizes[LyXFont::SIZE_LARGE]
1575                     != system_lyxrc.font_sizes[LyXFont::SIZE_LARGE] ||
1576                     font_sizes[LyXFont::SIZE_LARGER]
1577                     != system_lyxrc.font_sizes[LyXFont::SIZE_LARGER] ||
1578                     font_sizes[LyXFont::SIZE_LARGEST]
1579                     != system_lyxrc.font_sizes[LyXFont::SIZE_LARGEST] ||
1580                     font_sizes[LyXFont::SIZE_HUGE]
1581                     != system_lyxrc.font_sizes[LyXFont::SIZE_HUGE] ||
1582                     font_sizes[LyXFont::SIZE_HUGER]
1583                     != system_lyxrc.font_sizes[LyXFont::SIZE_HUGER]) {
1584                         os.setf(ios::fixed);
1585                         os.precision(2);
1586                         os << "\\screen_font_sizes"
1587                            << ' ' << font_sizes[LyXFont::SIZE_TINY]
1588                            << ' ' << font_sizes[LyXFont::SIZE_SCRIPT]
1589                            << ' ' << font_sizes[LyXFont::SIZE_FOOTNOTE]
1590                            << ' ' << font_sizes[LyXFont::SIZE_SMALL]
1591                            << ' ' << font_sizes[LyXFont::SIZE_NORMAL]
1592                            << ' ' << font_sizes[LyXFont::SIZE_LARGE]
1593                            << ' ' << font_sizes[LyXFont::SIZE_LARGER]
1594                            << ' ' << font_sizes[LyXFont::SIZE_LARGEST]
1595                            << ' ' << font_sizes[LyXFont::SIZE_HUGE]
1596                            << ' ' << font_sizes[LyXFont::SIZE_HUGER]
1597                            << '\n';
1598                 }
1599
1600                 os << "\n#\n"
1601                    << "# COLOR SECTION ###################################\n"
1602                    << "#\n\n";
1603
1604         case RC_SET_COLOR:
1605                 for (int i = 0; i < LColor::ignore; ++i) {
1606                         LColor::color lc = static_cast<LColor::color>(i);
1607
1608                         string const col(lcolor.getX11Name(lc));
1609                         if (ignore_system_lyxrc ||
1610                             col != system_lcolor.getX11Name(lc)) {
1611                                 os << "\\set_color \""
1612                                    << lcolor.getLyXName(lc) << "\" \""
1613                                    << col << "\"\n";
1614                         }
1615                 }
1616
1617                 os << "\n#\n"
1618                    << "# PRINTER SECTION ###################################\n"
1619                    << "#\n\n";
1620
1621         case RC_PRINTER:
1622                 if (ignore_system_lyxrc ||
1623                     printer != system_lyxrc.printer) {
1624                         os << "\\printer \"" << printer << "\"\n";
1625                 }
1626         case RC_PRINT_ADAPTOUTPUT:
1627                 if (ignore_system_lyxrc ||
1628                     print_adapt_output != system_lyxrc.print_adapt_output) {
1629                         os << "\\print_adapt_output "
1630                            << convert<string>(print_adapt_output)
1631                            << '\n';
1632                 }
1633         case RC_PRINT_COMMAND:
1634                 if (ignore_system_lyxrc ||
1635                     print_command != system_lyxrc.print_command) {
1636                         os << "\\print_command \"" << print_command << "\"\n";
1637                 }
1638         case RC_PRINTEXSTRAOPTIONS:
1639                 if (ignore_system_lyxrc ||
1640                     print_extra_options != system_lyxrc.print_extra_options) {
1641                         os << "\\print_extra_options \"" << print_extra_options
1642                            << "\"\n";
1643                 }
1644         case RC_PRINTSPOOL_COMMAND:
1645                 if (ignore_system_lyxrc ||
1646                     print_spool_command != system_lyxrc.print_spool_command) {
1647                         os << "\\print_spool_command \"" << print_spool_command
1648                            << "\"\n";
1649                 }
1650         case RC_PRINTSPOOL_PRINTERPREFIX:
1651                 if (ignore_system_lyxrc ||
1652                     print_spool_printerprefix
1653                     != system_lyxrc.print_spool_printerprefix) {
1654                         os << "\\print_spool_printerprefix \""
1655                            << print_spool_printerprefix << "\"\n";
1656                 }
1657         case RC_PRINTEVENPAGEFLAG:
1658                 if (ignore_system_lyxrc ||
1659                     print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1660                         os << "\\print_evenpage_flag \"" << print_evenpage_flag
1661                            << "\"\n";
1662                 }
1663         case RC_PRINTODDPAGEFLAG:
1664                 if (ignore_system_lyxrc ||
1665                     print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1666                         os << "\\print_oddpage_flag \"" << print_oddpage_flag
1667                            << "\"\n";
1668                 }
1669         case RC_PRINTREVERSEFLAG:
1670                 if (ignore_system_lyxrc ||
1671                     print_reverse_flag != system_lyxrc.print_reverse_flag) {
1672                         os << "\\print_reverse_flag \"" << print_reverse_flag
1673                            << "\"\n";
1674                 }
1675         case RC_PRINTLANDSCAPEFLAG:
1676                 if (ignore_system_lyxrc ||
1677                     print_landscape_flag != system_lyxrc.print_landscape_flag) {
1678                         os << "\\print_landscape_flag \"" << print_landscape_flag
1679                            << "\"\n";
1680                 }
1681         case RC_PRINTPAGERANGEFLAG:
1682                 if (ignore_system_lyxrc ||
1683                     print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1684                         os << "\\print_pagerange_flag \"" << print_pagerange_flag
1685                            << "\"\n";
1686                 }
1687         case RC_PRINTCOPIESFLAG:
1688                 if (ignore_system_lyxrc ||
1689                     print_copies_flag != system_lyxrc.print_copies_flag) {
1690                         os << "\\print_copies_flag \"" << print_copies_flag
1691                            << "\"\n";
1692                 }
1693         case RC_PRINTCOLLCOPIESFLAG:
1694                 if (ignore_system_lyxrc ||
1695                     print_collcopies_flag
1696                     != system_lyxrc.print_collcopies_flag) {
1697                         os << "\\print_collcopies_flag \""
1698                            << print_collcopies_flag
1699                            << "\"\n";
1700                 }
1701         case RC_PRINTPAPERFLAG:
1702                 if (ignore_system_lyxrc ||
1703                     print_paper_flag != system_lyxrc.print_paper_flag) {
1704                         os << "\\print_paper_flag \"" << print_paper_flag
1705                            << "\"\n";
1706                 }
1707         case RC_PRINTPAPERDIMENSIONFLAG:
1708                 if (ignore_system_lyxrc ||
1709                     print_paper_dimension_flag
1710                     != system_lyxrc.print_paper_dimension_flag) {
1711                         os << "\\print_paper_dimension_flag \""
1712                            << print_paper_dimension_flag << "\"\n";
1713                 }
1714         case RC_PRINTTOPRINTER:
1715                 if (ignore_system_lyxrc ||
1716                     print_to_printer != system_lyxrc.print_to_printer) {
1717                         os << "\\print_to_printer \"" << print_to_printer
1718                            << "\"\n";
1719                 }
1720         case RC_PRINTTOFILE:
1721                 if (ignore_system_lyxrc ||
1722                     print_to_file != system_lyxrc.print_to_file) {
1723                         string const path = os::external_path(print_to_file);
1724                         os << "\\print_to_file \"" << path << "\"\n";
1725                 }
1726         case RC_PRINTFILEEXTENSION:
1727                 if (ignore_system_lyxrc ||
1728                     print_file_extension != system_lyxrc.print_file_extension) {
1729                         os << "\\print_file_extension \""
1730                            << print_file_extension
1731                            << "\"\n";
1732                 }
1733
1734                 os << "\n#\n"
1735                    << "# EXPORT SECTION ####################################\n"
1736                    << "#\n\n";
1737
1738         case RC_CUSTOM_EXPORT_COMMAND:
1739                 if (ignore_system_lyxrc ||
1740                     custom_export_command
1741                     != system_lyxrc.custom_export_command) {
1742                         os << "\\custom_export_command \""
1743                            << custom_export_command
1744                            << "\"\n";
1745                 }
1746         case RC_CUSTOM_EXPORT_FORMAT:
1747                 if (ignore_system_lyxrc ||
1748                     custom_export_format
1749                     != system_lyxrc.custom_export_format) {
1750                         os << "\\custom_export_format \"" << custom_export_format
1751                            << "\"\n";
1752                 }
1753
1754                 os << "\n#\n"
1755                    << "# TEX SECTION #######################################\n"
1756                    << "#\n\n";
1757
1758         case RC_FONT_ENCODING:
1759                 if (ignore_system_lyxrc ||
1760                     fontenc != system_lyxrc.fontenc) {
1761                         os << "\\font_encoding \"" << fontenc << "\"\n";
1762                 }
1763
1764                 os << "\n#\n"
1765                    << "# FILE SECTION ######################################\n"
1766                    << "#\n\n";
1767
1768         case RC_DOCUMENTPATH:
1769                 if (ignore_system_lyxrc ||
1770                     document_path != system_lyxrc.document_path) {
1771                         string const path = os::external_path(document_path);
1772                         os << "\\document_path \"" << path << "\"\n";
1773                 }
1774         case RC_USELASTFILEPOS:
1775                 if (ignore_system_lyxrc ||
1776                     use_lastfilepos != system_lyxrc.use_lastfilepos) {
1777                         os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1778                            << '\n';
1779                 }
1780         case RC_LOADSESSION:
1781                 if (ignore_system_lyxrc ||
1782                     load_session != system_lyxrc.load_session) {
1783                         os << "\\load_session " << convert<string>(load_session)
1784                            << "\n";
1785                 }
1786         case RC_NUMLASTFILES:
1787                 if (ignore_system_lyxrc ||
1788                     num_lastfiles != system_lyxrc.num_lastfiles) {
1789                         os << "\\num_lastfiles " << num_lastfiles << '\n';
1790                 }
1791         case RC_CHECKLASTFILES:
1792                 if (ignore_system_lyxrc ||
1793                     check_lastfiles != system_lyxrc.check_lastfiles) {
1794                         os << "\\check_lastfiles " << convert<string>(check_lastfiles)
1795                            << '\n';
1796                 }
1797         case RC_TEMPLATEPATH:
1798                 if (ignore_system_lyxrc ||
1799                     template_path != system_lyxrc.template_path) {
1800                         string const path = os::external_path(template_path);
1801                         os << "\\template_path \"" << path << "\"\n";
1802                 }
1803         case RC_TEMPDIRPATH:
1804                 if (ignore_system_lyxrc ||
1805                     tempdir_path != system_lyxrc.tempdir_path) {
1806                         string const path = os::external_path(tempdir_path);
1807                         os << "\\tempdir_path \"" << path << "\"\n";
1808                 }
1809         case RC_USETEMPDIR:
1810                 // Ignore it
1811         case RC_PLAINTEXT_LINELEN:
1812                 if (ignore_system_lyxrc ||
1813                     plaintext_linelen != system_lyxrc.plaintext_linelen) {
1814                         os << "\\plaintext_linelen " << plaintext_linelen << '\n';
1815                 }
1816         case RC_MAKE_BACKUP:
1817                 if (ignore_system_lyxrc ||
1818                     make_backup != system_lyxrc.make_backup) {
1819                         os << "\\make_backup " << convert<string>(make_backup) << '\n';
1820                 }
1821         case RC_BACKUPDIR_PATH:
1822                 if (ignore_system_lyxrc ||
1823                     backupdir_path != system_lyxrc.backupdir_path) {
1824                         string const path = os::external_path(backupdir_path);
1825                         os << "\\backupdir_path \"" << path << "\"\n";
1826                 }
1827
1828                 os << "\n#\n"
1829                    << "# PLAIN TEXT EXPORT SECTION ##############################\n"
1830                    << "#\n\n";
1831
1832         case RC_PLAINTEXT_ROFF_COMMAND:
1833                 if (ignore_system_lyxrc ||
1834                     plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
1835                         os << "\\plaintext_roff_command \"" << plaintext_roff_command
1836                            << "\"\n";
1837                 }
1838
1839                 os << "\n#\n"
1840                    << "# SPELLCHECKER SECTION ##############################\n"
1841                    << "#\n\n";
1842         case RC_USE_SPELL_LIB:
1843                 if (ignore_system_lyxrc ||
1844                     use_spell_lib != system_lyxrc.use_spell_lib) {
1845                         os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
1846                 }
1847         case RC_SPELL_COMMAND:
1848                 if (ignore_system_lyxrc ||
1849                     isp_command != system_lyxrc.isp_command) {
1850                         os << "\\spell_command \"" << isp_command << "\"\n";
1851                 }
1852         case RC_ACCEPT_COMPOUND:
1853                 if (ignore_system_lyxrc ||
1854                     isp_accept_compound != system_lyxrc.isp_accept_compound) {
1855                         os << "\\accept_compound " << convert<string>(isp_accept_compound)
1856                            << '\n';
1857                 }
1858         case RC_USE_ALT_LANG:
1859                 if (ignore_system_lyxrc ||
1860                     isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
1861                         os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
1862                            << '\n';
1863                 }
1864         case RC_ALT_LANG:
1865                 if (ignore_system_lyxrc ||
1866                     isp_alt_lang != system_lyxrc.isp_alt_lang) {
1867                         os << "\\alternate_language \"" << isp_alt_lang
1868                            << "\"\n";
1869                 }
1870         case RC_USE_ESC_CHARS:
1871                 if (ignore_system_lyxrc ||
1872                     isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
1873                         os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
1874                            << '\n';
1875                 }
1876         case RC_ESC_CHARS:
1877                 if (ignore_system_lyxrc ||
1878                     isp_esc_chars != system_lyxrc.isp_esc_chars) {
1879                         os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
1880                 }
1881         case RC_USE_PERS_DICT:
1882                 if (ignore_system_lyxrc ||
1883                     isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
1884                         os << "\\use_personal_dictionary "
1885                            << convert<string>(isp_use_pers_dict)
1886                            << '\n';
1887                 }
1888         case RC_PERS_DICT:
1889                 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
1890                         string const path = os::external_path(isp_pers_dict);
1891                         os << "\\personal_dictionary \"" << path << "\"\n";
1892                 }
1893         case RC_USE_INP_ENC:
1894                 if (ignore_system_lyxrc ||
1895                     isp_use_input_encoding
1896                     != system_lyxrc.isp_use_input_encoding) {
1897                         os << "\\use_input_encoding "
1898                            << convert<string>(isp_use_input_encoding)
1899                            << '\n';
1900                 }
1901
1902                 os << "\n#\n"
1903                    << "# LANGUAGE SUPPORT SECTION ##########################\n"
1904                    << "#\n\n";
1905
1906         case RC_RTL_SUPPORT:
1907                 if (ignore_system_lyxrc ||
1908                     rtl_support != system_lyxrc.rtl_support) {
1909                         os << "\\rtl " << convert<string>(rtl_support) << '\n';
1910                 }
1911         case RC_LANGUAGE_PACKAGE:
1912                 if (ignore_system_lyxrc ||
1913                     language_package != system_lyxrc.language_package) {
1914                         os << "\\language_package \"" << language_package
1915                            << "\"\n";
1916                 }
1917         case RC_LANGUAGE_GLOBAL_OPTIONS:
1918                 if (ignore_system_lyxrc ||
1919                     language_global_options
1920                     != system_lyxrc.language_global_options) {
1921                         os << "\\language_global_options \""
1922                            << convert<string>(language_global_options)
1923                            << "\"\n";
1924                 }
1925         case RC_LANGUAGE_USE_BABEL:
1926                 if (ignore_system_lyxrc ||
1927                     language_use_babel != system_lyxrc.language_use_babel) {
1928                         os << "\\language_use_babel \""
1929                            << convert<string>(language_use_babel)
1930                            << "\"\n";
1931                 }
1932         case RC_LANGUAGE_COMMAND_BEGIN:
1933                 if (ignore_system_lyxrc ||
1934                     language_command_begin
1935                     != system_lyxrc.language_command_begin) {
1936                         os << "\\language_command_begin \""
1937                            << language_command_begin
1938                            << "\"\n";
1939                 }
1940         case RC_LANGUAGE_COMMAND_END:
1941                 if (ignore_system_lyxrc ||
1942                     language_command_end
1943                     != system_lyxrc.language_command_end) {
1944                         os << "\\language_command_end \"" << language_command_end
1945                            << "\"\n";
1946                 }
1947         case RC_LANGUAGE_COMMAND_LOCAL:
1948                 if (ignore_system_lyxrc ||
1949                     language_command_local
1950                     != system_lyxrc.language_command_local) {
1951                         os << "\\language_command_local \""
1952                            << language_command_local
1953                            << "\"\n";
1954                 }
1955         case RC_LANGUAGE_AUTO_BEGIN:
1956                 if (ignore_system_lyxrc ||
1957                     language_auto_begin != system_lyxrc.language_auto_begin) {
1958                         os << "\\language_auto_begin "
1959                            << convert<string>(language_auto_begin) << '\n';
1960                 }
1961         case RC_LANGUAGE_AUTO_END:
1962                 if (ignore_system_lyxrc ||
1963                     language_auto_end != system_lyxrc.language_auto_end) {
1964                         os << "\\language_auto_end "
1965                            << convert<string>(language_auto_end) << '\n';
1966                 }
1967         case RC_MARK_FOREIGN_LANGUAGE:
1968                 if (ignore_system_lyxrc ||
1969                     mark_foreign_language
1970                     != system_lyxrc.mark_foreign_language) {
1971                         os << "\\mark_foreign_language " <<
1972                                 convert<string>(mark_foreign_language) << '\n';
1973                 }
1974
1975                 os << "\n#\n"
1976                    << "# 2nd MISC SUPPORT SECTION ##########################\n"
1977                    << "#\n\n";
1978
1979         case RC_AUTO_NUMBER:
1980                 if (ignore_system_lyxrc ||
1981                     auto_number != system_lyxrc.auto_number) {
1982                         os << "\\auto_number " << convert<string>(auto_number) << '\n';
1983                 }
1984         case RC_DEFAULT_LANGUAGE:
1985                 if (ignore_system_lyxrc ||
1986                     default_language != system_lyxrc.default_language) {
1987                         os << "\\default_language " << default_language << '\n';
1988                 }
1989
1990                 os << "\n#\n"
1991                    << "# FORMATS SECTION ##########################\n"
1992                    << "#\n\n";
1993
1994         case RC_FORMAT:
1995                 // New/modified formats
1996                 for (Formats::const_iterator cit = formats.begin();
1997                      cit != formats.end(); ++cit) {
1998                         Format const * format =
1999                                 system_formats.getFormat(cit->name());
2000                         if (!format ||
2001                             format->extension() != cit->extension() ||
2002                             format->prettyname() != cit->prettyname() ||
2003                             format->shortcut() != cit->shortcut() ||
2004                             format->viewer() != cit->viewer() ||
2005                             format->editor() != cit->editor() ||
2006                             format->documentFormat() != cit->documentFormat() ||
2007                             format->vectorFormat() != cit->vectorFormat()) {
2008                                 os << "\\format \"" << cit->name() << "\" \""
2009                                    << cit->extension() << "\" \""
2010                                    << cit->prettyname() << "\" \""
2011                                    << cit->shortcut() << "\" \""
2012                                    << cit->viewer() << "\" \""
2013                                    << cit->editor() << "\" \"";
2014                                 std::vector<string> flags;
2015                                 if (cit->documentFormat())
2016                                         flags.push_back("document");
2017                                 if (cit->vectorFormat())
2018                                         flags.push_back("vector");
2019                                 os << support::getStringFromVector(flags);
2020                                 os << "\"\n";
2021                         }
2022                 }
2023
2024                 // Look for deleted formats
2025                 for (Formats::const_iterator cit = system_formats.begin();
2026                      cit != system_formats.end(); ++cit)
2027                         if (!formats.getFormat(cit->name()))
2028                                 os << "\\format \"" << cit->name()
2029                                    << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2030         case RC_VIEWER:
2031                 // Ignore it
2032
2033                 os << "\n#\n"
2034                    << "# CONVERTERS SECTION ##########################\n"
2035                    << "#\n\n";
2036
2037         case RC_CONVERTER:
2038                 // Look for new converters
2039                 for (Converters::const_iterator cit = theConverters().begin();
2040                      cit != theConverters().end(); ++cit) {
2041                         Converter const * converter =
2042                                 theSystemConverters().getConverter(cit->from,
2043                                                                cit->to);
2044                         if (!converter ||
2045                             converter->command != cit->command ||
2046                             converter->flags != cit->flags)
2047                                 os << "\\converter \"" << cit->from << "\" \""
2048                                    << cit->to << "\" \""
2049                                    << cit->command << "\" \""
2050                                    << cit->flags << "\"\n";
2051                 }
2052
2053                 // New/modifed converters
2054                 for (Converters::const_iterator cit = theSystemConverters().begin();
2055                      cit != theSystemConverters().end(); ++cit)
2056                         if (!theConverters().getConverter(cit->from, cit->to))
2057                                 os << "\\converter \"" << cit->from
2058                                    << "\" \"" << cit->to << "\" \"\" \"\"\n";
2059
2060         case RC_COPIER:
2061                 os << "\n#\n"
2062                    << "# COPIERS SECTION ##########################\n"
2063                    << "#\n\n";
2064
2065                 // Look for new movers
2066                 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2067                 Movers::const_iterator const sysend = theSystemMovers().end();
2068                 Movers::const_iterator it = theMovers().begin();
2069                 Movers::const_iterator end = theMovers().end();
2070
2071                 for (; it != end; ++it) {
2072                         Movers::const_iterator const sysit =
2073                                 std::find_if(sysbegin, sysend, SameMover(*it));
2074                         if (sysit == sysend) {
2075                                 std::string const & fmt = it->first;
2076                                 std::string const & command =
2077                                         it->second.command();
2078
2079                                 os << "\\copier " << fmt
2080                                    << " \"" << command << "\"\n";
2081                         }
2082                 }
2083
2084                 // We don't actually delete SpecialisedMover(s) from the
2085                 // map, just clear their 'command', so there's no need
2086                 // to test for anything else.
2087         }
2088
2089         os.flush();
2090 }
2091
2092 void LyXRC::set_font_norm_type()
2093 {
2094         if (font_norm == "iso10646-1")
2095                 font_norm_type = ISO_10646_1;
2096         else if (font_norm == "iso8859-1")
2097                 font_norm_type = ISO_8859_1;
2098         else if (font_norm == "iso8859-3")
2099                 font_norm_type = ISO_8859_3;
2100         else if (font_norm == "iso8859-4")
2101                 font_norm_type = ISO_8859_4;
2102         else if (font_norm == "iso8859-6.8x")
2103                 font_norm_type = ISO_8859_6_8;
2104         else if (font_norm == "iso8859-9")
2105                 font_norm_type = ISO_8859_9;
2106         else if (font_norm == "iso8859-15")
2107                 font_norm_type = ISO_8859_15;
2108         else
2109                 font_norm_type = OTHER_ENCODING;
2110 }
2111
2112
2113 #if 0
2114 string const LyXRC::getDescription(LyXRCTags tag)
2115 {
2116         docstring str;
2117
2118         switch (tag) {
2119         case RC_ACCEPT_COMPOUND:
2120                 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2121                 break;
2122
2123         case RC_ALT_LANG:
2124         case RC_USE_ALT_LANG:
2125                 str = _("Specify an alternate language. The default is to use the language of the document.");
2126                 break;
2127
2128         case RC_PLAINTEXT_ROFF_COMMAND:
2129                 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.");
2130                 break;
2131
2132         case RC_PLAINTEXT_LINELEN:
2133                 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.");
2134                 break;
2135
2136         case RC_AUTOREGIONDELETE:
2137                 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2138                 break;
2139
2140         case RC_AUTORESET_OPTIONS:
2141                 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2142                 break;
2143
2144         case RC_AUTOSAVE:
2145                 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2146                 break;
2147
2148         case RC_AUTO_NUMBER:
2149                 break;
2150
2151         case RC_BACKUPDIR_PATH:
2152                 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.");
2153                 break;
2154
2155         case RC_BIBTEX_COMMAND:
2156                 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2157                 break;
2158
2159         case RC_BINDFILE:
2160                 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2161                 break;
2162
2163         case RC_CHECKLASTFILES:
2164                 str = _("Select to check whether the lastfiles still exist.");
2165                 break;
2166
2167         case RC_CHKTEX_COMMAND:
2168                 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2169                 break;
2170
2171         case RC_CONVERTER:
2172                 break;
2173
2174         case RC_COPIER:
2175                 break;
2176
2177         case RC_CURSOR_FOLLOWS_SCROLLBAR:
2178                 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.");
2179                 break;
2180
2181         case RC_CUSTOM_EXPORT_COMMAND:
2182                 break;
2183
2184         case RC_CUSTOM_EXPORT_FORMAT:
2185                 break;
2186
2187         case RC_DATE_INSERT_FORMAT:
2188                 //xgettext:no-c-format
2189                 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2190                 break;
2191
2192         case RC_DEFAULT_LANGUAGE:
2193                 str = _("New documents will be assigned this language.");
2194                 break;
2195
2196         case RC_DEFAULT_PAPERSIZE:
2197                 str = _("Specify the default paper size.");
2198                 break;
2199
2200         case RC_DIALOGS_ICONIFY_WITH_MAIN:
2201                 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2202                 break;
2203
2204         case RC_DISPLAY_GRAPHICS:
2205                 str = _("Select how LyX will display any graphics.");
2206                 break;
2207
2208         case RC_DOCUMENTPATH:
2209                 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2210                 break;
2211
2212         case RC_ESC_CHARS:
2213         case RC_USE_ESC_CHARS:
2214                 str = _("Specify additional chars that can be part of a word.");
2215                 break;
2216
2217         case RC_FONT_ENCODING:
2218                 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2219                 break;
2220
2221         case RC_FORMAT:
2222                 break;
2223
2224         case RC_INDEX_COMMAND:
2225                 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\".");
2226                 break;
2227
2228         case RC_INPUT:
2229                 break;
2230
2231         case RC_KBMAP:
2232         case RC_KBMAP_PRIMARY:
2233         case RC_KBMAP_SECONDARY:
2234                 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.");
2235                 break;
2236
2237         case RC_LABEL_INIT_LENGTH:
2238                 str = _("Maximum number of words in the initialization string for a new label");
2239                 break;
2240
2241         case RC_LANGUAGE_AUTO_BEGIN:
2242                 str = _("Select if a language switching command is needed at the beginning of the document.");
2243                 break;
2244
2245         case RC_LANGUAGE_AUTO_END:
2246                 str = _("Select if a language switching command is needed at the end of the document.");
2247                 break;
2248
2249         case RC_LANGUAGE_COMMAND_BEGIN:
2250                 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.");
2251                 break;
2252
2253         case RC_LANGUAGE_COMMAND_END:
2254                 str = _("The LaTeX command for changing back to the language of the document.");
2255                 break;
2256
2257         case RC_LANGUAGE_COMMAND_LOCAL:
2258                 str = _("The LaTeX command for local changing of the language.");
2259                 break;
2260
2261         case RC_LANGUAGE_GLOBAL_OPTIONS:
2262                 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2263                 break;
2264
2265         case RC_LANGUAGE_PACKAGE:
2266                 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2267                 break;
2268
2269         case RC_LANGUAGE_USE_BABEL:
2270                 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2271                 break;
2272
2273         case RC_USELASTFILEPOS:
2274                 str = _("De-select if you do not want LyX to scroll to saved position.");
2275                 break;
2276
2277         case RC_LOADSESSION:
2278                 str = _("De-select to prevent loading files opened from the last lyx session.");
2279                 break;
2280
2281         case RC_MAKE_BACKUP:
2282                 str = _("De-select if you don't want LyX to create backup files.");
2283                 break;
2284
2285         case RC_MARK_FOREIGN_LANGUAGE:
2286                 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2287                 break;
2288
2289         case RC_NUMLASTFILES:
2290                 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2291                         maxlastfiles);
2292                 break;
2293
2294         case RC_PATH_PREFIX:
2295                 str = _("Specify those directories which should be "
2296                          "prepended to the PATH environment variable. "
2297                          "Use the OS native format.");
2298                 break;
2299
2300         case RC_PERS_DICT:
2301         case RC_USE_PERS_DICT:
2302                 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2303                 break;
2304
2305         case RC_PREVIEW:
2306                 str = _("Shows a typeset preview of things such as math");
2307                 break;
2308
2309         case RC_PREVIEW_HASHED_LABELS:
2310                 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2311                 break;
2312
2313         case RC_PREVIEW_SCALE_FACTOR:
2314                 str = _("Scale the preview size to suit.");
2315                 break;
2316
2317         case RC_PRINTCOLLCOPIESFLAG:
2318                 str = _("The option for specifying whether the copies should be collated.");
2319                 break;
2320
2321         case RC_PRINTCOPIESFLAG:
2322                 str = _("The option for specifying the number of copies to print.");
2323                 break;
2324
2325         case RC_PRINTER:
2326                 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2327                 break;
2328
2329         case RC_PRINTEVENPAGEFLAG:
2330                 str = _("The option to print only even pages.");
2331                 break;
2332
2333         case RC_PRINTEXSTRAOPTIONS:
2334                 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2335                 break;
2336
2337         case RC_PRINTFILEEXTENSION:
2338                 str = _("Extension of printer program output file. Usually \".ps\".");
2339                 break;
2340
2341         case RC_PRINTLANDSCAPEFLAG:
2342                 str = _("The option to print out in landscape.");
2343                 break;
2344
2345         case RC_PRINTODDPAGEFLAG:
2346                 str = _("The option to print only odd pages.");
2347                 break;
2348
2349         case RC_PRINTPAGERANGEFLAG:
2350                 str = _("The option for specifying a comma-separated list of pages to print.");
2351                 break;
2352
2353         case RC_PRINTPAPERDIMENSIONFLAG:
2354                                    str = _("Option to specify the dimensions of the print paper.");
2355                 break;
2356
2357         case RC_PRINTPAPERFLAG:
2358                 str = _("The option to specify paper type.");
2359                 break;
2360
2361         case RC_PRINTREVERSEFLAG:
2362                 str = _("The option to reverse the order of the pages printed.");
2363                 break;
2364
2365         case RC_PRINTSPOOL_COMMAND:
2366                 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.");
2367                 break;
2368
2369         case RC_PRINTSPOOL_PRINTERPREFIX:
2370                 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.");
2371                 break;
2372
2373         case RC_PRINTTOFILE:
2374                 str = _("Option to pass to the print program to print to a file.");
2375                 break;
2376
2377         case RC_PRINTTOPRINTER:
2378                 str = _("Option to pass to the print program to print on a specific printer.");
2379                 break;
2380
2381         case RC_PRINT_ADAPTOUTPUT:
2382                 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2383                 break;
2384
2385         case RC_PRINT_COMMAND:
2386                 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2387                 break;
2388
2389         case RC_RTL_SUPPORT:
2390                 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2391                 break;
2392
2393         case RC_SCREEN_DPI:
2394                 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2395                 break;
2396
2397         case RC_SCREEN_FONT_ENCODING:
2398                 str = _("The encoding for the screen fonts.");
2399                 break;
2400
2401         case RC_SCREEN_FONT_ROMAN:
2402         case RC_SCREEN_FONT_SANS:
2403         case RC_SCREEN_FONT_TYPEWRITER:
2404                 str = _("The screen fonts used to display the text while editing.");
2405                 break;
2406
2407         case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2408         case RC_SCREEN_FONT_SANS_FOUNDRY:
2409         case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2410                 break;
2411
2412         case RC_SCREEN_FONT_SCALABLE:
2413                 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.");
2414                 break;
2415
2416         case RC_SCREEN_FONT_SIZES:
2417                 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2418                 break;
2419
2420         case RC_SCREEN_ZOOM:
2421                 //xgettext:no-c-format
2422                 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2423                 break;
2424
2425         case RC_SCREEN_GEOMETRY_HEIGHT:
2426         case RC_SCREEN_GEOMETRY_WIDTH:
2427                 str = _("Specify geometry of the main view in width x height (values from last session will not be used if non-zero values are specified).");
2428                 break;
2429
2430         case RC_SCREEN_GEOMETRY_XYSAVED:
2431                 str = _("Allow session manager to save and restore windows position.");
2432                 break;
2433
2434         case RC_SERVERPIPE:
2435                 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2436                 break;
2437
2438         case RC_SET_COLOR:
2439                 break;
2440
2441         case RC_SHOW_BANNER:
2442                 str = _("De-select if you don't want the startup banner.");
2443                 break;
2444
2445         case RC_SPELL_COMMAND:
2446                 str = _("What command runs the spellchecker?");
2447                 break;
2448
2449         case RC_TEMPDIRPATH:
2450                 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2451                 break;
2452
2453         case RC_TEMPLATEPATH:
2454                 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2455                 break;
2456
2457         case RC_TEX_ALLOWS_SPACES:
2458                 break;
2459
2460         case RC_TEX_EXPECTS_WINDOWS_PATHS:
2461                 break;
2462
2463         case RC_UIFILE:
2464                 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2465                 break;
2466
2467         case RC_USER_EMAIL:
2468                 break;
2469
2470         case RC_USER_NAME:
2471                 break;
2472
2473         case RC_USETEMPDIR:
2474                 break;
2475
2476         case RC_USE_INP_ENC:
2477                 str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2478                 break;
2479
2480         case RC_USE_SPELL_LIB:
2481                 break;
2482
2483         case RC_VIEWDVI_PAPEROPTION:
2484                 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2485                 break;
2486
2487         case RC_VIEWER:
2488                 break;
2489
2490         case RC_LAST:
2491                 break;
2492         }
2493
2494         return str;
2495 }
2496 #endif
2497
2498
2499 // The global instance
2500 LyXRC lyxrc;
2501
2502 // The global copy of the system lyxrc entries (everything except preferences)
2503 LyXRC system_lyxrc;
2504
2505
2506 } // namespace lyx