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"
29 #include "FontEnums.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/userinfo.h"
44 using namespace lyx::support;
48 namespace os = support::os;
52 // when adding something to this array keep it sorted!
53 LexerKeyword lyxrcTags[] = {
54 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
55 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
56 { "\\alternate_language", LyXRC::RC_ALT_LANG },
57 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
58 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
59 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
60 { "\\autosave", LyXRC::RC_AUTOSAVE },
61 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
62 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
63 { "\\bind_file", LyXRC::RC_BINDFILE },
64 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
65 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
66 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
67 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
68 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
69 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
70 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
71 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
72 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
73 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
74 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
75 { "\\converter", LyXRC::RC_CONVERTER },
76 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
77 { "\\copier", LyXRC::RC_COPIER },
78 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
79 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
80 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
81 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
82 { "\\def_file", LyXRC::RC_DEFFILE },
83 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
84 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
85 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
86 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
87 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
88 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
89 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
90 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
91 { "\\format", LyXRC::RC_FORMAT },
92 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
93 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
94 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
95 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
96 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
97 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
98 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
99 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
100 { "\\input", LyXRC::RC_INPUT },
101 { "\\kbmap", LyXRC::RC_KBMAP },
102 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
103 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
104 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
105 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
106 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
107 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
108 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
109 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
110 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
111 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
112 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
113 { "\\load_session", LyXRC::RC_LOADSESSION },
114 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
115 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
116 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
117 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
118 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
119 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
120 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
121 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
122 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
123 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
124 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
125 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
126 { "\\preview", LyXRC::RC_PREVIEW },
127 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
128 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
129 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
130 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
131 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
132 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
133 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
134 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
135 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
136 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
137 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
138 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
139 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
140 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
141 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
142 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
143 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
144 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
145 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
146 { "\\printer", LyXRC::RC_PRINTER },
147 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
148 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
149 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
150 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
151 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
152 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
153 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
154 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
155 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
156 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
157 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
158 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
159 { "\\set_color", LyXRC::RC_SET_COLOR },
160 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
161 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
162 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
163 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
164 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
165 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
166 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
167 { "\\ui_file", LyXRC::RC_UIFILE },
168 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
169 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
170 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
171 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
172 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
173 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
174 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
175 // compatibility with versions older than 1.4.0 only
176 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
177 { "\\use_spell_lib", LyXRC::RC_USE_SPELL_LIB },
178 // compatibility with versions older than 1.4.0 only
179 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
180 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
181 { "\\user_email", LyXRC::RC_USER_EMAIL },
182 { "\\user_name", LyXRC::RC_USER_NAME },
183 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
184 // compatibility with versions older than 1.4.0 only
185 { "\\viewer", LyXRC::RC_VIEWER},
186 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
189 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
200 void LyXRC::setDefaults()
203 def_file = "default";
205 // Get printer from the environment. If fail, use default "",
206 // assuming that everything is set up correctly.
207 printer = getEnv("PRINTER");
208 print_adapt_output = false;
209 print_command = "dvips";
210 print_evenpage_flag = "-B";
211 print_oddpage_flag = "-A";
212 print_pagerange_flag = "-pp";
213 print_copies_flag = "-c";
214 print_collcopies_flag = "-C";
215 print_reverse_flag = "-r";
216 print_landscape_flag = "-t landscape";
217 print_to_printer = "-P";
218 print_to_file = "-o ";
219 print_file_extension = ".ps";
220 print_paper_flag = "-t";
221 print_paper_dimension_flag = "-T";
222 document_path.erase();
223 view_dvi_paper_option.erase();
224 default_papersize = PAPER_DEFAULT;
225 custom_export_format = "ps";
226 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
227 bibtex_command = "bibtex";
229 index_command = "makeindex -c -q";
230 nomencl_command = "makeindex -s nomencl.ist";
232 // Because a screen typically is wider than a piece of paper:
234 allow_geometry_session = true;
235 // Default LaTeX font size:
236 font_sizes[FONT_SIZE_TINY] = "5.0";
237 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
238 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
239 font_sizes[FONT_SIZE_SMALL] = "9.0";
240 font_sizes[FONT_SIZE_NORMAL] = "10.0";
241 font_sizes[FONT_SIZE_LARGE] = "12.0";
242 font_sizes[FONT_SIZE_LARGER] = "14.4";
243 font_sizes[FONT_SIZE_LARGEST] = "17.26";
244 font_sizes[FONT_SIZE_HUGE] = "20.74";
245 font_sizes[FONT_SIZE_HUGER] = "24.88";
246 use_scalable_fonts = true;
247 roman_font_name = "";
249 typewriter_font_name = "";
251 auto_region_delete = true;
252 auto_reset_options = false;
253 plaintext_linelen = 65;
254 mouse_wheel_speed = 1.0;
255 num_lastfiles = maxlastfiles;
256 check_lastfiles = true;
257 use_lastfilepos = true;
258 load_session = false;
260 backupdir_path.erase();
261 display_graphics = true;
262 // Spellchecker settings:
263 use_spell_lib = true;
264 isp_command = "ispell";
265 isp_accept_compound = false;
266 isp_use_input_encoding = false;
267 isp_use_alt_lang = false;
268 isp_use_pers_dict = false;
269 isp_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 completion_inline_math = true;
319 completion_inline_text = false;
320 completion_inline_dots = -1;
321 completion_inline_delay = 0.2;
327 void oldFontFormat(string & family, string & foundry)
329 if (family.empty() || family[0] != '-')
331 foundry = token(family, '-', 1);
332 family = token(family, '-', 2);
340 int LyXRC::read(FileName const & filename)
342 Lexer lexrc(lyxrcTags);
343 if (lyxerr.debugging(Debug::PARSER))
344 lexrc.printTable(lyxerr);
346 lexrc.setFile(filename);
350 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
356 int LyXRC::read(istream & is)
358 Lexer lexrc(lyxrcTags);
359 if (lyxerr.debugging(Debug::PARSER))
360 lexrc.printTable(lyxerr);
366 LYXERR(Debug::LYXRC, "Reading istream...");
372 int LyXRC::read(Lexer & lexrc)
374 if (!lexrc.isOK()) return -2;
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:
393 switch (static_cast<LyXRCTags>(le)) {
394 case RC_INPUT: // Include file
397 libFileSearch(string(),
400 lexrc.printError("Error reading "
401 "included file: " + tmp.absFilename());
407 bind_file = os::internal_path(lexrc.getString());
413 def_file = os::internal_path(lexrc.getString());
419 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);
678 LYXERR0("Ignoring obsolete use_tempdir flag.");
681 case RC_USELASTFILEPOS:
682 lexrc >> use_lastfilepos;
686 lexrc >> load_session;
689 case RC_MOUSE_WHEEL_SPEED:
690 lexrc >> mouse_wheel_speed;
693 case RC_COMPLETION_INLINE_DELAY:
694 lexrc >> completion_inline_delay;
697 case RC_COMPLETION_INLINE_MATH:
698 lexrc >> completion_inline_math;
701 case RC_COMPLETION_INLINE_TEXT:
702 lexrc >> completion_inline_text;
705 case RC_COMPLETION_INLINE_DOTS:
706 lexrc >> completion_inline_dots;
709 case RC_COMPLETION_POPUP_DELAY:
710 lexrc >> completion_popup_delay;
713 case RC_COMPLETION_POPUP_MATH:
714 lexrc >> completion_popup_math;
717 case RC_COMPLETION_POPUP_TEXT:
718 lexrc >> completion_popup_text;
721 case RC_COMPLETION_CURSOR_TEXT:
722 lexrc >> completion_cursor_text;
725 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
726 lexrc >> completion_popup_after_complete;
729 case RC_NUMLASTFILES:
730 lexrc >> num_lastfiles;
733 case RC_CHECKLASTFILES:
734 lexrc >> check_lastfiles;
737 case RC_SCREEN_FONT_ROMAN:
739 roman_font_name = lexrc.getString();
740 oldFontFormat(roman_font_name,
745 case RC_SCREEN_FONT_SANS:
747 sans_font_name = lexrc.getString();
748 oldFontFormat(sans_font_name, sans_font_foundry);
752 case RC_SCREEN_FONT_TYPEWRITER:
754 typewriter_font_name = lexrc.getString();
755 oldFontFormat(typewriter_font_name,
756 typewriter_font_foundry);
760 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
761 lexrc >> roman_font_foundry;
764 case RC_SCREEN_FONT_SANS_FOUNDRY:
765 lexrc >> sans_font_foundry;
768 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
769 lexrc >> typewriter_font_foundry;
774 lexrc.printError("Missing color tag.");
777 string lyx_name = lexrc.getString();
780 lexrc.printError("Missing color name for color: `$$Token'");
783 string x11_name = lexrc.getString();
785 ColorCode const col =
786 lcolor.getFromLyXName(lyx_name);
787 if (col == Color_none ||
788 col == Color_inherit ||
792 if (!lcolor.setColor(col, x11_name))
793 LYXERR0("Bad lyxrc set_color for " << lyx_name);
797 case RC_AUTOREGIONDELETE:
798 // Auto region delete defaults to true
799 lexrc >> auto_region_delete;
804 lyxpipes = os::internal_path(lexrc.getString());
805 lyxpipes = expandPath(lyxpipes);
809 case RC_CURSOR_FOLLOWS_SCROLLBAR:
810 lexrc >> cursor_follows_scrollbar;
813 case RC_MAC_LIKE_WORD_MOVEMENT:
814 lexrc >> mac_like_word_movement;
817 case RC_MACRO_EDIT_STYLE:
819 switch (lexrc.getInteger()) {
820 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
821 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
822 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
827 case RC_DIALOGS_ICONIFY_WITH_MAIN:
828 lexrc >> dialogs_iconify_with_main;
831 case RC_PLAINTEXT_ROFF_COMMAND:
832 if (lexrc.next(true)) {
833 plaintext_roff_command = lexrc.getString();
836 case RC_PLAINTEXT_LINELEN:
837 lexrc >> plaintext_linelen;
839 // Spellchecker settings:
840 case RC_USE_SPELL_LIB:
841 lexrc >> use_spell_lib;
843 case RC_SPELL_COMMAND:
844 if (lexrc.next(true))
845 isp_command = lexrc.getString();
847 case RC_ACCEPT_COMPOUND:
848 lexrc >> isp_accept_compound;
851 lexrc >> isp_use_input_encoding;
853 case RC_USE_ALT_LANG:
854 lexrc >> isp_use_alt_lang;
856 case RC_USE_PERS_DICT:
857 lexrc >> isp_use_pers_dict;
860 lexrc >> use_tooltip;
862 case RC_USE_PIXMAP_CACHE:
863 lexrc >> use_pixmap_cache;
865 case RC_USE_ESC_CHARS:
866 lexrc >> isp_use_esc_chars;
869 lexrc >> isp_alt_lang;
873 isp_pers_dict = os::internal_path(lexrc.getString());
876 lexrc >> isp_esc_chars;
879 lexrc >> make_backup;
881 case RC_BACKUPDIR_PATH:
883 backupdir_path = os::internal_path(lexrc.getString());
884 backupdir_path = expandPath(backupdir_path);
887 case RC_DATE_INSERT_FORMAT:
888 lexrc >> date_insert_format;
890 case RC_LANGUAGE_PACKAGE:
891 lexrc >> language_package;
893 case RC_LANGUAGE_AUTO_BEGIN:
894 lexrc >> language_auto_begin;
896 case RC_LANGUAGE_AUTO_END:
897 lexrc >> language_auto_end;
899 case RC_LANGUAGE_GLOBAL_OPTIONS:
900 lexrc >> language_global_options;
902 case RC_LANGUAGE_USE_BABEL:
903 lexrc >> language_use_babel;
905 case RC_LANGUAGE_COMMAND_BEGIN:
906 lexrc >> language_command_begin;
908 case RC_LANGUAGE_COMMAND_END:
909 lexrc >> language_command_end;
911 case RC_LANGUAGE_COMMAND_LOCAL:
912 lexrc >> language_command_local;
915 lexrc >> rtl_support;
917 case RC_VISUAL_CURSOR:
918 lexrc >> visual_cursor;
921 lexrc >> auto_number;
923 case RC_MARK_FOREIGN_LANGUAGE:
924 lexrc >> mark_foreign_language;
930 fmt = lexrc.getString();
931 if (lexrc.next(true))
932 command = lexrc.getString();
933 setMover(fmt, command);
938 string from, to, command, flags;
940 from = lexrc.getString();
942 to = lexrc.getString();
943 if (lexrc.next(true))
944 command = lexrc.getString();
946 flags = lexrc.getString();
948 theConverters().erase(from, to);
950 theConverters().add(from, to, command, flags);
953 // compatibility with versions older than 1.4.0 only
955 string format, command;
956 lexrc >> format >> command;
957 formats.setViewer(format, command);
961 string format, extension, prettyname, shortcut;
962 lexrc >> format >> extension >> prettyname >> shortcut;
963 string viewer, editor;
964 if (lexrc.next(true))
965 viewer = lexrc.getString();
966 if (lexrc.next(true))
967 editor = lexrc.getString();
969 // Hack to ensure compatibility with versions older
971 int le = lexrc.lex();
972 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
973 flags = lexrc.getString();
974 if (le != Lexer::LEX_DATA) {
975 // We have got a known token.
976 // Therefore this is an old style
977 // format definition without
979 lexrc.pushToken(flags);
983 int flgs = Format::none;
984 while (!flags.empty()) {
986 flags = split(flags, flag, ',');
987 if (flag == "document")
988 flgs |= Format::document;
989 else if (flag == "vector")
990 flgs |= Format::vector;
992 LYXERR0("Ignoring unknown flag `"
993 << flag << "' for format `"
996 if (prettyname.empty()) {
997 if (theConverters().formatIsUsed(format))
998 LYXERR0("Can't delete format " << format);
1000 formats.erase(format);
1002 formats.add(format, extension, prettyname,
1003 shortcut, viewer, editor, flgs);
1007 case RC_DEFAULT_LANGUAGE:
1008 lexrc >> default_language;
1011 case RC_GUI_LANGUAGE:
1012 lexrc >> gui_language;
1015 case RC_LABEL_INIT_LENGTH:
1016 lexrc >> label_init_length;
1019 case RC_SHOW_BANNER:
1020 lexrc >> show_banner;
1025 string const tmp = lexrc.getString();
1026 if (tmp == "true" || tmp == "on")
1027 preview = PREVIEW_ON;
1028 else if (tmp == "no_math")
1029 preview = PREVIEW_NO_MATH;
1031 preview = PREVIEW_OFF;
1032 if (tmp != "false" && tmp != "off")
1033 LYXERR0("Unrecognized preview status \""
1039 case RC_PREVIEW_HASHED_LABELS:
1040 lexrc >> preview_hashed_labels;
1043 case RC_PREVIEW_SCALE_FACTOR:
1044 lexrc >> preview_scale_factor;
1051 lexrc >> user_email;
1054 case RC_PATH_PREFIX:
1055 lexrc >> path_prefix;
1058 case RC_USE_CONVERTER_CACHE:
1059 lexrc >> use_converter_cache;
1061 case RC_CONVERTER_CACHE_MAXAGE:
1062 lexrc >> converter_cache_maxage;
1065 case RC_SORT_LAYOUTS:
1066 lexrc >> sort_layouts;
1068 case RC_GROUP_LAYOUTS:
1069 lexrc >> group_layouts;
1071 case RC_FULL_SCREEN_LIMIT:
1072 lexrc >> full_screen_limit;
1074 case RC_FULL_SCREEN_TOOLBARS:
1075 lexrc >> full_screen_toolbars;
1077 case RC_FULL_SCREEN_SCROLLBAR:
1078 lexrc >> full_screen_scrollbar;
1080 case RC_FULL_SCREEN_TABBAR:
1081 lexrc >> full_screen_tabbar;
1083 case RC_FULL_SCREEN_WIDTH:
1084 lexrc >> full_screen_width;
1086 case RC_OPEN_BUFFERS_IN_TABS:
1087 lexrc >> open_buffers_in_tabs;
1091 break; // this is just a dummy
1095 /// Update converters data-structures
1096 theConverters().update(formats);
1097 theConverters().buildGraph();
1103 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1105 ofstream ofs(filename.toFilesystemEncoding().c_str());
1107 write(ofs, ignore_system_lyxrc);
1111 void LyXRC::print() const
1113 if (lyxerr.debugging())
1114 write(lyxerr, false);
1122 typedef pair<string, SpecialisedMover> Data;
1124 SameMover(Data const & comparison)
1125 : comparison_(comparison) {}
1127 bool operator()(Data const & data) const
1129 return data.first == comparison_.first &&
1130 data.second.command() == comparison_.second.command();
1140 // Escape \ and " so that LyXLex can read the string later
1141 string escapeCommand(string const & str) {
1142 return subst(subst(str , "\\", "\\\\"),
1149 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1151 LyXRCTags tag = RC_LAST;
1153 if (!name.empty()) {
1154 for (int i = 0; i != lyxrcCount; ++i)
1155 if ("\\" + name == lyxrcTags[i].tag)
1156 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1160 os << "# This file is written by LyX, if you want to make your own\n"
1161 << "# modifications you should do them from inside LyX and save\n"
1164 // Why the switch you might ask. It is a trick to ensure that all
1165 // the elements in the LyXRCTags enum are handled. As you can see
1166 // there are no breaks at all. So it is just a huge fall-through.
1167 // The nice thing is that we will get a warning from the compiler
1168 // if we forget an element.
1172 // input/include files are not done here
1174 if (ignore_system_lyxrc ||
1175 bind_file != system_lyxrc.bind_file) {
1176 string const path = os::external_path(bind_file);
1177 os << "\\bind_file \"" << path << "\"\n";
1183 if (ignore_system_lyxrc ||
1184 def_file != system_lyxrc.def_file) {
1185 string const path = os::external_path(def_file);
1186 os << "\\def_file \"" << path << "\"\n";
1195 << "# MISC SECTION ######################################\n"
1197 // bind files are not done here.
1199 case RC_PATH_PREFIX:
1200 if (ignore_system_lyxrc ||
1201 path_prefix != system_lyxrc.path_prefix) {
1202 os << "\\path_prefix \"" << path_prefix << "\"\n";
1207 if (ignore_system_lyxrc ||
1208 ui_file != system_lyxrc.ui_file) {
1209 string const path = os::external_path(ui_file);
1210 os << "\\ui_file \"" << path << "\"\n";
1214 case RC_AUTOREGIONDELETE:
1215 if (ignore_system_lyxrc ||
1216 auto_region_delete != system_lyxrc.auto_region_delete) {
1217 os << "# Set to false to inhibit automatic replacement of\n"
1218 << "# the current selection.\n"
1219 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1224 case RC_AUTORESET_OPTIONS:
1225 if (ignore_system_lyxrc ||
1226 auto_reset_options != system_lyxrc.auto_reset_options) {
1227 os << "# Set to false to inhibit automatic reset of\n"
1228 << "# the class options to defaults on class change.\n"
1229 << "\\auto_reset_options "
1230 << convert<string>(auto_reset_options)
1236 if (ignore_system_lyxrc ||
1237 autosave != system_lyxrc.autosave) {
1238 os << "# The time interval between auto-saves in seconds.\n"
1239 << "\\autosave " << autosave << '\n';
1243 case RC_DISPLAY_GRAPHICS:
1244 if (ignore_system_lyxrc ||
1245 display_graphics != system_lyxrc.display_graphics) {
1246 os << "# Display graphics within LyX\n"
1248 << "\\display_graphics "
1249 << (display_graphics ? "true" : "false")
1254 case RC_SORT_LAYOUTS:
1255 if (ignore_system_lyxrc ||
1256 sort_layouts != system_lyxrc.sort_layouts) {
1257 os << "# Sort layouts alphabetically.\n"
1258 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1262 case RC_GROUP_LAYOUTS:
1263 if (ignore_system_lyxrc ||
1264 group_layouts != system_lyxrc.group_layouts) {
1265 os << "# Group layouts by their category.\n"
1266 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1270 case RC_VIEWDVI_PAPEROPTION:
1271 if (ignore_system_lyxrc ||
1272 view_dvi_paper_option
1273 != system_lyxrc.view_dvi_paper_option) {
1274 os << "# Options used to specify paper size to the\n"
1275 << "# view_dvi_command (e.g. -paper)\n"
1276 << "\\view_dvi_paper_option \""
1277 << view_dvi_paper_option << "\"\n";
1281 case RC_DEFAULT_PAPERSIZE:
1282 if (ignore_system_lyxrc ||
1283 default_papersize != system_lyxrc.default_papersize) {
1284 os << "# The default papersize to use.\n"
1285 << "\\default_papersize \"";
1286 switch (default_papersize) {
1288 os << "default"; break;
1289 case PAPER_USLETTER:
1290 os << "usletter"; break;
1292 os << "legal"; break;
1293 case PAPER_USEXECUTIVE:
1294 os << "executive"; break;
1305 case PAPER_B4: break;
1311 case RC_CHKTEX_COMMAND:
1312 if (ignore_system_lyxrc ||
1313 chktex_command != system_lyxrc.chktex_command) {
1314 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1318 case RC_BIBTEX_COMMAND:
1319 if (ignore_system_lyxrc ||
1320 bibtex_command != system_lyxrc.bibtex_command) {
1321 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1325 case RC_INDEX_COMMAND:
1326 if (ignore_system_lyxrc ||
1327 index_command != system_lyxrc.index_command) {
1328 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1332 case RC_NOMENCL_COMMAND:
1333 if (ignore_system_lyxrc ||
1334 nomencl_command != system_lyxrc.nomencl_command) {
1335 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1339 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1340 if (ignore_system_lyxrc ||
1341 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1342 os << "\\tex_expects_windows_paths "
1343 << convert<string>(windows_style_tex_paths) << '\n';
1347 case RC_TEX_ALLOWS_SPACES:
1348 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1349 os << "\\tex_allows_spaces "
1350 << convert<string>(tex_allows_spaces) << '\n';
1355 if (ignore_system_lyxrc ||
1356 use_kbmap != system_lyxrc.use_kbmap) {
1357 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1361 case RC_KBMAP_PRIMARY:
1362 if (ignore_system_lyxrc ||
1363 primary_kbmap != system_lyxrc.primary_kbmap) {
1364 string const path = os::external_path(primary_kbmap);
1365 os << "\\kbmap_primary \"" << path << "\"\n";
1369 case RC_KBMAP_SECONDARY:
1370 if (ignore_system_lyxrc ||
1371 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1372 string const path = os::external_path(secondary_kbmap);
1373 os << "\\kbmap_secondary \"" << path << "\"\n";
1378 if (ignore_system_lyxrc ||
1379 lyxpipes != system_lyxrc.lyxpipes) {
1380 string const path = os::external_path(lyxpipes);
1381 os << "\\serverpipe \"" << path << "\"\n";
1385 case RC_DATE_INSERT_FORMAT:
1386 if (ignore_system_lyxrc ||
1387 date_insert_format != system_lyxrc.date_insert_format) {
1388 os << "\\date_insert_format \"" << date_insert_format
1393 case RC_LABEL_INIT_LENGTH:
1394 if (ignore_system_lyxrc ||
1395 label_init_length != system_lyxrc.label_init_length) {
1396 os << "\\label_init_length " << label_init_length
1403 os << "\\user_name \"" << user_name << "\"\n";
1408 os << "\\user_email \"" << user_email << "\"\n";
1412 case RC_SHOW_BANNER:
1413 if (ignore_system_lyxrc ||
1414 show_banner != system_lyxrc.show_banner) {
1415 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1421 if (ignore_system_lyxrc ||
1422 preview != system_lyxrc.preview) {
1428 case PREVIEW_NO_MATH:
1435 os << "\\preview " << status << '\n';
1440 case RC_PREVIEW_HASHED_LABELS:
1441 if (ignore_system_lyxrc ||
1442 preview_hashed_labels !=
1443 system_lyxrc.preview_hashed_labels) {
1444 os << "\\preview_hashed_labels "
1445 << convert<string>(preview_hashed_labels) << '\n';
1450 case RC_PREVIEW_SCALE_FACTOR:
1451 if (ignore_system_lyxrc ||
1452 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1453 os << "\\preview_scale_factor "
1454 << preview_scale_factor << '\n';
1459 case RC_USE_CONVERTER_CACHE:
1460 if (ignore_system_lyxrc ||
1461 use_converter_cache != system_lyxrc.use_converter_cache) {
1462 os << "\\use_converter_cache "
1463 << convert<string>(use_converter_cache) << '\n';
1468 case RC_CONVERTER_CACHE_MAXAGE:
1469 if (ignore_system_lyxrc ||
1470 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1471 os << "\\converter_cache_maxage "
1472 << converter_cache_maxage << '\n';
1478 << "# SCREEN & FONTS SECTION ############################\n"
1482 if (ignore_system_lyxrc ||
1483 dpi != system_lyxrc.dpi) {
1484 os << "\\screen_dpi " << dpi << '\n';
1488 case RC_SCREEN_ZOOM:
1489 if (ignore_system_lyxrc ||
1490 zoom != system_lyxrc.zoom) {
1491 os << "\\screen_zoom " << zoom << '\n';
1495 case RC_GEOMETRY_SESSION:
1496 if (ignore_system_lyxrc ||
1497 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1498 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1503 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1504 if (ignore_system_lyxrc ||
1505 cursor_follows_scrollbar
1506 != system_lyxrc.cursor_follows_scrollbar) {
1507 os << "\\cursor_follows_scrollbar "
1508 << convert<string>(cursor_follows_scrollbar) << '\n';
1512 case RC_MAC_LIKE_WORD_MOVEMENT:
1513 if (ignore_system_lyxrc ||
1514 mac_like_word_movement
1515 != system_lyxrc.mac_like_word_movement) {
1516 os << "\\mac_like_word_movement "
1517 << convert<string>(mac_like_word_movement) << '\n';
1521 case RC_MACRO_EDIT_STYLE:
1522 if (ignore_system_lyxrc ||
1524 != system_lyxrc.macro_edit_style) {
1525 os << "\\macro_edit_style ";
1526 switch (macro_edit_style) {
1527 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1528 case MACRO_EDIT_INLINE: os << "1\n"; break;
1529 case MACRO_EDIT_LIST: os << "2\n"; break;
1534 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1535 if (ignore_system_lyxrc ||
1536 dialogs_iconify_with_main
1537 != system_lyxrc.dialogs_iconify_with_main) {
1538 os << "\\dialogs_iconify_with_main "
1539 << convert<string>(dialogs_iconify_with_main) << '\n';
1543 case RC_SCREEN_FONT_ROMAN:
1544 if (ignore_system_lyxrc ||
1545 roman_font_name != system_lyxrc.roman_font_name) {
1546 os << "\\screen_font_roman \"" << roman_font_name
1551 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1552 if (ignore_system_lyxrc ||
1553 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1554 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1559 case RC_SCREEN_FONT_SANS:
1560 if (ignore_system_lyxrc ||
1561 sans_font_name != system_lyxrc.sans_font_name) {
1562 os << "\\screen_font_sans \"" << sans_font_name
1567 case RC_SCREEN_FONT_SANS_FOUNDRY:
1568 if (ignore_system_lyxrc ||
1569 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1570 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1575 case RC_SCREEN_FONT_TYPEWRITER:
1576 if (ignore_system_lyxrc ||
1577 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1578 os << "\\screen_font_typewriter \""
1579 << typewriter_font_name << "\"\n";
1583 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1584 if (ignore_system_lyxrc ||
1585 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1586 os << "\\screen_font_typewriter_foundry \""
1587 << typewriter_font_foundry << "\"\n";
1592 case RC_SCREEN_FONT_SCALABLE:
1593 if (ignore_system_lyxrc ||
1594 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1595 os << "\\screen_font_scalable "
1596 << convert<string>(use_scalable_fonts)
1601 case RC_SCREEN_FONT_SIZES:
1602 if (ignore_system_lyxrc ||
1603 font_sizes[FONT_SIZE_TINY]
1604 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1605 font_sizes[FONT_SIZE_SCRIPT]
1606 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1607 font_sizes[FONT_SIZE_FOOTNOTE]
1608 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1609 font_sizes[FONT_SIZE_SMALL]
1610 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1611 font_sizes[FONT_SIZE_NORMAL]
1612 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1613 font_sizes[FONT_SIZE_LARGE]
1614 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1615 font_sizes[FONT_SIZE_LARGER]
1616 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1617 font_sizes[FONT_SIZE_LARGEST]
1618 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1619 font_sizes[FONT_SIZE_HUGE]
1620 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1621 font_sizes[FONT_SIZE_HUGER]
1622 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1623 os.setf(ios::fixed);
1625 os << "\\screen_font_sizes"
1626 << ' ' << font_sizes[FONT_SIZE_TINY]
1627 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1628 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1629 << ' ' << font_sizes[FONT_SIZE_SMALL]
1630 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1631 << ' ' << font_sizes[FONT_SIZE_LARGE]
1632 << ' ' << font_sizes[FONT_SIZE_LARGER]
1633 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1634 << ' ' << font_sizes[FONT_SIZE_HUGE]
1635 << ' ' << font_sizes[FONT_SIZE_HUGER]
1640 case RC_FULL_SCREEN_LIMIT:
1641 if (ignore_system_lyxrc ||
1642 full_screen_limit != system_lyxrc.full_screen_limit) {
1643 os << "\\fullscreen_limit "
1644 << convert<string>(full_screen_limit)
1649 case RC_FULL_SCREEN_TOOLBARS:
1650 if (ignore_system_lyxrc ||
1651 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1652 os << "\\fullscreen_toolbars "
1653 << convert<string>(full_screen_toolbars)
1658 case RC_FULL_SCREEN_SCROLLBAR:
1659 if (ignore_system_lyxrc ||
1660 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1661 os << "\\fullscreen_scrollbar "
1662 << convert<string>(full_screen_scrollbar)
1667 case RC_FULL_SCREEN_TABBAR:
1668 if (ignore_system_lyxrc ||
1669 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1670 os << "\\fullscreen_tabbar "
1671 << convert<string>(full_screen_tabbar)
1676 case RC_FULL_SCREEN_WIDTH:
1677 if (ignore_system_lyxrc ||
1678 full_screen_width != system_lyxrc.full_screen_width) {
1679 os << "\\fullscreen_width "
1680 << convert<string>(full_screen_width)
1685 case RC_OPEN_BUFFERS_IN_TABS:
1686 if (ignore_system_lyxrc ||
1687 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1688 os << "\\open_buffers_in_tabs "
1689 << convert<string>(open_buffers_in_tabs)
1696 << "# COLOR SECTION ###################################\n"
1700 for (int i = 0; i < Color_ignore; ++i) {
1701 ColorCode lc = static_cast<ColorCode>(i);
1702 string const col = lcolor.getX11Name(lc);
1703 if (ignore_system_lyxrc
1704 || col != system_lcolor.getX11Name(lc)) {
1705 os << "\\set_color \""
1706 << lcolor.getLyXName(lc) << "\" \""
1714 << "# PRINTER SECTION ###################################\n"
1718 if (ignore_system_lyxrc ||
1719 printer != system_lyxrc.printer) {
1720 os << "\\printer \"" << printer << "\"\n";
1724 case RC_PRINT_ADAPTOUTPUT:
1725 if (ignore_system_lyxrc ||
1726 print_adapt_output != system_lyxrc.print_adapt_output) {
1727 os << "\\print_adapt_output "
1728 << convert<string>(print_adapt_output)
1733 case RC_PRINT_COMMAND:
1734 if (ignore_system_lyxrc ||
1735 print_command != system_lyxrc.print_command) {
1736 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1740 case RC_PRINTEXSTRAOPTIONS:
1741 if (ignore_system_lyxrc ||
1742 print_extra_options != system_lyxrc.print_extra_options) {
1743 os << "\\print_extra_options \"" << print_extra_options
1748 case RC_PRINTSPOOL_COMMAND:
1749 if (ignore_system_lyxrc ||
1750 print_spool_command != system_lyxrc.print_spool_command) {
1751 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1756 case RC_PRINTSPOOL_PRINTERPREFIX:
1757 if (ignore_system_lyxrc ||
1758 print_spool_printerprefix
1759 != system_lyxrc.print_spool_printerprefix) {
1760 os << "\\print_spool_printerprefix \""
1761 << print_spool_printerprefix << "\"\n";
1765 case RC_PRINTEVENPAGEFLAG:
1766 if (ignore_system_lyxrc ||
1767 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1768 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1773 case RC_PRINTODDPAGEFLAG:
1774 if (ignore_system_lyxrc ||
1775 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1776 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1781 case RC_PRINTREVERSEFLAG:
1782 if (ignore_system_lyxrc ||
1783 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1784 os << "\\print_reverse_flag \"" << print_reverse_flag
1789 case RC_PRINTLANDSCAPEFLAG:
1790 if (ignore_system_lyxrc ||
1791 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1792 os << "\\print_landscape_flag \"" << print_landscape_flag
1797 case RC_PRINTPAGERANGEFLAG:
1798 if (ignore_system_lyxrc ||
1799 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1800 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1805 case RC_PRINTCOPIESFLAG:
1806 if (ignore_system_lyxrc ||
1807 print_copies_flag != system_lyxrc.print_copies_flag) {
1808 os << "\\print_copies_flag \"" << print_copies_flag
1813 case RC_PRINTCOLLCOPIESFLAG:
1814 if (ignore_system_lyxrc ||
1815 print_collcopies_flag
1816 != system_lyxrc.print_collcopies_flag) {
1817 os << "\\print_collcopies_flag \""
1818 << print_collcopies_flag
1823 case RC_PRINTPAPERFLAG:
1824 if (ignore_system_lyxrc ||
1825 print_paper_flag != system_lyxrc.print_paper_flag) {
1826 os << "\\print_paper_flag \"" << print_paper_flag
1831 case RC_PRINTPAPERDIMENSIONFLAG:
1832 if (ignore_system_lyxrc ||
1833 print_paper_dimension_flag
1834 != system_lyxrc.print_paper_dimension_flag) {
1835 os << "\\print_paper_dimension_flag \""
1836 << print_paper_dimension_flag << "\"\n";
1840 case RC_PRINTTOPRINTER:
1841 if (ignore_system_lyxrc ||
1842 print_to_printer != system_lyxrc.print_to_printer) {
1843 os << "\\print_to_printer \"" << print_to_printer
1848 case RC_PRINTTOFILE:
1849 if (ignore_system_lyxrc ||
1850 print_to_file != system_lyxrc.print_to_file) {
1851 string const path = os::external_path(print_to_file);
1852 os << "\\print_to_file \"" << path << "\"\n";
1856 case RC_PRINTFILEEXTENSION:
1857 if (ignore_system_lyxrc ||
1858 print_file_extension != system_lyxrc.print_file_extension) {
1859 os << "\\print_file_extension \""
1860 << print_file_extension
1867 << "# EXPORT SECTION ####################################\n"
1870 case RC_CUSTOM_EXPORT_COMMAND:
1871 if (ignore_system_lyxrc ||
1872 custom_export_command
1873 != system_lyxrc.custom_export_command) {
1874 os << "\\custom_export_command \""
1875 << custom_export_command
1880 case RC_CUSTOM_EXPORT_FORMAT:
1881 if (ignore_system_lyxrc ||
1882 custom_export_format
1883 != system_lyxrc.custom_export_format) {
1884 os << "\\custom_export_format \"" << custom_export_format
1891 << "# TEX SECTION #######################################\n"
1894 case RC_FONT_ENCODING:
1895 if (ignore_system_lyxrc ||
1896 fontenc != system_lyxrc.fontenc) {
1897 os << "\\font_encoding \"" << fontenc << "\"\n";
1903 << "# FILE SECTION ######################################\n"
1906 case RC_DOCUMENTPATH:
1907 if (ignore_system_lyxrc ||
1908 document_path != system_lyxrc.document_path) {
1909 string const path = os::external_path(document_path);
1910 os << "\\document_path \"" << path << "\"\n";
1914 case RC_USELASTFILEPOS:
1915 if (ignore_system_lyxrc ||
1916 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1917 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1922 case RC_LOADSESSION:
1923 if (ignore_system_lyxrc ||
1924 load_session != system_lyxrc.load_session) {
1925 os << "\\load_session " << convert<string>(load_session)
1930 case RC_MOUSE_WHEEL_SPEED:
1931 if (ignore_system_lyxrc ||
1932 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1933 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1937 case RC_COMPLETION_INLINE_DELAY:
1938 if (ignore_system_lyxrc ||
1939 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1940 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1944 case RC_COMPLETION_INLINE_MATH:
1945 if (ignore_system_lyxrc ||
1946 completion_inline_math != system_lyxrc.completion_inline_math) {
1947 os << "\\completion_inline_math "
1948 << convert<string>(completion_inline_math) << '\n';
1952 case RC_COMPLETION_INLINE_TEXT:
1953 if (ignore_system_lyxrc ||
1954 completion_inline_text != system_lyxrc.completion_inline_text) {
1955 os << "\\completion_inline_text "
1956 << convert<string>(completion_inline_text) << '\n';
1960 case RC_COMPLETION_INLINE_DOTS:
1961 if (ignore_system_lyxrc ||
1962 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1963 os << "\\completion_inline_dots "
1964 << convert<string>(completion_inline_dots) << '\n';
1968 case RC_COMPLETION_POPUP_DELAY:
1969 if (ignore_system_lyxrc ||
1970 completion_popup_delay != system_lyxrc.completion_popup_delay) {
1971 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
1975 case RC_COMPLETION_POPUP_MATH:
1976 if (ignore_system_lyxrc ||
1977 completion_popup_math != system_lyxrc.completion_popup_math) {
1978 os << "\\completion_popup_math "
1979 << convert<string>(completion_popup_math) << '\n';
1983 case RC_COMPLETION_POPUP_TEXT:
1984 if (ignore_system_lyxrc ||
1985 completion_popup_text != system_lyxrc.completion_popup_text) {
1986 os << "\\completion_popup_text "
1987 << convert<string>(completion_popup_text) << '\n';
1991 case RC_COMPLETION_CURSOR_TEXT:
1992 if (ignore_system_lyxrc ||
1993 completion_cursor_text != system_lyxrc.completion_cursor_text) {
1994 os << "\\completion_cursor_text "
1995 << convert<string>(completion_cursor_text) << '\n';
1999 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2000 if (ignore_system_lyxrc ||
2001 completion_popup_after_complete
2002 != system_lyxrc.completion_popup_after_complete) {
2003 os << "\\completion_popup_after_complete "
2004 << convert<string>(completion_popup_after_complete) << '\n';
2008 case RC_NUMLASTFILES:
2009 if (ignore_system_lyxrc ||
2010 num_lastfiles != system_lyxrc.num_lastfiles) {
2011 os << "\\num_lastfiles " << num_lastfiles << '\n';
2015 case RC_CHECKLASTFILES:
2016 if (ignore_system_lyxrc ||
2017 check_lastfiles != system_lyxrc.check_lastfiles) {
2018 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2023 case RC_EXAMPLEPATH:
2024 if (ignore_system_lyxrc ||
2025 example_path != system_lyxrc.example_path) {
2026 string const path = os::external_path(example_path);
2027 os << "\\example_path \"" << path << "\"\n";
2031 case RC_TEMPLATEPATH:
2032 if (ignore_system_lyxrc ||
2033 template_path != system_lyxrc.template_path) {
2034 string const path = os::external_path(template_path);
2035 os << "\\template_path \"" << path << "\"\n";
2039 case RC_TEMPDIRPATH:
2040 if (ignore_system_lyxrc ||
2041 tempdir_path != system_lyxrc.tempdir_path) {
2042 string const path = os::external_path(tempdir_path);
2043 os << "\\tempdir_path \"" << path << "\"\n";
2051 case RC_PLAINTEXT_LINELEN:
2052 if (ignore_system_lyxrc ||
2053 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2054 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2058 case RC_MAKE_BACKUP:
2059 if (ignore_system_lyxrc ||
2060 make_backup != system_lyxrc.make_backup) {
2061 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2065 case RC_BACKUPDIR_PATH:
2066 if (ignore_system_lyxrc ||
2067 backupdir_path != system_lyxrc.backupdir_path) {
2068 string const path = os::external_path(backupdir_path);
2069 os << "\\backupdir_path \"" << path << "\"\n";
2075 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2078 case RC_PLAINTEXT_ROFF_COMMAND:
2079 if (ignore_system_lyxrc ||
2080 plaintext_roff_command != system_lyxrc.plaintext_roff_command) {
2081 os << "\\plaintext_roff_command \"" << escapeCommand(plaintext_roff_command)
2088 << "# SPELLCHECKER SECTION ##############################\n"
2090 case RC_USE_SPELL_LIB:
2091 if (ignore_system_lyxrc ||
2092 use_spell_lib != system_lyxrc.use_spell_lib) {
2093 os << "\\use_spell_lib " << convert<string>(use_spell_lib) << '\n';
2097 case RC_SPELL_COMMAND:
2098 if (ignore_system_lyxrc ||
2099 isp_command != system_lyxrc.isp_command) {
2100 os << "\\spell_command \"" << escapeCommand(isp_command) << "\"\n";
2104 case RC_ACCEPT_COMPOUND:
2105 if (ignore_system_lyxrc ||
2106 isp_accept_compound != system_lyxrc.isp_accept_compound) {
2107 os << "\\accept_compound " << convert<string>(isp_accept_compound)
2112 case RC_USE_ALT_LANG:
2113 if (ignore_system_lyxrc ||
2114 isp_use_alt_lang != system_lyxrc.isp_use_alt_lang) {
2115 os << "\\use_alt_language " << convert<string>(isp_use_alt_lang)
2121 if (ignore_system_lyxrc ||
2122 isp_alt_lang != system_lyxrc.isp_alt_lang) {
2123 os << "\\alternate_language \"" << isp_alt_lang
2128 case RC_USE_ESC_CHARS:
2129 if (ignore_system_lyxrc ||
2130 isp_use_esc_chars != system_lyxrc.isp_use_esc_chars) {
2131 os << "\\use_escape_chars " << convert<string>(isp_use_esc_chars)
2137 if (ignore_system_lyxrc ||
2138 isp_esc_chars != system_lyxrc.isp_esc_chars) {
2139 os << "\\escape_chars \"" << isp_esc_chars << "\"\n";
2143 case RC_USE_PERS_DICT:
2144 if (ignore_system_lyxrc ||
2145 isp_use_pers_dict != system_lyxrc.isp_use_pers_dict) {
2146 os << "\\use_personal_dictionary "
2147 << convert<string>(isp_use_pers_dict)
2152 case RC_USE_TOOLTIP:
2153 if (ignore_system_lyxrc ||
2154 use_tooltip != system_lyxrc.use_tooltip) {
2155 os << "\\use_tooltip "
2156 << convert<string>(use_tooltip)
2159 case RC_USE_PIXMAP_CACHE:
2160 if (ignore_system_lyxrc ||
2161 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2162 os << "\\use_pixmap_cache "
2163 << convert<string>(use_pixmap_cache)
2167 if (isp_pers_dict != system_lyxrc.isp_pers_dict) {
2168 string const path = os::external_path(isp_pers_dict);
2169 os << "\\personal_dictionary \"" << path << "\"\n";
2173 case RC_USE_INP_ENC:
2174 if (ignore_system_lyxrc ||
2175 isp_use_input_encoding
2176 != system_lyxrc.isp_use_input_encoding) {
2177 os << "\\use_input_encoding "
2178 << convert<string>(isp_use_input_encoding)
2185 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2188 case RC_RTL_SUPPORT:
2189 if (ignore_system_lyxrc ||
2190 rtl_support != system_lyxrc.rtl_support) {
2191 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2195 case RC_VISUAL_CURSOR:
2196 if (ignore_system_lyxrc ||
2197 visual_cursor != system_lyxrc.visual_cursor) {
2198 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2202 case RC_LANGUAGE_PACKAGE:
2203 if (ignore_system_lyxrc ||
2204 language_package != system_lyxrc.language_package) {
2205 os << "\\language_package \"" << language_package
2210 case RC_LANGUAGE_GLOBAL_OPTIONS:
2211 if (ignore_system_lyxrc ||
2212 language_global_options
2213 != system_lyxrc.language_global_options) {
2214 os << "\\language_global_options \""
2215 << convert<string>(language_global_options)
2220 case RC_LANGUAGE_USE_BABEL:
2221 if (ignore_system_lyxrc ||
2222 language_use_babel != system_lyxrc.language_use_babel) {
2223 os << "\\language_use_babel \""
2224 << convert<string>(language_use_babel)
2229 case RC_LANGUAGE_COMMAND_BEGIN:
2230 if (ignore_system_lyxrc ||
2231 language_command_begin
2232 != system_lyxrc.language_command_begin) {
2233 os << "\\language_command_begin \""
2234 << language_command_begin
2239 case RC_LANGUAGE_COMMAND_END:
2240 if (ignore_system_lyxrc ||
2241 language_command_end
2242 != system_lyxrc.language_command_end) {
2243 os << "\\language_command_end \"" << language_command_end
2248 case RC_LANGUAGE_COMMAND_LOCAL:
2249 if (ignore_system_lyxrc ||
2250 language_command_local
2251 != system_lyxrc.language_command_local) {
2252 os << "\\language_command_local \""
2253 << language_command_local
2258 case RC_LANGUAGE_AUTO_BEGIN:
2259 if (ignore_system_lyxrc ||
2260 language_auto_begin != system_lyxrc.language_auto_begin) {
2261 os << "\\language_auto_begin "
2262 << convert<string>(language_auto_begin) << '\n';
2266 case RC_LANGUAGE_AUTO_END:
2267 if (ignore_system_lyxrc ||
2268 language_auto_end != system_lyxrc.language_auto_end) {
2269 os << "\\language_auto_end "
2270 << convert<string>(language_auto_end) << '\n';
2274 case RC_MARK_FOREIGN_LANGUAGE:
2275 if (ignore_system_lyxrc ||
2276 mark_foreign_language
2277 != system_lyxrc.mark_foreign_language) {
2278 os << "\\mark_foreign_language " <<
2279 convert<string>(mark_foreign_language) << '\n';
2285 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2288 case RC_AUTO_NUMBER:
2289 if (ignore_system_lyxrc ||
2290 auto_number != system_lyxrc.auto_number) {
2291 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2295 case RC_DEFAULT_LANGUAGE:
2296 if (ignore_system_lyxrc ||
2297 default_language != system_lyxrc.default_language) {
2298 os << "\\default_language " << default_language << '\n';
2302 case RC_GUI_LANGUAGE:
2303 if (ignore_system_lyxrc ||
2304 gui_language != system_lyxrc.gui_language) {
2305 os << "\\gui_language " << gui_language << '\n';
2311 << "# FORMATS SECTION ##########################\n"
2315 // New/modified formats
2316 for (Formats::const_iterator cit = formats.begin();
2317 cit != formats.end(); ++cit) {
2318 Format const * format =
2319 system_formats.getFormat(cit->name());
2321 format->extension() != cit->extension() ||
2322 format->prettyname() != cit->prettyname() ||
2323 format->shortcut() != cit->shortcut() ||
2324 format->viewer() != cit->viewer() ||
2325 format->editor() != cit->editor() ||
2326 format->documentFormat() != cit->documentFormat() ||
2327 format->vectorFormat() != cit->vectorFormat()) {
2328 os << "\\format \"" << cit->name() << "\" \""
2329 << cit->extension() << "\" \""
2330 << cit->prettyname() << "\" \""
2331 << cit->shortcut() << "\" \""
2332 << escapeCommand(cit->viewer()) << "\" \""
2333 << escapeCommand(cit->editor()) << "\" \"";
2334 vector<string> flags;
2335 if (cit->documentFormat())
2336 flags.push_back("document");
2337 if (cit->vectorFormat())
2338 flags.push_back("vector");
2339 os << getStringFromVector(flags);
2344 // Look for deleted formats
2345 for (Formats::const_iterator cit = system_formats.begin();
2346 cit != system_formats.end(); ++cit)
2347 if (!formats.getFormat(cit->name()))
2348 os << "\\format \"" << cit->name()
2349 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2358 << "# CONVERTERS SECTION ##########################\n"
2362 // Look for new converters
2363 for (Converters::const_iterator cit = theConverters().begin();
2364 cit != theConverters().end(); ++cit) {
2365 Converter const * converter =
2366 theSystemConverters().getConverter(cit->from,
2369 converter->command != cit->command ||
2370 converter->flags != cit->flags)
2371 os << "\\converter \"" << cit->from << "\" \""
2372 << cit->to << "\" \""
2373 << escapeCommand(cit->command) << "\" \""
2374 << cit->flags << "\"\n";
2377 // New/modifed converters
2378 for (Converters::const_iterator cit = theSystemConverters().begin();
2379 cit != theSystemConverters().end(); ++cit)
2380 if (!theConverters().getConverter(cit->from, cit->to))
2381 os << "\\converter \"" << cit->from
2382 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2389 << "# COPIERS SECTION ##########################\n"
2392 // Look for new movers
2393 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2394 Movers::const_iterator const sysend = theSystemMovers().end();
2395 Movers::const_iterator it = theMovers().begin();
2396 Movers::const_iterator end = theMovers().end();
2398 for (; it != end; ++it) {
2399 Movers::const_iterator const sysit =
2400 find_if(sysbegin, sysend, SameMover(*it));
2401 if (sysit == sysend) {
2402 string const & fmt = it->first;
2403 string const & command =
2404 it->second.command();
2406 os << "\\copier " << fmt
2407 << " \"" << escapeCommand(command) << "\"\n";
2413 // We don't actually delete SpecialisedMover(s) from the
2414 // map, just clear their 'command', so there's no need
2415 // to test for anything else.
2423 string const LyXRC::getDescription(LyXRCTags tag)
2428 case RC_ACCEPT_COMPOUND:
2429 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2433 case RC_USE_ALT_LANG:
2434 str = _("Specify an alternate language. The default is to use the language of the document.");
2437 case RC_PLAINTEXT_ROFF_COMMAND:
2438 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.");
2441 case RC_PLAINTEXT_LINELEN:
2442 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.");
2445 case RC_AUTOREGIONDELETE:
2446 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2449 case RC_AUTORESET_OPTIONS:
2450 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2454 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2457 case RC_AUTO_NUMBER:
2460 case RC_BACKUPDIR_PATH:
2461 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.");
2464 case RC_BIBTEX_COMMAND:
2465 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2469 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2472 case RC_CHECKLASTFILES:
2473 str = _("Select to check whether the lastfiles still exist.");
2476 case RC_CHKTEX_COMMAND:
2477 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2486 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2487 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.");
2490 case RC_MAC_LIKE_WORD_MOVEMENT:
2491 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2494 case RC_SHOW_MACRO_LABEL:
2495 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2498 case RC_CUSTOM_EXPORT_COMMAND:
2501 case RC_CUSTOM_EXPORT_FORMAT:
2504 case RC_DATE_INSERT_FORMAT:
2505 //xgettext:no-c-format
2506 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2510 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2513 case RC_DEFAULT_LANGUAGE:
2514 str = _("New documents will be assigned this language.");
2517 case RC_DEFAULT_PAPERSIZE:
2518 str = _("Specify the default paper size.");
2521 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2522 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2525 case RC_DISPLAY_GRAPHICS:
2526 str = _("Select how LyX will display any graphics.");
2529 case RC_DOCUMENTPATH:
2530 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2534 case RC_USE_ESC_CHARS:
2535 str = _("Specify additional chars that can be part of a word.");
2538 case RC_EXAMPLEPATH:
2539 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2542 case RC_FONT_ENCODING:
2543 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2549 case RC_INDEX_COMMAND:
2550 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\".");
2553 case RC_NOMENCL_COMMAND:
2554 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2561 case RC_KBMAP_PRIMARY:
2562 case RC_KBMAP_SECONDARY:
2563 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.");
2566 case RC_LABEL_INIT_LENGTH:
2567 str = _("Maximum number of words in the initialization string for a new label");
2570 case RC_LANGUAGE_AUTO_BEGIN:
2571 str = _("Select if a language switching command is needed at the beginning of the document.");
2574 case RC_LANGUAGE_AUTO_END:
2575 str = _("Select if a language switching command is needed at the end of the document.");
2578 case RC_LANGUAGE_COMMAND_BEGIN:
2579 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.");
2582 case RC_LANGUAGE_COMMAND_END:
2583 str = _("The LaTeX command for changing back to the language of the document.");
2586 case RC_LANGUAGE_COMMAND_LOCAL:
2587 str = _("The LaTeX command for local changing of the language.");
2590 case RC_LANGUAGE_GLOBAL_OPTIONS:
2591 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2594 case RC_LANGUAGE_PACKAGE:
2595 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2598 case RC_LANGUAGE_USE_BABEL:
2599 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2602 case RC_USELASTFILEPOS:
2603 str = _("De-select if you do not want LyX to scroll to saved position.");
2606 case RC_LOADSESSION:
2607 str = _("De-select to prevent loading files opened from the last LyX session.");
2610 case RC_MAKE_BACKUP:
2611 str = _("De-select if you don't want LyX to create backup files.");
2614 case RC_MARK_FOREIGN_LANGUAGE:
2615 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2618 case RC_MOUSE_WHEEL_SPEED:
2619 str = bformat(_("The scrolling speed of the mouse wheel."),
2623 case RC_COMPLETION_POPUP_DELAY:
2624 str = _("The completion popup delay.");
2627 case RC_COMPLETION_POPUP_MATH:
2628 str = _("Select to display the completion popup in math mode.");
2631 case RC_COMPLETION_POPUP_TEXT:
2632 str = _("Select to display the completion popup in text mode.");
2635 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2636 str = _("Show the completion popup without delay after non-unique completion attempt.");
2639 case RC_COMPLETION_POPUP_TEXT:
2640 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2643 case RC_COMPLETION_POPUP_DELAY:
2644 str = _("The inline completion delay.");
2647 case RC_COMPLETION_INLINE_MATH:
2648 str = _("Select to display the inline completion in math mode.");
2651 case RC_COMPLETION_INLINE_TEXT:
2652 str = _("Select to display the inline completion in text mode.");
2655 case RC_COMPLETION_INLINE_DOTS:
2656 str = _("Use \"...\" to shorten long completions.");
2659 case RC_NUMLASTFILES:
2660 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2664 case RC_PATH_PREFIX:
2665 str = _("Specify those directories which should be "
2666 "prepended to the PATH environment variable. "
2667 "Use the OS native format.");
2671 case RC_USE_PERS_DICT:
2672 str = _("Specify an alternate personal dictionary file. E.g. \".ispell_english\".");
2676 str = _("Shows a typeset preview of things such as math");
2679 case RC_PREVIEW_HASHED_LABELS:
2680 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2683 case RC_PREVIEW_SCALE_FACTOR:
2684 str = _("Scale the preview size to suit.");
2687 case RC_PRINTCOLLCOPIESFLAG:
2688 str = _("The option for specifying whether the copies should be collated.");
2691 case RC_PRINTCOPIESFLAG:
2692 str = _("The option for specifying the number of copies to print.");
2696 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2699 case RC_PRINTEVENPAGEFLAG:
2700 str = _("The option to print only even pages.");
2703 case RC_PRINTEXSTRAOPTIONS:
2704 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2707 case RC_PRINTFILEEXTENSION:
2708 str = _("Extension of printer program output file. Usually \".ps\".");
2711 case RC_PRINTLANDSCAPEFLAG:
2712 str = _("The option to print out in landscape.");
2715 case RC_PRINTODDPAGEFLAG:
2716 str = _("The option to print only odd pages.");
2719 case RC_PRINTPAGERANGEFLAG:
2720 str = _("The option for specifying a comma-separated list of pages to print.");
2723 case RC_PRINTPAPERDIMENSIONFLAG:
2724 str = _("Option to specify the dimensions of the print paper.");
2727 case RC_PRINTPAPERFLAG:
2728 str = _("The option to specify paper type.");
2731 case RC_PRINTREVERSEFLAG:
2732 str = _("The option to reverse the order of the pages printed.");
2735 case RC_PRINTSPOOL_COMMAND:
2736 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.");
2739 case RC_PRINTSPOOL_PRINTERPREFIX:
2740 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.");
2743 case RC_PRINTTOFILE:
2744 str = _("Option to pass to the print program to print to a file.");
2747 case RC_PRINTTOPRINTER:
2748 str = _("Option to pass to the print program to print on a specific printer.");
2751 case RC_PRINT_ADAPTOUTPUT:
2752 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2755 case RC_PRINT_COMMAND:
2756 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2759 case RC_RTL_SUPPORT:
2760 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2763 case RC_VISUAL_CURSOR:
2764 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2768 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2771 case RC_SCREEN_FONT_ROMAN:
2772 case RC_SCREEN_FONT_SANS:
2773 case RC_SCREEN_FONT_TYPEWRITER:
2774 str = _("The screen fonts used to display the text while editing.");
2777 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2778 case RC_SCREEN_FONT_SANS_FOUNDRY:
2779 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2782 case RC_SCREEN_FONT_SCALABLE:
2783 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.");
2786 case RC_SCREEN_FONT_SIZES:
2787 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2790 case RC_SCREEN_ZOOM:
2791 //xgettext:no-c-format
2792 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2795 case RC_GEOMETRY_SESSION:
2796 str = _("Allow session manager to save and restore windows geometry.");
2800 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2806 case RC_SHOW_BANNER:
2807 str = _("De-select if you don't want the startup banner.");
2810 case RC_SPELL_COMMAND:
2811 str = _("What command runs the spellchecker?");
2814 case RC_TEMPDIRPATH:
2815 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2818 case RC_TEMPLATEPATH:
2819 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2822 case RC_TEX_ALLOWS_SPACES:
2825 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2829 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2841 case RC_USE_INP_ENC:
2842 str = _("Specify whether to pass the -T input encoding option to ispell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2845 case RC_USE_TOOLTIP:
2846 str = _("Enable the automatic appearance of tool tips in the work area.");
2849 case RC_USE_PIXMAP_CACHE:
2850 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2853 case RC_USE_SPELL_LIB:
2856 case RC_VIEWDVI_PAPEROPTION:
2857 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2872 // The global instance
2875 // The global copy of the system lyxrc entries (everything except preferences)