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 { "\\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 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
82 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
83 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
84 { "\\def_file", LyXRC::RC_DEFFILE },
85 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
86 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
87 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
88 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
89 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
90 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
91 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
92 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
93 { "\\format", LyXRC::RC_FORMAT },
94 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
95 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
96 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
97 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
98 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
99 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
100 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
101 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
102 { "\\input", LyXRC::RC_INPUT },
103 { "\\kbmap", LyXRC::RC_KBMAP },
104 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
105 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
106 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
107 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
108 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
109 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
110 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
111 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
112 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
113 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
114 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
115 { "\\load_session", LyXRC::RC_LOADSESSION },
116 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
117 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
118 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
119 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
120 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
121 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
122 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
123 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
124 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
125 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
126 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
127 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
128 { "\\preview", LyXRC::RC_PREVIEW },
129 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
130 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
131 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
132 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
133 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
134 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
135 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
136 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
137 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
138 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
139 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
140 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
141 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
142 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
143 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
144 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
145 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
146 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
147 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
148 { "\\printer", LyXRC::RC_PRINTER },
149 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
150 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
151 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
152 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
153 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
154 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
155 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
156 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
157 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
158 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
159 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
160 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
161 { "\\set_color", LyXRC::RC_SET_COLOR },
162 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
163 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
164 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
165 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
166 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
167 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
168 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
169 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
170 { "\\ui_file", LyXRC::RC_UIFILE },
171 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
172 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
173 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
174 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
175 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
176 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
177 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
178 // compatibility with versions older than 1.4.0 only
179 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
180 // compatibility with versions older than 1.4.0 only
181 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
182 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
183 { "\\user_email", LyXRC::RC_USER_EMAIL },
184 { "\\user_name", LyXRC::RC_USER_NAME },
185 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
186 // compatibility with versions older than 1.4.0 only
187 { "\\viewer", LyXRC::RC_VIEWER},
188 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
191 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
202 void LyXRC::setDefaults()
205 def_file = "default";
207 // Get printer from the environment. If fail, use default "",
208 // assuming that everything is set up correctly.
209 printer = getEnv("PRINTER");
210 print_adapt_output = false;
211 print_command = "dvips";
212 print_evenpage_flag = "-B";
213 print_oddpage_flag = "-A";
214 print_pagerange_flag = "-pp";
215 print_copies_flag = "-c";
216 print_collcopies_flag = "-C";
217 print_reverse_flag = "-r";
218 print_landscape_flag = "-t landscape";
219 print_to_printer = "-P";
220 print_to_file = "-o ";
221 print_file_extension = ".ps";
222 print_paper_flag = "-t";
223 print_paper_dimension_flag = "-T";
224 document_path.erase();
225 view_dvi_paper_option.erase();
226 default_papersize = PAPER_DEFAULT;
227 custom_export_format = "ps";
228 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
229 bibtex_command = "bibtex";
231 index_command = "makeindex -c -q";
232 nomencl_command = "makeindex -s nomencl.ist";
234 // Because a screen typically is wider than a piece of paper:
236 allow_geometry_session = true;
237 // Default LaTeX font size:
238 font_sizes[FONT_SIZE_TINY] = "5.0";
239 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
240 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
241 font_sizes[FONT_SIZE_SMALL] = "9.0";
242 font_sizes[FONT_SIZE_NORMAL] = "10.0";
243 font_sizes[FONT_SIZE_LARGE] = "12.0";
244 font_sizes[FONT_SIZE_LARGER] = "14.4";
245 font_sizes[FONT_SIZE_LARGEST] = "17.26";
246 font_sizes[FONT_SIZE_HUGE] = "20.74";
247 font_sizes[FONT_SIZE_HUGER] = "24.88";
248 use_scalable_fonts = true;
249 roman_font_name = "";
251 typewriter_font_name = "";
253 auto_region_delete = true;
254 auto_reset_options = false;
255 plaintext_linelen = 65;
256 mouse_wheel_speed = 1.0;
257 num_lastfiles = maxlastfiles;
258 check_lastfiles = true;
259 use_lastfilepos = true;
260 load_session = false;
262 backupdir_path.erase();
263 display_graphics = true;
264 // Spellchecker settings:
265 spellchecker_accept_compound = false;
266 spellchecker_use_input_encoding = false;
267 spellchecker_use_alt_lang = false;
268 spellchecker_use_pers_dict = false;
269 spellchecker_use_esc_chars = false;
272 visual_cursor = false;
274 mark_foreign_language = true;
275 language_auto_begin = true;
276 language_auto_end = true;
277 language_global_options = true;
278 language_use_babel = true;
279 language_package = "\\usepackage{babel}";
280 language_command_begin = "\\selectlanguage{$$lang}";
281 language_command_local = "\\foreignlanguage{$$lang}{";
282 sort_layouts = false;
283 group_layouts = true;
284 default_language = "english";
285 gui_language = "auto";
287 windows_style_tex_paths = false;
288 tex_allows_spaces = false;
289 date_insert_format = "%x";
290 cursor_follows_scrollbar = false;
291 mac_like_word_movement = false;
292 macro_edit_style = MACRO_EDIT_INLINE_BOX;
293 dialogs_iconify_with_main = false;
294 label_init_length = 3;
295 preview = PREVIEW_OFF;
296 preview_hashed_labels = false;
297 preview_scale_factor = "0.9";
298 use_converter_cache = true;
300 use_pixmap_cache = false;
301 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
302 user_name = to_utf8(support::user_name());
303 user_email = to_utf8(support::user_email());
304 open_buffers_in_tabs = true;
306 // Fullscreen settings
307 full_screen_limit = false;
308 full_screen_toolbars = true;
309 full_screen_tabbar = true;
310 full_screen_scrollbar = true;
311 full_screen_width = 700;
313 completion_cursor_text = true;
314 completion_popup_math = true;
315 completion_popup_text = false;
316 completion_popup_delay = 2.0;
317 completion_popup_after_complete = true;
318 autocorrection_math = false;
319 completion_inline_math = true;
320 completion_inline_text = false;
321 completion_inline_dots = -1;
322 completion_inline_delay = 0.2;
328 void oldFontFormat(string & family, string & foundry)
330 if (family.empty() || family[0] != '-')
332 foundry = token(family, '-', 1);
333 family = token(family, '-', 2);
341 int LyXRC::read(FileName const & filename)
343 Lexer lexrc(lyxrcTags);
344 if (lyxerr.debugging(Debug::PARSER))
345 lexrc.printTable(lyxerr);
347 lexrc.setFile(filename);
351 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
357 int LyXRC::read(istream & is)
359 Lexer lexrc(lyxrcTags);
360 if (lyxerr.debugging(Debug::PARSER))
361 lexrc.printTable(lyxerr);
367 LYXERR(Debug::LYXRC, "Reading istream...");
373 int LyXRC::read(Lexer & lexrc)
378 while (lexrc.isOK()) {
379 // By using two switches we take advantage of the compiler
380 // telling us if we have missed a LyXRCTags element in
381 // the second switch.
382 // Note that this also shows a problem with Lexer since it
383 // helps us avoid taking advantage of the strictness of the
386 int le = lexrc.lex();
388 case Lexer::LEX_UNDEF:
389 lexrc.printError("Unknown tag `$$Token'");
391 case Lexer::LEX_FEOF:
396 switch (static_cast<LyXRCTags>(le)) {
397 case RC_INPUT: // Include file
400 libFileSearch(string(),
403 lexrc.printError("Error reading "
404 "included file: " + tmp.absFilename());
410 bind_file = os::internal_path(lexrc.getString());
415 def_file = os::internal_path(lexrc.getString());
420 ui_file = os::internal_path(lexrc.getString());
423 case RC_AUTORESET_OPTIONS:
424 lexrc >> auto_reset_options;
427 case RC_DISPLAY_GRAPHICS:
429 display_graphics = lexrc.getString() == "true";
432 case RC_TEX_EXPECTS_WINDOWS_PATHS:
433 lexrc >> windows_style_tex_paths;
436 case RC_TEX_ALLOWS_SPACES:
437 lexrc >> tex_allows_spaces;
444 case RC_KBMAP_PRIMARY:
446 string const kmap(os::internal_path(lexrc.getString()));
449 } else if (!libFileSearch("kbd", kmap,
451 primary_kbmap = kmap;
453 lexrc.printError("LyX: Keymap `$$Token' not found");
458 case RC_KBMAP_SECONDARY:
460 string const kmap(os::internal_path(lexrc.getString()));
463 } else if (!libFileSearch("kbd", kmap,
465 secondary_kbmap = kmap;
467 lexrc.printError("LyX: Keymap `$$Token' not found");
472 case RC_FONT_ENCODING:
480 case RC_PRINT_COMMAND:
481 if (lexrc.next(true)) {
482 print_command = lexrc.getString();
486 case RC_PRINTEVENPAGEFLAG:
487 lexrc >> print_evenpage_flag;
490 case RC_PRINTODDPAGEFLAG:
491 lexrc >> print_oddpage_flag;
494 case RC_PRINTPAGERANGEFLAG:
495 lexrc >> print_pagerange_flag;
498 case RC_PRINTCOPIESFLAG:
499 lexrc >> print_copies_flag;
502 case RC_PRINTCOLLCOPIESFLAG:
503 lexrc >> print_collcopies_flag;
506 case RC_PRINTREVERSEFLAG:
507 lexrc >> print_reverse_flag;
510 case RC_PRINTLANDSCAPEFLAG:
511 lexrc >> print_landscape_flag;
514 case RC_PRINTTOPRINTER:
515 lexrc >> print_to_printer;
518 case RC_PRINT_ADAPTOUTPUT:
519 lexrc >> print_adapt_output;
524 print_to_file = os::internal_path(lexrc.getString());
528 case RC_PRINTFILEEXTENSION:
529 lexrc >> print_file_extension;
532 case RC_PRINTEXSTRAOPTIONS:
533 lexrc >> print_extra_options;
536 case RC_PRINTSPOOL_COMMAND:
537 if (lexrc.next(true)) {
538 print_spool_command = lexrc.getString();
542 case RC_PRINTSPOOL_PRINTERPREFIX:
543 lexrc >> print_spool_printerprefix;
546 case RC_PRINTPAPERDIMENSIONFLAG:
547 lexrc >> print_paper_dimension_flag;
550 case RC_PRINTPAPERFLAG:
551 lexrc >> print_paper_flag;
554 case RC_CUSTOM_EXPORT_COMMAND:
555 lexrc >> custom_export_command;
558 case RC_CUSTOM_EXPORT_FORMAT:
559 lexrc >> custom_export_format;
562 case RC_DEFAULT_PAPERSIZE:
564 string const size = ascii_lowercase(lexrc.getString());
565 if (size == "usletter")
566 default_papersize = PAPER_USLETTER;
567 else if (size == "legal")
568 default_papersize = PAPER_USLEGAL;
569 else if (size == "executive")
570 default_papersize = PAPER_USEXECUTIVE;
571 else if (size == "a3")
572 default_papersize = PAPER_A3;
573 else if (size == "a4")
574 default_papersize = PAPER_A4;
575 else if (size == "a5")
576 default_papersize = PAPER_A5;
577 else if (size == "b5")
578 default_papersize = PAPER_B5;
579 else if (size == "default")
580 default_papersize = PAPER_DEFAULT;
584 case RC_VIEWDVI_PAPEROPTION:
586 view_dvi_paper_option = lexrc.getString();
588 view_dvi_paper_option.erase();
591 case RC_CHKTEX_COMMAND:
592 if (lexrc.next(true)) {
593 chktex_command = lexrc.getString();
597 case RC_BIBTEX_COMMAND:
598 if (lexrc.next(true)) {
599 bibtex_command = lexrc.getString();
603 case RC_INDEX_COMMAND:
604 if (lexrc.next(true)) {
605 index_command = lexrc.getString();
609 case RC_NOMENCL_COMMAND:
610 if (lexrc.next(true)) {
611 nomencl_command = lexrc.getString();
623 case RC_GEOMETRY_SESSION:
624 lexrc >> allow_geometry_session;
627 case RC_SCREEN_FONT_SIZES:
628 lexrc >> font_sizes[FONT_SIZE_TINY];
629 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
630 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
631 lexrc >> font_sizes[FONT_SIZE_SMALL];
632 lexrc >> font_sizes[FONT_SIZE_NORMAL];
633 lexrc >> font_sizes[FONT_SIZE_LARGE];
634 lexrc >> font_sizes[FONT_SIZE_LARGER];
635 lexrc >> font_sizes[FONT_SIZE_LARGEST];
636 lexrc >> font_sizes[FONT_SIZE_HUGE];
637 lexrc >> font_sizes[FONT_SIZE_HUGER];
640 case RC_SCREEN_FONT_SCALABLE:
641 lexrc >> use_scalable_fonts;
648 case RC_DOCUMENTPATH:
650 document_path = os::internal_path(lexrc.getString());
651 document_path = expandPath(document_path);
657 example_path = os::internal_path(lexrc.getString());
658 example_path = expandPath(example_path);
662 case RC_TEMPLATEPATH:
664 template_path = os::internal_path(lexrc.getString());
665 template_path = expandPath(template_path);
671 tempdir_path = os::internal_path(lexrc.getString());
672 tempdir_path = expandPath(tempdir_path);
676 case RC_THESAURUSDIRPATH:
678 thesaurusdir_path = os::internal_path(lexrc.getString());
679 thesaurusdir_path = expandPath(thesaurusdir_path);
685 LYXERR0("Ignoring obsolete use_tempdir flag.");
688 case RC_USELASTFILEPOS:
689 lexrc >> use_lastfilepos;
693 lexrc >> load_session;
696 case RC_MOUSE_WHEEL_SPEED:
697 lexrc >> mouse_wheel_speed;
700 case RC_COMPLETION_INLINE_DELAY:
701 lexrc >> completion_inline_delay;
704 case RC_COMPLETION_INLINE_MATH:
705 lexrc >> completion_inline_math;
708 case RC_COMPLETION_INLINE_TEXT:
709 lexrc >> completion_inline_text;
712 case RC_COMPLETION_INLINE_DOTS:
713 lexrc >> completion_inline_dots;
716 case RC_AUTOCORRECTION_MATH:
717 lexrc >> autocorrection_math;
720 case RC_COMPLETION_POPUP_DELAY:
721 lexrc >> completion_popup_delay;
724 case RC_COMPLETION_POPUP_MATH:
725 lexrc >> completion_popup_math;
728 case RC_COMPLETION_POPUP_TEXT:
729 lexrc >> completion_popup_text;
732 case RC_COMPLETION_CURSOR_TEXT:
733 lexrc >> completion_cursor_text;
736 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
737 lexrc >> completion_popup_after_complete;
740 case RC_NUMLASTFILES:
741 lexrc >> num_lastfiles;
744 case RC_CHECKLASTFILES:
745 lexrc >> check_lastfiles;
748 case RC_SCREEN_FONT_ROMAN:
750 roman_font_name = lexrc.getString();
751 oldFontFormat(roman_font_name,
756 case RC_SCREEN_FONT_SANS:
758 sans_font_name = lexrc.getString();
759 oldFontFormat(sans_font_name, sans_font_foundry);
763 case RC_SCREEN_FONT_TYPEWRITER:
765 typewriter_font_name = lexrc.getString();
766 oldFontFormat(typewriter_font_name,
767 typewriter_font_foundry);
771 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
772 lexrc >> roman_font_foundry;
775 case RC_SCREEN_FONT_SANS_FOUNDRY:
776 lexrc >> sans_font_foundry;
779 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
780 lexrc >> typewriter_font_foundry;
785 lexrc.printError("Missing color tag.");
788 string lyx_name = lexrc.getString();
791 lexrc.printError("Missing color name for color: `$$Token'");
794 string x11_name = lexrc.getString();
796 ColorCode const col =
797 lcolor.getFromLyXName(lyx_name);
798 if (col == Color_none ||
799 col == Color_inherit ||
803 if (!lcolor.setColor(col, x11_name))
804 LYXERR0("Bad lyxrc set_color for " << lyx_name);
808 case RC_AUTOREGIONDELETE:
809 // Auto region delete defaults to true
810 lexrc >> auto_region_delete;
815 lyxpipes = os::internal_path(lexrc.getString());
816 lyxpipes = expandPath(lyxpipes);
820 case RC_CURSOR_FOLLOWS_SCROLLBAR:
821 lexrc >> cursor_follows_scrollbar;
824 case RC_MAC_LIKE_WORD_MOVEMENT:
825 lexrc >> mac_like_word_movement;
828 case RC_MACRO_EDIT_STYLE:
830 switch (lexrc.getInteger()) {
831 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
832 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
833 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
838 case RC_DIALOGS_ICONIFY_WITH_MAIN:
839 lexrc >> dialogs_iconify_with_main;
842 case RC_PLAINTEXT_ROFF_COMMAND:
843 (void) lexrc.getString(); // Obsoleted in 2.0
845 case RC_PLAINTEXT_LINELEN:
846 lexrc >> plaintext_linelen;
848 // Spellchecker settings:
849 case RC_ACCEPT_COMPOUND:
850 lexrc >> spellchecker_accept_compound;
853 lexrc >> spellchecker_use_input_encoding;
855 case RC_USE_ALT_LANG:
856 lexrc >> spellchecker_use_alt_lang;
858 case RC_USE_PERS_DICT:
859 lexrc >> spellchecker_use_pers_dict;
862 lexrc >> use_tooltip;
864 case RC_USE_PIXMAP_CACHE:
865 lexrc >> use_pixmap_cache;
867 case RC_USE_ESC_CHARS:
868 lexrc >> spellchecker_use_esc_chars;
871 lexrc >> spellchecker_alt_lang;
875 spellchecker_pers_dict = os::internal_path(lexrc.getString());
878 lexrc >> spellchecker_esc_chars;
881 lexrc >> make_backup;
883 case RC_BACKUPDIR_PATH:
885 backupdir_path = os::internal_path(lexrc.getString());
886 backupdir_path = expandPath(backupdir_path);
889 case RC_DATE_INSERT_FORMAT:
890 lexrc >> date_insert_format;
892 case RC_LANGUAGE_PACKAGE:
893 lexrc >> language_package;
895 case RC_LANGUAGE_AUTO_BEGIN:
896 lexrc >> language_auto_begin;
898 case RC_LANGUAGE_AUTO_END:
899 lexrc >> language_auto_end;
901 case RC_LANGUAGE_GLOBAL_OPTIONS:
902 lexrc >> language_global_options;
904 case RC_LANGUAGE_USE_BABEL:
905 lexrc >> language_use_babel;
907 case RC_LANGUAGE_COMMAND_BEGIN:
908 lexrc >> language_command_begin;
910 case RC_LANGUAGE_COMMAND_END:
911 lexrc >> language_command_end;
913 case RC_LANGUAGE_COMMAND_LOCAL:
914 lexrc >> language_command_local;
917 lexrc >> rtl_support;
919 case RC_VISUAL_CURSOR:
920 lexrc >> visual_cursor;
923 lexrc >> auto_number;
925 case RC_MARK_FOREIGN_LANGUAGE:
926 lexrc >> mark_foreign_language;
932 fmt = lexrc.getString();
933 if (lexrc.next(true))
934 command = lexrc.getString();
935 setMover(fmt, command);
940 string from, to, command, flags;
942 from = lexrc.getString();
944 to = lexrc.getString();
945 if (lexrc.next(true))
946 command = lexrc.getString();
948 flags = lexrc.getString();
950 theConverters().erase(from, to);
952 theConverters().add(from, to, command, flags);
955 // compatibility with versions older than 1.4.0 only
957 string format, command;
958 lexrc >> format >> command;
959 formats.setViewer(format, command);
963 string format, extension, prettyname, shortcut;
964 lexrc >> format >> extension >> prettyname >> shortcut;
965 string viewer, editor;
966 if (lexrc.next(true))
967 viewer = lexrc.getString();
968 if (lexrc.next(true))
969 editor = lexrc.getString();
971 // Hack to ensure compatibility with versions older
973 int le = lexrc.lex();
974 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
975 flags = lexrc.getString();
976 if (le != Lexer::LEX_DATA) {
977 // We have got a known token.
978 // Therefore this is an old style
979 // format definition without
981 lexrc.pushToken(flags);
985 int flgs = Format::none;
986 while (!flags.empty()) {
988 flags = split(flags, flag, ',');
989 if (flag == "document")
990 flgs |= Format::document;
991 else if (flag == "vector")
992 flgs |= Format::vector;
994 LYXERR0("Ignoring unknown flag `"
995 << flag << "' for format `"
998 if (prettyname.empty()) {
999 if (theConverters().formatIsUsed(format))
1000 LYXERR0("Can't delete format " << format);
1002 formats.erase(format);
1004 formats.add(format, extension, prettyname,
1005 shortcut, viewer, editor, flgs);
1009 case RC_DEFAULT_LANGUAGE:
1010 lexrc >> default_language;
1013 case RC_GUI_LANGUAGE:
1014 lexrc >> gui_language;
1017 case RC_LABEL_INIT_LENGTH:
1018 lexrc >> label_init_length;
1021 case RC_SHOW_BANNER:
1022 lexrc >> show_banner;
1027 string const tmp = lexrc.getString();
1028 if (tmp == "true" || tmp == "on")
1029 preview = PREVIEW_ON;
1030 else if (tmp == "no_math")
1031 preview = PREVIEW_NO_MATH;
1033 preview = PREVIEW_OFF;
1034 if (tmp != "false" && tmp != "off")
1035 LYXERR0("Unrecognized preview status \""
1041 case RC_PREVIEW_HASHED_LABELS:
1042 lexrc >> preview_hashed_labels;
1045 case RC_PREVIEW_SCALE_FACTOR:
1046 lexrc >> preview_scale_factor;
1053 lexrc >> user_email;
1056 case RC_PATH_PREFIX:
1057 lexrc >> path_prefix;
1060 case RC_USE_CONVERTER_CACHE:
1061 lexrc >> use_converter_cache;
1063 case RC_CONVERTER_CACHE_MAXAGE:
1064 lexrc >> converter_cache_maxage;
1067 case RC_SORT_LAYOUTS:
1068 lexrc >> sort_layouts;
1070 case RC_GROUP_LAYOUTS:
1071 lexrc >> group_layouts;
1073 case RC_FULL_SCREEN_LIMIT:
1074 lexrc >> full_screen_limit;
1076 case RC_FULL_SCREEN_TOOLBARS:
1077 lexrc >> full_screen_toolbars;
1079 case RC_FULL_SCREEN_SCROLLBAR:
1080 lexrc >> full_screen_scrollbar;
1082 case RC_FULL_SCREEN_TABBAR:
1083 lexrc >> full_screen_tabbar;
1085 case RC_FULL_SCREEN_WIDTH:
1086 lexrc >> full_screen_width;
1088 case RC_OPEN_BUFFERS_IN_TABS:
1089 lexrc >> open_buffers_in_tabs;
1093 case RC_SPELL_COMMAND:
1094 case RC_USE_SPELL_LIB:
1095 (void) lexrc.getString();
1099 break; // this is just a dummy
1103 /// Update converters data-structures
1104 theConverters().update(formats);
1105 theConverters().buildGraph();
1111 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1113 ofstream ofs(filename.toFilesystemEncoding().c_str());
1115 write(ofs, ignore_system_lyxrc);
1119 void LyXRC::print() const
1121 if (lyxerr.debugging())
1122 write(lyxerr, false);
1130 typedef pair<string, SpecialisedMover> Data;
1132 SameMover(Data const & comparison)
1133 : comparison_(comparison) {}
1135 bool operator()(Data const & data) const
1137 return data.first == comparison_.first &&
1138 data.second.command() == comparison_.second.command();
1148 // Escape \ and " so that LyXLex can read the string later
1149 string escapeCommand(string const & str) {
1150 return subst(subst(str , "\\", "\\\\"),
1157 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1159 LyXRCTags tag = RC_LAST;
1161 if (!name.empty()) {
1162 for (int i = 0; i != lyxrcCount; ++i)
1163 if ("\\" + name == lyxrcTags[i].tag)
1164 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1168 os << "# LyX " << lyx_version
1169 << " generated this file. If you want to make your own\n"
1170 << "# modifications you should do them from inside LyX and save.\n"
1173 // Why the switch you might ask. It is a trick to ensure that all
1174 // the elements in the LyXRCTags enum are handled. As you can see
1175 // there are no breaks at all. So it is just a huge fall-through.
1176 // The nice thing is that we will get a warning from the compiler
1177 // if we forget an element.
1181 // input/include files are not done here
1183 if (ignore_system_lyxrc ||
1184 bind_file != system_lyxrc.bind_file) {
1185 string const path = os::external_path(bind_file);
1186 os << "\\bind_file \"" << path << "\"\n";
1192 if (ignore_system_lyxrc ||
1193 def_file != system_lyxrc.def_file) {
1194 string const path = os::external_path(def_file);
1195 os << "\\def_file \"" << path << "\"\n";
1204 << "# MISC SECTION ######################################\n"
1206 // bind files are not done here.
1208 case RC_PATH_PREFIX:
1209 if (ignore_system_lyxrc ||
1210 path_prefix != system_lyxrc.path_prefix) {
1211 os << "\\path_prefix \"" << path_prefix << "\"\n";
1216 if (ignore_system_lyxrc ||
1217 ui_file != system_lyxrc.ui_file) {
1218 string const path = os::external_path(ui_file);
1219 os << "\\ui_file \"" << path << "\"\n";
1223 case RC_AUTOREGIONDELETE:
1224 if (ignore_system_lyxrc ||
1225 auto_region_delete != system_lyxrc.auto_region_delete) {
1226 os << "# Set to false to inhibit automatic replacement of\n"
1227 << "# the current selection.\n"
1228 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1233 case RC_AUTORESET_OPTIONS:
1234 if (ignore_system_lyxrc ||
1235 auto_reset_options != system_lyxrc.auto_reset_options) {
1236 os << "# Set to false to inhibit automatic reset of\n"
1237 << "# the class options to defaults on class change.\n"
1238 << "\\auto_reset_options "
1239 << convert<string>(auto_reset_options)
1245 if (ignore_system_lyxrc ||
1246 autosave != system_lyxrc.autosave) {
1247 os << "# The time interval between auto-saves in seconds.\n"
1248 << "\\autosave " << autosave << '\n';
1252 case RC_DISPLAY_GRAPHICS:
1253 if (ignore_system_lyxrc ||
1254 display_graphics != system_lyxrc.display_graphics) {
1255 os << "# Display graphics within LyX\n"
1257 << "\\display_graphics "
1258 << (display_graphics ? "true" : "false")
1263 case RC_SORT_LAYOUTS:
1264 if (ignore_system_lyxrc ||
1265 sort_layouts != system_lyxrc.sort_layouts) {
1266 os << "# Sort layouts alphabetically.\n"
1267 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1271 case RC_GROUP_LAYOUTS:
1272 if (ignore_system_lyxrc ||
1273 group_layouts != system_lyxrc.group_layouts) {
1274 os << "# Group layouts by their category.\n"
1275 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1279 case RC_VIEWDVI_PAPEROPTION:
1280 if (ignore_system_lyxrc ||
1281 view_dvi_paper_option
1282 != system_lyxrc.view_dvi_paper_option) {
1283 os << "# Options used to specify paper size to the\n"
1284 << "# view_dvi_command (e.g. -paper)\n"
1285 << "\\view_dvi_paper_option \""
1286 << view_dvi_paper_option << "\"\n";
1290 case RC_DEFAULT_PAPERSIZE:
1291 if (ignore_system_lyxrc ||
1292 default_papersize != system_lyxrc.default_papersize) {
1293 os << "# The default papersize to use.\n"
1294 << "\\default_papersize \"";
1295 switch (default_papersize) {
1297 os << "default"; break;
1298 case PAPER_USLETTER:
1299 os << "usletter"; break;
1301 os << "legal"; break;
1302 case PAPER_USEXECUTIVE:
1303 os << "executive"; break;
1314 case PAPER_B4: break;
1320 case RC_CHKTEX_COMMAND:
1321 if (ignore_system_lyxrc ||
1322 chktex_command != system_lyxrc.chktex_command) {
1323 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1327 case RC_BIBTEX_COMMAND:
1328 if (ignore_system_lyxrc ||
1329 bibtex_command != system_lyxrc.bibtex_command) {
1330 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1334 case RC_INDEX_COMMAND:
1335 if (ignore_system_lyxrc ||
1336 index_command != system_lyxrc.index_command) {
1337 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1341 case RC_NOMENCL_COMMAND:
1342 if (ignore_system_lyxrc ||
1343 nomencl_command != system_lyxrc.nomencl_command) {
1344 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1348 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1349 if (ignore_system_lyxrc ||
1350 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1351 os << "\\tex_expects_windows_paths "
1352 << convert<string>(windows_style_tex_paths) << '\n';
1356 case RC_TEX_ALLOWS_SPACES:
1357 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1358 os << "\\tex_allows_spaces "
1359 << convert<string>(tex_allows_spaces) << '\n';
1364 if (ignore_system_lyxrc ||
1365 use_kbmap != system_lyxrc.use_kbmap) {
1366 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1370 case RC_KBMAP_PRIMARY:
1371 if (ignore_system_lyxrc ||
1372 primary_kbmap != system_lyxrc.primary_kbmap) {
1373 string const path = os::external_path(primary_kbmap);
1374 os << "\\kbmap_primary \"" << path << "\"\n";
1378 case RC_KBMAP_SECONDARY:
1379 if (ignore_system_lyxrc ||
1380 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1381 string const path = os::external_path(secondary_kbmap);
1382 os << "\\kbmap_secondary \"" << path << "\"\n";
1387 if (ignore_system_lyxrc ||
1388 lyxpipes != system_lyxrc.lyxpipes) {
1389 string const path = os::external_path(lyxpipes);
1390 os << "\\serverpipe \"" << path << "\"\n";
1394 case RC_DATE_INSERT_FORMAT:
1395 if (ignore_system_lyxrc ||
1396 date_insert_format != system_lyxrc.date_insert_format) {
1397 os << "\\date_insert_format \"" << date_insert_format
1402 case RC_LABEL_INIT_LENGTH:
1403 if (ignore_system_lyxrc ||
1404 label_init_length != system_lyxrc.label_init_length) {
1405 os << "\\label_init_length " << label_init_length
1412 os << "\\user_name \"" << user_name << "\"\n";
1417 os << "\\user_email \"" << user_email << "\"\n";
1421 case RC_SHOW_BANNER:
1422 if (ignore_system_lyxrc ||
1423 show_banner != system_lyxrc.show_banner) {
1424 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1430 if (ignore_system_lyxrc ||
1431 preview != system_lyxrc.preview) {
1437 case PREVIEW_NO_MATH:
1444 os << "\\preview " << status << '\n';
1449 case RC_PREVIEW_HASHED_LABELS:
1450 if (ignore_system_lyxrc ||
1451 preview_hashed_labels !=
1452 system_lyxrc.preview_hashed_labels) {
1453 os << "\\preview_hashed_labels "
1454 << convert<string>(preview_hashed_labels) << '\n';
1459 case RC_PREVIEW_SCALE_FACTOR:
1460 if (ignore_system_lyxrc ||
1461 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1462 os << "\\preview_scale_factor "
1463 << preview_scale_factor << '\n';
1468 case RC_USE_CONVERTER_CACHE:
1469 if (ignore_system_lyxrc ||
1470 use_converter_cache != system_lyxrc.use_converter_cache) {
1471 os << "\\use_converter_cache "
1472 << convert<string>(use_converter_cache) << '\n';
1477 case RC_CONVERTER_CACHE_MAXAGE:
1478 if (ignore_system_lyxrc ||
1479 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1480 os << "\\converter_cache_maxage "
1481 << converter_cache_maxage << '\n';
1487 << "# SCREEN & FONTS SECTION ############################\n"
1491 if (ignore_system_lyxrc ||
1492 dpi != system_lyxrc.dpi) {
1493 os << "\\screen_dpi " << dpi << '\n';
1497 case RC_SCREEN_ZOOM:
1498 if (ignore_system_lyxrc ||
1499 zoom != system_lyxrc.zoom) {
1500 os << "\\screen_zoom " << zoom << '\n';
1504 case RC_GEOMETRY_SESSION:
1505 if (ignore_system_lyxrc ||
1506 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1507 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1512 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1513 if (ignore_system_lyxrc ||
1514 cursor_follows_scrollbar
1515 != system_lyxrc.cursor_follows_scrollbar) {
1516 os << "\\cursor_follows_scrollbar "
1517 << convert<string>(cursor_follows_scrollbar) << '\n';
1521 case RC_MAC_LIKE_WORD_MOVEMENT:
1522 if (ignore_system_lyxrc ||
1523 mac_like_word_movement
1524 != system_lyxrc.mac_like_word_movement) {
1525 os << "\\mac_like_word_movement "
1526 << convert<string>(mac_like_word_movement) << '\n';
1530 case RC_MACRO_EDIT_STYLE:
1531 if (ignore_system_lyxrc ||
1533 != system_lyxrc.macro_edit_style) {
1534 os << "\\macro_edit_style ";
1535 switch (macro_edit_style) {
1536 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1537 case MACRO_EDIT_INLINE: os << "1\n"; break;
1538 case MACRO_EDIT_LIST: os << "2\n"; break;
1543 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1544 if (ignore_system_lyxrc ||
1545 dialogs_iconify_with_main
1546 != system_lyxrc.dialogs_iconify_with_main) {
1547 os << "\\dialogs_iconify_with_main "
1548 << convert<string>(dialogs_iconify_with_main) << '\n';
1552 case RC_SCREEN_FONT_ROMAN:
1553 if (ignore_system_lyxrc ||
1554 roman_font_name != system_lyxrc.roman_font_name) {
1555 os << "\\screen_font_roman \"" << roman_font_name
1560 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1561 if (ignore_system_lyxrc ||
1562 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1563 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1568 case RC_SCREEN_FONT_SANS:
1569 if (ignore_system_lyxrc ||
1570 sans_font_name != system_lyxrc.sans_font_name) {
1571 os << "\\screen_font_sans \"" << sans_font_name
1576 case RC_SCREEN_FONT_SANS_FOUNDRY:
1577 if (ignore_system_lyxrc ||
1578 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1579 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1584 case RC_SCREEN_FONT_TYPEWRITER:
1585 if (ignore_system_lyxrc ||
1586 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1587 os << "\\screen_font_typewriter \""
1588 << typewriter_font_name << "\"\n";
1592 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1593 if (ignore_system_lyxrc ||
1594 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1595 os << "\\screen_font_typewriter_foundry \""
1596 << typewriter_font_foundry << "\"\n";
1601 case RC_SCREEN_FONT_SCALABLE:
1602 if (ignore_system_lyxrc ||
1603 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1604 os << "\\screen_font_scalable "
1605 << convert<string>(use_scalable_fonts)
1610 case RC_SCREEN_FONT_SIZES:
1611 if (ignore_system_lyxrc ||
1612 font_sizes[FONT_SIZE_TINY]
1613 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1614 font_sizes[FONT_SIZE_SCRIPT]
1615 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1616 font_sizes[FONT_SIZE_FOOTNOTE]
1617 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1618 font_sizes[FONT_SIZE_SMALL]
1619 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1620 font_sizes[FONT_SIZE_NORMAL]
1621 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1622 font_sizes[FONT_SIZE_LARGE]
1623 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1624 font_sizes[FONT_SIZE_LARGER]
1625 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1626 font_sizes[FONT_SIZE_LARGEST]
1627 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1628 font_sizes[FONT_SIZE_HUGE]
1629 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1630 font_sizes[FONT_SIZE_HUGER]
1631 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1632 os.setf(ios::fixed);
1634 os << "\\screen_font_sizes"
1635 << ' ' << font_sizes[FONT_SIZE_TINY]
1636 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1637 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1638 << ' ' << font_sizes[FONT_SIZE_SMALL]
1639 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1640 << ' ' << font_sizes[FONT_SIZE_LARGE]
1641 << ' ' << font_sizes[FONT_SIZE_LARGER]
1642 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1643 << ' ' << font_sizes[FONT_SIZE_HUGE]
1644 << ' ' << font_sizes[FONT_SIZE_HUGER]
1649 case RC_FULL_SCREEN_LIMIT:
1650 if (ignore_system_lyxrc ||
1651 full_screen_limit != system_lyxrc.full_screen_limit) {
1652 os << "\\fullscreen_limit "
1653 << convert<string>(full_screen_limit)
1658 case RC_FULL_SCREEN_TOOLBARS:
1659 if (ignore_system_lyxrc ||
1660 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1661 os << "\\fullscreen_toolbars "
1662 << convert<string>(full_screen_toolbars)
1667 case RC_FULL_SCREEN_SCROLLBAR:
1668 if (ignore_system_lyxrc ||
1669 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1670 os << "\\fullscreen_scrollbar "
1671 << convert<string>(full_screen_scrollbar)
1676 case RC_FULL_SCREEN_TABBAR:
1677 if (ignore_system_lyxrc ||
1678 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1679 os << "\\fullscreen_tabbar "
1680 << convert<string>(full_screen_tabbar)
1685 case RC_FULL_SCREEN_WIDTH:
1686 if (ignore_system_lyxrc ||
1687 full_screen_width != system_lyxrc.full_screen_width) {
1688 os << "\\fullscreen_width "
1689 << convert<string>(full_screen_width)
1694 case RC_OPEN_BUFFERS_IN_TABS:
1695 if (ignore_system_lyxrc ||
1696 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1697 os << "\\open_buffers_in_tabs "
1698 << convert<string>(open_buffers_in_tabs)
1705 << "# COLOR SECTION ###################################\n"
1709 for (int i = 0; i < Color_ignore; ++i) {
1710 ColorCode lc = static_cast<ColorCode>(i);
1711 string const col = lcolor.getX11Name(lc);
1712 if (ignore_system_lyxrc
1713 || col != system_lcolor.getX11Name(lc)) {
1714 os << "\\set_color \""
1715 << lcolor.getLyXName(lc) << "\" \""
1723 << "# PRINTER SECTION ###################################\n"
1727 if (ignore_system_lyxrc ||
1728 printer != system_lyxrc.printer) {
1729 os << "\\printer \"" << printer << "\"\n";
1733 case RC_PRINT_ADAPTOUTPUT:
1734 if (ignore_system_lyxrc ||
1735 print_adapt_output != system_lyxrc.print_adapt_output) {
1736 os << "\\print_adapt_output "
1737 << convert<string>(print_adapt_output)
1742 case RC_PRINT_COMMAND:
1743 if (ignore_system_lyxrc ||
1744 print_command != system_lyxrc.print_command) {
1745 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1749 case RC_PRINTEXSTRAOPTIONS:
1750 if (ignore_system_lyxrc ||
1751 print_extra_options != system_lyxrc.print_extra_options) {
1752 os << "\\print_extra_options \"" << print_extra_options
1757 case RC_PRINTSPOOL_COMMAND:
1758 if (ignore_system_lyxrc ||
1759 print_spool_command != system_lyxrc.print_spool_command) {
1760 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1765 case RC_PRINTSPOOL_PRINTERPREFIX:
1766 if (ignore_system_lyxrc ||
1767 print_spool_printerprefix
1768 != system_lyxrc.print_spool_printerprefix) {
1769 os << "\\print_spool_printerprefix \""
1770 << print_spool_printerprefix << "\"\n";
1774 case RC_PRINTEVENPAGEFLAG:
1775 if (ignore_system_lyxrc ||
1776 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1777 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1782 case RC_PRINTODDPAGEFLAG:
1783 if (ignore_system_lyxrc ||
1784 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1785 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1790 case RC_PRINTREVERSEFLAG:
1791 if (ignore_system_lyxrc ||
1792 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1793 os << "\\print_reverse_flag \"" << print_reverse_flag
1798 case RC_PRINTLANDSCAPEFLAG:
1799 if (ignore_system_lyxrc ||
1800 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1801 os << "\\print_landscape_flag \"" << print_landscape_flag
1806 case RC_PRINTPAGERANGEFLAG:
1807 if (ignore_system_lyxrc ||
1808 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1809 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1814 case RC_PRINTCOPIESFLAG:
1815 if (ignore_system_lyxrc ||
1816 print_copies_flag != system_lyxrc.print_copies_flag) {
1817 os << "\\print_copies_flag \"" << print_copies_flag
1822 case RC_PRINTCOLLCOPIESFLAG:
1823 if (ignore_system_lyxrc ||
1824 print_collcopies_flag
1825 != system_lyxrc.print_collcopies_flag) {
1826 os << "\\print_collcopies_flag \""
1827 << print_collcopies_flag
1832 case RC_PRINTPAPERFLAG:
1833 if (ignore_system_lyxrc ||
1834 print_paper_flag != system_lyxrc.print_paper_flag) {
1835 os << "\\print_paper_flag \"" << print_paper_flag
1840 case RC_PRINTPAPERDIMENSIONFLAG:
1841 if (ignore_system_lyxrc ||
1842 print_paper_dimension_flag
1843 != system_lyxrc.print_paper_dimension_flag) {
1844 os << "\\print_paper_dimension_flag \""
1845 << print_paper_dimension_flag << "\"\n";
1849 case RC_PRINTTOPRINTER:
1850 if (ignore_system_lyxrc ||
1851 print_to_printer != system_lyxrc.print_to_printer) {
1852 os << "\\print_to_printer \"" << print_to_printer
1857 case RC_PRINTTOFILE:
1858 if (ignore_system_lyxrc ||
1859 print_to_file != system_lyxrc.print_to_file) {
1860 string const path = os::external_path(print_to_file);
1861 os << "\\print_to_file \"" << path << "\"\n";
1865 case RC_PRINTFILEEXTENSION:
1866 if (ignore_system_lyxrc ||
1867 print_file_extension != system_lyxrc.print_file_extension) {
1868 os << "\\print_file_extension \""
1869 << print_file_extension
1876 << "# EXPORT SECTION ####################################\n"
1879 case RC_CUSTOM_EXPORT_COMMAND:
1880 if (ignore_system_lyxrc ||
1881 custom_export_command
1882 != system_lyxrc.custom_export_command) {
1883 os << "\\custom_export_command \""
1884 << custom_export_command
1889 case RC_CUSTOM_EXPORT_FORMAT:
1890 if (ignore_system_lyxrc ||
1891 custom_export_format
1892 != system_lyxrc.custom_export_format) {
1893 os << "\\custom_export_format \"" << custom_export_format
1900 << "# TEX SECTION #######################################\n"
1903 case RC_FONT_ENCODING:
1904 if (ignore_system_lyxrc ||
1905 fontenc != system_lyxrc.fontenc) {
1906 os << "\\font_encoding \"" << fontenc << "\"\n";
1912 << "# FILE SECTION ######################################\n"
1915 case RC_DOCUMENTPATH:
1916 if (ignore_system_lyxrc ||
1917 document_path != system_lyxrc.document_path) {
1918 string const path = os::external_path(document_path);
1919 os << "\\document_path \"" << path << "\"\n";
1923 case RC_USELASTFILEPOS:
1924 if (ignore_system_lyxrc ||
1925 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1926 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1931 case RC_LOADSESSION:
1932 if (ignore_system_lyxrc ||
1933 load_session != system_lyxrc.load_session) {
1934 os << "\\load_session " << convert<string>(load_session)
1939 case RC_MOUSE_WHEEL_SPEED:
1940 if (ignore_system_lyxrc ||
1941 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1942 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1946 case RC_COMPLETION_INLINE_DELAY:
1947 if (ignore_system_lyxrc ||
1948 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1949 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1953 case RC_COMPLETION_INLINE_MATH:
1954 if (ignore_system_lyxrc ||
1955 completion_inline_math != system_lyxrc.completion_inline_math) {
1956 os << "\\completion_inline_math "
1957 << convert<string>(completion_inline_math) << '\n';
1961 case RC_COMPLETION_INLINE_TEXT:
1962 if (ignore_system_lyxrc ||
1963 completion_inline_text != system_lyxrc.completion_inline_text) {
1964 os << "\\completion_inline_text "
1965 << convert<string>(completion_inline_text) << '\n';
1969 case RC_COMPLETION_INLINE_DOTS:
1970 if (ignore_system_lyxrc ||
1971 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1972 os << "\\completion_inline_dots "
1973 << convert<string>(completion_inline_dots) << '\n';
1977 case RC_AUTOCORRECTION_MATH:
1978 if (ignore_system_lyxrc ||
1979 autocorrection_math != system_lyxrc.autocorrection_math) {
1980 os << "\\autocorrection_math "
1981 << convert<string>(autocorrection_math) << '\n';
1985 case RC_COMPLETION_POPUP_DELAY:
1986 if (ignore_system_lyxrc ||
1987 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1988 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1992 case RC_COMPLETION_POPUP_MATH:
1993 if (ignore_system_lyxrc ||
1994 completion_popup_math != system_lyxrc.completion_popup_math) {
1995 os << "\\completion_popup_math "
1996 << convert<string>(completion_popup_math) << '\n';
2000 case RC_COMPLETION_POPUP_TEXT:
2001 if (ignore_system_lyxrc ||
2002 completion_popup_text != system_lyxrc.completion_popup_text) {
2003 os << "\\completion_popup_text "
2004 << convert<string>(completion_popup_text) << '\n';
2008 case RC_COMPLETION_CURSOR_TEXT:
2009 if (ignore_system_lyxrc ||
2010 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2011 os << "\\completion_cursor_text "
2012 << convert<string>(completion_cursor_text) << '\n';
2016 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2017 if (ignore_system_lyxrc ||
2018 completion_popup_after_complete
2019 != system_lyxrc.completion_popup_after_complete) {
2020 os << "\\completion_popup_after_complete "
2021 << convert<string>(completion_popup_after_complete) << '\n';
2025 case RC_NUMLASTFILES:
2026 if (ignore_system_lyxrc ||
2027 num_lastfiles != system_lyxrc.num_lastfiles) {
2028 os << "\\num_lastfiles " << num_lastfiles << '\n';
2032 case RC_CHECKLASTFILES:
2033 if (ignore_system_lyxrc ||
2034 check_lastfiles != system_lyxrc.check_lastfiles) {
2035 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2040 case RC_EXAMPLEPATH:
2041 if (ignore_system_lyxrc ||
2042 example_path != system_lyxrc.example_path) {
2043 string const path = os::external_path(example_path);
2044 os << "\\example_path \"" << path << "\"\n";
2048 case RC_TEMPLATEPATH:
2049 if (ignore_system_lyxrc ||
2050 template_path != system_lyxrc.template_path) {
2051 string const path = os::external_path(template_path);
2052 os << "\\template_path \"" << path << "\"\n";
2056 case RC_TEMPDIRPATH:
2057 if (ignore_system_lyxrc ||
2058 tempdir_path != system_lyxrc.tempdir_path) {
2059 string const path = os::external_path(tempdir_path);
2060 os << "\\tempdir_path \"" << path << "\"\n";
2064 case RC_THESAURUSDIRPATH:
2065 if (ignore_system_lyxrc ||
2066 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2067 string const path = os::external_path(thesaurusdir_path);
2068 os << "\\thesaurusdir_path \"" << path << "\"\n";
2076 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2079 case RC_PLAINTEXT_LINELEN:
2080 if (ignore_system_lyxrc ||
2081 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2082 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2086 case RC_MAKE_BACKUP:
2087 if (ignore_system_lyxrc ||
2088 make_backup != system_lyxrc.make_backup) {
2089 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2093 case RC_BACKUPDIR_PATH:
2094 if (ignore_system_lyxrc ||
2095 backupdir_path != system_lyxrc.backupdir_path) {
2096 string const path = os::external_path(backupdir_path);
2097 os << "\\backupdir_path \"" << path << "\"\n";
2103 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2107 << "# SPELLCHECKER SECTION ##############################\n"
2109 case RC_SPELL_COMMAND:
2110 case RC_USE_SPELL_LIB:
2114 case RC_ACCEPT_COMPOUND:
2115 if (ignore_system_lyxrc ||
2116 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2117 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2122 case RC_USE_ALT_LANG:
2123 if (ignore_system_lyxrc ||
2124 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2125 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2131 if (ignore_system_lyxrc ||
2132 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2133 os << "\\alternate_language \"" << spellchecker_alt_lang
2138 case RC_USE_ESC_CHARS:
2139 if (ignore_system_lyxrc ||
2140 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2141 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2147 if (ignore_system_lyxrc ||
2148 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2149 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2153 case RC_USE_PERS_DICT:
2154 if (ignore_system_lyxrc ||
2155 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2156 os << "\\use_personal_dictionary "
2157 << convert<string>(spellchecker_use_pers_dict)
2162 case RC_USE_TOOLTIP:
2163 if (ignore_system_lyxrc ||
2164 use_tooltip != system_lyxrc.use_tooltip) {
2165 os << "\\use_tooltip "
2166 << convert<string>(use_tooltip)
2169 case RC_USE_PIXMAP_CACHE:
2170 if (ignore_system_lyxrc ||
2171 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2172 os << "\\use_pixmap_cache "
2173 << convert<string>(use_pixmap_cache)
2177 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2178 string const path = os::external_path(spellchecker_pers_dict);
2179 os << "\\personal_dictionary \"" << path << "\"\n";
2183 case RC_USE_INP_ENC:
2184 if (ignore_system_lyxrc ||
2185 spellchecker_use_input_encoding
2186 != system_lyxrc.spellchecker_use_input_encoding) {
2187 os << "\\use_input_encoding "
2188 << convert<string>(spellchecker_use_input_encoding)
2195 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2198 case RC_RTL_SUPPORT:
2199 if (ignore_system_lyxrc ||
2200 rtl_support != system_lyxrc.rtl_support) {
2201 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2205 case RC_VISUAL_CURSOR:
2206 if (ignore_system_lyxrc ||
2207 visual_cursor != system_lyxrc.visual_cursor) {
2208 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2212 case RC_LANGUAGE_PACKAGE:
2213 if (ignore_system_lyxrc ||
2214 language_package != system_lyxrc.language_package) {
2215 os << "\\language_package \"" << language_package
2220 case RC_LANGUAGE_GLOBAL_OPTIONS:
2221 if (ignore_system_lyxrc ||
2222 language_global_options
2223 != system_lyxrc.language_global_options) {
2224 os << "\\language_global_options \""
2225 << convert<string>(language_global_options)
2230 case RC_LANGUAGE_USE_BABEL:
2231 if (ignore_system_lyxrc ||
2232 language_use_babel != system_lyxrc.language_use_babel) {
2233 os << "\\language_use_babel \""
2234 << convert<string>(language_use_babel)
2239 case RC_LANGUAGE_COMMAND_BEGIN:
2240 if (ignore_system_lyxrc ||
2241 language_command_begin
2242 != system_lyxrc.language_command_begin) {
2243 os << "\\language_command_begin \""
2244 << language_command_begin
2249 case RC_LANGUAGE_COMMAND_END:
2250 if (ignore_system_lyxrc ||
2251 language_command_end
2252 != system_lyxrc.language_command_end) {
2253 os << "\\language_command_end \"" << language_command_end
2258 case RC_LANGUAGE_COMMAND_LOCAL:
2259 if (ignore_system_lyxrc ||
2260 language_command_local
2261 != system_lyxrc.language_command_local) {
2262 os << "\\language_command_local \""
2263 << language_command_local
2268 case RC_LANGUAGE_AUTO_BEGIN:
2269 if (ignore_system_lyxrc ||
2270 language_auto_begin != system_lyxrc.language_auto_begin) {
2271 os << "\\language_auto_begin "
2272 << convert<string>(language_auto_begin) << '\n';
2276 case RC_LANGUAGE_AUTO_END:
2277 if (ignore_system_lyxrc ||
2278 language_auto_end != system_lyxrc.language_auto_end) {
2279 os << "\\language_auto_end "
2280 << convert<string>(language_auto_end) << '\n';
2284 case RC_MARK_FOREIGN_LANGUAGE:
2285 if (ignore_system_lyxrc ||
2286 mark_foreign_language
2287 != system_lyxrc.mark_foreign_language) {
2288 os << "\\mark_foreign_language " <<
2289 convert<string>(mark_foreign_language) << '\n';
2295 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2298 case RC_AUTO_NUMBER:
2299 if (ignore_system_lyxrc ||
2300 auto_number != system_lyxrc.auto_number) {
2301 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2305 case RC_DEFAULT_LANGUAGE:
2306 if (ignore_system_lyxrc ||
2307 default_language != system_lyxrc.default_language) {
2308 os << "\\default_language " << default_language << '\n';
2312 case RC_GUI_LANGUAGE:
2313 if (ignore_system_lyxrc ||
2314 gui_language != system_lyxrc.gui_language) {
2315 os << "\\gui_language " << gui_language << '\n';
2321 << "# FORMATS SECTION ##########################\n"
2325 // New/modified formats
2326 for (Formats::const_iterator cit = formats.begin();
2327 cit != formats.end(); ++cit) {
2328 Format const * format =
2329 system_formats.getFormat(cit->name());
2331 format->extension() != cit->extension() ||
2332 format->prettyname() != cit->prettyname() ||
2333 format->shortcut() != cit->shortcut() ||
2334 format->viewer() != cit->viewer() ||
2335 format->editor() != cit->editor() ||
2336 format->documentFormat() != cit->documentFormat() ||
2337 format->vectorFormat() != cit->vectorFormat()) {
2338 os << "\\format \"" << cit->name() << "\" \""
2339 << cit->extension() << "\" \""
2340 << cit->prettyname() << "\" \""
2341 << cit->shortcut() << "\" \""
2342 << escapeCommand(cit->viewer()) << "\" \""
2343 << escapeCommand(cit->editor()) << "\" \"";
2344 vector<string> flags;
2345 if (cit->documentFormat())
2346 flags.push_back("document");
2347 if (cit->vectorFormat())
2348 flags.push_back("vector");
2349 os << getStringFromVector(flags);
2354 // Look for deleted formats
2355 for (Formats::const_iterator cit = system_formats.begin();
2356 cit != system_formats.end(); ++cit)
2357 if (!formats.getFormat(cit->name()))
2358 os << "\\format \"" << cit->name()
2359 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2368 << "# CONVERTERS SECTION ##########################\n"
2372 // Look for new converters
2373 for (Converters::const_iterator cit = theConverters().begin();
2374 cit != theConverters().end(); ++cit) {
2375 Converter const * converter =
2376 theSystemConverters().getConverter(cit->from,
2379 converter->command != cit->command ||
2380 converter->flags != cit->flags)
2381 os << "\\converter \"" << cit->from << "\" \""
2382 << cit->to << "\" \""
2383 << escapeCommand(cit->command) << "\" \""
2384 << cit->flags << "\"\n";
2387 // New/modifed converters
2388 for (Converters::const_iterator cit = theSystemConverters().begin();
2389 cit != theSystemConverters().end(); ++cit)
2390 if (!theConverters().getConverter(cit->from, cit->to))
2391 os << "\\converter \"" << cit->from
2392 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2399 << "# COPIERS SECTION ##########################\n"
2402 // Look for new movers
2403 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2404 Movers::const_iterator const sysend = theSystemMovers().end();
2405 Movers::const_iterator it = theMovers().begin();
2406 Movers::const_iterator end = theMovers().end();
2408 for (; it != end; ++it) {
2409 Movers::const_iterator const sysit =
2410 find_if(sysbegin, sysend, SameMover(*it));
2411 if (sysit == sysend) {
2412 string const & fmt = it->first;
2413 string const & command =
2414 it->second.command();
2416 os << "\\copier " << fmt
2417 << " \"" << escapeCommand(command) << "\"\n";
2423 // We don't actually delete SpecialisedMover(s) from the
2424 // map, just clear their 'command', so there's no need
2425 // to test for anything else.
2433 string const LyXRC::getDescription(LyXRCTags tag)
2438 case RC_ACCEPT_COMPOUND:
2439 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2443 case RC_USE_ALT_LANG:
2444 str = _("Specify an alternate language. The default is to use the language of the document.");
2447 case RC_PLAINTEXT_ROFF_COMMAND:
2448 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.");
2451 case RC_PLAINTEXT_LINELEN:
2452 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.");
2455 case RC_AUTOREGIONDELETE:
2456 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2459 case RC_AUTORESET_OPTIONS:
2460 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2464 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2467 case RC_AUTO_NUMBER:
2470 case RC_BACKUPDIR_PATH:
2471 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.");
2474 case RC_BIBTEX_COMMAND:
2475 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2479 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2482 case RC_CHECKLASTFILES:
2483 str = _("Select to check whether the lastfiles still exist.");
2486 case RC_CHKTEX_COMMAND:
2487 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2496 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2497 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.");
2500 case RC_MAC_LIKE_WORD_MOVEMENT:
2501 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2504 case RC_SHOW_MACRO_LABEL:
2505 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2508 case RC_CUSTOM_EXPORT_COMMAND:
2511 case RC_CUSTOM_EXPORT_FORMAT:
2514 case RC_DATE_INSERT_FORMAT:
2515 //xgettext:no-c-format
2516 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2520 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2523 case RC_DEFAULT_LANGUAGE:
2524 str = _("New documents will be assigned this language.");
2527 case RC_DEFAULT_PAPERSIZE:
2528 str = _("Specify the default paper size.");
2531 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2532 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2535 case RC_DISPLAY_GRAPHICS:
2536 str = _("Select how LyX will display any graphics.");
2539 case RC_DOCUMENTPATH:
2540 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2544 case RC_USE_ESC_CHARS:
2545 str = _("Specify additional chars that can be part of a word.");
2548 case RC_EXAMPLEPATH:
2549 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2552 case RC_FONT_ENCODING:
2553 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2559 case RC_INDEX_COMMAND:
2560 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\".");
2563 case RC_NOMENCL_COMMAND:
2564 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2571 case RC_KBMAP_PRIMARY:
2572 case RC_KBMAP_SECONDARY:
2573 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.");
2576 case RC_LABEL_INIT_LENGTH:
2577 str = _("Maximum number of words in the initialization string for a new label");
2580 case RC_LANGUAGE_AUTO_BEGIN:
2581 str = _("Select if a language switching command is needed at the beginning of the document.");
2584 case RC_LANGUAGE_AUTO_END:
2585 str = _("Select if a language switching command is needed at the end of the document.");
2588 case RC_LANGUAGE_COMMAND_BEGIN:
2589 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.");
2592 case RC_LANGUAGE_COMMAND_END:
2593 str = _("The LaTeX command for changing back to the language of the document.");
2596 case RC_LANGUAGE_COMMAND_LOCAL:
2597 str = _("The LaTeX command for local changing of the language.");
2600 case RC_LANGUAGE_GLOBAL_OPTIONS:
2601 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2604 case RC_LANGUAGE_PACKAGE:
2605 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2608 case RC_LANGUAGE_USE_BABEL:
2609 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2612 case RC_USELASTFILEPOS:
2613 str = _("De-select if you do not want LyX to scroll to saved position.");
2616 case RC_LOADSESSION:
2617 str = _("De-select to prevent loading files opened from the last LyX session.");
2620 case RC_MAKE_BACKUP:
2621 str = _("De-select if you don't want LyX to create backup files.");
2624 case RC_MARK_FOREIGN_LANGUAGE:
2625 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2628 case RC_MOUSE_WHEEL_SPEED:
2629 str = bformat(_("The scrolling speed of the mouse wheel."),
2633 case RC_COMPLETION_POPUP_DELAY:
2634 str = _("The completion popup delay.");
2637 case RC_COMPLETION_POPUP_MATH:
2638 str = _("Select to display the completion popup in math mode.");
2641 case RC_COMPLETION_POPUP_TEXT:
2642 str = _("Select to display the completion popup in text mode.");
2645 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2646 str = _("Show the completion popup without delay after non-unique completion attempt.");
2649 case RC_COMPLETION_POPUP_TEXT:
2650 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2653 case RC_COMPLETION_POPUP_DELAY:
2654 str = _("The inline completion delay.");
2657 case RC_COMPLETION_INLINE_MATH:
2658 str = _("Select to display the inline completion in math mode.");
2661 case RC_COMPLETION_INLINE_TEXT:
2662 str = _("Select to display the inline completion in text mode.");
2665 case RC_COMPLETION_INLINE_DOTS:
2666 str = _("Use \"...\" to shorten long completions.");
2669 case RC_AUTOCORRECTION_MATH:
2670 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2673 case RC_NUMLASTFILES:
2674 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2678 case RC_PATH_PREFIX:
2679 str = _("Specify those directories which should be "
2680 "prepended to the PATH environment variable. "
2681 "Use the OS native format.");
2685 case RC_USE_PERS_DICT:
2686 str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
2690 str = _("Shows a typeset preview of things such as math");
2693 case RC_PREVIEW_HASHED_LABELS:
2694 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2697 case RC_PREVIEW_SCALE_FACTOR:
2698 str = _("Scale the preview size to suit.");
2701 case RC_PRINTCOLLCOPIESFLAG:
2702 str = _("The option for specifying whether the copies should be collated.");
2705 case RC_PRINTCOPIESFLAG:
2706 str = _("The option for specifying the number of copies to print.");
2710 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2713 case RC_PRINTEVENPAGEFLAG:
2714 str = _("The option to print only even pages.");
2717 case RC_PRINTEXSTRAOPTIONS:
2718 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2721 case RC_PRINTFILEEXTENSION:
2722 str = _("Extension of printer program output file. Usually \".ps\".");
2725 case RC_PRINTLANDSCAPEFLAG:
2726 str = _("The option to print out in landscape.");
2729 case RC_PRINTODDPAGEFLAG:
2730 str = _("The option to print only odd pages.");
2733 case RC_PRINTPAGERANGEFLAG:
2734 str = _("The option for specifying a comma-separated list of pages to print.");
2737 case RC_PRINTPAPERDIMENSIONFLAG:
2738 str = _("Option to specify the dimensions of the print paper.");
2741 case RC_PRINTPAPERFLAG:
2742 str = _("The option to specify paper type.");
2745 case RC_PRINTREVERSEFLAG:
2746 str = _("The option to reverse the order of the pages printed.");
2749 case RC_PRINTSPOOL_COMMAND:
2750 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.");
2753 case RC_PRINTSPOOL_PRINTERPREFIX:
2754 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.");
2757 case RC_PRINTTOFILE:
2758 str = _("Option to pass to the print program to print to a file.");
2761 case RC_PRINTTOPRINTER:
2762 str = _("Option to pass to the print program to print on a specific printer.");
2765 case RC_PRINT_ADAPTOUTPUT:
2766 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2769 case RC_PRINT_COMMAND:
2770 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2773 case RC_RTL_SUPPORT:
2774 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2777 case RC_VISUAL_CURSOR:
2778 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2782 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2785 case RC_SCREEN_FONT_ROMAN:
2786 case RC_SCREEN_FONT_SANS:
2787 case RC_SCREEN_FONT_TYPEWRITER:
2788 str = _("The screen fonts used to display the text while editing.");
2791 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2792 case RC_SCREEN_FONT_SANS_FOUNDRY:
2793 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2796 case RC_SCREEN_FONT_SCALABLE:
2797 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.");
2800 case RC_SCREEN_FONT_SIZES:
2801 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2804 case RC_SCREEN_ZOOM:
2805 //xgettext:no-c-format
2806 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2809 case RC_GEOMETRY_SESSION:
2810 str = _("Allow session manager to save and restore windows geometry.");
2814 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2820 case RC_SHOW_BANNER:
2821 str = _("De-select if you don't want the startup banner.");
2824 case RC_TEMPDIRPATH:
2825 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2828 case RC_THESAURUSDIRPATH:
2829 str = _("This is the place where the files of the thesaurus library reside.");
2832 case RC_TEMPLATEPATH:
2833 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2836 case RC_TEX_ALLOWS_SPACES:
2839 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2843 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2855 case RC_USE_INP_ENC:
2856 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.");
2859 case RC_USE_TOOLTIP:
2860 str = _("Enable the automatic appearance of tool tips in the work area.");
2863 case RC_USE_PIXMAP_CACHE:
2864 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2867 case RC_USE_SPELL_LIB:
2870 case RC_VIEWDVI_PAPEROPTION:
2871 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2886 // The global instance
2889 // The global copy of the system lyxrc entries (everything except preferences)