3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/filetools.h"
36 #include "support/gettext.h"
37 #include "support/lstrings.h"
38 #include "support/os.h"
39 #include "support/userinfo.h"
45 using namespace lyx::support;
49 namespace os = support::os;
53 // when adding something to this array keep it sorted!
54 LexerKeyword lyxrcTags[] = {
55 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
56 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
57 { "\\alternate_language", LyXRC::RC_ALT_LANG },
58 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
59 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
60 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
61 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
62 { "\\autosave", LyXRC::RC_AUTOSAVE },
63 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
64 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
65 { "\\bind_file", LyXRC::RC_BINDFILE },
66 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
67 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
68 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
69 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
70 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
71 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
72 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
73 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
74 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
75 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
76 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
77 { "\\converter", LyXRC::RC_CONVERTER },
78 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
79 { "\\copier", LyXRC::RC_COPIER },
80 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
81 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
82 { "\\def_file", LyXRC::RC_DEFFILE },
83 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
84 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
85 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
86 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
87 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
88 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
89 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
90 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
91 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
92 { "\\format", LyXRC::RC_FORMAT },
93 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
94 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
95 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
96 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
97 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
98 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
99 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
100 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
101 { "\\input", LyXRC::RC_INPUT },
102 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
103 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
104 { "\\kbmap", LyXRC::RC_KBMAP },
105 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
106 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
107 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
108 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
109 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
110 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
111 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
112 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
113 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
114 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
115 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
116 { "\\load_session", LyXRC::RC_LOADSESSION },
117 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
118 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
119 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
120 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
121 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
122 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
123 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
124 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
125 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
126 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
127 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
128 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
129 { "\\preview", LyXRC::RC_PREVIEW },
130 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
131 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
132 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
133 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
134 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
135 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
136 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
137 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
138 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
139 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
140 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
141 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
142 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
143 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
144 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
145 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
146 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
147 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
148 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
149 { "\\printer", LyXRC::RC_PRINTER },
150 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
151 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
152 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
153 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
154 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
155 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
156 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
157 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
158 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
159 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
160 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
161 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
162 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
163 { "\\set_color", LyXRC::RC_SET_COLOR },
164 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
165 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
166 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
167 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
168 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
169 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
170 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
171 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
172 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
173 { "\\ui_file", LyXRC::RC_UIFILE },
174 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
175 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
176 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
177 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
178 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
179 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
180 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
181 // compatibility with versions older than 1.4.0 only
182 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
183 // compatibility with versions older than 1.4.0 only
184 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
185 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
186 { "\\user_email", LyXRC::RC_USER_EMAIL },
187 { "\\user_name", LyXRC::RC_USER_NAME },
188 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
189 // compatibility with versions older than 1.4.0 only
190 { "\\viewer", LyXRC::RC_VIEWER},
191 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
194 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
205 void LyXRC::setDefaults()
208 def_file = "default";
210 // Get printer from the environment. If fail, use default "",
211 // assuming that everything is set up correctly.
212 printer = getEnv("PRINTER");
213 print_adapt_output = false;
214 print_command = "dvips";
215 print_evenpage_flag = "-B";
216 print_oddpage_flag = "-A";
217 print_pagerange_flag = "-pp";
218 print_copies_flag = "-c";
219 print_collcopies_flag = "-C";
220 print_reverse_flag = "-r";
221 print_landscape_flag = "-t landscape";
222 print_to_printer = "-P";
223 print_to_file = "-o ";
224 print_file_extension = ".ps";
225 print_paper_flag = "-t";
226 print_paper_dimension_flag = "-T";
227 document_path.erase();
228 view_dvi_paper_option.erase();
229 default_papersize = PAPER_DEFAULT;
230 default_view_format = "pdf2";
231 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
232 bibtex_command = "bibtex";
234 index_command = "makeindex -c -q";
235 nomencl_command = "makeindex -s nomencl.ist";
237 // Because a screen typically is wider than a piece of paper:
239 allow_geometry_session = true;
240 // Default LaTeX font size:
241 font_sizes[FONT_SIZE_TINY] = "5.0";
242 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
243 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
244 font_sizes[FONT_SIZE_SMALL] = "9.0";
245 font_sizes[FONT_SIZE_NORMAL] = "10.0";
246 font_sizes[FONT_SIZE_LARGE] = "12.0";
247 font_sizes[FONT_SIZE_LARGER] = "14.4";
248 font_sizes[FONT_SIZE_LARGEST] = "17.26";
249 font_sizes[FONT_SIZE_HUGE] = "20.74";
250 font_sizes[FONT_SIZE_HUGER] = "24.88";
251 use_scalable_fonts = true;
252 roman_font_name = "";
254 typewriter_font_name = "";
256 auto_region_delete = true;
257 auto_reset_options = false;
258 plaintext_linelen = 65;
259 mouse_wheel_speed = 1.0;
260 num_lastfiles = maxlastfiles;
261 check_lastfiles = true;
262 use_lastfilepos = true;
263 load_session = false;
265 backupdir_path.erase();
266 display_graphics = true;
267 // Spellchecker settings:
268 spellchecker_accept_compound = false;
269 spellchecker_use_input_encoding = false;
270 spellchecker_use_alt_lang = false;
271 spellchecker_use_pers_dict = false;
272 spellchecker_use_esc_chars = false;
273 spellcheck_continuously = false;
276 visual_cursor = false;
278 mark_foreign_language = true;
279 language_auto_begin = true;
280 language_auto_end = true;
281 language_global_options = true;
282 language_use_babel = true;
283 language_package = "\\usepackage{babel}";
284 language_command_begin = "\\selectlanguage{$$lang}";
285 language_command_local = "\\foreignlanguage{$$lang}{";
286 sort_layouts = false;
287 group_layouts = true;
288 default_language = "english";
289 gui_language = "auto";
291 windows_style_tex_paths = false;
292 tex_allows_spaces = false;
293 date_insert_format = "%x";
294 cursor_follows_scrollbar = false;
295 scroll_below_document = false;
296 mac_like_word_movement = false;
297 macro_edit_style = MACRO_EDIT_INLINE_BOX;
298 dialogs_iconify_with_main = false;
299 label_init_length = 3;
300 preview = PREVIEW_OFF;
301 preview_hashed_labels = false;
302 preview_scale_factor = "0.9";
303 use_converter_cache = true;
305 use_pixmap_cache = false;
306 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
307 user_name = to_utf8(support::user_name());
308 user_email = to_utf8(support::user_email());
309 open_buffers_in_tabs = true;
311 // Fullscreen settings
312 full_screen_limit = false;
313 full_screen_toolbars = true;
314 full_screen_tabbar = true;
315 full_screen_scrollbar = true;
316 full_screen_width = 700;
318 completion_cursor_text = true;
319 completion_popup_math = true;
320 completion_popup_text = false;
321 completion_popup_delay = 2.0;
322 completion_popup_after_complete = true;
323 autocorrection_math = false;
324 completion_inline_math = true;
325 completion_inline_text = false;
326 completion_inline_dots = -1;
327 completion_inline_delay = 0.2;
333 void oldFontFormat(string & family, string & foundry)
335 if (family.empty() || family[0] != '-')
337 foundry = token(family, '-', 1);
338 family = token(family, '-', 2);
346 int LyXRC::read(FileName const & filename)
348 Lexer lexrc(lyxrcTags);
349 if (lyxerr.debugging(Debug::PARSER))
350 lexrc.printTable(lyxerr);
352 lexrc.setFile(filename);
356 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
362 int LyXRC::read(istream & is)
364 Lexer lexrc(lyxrcTags);
365 if (lyxerr.debugging(Debug::PARSER))
366 lexrc.printTable(lyxerr);
372 LYXERR(Debug::LYXRC, "Reading istream...");
378 int LyXRC::read(Lexer & lexrc)
383 while (lexrc.isOK()) {
384 // By using two switches we take advantage of the compiler
385 // telling us if we have missed a LyXRCTags element in
386 // the second switch.
387 // Note that this also shows a problem with Lexer since it
388 // helps us avoid taking advantage of the strictness of the
391 int le = lexrc.lex();
393 case Lexer::LEX_UNDEF:
394 lexrc.printError("Unknown tag `$$Token'");
396 case Lexer::LEX_FEOF:
401 switch (static_cast<LyXRCTags>(le)) {
402 case RC_INPUT: // Include file
405 libFileSearch(string(),
408 lexrc.printError("Error reading "
409 "included file: " + tmp.absFilename());
415 bind_file = os::internal_path(lexrc.getString());
420 def_file = os::internal_path(lexrc.getString());
425 ui_file = os::internal_path(lexrc.getString());
428 case RC_AUTORESET_OPTIONS:
429 lexrc >> auto_reset_options;
432 case RC_DISPLAY_GRAPHICS:
434 display_graphics = lexrc.getString() == "true";
437 case RC_TEX_EXPECTS_WINDOWS_PATHS:
438 lexrc >> windows_style_tex_paths;
441 case RC_TEX_ALLOWS_SPACES:
442 lexrc >> tex_allows_spaces;
449 case RC_KBMAP_PRIMARY:
451 string const kmap(os::internal_path(lexrc.getString()));
454 } else if (!libFileSearch("kbd", kmap,
456 primary_kbmap = kmap;
458 lexrc.printError("LyX: Keymap `$$Token' not found");
463 case RC_KBMAP_SECONDARY:
465 string const kmap(os::internal_path(lexrc.getString()));
468 } else if (!libFileSearch("kbd", kmap,
470 secondary_kbmap = kmap;
472 lexrc.printError("LyX: Keymap `$$Token' not found");
477 case RC_FONT_ENCODING:
485 case RC_PRINT_COMMAND:
486 if (lexrc.next(true)) {
487 print_command = lexrc.getString();
491 case RC_PRINTEVENPAGEFLAG:
492 lexrc >> print_evenpage_flag;
495 case RC_PRINTODDPAGEFLAG:
496 lexrc >> print_oddpage_flag;
499 case RC_PRINTPAGERANGEFLAG:
500 lexrc >> print_pagerange_flag;
503 case RC_PRINTCOPIESFLAG:
504 lexrc >> print_copies_flag;
507 case RC_PRINTCOLLCOPIESFLAG:
508 lexrc >> print_collcopies_flag;
511 case RC_PRINTREVERSEFLAG:
512 lexrc >> print_reverse_flag;
515 case RC_PRINTLANDSCAPEFLAG:
516 lexrc >> print_landscape_flag;
519 case RC_PRINTTOPRINTER:
520 lexrc >> print_to_printer;
523 case RC_PRINT_ADAPTOUTPUT:
524 lexrc >> print_adapt_output;
529 print_to_file = os::internal_path(lexrc.getString());
533 case RC_PRINTFILEEXTENSION:
534 lexrc >> print_file_extension;
537 case RC_PRINTEXSTRAOPTIONS:
538 lexrc >> print_extra_options;
541 case RC_PRINTSPOOL_COMMAND:
542 if (lexrc.next(true)) {
543 print_spool_command = lexrc.getString();
547 case RC_PRINTSPOOL_PRINTERPREFIX:
548 lexrc >> print_spool_printerprefix;
551 case RC_PRINTPAPERDIMENSIONFLAG:
552 lexrc >> print_paper_dimension_flag;
555 case RC_PRINTPAPERFLAG:
556 lexrc >> print_paper_flag;
559 case RC_DEFAULT_PAPERSIZE:
561 string const size = ascii_lowercase(lexrc.getString());
562 if (size == "usletter")
563 default_papersize = PAPER_USLETTER;
564 else if (size == "legal")
565 default_papersize = PAPER_USLEGAL;
566 else if (size == "executive")
567 default_papersize = PAPER_USEXECUTIVE;
568 else if (size == "a3")
569 default_papersize = PAPER_A3;
570 else if (size == "a4")
571 default_papersize = PAPER_A4;
572 else if (size == "a5")
573 default_papersize = PAPER_A5;
574 else if (size == "b5")
575 default_papersize = PAPER_B5;
576 else if (size == "default")
577 default_papersize = PAPER_DEFAULT;
581 case RC_VIEWDVI_PAPEROPTION:
583 view_dvi_paper_option = lexrc.getString();
585 view_dvi_paper_option.erase();
588 case RC_CHKTEX_COMMAND:
589 if (lexrc.next(true)) {
590 chktex_command = lexrc.getString();
594 case RC_BIBTEX_COMMAND:
595 if (lexrc.next(true)) {
596 bibtex_command = lexrc.getString();
600 case RC_JBIBTEX_COMMAND:
601 if (lexrc.next(true)) {
602 jbibtex_command = lexrc.getString();
606 case RC_INDEX_COMMAND:
607 if (lexrc.next(true)) {
608 index_command = lexrc.getString();
612 case RC_JINDEX_COMMAND:
613 if (lexrc.next(true)) {
614 jindex_command = lexrc.getString();
618 case RC_NOMENCL_COMMAND:
619 if (lexrc.next(true)) {
620 nomencl_command = lexrc.getString();
632 case RC_GEOMETRY_SESSION:
633 lexrc >> allow_geometry_session;
636 case RC_SCREEN_FONT_SIZES:
637 lexrc >> font_sizes[FONT_SIZE_TINY];
638 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
639 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
640 lexrc >> font_sizes[FONT_SIZE_SMALL];
641 lexrc >> font_sizes[FONT_SIZE_NORMAL];
642 lexrc >> font_sizes[FONT_SIZE_LARGE];
643 lexrc >> font_sizes[FONT_SIZE_LARGER];
644 lexrc >> font_sizes[FONT_SIZE_LARGEST];
645 lexrc >> font_sizes[FONT_SIZE_HUGE];
646 lexrc >> font_sizes[FONT_SIZE_HUGER];
649 case RC_SCREEN_FONT_SCALABLE:
650 lexrc >> use_scalable_fonts;
657 case RC_DOCUMENTPATH:
659 document_path = os::internal_path(lexrc.getString());
660 document_path = expandPath(document_path);
666 example_path = os::internal_path(lexrc.getString());
667 example_path = expandPath(example_path);
671 case RC_TEMPLATEPATH:
673 template_path = os::internal_path(lexrc.getString());
674 template_path = expandPath(template_path);
680 tempdir_path = os::internal_path(lexrc.getString());
681 tempdir_path = expandPath(tempdir_path);
685 case RC_THESAURUSDIRPATH:
687 thesaurusdir_path = os::internal_path(lexrc.getString());
688 thesaurusdir_path = expandPath(thesaurusdir_path);
694 LYXERR0("Ignoring obsolete use_tempdir flag.");
697 case RC_USELASTFILEPOS:
698 lexrc >> use_lastfilepos;
702 lexrc >> load_session;
705 case RC_MOUSE_WHEEL_SPEED:
706 lexrc >> mouse_wheel_speed;
709 case RC_COMPLETION_INLINE_DELAY:
710 lexrc >> completion_inline_delay;
713 case RC_COMPLETION_INLINE_MATH:
714 lexrc >> completion_inline_math;
717 case RC_COMPLETION_INLINE_TEXT:
718 lexrc >> completion_inline_text;
721 case RC_COMPLETION_INLINE_DOTS:
722 lexrc >> completion_inline_dots;
725 case RC_AUTOCORRECTION_MATH:
726 lexrc >> autocorrection_math;
729 case RC_COMPLETION_POPUP_DELAY:
730 lexrc >> completion_popup_delay;
733 case RC_COMPLETION_POPUP_MATH:
734 lexrc >> completion_popup_math;
737 case RC_COMPLETION_POPUP_TEXT:
738 lexrc >> completion_popup_text;
741 case RC_COMPLETION_CURSOR_TEXT:
742 lexrc >> completion_cursor_text;
745 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
746 lexrc >> completion_popup_after_complete;
749 case RC_NUMLASTFILES:
750 lexrc >> num_lastfiles;
753 case RC_CHECKLASTFILES:
754 lexrc >> check_lastfiles;
757 case RC_SCREEN_FONT_ROMAN:
759 roman_font_name = lexrc.getString();
760 oldFontFormat(roman_font_name,
765 case RC_SCREEN_FONT_SANS:
767 sans_font_name = lexrc.getString();
768 oldFontFormat(sans_font_name, sans_font_foundry);
772 case RC_SCREEN_FONT_TYPEWRITER:
774 typewriter_font_name = lexrc.getString();
775 oldFontFormat(typewriter_font_name,
776 typewriter_font_foundry);
780 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
781 lexrc >> roman_font_foundry;
784 case RC_SCREEN_FONT_SANS_FOUNDRY:
785 lexrc >> sans_font_foundry;
788 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
789 lexrc >> typewriter_font_foundry;
794 lexrc.printError("Missing color tag.");
797 string lyx_name = lexrc.getString();
800 lexrc.printError("Missing color name for color: `$$Token'");
803 string x11_name = lexrc.getString();
805 ColorCode const col =
806 lcolor.getFromLyXName(lyx_name);
807 if (col == Color_none ||
808 col == Color_inherit ||
812 if (!lcolor.setColor(col, x11_name))
813 LYXERR0("Bad lyxrc set_color for " << lyx_name);
817 case RC_AUTOREGIONDELETE:
818 // Auto region delete defaults to true
819 lexrc >> auto_region_delete;
824 lyxpipes = os::internal_path(lexrc.getString());
825 lyxpipes = expandPath(lyxpipes);
829 case RC_CURSOR_FOLLOWS_SCROLLBAR:
830 lexrc >> cursor_follows_scrollbar;
833 case RC_SCROLL_BELOW_DOCUMENT:
834 lexrc >> scroll_below_document;
837 case RC_MAC_LIKE_WORD_MOVEMENT:
838 lexrc >> mac_like_word_movement;
841 case RC_MACRO_EDIT_STYLE:
843 switch (lexrc.getInteger()) {
844 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
845 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
846 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
851 case RC_DIALOGS_ICONIFY_WITH_MAIN:
852 lexrc >> dialogs_iconify_with_main;
855 case RC_PLAINTEXT_ROFF_COMMAND:
856 (void) lexrc.getString(); // Obsoleted in 2.0
858 case RC_PLAINTEXT_LINELEN:
859 lexrc >> plaintext_linelen;
861 // Spellchecker settings:
862 case RC_ACCEPT_COMPOUND:
863 lexrc >> spellchecker_accept_compound;
866 lexrc >> spellchecker_use_input_encoding;
868 case RC_USE_ALT_LANG:
869 lexrc >> spellchecker_use_alt_lang;
871 case RC_USE_PERS_DICT:
872 lexrc >> spellchecker_use_pers_dict;
875 lexrc >> use_tooltip;
877 case RC_USE_PIXMAP_CACHE:
878 lexrc >> use_pixmap_cache;
880 case RC_USE_ESC_CHARS:
881 lexrc >> spellchecker_use_esc_chars;
884 lexrc >> spellchecker_alt_lang;
888 spellchecker_pers_dict = os::internal_path(lexrc.getString());
891 lexrc >> spellchecker_esc_chars;
893 case RC_SPELLCHECK_CONTINUOUSLY:
894 lexrc >> spellcheck_continuously;
897 lexrc >> make_backup;
899 case RC_BACKUPDIR_PATH:
901 backupdir_path = os::internal_path(lexrc.getString());
902 backupdir_path = expandPath(backupdir_path);
905 case RC_DATE_INSERT_FORMAT:
906 lexrc >> date_insert_format;
908 case RC_LANGUAGE_PACKAGE:
909 lexrc >> language_package;
911 case RC_LANGUAGE_AUTO_BEGIN:
912 lexrc >> language_auto_begin;
914 case RC_LANGUAGE_AUTO_END:
915 lexrc >> language_auto_end;
917 case RC_LANGUAGE_GLOBAL_OPTIONS:
918 lexrc >> language_global_options;
920 case RC_LANGUAGE_USE_BABEL:
921 lexrc >> language_use_babel;
923 case RC_LANGUAGE_COMMAND_BEGIN:
924 lexrc >> language_command_begin;
926 case RC_LANGUAGE_COMMAND_END:
927 lexrc >> language_command_end;
929 case RC_LANGUAGE_COMMAND_LOCAL:
930 lexrc >> language_command_local;
933 lexrc >> rtl_support;
935 case RC_VISUAL_CURSOR:
936 lexrc >> visual_cursor;
939 lexrc >> auto_number;
941 case RC_MARK_FOREIGN_LANGUAGE:
942 lexrc >> mark_foreign_language;
948 fmt = lexrc.getString();
949 if (lexrc.next(true))
950 command = lexrc.getString();
951 setMover(fmt, command);
956 string from, to, command, flags;
958 from = lexrc.getString();
960 to = lexrc.getString();
961 if (lexrc.next(true))
962 command = lexrc.getString();
964 flags = lexrc.getString();
966 theConverters().erase(from, to);
968 theConverters().add(from, to, command, flags);
971 // compatibility with versions older than 1.4.0 only
973 string format, command;
974 lexrc >> format >> command;
975 formats.setViewer(format, command);
979 string format, extension, prettyname, shortcut;
980 lexrc >> format >> extension >> prettyname >> shortcut;
981 string viewer, editor;
982 if (lexrc.next(true))
983 viewer = lexrc.getString();
984 if (lexrc.next(true))
985 editor = lexrc.getString();
987 // Hack to ensure compatibility with versions older
989 int le = lexrc.lex();
990 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
991 flags = lexrc.getString();
992 if (le != Lexer::LEX_DATA) {
993 // We have got a known token.
994 // Therefore this is an old style
995 // format definition without
997 lexrc.pushToken(flags);
1001 int flgs = Format::none;
1002 while (!flags.empty()) {
1004 flags = split(flags, flag, ',');
1005 if (flag == "document")
1006 flgs |= Format::document;
1007 else if (flag == "vector")
1008 flgs |= Format::vector;
1010 LYXERR0("Ignoring unknown flag `"
1011 << flag << "' for format `"
1014 if (prettyname.empty()) {
1015 if (theConverters().formatIsUsed(format))
1016 LYXERR0("Can't delete format " << format);
1018 formats.erase(format);
1020 formats.add(format, extension, prettyname,
1021 shortcut, viewer, editor, flgs);
1025 case RC_DEFAULT_VIEW_FORMAT:
1026 lexrc >> default_view_format;
1029 case RC_DEFAULT_LANGUAGE:
1030 lexrc >> default_language;
1033 case RC_GUI_LANGUAGE:
1034 lexrc >> gui_language;
1037 case RC_LABEL_INIT_LENGTH:
1038 lexrc >> label_init_length;
1041 case RC_SHOW_BANNER:
1042 lexrc >> show_banner;
1047 string const tmp = lexrc.getString();
1048 if (tmp == "true" || tmp == "on")
1049 preview = PREVIEW_ON;
1050 else if (tmp == "no_math")
1051 preview = PREVIEW_NO_MATH;
1053 preview = PREVIEW_OFF;
1054 if (tmp != "false" && tmp != "off")
1055 LYXERR0("Unrecognized preview status \""
1061 case RC_PREVIEW_HASHED_LABELS:
1062 lexrc >> preview_hashed_labels;
1065 case RC_PREVIEW_SCALE_FACTOR:
1066 lexrc >> preview_scale_factor;
1073 lexrc >> user_email;
1076 case RC_PATH_PREFIX:
1077 lexrc >> path_prefix;
1080 case RC_USE_CONVERTER_CACHE:
1081 lexrc >> use_converter_cache;
1083 case RC_CONVERTER_CACHE_MAXAGE:
1084 lexrc >> converter_cache_maxage;
1087 case RC_SORT_LAYOUTS:
1088 lexrc >> sort_layouts;
1090 case RC_GROUP_LAYOUTS:
1091 lexrc >> group_layouts;
1093 case RC_FULL_SCREEN_LIMIT:
1094 lexrc >> full_screen_limit;
1096 case RC_FULL_SCREEN_TOOLBARS:
1097 lexrc >> full_screen_toolbars;
1099 case RC_FULL_SCREEN_SCROLLBAR:
1100 lexrc >> full_screen_scrollbar;
1102 case RC_FULL_SCREEN_TABBAR:
1103 lexrc >> full_screen_tabbar;
1105 case RC_FULL_SCREEN_WIDTH:
1106 lexrc >> full_screen_width;
1108 case RC_OPEN_BUFFERS_IN_TABS:
1109 lexrc >> open_buffers_in_tabs;
1113 case RC_SPELL_COMMAND:
1114 case RC_USE_SPELL_LIB:
1115 (void) lexrc.getString();
1119 break; // this is just a dummy
1123 /// Update converters data-structures
1124 theConverters().update(formats);
1125 theConverters().buildGraph();
1131 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1133 ofstream ofs(filename.toFilesystemEncoding().c_str());
1135 write(ofs, ignore_system_lyxrc);
1139 void LyXRC::print() const
1141 if (lyxerr.debugging())
1142 write(lyxerr, false);
1150 typedef pair<string, SpecialisedMover> Data;
1152 SameMover(Data const & comparison)
1153 : comparison_(comparison) {}
1155 bool operator()(Data const & data) const
1157 return data.first == comparison_.first &&
1158 data.second.command() == comparison_.second.command();
1168 // Escape \ and " so that LyXLex can read the string later
1169 string escapeCommand(string const & str) {
1170 return subst(subst(str , "\\", "\\\\"),
1177 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1179 LyXRCTags tag = RC_LAST;
1181 if (!name.empty()) {
1182 for (int i = 0; i != lyxrcCount; ++i)
1183 if ("\\" + name == lyxrcTags[i].tag)
1184 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1188 os << "# LyX " << lyx_version
1189 << " generated this file. If you want to make your own\n"
1190 << "# modifications you should do them from inside LyX and save.\n"
1193 // Why the switch you might ask. It is a trick to ensure that all
1194 // the elements in the LyXRCTags enum are handled. As you can see
1195 // there are no breaks at all. So it is just a huge fall-through.
1196 // The nice thing is that we will get a warning from the compiler
1197 // if we forget an element.
1201 // input/include files are not done here
1203 if (ignore_system_lyxrc ||
1204 bind_file != system_lyxrc.bind_file) {
1205 string const path = os::external_path(bind_file);
1206 os << "\\bind_file \"" << path << "\"\n";
1212 if (ignore_system_lyxrc ||
1213 def_file != system_lyxrc.def_file) {
1214 string const path = os::external_path(def_file);
1215 os << "\\def_file \"" << path << "\"\n";
1224 << "# MISC SECTION ######################################\n"
1226 // bind files are not done here.
1228 case RC_PATH_PREFIX:
1229 if (ignore_system_lyxrc ||
1230 path_prefix != system_lyxrc.path_prefix) {
1231 os << "\\path_prefix \"" << path_prefix << "\"\n";
1236 if (ignore_system_lyxrc ||
1237 ui_file != system_lyxrc.ui_file) {
1238 string const path = os::external_path(ui_file);
1239 os << "\\ui_file \"" << path << "\"\n";
1243 case RC_AUTOREGIONDELETE:
1244 if (ignore_system_lyxrc ||
1245 auto_region_delete != system_lyxrc.auto_region_delete) {
1246 os << "# Set to false to inhibit automatic replacement of\n"
1247 << "# the current selection.\n"
1248 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1253 case RC_AUTORESET_OPTIONS:
1254 if (ignore_system_lyxrc ||
1255 auto_reset_options != system_lyxrc.auto_reset_options) {
1256 os << "# Set to false to inhibit automatic reset of\n"
1257 << "# the class options to defaults on class change.\n"
1258 << "\\auto_reset_options "
1259 << convert<string>(auto_reset_options)
1265 if (ignore_system_lyxrc ||
1266 autosave != system_lyxrc.autosave) {
1267 os << "# The time interval between auto-saves in seconds.\n"
1268 << "\\autosave " << autosave << '\n';
1272 case RC_DISPLAY_GRAPHICS:
1273 if (ignore_system_lyxrc ||
1274 display_graphics != system_lyxrc.display_graphics) {
1275 os << "# Display graphics within LyX\n"
1277 << "\\display_graphics "
1278 << (display_graphics ? "true" : "false")
1283 case RC_SORT_LAYOUTS:
1284 if (ignore_system_lyxrc ||
1285 sort_layouts != system_lyxrc.sort_layouts) {
1286 os << "# Sort layouts alphabetically.\n"
1287 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1291 case RC_GROUP_LAYOUTS:
1292 if (ignore_system_lyxrc ||
1293 group_layouts != system_lyxrc.group_layouts) {
1294 os << "# Group layouts by their category.\n"
1295 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1299 case RC_VIEWDVI_PAPEROPTION:
1300 if (ignore_system_lyxrc ||
1301 view_dvi_paper_option
1302 != system_lyxrc.view_dvi_paper_option) {
1303 os << "# Options used to specify paper size to the\n"
1304 << "# view_dvi_command (e.g. -paper)\n"
1305 << "\\view_dvi_paper_option \""
1306 << view_dvi_paper_option << "\"\n";
1310 case RC_DEFAULT_PAPERSIZE:
1311 if (ignore_system_lyxrc ||
1312 default_papersize != system_lyxrc.default_papersize) {
1313 os << "# The default papersize to use.\n"
1314 << "\\default_papersize \"";
1315 switch (default_papersize) {
1317 os << "default"; break;
1318 case PAPER_USLETTER:
1319 os << "usletter"; break;
1321 os << "legal"; break;
1322 case PAPER_USEXECUTIVE:
1323 os << "executive"; break;
1334 case PAPER_B4: break;
1340 case RC_CHKTEX_COMMAND:
1341 if (ignore_system_lyxrc ||
1342 chktex_command != system_lyxrc.chktex_command) {
1343 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1347 case RC_BIBTEX_COMMAND:
1348 if (ignore_system_lyxrc ||
1349 bibtex_command != system_lyxrc.bibtex_command) {
1350 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1354 case RC_JBIBTEX_COMMAND:
1355 if (ignore_system_lyxrc ||
1356 jbibtex_command != system_lyxrc.jbibtex_command) {
1357 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1361 case RC_INDEX_COMMAND:
1362 if (ignore_system_lyxrc ||
1363 index_command != system_lyxrc.index_command) {
1364 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1368 case RC_JINDEX_COMMAND:
1369 if (ignore_system_lyxrc ||
1370 jindex_command != system_lyxrc.jindex_command) {
1371 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1375 case RC_NOMENCL_COMMAND:
1376 if (ignore_system_lyxrc ||
1377 nomencl_command != system_lyxrc.nomencl_command) {
1378 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1382 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1383 if (ignore_system_lyxrc ||
1384 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1385 os << "\\tex_expects_windows_paths "
1386 << convert<string>(windows_style_tex_paths) << '\n';
1390 case RC_TEX_ALLOWS_SPACES:
1391 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1392 os << "\\tex_allows_spaces "
1393 << convert<string>(tex_allows_spaces) << '\n';
1398 if (ignore_system_lyxrc ||
1399 use_kbmap != system_lyxrc.use_kbmap) {
1400 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1404 case RC_KBMAP_PRIMARY:
1405 if (ignore_system_lyxrc ||
1406 primary_kbmap != system_lyxrc.primary_kbmap) {
1407 string const path = os::external_path(primary_kbmap);
1408 os << "\\kbmap_primary \"" << path << "\"\n";
1412 case RC_KBMAP_SECONDARY:
1413 if (ignore_system_lyxrc ||
1414 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1415 string const path = os::external_path(secondary_kbmap);
1416 os << "\\kbmap_secondary \"" << path << "\"\n";
1421 if (ignore_system_lyxrc ||
1422 lyxpipes != system_lyxrc.lyxpipes) {
1423 string const path = os::external_path(lyxpipes);
1424 os << "\\serverpipe \"" << path << "\"\n";
1428 case RC_DATE_INSERT_FORMAT:
1429 if (ignore_system_lyxrc ||
1430 date_insert_format != system_lyxrc.date_insert_format) {
1431 os << "\\date_insert_format \"" << date_insert_format
1436 case RC_LABEL_INIT_LENGTH:
1437 if (ignore_system_lyxrc ||
1438 label_init_length != system_lyxrc.label_init_length) {
1439 os << "\\label_init_length " << label_init_length
1446 os << "\\user_name \"" << user_name << "\"\n";
1451 os << "\\user_email \"" << user_email << "\"\n";
1455 case RC_SHOW_BANNER:
1456 if (ignore_system_lyxrc ||
1457 show_banner != system_lyxrc.show_banner) {
1458 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1464 if (ignore_system_lyxrc ||
1465 preview != system_lyxrc.preview) {
1471 case PREVIEW_NO_MATH:
1478 os << "\\preview " << status << '\n';
1483 case RC_PREVIEW_HASHED_LABELS:
1484 if (ignore_system_lyxrc ||
1485 preview_hashed_labels !=
1486 system_lyxrc.preview_hashed_labels) {
1487 os << "\\preview_hashed_labels "
1488 << convert<string>(preview_hashed_labels) << '\n';
1493 case RC_PREVIEW_SCALE_FACTOR:
1494 if (ignore_system_lyxrc ||
1495 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1496 os << "\\preview_scale_factor "
1497 << preview_scale_factor << '\n';
1502 case RC_USE_CONVERTER_CACHE:
1503 if (ignore_system_lyxrc ||
1504 use_converter_cache != system_lyxrc.use_converter_cache) {
1505 os << "\\use_converter_cache "
1506 << convert<string>(use_converter_cache) << '\n';
1511 case RC_CONVERTER_CACHE_MAXAGE:
1512 if (ignore_system_lyxrc ||
1513 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1514 os << "\\converter_cache_maxage "
1515 << converter_cache_maxage << '\n';
1521 << "# SCREEN & FONTS SECTION ############################\n"
1525 if (ignore_system_lyxrc ||
1526 dpi != system_lyxrc.dpi) {
1527 os << "\\screen_dpi " << dpi << '\n';
1531 case RC_SCREEN_ZOOM:
1532 if (ignore_system_lyxrc ||
1533 zoom != system_lyxrc.zoom) {
1534 os << "\\screen_zoom " << zoom << '\n';
1538 case RC_GEOMETRY_SESSION:
1539 if (ignore_system_lyxrc ||
1540 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1541 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1546 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1547 if (ignore_system_lyxrc ||
1548 cursor_follows_scrollbar
1549 != system_lyxrc.cursor_follows_scrollbar) {
1550 os << "\\cursor_follows_scrollbar "
1551 << convert<string>(cursor_follows_scrollbar) << '\n';
1555 case RC_SCROLL_BELOW_DOCUMENT:
1556 if (ignore_system_lyxrc ||
1557 scroll_below_document
1558 != system_lyxrc.scroll_below_document) {
1559 os << "\\scroll_below_document "
1560 << convert<string>(scroll_below_document) << '\n';
1564 case RC_MAC_LIKE_WORD_MOVEMENT:
1565 if (ignore_system_lyxrc ||
1566 mac_like_word_movement
1567 != system_lyxrc.mac_like_word_movement) {
1568 os << "\\mac_like_word_movement "
1569 << convert<string>(mac_like_word_movement) << '\n';
1573 case RC_MACRO_EDIT_STYLE:
1574 if (ignore_system_lyxrc ||
1576 != system_lyxrc.macro_edit_style) {
1577 os << "\\macro_edit_style ";
1578 switch (macro_edit_style) {
1579 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1580 case MACRO_EDIT_INLINE: os << "1\n"; break;
1581 case MACRO_EDIT_LIST: os << "2\n"; break;
1586 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1587 if (ignore_system_lyxrc ||
1588 dialogs_iconify_with_main
1589 != system_lyxrc.dialogs_iconify_with_main) {
1590 os << "\\dialogs_iconify_with_main "
1591 << convert<string>(dialogs_iconify_with_main) << '\n';
1595 case RC_SCREEN_FONT_ROMAN:
1596 if (ignore_system_lyxrc ||
1597 roman_font_name != system_lyxrc.roman_font_name) {
1598 os << "\\screen_font_roman \"" << roman_font_name
1603 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1604 if (ignore_system_lyxrc ||
1605 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1606 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1611 case RC_SCREEN_FONT_SANS:
1612 if (ignore_system_lyxrc ||
1613 sans_font_name != system_lyxrc.sans_font_name) {
1614 os << "\\screen_font_sans \"" << sans_font_name
1619 case RC_SCREEN_FONT_SANS_FOUNDRY:
1620 if (ignore_system_lyxrc ||
1621 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1622 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1627 case RC_SCREEN_FONT_TYPEWRITER:
1628 if (ignore_system_lyxrc ||
1629 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1630 os << "\\screen_font_typewriter \""
1631 << typewriter_font_name << "\"\n";
1635 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1636 if (ignore_system_lyxrc ||
1637 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1638 os << "\\screen_font_typewriter_foundry \""
1639 << typewriter_font_foundry << "\"\n";
1644 case RC_SCREEN_FONT_SCALABLE:
1645 if (ignore_system_lyxrc ||
1646 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1647 os << "\\screen_font_scalable "
1648 << convert<string>(use_scalable_fonts)
1653 case RC_SCREEN_FONT_SIZES:
1654 if (ignore_system_lyxrc ||
1655 font_sizes[FONT_SIZE_TINY]
1656 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1657 font_sizes[FONT_SIZE_SCRIPT]
1658 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1659 font_sizes[FONT_SIZE_FOOTNOTE]
1660 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1661 font_sizes[FONT_SIZE_SMALL]
1662 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1663 font_sizes[FONT_SIZE_NORMAL]
1664 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1665 font_sizes[FONT_SIZE_LARGE]
1666 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1667 font_sizes[FONT_SIZE_LARGER]
1668 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1669 font_sizes[FONT_SIZE_LARGEST]
1670 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1671 font_sizes[FONT_SIZE_HUGE]
1672 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1673 font_sizes[FONT_SIZE_HUGER]
1674 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1675 os.setf(ios::fixed);
1677 os << "\\screen_font_sizes"
1678 << ' ' << font_sizes[FONT_SIZE_TINY]
1679 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1680 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1681 << ' ' << font_sizes[FONT_SIZE_SMALL]
1682 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1683 << ' ' << font_sizes[FONT_SIZE_LARGE]
1684 << ' ' << font_sizes[FONT_SIZE_LARGER]
1685 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1686 << ' ' << font_sizes[FONT_SIZE_HUGE]
1687 << ' ' << font_sizes[FONT_SIZE_HUGER]
1692 case RC_FULL_SCREEN_LIMIT:
1693 if (ignore_system_lyxrc ||
1694 full_screen_limit != system_lyxrc.full_screen_limit) {
1695 os << "\\fullscreen_limit "
1696 << convert<string>(full_screen_limit)
1701 case RC_FULL_SCREEN_TOOLBARS:
1702 if (ignore_system_lyxrc ||
1703 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1704 os << "\\fullscreen_toolbars "
1705 << convert<string>(full_screen_toolbars)
1710 case RC_FULL_SCREEN_SCROLLBAR:
1711 if (ignore_system_lyxrc ||
1712 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1713 os << "\\fullscreen_scrollbar "
1714 << convert<string>(full_screen_scrollbar)
1719 case RC_FULL_SCREEN_TABBAR:
1720 if (ignore_system_lyxrc ||
1721 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1722 os << "\\fullscreen_tabbar "
1723 << convert<string>(full_screen_tabbar)
1728 case RC_FULL_SCREEN_WIDTH:
1729 if (ignore_system_lyxrc ||
1730 full_screen_width != system_lyxrc.full_screen_width) {
1731 os << "\\fullscreen_width "
1732 << convert<string>(full_screen_width)
1737 case RC_OPEN_BUFFERS_IN_TABS:
1738 if (ignore_system_lyxrc ||
1739 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1740 os << "\\open_buffers_in_tabs "
1741 << convert<string>(open_buffers_in_tabs)
1748 << "# COLOR SECTION ###################################\n"
1752 for (int i = 0; i < Color_ignore; ++i) {
1753 ColorCode lc = static_cast<ColorCode>(i);
1754 string const col = lcolor.getX11Name(lc);
1755 if (ignore_system_lyxrc
1756 || col != system_lcolor.getX11Name(lc)) {
1757 os << "\\set_color \""
1758 << lcolor.getLyXName(lc) << "\" \""
1766 << "# PRINTER SECTION ###################################\n"
1770 if (ignore_system_lyxrc ||
1771 printer != system_lyxrc.printer) {
1772 os << "\\printer \"" << printer << "\"\n";
1776 case RC_PRINT_ADAPTOUTPUT:
1777 if (ignore_system_lyxrc ||
1778 print_adapt_output != system_lyxrc.print_adapt_output) {
1779 os << "\\print_adapt_output "
1780 << convert<string>(print_adapt_output)
1785 case RC_PRINT_COMMAND:
1786 if (ignore_system_lyxrc ||
1787 print_command != system_lyxrc.print_command) {
1788 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1792 case RC_PRINTEXSTRAOPTIONS:
1793 if (ignore_system_lyxrc ||
1794 print_extra_options != system_lyxrc.print_extra_options) {
1795 os << "\\print_extra_options \"" << print_extra_options
1800 case RC_PRINTSPOOL_COMMAND:
1801 if (ignore_system_lyxrc ||
1802 print_spool_command != system_lyxrc.print_spool_command) {
1803 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1808 case RC_PRINTSPOOL_PRINTERPREFIX:
1809 if (ignore_system_lyxrc ||
1810 print_spool_printerprefix
1811 != system_lyxrc.print_spool_printerprefix) {
1812 os << "\\print_spool_printerprefix \""
1813 << print_spool_printerprefix << "\"\n";
1817 case RC_PRINTEVENPAGEFLAG:
1818 if (ignore_system_lyxrc ||
1819 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1820 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1825 case RC_PRINTODDPAGEFLAG:
1826 if (ignore_system_lyxrc ||
1827 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1828 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1833 case RC_PRINTREVERSEFLAG:
1834 if (ignore_system_lyxrc ||
1835 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1836 os << "\\print_reverse_flag \"" << print_reverse_flag
1841 case RC_PRINTLANDSCAPEFLAG:
1842 if (ignore_system_lyxrc ||
1843 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1844 os << "\\print_landscape_flag \"" << print_landscape_flag
1849 case RC_PRINTPAGERANGEFLAG:
1850 if (ignore_system_lyxrc ||
1851 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1852 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1857 case RC_PRINTCOPIESFLAG:
1858 if (ignore_system_lyxrc ||
1859 print_copies_flag != system_lyxrc.print_copies_flag) {
1860 os << "\\print_copies_flag \"" << print_copies_flag
1865 case RC_PRINTCOLLCOPIESFLAG:
1866 if (ignore_system_lyxrc ||
1867 print_collcopies_flag
1868 != system_lyxrc.print_collcopies_flag) {
1869 os << "\\print_collcopies_flag \""
1870 << print_collcopies_flag
1875 case RC_PRINTPAPERFLAG:
1876 if (ignore_system_lyxrc ||
1877 print_paper_flag != system_lyxrc.print_paper_flag) {
1878 os << "\\print_paper_flag \"" << print_paper_flag
1883 case RC_PRINTPAPERDIMENSIONFLAG:
1884 if (ignore_system_lyxrc ||
1885 print_paper_dimension_flag
1886 != system_lyxrc.print_paper_dimension_flag) {
1887 os << "\\print_paper_dimension_flag \""
1888 << print_paper_dimension_flag << "\"\n";
1892 case RC_PRINTTOPRINTER:
1893 if (ignore_system_lyxrc ||
1894 print_to_printer != system_lyxrc.print_to_printer) {
1895 os << "\\print_to_printer \"" << print_to_printer
1900 case RC_PRINTTOFILE:
1901 if (ignore_system_lyxrc ||
1902 print_to_file != system_lyxrc.print_to_file) {
1903 string const path = os::external_path(print_to_file);
1904 os << "\\print_to_file \"" << path << "\"\n";
1908 case RC_PRINTFILEEXTENSION:
1909 if (ignore_system_lyxrc ||
1910 print_file_extension != system_lyxrc.print_file_extension) {
1911 os << "\\print_file_extension \""
1912 << print_file_extension
1919 << "# TEX SECTION #######################################\n"
1922 case RC_FONT_ENCODING:
1923 if (ignore_system_lyxrc ||
1924 fontenc != system_lyxrc.fontenc) {
1925 os << "\\font_encoding \"" << fontenc << "\"\n";
1931 << "# FILE SECTION ######################################\n"
1934 case RC_DOCUMENTPATH:
1935 if (ignore_system_lyxrc ||
1936 document_path != system_lyxrc.document_path) {
1937 string const path = os::external_path(document_path);
1938 os << "\\document_path \"" << path << "\"\n";
1942 case RC_USELASTFILEPOS:
1943 if (ignore_system_lyxrc ||
1944 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1945 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1950 case RC_LOADSESSION:
1951 if (ignore_system_lyxrc ||
1952 load_session != system_lyxrc.load_session) {
1953 os << "\\load_session " << convert<string>(load_session)
1958 case RC_MOUSE_WHEEL_SPEED:
1959 if (ignore_system_lyxrc ||
1960 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1961 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1965 case RC_COMPLETION_INLINE_DELAY:
1966 if (ignore_system_lyxrc ||
1967 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1968 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1972 case RC_COMPLETION_INLINE_MATH:
1973 if (ignore_system_lyxrc ||
1974 completion_inline_math != system_lyxrc.completion_inline_math) {
1975 os << "\\completion_inline_math "
1976 << convert<string>(completion_inline_math) << '\n';
1980 case RC_COMPLETION_INLINE_TEXT:
1981 if (ignore_system_lyxrc ||
1982 completion_inline_text != system_lyxrc.completion_inline_text) {
1983 os << "\\completion_inline_text "
1984 << convert<string>(completion_inline_text) << '\n';
1988 case RC_COMPLETION_INLINE_DOTS:
1989 if (ignore_system_lyxrc ||
1990 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1991 os << "\\completion_inline_dots "
1992 << convert<string>(completion_inline_dots) << '\n';
1996 case RC_AUTOCORRECTION_MATH:
1997 if (ignore_system_lyxrc ||
1998 autocorrection_math != system_lyxrc.autocorrection_math) {
1999 os << "\\autocorrection_math "
2000 << convert<string>(autocorrection_math) << '\n';
2004 case RC_COMPLETION_POPUP_DELAY:
2005 if (ignore_system_lyxrc ||
2006 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2007 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2011 case RC_COMPLETION_POPUP_MATH:
2012 if (ignore_system_lyxrc ||
2013 completion_popup_math != system_lyxrc.completion_popup_math) {
2014 os << "\\completion_popup_math "
2015 << convert<string>(completion_popup_math) << '\n';
2019 case RC_COMPLETION_POPUP_TEXT:
2020 if (ignore_system_lyxrc ||
2021 completion_popup_text != system_lyxrc.completion_popup_text) {
2022 os << "\\completion_popup_text "
2023 << convert<string>(completion_popup_text) << '\n';
2027 case RC_COMPLETION_CURSOR_TEXT:
2028 if (ignore_system_lyxrc ||
2029 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2030 os << "\\completion_cursor_text "
2031 << convert<string>(completion_cursor_text) << '\n';
2035 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2036 if (ignore_system_lyxrc ||
2037 completion_popup_after_complete
2038 != system_lyxrc.completion_popup_after_complete) {
2039 os << "\\completion_popup_after_complete "
2040 << convert<string>(completion_popup_after_complete) << '\n';
2044 case RC_NUMLASTFILES:
2045 if (ignore_system_lyxrc ||
2046 num_lastfiles != system_lyxrc.num_lastfiles) {
2047 os << "\\num_lastfiles " << num_lastfiles << '\n';
2051 case RC_CHECKLASTFILES:
2052 if (ignore_system_lyxrc ||
2053 check_lastfiles != system_lyxrc.check_lastfiles) {
2054 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2059 case RC_EXAMPLEPATH:
2060 if (ignore_system_lyxrc ||
2061 example_path != system_lyxrc.example_path) {
2062 string const path = os::external_path(example_path);
2063 os << "\\example_path \"" << path << "\"\n";
2067 case RC_TEMPLATEPATH:
2068 if (ignore_system_lyxrc ||
2069 template_path != system_lyxrc.template_path) {
2070 string const path = os::external_path(template_path);
2071 os << "\\template_path \"" << path << "\"\n";
2075 case RC_TEMPDIRPATH:
2076 if (ignore_system_lyxrc ||
2077 tempdir_path != system_lyxrc.tempdir_path) {
2078 string const path = os::external_path(tempdir_path);
2079 os << "\\tempdir_path \"" << path << "\"\n";
2083 case RC_THESAURUSDIRPATH:
2084 if (ignore_system_lyxrc ||
2085 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2086 string const path = os::external_path(thesaurusdir_path);
2087 os << "\\thesaurusdir_path \"" << path << "\"\n";
2095 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2098 case RC_PLAINTEXT_LINELEN:
2099 if (ignore_system_lyxrc ||
2100 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2101 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2105 case RC_MAKE_BACKUP:
2106 if (ignore_system_lyxrc ||
2107 make_backup != system_lyxrc.make_backup) {
2108 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2112 case RC_BACKUPDIR_PATH:
2113 if (ignore_system_lyxrc ||
2114 backupdir_path != system_lyxrc.backupdir_path) {
2115 string const path = os::external_path(backupdir_path);
2116 os << "\\backupdir_path \"" << path << "\"\n";
2122 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2126 << "# SPELLCHECKER SECTION ##############################\n"
2129 case RC_SPELL_COMMAND:
2130 case RC_USE_SPELL_LIB:
2134 case RC_ACCEPT_COMPOUND:
2135 if (ignore_system_lyxrc ||
2136 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2137 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2142 case RC_USE_ALT_LANG:
2143 if (ignore_system_lyxrc ||
2144 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2145 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2151 if (ignore_system_lyxrc ||
2152 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2153 os << "\\alternate_language \"" << spellchecker_alt_lang
2158 case RC_USE_ESC_CHARS:
2159 if (ignore_system_lyxrc ||
2160 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2161 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2167 if (ignore_system_lyxrc ||
2168 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2169 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2173 case RC_USE_PERS_DICT:
2174 if (ignore_system_lyxrc ||
2175 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2176 os << "\\use_personal_dictionary "
2177 << convert<string>(spellchecker_use_pers_dict)
2182 case RC_USE_TOOLTIP:
2183 if (ignore_system_lyxrc ||
2184 use_tooltip != system_lyxrc.use_tooltip) {
2185 os << "\\use_tooltip "
2186 << convert<string>(use_tooltip)
2189 case RC_USE_PIXMAP_CACHE:
2190 if (ignore_system_lyxrc ||
2191 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2192 os << "\\use_pixmap_cache "
2193 << convert<string>(use_pixmap_cache)
2197 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2198 string const path = os::external_path(spellchecker_pers_dict);
2199 os << "\\personal_dictionary \"" << path << "\"\n";
2203 case RC_USE_INP_ENC:
2204 if (ignore_system_lyxrc ||
2205 spellchecker_use_input_encoding
2206 != system_lyxrc.spellchecker_use_input_encoding) {
2207 os << "\\use_input_encoding "
2208 << convert<string>(spellchecker_use_input_encoding)
2215 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2218 case RC_SPELLCHECK_CONTINUOUSLY:
2219 if (ignore_system_lyxrc ||
2220 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2221 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2227 case RC_RTL_SUPPORT:
2228 if (ignore_system_lyxrc ||
2229 rtl_support != system_lyxrc.rtl_support) {
2230 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2234 case RC_VISUAL_CURSOR:
2235 if (ignore_system_lyxrc ||
2236 visual_cursor != system_lyxrc.visual_cursor) {
2237 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2241 case RC_LANGUAGE_PACKAGE:
2242 if (ignore_system_lyxrc ||
2243 language_package != system_lyxrc.language_package) {
2244 os << "\\language_package \"" << language_package
2249 case RC_LANGUAGE_GLOBAL_OPTIONS:
2250 if (ignore_system_lyxrc ||
2251 language_global_options
2252 != system_lyxrc.language_global_options) {
2253 os << "\\language_global_options \""
2254 << convert<string>(language_global_options)
2259 case RC_LANGUAGE_USE_BABEL:
2260 if (ignore_system_lyxrc ||
2261 language_use_babel != system_lyxrc.language_use_babel) {
2262 os << "\\language_use_babel \""
2263 << convert<string>(language_use_babel)
2268 case RC_LANGUAGE_COMMAND_BEGIN:
2269 if (ignore_system_lyxrc ||
2270 language_command_begin
2271 != system_lyxrc.language_command_begin) {
2272 os << "\\language_command_begin \""
2273 << language_command_begin
2278 case RC_LANGUAGE_COMMAND_END:
2279 if (ignore_system_lyxrc ||
2280 language_command_end
2281 != system_lyxrc.language_command_end) {
2282 os << "\\language_command_end \"" << language_command_end
2287 case RC_LANGUAGE_COMMAND_LOCAL:
2288 if (ignore_system_lyxrc ||
2289 language_command_local
2290 != system_lyxrc.language_command_local) {
2291 os << "\\language_command_local \""
2292 << language_command_local
2297 case RC_LANGUAGE_AUTO_BEGIN:
2298 if (ignore_system_lyxrc ||
2299 language_auto_begin != system_lyxrc.language_auto_begin) {
2300 os << "\\language_auto_begin "
2301 << convert<string>(language_auto_begin) << '\n';
2305 case RC_LANGUAGE_AUTO_END:
2306 if (ignore_system_lyxrc ||
2307 language_auto_end != system_lyxrc.language_auto_end) {
2308 os << "\\language_auto_end "
2309 << convert<string>(language_auto_end) << '\n';
2313 case RC_MARK_FOREIGN_LANGUAGE:
2314 if (ignore_system_lyxrc ||
2315 mark_foreign_language
2316 != system_lyxrc.mark_foreign_language) {
2317 os << "\\mark_foreign_language " <<
2318 convert<string>(mark_foreign_language) << '\n';
2324 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2327 case RC_AUTO_NUMBER:
2328 if (ignore_system_lyxrc ||
2329 auto_number != system_lyxrc.auto_number) {
2330 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2334 case RC_DEFAULT_LANGUAGE:
2335 if (ignore_system_lyxrc ||
2336 default_language != system_lyxrc.default_language) {
2337 os << "\\default_language " << default_language << '\n';
2341 case RC_GUI_LANGUAGE:
2342 if (ignore_system_lyxrc ||
2343 gui_language != system_lyxrc.gui_language) {
2344 os << "\\gui_language " << gui_language << '\n';
2350 << "# FORMATS SECTION ##########################\n"
2354 // New/modified formats
2355 for (Formats::const_iterator cit = formats.begin();
2356 cit != formats.end(); ++cit) {
2357 Format const * format =
2358 system_formats.getFormat(cit->name());
2360 format->extension() != cit->extension() ||
2361 format->prettyname() != cit->prettyname() ||
2362 format->shortcut() != cit->shortcut() ||
2363 format->viewer() != cit->viewer() ||
2364 format->editor() != cit->editor() ||
2365 format->documentFormat() != cit->documentFormat() ||
2366 format->vectorFormat() != cit->vectorFormat()) {
2367 os << "\\format \"" << cit->name() << "\" \""
2368 << cit->extension() << "\" \""
2369 << cit->prettyname() << "\" \""
2370 << cit->shortcut() << "\" \""
2371 << escapeCommand(cit->viewer()) << "\" \""
2372 << escapeCommand(cit->editor()) << "\" \"";
2373 vector<string> flags;
2374 if (cit->documentFormat())
2375 flags.push_back("document");
2376 if (cit->vectorFormat())
2377 flags.push_back("vector");
2378 os << getStringFromVector(flags);
2383 // Look for deleted formats
2384 for (Formats::const_iterator cit = system_formats.begin();
2385 cit != system_formats.end(); ++cit)
2386 if (!formats.getFormat(cit->name()))
2387 os << "\\format \"" << cit->name()
2388 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2391 case RC_DEFAULT_VIEW_FORMAT:
2392 if (ignore_system_lyxrc ||
2393 default_view_format != system_lyxrc.default_view_format) {
2394 os << "\\default_view_format " << default_view_format << '\n';
2404 << "# CONVERTERS SECTION ##########################\n"
2408 // Look for new converters
2409 for (Converters::const_iterator cit = theConverters().begin();
2410 cit != theConverters().end(); ++cit) {
2411 Converter const * converter =
2412 theSystemConverters().getConverter(cit->from,
2415 converter->command != cit->command ||
2416 converter->flags != cit->flags)
2417 os << "\\converter \"" << cit->from << "\" \""
2418 << cit->to << "\" \""
2419 << escapeCommand(cit->command) << "\" \""
2420 << cit->flags << "\"\n";
2423 // New/modifed converters
2424 for (Converters::const_iterator cit = theSystemConverters().begin();
2425 cit != theSystemConverters().end(); ++cit)
2426 if (!theConverters().getConverter(cit->from, cit->to))
2427 os << "\\converter \"" << cit->from
2428 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2435 << "# COPIERS SECTION ##########################\n"
2438 // Look for new movers
2439 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2440 Movers::const_iterator const sysend = theSystemMovers().end();
2441 Movers::const_iterator it = theMovers().begin();
2442 Movers::const_iterator end = theMovers().end();
2444 for (; it != end; ++it) {
2445 Movers::const_iterator const sysit =
2446 find_if(sysbegin, sysend, SameMover(*it));
2447 if (sysit == sysend) {
2448 string const & fmt = it->first;
2449 string const & command =
2450 it->second.command();
2452 os << "\\copier " << fmt
2453 << " \"" << escapeCommand(command) << "\"\n";
2459 // We don't actually delete SpecialisedMover(s) from the
2460 // map, just clear their 'command', so there's no need
2461 // to test for anything else.
2469 string const LyXRC::getDescription(LyXRCTags tag)
2474 case RC_ACCEPT_COMPOUND:
2475 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2479 case RC_USE_ALT_LANG:
2480 str = _("Specify an alternate language. The default is to use the language of the document.");
2483 case RC_PLAINTEXT_ROFF_COMMAND:
2484 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.");
2487 case RC_PLAINTEXT_LINELEN:
2488 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.");
2491 case RC_AUTOREGIONDELETE:
2492 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2495 case RC_AUTORESET_OPTIONS:
2496 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2500 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2503 case RC_AUTO_NUMBER:
2506 case RC_BACKUPDIR_PATH:
2507 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.");
2510 case RC_BIBTEX_COMMAND:
2511 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2514 case RC_JBIBTEX_COMMAND:
2515 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2519 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2522 case RC_CHECKLASTFILES:
2523 str = _("Select to check whether the lastfiles still exist.");
2526 case RC_CHKTEX_COMMAND:
2527 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2536 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2537 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.");
2540 case RC_SCROLL_BELOW_DOCUMENT:
2541 str = _("LyX normally doesn't allow the user to scroll further than the bottom of the document. Set to true if you prefer to scroll the bottom of the document to the top of the screen");
2544 case RC_MAC_LIKE_WORD_MOVEMENT:
2545 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2548 case RC_SHOW_MACRO_LABEL:
2549 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2552 case RC_DATE_INSERT_FORMAT:
2553 //xgettext:no-c-format
2554 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2558 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2561 case RC_DEFAULT_VIEW_FORMAT:
2562 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2565 case RC_DEFAULT_LANGUAGE:
2566 str = _("New documents will be assigned this language.");
2569 case RC_DEFAULT_PAPERSIZE:
2570 str = _("Specify the default paper size.");
2573 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2574 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2577 case RC_DISPLAY_GRAPHICS:
2578 str = _("Select how LyX will display any graphics.");
2581 case RC_DOCUMENTPATH:
2582 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2586 case RC_USE_ESC_CHARS:
2587 str = _("Specify additional chars that can be part of a word.");
2590 case RC_EXAMPLEPATH:
2591 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2594 case RC_FONT_ENCODING:
2595 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2601 case RC_INDEX_COMMAND:
2602 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\".");
2605 case RC_JINDEX_COMMAND:
2606 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2609 case RC_NOMENCL_COMMAND:
2610 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2617 case RC_KBMAP_PRIMARY:
2618 case RC_KBMAP_SECONDARY:
2619 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.");
2622 case RC_LABEL_INIT_LENGTH:
2623 str = _("Maximum number of words in the initialization string for a new label");
2626 case RC_LANGUAGE_AUTO_BEGIN:
2627 str = _("Select if a language switching command is needed at the beginning of the document.");
2630 case RC_LANGUAGE_AUTO_END:
2631 str = _("Select if a language switching command is needed at the end of the document.");
2634 case RC_LANGUAGE_COMMAND_BEGIN:
2635 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.");
2638 case RC_LANGUAGE_COMMAND_END:
2639 str = _("The LaTeX command for changing back to the language of the document.");
2642 case RC_LANGUAGE_COMMAND_LOCAL:
2643 str = _("The LaTeX command for local changing of the language.");
2646 case RC_LANGUAGE_GLOBAL_OPTIONS:
2647 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2650 case RC_LANGUAGE_PACKAGE:
2651 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2654 case RC_LANGUAGE_USE_BABEL:
2655 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2658 case RC_USELASTFILEPOS:
2659 str = _("De-select if you do not want LyX to scroll to saved position.");
2662 case RC_LOADSESSION:
2663 str = _("De-select to prevent loading files opened from the last LyX session.");
2666 case RC_MAKE_BACKUP:
2667 str = _("De-select if you don't want LyX to create backup files.");
2670 case RC_MARK_FOREIGN_LANGUAGE:
2671 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2674 case RC_MOUSE_WHEEL_SPEED:
2675 str = bformat(_("The scrolling speed of the mouse wheel."),
2679 case RC_COMPLETION_POPUP_DELAY:
2680 str = _("The completion popup delay.");
2683 case RC_COMPLETION_POPUP_MATH:
2684 str = _("Select to display the completion popup in math mode.");
2687 case RC_COMPLETION_POPUP_TEXT:
2688 str = _("Select to display the completion popup in text mode.");
2691 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2692 str = _("Show the completion popup without delay after non-unique completion attempt.");
2695 case RC_COMPLETION_POPUP_TEXT:
2696 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2699 case RC_COMPLETION_POPUP_DELAY:
2700 str = _("The inline completion delay.");
2703 case RC_COMPLETION_INLINE_MATH:
2704 str = _("Select to display the inline completion in math mode.");
2707 case RC_COMPLETION_INLINE_TEXT:
2708 str = _("Select to display the inline completion in text mode.");
2711 case RC_COMPLETION_INLINE_DOTS:
2712 str = _("Use \"...\" to shorten long completions.");
2715 case RC_AUTOCORRECTION_MATH:
2716 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2719 case RC_NUMLASTFILES:
2720 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2724 case RC_PATH_PREFIX:
2725 str = _("Specify those directories which should be "
2726 "prepended to the PATH environment variable. "
2727 "Use the OS native format.");
2731 case RC_USE_PERS_DICT:
2732 str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
2736 str = _("Shows a typeset preview of things such as math");
2739 case RC_PREVIEW_HASHED_LABELS:
2740 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2743 case RC_PREVIEW_SCALE_FACTOR:
2744 str = _("Scale the preview size to suit.");
2747 case RC_PRINTCOLLCOPIESFLAG:
2748 str = _("The option for specifying whether the copies should be collated.");
2751 case RC_PRINTCOPIESFLAG:
2752 str = _("The option for specifying the number of copies to print.");
2756 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2759 case RC_PRINTEVENPAGEFLAG:
2760 str = _("The option to print only even pages.");
2763 case RC_PRINTEXSTRAOPTIONS:
2764 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2767 case RC_PRINTFILEEXTENSION:
2768 str = _("Extension of printer program output file. Usually \".ps\".");
2771 case RC_PRINTLANDSCAPEFLAG:
2772 str = _("The option to print out in landscape.");
2775 case RC_PRINTODDPAGEFLAG:
2776 str = _("The option to print only odd pages.");
2779 case RC_PRINTPAGERANGEFLAG:
2780 str = _("The option for specifying a comma-separated list of pages to print.");
2783 case RC_PRINTPAPERDIMENSIONFLAG:
2784 str = _("Option to specify the dimensions of the print paper.");
2787 case RC_PRINTPAPERFLAG:
2788 str = _("The option to specify paper type.");
2791 case RC_PRINTREVERSEFLAG:
2792 str = _("The option to reverse the order of the pages printed.");
2795 case RC_PRINTSPOOL_COMMAND:
2796 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.");
2799 case RC_PRINTSPOOL_PRINTERPREFIX:
2800 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.");
2803 case RC_PRINTTOFILE:
2804 str = _("Option to pass to the print program to print to a file.");
2807 case RC_PRINTTOPRINTER:
2808 str = _("Option to pass to the print program to print on a specific printer.");
2811 case RC_PRINT_ADAPTOUTPUT:
2812 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2815 case RC_PRINT_COMMAND:
2816 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2819 case RC_RTL_SUPPORT:
2820 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2823 case RC_VISUAL_CURSOR:
2824 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2828 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2831 case RC_SCREEN_FONT_ROMAN:
2832 case RC_SCREEN_FONT_SANS:
2833 case RC_SCREEN_FONT_TYPEWRITER:
2834 str = _("The screen fonts used to display the text while editing.");
2837 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2838 case RC_SCREEN_FONT_SANS_FOUNDRY:
2839 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2842 case RC_SCREEN_FONT_SCALABLE:
2843 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.");
2846 case RC_SCREEN_FONT_SIZES:
2847 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2850 case RC_SCREEN_ZOOM:
2851 //xgettext:no-c-format
2852 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2855 case RC_GEOMETRY_SESSION:
2856 str = _("Allow session manager to save and restore windows geometry.");
2860 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2866 case RC_SHOW_BANNER:
2867 str = _("De-select if you don't want the startup banner.");
2870 case RC_TEMPDIRPATH:
2871 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2874 case RC_THESAURUSDIRPATH:
2875 str = _("This is the place where the files of the thesaurus library reside.");
2878 case RC_TEMPLATEPATH:
2879 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2882 case RC_TEX_ALLOWS_SPACES:
2885 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2889 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2901 case RC_USE_INP_ENC:
2902 str = _("Specify whether to pass the -T input encoding option to aspell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2905 case RC_USE_TOOLTIP:
2906 str = _("Enable the automatic appearance of tool tips in the work area.");
2909 case RC_USE_PIXMAP_CACHE:
2910 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2913 case RC_USE_SPELL_LIB:
2916 case RC_VIEWDVI_PAPEROPTION:
2917 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2932 // The global instance
2935 // The global copy of the system lyxrc entries (everything except preferences)