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 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
115 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
116 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
117 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
118 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
119 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
120 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
121 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
122 { "\\load_session", LyXRC::RC_LOADSESSION },
123 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
124 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
125 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
126 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
127 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
128 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
129 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
130 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
131 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
132 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
133 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
134 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
135 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
136 { "\\preview", LyXRC::RC_PREVIEW },
137 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
138 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
139 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
140 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
141 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
142 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
143 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
144 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
145 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
146 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
147 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
148 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
149 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
150 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
151 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
152 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
153 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
154 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
155 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
156 { "\\printer", LyXRC::RC_PRINTER },
157 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
158 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
159 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
160 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
161 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
162 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
163 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
164 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
165 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
166 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
167 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
168 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
169 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
170 { "\\set_color", LyXRC::RC_SET_COLOR },
171 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
172 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
173 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
174 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
175 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
176 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
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 #if defined(USE_ASPELL)
281 spellchecker = "aspell";
282 #elif defined(USE_HUNSPELL)
283 spellchecker = "hunspell";
285 spellchecker = "aspell";
287 spellchecker_accept_compound = false;
288 spellcheck_continuously = false;
289 spellcheck_notes = true;
292 visual_cursor = false;
294 mark_foreign_language = true;
295 language_auto_begin = true;
296 language_auto_end = true;
297 language_global_options = true;
298 language_use_babel = true;
299 language_package = "\\usepackage{babel}";
300 language_command_begin = "\\selectlanguage{$$lang}";
301 language_command_local = "\\foreignlanguage{$$lang}{";
302 sort_layouts = false;
303 group_layouts = true;
304 default_language = "english";
305 gui_language = "auto";
307 windows_style_tex_paths = false;
308 tex_allows_spaces = false;
309 date_insert_format = "%x";
310 cursor_follows_scrollbar = false;
311 scroll_below_document = false;
312 paragraph_markers = false;
313 mac_like_word_movement = false;
314 macro_edit_style = MACRO_EDIT_INLINE_BOX;
315 dialogs_iconify_with_main = false;
316 preview = PREVIEW_OFF;
317 preview_hashed_labels = false;
318 preview_scale_factor = 1.0;
319 use_converter_cache = true;
321 use_pixmap_cache = false;
322 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
323 user_name = to_utf8(support::user_name());
324 user_email = to_utf8(support::user_email());
325 open_buffers_in_tabs = true;
326 single_close_tab_button = false;
328 // Fullscreen settings
329 full_screen_limit = false;
330 full_screen_toolbars = true;
331 full_screen_tabbar = true;
332 full_screen_menubar = true;
333 full_screen_scrollbar = true;
334 full_screen_width = 700;
336 completion_cursor_text = true;
337 completion_popup_math = true;
338 completion_popup_text = false;
339 completion_popup_delay = 2.0;
340 completion_popup_after_complete = true;
341 autocorrection_math = false;
342 completion_inline_math = true;
343 completion_inline_text = false;
344 completion_inline_dots = -1;
345 completion_inline_delay = 0.2;
351 void oldFontFormat(string & family, string & foundry)
353 if (family.empty() || family[0] != '-')
355 foundry = token(family, '-', 1);
356 family = token(family, '-', 2);
364 int LyXRC::read(FileName const & filename)
366 Lexer lexrc(lyxrcTags);
367 if (lyxerr.debugging(Debug::PARSER))
368 lexrc.printTable(lyxerr);
370 lexrc.setFile(filename);
374 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
380 int LyXRC::read(istream & is)
382 Lexer lexrc(lyxrcTags);
383 if (lyxerr.debugging(Debug::PARSER))
384 lexrc.printTable(lyxerr);
390 LYXERR(Debug::LYXRC, "Reading istream...");
396 int LyXRC::read(Lexer & lexrc)
401 while (lexrc.isOK()) {
402 // By using two switches we take advantage of the compiler
403 // telling us if we have missed a LyXRCTags element in
404 // the second switch.
405 // Note that this also shows a problem with Lexer since it
406 // helps us avoid taking advantage of the strictness of the
409 int le = lexrc.lex();
411 case Lexer::LEX_UNDEF:
412 lexrc.printError("Unknown tag `$$Token'");
414 case Lexer::LEX_FEOF:
419 switch (static_cast<LyXRCTags>(le)) {
420 case RC_INPUT: // Include file
423 libFileSearch(string(),
426 lexrc.printError("Error reading "
427 "included file: " + tmp.absFilename());
433 bind_file = os::internal_path(lexrc.getString());
438 def_file = os::internal_path(lexrc.getString());
443 ui_file = os::internal_path(lexrc.getString());
446 case RC_AUTORESET_OPTIONS:
447 lexrc >> auto_reset_options;
450 case RC_DISPLAY_GRAPHICS:
452 display_graphics = lexrc.getString() == "true";
455 case RC_TEX_EXPECTS_WINDOWS_PATHS:
456 lexrc >> windows_style_tex_paths;
459 case RC_TEX_ALLOWS_SPACES:
460 lexrc >> tex_allows_spaces;
467 case RC_KBMAP_PRIMARY:
469 string const kmap(os::internal_path(lexrc.getString()));
470 if (!libFileSearch("kbd", kmap, "kmap").empty()
472 primary_kbmap = kmap;
474 lexrc.printError("LyX: Keymap `$$Token' not found");
479 case RC_KBMAP_SECONDARY:
481 string const kmap(os::internal_path(lexrc.getString()));
482 if (!libFileSearch("kbd", kmap, "kmap").empty()
484 secondary_kbmap = kmap;
486 lexrc.printError("LyX: Keymap `$$Token' not found");
491 case RC_FONT_ENCODING:
499 case RC_PRINT_COMMAND:
500 if (lexrc.next(true)) {
501 print_command = lexrc.getString();
505 case RC_PRINTEVENPAGEFLAG:
506 lexrc >> print_evenpage_flag;
509 case RC_PRINTODDPAGEFLAG:
510 lexrc >> print_oddpage_flag;
513 case RC_PRINTPAGERANGEFLAG:
514 lexrc >> print_pagerange_flag;
517 case RC_PRINTCOPIESFLAG:
518 lexrc >> print_copies_flag;
521 case RC_PRINTCOLLCOPIESFLAG:
522 lexrc >> print_collcopies_flag;
525 case RC_PRINTREVERSEFLAG:
526 lexrc >> print_reverse_flag;
529 case RC_PRINTLANDSCAPEFLAG:
530 lexrc >> print_landscape_flag;
533 case RC_PRINTTOPRINTER:
534 lexrc >> print_to_printer;
537 case RC_PRINT_ADAPTOUTPUT:
538 lexrc >> print_adapt_output;
543 print_to_file = os::internal_path(lexrc.getString());
547 case RC_PRINTFILEEXTENSION:
548 lexrc >> print_file_extension;
551 case RC_PRINTEXSTRAOPTIONS:
552 lexrc >> print_extra_options;
555 case RC_PRINTSPOOL_COMMAND:
556 if (lexrc.next(true)) {
557 print_spool_command = lexrc.getString();
561 case RC_PRINTSPOOL_PRINTERPREFIX:
562 lexrc >> print_spool_printerprefix;
565 case RC_PRINTPAPERDIMENSIONFLAG:
566 lexrc >> print_paper_dimension_flag;
569 case RC_PRINTPAPERFLAG:
570 lexrc >> print_paper_flag;
573 case RC_DEFAULT_PAPERSIZE:
575 string const size = ascii_lowercase(lexrc.getString());
576 if (size == "usletter")
577 default_papersize = PAPER_USLETTER;
578 else if (size == "legal")
579 default_papersize = PAPER_USLEGAL;
580 else if (size == "executive")
581 default_papersize = PAPER_USEXECUTIVE;
582 else if (size == "a3")
583 default_papersize = PAPER_A3;
584 else if (size == "a4")
585 default_papersize = PAPER_A4;
586 else if (size == "a5")
587 default_papersize = PAPER_A5;
588 else if (size == "b5")
589 default_papersize = PAPER_B5;
590 else if (size == "default")
591 default_papersize = PAPER_DEFAULT;
595 case RC_VIEWDVI_PAPEROPTION:
597 view_dvi_paper_option = lexrc.getString();
599 view_dvi_paper_option.erase();
602 case RC_CHKTEX_COMMAND:
603 if (lexrc.next(true)) {
604 chktex_command = lexrc.getString();
608 case RC_BIBTEX_ALTERNATIVES:
609 if (lexrc.next(true)) {
610 bibtex_alternatives.insert(lexrc.getString());
614 case RC_BIBTEX_COMMAND:
615 if (lexrc.next(true)) {
616 bibtex_command = lexrc.getString();
620 case RC_JBIBTEX_COMMAND:
621 if (lexrc.next(true)) {
622 jbibtex_command = lexrc.getString();
626 case RC_INDEX_ALTERNATIVES:
627 if (lexrc.next(true)) {
628 index_alternatives.insert(lexrc.getString());
632 case RC_INDEX_COMMAND:
633 if (lexrc.next(true)) {
634 index_command = lexrc.getString();
638 case RC_JINDEX_COMMAND:
639 if (lexrc.next(true)) {
640 jindex_command = lexrc.getString();
644 case RC_SPLITINDEX_COMMAND:
645 if (lexrc.next(true)) {
646 splitindex_command = lexrc.getString();
650 case RC_NOMENCL_COMMAND:
651 if (lexrc.next(true)) {
652 nomencl_command = lexrc.getString();
664 case RC_GEOMETRY_SESSION:
665 lexrc >> allow_geometry_session;
668 case RC_SCREEN_FONT_SIZES:
669 lexrc >> font_sizes[FONT_SIZE_TINY];
670 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
671 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
672 lexrc >> font_sizes[FONT_SIZE_SMALL];
673 lexrc >> font_sizes[FONT_SIZE_NORMAL];
674 lexrc >> font_sizes[FONT_SIZE_LARGE];
675 lexrc >> font_sizes[FONT_SIZE_LARGER];
676 lexrc >> font_sizes[FONT_SIZE_LARGEST];
677 lexrc >> font_sizes[FONT_SIZE_HUGE];
678 lexrc >> font_sizes[FONT_SIZE_HUGER];
681 case RC_SCREEN_FONT_SCALABLE:
682 lexrc >> use_scalable_fonts;
689 case RC_DOCUMENTPATH:
691 document_path = os::internal_path(lexrc.getString());
692 document_path = expandPath(document_path);
698 example_path = os::internal_path(lexrc.getString());
699 example_path = expandPath(example_path);
703 case RC_TEMPLATEPATH:
705 template_path = os::internal_path(lexrc.getString());
706 template_path = expandPath(template_path);
712 tempdir_path = os::internal_path(lexrc.getString());
713 tempdir_path = expandPath(tempdir_path);
717 case RC_THESAURUSDIRPATH:
719 thesaurusdir_path = os::internal_path(lexrc.getString());
720 thesaurusdir_path = expandPath(thesaurusdir_path);
724 case RC_HUNSPELLDIR_PATH:
726 hunspelldir_path = os::internal_path(lexrc.getString());
727 hunspelldir_path = expandPath(hunspelldir_path);
731 case RC_USELASTFILEPOS:
732 lexrc >> use_lastfilepos;
736 lexrc >> load_session;
739 case RC_MOUSE_WHEEL_SPEED:
740 lexrc >> mouse_wheel_speed;
743 case RC_COMPLETION_INLINE_DELAY:
744 lexrc >> completion_inline_delay;
747 case RC_COMPLETION_INLINE_MATH:
748 lexrc >> completion_inline_math;
751 case RC_COMPLETION_INLINE_TEXT:
752 lexrc >> completion_inline_text;
755 case RC_COMPLETION_INLINE_DOTS:
756 lexrc >> completion_inline_dots;
759 case RC_AUTOCORRECTION_MATH:
760 lexrc >> autocorrection_math;
763 case RC_COMPLETION_POPUP_DELAY:
764 lexrc >> completion_popup_delay;
767 case RC_COMPLETION_POPUP_MATH:
768 lexrc >> completion_popup_math;
771 case RC_COMPLETION_POPUP_TEXT:
772 lexrc >> completion_popup_text;
775 case RC_COMPLETION_CURSOR_TEXT:
776 lexrc >> completion_cursor_text;
779 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
780 lexrc >> completion_popup_after_complete;
783 case RC_NUMLASTFILES:
784 lexrc >> num_lastfiles;
787 case RC_CHECKLASTFILES:
788 lexrc >> check_lastfiles;
791 case RC_SCREEN_FONT_ROMAN:
793 roman_font_name = lexrc.getString();
794 oldFontFormat(roman_font_name,
799 case RC_SCREEN_FONT_SANS:
801 sans_font_name = lexrc.getString();
802 oldFontFormat(sans_font_name, sans_font_foundry);
806 case RC_SCREEN_FONT_TYPEWRITER:
808 typewriter_font_name = lexrc.getString();
809 oldFontFormat(typewriter_font_name,
810 typewriter_font_foundry);
814 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
815 lexrc >> roman_font_foundry;
818 case RC_SCREEN_FONT_SANS_FOUNDRY:
819 lexrc >> sans_font_foundry;
822 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
823 lexrc >> typewriter_font_foundry;
828 lexrc.printError("Missing color tag.");
831 string lyx_name = lexrc.getString();
834 lexrc.printError("Missing color name for color: `$$Token'");
837 string x11_name = lexrc.getString();
839 ColorCode const col =
840 lcolor.getFromLyXName(lyx_name);
841 if (col == Color_none ||
842 col == Color_inherit ||
846 if (!lcolor.setColor(col, x11_name))
847 LYXERR0("Bad lyxrc set_color for " << lyx_name);
851 case RC_AUTOREGIONDELETE:
852 // Auto region delete defaults to true
853 lexrc >> auto_region_delete;
858 lyxpipes = os::internal_path(lexrc.getString());
859 lyxpipes = expandPath(lyxpipes);
863 case RC_CURSOR_FOLLOWS_SCROLLBAR:
864 lexrc >> cursor_follows_scrollbar;
867 case RC_SCROLL_BELOW_DOCUMENT:
868 lexrc >> scroll_below_document;
871 case RC_PARAGRAPH_MARKERS:
872 lexrc >> paragraph_markers;
875 case RC_MAC_LIKE_WORD_MOVEMENT:
876 lexrc >> mac_like_word_movement;
879 case RC_MACRO_EDIT_STYLE:
881 switch (lexrc.getInteger()) {
882 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
883 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
884 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
889 case RC_DIALOGS_ICONIFY_WITH_MAIN:
890 lexrc >> dialogs_iconify_with_main;
893 case RC_PLAINTEXT_LINELEN:
894 lexrc >> plaintext_linelen;
896 // Spellchecker settings:
897 case RC_ACCEPT_COMPOUND:
898 lexrc >> spellchecker_accept_compound;
901 lexrc >> use_tooltip;
903 case RC_USE_PIXMAP_CACHE:
904 lexrc >> use_pixmap_cache;
906 case RC_SPELLCHECKER:
907 lexrc >> spellchecker;
910 lexrc >> spellchecker_alt_lang;
913 lexrc >> spellchecker_esc_chars;
915 case RC_SPELLCHECK_CONTINUOUSLY:
916 lexrc >> spellcheck_continuously;
918 case RC_SPELLCHECK_NOTES:
919 lexrc >> spellcheck_notes;
922 lexrc >> make_backup;
924 case RC_BACKUPDIR_PATH:
926 backupdir_path = os::internal_path(lexrc.getString());
927 backupdir_path = expandPath(backupdir_path);
930 case RC_DATE_INSERT_FORMAT:
931 lexrc >> date_insert_format;
933 case RC_LANGUAGE_PACKAGE:
934 lexrc >> language_package;
936 case RC_LANGUAGE_AUTO_BEGIN:
937 lexrc >> language_auto_begin;
939 case RC_LANGUAGE_AUTO_END:
940 lexrc >> language_auto_end;
942 case RC_LANGUAGE_GLOBAL_OPTIONS:
943 lexrc >> language_global_options;
945 case RC_LANGUAGE_USE_BABEL:
946 lexrc >> language_use_babel;
948 case RC_LANGUAGE_COMMAND_BEGIN:
949 lexrc >> language_command_begin;
951 case RC_LANGUAGE_COMMAND_END:
952 lexrc >> language_command_end;
954 case RC_LANGUAGE_COMMAND_LOCAL:
955 lexrc >> language_command_local;
958 lexrc >> rtl_support;
960 case RC_VISUAL_CURSOR:
961 lexrc >> visual_cursor;
964 lexrc >> auto_number;
966 case RC_MARK_FOREIGN_LANGUAGE:
967 lexrc >> mark_foreign_language;
973 fmt = lexrc.getString();
974 if (lexrc.next(true))
975 command = lexrc.getString();
976 setMover(fmt, command);
981 string from, to, command, flags;
983 from = lexrc.getString();
985 to = lexrc.getString();
986 if (lexrc.next(true))
987 command = lexrc.getString();
989 flags = lexrc.getString();
991 theConverters().erase(from, to);
993 theConverters().add(from, to, command, flags);
996 // compatibility with versions older than 1.4.0 only
998 string format, command;
999 lexrc >> format >> command;
1000 formats.setViewer(format, command);
1004 string format, extension, prettyname, shortcut;
1005 lexrc >> format >> extension >> prettyname >> shortcut;
1006 string viewer, editor;
1007 if (lexrc.next(true))
1008 viewer = lexrc.getString();
1009 if (lexrc.next(true))
1010 editor = lexrc.getString();
1012 // Hack to ensure compatibility with versions older
1014 int le = lexrc.lex();
1015 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1016 flags = lexrc.getString();
1017 if (le != Lexer::LEX_DATA) {
1018 // We have got a known token.
1019 // Therefore this is an old style
1020 // format definition without
1022 lexrc.pushToken(flags);
1026 int flgs = Format::none;
1027 while (!flags.empty()) {
1029 flags = split(flags, flag, ',');
1030 if (flag == "document")
1031 flgs |= Format::document;
1032 else if (flag == "vector")
1033 flgs |= Format::vector;
1035 LYXERR0("Ignoring unknown flag `"
1036 << flag << "' for format `"
1039 if (prettyname.empty()) {
1040 if (theConverters().formatIsUsed(format))
1041 LYXERR0("Can't delete format " << format);
1043 formats.erase(format);
1045 formats.add(format, extension, prettyname,
1046 shortcut, viewer, editor, flgs);
1050 case RC_VIEWER_ALTERNATIVES: {
1051 string format, command;
1053 format = lexrc.getString();
1054 if (lexrc.eatLine())
1055 command = lexrc.getString();
1056 viewer_alternatives[format].insert(command);
1059 case RC_EDITOR_ALTERNATIVES: {
1060 string format, command;
1061 lexrc >> format >> command;
1062 editor_alternatives[format].insert(command);
1066 case RC_DEFAULT_VIEW_FORMAT:
1067 lexrc >> default_view_format;
1070 case RC_DEFAULT_LANGUAGE:
1071 lexrc >> default_language;
1074 case RC_GUI_LANGUAGE:
1075 lexrc >> gui_language;
1078 case RC_SHOW_BANNER:
1079 lexrc >> show_banner;
1084 string const tmp = lexrc.getString();
1085 if (tmp == "true" || tmp == "on")
1086 preview = PREVIEW_ON;
1087 else if (tmp == "no_math")
1088 preview = PREVIEW_NO_MATH;
1090 preview = PREVIEW_OFF;
1091 if (tmp != "false" && tmp != "off")
1092 LYXERR0("Unrecognized preview status \""
1098 case RC_PREVIEW_HASHED_LABELS:
1099 lexrc >> preview_hashed_labels;
1102 case RC_PREVIEW_SCALE_FACTOR:
1103 lexrc >> preview_scale_factor;
1110 lexrc >> user_email;
1113 case RC_PATH_PREFIX:
1114 lexrc >> path_prefix;
1117 case RC_USE_CONVERTER_CACHE:
1118 lexrc >> use_converter_cache;
1120 case RC_CONVERTER_CACHE_MAXAGE:
1121 lexrc >> converter_cache_maxage;
1124 case RC_SORT_LAYOUTS:
1125 lexrc >> sort_layouts;
1127 case RC_GROUP_LAYOUTS:
1128 lexrc >> group_layouts;
1130 case RC_FULL_SCREEN_LIMIT:
1131 lexrc >> full_screen_limit;
1133 case RC_FULL_SCREEN_TOOLBARS:
1134 lexrc >> full_screen_toolbars;
1136 case RC_FULL_SCREEN_SCROLLBAR:
1137 lexrc >> full_screen_scrollbar;
1139 case RC_FULL_SCREEN_TABBAR:
1140 lexrc >> full_screen_tabbar;
1142 case RC_FULL_SCREEN_MENUBAR:
1143 lexrc >> full_screen_menubar;
1145 case RC_FULL_SCREEN_WIDTH:
1146 lexrc >> full_screen_width;
1148 case RC_OPEN_BUFFERS_IN_TABS:
1149 lexrc >> open_buffers_in_tabs;
1151 case RC_SINGLE_CLOSE_TAB_BUTTON:
1152 lexrc >> single_close_tab_button;
1155 // Obsoteted in 1.4.0
1158 case RC_SPELL_COMMAND:
1160 case RC_PLAINTEXT_ROFF_COMMAND:
1161 case RC_USE_ALT_LANG:
1162 case RC_USE_ESC_CHARS:
1163 case RC_USE_INP_ENC:
1164 case RC_USE_PERS_DICT:
1165 case RC_USE_SPELL_LIB:
1166 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1167 << lexrc.getString() << "'.");
1172 break; // this is just a dummy
1176 /// Update converters data-structures
1177 theConverters().update(formats);
1178 theConverters().buildGraph();
1184 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1186 ofstream ofs(filename.toFilesystemEncoding().c_str());
1188 write(ofs, ignore_system_lyxrc);
1192 void LyXRC::print() const
1194 if (lyxerr.debugging())
1195 write(lyxerr, false);
1203 typedef pair<string, SpecialisedMover> Data;
1205 SameMover(Data const & comparison)
1206 : comparison_(comparison) {}
1208 bool operator()(Data const & data) const
1210 return data.first == comparison_.first &&
1211 data.second.command() == comparison_.second.command();
1221 // Escape \ and " so that LyXLex can read the string later
1222 string escapeCommand(string const & str) {
1223 return subst(subst(str , "\\", "\\\\"),
1230 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1232 LyXRCTags tag = RC_LAST;
1234 if (!name.empty()) {
1235 for (int i = 0; i != lyxrcCount; ++i)
1236 if ("\\" + name == lyxrcTags[i].tag)
1237 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1241 os << "# LyX " << lyx_version
1242 << " generated this file. If you want to make your own\n"
1243 << "# modifications you should do them from inside LyX and save.\n"
1246 // Why the switch you might ask. It is a trick to ensure that all
1247 // the elements in the LyXRCTags enum are handled. As you can see
1248 // there are no breaks at all. So it is just a huge fall-through.
1249 // The nice thing is that we will get a warning from the compiler
1250 // if we forget an element.
1254 // input/include files are not done here
1256 if (ignore_system_lyxrc ||
1257 bind_file != system_lyxrc.bind_file) {
1258 string const path = os::external_path(bind_file);
1259 os << "\\bind_file \"" << path << "\"\n";
1265 if (ignore_system_lyxrc ||
1266 def_file != system_lyxrc.def_file) {
1267 string const path = os::external_path(def_file);
1268 os << "\\def_file \"" << path << "\"\n";
1277 << "# MISC SECTION ######################################\n"
1279 // bind files are not done here.
1281 case RC_PATH_PREFIX:
1282 if (ignore_system_lyxrc ||
1283 path_prefix != system_lyxrc.path_prefix) {
1284 os << "\\path_prefix \"" << path_prefix << "\"\n";
1289 if (ignore_system_lyxrc ||
1290 ui_file != system_lyxrc.ui_file) {
1291 string const path = os::external_path(ui_file);
1292 os << "\\ui_file \"" << path << "\"\n";
1296 case RC_AUTOREGIONDELETE:
1297 if (ignore_system_lyxrc ||
1298 auto_region_delete != system_lyxrc.auto_region_delete) {
1299 os << "# Set to false to inhibit automatic replacement of\n"
1300 << "# the current selection.\n"
1301 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1306 case RC_AUTORESET_OPTIONS:
1307 if (ignore_system_lyxrc ||
1308 auto_reset_options != system_lyxrc.auto_reset_options) {
1309 os << "# Set to false to inhibit automatic reset of\n"
1310 << "# the class options to defaults on class change.\n"
1311 << "\\auto_reset_options "
1312 << convert<string>(auto_reset_options)
1318 if (ignore_system_lyxrc ||
1319 autosave != system_lyxrc.autosave) {
1320 os << "# The time interval between auto-saves in seconds.\n"
1321 << "\\autosave " << autosave << '\n';
1325 case RC_DISPLAY_GRAPHICS:
1326 if (ignore_system_lyxrc ||
1327 display_graphics != system_lyxrc.display_graphics) {
1328 os << "# Display graphics within LyX\n"
1330 << "\\display_graphics "
1331 << (display_graphics ? "true" : "false")
1336 case RC_SORT_LAYOUTS:
1337 if (ignore_system_lyxrc ||
1338 sort_layouts != system_lyxrc.sort_layouts) {
1339 os << "# Sort layouts alphabetically.\n"
1340 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1344 case RC_GROUP_LAYOUTS:
1345 if (ignore_system_lyxrc ||
1346 group_layouts != system_lyxrc.group_layouts) {
1347 os << "# Group layouts by their category.\n"
1348 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1352 case RC_VIEWDVI_PAPEROPTION:
1353 if (ignore_system_lyxrc ||
1354 view_dvi_paper_option
1355 != system_lyxrc.view_dvi_paper_option) {
1356 os << "# Options used to specify paper size to the\n"
1357 << "# view_dvi_command (e.g. -paper)\n"
1358 << "\\view_dvi_paper_option \""
1359 << view_dvi_paper_option << "\"\n";
1363 case RC_DEFAULT_PAPERSIZE:
1364 if (ignore_system_lyxrc ||
1365 default_papersize != system_lyxrc.default_papersize) {
1366 os << "# The default papersize to use.\n"
1367 << "\\default_papersize \"";
1368 switch (default_papersize) {
1370 os << "default"; break;
1371 case PAPER_USLETTER:
1372 os << "usletter"; break;
1374 os << "legal"; break;
1375 case PAPER_USEXECUTIVE:
1376 os << "executive"; break;
1387 case PAPER_B4: break;
1393 case RC_CHKTEX_COMMAND:
1394 if (ignore_system_lyxrc ||
1395 chktex_command != system_lyxrc.chktex_command) {
1396 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1400 case RC_BIBTEX_ALTERNATIVES: {
1401 CommandSet::const_iterator it = bibtex_alternatives.begin();
1402 CommandSet::const_iterator end = bibtex_alternatives.end();
1403 for ( ; it != end; ++it) {
1404 if (ignore_system_lyxrc
1405 || !system_lyxrc.bibtex_alternatives.count(*it))
1406 os << "\\bibtex_alternatives \""
1412 case RC_BIBTEX_COMMAND:
1413 if (ignore_system_lyxrc ||
1414 bibtex_command != system_lyxrc.bibtex_command) {
1415 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1419 case RC_JBIBTEX_COMMAND:
1420 if (ignore_system_lyxrc ||
1421 jbibtex_command != system_lyxrc.jbibtex_command) {
1422 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1426 case RC_INDEX_ALTERNATIVES: {
1427 CommandSet::const_iterator it = index_alternatives.begin();
1428 CommandSet::const_iterator end = index_alternatives.end();
1429 for ( ; it != end; ++it) {
1430 if (ignore_system_lyxrc
1431 || !system_lyxrc.index_alternatives.count(*it))
1432 os << "\\index_alternatives \""
1438 case RC_INDEX_COMMAND:
1439 if (ignore_system_lyxrc ||
1440 index_command != system_lyxrc.index_command) {
1441 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1445 case RC_JINDEX_COMMAND:
1446 if (ignore_system_lyxrc ||
1447 jindex_command != system_lyxrc.jindex_command) {
1448 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1452 case RC_SPLITINDEX_COMMAND:
1453 if (ignore_system_lyxrc ||
1454 splitindex_command != system_lyxrc.splitindex_command) {
1455 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1459 case RC_NOMENCL_COMMAND:
1460 if (ignore_system_lyxrc ||
1461 nomencl_command != system_lyxrc.nomencl_command) {
1462 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1466 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1467 if (ignore_system_lyxrc ||
1468 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1469 os << "\\tex_expects_windows_paths "
1470 << convert<string>(windows_style_tex_paths) << '\n';
1474 case RC_TEX_ALLOWS_SPACES:
1475 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1476 os << "\\tex_allows_spaces "
1477 << convert<string>(tex_allows_spaces) << '\n';
1482 if (ignore_system_lyxrc ||
1483 use_kbmap != system_lyxrc.use_kbmap) {
1484 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1488 case RC_KBMAP_PRIMARY:
1489 if (ignore_system_lyxrc ||
1490 primary_kbmap != system_lyxrc.primary_kbmap) {
1491 string const path = os::external_path(primary_kbmap);
1492 os << "\\kbmap_primary \"" << path << "\"\n";
1496 case RC_KBMAP_SECONDARY:
1497 if (ignore_system_lyxrc ||
1498 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1499 string const path = os::external_path(secondary_kbmap);
1500 os << "\\kbmap_secondary \"" << path << "\"\n";
1505 if (ignore_system_lyxrc ||
1506 lyxpipes != system_lyxrc.lyxpipes) {
1507 string const path = os::external_path(lyxpipes);
1508 os << "\\serverpipe \"" << path << "\"\n";
1512 case RC_DATE_INSERT_FORMAT:
1513 if (ignore_system_lyxrc ||
1514 date_insert_format != system_lyxrc.date_insert_format) {
1515 os << "\\date_insert_format \"" << date_insert_format
1522 os << "\\user_name \"" << user_name << "\"\n";
1527 os << "\\user_email \"" << user_email << "\"\n";
1531 case RC_SHOW_BANNER:
1532 if (ignore_system_lyxrc ||
1533 show_banner != system_lyxrc.show_banner) {
1534 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1540 if (ignore_system_lyxrc ||
1541 preview != system_lyxrc.preview) {
1547 case PREVIEW_NO_MATH:
1554 os << "\\preview " << status << '\n';
1559 case RC_PREVIEW_HASHED_LABELS:
1560 if (ignore_system_lyxrc ||
1561 preview_hashed_labels !=
1562 system_lyxrc.preview_hashed_labels) {
1563 os << "\\preview_hashed_labels "
1564 << convert<string>(preview_hashed_labels) << '\n';
1569 case RC_PREVIEW_SCALE_FACTOR:
1570 if (ignore_system_lyxrc ||
1571 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1572 os << "\\preview_scale_factor "
1573 << preview_scale_factor << '\n';
1578 case RC_USE_CONVERTER_CACHE:
1579 if (ignore_system_lyxrc ||
1580 use_converter_cache != system_lyxrc.use_converter_cache) {
1581 os << "\\use_converter_cache "
1582 << convert<string>(use_converter_cache) << '\n';
1587 case RC_CONVERTER_CACHE_MAXAGE:
1588 if (ignore_system_lyxrc ||
1589 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1590 os << "\\converter_cache_maxage "
1591 << converter_cache_maxage << '\n';
1597 << "# SCREEN & FONTS SECTION ############################\n"
1601 if (ignore_system_lyxrc ||
1602 dpi != system_lyxrc.dpi) {
1603 os << "\\screen_dpi " << dpi << '\n';
1607 case RC_SCREEN_ZOOM:
1608 if (ignore_system_lyxrc ||
1609 zoom != system_lyxrc.zoom) {
1610 os << "\\screen_zoom " << zoom << '\n';
1614 case RC_GEOMETRY_SESSION:
1615 if (ignore_system_lyxrc ||
1616 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1617 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1622 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1623 if (ignore_system_lyxrc ||
1624 cursor_follows_scrollbar
1625 != system_lyxrc.cursor_follows_scrollbar) {
1626 os << "\\cursor_follows_scrollbar "
1627 << convert<string>(cursor_follows_scrollbar) << '\n';
1631 case RC_SCROLL_BELOW_DOCUMENT:
1632 if (ignore_system_lyxrc ||
1633 scroll_below_document
1634 != system_lyxrc.scroll_below_document) {
1635 os << "\\scroll_below_document "
1636 << convert<string>(scroll_below_document) << '\n';
1640 case RC_PARAGRAPH_MARKERS:
1641 if (ignore_system_lyxrc ||
1643 != system_lyxrc.paragraph_markers) {
1644 os << "\\paragraph_markers "
1645 << convert<string>(paragraph_markers) << '\n';
1649 case RC_MAC_LIKE_WORD_MOVEMENT:
1650 if (ignore_system_lyxrc ||
1651 mac_like_word_movement
1652 != system_lyxrc.mac_like_word_movement) {
1653 os << "\\mac_like_word_movement "
1654 << convert<string>(mac_like_word_movement) << '\n';
1658 case RC_MACRO_EDIT_STYLE:
1659 if (ignore_system_lyxrc ||
1661 != system_lyxrc.macro_edit_style) {
1662 os << "\\macro_edit_style ";
1663 switch (macro_edit_style) {
1664 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1665 case MACRO_EDIT_INLINE: os << "1\n"; break;
1666 case MACRO_EDIT_LIST: os << "2\n"; break;
1671 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1672 if (ignore_system_lyxrc ||
1673 dialogs_iconify_with_main
1674 != system_lyxrc.dialogs_iconify_with_main) {
1675 os << "\\dialogs_iconify_with_main "
1676 << convert<string>(dialogs_iconify_with_main) << '\n';
1680 case RC_SCREEN_FONT_ROMAN:
1681 if (ignore_system_lyxrc ||
1682 roman_font_name != system_lyxrc.roman_font_name) {
1683 os << "\\screen_font_roman \"" << roman_font_name
1688 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1689 if (ignore_system_lyxrc ||
1690 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1691 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1696 case RC_SCREEN_FONT_SANS:
1697 if (ignore_system_lyxrc ||
1698 sans_font_name != system_lyxrc.sans_font_name) {
1699 os << "\\screen_font_sans \"" << sans_font_name
1704 case RC_SCREEN_FONT_SANS_FOUNDRY:
1705 if (ignore_system_lyxrc ||
1706 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1707 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1712 case RC_SCREEN_FONT_TYPEWRITER:
1713 if (ignore_system_lyxrc ||
1714 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1715 os << "\\screen_font_typewriter \""
1716 << typewriter_font_name << "\"\n";
1720 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1721 if (ignore_system_lyxrc ||
1722 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1723 os << "\\screen_font_typewriter_foundry \""
1724 << typewriter_font_foundry << "\"\n";
1729 case RC_SCREEN_FONT_SCALABLE:
1730 if (ignore_system_lyxrc ||
1731 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1732 os << "\\screen_font_scalable "
1733 << convert<string>(use_scalable_fonts)
1738 case RC_SCREEN_FONT_SIZES:
1739 if (ignore_system_lyxrc ||
1740 font_sizes[FONT_SIZE_TINY]
1741 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1742 font_sizes[FONT_SIZE_SCRIPT]
1743 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1744 font_sizes[FONT_SIZE_FOOTNOTE]
1745 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1746 font_sizes[FONT_SIZE_SMALL]
1747 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1748 font_sizes[FONT_SIZE_NORMAL]
1749 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1750 font_sizes[FONT_SIZE_LARGE]
1751 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1752 font_sizes[FONT_SIZE_LARGER]
1753 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1754 font_sizes[FONT_SIZE_LARGEST]
1755 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1756 font_sizes[FONT_SIZE_HUGE]
1757 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1758 font_sizes[FONT_SIZE_HUGER]
1759 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1760 os.setf(ios::fixed);
1762 os << "\\screen_font_sizes"
1763 << ' ' << font_sizes[FONT_SIZE_TINY]
1764 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1765 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1766 << ' ' << font_sizes[FONT_SIZE_SMALL]
1767 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1768 << ' ' << font_sizes[FONT_SIZE_LARGE]
1769 << ' ' << font_sizes[FONT_SIZE_LARGER]
1770 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1771 << ' ' << font_sizes[FONT_SIZE_HUGE]
1772 << ' ' << font_sizes[FONT_SIZE_HUGER]
1777 case RC_FULL_SCREEN_LIMIT:
1778 if (ignore_system_lyxrc ||
1779 full_screen_limit != system_lyxrc.full_screen_limit) {
1780 os << "\\fullscreen_limit "
1781 << convert<string>(full_screen_limit)
1786 case RC_FULL_SCREEN_TOOLBARS:
1787 if (ignore_system_lyxrc ||
1788 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1789 os << "\\fullscreen_toolbars "
1790 << convert<string>(full_screen_toolbars)
1795 case RC_FULL_SCREEN_SCROLLBAR:
1796 if (ignore_system_lyxrc ||
1797 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1798 os << "\\fullscreen_scrollbar "
1799 << convert<string>(full_screen_scrollbar)
1804 case RC_FULL_SCREEN_TABBAR:
1805 if (ignore_system_lyxrc ||
1806 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1807 os << "\\fullscreen_tabbar "
1808 << convert<string>(full_screen_tabbar)
1813 case RC_FULL_SCREEN_MENUBAR:
1814 if (ignore_system_lyxrc ||
1815 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1816 os << "\\fullscreen_menubar "
1817 << convert<string>(full_screen_menubar)
1822 case RC_FULL_SCREEN_WIDTH:
1823 if (ignore_system_lyxrc ||
1824 full_screen_width != system_lyxrc.full_screen_width) {
1825 os << "\\fullscreen_width "
1826 << convert<string>(full_screen_width)
1831 case RC_OPEN_BUFFERS_IN_TABS:
1832 if (ignore_system_lyxrc ||
1833 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1834 os << "\\open_buffers_in_tabs "
1835 << convert<string>(open_buffers_in_tabs)
1838 case RC_SINGLE_CLOSE_TAB_BUTTON:
1839 if (ignore_system_lyxrc ||
1840 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1841 os << "\\single_close_tab_button "
1842 << convert<string>(single_close_tab_button)
1849 << "# COLOR SECTION ###################################\n"
1853 for (int i = 0; i < Color_ignore; ++i) {
1854 ColorCode lc = static_cast<ColorCode>(i);
1855 string const col = lcolor.getX11Name(lc);
1856 if (ignore_system_lyxrc
1857 || col != system_lcolor.getX11Name(lc)) {
1858 os << "\\set_color \""
1859 << lcolor.getLyXName(lc) << "\" \""
1867 << "# PRINTER SECTION ###################################\n"
1871 if (ignore_system_lyxrc ||
1872 printer != system_lyxrc.printer) {
1873 os << "\\printer \"" << printer << "\"\n";
1877 case RC_PRINT_ADAPTOUTPUT:
1878 if (ignore_system_lyxrc ||
1879 print_adapt_output != system_lyxrc.print_adapt_output) {
1880 os << "\\print_adapt_output "
1881 << convert<string>(print_adapt_output)
1886 case RC_PRINT_COMMAND:
1887 if (ignore_system_lyxrc ||
1888 print_command != system_lyxrc.print_command) {
1889 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1893 case RC_PRINTEXSTRAOPTIONS:
1894 if (ignore_system_lyxrc ||
1895 print_extra_options != system_lyxrc.print_extra_options) {
1896 os << "\\print_extra_options \"" << print_extra_options
1901 case RC_PRINTSPOOL_COMMAND:
1902 if (ignore_system_lyxrc ||
1903 print_spool_command != system_lyxrc.print_spool_command) {
1904 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1909 case RC_PRINTSPOOL_PRINTERPREFIX:
1910 if (ignore_system_lyxrc ||
1911 print_spool_printerprefix
1912 != system_lyxrc.print_spool_printerprefix) {
1913 os << "\\print_spool_printerprefix \""
1914 << print_spool_printerprefix << "\"\n";
1918 case RC_PRINTEVENPAGEFLAG:
1919 if (ignore_system_lyxrc ||
1920 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1921 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1926 case RC_PRINTODDPAGEFLAG:
1927 if (ignore_system_lyxrc ||
1928 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1929 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1934 case RC_PRINTREVERSEFLAG:
1935 if (ignore_system_lyxrc ||
1936 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1937 os << "\\print_reverse_flag \"" << print_reverse_flag
1942 case RC_PRINTLANDSCAPEFLAG:
1943 if (ignore_system_lyxrc ||
1944 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1945 os << "\\print_landscape_flag \"" << print_landscape_flag
1950 case RC_PRINTPAGERANGEFLAG:
1951 if (ignore_system_lyxrc ||
1952 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1953 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1958 case RC_PRINTCOPIESFLAG:
1959 if (ignore_system_lyxrc ||
1960 print_copies_flag != system_lyxrc.print_copies_flag) {
1961 os << "\\print_copies_flag \"" << print_copies_flag
1966 case RC_PRINTCOLLCOPIESFLAG:
1967 if (ignore_system_lyxrc ||
1968 print_collcopies_flag
1969 != system_lyxrc.print_collcopies_flag) {
1970 os << "\\print_collcopies_flag \""
1971 << print_collcopies_flag
1976 case RC_PRINTPAPERFLAG:
1977 if (ignore_system_lyxrc ||
1978 print_paper_flag != system_lyxrc.print_paper_flag) {
1979 os << "\\print_paper_flag \"" << print_paper_flag
1984 case RC_PRINTPAPERDIMENSIONFLAG:
1985 if (ignore_system_lyxrc ||
1986 print_paper_dimension_flag
1987 != system_lyxrc.print_paper_dimension_flag) {
1988 os << "\\print_paper_dimension_flag \""
1989 << print_paper_dimension_flag << "\"\n";
1993 case RC_PRINTTOPRINTER:
1994 if (ignore_system_lyxrc ||
1995 print_to_printer != system_lyxrc.print_to_printer) {
1996 os << "\\print_to_printer \"" << print_to_printer
2001 case RC_PRINTTOFILE:
2002 if (ignore_system_lyxrc ||
2003 print_to_file != system_lyxrc.print_to_file) {
2004 string const path = os::external_path(print_to_file);
2005 os << "\\print_to_file \"" << path << "\"\n";
2009 case RC_PRINTFILEEXTENSION:
2010 if (ignore_system_lyxrc ||
2011 print_file_extension != system_lyxrc.print_file_extension) {
2012 os << "\\print_file_extension \""
2013 << print_file_extension
2020 << "# TEX SECTION #######################################\n"
2023 case RC_FONT_ENCODING:
2024 if (ignore_system_lyxrc ||
2025 fontenc != system_lyxrc.fontenc) {
2026 os << "\\font_encoding \"" << fontenc << "\"\n";
2032 << "# FILE SECTION ######################################\n"
2035 case RC_DOCUMENTPATH:
2036 if (ignore_system_lyxrc ||
2037 document_path != system_lyxrc.document_path) {
2038 string const path = os::external_path(document_path);
2039 os << "\\document_path \"" << path << "\"\n";
2043 case RC_USELASTFILEPOS:
2044 if (ignore_system_lyxrc ||
2045 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2046 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2051 case RC_LOADSESSION:
2052 if (ignore_system_lyxrc ||
2053 load_session != system_lyxrc.load_session) {
2054 os << "\\load_session " << convert<string>(load_session)
2059 case RC_MOUSE_WHEEL_SPEED:
2060 if (ignore_system_lyxrc ||
2061 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2062 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2066 case RC_COMPLETION_INLINE_DELAY:
2067 if (ignore_system_lyxrc ||
2068 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2069 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2073 case RC_COMPLETION_INLINE_MATH:
2074 if (ignore_system_lyxrc ||
2075 completion_inline_math != system_lyxrc.completion_inline_math) {
2076 os << "\\completion_inline_math "
2077 << convert<string>(completion_inline_math) << '\n';
2081 case RC_COMPLETION_INLINE_TEXT:
2082 if (ignore_system_lyxrc ||
2083 completion_inline_text != system_lyxrc.completion_inline_text) {
2084 os << "\\completion_inline_text "
2085 << convert<string>(completion_inline_text) << '\n';
2089 case RC_COMPLETION_INLINE_DOTS:
2090 if (ignore_system_lyxrc ||
2091 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2092 os << "\\completion_inline_dots "
2093 << convert<string>(completion_inline_dots) << '\n';
2097 case RC_AUTOCORRECTION_MATH:
2098 if (ignore_system_lyxrc ||
2099 autocorrection_math != system_lyxrc.autocorrection_math) {
2100 os << "\\autocorrection_math "
2101 << convert<string>(autocorrection_math) << '\n';
2105 case RC_COMPLETION_POPUP_DELAY:
2106 if (ignore_system_lyxrc ||
2107 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2108 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2112 case RC_COMPLETION_POPUP_MATH:
2113 if (ignore_system_lyxrc ||
2114 completion_popup_math != system_lyxrc.completion_popup_math) {
2115 os << "\\completion_popup_math "
2116 << convert<string>(completion_popup_math) << '\n';
2120 case RC_COMPLETION_POPUP_TEXT:
2121 if (ignore_system_lyxrc ||
2122 completion_popup_text != system_lyxrc.completion_popup_text) {
2123 os << "\\completion_popup_text "
2124 << convert<string>(completion_popup_text) << '\n';
2128 case RC_COMPLETION_CURSOR_TEXT:
2129 if (ignore_system_lyxrc ||
2130 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2131 os << "\\completion_cursor_text "
2132 << convert<string>(completion_cursor_text) << '\n';
2136 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2137 if (ignore_system_lyxrc ||
2138 completion_popup_after_complete
2139 != system_lyxrc.completion_popup_after_complete) {
2140 os << "\\completion_popup_after_complete "
2141 << convert<string>(completion_popup_after_complete) << '\n';
2145 case RC_NUMLASTFILES:
2146 if (ignore_system_lyxrc ||
2147 num_lastfiles != system_lyxrc.num_lastfiles) {
2148 os << "\\num_lastfiles " << num_lastfiles << '\n';
2152 case RC_CHECKLASTFILES:
2153 if (ignore_system_lyxrc ||
2154 check_lastfiles != system_lyxrc.check_lastfiles) {
2155 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2160 case RC_EXAMPLEPATH:
2161 if (ignore_system_lyxrc ||
2162 example_path != system_lyxrc.example_path) {
2163 string const path = os::external_path(example_path);
2164 os << "\\example_path \"" << path << "\"\n";
2168 case RC_TEMPLATEPATH:
2169 if (ignore_system_lyxrc ||
2170 template_path != system_lyxrc.template_path) {
2171 string const path = os::external_path(template_path);
2172 os << "\\template_path \"" << path << "\"\n";
2176 case RC_TEMPDIRPATH:
2177 if (ignore_system_lyxrc ||
2178 tempdir_path != system_lyxrc.tempdir_path) {
2179 string const path = os::external_path(tempdir_path);
2180 os << "\\tempdir_path \"" << path << "\"\n";
2184 case RC_THESAURUSDIRPATH:
2185 if (ignore_system_lyxrc ||
2186 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2187 string const path = os::external_path(thesaurusdir_path);
2188 os << "\\thesaurusdir_path \"" << path << "\"\n";
2192 case RC_HUNSPELLDIR_PATH:
2193 if (ignore_system_lyxrc ||
2194 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2195 string const path = os::external_path(hunspelldir_path);
2196 os << "\\hunspelldir_path \"" << path << "\"\n";
2204 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2207 case RC_PLAINTEXT_LINELEN:
2208 if (ignore_system_lyxrc ||
2209 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2210 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2214 case RC_MAKE_BACKUP:
2215 if (ignore_system_lyxrc ||
2216 make_backup != system_lyxrc.make_backup) {
2217 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2221 case RC_BACKUPDIR_PATH:
2222 if (ignore_system_lyxrc ||
2223 backupdir_path != system_lyxrc.backupdir_path) {
2224 string const path = os::external_path(backupdir_path);
2225 os << "\\backupdir_path \"" << path << "\"\n";
2231 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2235 << "# SPELLCHECKER SECTION ##############################\n"
2238 case RC_SPELL_COMMAND:
2239 case RC_USE_SPELL_LIB:
2243 case RC_ACCEPT_COMPOUND:
2244 if (ignore_system_lyxrc ||
2245 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2246 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2251 case RC_USE_ALT_LANG:
2256 if (ignore_system_lyxrc ||
2257 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2258 os << "\\alternate_language \"" << spellchecker_alt_lang
2263 case RC_USE_ESC_CHARS:
2267 if (ignore_system_lyxrc ||
2268 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2269 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2273 case RC_USE_PERS_DICT:
2277 case RC_USE_TOOLTIP:
2278 if (ignore_system_lyxrc ||
2279 use_tooltip != system_lyxrc.use_tooltip) {
2280 os << "\\use_tooltip "
2281 << convert<string>(use_tooltip)
2286 case RC_USE_PIXMAP_CACHE:
2287 if (ignore_system_lyxrc ||
2288 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2289 os << "\\use_pixmap_cache "
2290 << convert<string>(use_pixmap_cache)
2299 case RC_USE_INP_ENC:
2305 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2310 case RC_SPELLCHECKER:
2311 if (ignore_system_lyxrc ||
2312 spellchecker != system_lyxrc.spellchecker) {
2313 os << "\\spellchecker " << spellchecker << '\n';
2318 case RC_SPELLCHECK_CONTINUOUSLY:
2319 if (ignore_system_lyxrc ||
2320 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2321 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2327 case RC_SPELLCHECK_NOTES:
2328 if (ignore_system_lyxrc ||
2329 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2330 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2336 case RC_RTL_SUPPORT:
2337 if (ignore_system_lyxrc ||
2338 rtl_support != system_lyxrc.rtl_support) {
2339 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2343 case RC_VISUAL_CURSOR:
2344 if (ignore_system_lyxrc ||
2345 visual_cursor != system_lyxrc.visual_cursor) {
2346 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2350 case RC_LANGUAGE_PACKAGE:
2351 if (ignore_system_lyxrc ||
2352 language_package != system_lyxrc.language_package) {
2353 os << "\\language_package \"" << language_package
2358 case RC_LANGUAGE_GLOBAL_OPTIONS:
2359 if (ignore_system_lyxrc ||
2360 language_global_options
2361 != system_lyxrc.language_global_options) {
2362 os << "\\language_global_options \""
2363 << convert<string>(language_global_options)
2368 case RC_LANGUAGE_USE_BABEL:
2369 if (ignore_system_lyxrc ||
2370 language_use_babel != system_lyxrc.language_use_babel) {
2371 os << "\\language_use_babel \""
2372 << convert<string>(language_use_babel)
2377 case RC_LANGUAGE_COMMAND_BEGIN:
2378 if (ignore_system_lyxrc ||
2379 language_command_begin
2380 != system_lyxrc.language_command_begin) {
2381 os << "\\language_command_begin \""
2382 << language_command_begin
2387 case RC_LANGUAGE_COMMAND_END:
2388 if (ignore_system_lyxrc ||
2389 language_command_end
2390 != system_lyxrc.language_command_end) {
2391 os << "\\language_command_end \"" << language_command_end
2396 case RC_LANGUAGE_COMMAND_LOCAL:
2397 if (ignore_system_lyxrc ||
2398 language_command_local
2399 != system_lyxrc.language_command_local) {
2400 os << "\\language_command_local \""
2401 << language_command_local
2406 case RC_LANGUAGE_AUTO_BEGIN:
2407 if (ignore_system_lyxrc ||
2408 language_auto_begin != system_lyxrc.language_auto_begin) {
2409 os << "\\language_auto_begin "
2410 << convert<string>(language_auto_begin) << '\n';
2414 case RC_LANGUAGE_AUTO_END:
2415 if (ignore_system_lyxrc ||
2416 language_auto_end != system_lyxrc.language_auto_end) {
2417 os << "\\language_auto_end "
2418 << convert<string>(language_auto_end) << '\n';
2422 case RC_MARK_FOREIGN_LANGUAGE:
2423 if (ignore_system_lyxrc ||
2424 mark_foreign_language
2425 != system_lyxrc.mark_foreign_language) {
2426 os << "\\mark_foreign_language " <<
2427 convert<string>(mark_foreign_language) << '\n';
2433 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2436 case RC_AUTO_NUMBER:
2437 if (ignore_system_lyxrc ||
2438 auto_number != system_lyxrc.auto_number) {
2439 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2443 case RC_DEFAULT_LANGUAGE:
2444 if (ignore_system_lyxrc ||
2445 default_language != system_lyxrc.default_language) {
2446 os << "\\default_language " << default_language << '\n';
2450 case RC_GUI_LANGUAGE:
2451 if (ignore_system_lyxrc ||
2452 gui_language != system_lyxrc.gui_language) {
2453 os << "\\gui_language " << gui_language << '\n';
2459 << "# FORMATS SECTION ##########################\n"
2463 // New/modified formats
2464 for (Formats::const_iterator cit = formats.begin();
2465 cit != formats.end(); ++cit) {
2466 Format const * format =
2467 system_formats.getFormat(cit->name());
2469 format->extension() != cit->extension() ||
2470 format->prettyname() != cit->prettyname() ||
2471 format->shortcut() != cit->shortcut() ||
2472 format->viewer() != cit->viewer() ||
2473 format->editor() != cit->editor() ||
2474 format->documentFormat() != cit->documentFormat() ||
2475 format->vectorFormat() != cit->vectorFormat()) {
2476 os << "\\format \"" << cit->name() << "\" \""
2477 << cit->extension() << "\" \""
2478 << cit->prettyname() << "\" \""
2479 << cit->shortcut() << "\" \""
2480 << escapeCommand(cit->viewer()) << "\" \""
2481 << escapeCommand(cit->editor()) << "\" \"";
2482 vector<string> flags;
2483 if (cit->documentFormat())
2484 flags.push_back("document");
2485 if (cit->vectorFormat())
2486 flags.push_back("vector");
2487 os << getStringFromVector(flags);
2492 // Look for deleted formats
2493 for (Formats::const_iterator cit = system_formats.begin();
2494 cit != system_formats.end(); ++cit)
2495 if (!formats.getFormat(cit->name()))
2496 os << "\\format \"" << cit->name()
2497 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2500 case RC_VIEWER_ALTERNATIVES: {
2501 Alternatives::const_iterator it = viewer_alternatives.begin();
2502 Alternatives::const_iterator const en = viewer_alternatives.end();
2503 Alternatives::const_iterator const sysend =
2504 system_lyxrc.viewer_alternatives.end();
2505 for (; it != en; ++it) {
2506 string const & fmt = it->first;
2507 CommandSet const & cmd = it->second;
2508 CommandSet::const_iterator sit = cmd.begin();
2509 CommandSet::const_iterator const sen = cmd.end();
2510 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2511 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2512 system_lyxrc.viewer_alternatives.find(fmt);
2513 for (; sit != sen; ++sit) {
2514 string const & cmd = *sit;
2515 if (ignore_system_lyxrc
2516 || sysfmt == sysend // format not found
2517 || sysfmt->second.count(cmd) == 0 // this command not found
2519 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2525 case RC_EDITOR_ALTERNATIVES: {
2526 Alternatives::const_iterator it = editor_alternatives.begin();
2527 Alternatives::const_iterator const en = editor_alternatives.end();
2528 Alternatives::const_iterator const sysend =
2529 system_lyxrc.editor_alternatives.end();
2530 for (; it != en; ++it) {
2531 string const & fmt = it->first;
2532 CommandSet const & cmd = it->second;
2533 CommandSet::const_iterator sit = cmd.begin();
2534 CommandSet::const_iterator const sen = cmd.end();
2535 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2536 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2537 system_lyxrc.editor_alternatives.find(fmt);
2538 for (; sit != sen; ++sit) {
2539 string const & cmd = *sit;
2540 if (ignore_system_lyxrc
2541 || sysfmt == sysend // format not found
2542 || sysfmt->second.count(cmd) == 0 // this command not found
2544 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2550 case RC_DEFAULT_VIEW_FORMAT:
2551 if (ignore_system_lyxrc ||
2552 default_view_format != system_lyxrc.default_view_format) {
2553 os << "\\default_view_format " << default_view_format << '\n';
2563 << "# CONVERTERS SECTION ##########################\n"
2567 // Look for new converters
2568 for (Converters::const_iterator cit = theConverters().begin();
2569 cit != theConverters().end(); ++cit) {
2570 Converter const * converter =
2571 theSystemConverters().getConverter(cit->from,
2574 converter->command != cit->command ||
2575 converter->flags != cit->flags)
2576 os << "\\converter \"" << cit->from << "\" \""
2577 << cit->to << "\" \""
2578 << escapeCommand(cit->command) << "\" \""
2579 << cit->flags << "\"\n";
2582 // New/modifed converters
2583 for (Converters::const_iterator cit = theSystemConverters().begin();
2584 cit != theSystemConverters().end(); ++cit)
2585 if (!theConverters().getConverter(cit->from, cit->to))
2586 os << "\\converter \"" << cit->from
2587 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2594 << "# COPIERS SECTION ##########################\n"
2597 // Look for new movers
2598 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2599 Movers::const_iterator const sysend = theSystemMovers().end();
2600 Movers::const_iterator it = theMovers().begin();
2601 Movers::const_iterator end = theMovers().end();
2603 for (; it != end; ++it) {
2604 Movers::const_iterator const sysit =
2605 find_if(sysbegin, sysend, SameMover(*it));
2606 if (sysit == sysend) {
2607 string const & fmt = it->first;
2608 string const & command =
2609 it->second.command();
2611 os << "\\copier " << fmt
2612 << " \"" << escapeCommand(command) << "\"\n";
2618 // We don't actually delete SpecialisedMover(s) from the
2619 // map, just clear their 'command', so there's no need
2620 // to test for anything else.
2627 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2629 // Why the switch you might ask. It is a trick to ensure that all
2630 // the elements in the LyXRCTags enum is handled. As you can see
2631 // there are no breaks at all. So it is just a huge fall-through.
2632 // The nice thing is that we will get a warning from the compiler
2633 // if we forget an element.
2634 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2636 case LyXRC::RC_ACCEPT_COMPOUND:
2637 case LyXRC::RC_ALT_LANG:
2638 case LyXRC::RC_PLAINTEXT_LINELEN:
2639 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2640 case LyXRC::RC_AUTOCORRECTION_MATH:
2641 case LyXRC::RC_AUTOREGIONDELETE:
2642 case LyXRC::RC_AUTORESET_OPTIONS:
2643 case LyXRC::RC_AUTOSAVE:
2644 case LyXRC::RC_AUTO_NUMBER:
2645 case LyXRC::RC_BACKUPDIR_PATH:
2646 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2647 case LyXRC::RC_BIBTEX_COMMAND:
2648 case LyXRC::RC_BINDFILE:
2649 case LyXRC::RC_CHECKLASTFILES:
2650 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2651 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2652 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2653 case LyXRC::RC_COMPLETION_INLINE_MATH:
2654 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2655 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2656 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2657 case LyXRC::RC_COMPLETION_POPUP_MATH:
2658 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2659 case LyXRC::RC_USELASTFILEPOS:
2660 case LyXRC::RC_LOADSESSION:
2661 case LyXRC::RC_CHKTEX_COMMAND:
2662 case LyXRC::RC_CONVERTER:
2663 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2664 case LyXRC::RC_COPIER:
2665 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2666 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2667 case LyXRC::RC_DATE_INSERT_FORMAT:
2668 case LyXRC::RC_DEFAULT_LANGUAGE:
2669 case LyXRC::RC_GUI_LANGUAGE:
2670 case LyXRC::RC_DEFAULT_PAPERSIZE:
2671 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2672 case LyXRC::RC_DEFFILE:
2673 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2674 case LyXRC::RC_DISPLAY_GRAPHICS:
2675 case LyXRC::RC_DOCUMENTPATH:
2676 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2677 FileName path(lyxrc_new.document_path);
2678 if (path.exists() && path.isDirectory())
2679 package().document_dir() = FileName(lyxrc.document_path);
2681 case LyXRC::RC_EDITOR_ALTERNATIVES:
2682 case LyXRC::RC_ESC_CHARS:
2683 case LyXRC::RC_EXAMPLEPATH:
2684 case LyXRC::RC_FONT_ENCODING:
2685 case LyXRC::RC_FORMAT:
2686 case LyXRC::RC_GROUP_LAYOUTS:
2687 case LyXRC::RC_HUNSPELLDIR_PATH:
2688 case LyXRC::RC_INDEX_ALTERNATIVES:
2689 case LyXRC::RC_INDEX_COMMAND:
2690 case LyXRC::RC_JBIBTEX_COMMAND:
2691 case LyXRC::RC_JINDEX_COMMAND:
2692 case LyXRC::RC_NOMENCL_COMMAND:
2693 case LyXRC::RC_INPUT:
2694 case LyXRC::RC_KBMAP:
2695 case LyXRC::RC_KBMAP_PRIMARY:
2696 case LyXRC::RC_KBMAP_SECONDARY:
2697 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2698 case LyXRC::RC_LANGUAGE_AUTO_END:
2699 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2700 case LyXRC::RC_LANGUAGE_COMMAND_END:
2701 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2702 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2703 case LyXRC::RC_LANGUAGE_PACKAGE:
2704 case LyXRC::RC_LANGUAGE_USE_BABEL:
2705 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2706 case LyXRC::RC_MACRO_EDIT_STYLE:
2707 case LyXRC::RC_MAKE_BACKUP:
2708 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2709 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2710 case LyXRC::RC_NUMLASTFILES:
2711 case LyXRC::RC_PARAGRAPH_MARKERS:
2712 case LyXRC::RC_PATH_PREFIX:
2713 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2714 prependEnvPath("PATH", lyxrc.path_prefix);
2716 case LyXRC::RC_PERS_DICT:
2717 case LyXRC::RC_PREVIEW:
2718 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2719 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2720 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2721 case LyXRC::RC_PRINTCOPIESFLAG:
2722 case LyXRC::RC_PRINTER:
2723 case LyXRC::RC_PRINTEVENPAGEFLAG:
2724 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2725 case LyXRC::RC_PRINTFILEEXTENSION:
2726 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2727 case LyXRC::RC_PRINTODDPAGEFLAG:
2728 case LyXRC::RC_PRINTPAGERANGEFLAG:
2729 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2730 case LyXRC::RC_PRINTPAPERFLAG:
2731 case LyXRC::RC_PRINTREVERSEFLAG:
2732 case LyXRC::RC_PRINTSPOOL_COMMAND:
2733 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2734 case LyXRC::RC_PRINTTOFILE:
2735 case LyXRC::RC_PRINTTOPRINTER:
2736 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2737 case LyXRC::RC_PRINT_COMMAND:
2738 case LyXRC::RC_RTL_SUPPORT:
2739 case LyXRC::RC_SCREEN_DPI:
2740 case LyXRC::RC_SCREEN_FONT_ROMAN:
2741 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2742 case LyXRC::RC_SCREEN_FONT_SANS:
2743 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2744 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2745 case LyXRC::RC_SCREEN_FONT_SIZES:
2746 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2747 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2748 case LyXRC::RC_GEOMETRY_SESSION:
2749 case LyXRC::RC_SCREEN_ZOOM:
2750 case LyXRC::RC_SERVERPIPE:
2751 case LyXRC::RC_SET_COLOR:
2752 case LyXRC::RC_SHOW_BANNER:
2753 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2754 case LyXRC::RC_SPELL_COMMAND:
2755 case LyXRC::RC_SPELLCHECKER:
2756 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2757 case LyXRC::RC_SPELLCHECK_NOTES:
2758 case LyXRC::RC_SPLITINDEX_COMMAND:
2759 case LyXRC::RC_TEMPDIRPATH:
2760 case LyXRC::RC_TEMPLATEPATH:
2761 case LyXRC::RC_TEX_ALLOWS_SPACES:
2762 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2763 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2764 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2766 case LyXRC::RC_THESAURUSDIRPATH:
2767 case LyXRC::RC_UIFILE:
2768 case LyXRC::RC_USER_EMAIL:
2769 case LyXRC::RC_USER_NAME:
2770 case LyXRC::RC_USETEMPDIR:
2771 case LyXRC::RC_USE_ALT_LANG:
2772 case LyXRC::RC_USE_CONVERTER_CACHE:
2773 case LyXRC::RC_USE_ESC_CHARS:
2774 case LyXRC::RC_USE_INP_ENC:
2775 case LyXRC::RC_USE_PERS_DICT:
2776 case LyXRC::RC_USE_TOOLTIP:
2777 case LyXRC::RC_USE_PIXMAP_CACHE:
2778 case LyXRC::RC_USE_SPELL_LIB:
2779 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2780 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2781 case LyXRC::RC_SORT_LAYOUTS:
2782 case LyXRC::RC_FULL_SCREEN_LIMIT:
2783 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2784 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2785 case LyXRC::RC_FULL_SCREEN_TABBAR:
2786 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2787 case LyXRC::RC_FULL_SCREEN_WIDTH:
2788 case LyXRC::RC_VISUAL_CURSOR:
2789 case LyXRC::RC_VIEWER:
2790 case LyXRC::RC_VIEWER_ALTERNATIVES:
2791 case LyXRC::RC_LAST:
2798 string const LyXRC::getDescription(LyXRCTags tag)
2803 case RC_ACCEPT_COMPOUND:
2804 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2808 case RC_USE_ALT_LANG:
2809 str = _("Specify an alternate language. The default is to use the language of the document.");
2812 case RC_PLAINTEXT_ROFF_COMMAND:
2813 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.");
2816 case RC_PLAINTEXT_LINELEN:
2817 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.");
2820 case RC_AUTOREGIONDELETE:
2821 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2824 case RC_AUTORESET_OPTIONS:
2825 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2829 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2832 case RC_AUTO_NUMBER:
2835 case RC_BACKUPDIR_PATH:
2836 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.");
2839 case RC_BIBTEX_COMMAND:
2840 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2843 case RC_JBIBTEX_COMMAND:
2844 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2848 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2851 case RC_CHECKLASTFILES:
2852 str = _("Select to check whether the lastfiles still exist.");
2855 case RC_CHKTEX_COMMAND:
2856 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2865 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2866 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.");
2869 case RC_SCROLL_BELOW_DOCUMENT:
2870 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");
2873 case RC_MAC_LIKE_WORD_MOVEMENT:
2874 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2877 case RC_SHOW_MACRO_LABEL:
2878 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2881 case RC_DATE_INSERT_FORMAT:
2882 //xgettext:no-c-format
2883 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2887 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2890 case RC_DEFAULT_VIEW_FORMAT:
2891 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2894 case RC_DEFAULT_LANGUAGE:
2895 str = _("New documents will be assigned this language.");
2898 case RC_DEFAULT_PAPERSIZE:
2899 str = _("Specify the default paper size.");
2902 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2903 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2906 case RC_DISPLAY_GRAPHICS:
2907 str = _("Select how LyX will display any graphics.");
2910 case RC_DOCUMENTPATH:
2911 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2915 case RC_USE_ESC_CHARS:
2916 str = _("Specify additional chars that can be part of a word.");
2919 case RC_EXAMPLEPATH:
2920 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2923 case RC_FONT_ENCODING:
2924 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2930 case RC_INDEX_COMMAND:
2931 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\".");
2934 case RC_JINDEX_COMMAND:
2935 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2938 case RC_NOMENCL_COMMAND:
2939 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2946 case RC_KBMAP_PRIMARY:
2947 case RC_KBMAP_SECONDARY:
2948 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.");
2951 case RC_LANGUAGE_AUTO_BEGIN:
2952 str = _("Select if a language switching command is needed at the beginning of the document.");
2955 case RC_LANGUAGE_AUTO_END:
2956 str = _("Select if a language switching command is needed at the end of the document.");
2959 case RC_LANGUAGE_COMMAND_BEGIN:
2960 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.");
2963 case RC_LANGUAGE_COMMAND_END:
2964 str = _("The LaTeX command for changing back to the language of the document.");
2967 case RC_LANGUAGE_COMMAND_LOCAL:
2968 str = _("The LaTeX command for local changing of the language.");
2971 case RC_LANGUAGE_GLOBAL_OPTIONS:
2972 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2975 case RC_LANGUAGE_PACKAGE:
2976 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2979 case RC_LANGUAGE_USE_BABEL:
2980 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2983 case RC_USELASTFILEPOS:
2984 str = _("De-select if you do not want LyX to scroll to saved position.");
2987 case RC_LOADSESSION:
2988 str = _("De-select to prevent loading files opened from the last LyX session.");
2991 case RC_MAKE_BACKUP:
2992 str = _("De-select if you don't want LyX to create backup files.");
2995 case RC_MARK_FOREIGN_LANGUAGE:
2996 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2999 case RC_MOUSE_WHEEL_SPEED:
3000 str = bformat(_("The scrolling speed of the mouse wheel."),
3004 case RC_COMPLETION_POPUP_DELAY:
3005 str = _("The completion popup delay.");
3008 case RC_COMPLETION_POPUP_MATH:
3009 str = _("Select to display the completion popup in math mode.");
3012 case RC_COMPLETION_POPUP_TEXT:
3013 str = _("Select to display the completion popup in text mode.");
3016 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3017 str = _("Show the completion popup without delay after non-unique completion attempt.");
3020 case RC_COMPLETION_POPUP_TEXT:
3021 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3024 case RC_COMPLETION_POPUP_DELAY:
3025 str = _("The inline completion delay.");
3028 case RC_COMPLETION_INLINE_MATH:
3029 str = _("Select to display the inline completion in math mode.");
3032 case RC_COMPLETION_INLINE_TEXT:
3033 str = _("Select to display the inline completion in text mode.");
3036 case RC_COMPLETION_INLINE_DOTS:
3037 str = _("Use \"...\" to shorten long completions.");
3040 case RC_AUTOCORRECTION_MATH:
3041 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3044 case RC_NUMLASTFILES:
3045 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3049 case RC_PATH_PREFIX:
3050 str = _("Specify those directories which should be "
3051 "prepended to the PATH environment variable. "
3052 "Use the OS native format.");
3056 str = _("Shows a typeset preview of things such as math");
3059 case RC_PREVIEW_HASHED_LABELS:
3060 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3063 case RC_PREVIEW_SCALE_FACTOR:
3064 str = _("Scale the preview size to suit.");
3067 case RC_PRINTCOLLCOPIESFLAG:
3068 str = _("The option for specifying whether the copies should be collated.");
3071 case RC_PRINTCOPIESFLAG:
3072 str = _("The option for specifying the number of copies to print.");
3076 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3079 case RC_PRINTEVENPAGEFLAG:
3080 str = _("The option to print only even pages.");
3083 case RC_PRINTEXSTRAOPTIONS:
3084 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3087 case RC_PRINTFILEEXTENSION:
3088 str = _("Extension of printer program output file. Usually \".ps\".");
3091 case RC_PRINTLANDSCAPEFLAG:
3092 str = _("The option to print out in landscape.");
3095 case RC_PRINTODDPAGEFLAG:
3096 str = _("The option to print only odd pages.");
3099 case RC_PRINTPAGERANGEFLAG:
3100 str = _("The option for specifying a comma-separated list of pages to print.");
3103 case RC_PRINTPAPERDIMENSIONFLAG:
3104 str = _("Option to specify the dimensions of the print paper.");
3107 case RC_PRINTPAPERFLAG:
3108 str = _("The option to specify paper type.");
3111 case RC_PRINTREVERSEFLAG:
3112 str = _("The option to reverse the order of the pages printed.");
3115 case RC_PRINTSPOOL_COMMAND:
3116 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.");
3119 case RC_PRINTSPOOL_PRINTERPREFIX:
3120 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.");
3123 case RC_PRINTTOFILE:
3124 str = _("Option to pass to the print program to print to a file.");
3127 case RC_PRINTTOPRINTER:
3128 str = _("Option to pass to the print program to print on a specific printer.");
3131 case RC_PRINT_ADAPTOUTPUT:
3132 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3135 case RC_PRINT_COMMAND:
3136 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3139 case RC_RTL_SUPPORT:
3140 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3143 case RC_VISUAL_CURSOR:
3144 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3148 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3151 case RC_SCREEN_FONT_ROMAN:
3152 case RC_SCREEN_FONT_SANS:
3153 case RC_SCREEN_FONT_TYPEWRITER:
3154 str = _("The screen fonts used to display the text while editing.");
3157 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3158 case RC_SCREEN_FONT_SANS_FOUNDRY:
3159 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3162 case RC_SCREEN_FONT_SCALABLE:
3163 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.");
3166 case RC_SCREEN_FONT_SIZES:
3167 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3170 case RC_SCREEN_ZOOM:
3171 //xgettext:no-c-format
3172 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3175 case RC_GEOMETRY_SESSION:
3176 str = _("Allow session manager to save and restore windows geometry.");
3180 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3186 case RC_SHOW_BANNER:
3187 str = _("De-select if you don't want the startup banner.");
3190 case RC_TEMPDIRPATH:
3191 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3194 case RC_THESAURUSDIRPATH:
3195 str = _("This is the place where the files of the thesaurus library reside.");
3198 case RC_TEMPLATEPATH:
3199 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3202 case RC_TEX_ALLOWS_SPACES:
3205 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3209 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3221 case RC_USE_TOOLTIP:
3222 str = _("Enable the automatic appearance of tool tips in the work area.");
3225 case RC_USE_PIXMAP_CACHE:
3226 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3229 case RC_USE_SPELL_LIB:
3232 case RC_VIEWDVI_PAPEROPTION:
3233 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3248 // The global instance
3251 // The global copy of the system lyxrc entries (everything except preferences)