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.
25 #include "Converter.h"
26 #include "FontEnums.h"
33 #include "graphics/GraphicsTypes.h"
35 #include "support/convert.h"
36 #include "support/debug.h"
37 #include "support/environment.h"
38 #include "support/filetools.h"
39 #include "support/gettext.h"
40 #include "support/lstrings.h"
41 #include "support/os.h"
42 #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 { "\\autosave", LyXRC::RC_AUTOSAVE },
62 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
63 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
64 { "\\bind_file", LyXRC::RC_BINDFILE },
65 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
66 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
67 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
68 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
69 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
70 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
71 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
72 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
73 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
74 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
75 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
76 { "\\converter", LyXRC::RC_CONVERTER },
77 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
78 { "\\copier", LyXRC::RC_COPIER },
79 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
80 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
81 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
82 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
83 { "\\def_file", LyXRC::RC_DEFFILE },
84 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
85 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
86 { "\\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 { "\\kbmap", LyXRC::RC_KBMAP },
103 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
104 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
105 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
106 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
107 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
108 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
109 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
110 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
111 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
112 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
113 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
114 { "\\load_session", LyXRC::RC_LOADSESSION },
115 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
116 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
117 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
118 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
119 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
120 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
121 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
122 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
123 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
124 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
125 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
126 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
127 { "\\preview", LyXRC::RC_PREVIEW },
128 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
129 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
130 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
131 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
132 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
133 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
134 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
135 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
136 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
137 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
138 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
139 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
140 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
141 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
142 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
143 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
144 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
145 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
146 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
147 { "\\printer", LyXRC::RC_PRINTER },
148 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
149 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
150 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
151 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
152 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
153 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
154 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
155 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
156 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
157 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
158 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
159 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
160 { "\\set_color", LyXRC::RC_SET_COLOR },
161 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
162 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
163 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
164 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
165 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
166 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
167 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
168 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
169 { "\\ui_file", LyXRC::RC_UIFILE },
170 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
171 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
172 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
173 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
174 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
175 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
176 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
177 // compatibility with versions older than 1.4.0 only
178 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
179 // compatibility with versions older than 1.4.0 only
180 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
181 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
182 { "\\user_email", LyXRC::RC_USER_EMAIL },
183 { "\\user_name", LyXRC::RC_USER_NAME },
184 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
185 // compatibility with versions older than 1.4.0 only
186 { "\\viewer", LyXRC::RC_VIEWER},
187 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
190 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
201 void LyXRC::setDefaults()
204 def_file = "default";
206 // Get printer from the environment. If fail, use default "",
207 // assuming that everything is set up correctly.
208 printer = getEnv("PRINTER");
209 print_adapt_output = false;
210 print_command = "dvips";
211 print_evenpage_flag = "-B";
212 print_oddpage_flag = "-A";
213 print_pagerange_flag = "-pp";
214 print_copies_flag = "-c";
215 print_collcopies_flag = "-C";
216 print_reverse_flag = "-r";
217 print_landscape_flag = "-t landscape";
218 print_to_printer = "-P";
219 print_to_file = "-o ";
220 print_file_extension = ".ps";
221 print_paper_flag = "-t";
222 print_paper_dimension_flag = "-T";
223 document_path.erase();
224 view_dvi_paper_option.erase();
225 default_papersize = PAPER_DEFAULT;
226 custom_export_format = "ps";
227 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
228 bibtex_command = "bibtex";
230 index_command = "makeindex -c -q";
231 nomencl_command = "makeindex -s nomencl.ist";
233 // Because a screen typically is wider than a piece of paper:
235 allow_geometry_session = true;
236 // Default LaTeX font size:
237 font_sizes[FONT_SIZE_TINY] = "5.0";
238 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
239 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
240 font_sizes[FONT_SIZE_SMALL] = "9.0";
241 font_sizes[FONT_SIZE_NORMAL] = "10.0";
242 font_sizes[FONT_SIZE_LARGE] = "12.0";
243 font_sizes[FONT_SIZE_LARGER] = "14.4";
244 font_sizes[FONT_SIZE_LARGEST] = "17.26";
245 font_sizes[FONT_SIZE_HUGE] = "20.74";
246 font_sizes[FONT_SIZE_HUGER] = "24.88";
247 use_scalable_fonts = true;
248 roman_font_name = "";
250 typewriter_font_name = "";
252 auto_region_delete = true;
253 auto_reset_options = false;
254 plaintext_linelen = 65;
255 mouse_wheel_speed = 1.0;
256 num_lastfiles = maxlastfiles;
257 check_lastfiles = true;
258 use_lastfilepos = true;
259 load_session = false;
261 backupdir_path.erase();
262 display_graphics = true;
263 // Spellchecker settings:
264 spellchecker_accept_compound = false;
265 spellchecker_use_input_encoding = false;
266 spellchecker_use_alt_lang = false;
267 spellchecker_use_pers_dict = false;
268 spellchecker_use_esc_chars = false;
271 visual_cursor = false;
273 mark_foreign_language = true;
274 language_auto_begin = true;
275 language_auto_end = true;
276 language_global_options = true;
277 language_use_babel = true;
278 language_package = "\\usepackage{babel}";
279 language_command_begin = "\\selectlanguage{$$lang}";
280 language_command_local = "\\foreignlanguage{$$lang}{";
281 sort_layouts = false;
282 group_layouts = true;
283 default_language = "english";
284 gui_language = "auto";
286 windows_style_tex_paths = false;
287 tex_allows_spaces = false;
288 date_insert_format = "%x";
289 cursor_follows_scrollbar = false;
290 mac_like_word_movement = false;
291 macro_edit_style = MACRO_EDIT_INLINE_BOX;
292 dialogs_iconify_with_main = false;
293 label_init_length = 3;
294 preview = PREVIEW_OFF;
295 preview_hashed_labels = false;
296 preview_scale_factor = "0.9";
297 use_converter_cache = true;
299 use_pixmap_cache = false;
300 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
301 user_name = to_utf8(support::user_name());
302 user_email = to_utf8(support::user_email());
303 open_buffers_in_tabs = true;
305 // Fullscreen settings
306 full_screen_limit = false;
307 full_screen_toolbars = true;
308 full_screen_tabbar = true;
309 full_screen_scrollbar = true;
310 full_screen_width = 700;
312 completion_cursor_text = true;
313 completion_popup_math = true;
314 completion_popup_text = false;
315 completion_popup_delay = 2.0;
316 completion_popup_after_complete = true;
317 completion_inline_math = true;
318 completion_inline_text = false;
319 completion_inline_dots = -1;
320 completion_inline_delay = 0.2;
326 void oldFontFormat(string & family, string & foundry)
328 if (family.empty() || family[0] != '-')
330 foundry = token(family, '-', 1);
331 family = token(family, '-', 2);
339 int LyXRC::read(FileName const & filename)
341 Lexer lexrc(lyxrcTags);
342 if (lyxerr.debugging(Debug::PARSER))
343 lexrc.printTable(lyxerr);
345 lexrc.setFile(filename);
349 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
355 int LyXRC::read(istream & is)
357 Lexer lexrc(lyxrcTags);
358 if (lyxerr.debugging(Debug::PARSER))
359 lexrc.printTable(lyxerr);
365 LYXERR(Debug::LYXRC, "Reading istream...");
371 int LyXRC::read(Lexer & lexrc)
376 while (lexrc.isOK()) {
377 // By using two switches we take advantage of the compiler
378 // telling us if we have missed a LyXRCTags element in
379 // the second switch.
380 // Note that this also shows a problem with Lexer since it
381 // helps us avoid taking advantage of the strictness of the
384 int le = lexrc.lex();
386 case Lexer::LEX_UNDEF:
387 lexrc.printError("Unknown tag `$$Token'");
389 case Lexer::LEX_FEOF:
394 switch (static_cast<LyXRCTags>(le)) {
395 case RC_INPUT: // Include file
398 libFileSearch(string(),
401 lexrc.printError("Error reading "
402 "included file: " + tmp.absFilename());
408 bind_file = os::internal_path(lexrc.getString());
413 def_file = os::internal_path(lexrc.getString());
418 ui_file = os::internal_path(lexrc.getString());
421 case RC_AUTORESET_OPTIONS:
422 lexrc >> auto_reset_options;
425 case RC_DISPLAY_GRAPHICS:
427 display_graphics = lexrc.getString() == "true";
430 case RC_TEX_EXPECTS_WINDOWS_PATHS:
431 lexrc >> windows_style_tex_paths;
434 case RC_TEX_ALLOWS_SPACES:
435 lexrc >> tex_allows_spaces;
442 case RC_KBMAP_PRIMARY:
444 string const kmap(os::internal_path(lexrc.getString()));
447 } else if (!libFileSearch("kbd", kmap,
449 primary_kbmap = kmap;
451 lexrc.printError("LyX: Keymap `$$Token' not found");
456 case RC_KBMAP_SECONDARY:
458 string const kmap(os::internal_path(lexrc.getString()));
461 } else if (!libFileSearch("kbd", kmap,
463 secondary_kbmap = kmap;
465 lexrc.printError("LyX: Keymap `$$Token' not found");
470 case RC_FONT_ENCODING:
478 case RC_PRINT_COMMAND:
479 if (lexrc.next(true)) {
480 print_command = lexrc.getString();
484 case RC_PRINTEVENPAGEFLAG:
485 lexrc >> print_evenpage_flag;
488 case RC_PRINTODDPAGEFLAG:
489 lexrc >> print_oddpage_flag;
492 case RC_PRINTPAGERANGEFLAG:
493 lexrc >> print_pagerange_flag;
496 case RC_PRINTCOPIESFLAG:
497 lexrc >> print_copies_flag;
500 case RC_PRINTCOLLCOPIESFLAG:
501 lexrc >> print_collcopies_flag;
504 case RC_PRINTREVERSEFLAG:
505 lexrc >> print_reverse_flag;
508 case RC_PRINTLANDSCAPEFLAG:
509 lexrc >> print_landscape_flag;
512 case RC_PRINTTOPRINTER:
513 lexrc >> print_to_printer;
516 case RC_PRINT_ADAPTOUTPUT:
517 lexrc >> print_adapt_output;
522 print_to_file = os::internal_path(lexrc.getString());
526 case RC_PRINTFILEEXTENSION:
527 lexrc >> print_file_extension;
530 case RC_PRINTEXSTRAOPTIONS:
531 lexrc >> print_extra_options;
534 case RC_PRINTSPOOL_COMMAND:
535 if (lexrc.next(true)) {
536 print_spool_command = lexrc.getString();
540 case RC_PRINTSPOOL_PRINTERPREFIX:
541 lexrc >> print_spool_printerprefix;
544 case RC_PRINTPAPERDIMENSIONFLAG:
545 lexrc >> print_paper_dimension_flag;
548 case RC_PRINTPAPERFLAG:
549 lexrc >> print_paper_flag;
552 case RC_CUSTOM_EXPORT_COMMAND:
553 lexrc >> custom_export_command;
556 case RC_CUSTOM_EXPORT_FORMAT:
557 lexrc >> custom_export_format;
560 case RC_DEFAULT_PAPERSIZE:
562 string const size = ascii_lowercase(lexrc.getString());
563 if (size == "usletter")
564 default_papersize = PAPER_USLETTER;
565 else if (size == "legal")
566 default_papersize = PAPER_USLEGAL;
567 else if (size == "executive")
568 default_papersize = PAPER_USEXECUTIVE;
569 else if (size == "a3")
570 default_papersize = PAPER_A3;
571 else if (size == "a4")
572 default_papersize = PAPER_A4;
573 else if (size == "a5")
574 default_papersize = PAPER_A5;
575 else if (size == "b5")
576 default_papersize = PAPER_B5;
577 else if (size == "default")
578 default_papersize = PAPER_DEFAULT;
582 case RC_VIEWDVI_PAPEROPTION:
584 view_dvi_paper_option = lexrc.getString();
586 view_dvi_paper_option.erase();
589 case RC_CHKTEX_COMMAND:
590 if (lexrc.next(true)) {
591 chktex_command = lexrc.getString();
595 case RC_BIBTEX_COMMAND:
596 if (lexrc.next(true)) {
597 bibtex_command = lexrc.getString();
601 case RC_INDEX_COMMAND:
602 if (lexrc.next(true)) {
603 index_command = lexrc.getString();
607 case RC_NOMENCL_COMMAND:
608 if (lexrc.next(true)) {
609 nomencl_command = lexrc.getString();
621 case RC_GEOMETRY_SESSION:
622 lexrc >> allow_geometry_session;
625 case RC_SCREEN_FONT_SIZES:
626 lexrc >> font_sizes[FONT_SIZE_TINY];
627 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
628 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
629 lexrc >> font_sizes[FONT_SIZE_SMALL];
630 lexrc >> font_sizes[FONT_SIZE_NORMAL];
631 lexrc >> font_sizes[FONT_SIZE_LARGE];
632 lexrc >> font_sizes[FONT_SIZE_LARGER];
633 lexrc >> font_sizes[FONT_SIZE_LARGEST];
634 lexrc >> font_sizes[FONT_SIZE_HUGE];
635 lexrc >> font_sizes[FONT_SIZE_HUGER];
638 case RC_SCREEN_FONT_SCALABLE:
639 lexrc >> use_scalable_fonts;
646 case RC_DOCUMENTPATH:
648 document_path = os::internal_path(lexrc.getString());
649 document_path = expandPath(document_path);
655 example_path = os::internal_path(lexrc.getString());
656 example_path = expandPath(example_path);
660 case RC_TEMPLATEPATH:
662 template_path = os::internal_path(lexrc.getString());
663 template_path = expandPath(template_path);
669 tempdir_path = os::internal_path(lexrc.getString());
670 tempdir_path = expandPath(tempdir_path);
674 case RC_THESAURUSDIRPATH:
676 thesaurusdir_path = os::internal_path(lexrc.getString());
677 thesaurusdir_path = expandPath(thesaurusdir_path);
683 LYXERR0("Ignoring obsolete use_tempdir flag.");
686 case RC_USELASTFILEPOS:
687 lexrc >> use_lastfilepos;
691 lexrc >> load_session;
694 case RC_MOUSE_WHEEL_SPEED:
695 lexrc >> mouse_wheel_speed;
698 case RC_COMPLETION_INLINE_DELAY:
699 lexrc >> completion_inline_delay;
702 case RC_COMPLETION_INLINE_MATH:
703 lexrc >> completion_inline_math;
706 case RC_COMPLETION_INLINE_TEXT:
707 lexrc >> completion_inline_text;
710 case RC_COMPLETION_INLINE_DOTS:
711 lexrc >> completion_inline_dots;
714 case RC_COMPLETION_POPUP_DELAY:
715 lexrc >> completion_popup_delay;
718 case RC_COMPLETION_POPUP_MATH:
719 lexrc >> completion_popup_math;
722 case RC_COMPLETION_POPUP_TEXT:
723 lexrc >> completion_popup_text;
726 case RC_COMPLETION_CURSOR_TEXT:
727 lexrc >> completion_cursor_text;
730 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
731 lexrc >> completion_popup_after_complete;
734 case RC_NUMLASTFILES:
735 lexrc >> num_lastfiles;
738 case RC_CHECKLASTFILES:
739 lexrc >> check_lastfiles;
742 case RC_SCREEN_FONT_ROMAN:
744 roman_font_name = lexrc.getString();
745 oldFontFormat(roman_font_name,
750 case RC_SCREEN_FONT_SANS:
752 sans_font_name = lexrc.getString();
753 oldFontFormat(sans_font_name, sans_font_foundry);
757 case RC_SCREEN_FONT_TYPEWRITER:
759 typewriter_font_name = lexrc.getString();
760 oldFontFormat(typewriter_font_name,
761 typewriter_font_foundry);
765 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
766 lexrc >> roman_font_foundry;
769 case RC_SCREEN_FONT_SANS_FOUNDRY:
770 lexrc >> sans_font_foundry;
773 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
774 lexrc >> typewriter_font_foundry;
779 lexrc.printError("Missing color tag.");
782 string lyx_name = lexrc.getString();
785 lexrc.printError("Missing color name for color: `$$Token'");
788 string x11_name = lexrc.getString();
790 ColorCode const col =
791 lcolor.getFromLyXName(lyx_name);
792 if (col == Color_none ||
793 col == Color_inherit ||
797 if (!lcolor.setColor(col, x11_name))
798 LYXERR0("Bad lyxrc set_color for " << lyx_name);
802 case RC_AUTOREGIONDELETE:
803 // Auto region delete defaults to true
804 lexrc >> auto_region_delete;
809 lyxpipes = os::internal_path(lexrc.getString());
810 lyxpipes = expandPath(lyxpipes);
814 case RC_CURSOR_FOLLOWS_SCROLLBAR:
815 lexrc >> cursor_follows_scrollbar;
818 case RC_MAC_LIKE_WORD_MOVEMENT:
819 lexrc >> mac_like_word_movement;
822 case RC_MACRO_EDIT_STYLE:
824 switch (lexrc.getInteger()) {
825 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
826 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
827 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
832 case RC_DIALOGS_ICONIFY_WITH_MAIN:
833 lexrc >> dialogs_iconify_with_main;
836 case RC_PLAINTEXT_ROFF_COMMAND:
837 (void) lexrc.getString(); // Obsoleted in 2.0
839 case RC_PLAINTEXT_LINELEN:
840 lexrc >> plaintext_linelen;
842 // Spellchecker settings:
843 case RC_ACCEPT_COMPOUND:
844 lexrc >> spellchecker_accept_compound;
847 lexrc >> spellchecker_use_input_encoding;
849 case RC_USE_ALT_LANG:
850 lexrc >> spellchecker_use_alt_lang;
852 case RC_USE_PERS_DICT:
853 lexrc >> spellchecker_use_pers_dict;
856 lexrc >> use_tooltip;
858 case RC_USE_PIXMAP_CACHE:
859 lexrc >> use_pixmap_cache;
861 case RC_USE_ESC_CHARS:
862 lexrc >> spellchecker_use_esc_chars;
865 lexrc >> spellchecker_alt_lang;
869 spellchecker_pers_dict = os::internal_path(lexrc.getString());
872 lexrc >> spellchecker_esc_chars;
875 lexrc >> make_backup;
877 case RC_BACKUPDIR_PATH:
879 backupdir_path = os::internal_path(lexrc.getString());
880 backupdir_path = expandPath(backupdir_path);
883 case RC_DATE_INSERT_FORMAT:
884 lexrc >> date_insert_format;
886 case RC_LANGUAGE_PACKAGE:
887 lexrc >> language_package;
889 case RC_LANGUAGE_AUTO_BEGIN:
890 lexrc >> language_auto_begin;
892 case RC_LANGUAGE_AUTO_END:
893 lexrc >> language_auto_end;
895 case RC_LANGUAGE_GLOBAL_OPTIONS:
896 lexrc >> language_global_options;
898 case RC_LANGUAGE_USE_BABEL:
899 lexrc >> language_use_babel;
901 case RC_LANGUAGE_COMMAND_BEGIN:
902 lexrc >> language_command_begin;
904 case RC_LANGUAGE_COMMAND_END:
905 lexrc >> language_command_end;
907 case RC_LANGUAGE_COMMAND_LOCAL:
908 lexrc >> language_command_local;
911 lexrc >> rtl_support;
913 case RC_VISUAL_CURSOR:
914 lexrc >> visual_cursor;
917 lexrc >> auto_number;
919 case RC_MARK_FOREIGN_LANGUAGE:
920 lexrc >> mark_foreign_language;
926 fmt = lexrc.getString();
927 if (lexrc.next(true))
928 command = lexrc.getString();
929 setMover(fmt, command);
934 string from, to, command, flags;
936 from = lexrc.getString();
938 to = lexrc.getString();
939 if (lexrc.next(true))
940 command = lexrc.getString();
942 flags = lexrc.getString();
944 theConverters().erase(from, to);
946 theConverters().add(from, to, command, flags);
949 // compatibility with versions older than 1.4.0 only
951 string format, command;
952 lexrc >> format >> command;
953 formats.setViewer(format, command);
957 string format, extension, prettyname, shortcut;
958 lexrc >> format >> extension >> prettyname >> shortcut;
959 string viewer, editor;
960 if (lexrc.next(true))
961 viewer = lexrc.getString();
962 if (lexrc.next(true))
963 editor = lexrc.getString();
965 // Hack to ensure compatibility with versions older
967 int le = lexrc.lex();
968 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
969 flags = lexrc.getString();
970 if (le != Lexer::LEX_DATA) {
971 // We have got a known token.
972 // Therefore this is an old style
973 // format definition without
975 lexrc.pushToken(flags);
979 int flgs = Format::none;
980 while (!flags.empty()) {
982 flags = split(flags, flag, ',');
983 if (flag == "document")
984 flgs |= Format::document;
985 else if (flag == "vector")
986 flgs |= Format::vector;
988 LYXERR0("Ignoring unknown flag `"
989 << flag << "' for format `"
992 if (prettyname.empty()) {
993 if (theConverters().formatIsUsed(format))
994 LYXERR0("Can't delete format " << format);
996 formats.erase(format);
998 formats.add(format, extension, prettyname,
999 shortcut, viewer, editor, flgs);
1003 case RC_DEFAULT_LANGUAGE:
1004 lexrc >> default_language;
1007 case RC_GUI_LANGUAGE:
1008 lexrc >> gui_language;
1011 case RC_LABEL_INIT_LENGTH:
1012 lexrc >> label_init_length;
1015 case RC_SHOW_BANNER:
1016 lexrc >> show_banner;
1021 string const tmp = lexrc.getString();
1022 if (tmp == "true" || tmp == "on")
1023 preview = PREVIEW_ON;
1024 else if (tmp == "no_math")
1025 preview = PREVIEW_NO_MATH;
1027 preview = PREVIEW_OFF;
1028 if (tmp != "false" && tmp != "off")
1029 LYXERR0("Unrecognized preview status \""
1035 case RC_PREVIEW_HASHED_LABELS:
1036 lexrc >> preview_hashed_labels;
1039 case RC_PREVIEW_SCALE_FACTOR:
1040 lexrc >> preview_scale_factor;
1047 lexrc >> user_email;
1050 case RC_PATH_PREFIX:
1051 lexrc >> path_prefix;
1054 case RC_USE_CONVERTER_CACHE:
1055 lexrc >> use_converter_cache;
1057 case RC_CONVERTER_CACHE_MAXAGE:
1058 lexrc >> converter_cache_maxage;
1061 case RC_SORT_LAYOUTS:
1062 lexrc >> sort_layouts;
1064 case RC_GROUP_LAYOUTS:
1065 lexrc >> group_layouts;
1067 case RC_FULL_SCREEN_LIMIT:
1068 lexrc >> full_screen_limit;
1070 case RC_FULL_SCREEN_TOOLBARS:
1071 lexrc >> full_screen_toolbars;
1073 case RC_FULL_SCREEN_SCROLLBAR:
1074 lexrc >> full_screen_scrollbar;
1076 case RC_FULL_SCREEN_TABBAR:
1077 lexrc >> full_screen_tabbar;
1079 case RC_FULL_SCREEN_WIDTH:
1080 lexrc >> full_screen_width;
1082 case RC_OPEN_BUFFERS_IN_TABS:
1083 lexrc >> open_buffers_in_tabs;
1087 case RC_SPELL_COMMAND:
1088 case RC_USE_SPELL_LIB:
1089 (void) lexrc.getString();
1093 break; // this is just a dummy
1097 /// Update converters data-structures
1098 theConverters().update(formats);
1099 theConverters().buildGraph();
1105 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1107 ofstream ofs(filename.toFilesystemEncoding().c_str());
1109 write(ofs, ignore_system_lyxrc);
1113 void LyXRC::print() const
1115 if (lyxerr.debugging())
1116 write(lyxerr, false);
1124 typedef pair<string, SpecialisedMover> Data;
1126 SameMover(Data const & comparison)
1127 : comparison_(comparison) {}
1129 bool operator()(Data const & data) const
1131 return data.first == comparison_.first &&
1132 data.second.command() == comparison_.second.command();
1142 // Escape \ and " so that LyXLex can read the string later
1143 string escapeCommand(string const & str) {
1144 return subst(subst(str , "\\", "\\\\"),
1151 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1153 LyXRCTags tag = RC_LAST;
1155 if (!name.empty()) {
1156 for (int i = 0; i != lyxrcCount; ++i)
1157 if ("\\" + name == lyxrcTags[i].tag)
1158 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1162 os << "# LyX " << lyx_version
1163 << " generated this file. If you want to make your own\n"
1164 << "# modifications you should do them from inside LyX and save.\n"
1167 // Why the switch you might ask. It is a trick to ensure that all
1168 // the elements in the LyXRCTags enum are handled. As you can see
1169 // there are no breaks at all. So it is just a huge fall-through.
1170 // The nice thing is that we will get a warning from the compiler
1171 // if we forget an element.
1175 // input/include files are not done here
1177 if (ignore_system_lyxrc ||
1178 bind_file != system_lyxrc.bind_file) {
1179 string const path = os::external_path(bind_file);
1180 os << "\\bind_file \"" << path << "\"\n";
1186 if (ignore_system_lyxrc ||
1187 def_file != system_lyxrc.def_file) {
1188 string const path = os::external_path(def_file);
1189 os << "\\def_file \"" << path << "\"\n";
1198 << "# MISC SECTION ######################################\n"
1200 // bind files are not done here.
1202 case RC_PATH_PREFIX:
1203 if (ignore_system_lyxrc ||
1204 path_prefix != system_lyxrc.path_prefix) {
1205 os << "\\path_prefix \"" << path_prefix << "\"\n";
1210 if (ignore_system_lyxrc ||
1211 ui_file != system_lyxrc.ui_file) {
1212 string const path = os::external_path(ui_file);
1213 os << "\\ui_file \"" << path << "\"\n";
1217 case RC_AUTOREGIONDELETE:
1218 if (ignore_system_lyxrc ||
1219 auto_region_delete != system_lyxrc.auto_region_delete) {
1220 os << "# Set to false to inhibit automatic replacement of\n"
1221 << "# the current selection.\n"
1222 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1227 case RC_AUTORESET_OPTIONS:
1228 if (ignore_system_lyxrc ||
1229 auto_reset_options != system_lyxrc.auto_reset_options) {
1230 os << "# Set to false to inhibit automatic reset of\n"
1231 << "# the class options to defaults on class change.\n"
1232 << "\\auto_reset_options "
1233 << convert<string>(auto_reset_options)
1239 if (ignore_system_lyxrc ||
1240 autosave != system_lyxrc.autosave) {
1241 os << "# The time interval between auto-saves in seconds.\n"
1242 << "\\autosave " << autosave << '\n';
1246 case RC_DISPLAY_GRAPHICS:
1247 if (ignore_system_lyxrc ||
1248 display_graphics != system_lyxrc.display_graphics) {
1249 os << "# Display graphics within LyX\n"
1251 << "\\display_graphics "
1252 << (display_graphics ? "true" : "false")
1257 case RC_SORT_LAYOUTS:
1258 if (ignore_system_lyxrc ||
1259 sort_layouts != system_lyxrc.sort_layouts) {
1260 os << "# Sort layouts alphabetically.\n"
1261 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1265 case RC_GROUP_LAYOUTS:
1266 if (ignore_system_lyxrc ||
1267 group_layouts != system_lyxrc.group_layouts) {
1268 os << "# Group layouts by their category.\n"
1269 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1273 case RC_VIEWDVI_PAPEROPTION:
1274 if (ignore_system_lyxrc ||
1275 view_dvi_paper_option
1276 != system_lyxrc.view_dvi_paper_option) {
1277 os << "# Options used to specify paper size to the\n"
1278 << "# view_dvi_command (e.g. -paper)\n"
1279 << "\\view_dvi_paper_option \""
1280 << view_dvi_paper_option << "\"\n";
1284 case RC_DEFAULT_PAPERSIZE:
1285 if (ignore_system_lyxrc ||
1286 default_papersize != system_lyxrc.default_papersize) {
1287 os << "# The default papersize to use.\n"
1288 << "\\default_papersize \"";
1289 switch (default_papersize) {
1291 os << "default"; break;
1292 case PAPER_USLETTER:
1293 os << "usletter"; break;
1295 os << "legal"; break;
1296 case PAPER_USEXECUTIVE:
1297 os << "executive"; break;
1308 case PAPER_B4: break;
1314 case RC_CHKTEX_COMMAND:
1315 if (ignore_system_lyxrc ||
1316 chktex_command != system_lyxrc.chktex_command) {
1317 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1321 case RC_BIBTEX_COMMAND:
1322 if (ignore_system_lyxrc ||
1323 bibtex_command != system_lyxrc.bibtex_command) {
1324 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1328 case RC_INDEX_COMMAND:
1329 if (ignore_system_lyxrc ||
1330 index_command != system_lyxrc.index_command) {
1331 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1335 case RC_NOMENCL_COMMAND:
1336 if (ignore_system_lyxrc ||
1337 nomencl_command != system_lyxrc.nomencl_command) {
1338 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1342 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1343 if (ignore_system_lyxrc ||
1344 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1345 os << "\\tex_expects_windows_paths "
1346 << convert<string>(windows_style_tex_paths) << '\n';
1350 case RC_TEX_ALLOWS_SPACES:
1351 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1352 os << "\\tex_allows_spaces "
1353 << convert<string>(tex_allows_spaces) << '\n';
1358 if (ignore_system_lyxrc ||
1359 use_kbmap != system_lyxrc.use_kbmap) {
1360 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1364 case RC_KBMAP_PRIMARY:
1365 if (ignore_system_lyxrc ||
1366 primary_kbmap != system_lyxrc.primary_kbmap) {
1367 string const path = os::external_path(primary_kbmap);
1368 os << "\\kbmap_primary \"" << path << "\"\n";
1372 case RC_KBMAP_SECONDARY:
1373 if (ignore_system_lyxrc ||
1374 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1375 string const path = os::external_path(secondary_kbmap);
1376 os << "\\kbmap_secondary \"" << path << "\"\n";
1381 if (ignore_system_lyxrc ||
1382 lyxpipes != system_lyxrc.lyxpipes) {
1383 string const path = os::external_path(lyxpipes);
1384 os << "\\serverpipe \"" << path << "\"\n";
1388 case RC_DATE_INSERT_FORMAT:
1389 if (ignore_system_lyxrc ||
1390 date_insert_format != system_lyxrc.date_insert_format) {
1391 os << "\\date_insert_format \"" << date_insert_format
1396 case RC_LABEL_INIT_LENGTH:
1397 if (ignore_system_lyxrc ||
1398 label_init_length != system_lyxrc.label_init_length) {
1399 os << "\\label_init_length " << label_init_length
1406 os << "\\user_name \"" << user_name << "\"\n";
1411 os << "\\user_email \"" << user_email << "\"\n";
1415 case RC_SHOW_BANNER:
1416 if (ignore_system_lyxrc ||
1417 show_banner != system_lyxrc.show_banner) {
1418 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1424 if (ignore_system_lyxrc ||
1425 preview != system_lyxrc.preview) {
1431 case PREVIEW_NO_MATH:
1438 os << "\\preview " << status << '\n';
1443 case RC_PREVIEW_HASHED_LABELS:
1444 if (ignore_system_lyxrc ||
1445 preview_hashed_labels !=
1446 system_lyxrc.preview_hashed_labels) {
1447 os << "\\preview_hashed_labels "
1448 << convert<string>(preview_hashed_labels) << '\n';
1453 case RC_PREVIEW_SCALE_FACTOR:
1454 if (ignore_system_lyxrc ||
1455 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1456 os << "\\preview_scale_factor "
1457 << preview_scale_factor << '\n';
1462 case RC_USE_CONVERTER_CACHE:
1463 if (ignore_system_lyxrc ||
1464 use_converter_cache != system_lyxrc.use_converter_cache) {
1465 os << "\\use_converter_cache "
1466 << convert<string>(use_converter_cache) << '\n';
1471 case RC_CONVERTER_CACHE_MAXAGE:
1472 if (ignore_system_lyxrc ||
1473 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1474 os << "\\converter_cache_maxage "
1475 << converter_cache_maxage << '\n';
1481 << "# SCREEN & FONTS SECTION ############################\n"
1485 if (ignore_system_lyxrc ||
1486 dpi != system_lyxrc.dpi) {
1487 os << "\\screen_dpi " << dpi << '\n';
1491 case RC_SCREEN_ZOOM:
1492 if (ignore_system_lyxrc ||
1493 zoom != system_lyxrc.zoom) {
1494 os << "\\screen_zoom " << zoom << '\n';
1498 case RC_GEOMETRY_SESSION:
1499 if (ignore_system_lyxrc ||
1500 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1501 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1506 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1507 if (ignore_system_lyxrc ||
1508 cursor_follows_scrollbar
1509 != system_lyxrc.cursor_follows_scrollbar) {
1510 os << "\\cursor_follows_scrollbar "
1511 << convert<string>(cursor_follows_scrollbar) << '\n';
1515 case RC_MAC_LIKE_WORD_MOVEMENT:
1516 if (ignore_system_lyxrc ||
1517 mac_like_word_movement
1518 != system_lyxrc.mac_like_word_movement) {
1519 os << "\\mac_like_word_movement "
1520 << convert<string>(mac_like_word_movement) << '\n';
1524 case RC_MACRO_EDIT_STYLE:
1525 if (ignore_system_lyxrc ||
1527 != system_lyxrc.macro_edit_style) {
1528 os << "\\macro_edit_style ";
1529 switch (macro_edit_style) {
1530 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1531 case MACRO_EDIT_INLINE: os << "1\n"; break;
1532 case MACRO_EDIT_LIST: os << "2\n"; break;
1537 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1538 if (ignore_system_lyxrc ||
1539 dialogs_iconify_with_main
1540 != system_lyxrc.dialogs_iconify_with_main) {
1541 os << "\\dialogs_iconify_with_main "
1542 << convert<string>(dialogs_iconify_with_main) << '\n';
1546 case RC_SCREEN_FONT_ROMAN:
1547 if (ignore_system_lyxrc ||
1548 roman_font_name != system_lyxrc.roman_font_name) {
1549 os << "\\screen_font_roman \"" << roman_font_name
1554 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1555 if (ignore_system_lyxrc ||
1556 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1557 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1562 case RC_SCREEN_FONT_SANS:
1563 if (ignore_system_lyxrc ||
1564 sans_font_name != system_lyxrc.sans_font_name) {
1565 os << "\\screen_font_sans \"" << sans_font_name
1570 case RC_SCREEN_FONT_SANS_FOUNDRY:
1571 if (ignore_system_lyxrc ||
1572 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1573 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1578 case RC_SCREEN_FONT_TYPEWRITER:
1579 if (ignore_system_lyxrc ||
1580 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1581 os << "\\screen_font_typewriter \""
1582 << typewriter_font_name << "\"\n";
1586 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1587 if (ignore_system_lyxrc ||
1588 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1589 os << "\\screen_font_typewriter_foundry \""
1590 << typewriter_font_foundry << "\"\n";
1595 case RC_SCREEN_FONT_SCALABLE:
1596 if (ignore_system_lyxrc ||
1597 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1598 os << "\\screen_font_scalable "
1599 << convert<string>(use_scalable_fonts)
1604 case RC_SCREEN_FONT_SIZES:
1605 if (ignore_system_lyxrc ||
1606 font_sizes[FONT_SIZE_TINY]
1607 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1608 font_sizes[FONT_SIZE_SCRIPT]
1609 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1610 font_sizes[FONT_SIZE_FOOTNOTE]
1611 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1612 font_sizes[FONT_SIZE_SMALL]
1613 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1614 font_sizes[FONT_SIZE_NORMAL]
1615 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1616 font_sizes[FONT_SIZE_LARGE]
1617 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1618 font_sizes[FONT_SIZE_LARGER]
1619 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1620 font_sizes[FONT_SIZE_LARGEST]
1621 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1622 font_sizes[FONT_SIZE_HUGE]
1623 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1624 font_sizes[FONT_SIZE_HUGER]
1625 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1626 os.setf(ios::fixed);
1628 os << "\\screen_font_sizes"
1629 << ' ' << font_sizes[FONT_SIZE_TINY]
1630 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1631 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1632 << ' ' << font_sizes[FONT_SIZE_SMALL]
1633 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1634 << ' ' << font_sizes[FONT_SIZE_LARGE]
1635 << ' ' << font_sizes[FONT_SIZE_LARGER]
1636 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1637 << ' ' << font_sizes[FONT_SIZE_HUGE]
1638 << ' ' << font_sizes[FONT_SIZE_HUGER]
1643 case RC_FULL_SCREEN_LIMIT:
1644 if (ignore_system_lyxrc ||
1645 full_screen_limit != system_lyxrc.full_screen_limit) {
1646 os << "\\fullscreen_limit "
1647 << convert<string>(full_screen_limit)
1652 case RC_FULL_SCREEN_TOOLBARS:
1653 if (ignore_system_lyxrc ||
1654 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1655 os << "\\fullscreen_toolbars "
1656 << convert<string>(full_screen_toolbars)
1661 case RC_FULL_SCREEN_SCROLLBAR:
1662 if (ignore_system_lyxrc ||
1663 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1664 os << "\\fullscreen_scrollbar "
1665 << convert<string>(full_screen_scrollbar)
1670 case RC_FULL_SCREEN_TABBAR:
1671 if (ignore_system_lyxrc ||
1672 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1673 os << "\\fullscreen_tabbar "
1674 << convert<string>(full_screen_tabbar)
1679 case RC_FULL_SCREEN_WIDTH:
1680 if (ignore_system_lyxrc ||
1681 full_screen_width != system_lyxrc.full_screen_width) {
1682 os << "\\fullscreen_width "
1683 << convert<string>(full_screen_width)
1688 case RC_OPEN_BUFFERS_IN_TABS:
1689 if (ignore_system_lyxrc ||
1690 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1691 os << "\\open_buffers_in_tabs "
1692 << convert<string>(open_buffers_in_tabs)
1699 << "# COLOR SECTION ###################################\n"
1703 for (int i = 0; i < Color_ignore; ++i) {
1704 ColorCode lc = static_cast<ColorCode>(i);
1705 string const col = lcolor.getX11Name(lc);
1706 if (ignore_system_lyxrc
1707 || col != system_lcolor.getX11Name(lc)) {
1708 os << "\\set_color \""
1709 << lcolor.getLyXName(lc) << "\" \""
1717 << "# PRINTER SECTION ###################################\n"
1721 if (ignore_system_lyxrc ||
1722 printer != system_lyxrc.printer) {
1723 os << "\\printer \"" << printer << "\"\n";
1727 case RC_PRINT_ADAPTOUTPUT:
1728 if (ignore_system_lyxrc ||
1729 print_adapt_output != system_lyxrc.print_adapt_output) {
1730 os << "\\print_adapt_output "
1731 << convert<string>(print_adapt_output)
1736 case RC_PRINT_COMMAND:
1737 if (ignore_system_lyxrc ||
1738 print_command != system_lyxrc.print_command) {
1739 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1743 case RC_PRINTEXSTRAOPTIONS:
1744 if (ignore_system_lyxrc ||
1745 print_extra_options != system_lyxrc.print_extra_options) {
1746 os << "\\print_extra_options \"" << print_extra_options
1751 case RC_PRINTSPOOL_COMMAND:
1752 if (ignore_system_lyxrc ||
1753 print_spool_command != system_lyxrc.print_spool_command) {
1754 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1759 case RC_PRINTSPOOL_PRINTERPREFIX:
1760 if (ignore_system_lyxrc ||
1761 print_spool_printerprefix
1762 != system_lyxrc.print_spool_printerprefix) {
1763 os << "\\print_spool_printerprefix \""
1764 << print_spool_printerprefix << "\"\n";
1768 case RC_PRINTEVENPAGEFLAG:
1769 if (ignore_system_lyxrc ||
1770 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1771 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1776 case RC_PRINTODDPAGEFLAG:
1777 if (ignore_system_lyxrc ||
1778 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1779 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1784 case RC_PRINTREVERSEFLAG:
1785 if (ignore_system_lyxrc ||
1786 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1787 os << "\\print_reverse_flag \"" << print_reverse_flag
1792 case RC_PRINTLANDSCAPEFLAG:
1793 if (ignore_system_lyxrc ||
1794 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1795 os << "\\print_landscape_flag \"" << print_landscape_flag
1800 case RC_PRINTPAGERANGEFLAG:
1801 if (ignore_system_lyxrc ||
1802 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1803 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1808 case RC_PRINTCOPIESFLAG:
1809 if (ignore_system_lyxrc ||
1810 print_copies_flag != system_lyxrc.print_copies_flag) {
1811 os << "\\print_copies_flag \"" << print_copies_flag
1816 case RC_PRINTCOLLCOPIESFLAG:
1817 if (ignore_system_lyxrc ||
1818 print_collcopies_flag
1819 != system_lyxrc.print_collcopies_flag) {
1820 os << "\\print_collcopies_flag \""
1821 << print_collcopies_flag
1826 case RC_PRINTPAPERFLAG:
1827 if (ignore_system_lyxrc ||
1828 print_paper_flag != system_lyxrc.print_paper_flag) {
1829 os << "\\print_paper_flag \"" << print_paper_flag
1834 case RC_PRINTPAPERDIMENSIONFLAG:
1835 if (ignore_system_lyxrc ||
1836 print_paper_dimension_flag
1837 != system_lyxrc.print_paper_dimension_flag) {
1838 os << "\\print_paper_dimension_flag \""
1839 << print_paper_dimension_flag << "\"\n";
1843 case RC_PRINTTOPRINTER:
1844 if (ignore_system_lyxrc ||
1845 print_to_printer != system_lyxrc.print_to_printer) {
1846 os << "\\print_to_printer \"" << print_to_printer
1851 case RC_PRINTTOFILE:
1852 if (ignore_system_lyxrc ||
1853 print_to_file != system_lyxrc.print_to_file) {
1854 string const path = os::external_path(print_to_file);
1855 os << "\\print_to_file \"" << path << "\"\n";
1859 case RC_PRINTFILEEXTENSION:
1860 if (ignore_system_lyxrc ||
1861 print_file_extension != system_lyxrc.print_file_extension) {
1862 os << "\\print_file_extension \""
1863 << print_file_extension
1870 << "# EXPORT SECTION ####################################\n"
1873 case RC_CUSTOM_EXPORT_COMMAND:
1874 if (ignore_system_lyxrc ||
1875 custom_export_command
1876 != system_lyxrc.custom_export_command) {
1877 os << "\\custom_export_command \""
1878 << custom_export_command
1883 case RC_CUSTOM_EXPORT_FORMAT:
1884 if (ignore_system_lyxrc ||
1885 custom_export_format
1886 != system_lyxrc.custom_export_format) {
1887 os << "\\custom_export_format \"" << custom_export_format
1894 << "# TEX SECTION #######################################\n"
1897 case RC_FONT_ENCODING:
1898 if (ignore_system_lyxrc ||
1899 fontenc != system_lyxrc.fontenc) {
1900 os << "\\font_encoding \"" << fontenc << "\"\n";
1906 << "# FILE SECTION ######################################\n"
1909 case RC_DOCUMENTPATH:
1910 if (ignore_system_lyxrc ||
1911 document_path != system_lyxrc.document_path) {
1912 string const path = os::external_path(document_path);
1913 os << "\\document_path \"" << path << "\"\n";
1917 case RC_USELASTFILEPOS:
1918 if (ignore_system_lyxrc ||
1919 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1920 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1925 case RC_LOADSESSION:
1926 if (ignore_system_lyxrc ||
1927 load_session != system_lyxrc.load_session) {
1928 os << "\\load_session " << convert<string>(load_session)
1933 case RC_MOUSE_WHEEL_SPEED:
1934 if (ignore_system_lyxrc ||
1935 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1936 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1940 case RC_COMPLETION_INLINE_DELAY:
1941 if (ignore_system_lyxrc ||
1942 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1943 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1947 case RC_COMPLETION_INLINE_MATH:
1948 if (ignore_system_lyxrc ||
1949 completion_inline_math != system_lyxrc.completion_inline_math) {
1950 os << "\\completion_inline_math "
1951 << convert<string>(completion_inline_math) << '\n';
1955 case RC_COMPLETION_INLINE_TEXT:
1956 if (ignore_system_lyxrc ||
1957 completion_inline_text != system_lyxrc.completion_inline_text) {
1958 os << "\\completion_inline_text "
1959 << convert<string>(completion_inline_text) << '\n';
1963 case RC_COMPLETION_INLINE_DOTS:
1964 if (ignore_system_lyxrc ||
1965 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1966 os << "\\completion_inline_dots "
1967 << convert<string>(completion_inline_dots) << '\n';
1971 case RC_COMPLETION_POPUP_DELAY:
1972 if (ignore_system_lyxrc ||
1973 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1974 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1978 case RC_COMPLETION_POPUP_MATH:
1979 if (ignore_system_lyxrc ||
1980 completion_popup_math != system_lyxrc.completion_popup_math) {
1981 os << "\\completion_popup_math "
1982 << convert<string>(completion_popup_math) << '\n';
1986 case RC_COMPLETION_POPUP_TEXT:
1987 if (ignore_system_lyxrc ||
1988 completion_popup_text != system_lyxrc.completion_popup_text) {
1989 os << "\\completion_popup_text "
1990 << convert<string>(completion_popup_text) << '\n';
1994 case RC_COMPLETION_CURSOR_TEXT:
1995 if (ignore_system_lyxrc ||
1996 completion_cursor_text != system_lyxrc.completion_cursor_text) {
1997 os << "\\completion_cursor_text "
1998 << convert<string>(completion_cursor_text) << '\n';
2002 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2003 if (ignore_system_lyxrc ||
2004 completion_popup_after_complete
2005 != system_lyxrc.completion_popup_after_complete) {
2006 os << "\\completion_popup_after_complete "
2007 << convert<string>(completion_popup_after_complete) << '\n';
2011 case RC_NUMLASTFILES:
2012 if (ignore_system_lyxrc ||
2013 num_lastfiles != system_lyxrc.num_lastfiles) {
2014 os << "\\num_lastfiles " << num_lastfiles << '\n';
2018 case RC_CHECKLASTFILES:
2019 if (ignore_system_lyxrc ||
2020 check_lastfiles != system_lyxrc.check_lastfiles) {
2021 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2026 case RC_EXAMPLEPATH:
2027 if (ignore_system_lyxrc ||
2028 example_path != system_lyxrc.example_path) {
2029 string const path = os::external_path(example_path);
2030 os << "\\example_path \"" << path << "\"\n";
2034 case RC_TEMPLATEPATH:
2035 if (ignore_system_lyxrc ||
2036 template_path != system_lyxrc.template_path) {
2037 string const path = os::external_path(template_path);
2038 os << "\\template_path \"" << path << "\"\n";
2042 case RC_TEMPDIRPATH:
2043 if (ignore_system_lyxrc ||
2044 tempdir_path != system_lyxrc.tempdir_path) {
2045 string const path = os::external_path(tempdir_path);
2046 os << "\\tempdir_path \"" << path << "\"\n";
2050 case RC_THESAURUSDIRPATH:
2051 if (ignore_system_lyxrc ||
2052 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2053 string const path = os::external_path(thesaurusdir_path);
2054 os << "\\thesaurusdir_path \"" << path << "\"\n";
2062 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2065 case RC_PLAINTEXT_LINELEN:
2066 if (ignore_system_lyxrc ||
2067 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2068 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2072 case RC_MAKE_BACKUP:
2073 if (ignore_system_lyxrc ||
2074 make_backup != system_lyxrc.make_backup) {
2075 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2079 case RC_BACKUPDIR_PATH:
2080 if (ignore_system_lyxrc ||
2081 backupdir_path != system_lyxrc.backupdir_path) {
2082 string const path = os::external_path(backupdir_path);
2083 os << "\\backupdir_path \"" << path << "\"\n";
2089 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2093 << "# SPELLCHECKER SECTION ##############################\n"
2095 case RC_SPELL_COMMAND:
2096 case RC_USE_SPELL_LIB:
2100 case RC_ACCEPT_COMPOUND:
2101 if (ignore_system_lyxrc ||
2102 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2103 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2108 case RC_USE_ALT_LANG:
2109 if (ignore_system_lyxrc ||
2110 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2111 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2117 if (ignore_system_lyxrc ||
2118 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2119 os << "\\alternate_language \"" << spellchecker_alt_lang
2124 case RC_USE_ESC_CHARS:
2125 if (ignore_system_lyxrc ||
2126 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2127 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2133 if (ignore_system_lyxrc ||
2134 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2135 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2139 case RC_USE_PERS_DICT:
2140 if (ignore_system_lyxrc ||
2141 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2142 os << "\\use_personal_dictionary "
2143 << convert<string>(spellchecker_use_pers_dict)
2148 case RC_USE_TOOLTIP:
2149 if (ignore_system_lyxrc ||
2150 use_tooltip != system_lyxrc.use_tooltip) {
2151 os << "\\use_tooltip "
2152 << convert<string>(use_tooltip)
2155 case RC_USE_PIXMAP_CACHE:
2156 if (ignore_system_lyxrc ||
2157 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2158 os << "\\use_pixmap_cache "
2159 << convert<string>(use_pixmap_cache)
2163 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2164 string const path = os::external_path(spellchecker_pers_dict);
2165 os << "\\personal_dictionary \"" << path << "\"\n";
2169 case RC_USE_INP_ENC:
2170 if (ignore_system_lyxrc ||
2171 spellchecker_use_input_encoding
2172 != system_lyxrc.spellchecker_use_input_encoding) {
2173 os << "\\use_input_encoding "
2174 << convert<string>(spellchecker_use_input_encoding)
2181 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2184 case RC_RTL_SUPPORT:
2185 if (ignore_system_lyxrc ||
2186 rtl_support != system_lyxrc.rtl_support) {
2187 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2191 case RC_VISUAL_CURSOR:
2192 if (ignore_system_lyxrc ||
2193 visual_cursor != system_lyxrc.visual_cursor) {
2194 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2198 case RC_LANGUAGE_PACKAGE:
2199 if (ignore_system_lyxrc ||
2200 language_package != system_lyxrc.language_package) {
2201 os << "\\language_package \"" << language_package
2206 case RC_LANGUAGE_GLOBAL_OPTIONS:
2207 if (ignore_system_lyxrc ||
2208 language_global_options
2209 != system_lyxrc.language_global_options) {
2210 os << "\\language_global_options \""
2211 << convert<string>(language_global_options)
2216 case RC_LANGUAGE_USE_BABEL:
2217 if (ignore_system_lyxrc ||
2218 language_use_babel != system_lyxrc.language_use_babel) {
2219 os << "\\language_use_babel \""
2220 << convert<string>(language_use_babel)
2225 case RC_LANGUAGE_COMMAND_BEGIN:
2226 if (ignore_system_lyxrc ||
2227 language_command_begin
2228 != system_lyxrc.language_command_begin) {
2229 os << "\\language_command_begin \""
2230 << language_command_begin
2235 case RC_LANGUAGE_COMMAND_END:
2236 if (ignore_system_lyxrc ||
2237 language_command_end
2238 != system_lyxrc.language_command_end) {
2239 os << "\\language_command_end \"" << language_command_end
2244 case RC_LANGUAGE_COMMAND_LOCAL:
2245 if (ignore_system_lyxrc ||
2246 language_command_local
2247 != system_lyxrc.language_command_local) {
2248 os << "\\language_command_local \""
2249 << language_command_local
2254 case RC_LANGUAGE_AUTO_BEGIN:
2255 if (ignore_system_lyxrc ||
2256 language_auto_begin != system_lyxrc.language_auto_begin) {
2257 os << "\\language_auto_begin "
2258 << convert<string>(language_auto_begin) << '\n';
2262 case RC_LANGUAGE_AUTO_END:
2263 if (ignore_system_lyxrc ||
2264 language_auto_end != system_lyxrc.language_auto_end) {
2265 os << "\\language_auto_end "
2266 << convert<string>(language_auto_end) << '\n';
2270 case RC_MARK_FOREIGN_LANGUAGE:
2271 if (ignore_system_lyxrc ||
2272 mark_foreign_language
2273 != system_lyxrc.mark_foreign_language) {
2274 os << "\\mark_foreign_language " <<
2275 convert<string>(mark_foreign_language) << '\n';
2281 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2284 case RC_AUTO_NUMBER:
2285 if (ignore_system_lyxrc ||
2286 auto_number != system_lyxrc.auto_number) {
2287 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2291 case RC_DEFAULT_LANGUAGE:
2292 if (ignore_system_lyxrc ||
2293 default_language != system_lyxrc.default_language) {
2294 os << "\\default_language " << default_language << '\n';
2298 case RC_GUI_LANGUAGE:
2299 if (ignore_system_lyxrc ||
2300 gui_language != system_lyxrc.gui_language) {
2301 os << "\\gui_language " << gui_language << '\n';
2307 << "# FORMATS SECTION ##########################\n"
2311 // New/modified formats
2312 for (Formats::const_iterator cit = formats.begin();
2313 cit != formats.end(); ++cit) {
2314 Format const * format =
2315 system_formats.getFormat(cit->name());
2317 format->extension() != cit->extension() ||
2318 format->prettyname() != cit->prettyname() ||
2319 format->shortcut() != cit->shortcut() ||
2320 format->viewer() != cit->viewer() ||
2321 format->editor() != cit->editor() ||
2322 format->documentFormat() != cit->documentFormat() ||
2323 format->vectorFormat() != cit->vectorFormat()) {
2324 os << "\\format \"" << cit->name() << "\" \""
2325 << cit->extension() << "\" \""
2326 << cit->prettyname() << "\" \""
2327 << cit->shortcut() << "\" \""
2328 << escapeCommand(cit->viewer()) << "\" \""
2329 << escapeCommand(cit->editor()) << "\" \"";
2330 vector<string> flags;
2331 if (cit->documentFormat())
2332 flags.push_back("document");
2333 if (cit->vectorFormat())
2334 flags.push_back("vector");
2335 os << getStringFromVector(flags);
2340 // Look for deleted formats
2341 for (Formats::const_iterator cit = system_formats.begin();
2342 cit != system_formats.end(); ++cit)
2343 if (!formats.getFormat(cit->name()))
2344 os << "\\format \"" << cit->name()
2345 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2354 << "# CONVERTERS SECTION ##########################\n"
2358 // Look for new converters
2359 for (Converters::const_iterator cit = theConverters().begin();
2360 cit != theConverters().end(); ++cit) {
2361 Converter const * converter =
2362 theSystemConverters().getConverter(cit->from,
2365 converter->command != cit->command ||
2366 converter->flags != cit->flags)
2367 os << "\\converter \"" << cit->from << "\" \""
2368 << cit->to << "\" \""
2369 << escapeCommand(cit->command) << "\" \""
2370 << cit->flags << "\"\n";
2373 // New/modifed converters
2374 for (Converters::const_iterator cit = theSystemConverters().begin();
2375 cit != theSystemConverters().end(); ++cit)
2376 if (!theConverters().getConverter(cit->from, cit->to))
2377 os << "\\converter \"" << cit->from
2378 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2385 << "# COPIERS SECTION ##########################\n"
2388 // Look for new movers
2389 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2390 Movers::const_iterator const sysend = theSystemMovers().end();
2391 Movers::const_iterator it = theMovers().begin();
2392 Movers::const_iterator end = theMovers().end();
2394 for (; it != end; ++it) {
2395 Movers::const_iterator const sysit =
2396 find_if(sysbegin, sysend, SameMover(*it));
2397 if (sysit == sysend) {
2398 string const & fmt = it->first;
2399 string const & command =
2400 it->second.command();
2402 os << "\\copier " << fmt
2403 << " \"" << escapeCommand(command) << "\"\n";
2409 // We don't actually delete SpecialisedMover(s) from the
2410 // map, just clear their 'command', so there's no need
2411 // to test for anything else.
2419 string const LyXRC::getDescription(LyXRCTags tag)
2424 case RC_ACCEPT_COMPOUND:
2425 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2429 case RC_USE_ALT_LANG:
2430 str = _("Specify an alternate language. The default is to use the language of the document.");
2433 case RC_PLAINTEXT_ROFF_COMMAND:
2434 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.");
2437 case RC_PLAINTEXT_LINELEN:
2438 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.");
2441 case RC_AUTOREGIONDELETE:
2442 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2445 case RC_AUTORESET_OPTIONS:
2446 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2450 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2453 case RC_AUTO_NUMBER:
2456 case RC_BACKUPDIR_PATH:
2457 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.");
2460 case RC_BIBTEX_COMMAND:
2461 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2465 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2468 case RC_CHECKLASTFILES:
2469 str = _("Select to check whether the lastfiles still exist.");
2472 case RC_CHKTEX_COMMAND:
2473 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2482 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2483 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.");
2486 case RC_MAC_LIKE_WORD_MOVEMENT:
2487 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2490 case RC_SHOW_MACRO_LABEL:
2491 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2494 case RC_CUSTOM_EXPORT_COMMAND:
2497 case RC_CUSTOM_EXPORT_FORMAT:
2500 case RC_DATE_INSERT_FORMAT:
2501 //xgettext:no-c-format
2502 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2506 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2509 case RC_DEFAULT_LANGUAGE:
2510 str = _("New documents will be assigned this language.");
2513 case RC_DEFAULT_PAPERSIZE:
2514 str = _("Specify the default paper size.");
2517 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2518 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2521 case RC_DISPLAY_GRAPHICS:
2522 str = _("Select how LyX will display any graphics.");
2525 case RC_DOCUMENTPATH:
2526 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2530 case RC_USE_ESC_CHARS:
2531 str = _("Specify additional chars that can be part of a word.");
2534 case RC_EXAMPLEPATH:
2535 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2538 case RC_FONT_ENCODING:
2539 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2545 case RC_INDEX_COMMAND:
2546 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\".");
2549 case RC_NOMENCL_COMMAND:
2550 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2557 case RC_KBMAP_PRIMARY:
2558 case RC_KBMAP_SECONDARY:
2559 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.");
2562 case RC_LABEL_INIT_LENGTH:
2563 str = _("Maximum number of words in the initialization string for a new label");
2566 case RC_LANGUAGE_AUTO_BEGIN:
2567 str = _("Select if a language switching command is needed at the beginning of the document.");
2570 case RC_LANGUAGE_AUTO_END:
2571 str = _("Select if a language switching command is needed at the end of the document.");
2574 case RC_LANGUAGE_COMMAND_BEGIN:
2575 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.");
2578 case RC_LANGUAGE_COMMAND_END:
2579 str = _("The LaTeX command for changing back to the language of the document.");
2582 case RC_LANGUAGE_COMMAND_LOCAL:
2583 str = _("The LaTeX command for local changing of the language.");
2586 case RC_LANGUAGE_GLOBAL_OPTIONS:
2587 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2590 case RC_LANGUAGE_PACKAGE:
2591 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2594 case RC_LANGUAGE_USE_BABEL:
2595 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2598 case RC_USELASTFILEPOS:
2599 str = _("De-select if you do not want LyX to scroll to saved position.");
2602 case RC_LOADSESSION:
2603 str = _("De-select to prevent loading files opened from the last LyX session.");
2606 case RC_MAKE_BACKUP:
2607 str = _("De-select if you don't want LyX to create backup files.");
2610 case RC_MARK_FOREIGN_LANGUAGE:
2611 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2614 case RC_MOUSE_WHEEL_SPEED:
2615 str = bformat(_("The scrolling speed of the mouse wheel."),
2619 case RC_COMPLETION_POPUP_DELAY:
2620 str = _("The completion popup delay.");
2623 case RC_COMPLETION_POPUP_MATH:
2624 str = _("Select to display the completion popup in math mode.");
2627 case RC_COMPLETION_POPUP_TEXT:
2628 str = _("Select to display the completion popup in text mode.");
2631 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2632 str = _("Show the completion popup without delay after non-unique completion attempt.");
2635 case RC_COMPLETION_POPUP_TEXT:
2636 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2639 case RC_COMPLETION_POPUP_DELAY:
2640 str = _("The inline completion delay.");
2643 case RC_COMPLETION_INLINE_MATH:
2644 str = _("Select to display the inline completion in math mode.");
2647 case RC_COMPLETION_INLINE_TEXT:
2648 str = _("Select to display the inline completion in text mode.");
2651 case RC_COMPLETION_INLINE_DOTS:
2652 str = _("Use \"...\" to shorten long completions.");
2655 case RC_NUMLASTFILES:
2656 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2660 case RC_PATH_PREFIX:
2661 str = _("Specify those directories which should be "
2662 "prepended to the PATH environment variable. "
2663 "Use the OS native format.");
2667 case RC_USE_PERS_DICT:
2668 str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
2672 str = _("Shows a typeset preview of things such as math");
2675 case RC_PREVIEW_HASHED_LABELS:
2676 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2679 case RC_PREVIEW_SCALE_FACTOR:
2680 str = _("Scale the preview size to suit.");
2683 case RC_PRINTCOLLCOPIESFLAG:
2684 str = _("The option for specifying whether the copies should be collated.");
2687 case RC_PRINTCOPIESFLAG:
2688 str = _("The option for specifying the number of copies to print.");
2692 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2695 case RC_PRINTEVENPAGEFLAG:
2696 str = _("The option to print only even pages.");
2699 case RC_PRINTEXSTRAOPTIONS:
2700 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2703 case RC_PRINTFILEEXTENSION:
2704 str = _("Extension of printer program output file. Usually \".ps\".");
2707 case RC_PRINTLANDSCAPEFLAG:
2708 str = _("The option to print out in landscape.");
2711 case RC_PRINTODDPAGEFLAG:
2712 str = _("The option to print only odd pages.");
2715 case RC_PRINTPAGERANGEFLAG:
2716 str = _("The option for specifying a comma-separated list of pages to print.");
2719 case RC_PRINTPAPERDIMENSIONFLAG:
2720 str = _("Option to specify the dimensions of the print paper.");
2723 case RC_PRINTPAPERFLAG:
2724 str = _("The option to specify paper type.");
2727 case RC_PRINTREVERSEFLAG:
2728 str = _("The option to reverse the order of the pages printed.");
2731 case RC_PRINTSPOOL_COMMAND:
2732 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.");
2735 case RC_PRINTSPOOL_PRINTERPREFIX:
2736 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.");
2739 case RC_PRINTTOFILE:
2740 str = _("Option to pass to the print program to print to a file.");
2743 case RC_PRINTTOPRINTER:
2744 str = _("Option to pass to the print program to print on a specific printer.");
2747 case RC_PRINT_ADAPTOUTPUT:
2748 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2751 case RC_PRINT_COMMAND:
2752 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2755 case RC_RTL_SUPPORT:
2756 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2759 case RC_VISUAL_CURSOR:
2760 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2764 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2767 case RC_SCREEN_FONT_ROMAN:
2768 case RC_SCREEN_FONT_SANS:
2769 case RC_SCREEN_FONT_TYPEWRITER:
2770 str = _("The screen fonts used to display the text while editing.");
2773 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2774 case RC_SCREEN_FONT_SANS_FOUNDRY:
2775 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2778 case RC_SCREEN_FONT_SCALABLE:
2779 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.");
2782 case RC_SCREEN_FONT_SIZES:
2783 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2786 case RC_SCREEN_ZOOM:
2787 //xgettext:no-c-format
2788 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2791 case RC_GEOMETRY_SESSION:
2792 str = _("Allow session manager to save and restore windows geometry.");
2796 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2802 case RC_SHOW_BANNER:
2803 str = _("De-select if you don't want the startup banner.");
2806 case RC_TEMPDIRPATH:
2807 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2810 case RC_THESAURUSDIRPATH:
2811 str = _("This is the place where the files of the thesaurus library reside.");
2814 case RC_TEMPLATEPATH:
2815 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2818 case RC_TEX_ALLOWS_SPACES:
2821 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2825 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2837 case RC_USE_INP_ENC:
2838 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.");
2841 case RC_USE_TOOLTIP:
2842 str = _("Enable the automatic appearance of tool tips in the work area.");
2845 case RC_USE_PIXMAP_CACHE:
2846 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2849 case RC_USE_SPELL_LIB:
2852 case RC_VIEWDVI_PAPEROPTION:
2853 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2868 // The global instance
2871 // The global copy of the system lyxrc entries (everything except preferences)