3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/FileName.h"
36 #include "support/filetools.h"
37 #include "support/gettext.h"
38 #include "support/lstrings.h"
39 #include "support/os.h"
40 #include "support/Package.h"
41 #include "support/userinfo.h"
47 using namespace lyx::support;
51 namespace os = support::os;
55 // when adding something to this array keep it sorted!
56 LexerKeyword lyxrcTags[] = {
57 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
58 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
59 { "\\alternate_language", LyXRC::RC_ALT_LANG },
60 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
61 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
62 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
63 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
64 { "\\autosave", LyXRC::RC_AUTOSAVE },
65 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
66 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
67 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
68 { "\\bind_file", LyXRC::RC_BINDFILE },
69 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
70 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
71 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
72 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
73 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
74 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
75 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
76 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
77 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
78 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
79 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
80 { "\\converter", LyXRC::RC_CONVERTER },
81 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
82 { "\\copier", LyXRC::RC_COPIER },
83 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
84 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
85 { "\\def_file", LyXRC::RC_DEFFILE },
86 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
87 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
88 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
89 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
90 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
91 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
92 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
93 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
94 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
95 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
96 { "\\format", LyXRC::RC_FORMAT },
97 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
98 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
99 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
100 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
101 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
102 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
103 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
104 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
105 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
106 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
107 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
108 { "\\input", LyXRC::RC_INPUT },
109 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
110 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
111 { "\\kbmap", LyXRC::RC_KBMAP },
112 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
113 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
114 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
115 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
116 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
117 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
118 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
119 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
120 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
121 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
122 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
123 { "\\load_session", LyXRC::RC_LOADSESSION },
124 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
125 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
126 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
127 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
128 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
129 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
130 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
131 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
132 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
133 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
134 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
135 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
136 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
137 { "\\preview", LyXRC::RC_PREVIEW },
138 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
139 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
140 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
141 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
142 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
143 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
144 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
145 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
146 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
147 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
148 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
149 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
150 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
151 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
152 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
153 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
154 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
155 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
156 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
157 { "\\printer", LyXRC::RC_PRINTER },
158 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
159 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
160 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
161 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
162 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
163 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
164 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
165 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
166 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
167 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
168 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
169 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
170 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
171 { "\\set_color", LyXRC::RC_SET_COLOR },
172 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
173 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
174 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
175 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
176 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
177 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
178 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
179 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
180 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
181 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
182 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
183 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
184 { "\\ui_file", LyXRC::RC_UIFILE },
185 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
186 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
187 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
188 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
189 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
190 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
191 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
192 // compatibility with versions older than 1.4.0 only
193 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
194 // compatibility with versions older than 1.4.0 only
195 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
196 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
197 { "\\user_email", LyXRC::RC_USER_EMAIL },
198 { "\\user_name", LyXRC::RC_USER_NAME },
199 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
200 // compatibility with versions older than 1.4.0 only
201 { "\\viewer", LyXRC::RC_VIEWER},
202 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
203 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
206 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
217 void LyXRC::setDefaults()
220 def_file = "default";
222 // Get printer from the environment. If fail, use default "",
223 // assuming that everything is set up correctly.
224 printer = getEnv("PRINTER");
225 print_adapt_output = false;
226 print_command = "dvips";
227 print_evenpage_flag = "-B";
228 print_oddpage_flag = "-A";
229 print_pagerange_flag = "-pp";
230 print_copies_flag = "-c";
231 print_collcopies_flag = "-C";
232 print_reverse_flag = "-r";
233 print_landscape_flag = "-t landscape";
234 print_to_printer = "-P";
235 print_to_file = "-o ";
236 print_file_extension = ".ps";
237 print_paper_flag = "-t";
238 print_paper_dimension_flag = "-T";
239 document_path.erase();
240 view_dvi_paper_option.erase();
241 default_papersize = PAPER_DEFAULT;
242 default_view_format = "pdf2";
243 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
244 bibtex_command = "bibtex";
246 index_command = "makeindex -c -q";
247 nomencl_command = "makeindex -s nomencl.ist";
249 // Because a screen is typically wider than a piece of paper:
251 allow_geometry_session = true;
252 // Default LaTeX font size:
253 font_sizes[FONT_SIZE_TINY] = "5.0";
254 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
255 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
256 font_sizes[FONT_SIZE_SMALL] = "9.0";
257 font_sizes[FONT_SIZE_NORMAL] = "10.0";
258 font_sizes[FONT_SIZE_LARGE] = "12.0";
259 font_sizes[FONT_SIZE_LARGER] = "14.4";
260 font_sizes[FONT_SIZE_LARGEST] = "17.26";
261 font_sizes[FONT_SIZE_HUGE] = "20.74";
262 font_sizes[FONT_SIZE_HUGER] = "24.88";
263 use_scalable_fonts = true;
264 roman_font_name = "";
266 typewriter_font_name = "";
268 auto_region_delete = true;
269 auto_reset_options = false;
270 plaintext_linelen = 65;
271 mouse_wheel_speed = 1.0;
272 num_lastfiles = maxlastfiles;
273 check_lastfiles = true;
274 use_lastfilepos = true;
275 load_session = false;
277 backupdir_path.erase();
278 display_graphics = true;
279 // Spellchecker settings:
280 spellchecker = "aspell";
281 spellchecker_accept_compound = false;
282 spellcheck_continuously = false;
285 visual_cursor = false;
287 mark_foreign_language = true;
288 language_auto_begin = true;
289 language_auto_end = true;
290 language_global_options = true;
291 language_use_babel = true;
292 language_package = "\\usepackage{babel}";
293 language_command_begin = "\\selectlanguage{$$lang}";
294 language_command_local = "\\foreignlanguage{$$lang}{";
295 sort_layouts = false;
296 group_layouts = true;
297 default_language = "english";
298 gui_language = "auto";
300 windows_style_tex_paths = false;
301 tex_allows_spaces = false;
302 date_insert_format = "%x";
303 cursor_follows_scrollbar = false;
304 scroll_below_document = false;
305 paragraph_markers = false;
306 mac_like_word_movement = false;
307 macro_edit_style = MACRO_EDIT_INLINE_BOX;
308 dialogs_iconify_with_main = false;
309 label_init_length = 3;
310 preview = PREVIEW_OFF;
311 preview_hashed_labels = false;
312 preview_scale_factor = 1.0;
313 use_converter_cache = true;
315 use_pixmap_cache = false;
316 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
317 user_name = to_utf8(support::user_name());
318 user_email = to_utf8(support::user_email());
319 open_buffers_in_tabs = true;
320 single_close_tab_button = false;
322 // Fullscreen settings
323 full_screen_limit = false;
324 full_screen_toolbars = true;
325 full_screen_tabbar = true;
326 full_screen_menubar = true;
327 full_screen_scrollbar = true;
328 full_screen_width = 700;
330 completion_cursor_text = true;
331 completion_popup_math = true;
332 completion_popup_text = false;
333 completion_popup_delay = 2.0;
334 completion_popup_after_complete = true;
335 autocorrection_math = false;
336 completion_inline_math = true;
337 completion_inline_text = false;
338 completion_inline_dots = -1;
339 completion_inline_delay = 0.2;
345 void oldFontFormat(string & family, string & foundry)
347 if (family.empty() || family[0] != '-')
349 foundry = token(family, '-', 1);
350 family = token(family, '-', 2);
358 int LyXRC::read(FileName const & filename)
360 Lexer lexrc(lyxrcTags);
361 if (lyxerr.debugging(Debug::PARSER))
362 lexrc.printTable(lyxerr);
364 lexrc.setFile(filename);
368 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
374 int LyXRC::read(istream & is)
376 Lexer lexrc(lyxrcTags);
377 if (lyxerr.debugging(Debug::PARSER))
378 lexrc.printTable(lyxerr);
384 LYXERR(Debug::LYXRC, "Reading istream...");
390 int LyXRC::read(Lexer & lexrc)
395 while (lexrc.isOK()) {
396 // By using two switches we take advantage of the compiler
397 // telling us if we have missed a LyXRCTags element in
398 // the second switch.
399 // Note that this also shows a problem with Lexer since it
400 // helps us avoid taking advantage of the strictness of the
403 int le = lexrc.lex();
405 case Lexer::LEX_UNDEF:
406 lexrc.printError("Unknown tag `$$Token'");
408 case Lexer::LEX_FEOF:
413 switch (static_cast<LyXRCTags>(le)) {
414 case RC_INPUT: // Include file
417 libFileSearch(string(),
420 lexrc.printError("Error reading "
421 "included file: " + tmp.absFilename());
427 bind_file = os::internal_path(lexrc.getString());
432 def_file = os::internal_path(lexrc.getString());
437 ui_file = os::internal_path(lexrc.getString());
440 case RC_AUTORESET_OPTIONS:
441 lexrc >> auto_reset_options;
444 case RC_DISPLAY_GRAPHICS:
446 display_graphics = lexrc.getString() == "true";
449 case RC_TEX_EXPECTS_WINDOWS_PATHS:
450 lexrc >> windows_style_tex_paths;
453 case RC_TEX_ALLOWS_SPACES:
454 lexrc >> tex_allows_spaces;
461 case RC_KBMAP_PRIMARY:
463 string const kmap(os::internal_path(lexrc.getString()));
464 if (!libFileSearch("kbd", kmap, "kmap").empty()
466 primary_kbmap = kmap;
468 lexrc.printError("LyX: Keymap `$$Token' not found");
473 case RC_KBMAP_SECONDARY:
475 string const kmap(os::internal_path(lexrc.getString()));
476 if (!libFileSearch("kbd", kmap, "kmap").empty()
478 secondary_kbmap = kmap;
480 lexrc.printError("LyX: Keymap `$$Token' not found");
485 case RC_FONT_ENCODING:
493 case RC_PRINT_COMMAND:
494 if (lexrc.next(true)) {
495 print_command = lexrc.getString();
499 case RC_PRINTEVENPAGEFLAG:
500 lexrc >> print_evenpage_flag;
503 case RC_PRINTODDPAGEFLAG:
504 lexrc >> print_oddpage_flag;
507 case RC_PRINTPAGERANGEFLAG:
508 lexrc >> print_pagerange_flag;
511 case RC_PRINTCOPIESFLAG:
512 lexrc >> print_copies_flag;
515 case RC_PRINTCOLLCOPIESFLAG:
516 lexrc >> print_collcopies_flag;
519 case RC_PRINTREVERSEFLAG:
520 lexrc >> print_reverse_flag;
523 case RC_PRINTLANDSCAPEFLAG:
524 lexrc >> print_landscape_flag;
527 case RC_PRINTTOPRINTER:
528 lexrc >> print_to_printer;
531 case RC_PRINT_ADAPTOUTPUT:
532 lexrc >> print_adapt_output;
537 print_to_file = os::internal_path(lexrc.getString());
541 case RC_PRINTFILEEXTENSION:
542 lexrc >> print_file_extension;
545 case RC_PRINTEXSTRAOPTIONS:
546 lexrc >> print_extra_options;
549 case RC_PRINTSPOOL_COMMAND:
550 if (lexrc.next(true)) {
551 print_spool_command = lexrc.getString();
555 case RC_PRINTSPOOL_PRINTERPREFIX:
556 lexrc >> print_spool_printerprefix;
559 case RC_PRINTPAPERDIMENSIONFLAG:
560 lexrc >> print_paper_dimension_flag;
563 case RC_PRINTPAPERFLAG:
564 lexrc >> print_paper_flag;
567 case RC_DEFAULT_PAPERSIZE:
569 string const size = ascii_lowercase(lexrc.getString());
570 if (size == "usletter")
571 default_papersize = PAPER_USLETTER;
572 else if (size == "legal")
573 default_papersize = PAPER_USLEGAL;
574 else if (size == "executive")
575 default_papersize = PAPER_USEXECUTIVE;
576 else if (size == "a3")
577 default_papersize = PAPER_A3;
578 else if (size == "a4")
579 default_papersize = PAPER_A4;
580 else if (size == "a5")
581 default_papersize = PAPER_A5;
582 else if (size == "b5")
583 default_papersize = PAPER_B5;
584 else if (size == "default")
585 default_papersize = PAPER_DEFAULT;
589 case RC_VIEWDVI_PAPEROPTION:
591 view_dvi_paper_option = lexrc.getString();
593 view_dvi_paper_option.erase();
596 case RC_CHKTEX_COMMAND:
597 if (lexrc.next(true)) {
598 chktex_command = lexrc.getString();
602 case RC_BIBTEX_ALTERNATIVES:
603 if (lexrc.next(true)) {
604 bibtex_alternatives.insert(lexrc.getString());
608 case RC_BIBTEX_COMMAND:
609 if (lexrc.next(true)) {
610 bibtex_command = lexrc.getString();
614 case RC_JBIBTEX_COMMAND:
615 if (lexrc.next(true)) {
616 jbibtex_command = lexrc.getString();
620 case RC_INDEX_ALTERNATIVES:
621 if (lexrc.next(true)) {
622 index_alternatives.insert(lexrc.getString());
626 case RC_INDEX_COMMAND:
627 if (lexrc.next(true)) {
628 index_command = lexrc.getString();
632 case RC_JINDEX_COMMAND:
633 if (lexrc.next(true)) {
634 jindex_command = lexrc.getString();
638 case RC_SPLITINDEX_COMMAND:
639 if (lexrc.next(true)) {
640 splitindex_command = lexrc.getString();
644 case RC_NOMENCL_COMMAND:
645 if (lexrc.next(true)) {
646 nomencl_command = lexrc.getString();
658 case RC_GEOMETRY_SESSION:
659 lexrc >> allow_geometry_session;
662 case RC_SCREEN_FONT_SIZES:
663 lexrc >> font_sizes[FONT_SIZE_TINY];
664 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
665 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
666 lexrc >> font_sizes[FONT_SIZE_SMALL];
667 lexrc >> font_sizes[FONT_SIZE_NORMAL];
668 lexrc >> font_sizes[FONT_SIZE_LARGE];
669 lexrc >> font_sizes[FONT_SIZE_LARGER];
670 lexrc >> font_sizes[FONT_SIZE_LARGEST];
671 lexrc >> font_sizes[FONT_SIZE_HUGE];
672 lexrc >> font_sizes[FONT_SIZE_HUGER];
675 case RC_SCREEN_FONT_SCALABLE:
676 lexrc >> use_scalable_fonts;
683 case RC_DOCUMENTPATH:
685 document_path = os::internal_path(lexrc.getString());
686 document_path = expandPath(document_path);
692 example_path = os::internal_path(lexrc.getString());
693 example_path = expandPath(example_path);
697 case RC_TEMPLATEPATH:
699 template_path = os::internal_path(lexrc.getString());
700 template_path = expandPath(template_path);
706 tempdir_path = os::internal_path(lexrc.getString());
707 tempdir_path = expandPath(tempdir_path);
711 case RC_THESAURUSDIRPATH:
713 thesaurusdir_path = os::internal_path(lexrc.getString());
714 thesaurusdir_path = expandPath(thesaurusdir_path);
718 case RC_HUNSPELLDIR_PATH:
720 hunspelldir_path = os::internal_path(lexrc.getString());
721 hunspelldir_path = expandPath(hunspelldir_path);
725 case RC_USELASTFILEPOS:
726 lexrc >> use_lastfilepos;
730 lexrc >> load_session;
733 case RC_MOUSE_WHEEL_SPEED:
734 lexrc >> mouse_wheel_speed;
737 case RC_COMPLETION_INLINE_DELAY:
738 lexrc >> completion_inline_delay;
741 case RC_COMPLETION_INLINE_MATH:
742 lexrc >> completion_inline_math;
745 case RC_COMPLETION_INLINE_TEXT:
746 lexrc >> completion_inline_text;
749 case RC_COMPLETION_INLINE_DOTS:
750 lexrc >> completion_inline_dots;
753 case RC_AUTOCORRECTION_MATH:
754 lexrc >> autocorrection_math;
757 case RC_COMPLETION_POPUP_DELAY:
758 lexrc >> completion_popup_delay;
761 case RC_COMPLETION_POPUP_MATH:
762 lexrc >> completion_popup_math;
765 case RC_COMPLETION_POPUP_TEXT:
766 lexrc >> completion_popup_text;
769 case RC_COMPLETION_CURSOR_TEXT:
770 lexrc >> completion_cursor_text;
773 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
774 lexrc >> completion_popup_after_complete;
777 case RC_NUMLASTFILES:
778 lexrc >> num_lastfiles;
781 case RC_CHECKLASTFILES:
782 lexrc >> check_lastfiles;
785 case RC_SCREEN_FONT_ROMAN:
787 roman_font_name = lexrc.getString();
788 oldFontFormat(roman_font_name,
793 case RC_SCREEN_FONT_SANS:
795 sans_font_name = lexrc.getString();
796 oldFontFormat(sans_font_name, sans_font_foundry);
800 case RC_SCREEN_FONT_TYPEWRITER:
802 typewriter_font_name = lexrc.getString();
803 oldFontFormat(typewriter_font_name,
804 typewriter_font_foundry);
808 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
809 lexrc >> roman_font_foundry;
812 case RC_SCREEN_FONT_SANS_FOUNDRY:
813 lexrc >> sans_font_foundry;
816 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
817 lexrc >> typewriter_font_foundry;
822 lexrc.printError("Missing color tag.");
825 string lyx_name = lexrc.getString();
828 lexrc.printError("Missing color name for color: `$$Token'");
831 string x11_name = lexrc.getString();
833 ColorCode const col =
834 lcolor.getFromLyXName(lyx_name);
835 if (col == Color_none ||
836 col == Color_inherit ||
840 if (!lcolor.setColor(col, x11_name))
841 LYXERR0("Bad lyxrc set_color for " << lyx_name);
845 case RC_AUTOREGIONDELETE:
846 // Auto region delete defaults to true
847 lexrc >> auto_region_delete;
852 lyxpipes = os::internal_path(lexrc.getString());
853 lyxpipes = expandPath(lyxpipes);
857 case RC_CURSOR_FOLLOWS_SCROLLBAR:
858 lexrc >> cursor_follows_scrollbar;
861 case RC_SCROLL_BELOW_DOCUMENT:
862 lexrc >> scroll_below_document;
865 case RC_PARAGRAPH_MARKERS:
866 lexrc >> paragraph_markers;
869 case RC_MAC_LIKE_WORD_MOVEMENT:
870 lexrc >> mac_like_word_movement;
873 case RC_MACRO_EDIT_STYLE:
875 switch (lexrc.getInteger()) {
876 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
877 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
878 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
883 case RC_DIALOGS_ICONIFY_WITH_MAIN:
884 lexrc >> dialogs_iconify_with_main;
887 case RC_PLAINTEXT_LINELEN:
888 lexrc >> plaintext_linelen;
890 // Spellchecker settings:
891 case RC_ACCEPT_COMPOUND:
892 lexrc >> spellchecker_accept_compound;
895 lexrc >> use_tooltip;
897 case RC_USE_PIXMAP_CACHE:
898 lexrc >> use_pixmap_cache;
900 case RC_SPELLCHECKER:
901 lexrc >> spellchecker;
904 lexrc >> spellchecker_alt_lang;
907 lexrc >> spellchecker_esc_chars;
909 case RC_SPELLCHECK_CONTINUOUSLY:
910 lexrc >> spellcheck_continuously;
913 lexrc >> make_backup;
915 case RC_BACKUPDIR_PATH:
917 backupdir_path = os::internal_path(lexrc.getString());
918 backupdir_path = expandPath(backupdir_path);
921 case RC_DATE_INSERT_FORMAT:
922 lexrc >> date_insert_format;
924 case RC_LANGUAGE_PACKAGE:
925 lexrc >> language_package;
927 case RC_LANGUAGE_AUTO_BEGIN:
928 lexrc >> language_auto_begin;
930 case RC_LANGUAGE_AUTO_END:
931 lexrc >> language_auto_end;
933 case RC_LANGUAGE_GLOBAL_OPTIONS:
934 lexrc >> language_global_options;
936 case RC_LANGUAGE_USE_BABEL:
937 lexrc >> language_use_babel;
939 case RC_LANGUAGE_COMMAND_BEGIN:
940 lexrc >> language_command_begin;
942 case RC_LANGUAGE_COMMAND_END:
943 lexrc >> language_command_end;
945 case RC_LANGUAGE_COMMAND_LOCAL:
946 lexrc >> language_command_local;
949 lexrc >> rtl_support;
951 case RC_VISUAL_CURSOR:
952 lexrc >> visual_cursor;
955 lexrc >> auto_number;
957 case RC_MARK_FOREIGN_LANGUAGE:
958 lexrc >> mark_foreign_language;
964 fmt = lexrc.getString();
965 if (lexrc.next(true))
966 command = lexrc.getString();
967 setMover(fmt, command);
972 string from, to, command, flags;
974 from = lexrc.getString();
976 to = lexrc.getString();
977 if (lexrc.next(true))
978 command = lexrc.getString();
980 flags = lexrc.getString();
982 theConverters().erase(from, to);
984 theConverters().add(from, to, command, flags);
987 // compatibility with versions older than 1.4.0 only
989 string format, command;
990 lexrc >> format >> command;
991 formats.setViewer(format, command);
995 string format, extension, prettyname, shortcut;
996 lexrc >> format >> extension >> prettyname >> shortcut;
997 string viewer, editor;
998 if (lexrc.next(true))
999 viewer = lexrc.getString();
1000 if (lexrc.next(true))
1001 editor = lexrc.getString();
1003 // Hack to ensure compatibility with versions older
1005 int le = lexrc.lex();
1006 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1007 flags = lexrc.getString();
1008 if (le != Lexer::LEX_DATA) {
1009 // We have got a known token.
1010 // Therefore this is an old style
1011 // format definition without
1013 lexrc.pushToken(flags);
1017 int flgs = Format::none;
1018 while (!flags.empty()) {
1020 flags = split(flags, flag, ',');
1021 if (flag == "document")
1022 flgs |= Format::document;
1023 else if (flag == "vector")
1024 flgs |= Format::vector;
1026 LYXERR0("Ignoring unknown flag `"
1027 << flag << "' for format `"
1030 if (prettyname.empty()) {
1031 if (theConverters().formatIsUsed(format))
1032 LYXERR0("Can't delete format " << format);
1034 formats.erase(format);
1036 formats.add(format, extension, prettyname,
1037 shortcut, viewer, editor, flgs);
1041 case RC_VIEWER_ALTERNATIVES: {
1042 string format, command;
1044 format = lexrc.getString();
1045 if (lexrc.eatLine())
1046 command = lexrc.getString();
1047 viewer_alternatives[format].insert(command);
1050 case RC_EDITOR_ALTERNATIVES: {
1051 string format, command;
1052 lexrc >> format >> command;
1053 editor_alternatives[format].insert(command);
1057 case RC_DEFAULT_VIEW_FORMAT:
1058 lexrc >> default_view_format;
1061 case RC_DEFAULT_LANGUAGE:
1062 lexrc >> default_language;
1065 case RC_GUI_LANGUAGE:
1066 lexrc >> gui_language;
1069 case RC_LABEL_INIT_LENGTH:
1070 lexrc >> label_init_length;
1073 case RC_SHOW_BANNER:
1074 lexrc >> show_banner;
1079 string const tmp = lexrc.getString();
1080 if (tmp == "true" || tmp == "on")
1081 preview = PREVIEW_ON;
1082 else if (tmp == "no_math")
1083 preview = PREVIEW_NO_MATH;
1085 preview = PREVIEW_OFF;
1086 if (tmp != "false" && tmp != "off")
1087 LYXERR0("Unrecognized preview status \""
1093 case RC_PREVIEW_HASHED_LABELS:
1094 lexrc >> preview_hashed_labels;
1097 case RC_PREVIEW_SCALE_FACTOR:
1098 lexrc >> preview_scale_factor;
1105 lexrc >> user_email;
1108 case RC_PATH_PREFIX:
1109 lexrc >> path_prefix;
1112 case RC_USE_CONVERTER_CACHE:
1113 lexrc >> use_converter_cache;
1115 case RC_CONVERTER_CACHE_MAXAGE:
1116 lexrc >> converter_cache_maxage;
1119 case RC_SORT_LAYOUTS:
1120 lexrc >> sort_layouts;
1122 case RC_GROUP_LAYOUTS:
1123 lexrc >> group_layouts;
1125 case RC_FULL_SCREEN_LIMIT:
1126 lexrc >> full_screen_limit;
1128 case RC_FULL_SCREEN_TOOLBARS:
1129 lexrc >> full_screen_toolbars;
1131 case RC_FULL_SCREEN_SCROLLBAR:
1132 lexrc >> full_screen_scrollbar;
1134 case RC_FULL_SCREEN_TABBAR:
1135 lexrc >> full_screen_tabbar;
1137 case RC_FULL_SCREEN_MENUBAR:
1138 lexrc >> full_screen_menubar;
1140 case RC_FULL_SCREEN_WIDTH:
1141 lexrc >> full_screen_width;
1143 case RC_OPEN_BUFFERS_IN_TABS:
1144 lexrc >> open_buffers_in_tabs;
1146 case RC_SINGLE_CLOSE_TAB_BUTTON:
1147 lexrc >> single_close_tab_button;
1150 // Obsoteted in 1.4.0
1153 case RC_SPELL_COMMAND:
1155 case RC_PLAINTEXT_ROFF_COMMAND:
1156 case RC_USE_ALT_LANG:
1157 case RC_USE_ESC_CHARS:
1158 case RC_USE_INP_ENC:
1159 case RC_USE_PERS_DICT:
1160 case RC_USE_SPELL_LIB:
1161 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1162 << lexrc.getString() << "'.");
1167 break; // this is just a dummy
1171 /// Update converters data-structures
1172 theConverters().update(formats);
1173 theConverters().buildGraph();
1179 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1181 ofstream ofs(filename.toFilesystemEncoding().c_str());
1183 write(ofs, ignore_system_lyxrc);
1187 void LyXRC::print() const
1189 if (lyxerr.debugging())
1190 write(lyxerr, false);
1198 typedef pair<string, SpecialisedMover> Data;
1200 SameMover(Data const & comparison)
1201 : comparison_(comparison) {}
1203 bool operator()(Data const & data) const
1205 return data.first == comparison_.first &&
1206 data.second.command() == comparison_.second.command();
1216 // Escape \ and " so that LyXLex can read the string later
1217 string escapeCommand(string const & str) {
1218 return subst(subst(str , "\\", "\\\\"),
1225 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1227 LyXRCTags tag = RC_LAST;
1229 if (!name.empty()) {
1230 for (int i = 0; i != lyxrcCount; ++i)
1231 if ("\\" + name == lyxrcTags[i].tag)
1232 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1236 os << "# LyX " << lyx_version
1237 << " generated this file. If you want to make your own\n"
1238 << "# modifications you should do them from inside LyX and save.\n"
1241 // Why the switch you might ask. It is a trick to ensure that all
1242 // the elements in the LyXRCTags enum are handled. As you can see
1243 // there are no breaks at all. So it is just a huge fall-through.
1244 // The nice thing is that we will get a warning from the compiler
1245 // if we forget an element.
1249 // input/include files are not done here
1251 if (ignore_system_lyxrc ||
1252 bind_file != system_lyxrc.bind_file) {
1253 string const path = os::external_path(bind_file);
1254 os << "\\bind_file \"" << path << "\"\n";
1260 if (ignore_system_lyxrc ||
1261 def_file != system_lyxrc.def_file) {
1262 string const path = os::external_path(def_file);
1263 os << "\\def_file \"" << path << "\"\n";
1272 << "# MISC SECTION ######################################\n"
1274 // bind files are not done here.
1276 case RC_PATH_PREFIX:
1277 if (ignore_system_lyxrc ||
1278 path_prefix != system_lyxrc.path_prefix) {
1279 os << "\\path_prefix \"" << path_prefix << "\"\n";
1284 if (ignore_system_lyxrc ||
1285 ui_file != system_lyxrc.ui_file) {
1286 string const path = os::external_path(ui_file);
1287 os << "\\ui_file \"" << path << "\"\n";
1291 case RC_AUTOREGIONDELETE:
1292 if (ignore_system_lyxrc ||
1293 auto_region_delete != system_lyxrc.auto_region_delete) {
1294 os << "# Set to false to inhibit automatic replacement of\n"
1295 << "# the current selection.\n"
1296 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1301 case RC_AUTORESET_OPTIONS:
1302 if (ignore_system_lyxrc ||
1303 auto_reset_options != system_lyxrc.auto_reset_options) {
1304 os << "# Set to false to inhibit automatic reset of\n"
1305 << "# the class options to defaults on class change.\n"
1306 << "\\auto_reset_options "
1307 << convert<string>(auto_reset_options)
1313 if (ignore_system_lyxrc ||
1314 autosave != system_lyxrc.autosave) {
1315 os << "# The time interval between auto-saves in seconds.\n"
1316 << "\\autosave " << autosave << '\n';
1320 case RC_DISPLAY_GRAPHICS:
1321 if (ignore_system_lyxrc ||
1322 display_graphics != system_lyxrc.display_graphics) {
1323 os << "# Display graphics within LyX\n"
1325 << "\\display_graphics "
1326 << (display_graphics ? "true" : "false")
1331 case RC_SORT_LAYOUTS:
1332 if (ignore_system_lyxrc ||
1333 sort_layouts != system_lyxrc.sort_layouts) {
1334 os << "# Sort layouts alphabetically.\n"
1335 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1339 case RC_GROUP_LAYOUTS:
1340 if (ignore_system_lyxrc ||
1341 group_layouts != system_lyxrc.group_layouts) {
1342 os << "# Group layouts by their category.\n"
1343 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1347 case RC_VIEWDVI_PAPEROPTION:
1348 if (ignore_system_lyxrc ||
1349 view_dvi_paper_option
1350 != system_lyxrc.view_dvi_paper_option) {
1351 os << "# Options used to specify paper size to the\n"
1352 << "# view_dvi_command (e.g. -paper)\n"
1353 << "\\view_dvi_paper_option \""
1354 << view_dvi_paper_option << "\"\n";
1358 case RC_DEFAULT_PAPERSIZE:
1359 if (ignore_system_lyxrc ||
1360 default_papersize != system_lyxrc.default_papersize) {
1361 os << "# The default papersize to use.\n"
1362 << "\\default_papersize \"";
1363 switch (default_papersize) {
1365 os << "default"; break;
1366 case PAPER_USLETTER:
1367 os << "usletter"; break;
1369 os << "legal"; break;
1370 case PAPER_USEXECUTIVE:
1371 os << "executive"; break;
1382 case PAPER_B4: break;
1388 case RC_CHKTEX_COMMAND:
1389 if (ignore_system_lyxrc ||
1390 chktex_command != system_lyxrc.chktex_command) {
1391 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1395 case RC_BIBTEX_ALTERNATIVES: {
1396 CommandSet::const_iterator it = bibtex_alternatives.begin();
1397 CommandSet::const_iterator end = bibtex_alternatives.end();
1398 for ( ; it != end; ++it) {
1399 if (ignore_system_lyxrc
1400 || !system_lyxrc.bibtex_alternatives.count(*it))
1401 os << "\\bibtex_alternatives \""
1407 case RC_BIBTEX_COMMAND:
1408 if (ignore_system_lyxrc ||
1409 bibtex_command != system_lyxrc.bibtex_command) {
1410 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1414 case RC_JBIBTEX_COMMAND:
1415 if (ignore_system_lyxrc ||
1416 jbibtex_command != system_lyxrc.jbibtex_command) {
1417 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1421 case RC_INDEX_ALTERNATIVES: {
1422 CommandSet::const_iterator it = index_alternatives.begin();
1423 CommandSet::const_iterator end = index_alternatives.end();
1424 for ( ; it != end; ++it) {
1425 if (ignore_system_lyxrc
1426 || !system_lyxrc.index_alternatives.count(*it))
1427 os << "\\index_alternatives \""
1433 case RC_INDEX_COMMAND:
1434 if (ignore_system_lyxrc ||
1435 index_command != system_lyxrc.index_command) {
1436 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1440 case RC_JINDEX_COMMAND:
1441 if (ignore_system_lyxrc ||
1442 jindex_command != system_lyxrc.jindex_command) {
1443 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1447 case RC_SPLITINDEX_COMMAND:
1448 if (ignore_system_lyxrc ||
1449 splitindex_command != system_lyxrc.splitindex_command) {
1450 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1454 case RC_NOMENCL_COMMAND:
1455 if (ignore_system_lyxrc ||
1456 nomencl_command != system_lyxrc.nomencl_command) {
1457 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1461 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1462 if (ignore_system_lyxrc ||
1463 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1464 os << "\\tex_expects_windows_paths "
1465 << convert<string>(windows_style_tex_paths) << '\n';
1469 case RC_TEX_ALLOWS_SPACES:
1470 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1471 os << "\\tex_allows_spaces "
1472 << convert<string>(tex_allows_spaces) << '\n';
1477 if (ignore_system_lyxrc ||
1478 use_kbmap != system_lyxrc.use_kbmap) {
1479 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1483 case RC_KBMAP_PRIMARY:
1484 if (ignore_system_lyxrc ||
1485 primary_kbmap != system_lyxrc.primary_kbmap) {
1486 string const path = os::external_path(primary_kbmap);
1487 os << "\\kbmap_primary \"" << path << "\"\n";
1491 case RC_KBMAP_SECONDARY:
1492 if (ignore_system_lyxrc ||
1493 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1494 string const path = os::external_path(secondary_kbmap);
1495 os << "\\kbmap_secondary \"" << path << "\"\n";
1500 if (ignore_system_lyxrc ||
1501 lyxpipes != system_lyxrc.lyxpipes) {
1502 string const path = os::external_path(lyxpipes);
1503 os << "\\serverpipe \"" << path << "\"\n";
1507 case RC_DATE_INSERT_FORMAT:
1508 if (ignore_system_lyxrc ||
1509 date_insert_format != system_lyxrc.date_insert_format) {
1510 os << "\\date_insert_format \"" << date_insert_format
1515 case RC_LABEL_INIT_LENGTH:
1516 if (ignore_system_lyxrc ||
1517 label_init_length != system_lyxrc.label_init_length) {
1518 os << "\\label_init_length " << label_init_length
1525 os << "\\user_name \"" << user_name << "\"\n";
1530 os << "\\user_email \"" << user_email << "\"\n";
1534 case RC_SHOW_BANNER:
1535 if (ignore_system_lyxrc ||
1536 show_banner != system_lyxrc.show_banner) {
1537 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1543 if (ignore_system_lyxrc ||
1544 preview != system_lyxrc.preview) {
1550 case PREVIEW_NO_MATH:
1557 os << "\\preview " << status << '\n';
1562 case RC_PREVIEW_HASHED_LABELS:
1563 if (ignore_system_lyxrc ||
1564 preview_hashed_labels !=
1565 system_lyxrc.preview_hashed_labels) {
1566 os << "\\preview_hashed_labels "
1567 << convert<string>(preview_hashed_labels) << '\n';
1572 case RC_PREVIEW_SCALE_FACTOR:
1573 if (ignore_system_lyxrc ||
1574 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1575 os << "\\preview_scale_factor "
1576 << preview_scale_factor << '\n';
1581 case RC_USE_CONVERTER_CACHE:
1582 if (ignore_system_lyxrc ||
1583 use_converter_cache != system_lyxrc.use_converter_cache) {
1584 os << "\\use_converter_cache "
1585 << convert<string>(use_converter_cache) << '\n';
1590 case RC_CONVERTER_CACHE_MAXAGE:
1591 if (ignore_system_lyxrc ||
1592 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1593 os << "\\converter_cache_maxage "
1594 << converter_cache_maxage << '\n';
1600 << "# SCREEN & FONTS SECTION ############################\n"
1604 if (ignore_system_lyxrc ||
1605 dpi != system_lyxrc.dpi) {
1606 os << "\\screen_dpi " << dpi << '\n';
1610 case RC_SCREEN_ZOOM:
1611 if (ignore_system_lyxrc ||
1612 zoom != system_lyxrc.zoom) {
1613 os << "\\screen_zoom " << zoom << '\n';
1617 case RC_GEOMETRY_SESSION:
1618 if (ignore_system_lyxrc ||
1619 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1620 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1625 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1626 if (ignore_system_lyxrc ||
1627 cursor_follows_scrollbar
1628 != system_lyxrc.cursor_follows_scrollbar) {
1629 os << "\\cursor_follows_scrollbar "
1630 << convert<string>(cursor_follows_scrollbar) << '\n';
1634 case RC_SCROLL_BELOW_DOCUMENT:
1635 if (ignore_system_lyxrc ||
1636 scroll_below_document
1637 != system_lyxrc.scroll_below_document) {
1638 os << "\\scroll_below_document "
1639 << convert<string>(scroll_below_document) << '\n';
1643 case RC_PARAGRAPH_MARKERS:
1644 if (ignore_system_lyxrc ||
1646 != system_lyxrc.paragraph_markers) {
1647 os << "\\paragraph_markers "
1648 << convert<string>(paragraph_markers) << '\n';
1652 case RC_MAC_LIKE_WORD_MOVEMENT:
1653 if (ignore_system_lyxrc ||
1654 mac_like_word_movement
1655 != system_lyxrc.mac_like_word_movement) {
1656 os << "\\mac_like_word_movement "
1657 << convert<string>(mac_like_word_movement) << '\n';
1661 case RC_MACRO_EDIT_STYLE:
1662 if (ignore_system_lyxrc ||
1664 != system_lyxrc.macro_edit_style) {
1665 os << "\\macro_edit_style ";
1666 switch (macro_edit_style) {
1667 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1668 case MACRO_EDIT_INLINE: os << "1\n"; break;
1669 case MACRO_EDIT_LIST: os << "2\n"; break;
1674 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1675 if (ignore_system_lyxrc ||
1676 dialogs_iconify_with_main
1677 != system_lyxrc.dialogs_iconify_with_main) {
1678 os << "\\dialogs_iconify_with_main "
1679 << convert<string>(dialogs_iconify_with_main) << '\n';
1683 case RC_SCREEN_FONT_ROMAN:
1684 if (ignore_system_lyxrc ||
1685 roman_font_name != system_lyxrc.roman_font_name) {
1686 os << "\\screen_font_roman \"" << roman_font_name
1691 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1692 if (ignore_system_lyxrc ||
1693 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1694 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1699 case RC_SCREEN_FONT_SANS:
1700 if (ignore_system_lyxrc ||
1701 sans_font_name != system_lyxrc.sans_font_name) {
1702 os << "\\screen_font_sans \"" << sans_font_name
1707 case RC_SCREEN_FONT_SANS_FOUNDRY:
1708 if (ignore_system_lyxrc ||
1709 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1710 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1715 case RC_SCREEN_FONT_TYPEWRITER:
1716 if (ignore_system_lyxrc ||
1717 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1718 os << "\\screen_font_typewriter \""
1719 << typewriter_font_name << "\"\n";
1723 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1724 if (ignore_system_lyxrc ||
1725 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1726 os << "\\screen_font_typewriter_foundry \""
1727 << typewriter_font_foundry << "\"\n";
1732 case RC_SCREEN_FONT_SCALABLE:
1733 if (ignore_system_lyxrc ||
1734 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1735 os << "\\screen_font_scalable "
1736 << convert<string>(use_scalable_fonts)
1741 case RC_SCREEN_FONT_SIZES:
1742 if (ignore_system_lyxrc ||
1743 font_sizes[FONT_SIZE_TINY]
1744 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1745 font_sizes[FONT_SIZE_SCRIPT]
1746 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1747 font_sizes[FONT_SIZE_FOOTNOTE]
1748 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1749 font_sizes[FONT_SIZE_SMALL]
1750 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1751 font_sizes[FONT_SIZE_NORMAL]
1752 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1753 font_sizes[FONT_SIZE_LARGE]
1754 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1755 font_sizes[FONT_SIZE_LARGER]
1756 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1757 font_sizes[FONT_SIZE_LARGEST]
1758 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1759 font_sizes[FONT_SIZE_HUGE]
1760 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1761 font_sizes[FONT_SIZE_HUGER]
1762 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1763 os.setf(ios::fixed);
1765 os << "\\screen_font_sizes"
1766 << ' ' << font_sizes[FONT_SIZE_TINY]
1767 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1768 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1769 << ' ' << font_sizes[FONT_SIZE_SMALL]
1770 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1771 << ' ' << font_sizes[FONT_SIZE_LARGE]
1772 << ' ' << font_sizes[FONT_SIZE_LARGER]
1773 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1774 << ' ' << font_sizes[FONT_SIZE_HUGE]
1775 << ' ' << font_sizes[FONT_SIZE_HUGER]
1780 case RC_FULL_SCREEN_LIMIT:
1781 if (ignore_system_lyxrc ||
1782 full_screen_limit != system_lyxrc.full_screen_limit) {
1783 os << "\\fullscreen_limit "
1784 << convert<string>(full_screen_limit)
1789 case RC_FULL_SCREEN_TOOLBARS:
1790 if (ignore_system_lyxrc ||
1791 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1792 os << "\\fullscreen_toolbars "
1793 << convert<string>(full_screen_toolbars)
1798 case RC_FULL_SCREEN_SCROLLBAR:
1799 if (ignore_system_lyxrc ||
1800 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1801 os << "\\fullscreen_scrollbar "
1802 << convert<string>(full_screen_scrollbar)
1807 case RC_FULL_SCREEN_TABBAR:
1808 if (ignore_system_lyxrc ||
1809 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1810 os << "\\fullscreen_tabbar "
1811 << convert<string>(full_screen_tabbar)
1816 case RC_FULL_SCREEN_MENUBAR:
1817 if (ignore_system_lyxrc ||
1818 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1819 os << "\\fullscreen_menubar "
1820 << convert<string>(full_screen_menubar)
1825 case RC_FULL_SCREEN_WIDTH:
1826 if (ignore_system_lyxrc ||
1827 full_screen_width != system_lyxrc.full_screen_width) {
1828 os << "\\fullscreen_width "
1829 << convert<string>(full_screen_width)
1834 case RC_OPEN_BUFFERS_IN_TABS:
1835 if (ignore_system_lyxrc ||
1836 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1837 os << "\\open_buffers_in_tabs "
1838 << convert<string>(open_buffers_in_tabs)
1841 case RC_SINGLE_CLOSE_TAB_BUTTON:
1842 if (ignore_system_lyxrc ||
1843 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1844 os << "\\single_close_tab_button "
1845 << convert<string>(single_close_tab_button)
1852 << "# COLOR SECTION ###################################\n"
1856 for (int i = 0; i < Color_ignore; ++i) {
1857 ColorCode lc = static_cast<ColorCode>(i);
1858 string const col = lcolor.getX11Name(lc);
1859 if (ignore_system_lyxrc
1860 || col != system_lcolor.getX11Name(lc)) {
1861 os << "\\set_color \""
1862 << lcolor.getLyXName(lc) << "\" \""
1870 << "# PRINTER SECTION ###################################\n"
1874 if (ignore_system_lyxrc ||
1875 printer != system_lyxrc.printer) {
1876 os << "\\printer \"" << printer << "\"\n";
1880 case RC_PRINT_ADAPTOUTPUT:
1881 if (ignore_system_lyxrc ||
1882 print_adapt_output != system_lyxrc.print_adapt_output) {
1883 os << "\\print_adapt_output "
1884 << convert<string>(print_adapt_output)
1889 case RC_PRINT_COMMAND:
1890 if (ignore_system_lyxrc ||
1891 print_command != system_lyxrc.print_command) {
1892 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1896 case RC_PRINTEXSTRAOPTIONS:
1897 if (ignore_system_lyxrc ||
1898 print_extra_options != system_lyxrc.print_extra_options) {
1899 os << "\\print_extra_options \"" << print_extra_options
1904 case RC_PRINTSPOOL_COMMAND:
1905 if (ignore_system_lyxrc ||
1906 print_spool_command != system_lyxrc.print_spool_command) {
1907 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1912 case RC_PRINTSPOOL_PRINTERPREFIX:
1913 if (ignore_system_lyxrc ||
1914 print_spool_printerprefix
1915 != system_lyxrc.print_spool_printerprefix) {
1916 os << "\\print_spool_printerprefix \""
1917 << print_spool_printerprefix << "\"\n";
1921 case RC_PRINTEVENPAGEFLAG:
1922 if (ignore_system_lyxrc ||
1923 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1924 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1929 case RC_PRINTODDPAGEFLAG:
1930 if (ignore_system_lyxrc ||
1931 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1932 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1937 case RC_PRINTREVERSEFLAG:
1938 if (ignore_system_lyxrc ||
1939 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1940 os << "\\print_reverse_flag \"" << print_reverse_flag
1945 case RC_PRINTLANDSCAPEFLAG:
1946 if (ignore_system_lyxrc ||
1947 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1948 os << "\\print_landscape_flag \"" << print_landscape_flag
1953 case RC_PRINTPAGERANGEFLAG:
1954 if (ignore_system_lyxrc ||
1955 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1956 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1961 case RC_PRINTCOPIESFLAG:
1962 if (ignore_system_lyxrc ||
1963 print_copies_flag != system_lyxrc.print_copies_flag) {
1964 os << "\\print_copies_flag \"" << print_copies_flag
1969 case RC_PRINTCOLLCOPIESFLAG:
1970 if (ignore_system_lyxrc ||
1971 print_collcopies_flag
1972 != system_lyxrc.print_collcopies_flag) {
1973 os << "\\print_collcopies_flag \""
1974 << print_collcopies_flag
1979 case RC_PRINTPAPERFLAG:
1980 if (ignore_system_lyxrc ||
1981 print_paper_flag != system_lyxrc.print_paper_flag) {
1982 os << "\\print_paper_flag \"" << print_paper_flag
1987 case RC_PRINTPAPERDIMENSIONFLAG:
1988 if (ignore_system_lyxrc ||
1989 print_paper_dimension_flag
1990 != system_lyxrc.print_paper_dimension_flag) {
1991 os << "\\print_paper_dimension_flag \""
1992 << print_paper_dimension_flag << "\"\n";
1996 case RC_PRINTTOPRINTER:
1997 if (ignore_system_lyxrc ||
1998 print_to_printer != system_lyxrc.print_to_printer) {
1999 os << "\\print_to_printer \"" << print_to_printer
2004 case RC_PRINTTOFILE:
2005 if (ignore_system_lyxrc ||
2006 print_to_file != system_lyxrc.print_to_file) {
2007 string const path = os::external_path(print_to_file);
2008 os << "\\print_to_file \"" << path << "\"\n";
2012 case RC_PRINTFILEEXTENSION:
2013 if (ignore_system_lyxrc ||
2014 print_file_extension != system_lyxrc.print_file_extension) {
2015 os << "\\print_file_extension \""
2016 << print_file_extension
2023 << "# TEX SECTION #######################################\n"
2026 case RC_FONT_ENCODING:
2027 if (ignore_system_lyxrc ||
2028 fontenc != system_lyxrc.fontenc) {
2029 os << "\\font_encoding \"" << fontenc << "\"\n";
2035 << "# FILE SECTION ######################################\n"
2038 case RC_DOCUMENTPATH:
2039 if (ignore_system_lyxrc ||
2040 document_path != system_lyxrc.document_path) {
2041 string const path = os::external_path(document_path);
2042 os << "\\document_path \"" << path << "\"\n";
2046 case RC_USELASTFILEPOS:
2047 if (ignore_system_lyxrc ||
2048 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2049 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2054 case RC_LOADSESSION:
2055 if (ignore_system_lyxrc ||
2056 load_session != system_lyxrc.load_session) {
2057 os << "\\load_session " << convert<string>(load_session)
2062 case RC_MOUSE_WHEEL_SPEED:
2063 if (ignore_system_lyxrc ||
2064 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2065 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2069 case RC_COMPLETION_INLINE_DELAY:
2070 if (ignore_system_lyxrc ||
2071 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2072 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2076 case RC_COMPLETION_INLINE_MATH:
2077 if (ignore_system_lyxrc ||
2078 completion_inline_math != system_lyxrc.completion_inline_math) {
2079 os << "\\completion_inline_math "
2080 << convert<string>(completion_inline_math) << '\n';
2084 case RC_COMPLETION_INLINE_TEXT:
2085 if (ignore_system_lyxrc ||
2086 completion_inline_text != system_lyxrc.completion_inline_text) {
2087 os << "\\completion_inline_text "
2088 << convert<string>(completion_inline_text) << '\n';
2092 case RC_COMPLETION_INLINE_DOTS:
2093 if (ignore_system_lyxrc ||
2094 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2095 os << "\\completion_inline_dots "
2096 << convert<string>(completion_inline_dots) << '\n';
2100 case RC_AUTOCORRECTION_MATH:
2101 if (ignore_system_lyxrc ||
2102 autocorrection_math != system_lyxrc.autocorrection_math) {
2103 os << "\\autocorrection_math "
2104 << convert<string>(autocorrection_math) << '\n';
2108 case RC_COMPLETION_POPUP_DELAY:
2109 if (ignore_system_lyxrc ||
2110 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2111 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2115 case RC_COMPLETION_POPUP_MATH:
2116 if (ignore_system_lyxrc ||
2117 completion_popup_math != system_lyxrc.completion_popup_math) {
2118 os << "\\completion_popup_math "
2119 << convert<string>(completion_popup_math) << '\n';
2123 case RC_COMPLETION_POPUP_TEXT:
2124 if (ignore_system_lyxrc ||
2125 completion_popup_text != system_lyxrc.completion_popup_text) {
2126 os << "\\completion_popup_text "
2127 << convert<string>(completion_popup_text) << '\n';
2131 case RC_COMPLETION_CURSOR_TEXT:
2132 if (ignore_system_lyxrc ||
2133 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2134 os << "\\completion_cursor_text "
2135 << convert<string>(completion_cursor_text) << '\n';
2139 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2140 if (ignore_system_lyxrc ||
2141 completion_popup_after_complete
2142 != system_lyxrc.completion_popup_after_complete) {
2143 os << "\\completion_popup_after_complete "
2144 << convert<string>(completion_popup_after_complete) << '\n';
2148 case RC_NUMLASTFILES:
2149 if (ignore_system_lyxrc ||
2150 num_lastfiles != system_lyxrc.num_lastfiles) {
2151 os << "\\num_lastfiles " << num_lastfiles << '\n';
2155 case RC_CHECKLASTFILES:
2156 if (ignore_system_lyxrc ||
2157 check_lastfiles != system_lyxrc.check_lastfiles) {
2158 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2163 case RC_EXAMPLEPATH:
2164 if (ignore_system_lyxrc ||
2165 example_path != system_lyxrc.example_path) {
2166 string const path = os::external_path(example_path);
2167 os << "\\example_path \"" << path << "\"\n";
2171 case RC_TEMPLATEPATH:
2172 if (ignore_system_lyxrc ||
2173 template_path != system_lyxrc.template_path) {
2174 string const path = os::external_path(template_path);
2175 os << "\\template_path \"" << path << "\"\n";
2179 case RC_TEMPDIRPATH:
2180 if (ignore_system_lyxrc ||
2181 tempdir_path != system_lyxrc.tempdir_path) {
2182 string const path = os::external_path(tempdir_path);
2183 os << "\\tempdir_path \"" << path << "\"\n";
2187 case RC_THESAURUSDIRPATH:
2188 if (ignore_system_lyxrc ||
2189 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2190 string const path = os::external_path(thesaurusdir_path);
2191 os << "\\thesaurusdir_path \"" << path << "\"\n";
2195 case RC_HUNSPELLDIR_PATH:
2196 if (ignore_system_lyxrc ||
2197 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2198 string const path = os::external_path(hunspelldir_path);
2199 os << "\\hunspelldir_path \"" << path << "\"\n";
2207 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2210 case RC_PLAINTEXT_LINELEN:
2211 if (ignore_system_lyxrc ||
2212 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2213 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2217 case RC_MAKE_BACKUP:
2218 if (ignore_system_lyxrc ||
2219 make_backup != system_lyxrc.make_backup) {
2220 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2224 case RC_BACKUPDIR_PATH:
2225 if (ignore_system_lyxrc ||
2226 backupdir_path != system_lyxrc.backupdir_path) {
2227 string const path = os::external_path(backupdir_path);
2228 os << "\\backupdir_path \"" << path << "\"\n";
2234 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2238 << "# SPELLCHECKER SECTION ##############################\n"
2241 case RC_SPELL_COMMAND:
2242 case RC_USE_SPELL_LIB:
2246 case RC_ACCEPT_COMPOUND:
2247 if (ignore_system_lyxrc ||
2248 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2249 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2254 case RC_USE_ALT_LANG:
2259 if (ignore_system_lyxrc ||
2260 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2261 os << "\\alternate_language \"" << spellchecker_alt_lang
2266 case RC_USE_ESC_CHARS:
2270 if (ignore_system_lyxrc ||
2271 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2272 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2276 case RC_USE_PERS_DICT:
2280 case RC_USE_TOOLTIP:
2281 if (ignore_system_lyxrc ||
2282 use_tooltip != system_lyxrc.use_tooltip) {
2283 os << "\\use_tooltip "
2284 << convert<string>(use_tooltip)
2289 case RC_USE_PIXMAP_CACHE:
2290 if (ignore_system_lyxrc ||
2291 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2292 os << "\\use_pixmap_cache "
2293 << convert<string>(use_pixmap_cache)
2302 case RC_USE_INP_ENC:
2308 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2313 case RC_SPELLCHECKER:
2314 if (ignore_system_lyxrc ||
2315 spellchecker != system_lyxrc.spellchecker) {
2316 os << "\\spellchecker " << spellchecker << '\n';
2321 case RC_SPELLCHECK_CONTINUOUSLY:
2322 if (ignore_system_lyxrc ||
2323 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2324 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2330 case RC_RTL_SUPPORT:
2331 if (ignore_system_lyxrc ||
2332 rtl_support != system_lyxrc.rtl_support) {
2333 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2337 case RC_VISUAL_CURSOR:
2338 if (ignore_system_lyxrc ||
2339 visual_cursor != system_lyxrc.visual_cursor) {
2340 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2344 case RC_LANGUAGE_PACKAGE:
2345 if (ignore_system_lyxrc ||
2346 language_package != system_lyxrc.language_package) {
2347 os << "\\language_package \"" << language_package
2352 case RC_LANGUAGE_GLOBAL_OPTIONS:
2353 if (ignore_system_lyxrc ||
2354 language_global_options
2355 != system_lyxrc.language_global_options) {
2356 os << "\\language_global_options \""
2357 << convert<string>(language_global_options)
2362 case RC_LANGUAGE_USE_BABEL:
2363 if (ignore_system_lyxrc ||
2364 language_use_babel != system_lyxrc.language_use_babel) {
2365 os << "\\language_use_babel \""
2366 << convert<string>(language_use_babel)
2371 case RC_LANGUAGE_COMMAND_BEGIN:
2372 if (ignore_system_lyxrc ||
2373 language_command_begin
2374 != system_lyxrc.language_command_begin) {
2375 os << "\\language_command_begin \""
2376 << language_command_begin
2381 case RC_LANGUAGE_COMMAND_END:
2382 if (ignore_system_lyxrc ||
2383 language_command_end
2384 != system_lyxrc.language_command_end) {
2385 os << "\\language_command_end \"" << language_command_end
2390 case RC_LANGUAGE_COMMAND_LOCAL:
2391 if (ignore_system_lyxrc ||
2392 language_command_local
2393 != system_lyxrc.language_command_local) {
2394 os << "\\language_command_local \""
2395 << language_command_local
2400 case RC_LANGUAGE_AUTO_BEGIN:
2401 if (ignore_system_lyxrc ||
2402 language_auto_begin != system_lyxrc.language_auto_begin) {
2403 os << "\\language_auto_begin "
2404 << convert<string>(language_auto_begin) << '\n';
2408 case RC_LANGUAGE_AUTO_END:
2409 if (ignore_system_lyxrc ||
2410 language_auto_end != system_lyxrc.language_auto_end) {
2411 os << "\\language_auto_end "
2412 << convert<string>(language_auto_end) << '\n';
2416 case RC_MARK_FOREIGN_LANGUAGE:
2417 if (ignore_system_lyxrc ||
2418 mark_foreign_language
2419 != system_lyxrc.mark_foreign_language) {
2420 os << "\\mark_foreign_language " <<
2421 convert<string>(mark_foreign_language) << '\n';
2427 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2430 case RC_AUTO_NUMBER:
2431 if (ignore_system_lyxrc ||
2432 auto_number != system_lyxrc.auto_number) {
2433 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2437 case RC_DEFAULT_LANGUAGE:
2438 if (ignore_system_lyxrc ||
2439 default_language != system_lyxrc.default_language) {
2440 os << "\\default_language " << default_language << '\n';
2444 case RC_GUI_LANGUAGE:
2445 if (ignore_system_lyxrc ||
2446 gui_language != system_lyxrc.gui_language) {
2447 os << "\\gui_language " << gui_language << '\n';
2453 << "# FORMATS SECTION ##########################\n"
2457 // New/modified formats
2458 for (Formats::const_iterator cit = formats.begin();
2459 cit != formats.end(); ++cit) {
2460 Format const * format =
2461 system_formats.getFormat(cit->name());
2463 format->extension() != cit->extension() ||
2464 format->prettyname() != cit->prettyname() ||
2465 format->shortcut() != cit->shortcut() ||
2466 format->viewer() != cit->viewer() ||
2467 format->editor() != cit->editor() ||
2468 format->documentFormat() != cit->documentFormat() ||
2469 format->vectorFormat() != cit->vectorFormat()) {
2470 os << "\\format \"" << cit->name() << "\" \""
2471 << cit->extension() << "\" \""
2472 << cit->prettyname() << "\" \""
2473 << cit->shortcut() << "\" \""
2474 << escapeCommand(cit->viewer()) << "\" \""
2475 << escapeCommand(cit->editor()) << "\" \"";
2476 vector<string> flags;
2477 if (cit->documentFormat())
2478 flags.push_back("document");
2479 if (cit->vectorFormat())
2480 flags.push_back("vector");
2481 os << getStringFromVector(flags);
2486 // Look for deleted formats
2487 for (Formats::const_iterator cit = system_formats.begin();
2488 cit != system_formats.end(); ++cit)
2489 if (!formats.getFormat(cit->name()))
2490 os << "\\format \"" << cit->name()
2491 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2494 case RC_VIEWER_ALTERNATIVES: {
2495 Alternatives::const_iterator it = viewer_alternatives.begin();
2496 Alternatives::const_iterator const en = viewer_alternatives.end();
2497 Alternatives::const_iterator const sysend =
2498 system_lyxrc.viewer_alternatives.end();
2499 for (; it != en; ++it) {
2500 string const & fmt = it->first;
2501 CommandSet const & cmd = it->second;
2502 CommandSet::const_iterator sit = cmd.begin();
2503 CommandSet::const_iterator const sen = cmd.end();
2504 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2505 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2506 system_lyxrc.viewer_alternatives.find(fmt);
2507 for (; sit != sen; ++sit) {
2508 string const & cmd = *sit;
2509 if (ignore_system_lyxrc
2510 || sysfmt == sysend // format not found
2511 || sysfmt->second.count(cmd) == 0 // this command not found
2513 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2519 case RC_EDITOR_ALTERNATIVES: {
2520 Alternatives::const_iterator it = editor_alternatives.begin();
2521 Alternatives::const_iterator const en = editor_alternatives.end();
2522 Alternatives::const_iterator const sysend =
2523 system_lyxrc.editor_alternatives.end();
2524 for (; it != en; ++it) {
2525 string const & fmt = it->first;
2526 CommandSet const & cmd = it->second;
2527 CommandSet::const_iterator sit = cmd.begin();
2528 CommandSet::const_iterator const sen = cmd.end();
2529 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2530 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2531 system_lyxrc.editor_alternatives.find(fmt);
2532 for (; sit != sen; ++sit) {
2533 string const & cmd = *sit;
2534 if (ignore_system_lyxrc
2535 || sysfmt == sysend // format not found
2536 || sysfmt->second.count(cmd) == 0 // this command not found
2538 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2544 case RC_DEFAULT_VIEW_FORMAT:
2545 if (ignore_system_lyxrc ||
2546 default_view_format != system_lyxrc.default_view_format) {
2547 os << "\\default_view_format " << default_view_format << '\n';
2557 << "# CONVERTERS SECTION ##########################\n"
2561 // Look for new converters
2562 for (Converters::const_iterator cit = theConverters().begin();
2563 cit != theConverters().end(); ++cit) {
2564 Converter const * converter =
2565 theSystemConverters().getConverter(cit->from,
2568 converter->command != cit->command ||
2569 converter->flags != cit->flags)
2570 os << "\\converter \"" << cit->from << "\" \""
2571 << cit->to << "\" \""
2572 << escapeCommand(cit->command) << "\" \""
2573 << cit->flags << "\"\n";
2576 // New/modifed converters
2577 for (Converters::const_iterator cit = theSystemConverters().begin();
2578 cit != theSystemConverters().end(); ++cit)
2579 if (!theConverters().getConverter(cit->from, cit->to))
2580 os << "\\converter \"" << cit->from
2581 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2588 << "# COPIERS SECTION ##########################\n"
2591 // Look for new movers
2592 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2593 Movers::const_iterator const sysend = theSystemMovers().end();
2594 Movers::const_iterator it = theMovers().begin();
2595 Movers::const_iterator end = theMovers().end();
2597 for (; it != end; ++it) {
2598 Movers::const_iterator const sysit =
2599 find_if(sysbegin, sysend, SameMover(*it));
2600 if (sysit == sysend) {
2601 string const & fmt = it->first;
2602 string const & command =
2603 it->second.command();
2605 os << "\\copier " << fmt
2606 << " \"" << escapeCommand(command) << "\"\n";
2612 // We don't actually delete SpecialisedMover(s) from the
2613 // map, just clear their 'command', so there's no need
2614 // to test for anything else.
2621 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2623 // Why the switch you might ask. It is a trick to ensure that all
2624 // the elements in the LyXRCTags enum is handled. As you can see
2625 // there are no breaks at all. So it is just a huge fall-through.
2626 // The nice thing is that we will get a warning from the compiler
2627 // if we forget an element.
2628 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2630 case LyXRC::RC_ACCEPT_COMPOUND:
2631 case LyXRC::RC_ALT_LANG:
2632 case LyXRC::RC_PLAINTEXT_LINELEN:
2633 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2634 case LyXRC::RC_AUTOCORRECTION_MATH:
2635 case LyXRC::RC_AUTOREGIONDELETE:
2636 case LyXRC::RC_AUTORESET_OPTIONS:
2637 case LyXRC::RC_AUTOSAVE:
2638 case LyXRC::RC_AUTO_NUMBER:
2639 case LyXRC::RC_BACKUPDIR_PATH:
2640 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2641 case LyXRC::RC_BIBTEX_COMMAND:
2642 case LyXRC::RC_BINDFILE:
2643 case LyXRC::RC_CHECKLASTFILES:
2644 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2645 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2646 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2647 case LyXRC::RC_COMPLETION_INLINE_MATH:
2648 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2649 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2650 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2651 case LyXRC::RC_COMPLETION_POPUP_MATH:
2652 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2653 case LyXRC::RC_USELASTFILEPOS:
2654 case LyXRC::RC_LOADSESSION:
2655 case LyXRC::RC_CHKTEX_COMMAND:
2656 case LyXRC::RC_CONVERTER:
2657 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2658 case LyXRC::RC_COPIER:
2659 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2660 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2661 case LyXRC::RC_DATE_INSERT_FORMAT:
2662 case LyXRC::RC_DEFAULT_LANGUAGE:
2663 case LyXRC::RC_GUI_LANGUAGE:
2664 case LyXRC::RC_DEFAULT_PAPERSIZE:
2665 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2666 case LyXRC::RC_DEFFILE:
2667 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2668 case LyXRC::RC_DISPLAY_GRAPHICS:
2669 case LyXRC::RC_DOCUMENTPATH:
2670 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2671 FileName path(lyxrc_new.document_path);
2672 if (path.exists() && path.isDirectory())
2673 package().document_dir() = FileName(lyxrc.document_path);
2675 case LyXRC::RC_EDITOR_ALTERNATIVES:
2676 case LyXRC::RC_ESC_CHARS:
2677 case LyXRC::RC_EXAMPLEPATH:
2678 case LyXRC::RC_FONT_ENCODING:
2679 case LyXRC::RC_FORMAT:
2680 case LyXRC::RC_GROUP_LAYOUTS:
2681 case LyXRC::RC_HUNSPELLDIR_PATH:
2682 case LyXRC::RC_INDEX_ALTERNATIVES:
2683 case LyXRC::RC_INDEX_COMMAND:
2684 case LyXRC::RC_JBIBTEX_COMMAND:
2685 case LyXRC::RC_JINDEX_COMMAND:
2686 case LyXRC::RC_NOMENCL_COMMAND:
2687 case LyXRC::RC_INPUT:
2688 case LyXRC::RC_KBMAP:
2689 case LyXRC::RC_KBMAP_PRIMARY:
2690 case LyXRC::RC_KBMAP_SECONDARY:
2691 case LyXRC::RC_LABEL_INIT_LENGTH:
2692 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2693 case LyXRC::RC_LANGUAGE_AUTO_END:
2694 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2695 case LyXRC::RC_LANGUAGE_COMMAND_END:
2696 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2697 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2698 case LyXRC::RC_LANGUAGE_PACKAGE:
2699 case LyXRC::RC_LANGUAGE_USE_BABEL:
2700 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2701 case LyXRC::RC_MACRO_EDIT_STYLE:
2702 case LyXRC::RC_MAKE_BACKUP:
2703 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2704 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2705 case LyXRC::RC_NUMLASTFILES:
2706 case LyXRC::RC_PARAGRAPH_MARKERS:
2707 case LyXRC::RC_PATH_PREFIX:
2708 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2709 prependEnvPath("PATH", lyxrc.path_prefix);
2711 case LyXRC::RC_PERS_DICT:
2712 case LyXRC::RC_PREVIEW:
2713 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2714 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2715 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2716 case LyXRC::RC_PRINTCOPIESFLAG:
2717 case LyXRC::RC_PRINTER:
2718 case LyXRC::RC_PRINTEVENPAGEFLAG:
2719 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2720 case LyXRC::RC_PRINTFILEEXTENSION:
2721 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2722 case LyXRC::RC_PRINTODDPAGEFLAG:
2723 case LyXRC::RC_PRINTPAGERANGEFLAG:
2724 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2725 case LyXRC::RC_PRINTPAPERFLAG:
2726 case LyXRC::RC_PRINTREVERSEFLAG:
2727 case LyXRC::RC_PRINTSPOOL_COMMAND:
2728 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2729 case LyXRC::RC_PRINTTOFILE:
2730 case LyXRC::RC_PRINTTOPRINTER:
2731 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2732 case LyXRC::RC_PRINT_COMMAND:
2733 case LyXRC::RC_RTL_SUPPORT:
2734 case LyXRC::RC_SCREEN_DPI:
2735 case LyXRC::RC_SCREEN_FONT_ROMAN:
2736 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2737 case LyXRC::RC_SCREEN_FONT_SANS:
2738 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2739 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2740 case LyXRC::RC_SCREEN_FONT_SIZES:
2741 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2742 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2743 case LyXRC::RC_GEOMETRY_SESSION:
2744 case LyXRC::RC_SCREEN_ZOOM:
2745 case LyXRC::RC_SERVERPIPE:
2746 case LyXRC::RC_SET_COLOR:
2747 case LyXRC::RC_SHOW_BANNER:
2748 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2749 case LyXRC::RC_SPELL_COMMAND:
2750 case LyXRC::RC_SPELLCHECKER:
2751 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2752 case LyXRC::RC_SPLITINDEX_COMMAND:
2753 case LyXRC::RC_TEMPDIRPATH:
2754 case LyXRC::RC_TEMPLATEPATH:
2755 case LyXRC::RC_TEX_ALLOWS_SPACES:
2756 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2757 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2758 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2760 case LyXRC::RC_THESAURUSDIRPATH:
2761 case LyXRC::RC_UIFILE:
2762 case LyXRC::RC_USER_EMAIL:
2763 case LyXRC::RC_USER_NAME:
2764 case LyXRC::RC_USETEMPDIR:
2765 case LyXRC::RC_USE_ALT_LANG:
2766 case LyXRC::RC_USE_CONVERTER_CACHE:
2767 case LyXRC::RC_USE_ESC_CHARS:
2768 case LyXRC::RC_USE_INP_ENC:
2769 case LyXRC::RC_USE_PERS_DICT:
2770 case LyXRC::RC_USE_TOOLTIP:
2771 case LyXRC::RC_USE_PIXMAP_CACHE:
2772 case LyXRC::RC_USE_SPELL_LIB:
2773 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2774 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2775 case LyXRC::RC_SORT_LAYOUTS:
2776 case LyXRC::RC_FULL_SCREEN_LIMIT:
2777 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2778 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2779 case LyXRC::RC_FULL_SCREEN_TABBAR:
2780 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2781 case LyXRC::RC_FULL_SCREEN_WIDTH:
2782 case LyXRC::RC_VISUAL_CURSOR:
2783 case LyXRC::RC_VIEWER:
2784 case LyXRC::RC_VIEWER_ALTERNATIVES:
2785 case LyXRC::RC_LAST:
2792 string const LyXRC::getDescription(LyXRCTags tag)
2797 case RC_ACCEPT_COMPOUND:
2798 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2802 case RC_USE_ALT_LANG:
2803 str = _("Specify an alternate language. The default is to use the language of the document.");
2806 case RC_PLAINTEXT_ROFF_COMMAND:
2807 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.");
2810 case RC_PLAINTEXT_LINELEN:
2811 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.");
2814 case RC_AUTOREGIONDELETE:
2815 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2818 case RC_AUTORESET_OPTIONS:
2819 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2823 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2826 case RC_AUTO_NUMBER:
2829 case RC_BACKUPDIR_PATH:
2830 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.");
2833 case RC_BIBTEX_COMMAND:
2834 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2837 case RC_JBIBTEX_COMMAND:
2838 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2842 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2845 case RC_CHECKLASTFILES:
2846 str = _("Select to check whether the lastfiles still exist.");
2849 case RC_CHKTEX_COMMAND:
2850 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2859 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2860 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.");
2863 case RC_SCROLL_BELOW_DOCUMENT:
2864 str = _("LyX normally doesn't allow the user to scroll further than the bottom of the document. Set to true if you prefer to scroll the bottom of the document to the top of the screen");
2867 case RC_MAC_LIKE_WORD_MOVEMENT:
2868 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2871 case RC_SHOW_MACRO_LABEL:
2872 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2875 case RC_DATE_INSERT_FORMAT:
2876 //xgettext:no-c-format
2877 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2881 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2884 case RC_DEFAULT_VIEW_FORMAT:
2885 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2888 case RC_DEFAULT_LANGUAGE:
2889 str = _("New documents will be assigned this language.");
2892 case RC_DEFAULT_PAPERSIZE:
2893 str = _("Specify the default paper size.");
2896 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2897 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2900 case RC_DISPLAY_GRAPHICS:
2901 str = _("Select how LyX will display any graphics.");
2904 case RC_DOCUMENTPATH:
2905 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2909 case RC_USE_ESC_CHARS:
2910 str = _("Specify additional chars that can be part of a word.");
2913 case RC_EXAMPLEPATH:
2914 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2917 case RC_FONT_ENCODING:
2918 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2924 case RC_INDEX_COMMAND:
2925 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\".");
2928 case RC_JINDEX_COMMAND:
2929 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2932 case RC_NOMENCL_COMMAND:
2933 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2940 case RC_KBMAP_PRIMARY:
2941 case RC_KBMAP_SECONDARY:
2942 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.");
2945 case RC_LABEL_INIT_LENGTH:
2946 str = _("Maximum number of words in the initialization string for a new label");
2949 case RC_LANGUAGE_AUTO_BEGIN:
2950 str = _("Select if a language switching command is needed at the beginning of the document.");
2953 case RC_LANGUAGE_AUTO_END:
2954 str = _("Select if a language switching command is needed at the end of the document.");
2957 case RC_LANGUAGE_COMMAND_BEGIN:
2958 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.");
2961 case RC_LANGUAGE_COMMAND_END:
2962 str = _("The LaTeX command for changing back to the language of the document.");
2965 case RC_LANGUAGE_COMMAND_LOCAL:
2966 str = _("The LaTeX command for local changing of the language.");
2969 case RC_LANGUAGE_GLOBAL_OPTIONS:
2970 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2973 case RC_LANGUAGE_PACKAGE:
2974 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2977 case RC_LANGUAGE_USE_BABEL:
2978 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2981 case RC_USELASTFILEPOS:
2982 str = _("De-select if you do not want LyX to scroll to saved position.");
2985 case RC_LOADSESSION:
2986 str = _("De-select to prevent loading files opened from the last LyX session.");
2989 case RC_MAKE_BACKUP:
2990 str = _("De-select if you don't want LyX to create backup files.");
2993 case RC_MARK_FOREIGN_LANGUAGE:
2994 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2997 case RC_MOUSE_WHEEL_SPEED:
2998 str = bformat(_("The scrolling speed of the mouse wheel."),
3002 case RC_COMPLETION_POPUP_DELAY:
3003 str = _("The completion popup delay.");
3006 case RC_COMPLETION_POPUP_MATH:
3007 str = _("Select to display the completion popup in math mode.");
3010 case RC_COMPLETION_POPUP_TEXT:
3011 str = _("Select to display the completion popup in text mode.");
3014 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3015 str = _("Show the completion popup without delay after non-unique completion attempt.");
3018 case RC_COMPLETION_POPUP_TEXT:
3019 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3022 case RC_COMPLETION_POPUP_DELAY:
3023 str = _("The inline completion delay.");
3026 case RC_COMPLETION_INLINE_MATH:
3027 str = _("Select to display the inline completion in math mode.");
3030 case RC_COMPLETION_INLINE_TEXT:
3031 str = _("Select to display the inline completion in text mode.");
3034 case RC_COMPLETION_INLINE_DOTS:
3035 str = _("Use \"...\" to shorten long completions.");
3038 case RC_AUTOCORRECTION_MATH:
3039 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3042 case RC_NUMLASTFILES:
3043 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3047 case RC_PATH_PREFIX:
3048 str = _("Specify those directories which should be "
3049 "prepended to the PATH environment variable. "
3050 "Use the OS native format.");
3054 str = _("Shows a typeset preview of things such as math");
3057 case RC_PREVIEW_HASHED_LABELS:
3058 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3061 case RC_PREVIEW_SCALE_FACTOR:
3062 str = _("Scale the preview size to suit.");
3065 case RC_PRINTCOLLCOPIESFLAG:
3066 str = _("The option for specifying whether the copies should be collated.");
3069 case RC_PRINTCOPIESFLAG:
3070 str = _("The option for specifying the number of copies to print.");
3074 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3077 case RC_PRINTEVENPAGEFLAG:
3078 str = _("The option to print only even pages.");
3081 case RC_PRINTEXSTRAOPTIONS:
3082 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3085 case RC_PRINTFILEEXTENSION:
3086 str = _("Extension of printer program output file. Usually \".ps\".");
3089 case RC_PRINTLANDSCAPEFLAG:
3090 str = _("The option to print out in landscape.");
3093 case RC_PRINTODDPAGEFLAG:
3094 str = _("The option to print only odd pages.");
3097 case RC_PRINTPAGERANGEFLAG:
3098 str = _("The option for specifying a comma-separated list of pages to print.");
3101 case RC_PRINTPAPERDIMENSIONFLAG:
3102 str = _("Option to specify the dimensions of the print paper.");
3105 case RC_PRINTPAPERFLAG:
3106 str = _("The option to specify paper type.");
3109 case RC_PRINTREVERSEFLAG:
3110 str = _("The option to reverse the order of the pages printed.");
3113 case RC_PRINTSPOOL_COMMAND:
3114 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.");
3117 case RC_PRINTSPOOL_PRINTERPREFIX:
3118 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.");
3121 case RC_PRINTTOFILE:
3122 str = _("Option to pass to the print program to print to a file.");
3125 case RC_PRINTTOPRINTER:
3126 str = _("Option to pass to the print program to print on a specific printer.");
3129 case RC_PRINT_ADAPTOUTPUT:
3130 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3133 case RC_PRINT_COMMAND:
3134 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3137 case RC_RTL_SUPPORT:
3138 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3141 case RC_VISUAL_CURSOR:
3142 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3146 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3149 case RC_SCREEN_FONT_ROMAN:
3150 case RC_SCREEN_FONT_SANS:
3151 case RC_SCREEN_FONT_TYPEWRITER:
3152 str = _("The screen fonts used to display the text while editing.");
3155 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3156 case RC_SCREEN_FONT_SANS_FOUNDRY:
3157 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3160 case RC_SCREEN_FONT_SCALABLE:
3161 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.");
3164 case RC_SCREEN_FONT_SIZES:
3165 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3168 case RC_SCREEN_ZOOM:
3169 //xgettext:no-c-format
3170 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3173 case RC_GEOMETRY_SESSION:
3174 str = _("Allow session manager to save and restore windows geometry.");
3178 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3184 case RC_SHOW_BANNER:
3185 str = _("De-select if you don't want the startup banner.");
3188 case RC_TEMPDIRPATH:
3189 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3192 case RC_THESAURUSDIRPATH:
3193 str = _("This is the place where the files of the thesaurus library reside.");
3196 case RC_TEMPLATEPATH:
3197 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3200 case RC_TEX_ALLOWS_SPACES:
3203 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3207 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3219 case RC_USE_TOOLTIP:
3220 str = _("Enable the automatic appearance of tool tips in the work area.");
3223 case RC_USE_PIXMAP_CACHE:
3224 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3227 case RC_USE_SPELL_LIB:
3230 case RC_VIEWDVI_PAPEROPTION:
3231 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3246 // The global instance
3249 // The global copy of the system lyxrc entries (everything except preferences)