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 #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;
291 visual_cursor = false;
293 mark_foreign_language = true;
294 language_auto_begin = true;
295 language_auto_end = true;
296 language_global_options = true;
297 language_use_babel = true;
298 language_package = "\\usepackage{babel}";
299 language_command_begin = "\\selectlanguage{$$lang}";
300 language_command_local = "\\foreignlanguage{$$lang}{";
301 sort_layouts = false;
302 group_layouts = true;
303 default_language = "english";
304 gui_language = "auto";
306 windows_style_tex_paths = false;
307 tex_allows_spaces = false;
308 date_insert_format = "%x";
309 cursor_follows_scrollbar = false;
310 scroll_below_document = false;
311 paragraph_markers = false;
312 mac_like_word_movement = false;
313 macro_edit_style = MACRO_EDIT_INLINE_BOX;
314 dialogs_iconify_with_main = false;
315 label_init_length = 3;
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;
919 lexrc >> make_backup;
921 case RC_BACKUPDIR_PATH:
923 backupdir_path = os::internal_path(lexrc.getString());
924 backupdir_path = expandPath(backupdir_path);
927 case RC_DATE_INSERT_FORMAT:
928 lexrc >> date_insert_format;
930 case RC_LANGUAGE_PACKAGE:
931 lexrc >> language_package;
933 case RC_LANGUAGE_AUTO_BEGIN:
934 lexrc >> language_auto_begin;
936 case RC_LANGUAGE_AUTO_END:
937 lexrc >> language_auto_end;
939 case RC_LANGUAGE_GLOBAL_OPTIONS:
940 lexrc >> language_global_options;
942 case RC_LANGUAGE_USE_BABEL:
943 lexrc >> language_use_babel;
945 case RC_LANGUAGE_COMMAND_BEGIN:
946 lexrc >> language_command_begin;
948 case RC_LANGUAGE_COMMAND_END:
949 lexrc >> language_command_end;
951 case RC_LANGUAGE_COMMAND_LOCAL:
952 lexrc >> language_command_local;
955 lexrc >> rtl_support;
957 case RC_VISUAL_CURSOR:
958 lexrc >> visual_cursor;
961 lexrc >> auto_number;
963 case RC_MARK_FOREIGN_LANGUAGE:
964 lexrc >> mark_foreign_language;
970 fmt = lexrc.getString();
971 if (lexrc.next(true))
972 command = lexrc.getString();
973 setMover(fmt, command);
978 string from, to, command, flags;
980 from = lexrc.getString();
982 to = lexrc.getString();
983 if (lexrc.next(true))
984 command = lexrc.getString();
986 flags = lexrc.getString();
988 theConverters().erase(from, to);
990 theConverters().add(from, to, command, flags);
993 // compatibility with versions older than 1.4.0 only
995 string format, command;
996 lexrc >> format >> command;
997 formats.setViewer(format, command);
1001 string format, extension, prettyname, shortcut;
1002 lexrc >> format >> extension >> prettyname >> shortcut;
1003 string viewer, editor;
1004 if (lexrc.next(true))
1005 viewer = lexrc.getString();
1006 if (lexrc.next(true))
1007 editor = lexrc.getString();
1009 // Hack to ensure compatibility with versions older
1011 int le = lexrc.lex();
1012 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1013 flags = lexrc.getString();
1014 if (le != Lexer::LEX_DATA) {
1015 // We have got a known token.
1016 // Therefore this is an old style
1017 // format definition without
1019 lexrc.pushToken(flags);
1023 int flgs = Format::none;
1024 while (!flags.empty()) {
1026 flags = split(flags, flag, ',');
1027 if (flag == "document")
1028 flgs |= Format::document;
1029 else if (flag == "vector")
1030 flgs |= Format::vector;
1032 LYXERR0("Ignoring unknown flag `"
1033 << flag << "' for format `"
1036 if (prettyname.empty()) {
1037 if (theConverters().formatIsUsed(format))
1038 LYXERR0("Can't delete format " << format);
1040 formats.erase(format);
1042 formats.add(format, extension, prettyname,
1043 shortcut, viewer, editor, flgs);
1047 case RC_VIEWER_ALTERNATIVES: {
1048 string format, command;
1050 format = lexrc.getString();
1051 if (lexrc.eatLine())
1052 command = lexrc.getString();
1053 viewer_alternatives[format].insert(command);
1056 case RC_EDITOR_ALTERNATIVES: {
1057 string format, command;
1058 lexrc >> format >> command;
1059 editor_alternatives[format].insert(command);
1063 case RC_DEFAULT_VIEW_FORMAT:
1064 lexrc >> default_view_format;
1067 case RC_DEFAULT_LANGUAGE:
1068 lexrc >> default_language;
1071 case RC_GUI_LANGUAGE:
1072 lexrc >> gui_language;
1075 case RC_LABEL_INIT_LENGTH:
1076 lexrc >> label_init_length;
1079 case RC_SHOW_BANNER:
1080 lexrc >> show_banner;
1085 string const tmp = lexrc.getString();
1086 if (tmp == "true" || tmp == "on")
1087 preview = PREVIEW_ON;
1088 else if (tmp == "no_math")
1089 preview = PREVIEW_NO_MATH;
1091 preview = PREVIEW_OFF;
1092 if (tmp != "false" && tmp != "off")
1093 LYXERR0("Unrecognized preview status \""
1099 case RC_PREVIEW_HASHED_LABELS:
1100 lexrc >> preview_hashed_labels;
1103 case RC_PREVIEW_SCALE_FACTOR:
1104 lexrc >> preview_scale_factor;
1111 lexrc >> user_email;
1114 case RC_PATH_PREFIX:
1115 lexrc >> path_prefix;
1118 case RC_USE_CONVERTER_CACHE:
1119 lexrc >> use_converter_cache;
1121 case RC_CONVERTER_CACHE_MAXAGE:
1122 lexrc >> converter_cache_maxage;
1125 case RC_SORT_LAYOUTS:
1126 lexrc >> sort_layouts;
1128 case RC_GROUP_LAYOUTS:
1129 lexrc >> group_layouts;
1131 case RC_FULL_SCREEN_LIMIT:
1132 lexrc >> full_screen_limit;
1134 case RC_FULL_SCREEN_TOOLBARS:
1135 lexrc >> full_screen_toolbars;
1137 case RC_FULL_SCREEN_SCROLLBAR:
1138 lexrc >> full_screen_scrollbar;
1140 case RC_FULL_SCREEN_TABBAR:
1141 lexrc >> full_screen_tabbar;
1143 case RC_FULL_SCREEN_MENUBAR:
1144 lexrc >> full_screen_menubar;
1146 case RC_FULL_SCREEN_WIDTH:
1147 lexrc >> full_screen_width;
1149 case RC_OPEN_BUFFERS_IN_TABS:
1150 lexrc >> open_buffers_in_tabs;
1152 case RC_SINGLE_CLOSE_TAB_BUTTON:
1153 lexrc >> single_close_tab_button;
1156 // Obsoteted in 1.4.0
1159 case RC_SPELL_COMMAND:
1161 case RC_PLAINTEXT_ROFF_COMMAND:
1162 case RC_USE_ALT_LANG:
1163 case RC_USE_ESC_CHARS:
1164 case RC_USE_INP_ENC:
1165 case RC_USE_PERS_DICT:
1166 case RC_USE_SPELL_LIB:
1167 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1168 << lexrc.getString() << "'.");
1173 break; // this is just a dummy
1177 /// Update converters data-structures
1178 theConverters().update(formats);
1179 theConverters().buildGraph();
1185 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1187 ofstream ofs(filename.toFilesystemEncoding().c_str());
1189 write(ofs, ignore_system_lyxrc);
1193 void LyXRC::print() const
1195 if (lyxerr.debugging())
1196 write(lyxerr, false);
1204 typedef pair<string, SpecialisedMover> Data;
1206 SameMover(Data const & comparison)
1207 : comparison_(comparison) {}
1209 bool operator()(Data const & data) const
1211 return data.first == comparison_.first &&
1212 data.second.command() == comparison_.second.command();
1222 // Escape \ and " so that LyXLex can read the string later
1223 string escapeCommand(string const & str) {
1224 return subst(subst(str , "\\", "\\\\"),
1231 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1233 LyXRCTags tag = RC_LAST;
1235 if (!name.empty()) {
1236 for (int i = 0; i != lyxrcCount; ++i)
1237 if ("\\" + name == lyxrcTags[i].tag)
1238 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1242 os << "# LyX " << lyx_version
1243 << " generated this file. If you want to make your own\n"
1244 << "# modifications you should do them from inside LyX and save.\n"
1247 // Why the switch you might ask. It is a trick to ensure that all
1248 // the elements in the LyXRCTags enum are handled. As you can see
1249 // there are no breaks at all. So it is just a huge fall-through.
1250 // The nice thing is that we will get a warning from the compiler
1251 // if we forget an element.
1255 // input/include files are not done here
1257 if (ignore_system_lyxrc ||
1258 bind_file != system_lyxrc.bind_file) {
1259 string const path = os::external_path(bind_file);
1260 os << "\\bind_file \"" << path << "\"\n";
1266 if (ignore_system_lyxrc ||
1267 def_file != system_lyxrc.def_file) {
1268 string const path = os::external_path(def_file);
1269 os << "\\def_file \"" << path << "\"\n";
1278 << "# MISC SECTION ######################################\n"
1280 // bind files are not done here.
1282 case RC_PATH_PREFIX:
1283 if (ignore_system_lyxrc ||
1284 path_prefix != system_lyxrc.path_prefix) {
1285 os << "\\path_prefix \"" << path_prefix << "\"\n";
1290 if (ignore_system_lyxrc ||
1291 ui_file != system_lyxrc.ui_file) {
1292 string const path = os::external_path(ui_file);
1293 os << "\\ui_file \"" << path << "\"\n";
1297 case RC_AUTOREGIONDELETE:
1298 if (ignore_system_lyxrc ||
1299 auto_region_delete != system_lyxrc.auto_region_delete) {
1300 os << "# Set to false to inhibit automatic replacement of\n"
1301 << "# the current selection.\n"
1302 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1307 case RC_AUTORESET_OPTIONS:
1308 if (ignore_system_lyxrc ||
1309 auto_reset_options != system_lyxrc.auto_reset_options) {
1310 os << "# Set to false to inhibit automatic reset of\n"
1311 << "# the class options to defaults on class change.\n"
1312 << "\\auto_reset_options "
1313 << convert<string>(auto_reset_options)
1319 if (ignore_system_lyxrc ||
1320 autosave != system_lyxrc.autosave) {
1321 os << "# The time interval between auto-saves in seconds.\n"
1322 << "\\autosave " << autosave << '\n';
1326 case RC_DISPLAY_GRAPHICS:
1327 if (ignore_system_lyxrc ||
1328 display_graphics != system_lyxrc.display_graphics) {
1329 os << "# Display graphics within LyX\n"
1331 << "\\display_graphics "
1332 << (display_graphics ? "true" : "false")
1337 case RC_SORT_LAYOUTS:
1338 if (ignore_system_lyxrc ||
1339 sort_layouts != system_lyxrc.sort_layouts) {
1340 os << "# Sort layouts alphabetically.\n"
1341 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1345 case RC_GROUP_LAYOUTS:
1346 if (ignore_system_lyxrc ||
1347 group_layouts != system_lyxrc.group_layouts) {
1348 os << "# Group layouts by their category.\n"
1349 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1353 case RC_VIEWDVI_PAPEROPTION:
1354 if (ignore_system_lyxrc ||
1355 view_dvi_paper_option
1356 != system_lyxrc.view_dvi_paper_option) {
1357 os << "# Options used to specify paper size to the\n"
1358 << "# view_dvi_command (e.g. -paper)\n"
1359 << "\\view_dvi_paper_option \""
1360 << view_dvi_paper_option << "\"\n";
1364 case RC_DEFAULT_PAPERSIZE:
1365 if (ignore_system_lyxrc ||
1366 default_papersize != system_lyxrc.default_papersize) {
1367 os << "# The default papersize to use.\n"
1368 << "\\default_papersize \"";
1369 switch (default_papersize) {
1371 os << "default"; break;
1372 case PAPER_USLETTER:
1373 os << "usletter"; break;
1375 os << "legal"; break;
1376 case PAPER_USEXECUTIVE:
1377 os << "executive"; break;
1388 case PAPER_B4: break;
1394 case RC_CHKTEX_COMMAND:
1395 if (ignore_system_lyxrc ||
1396 chktex_command != system_lyxrc.chktex_command) {
1397 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1401 case RC_BIBTEX_ALTERNATIVES: {
1402 CommandSet::const_iterator it = bibtex_alternatives.begin();
1403 CommandSet::const_iterator end = bibtex_alternatives.end();
1404 for ( ; it != end; ++it) {
1405 if (ignore_system_lyxrc
1406 || !system_lyxrc.bibtex_alternatives.count(*it))
1407 os << "\\bibtex_alternatives \""
1413 case RC_BIBTEX_COMMAND:
1414 if (ignore_system_lyxrc ||
1415 bibtex_command != system_lyxrc.bibtex_command) {
1416 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1420 case RC_JBIBTEX_COMMAND:
1421 if (ignore_system_lyxrc ||
1422 jbibtex_command != system_lyxrc.jbibtex_command) {
1423 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1427 case RC_INDEX_ALTERNATIVES: {
1428 CommandSet::const_iterator it = index_alternatives.begin();
1429 CommandSet::const_iterator end = index_alternatives.end();
1430 for ( ; it != end; ++it) {
1431 if (ignore_system_lyxrc
1432 || !system_lyxrc.index_alternatives.count(*it))
1433 os << "\\index_alternatives \""
1439 case RC_INDEX_COMMAND:
1440 if (ignore_system_lyxrc ||
1441 index_command != system_lyxrc.index_command) {
1442 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1446 case RC_JINDEX_COMMAND:
1447 if (ignore_system_lyxrc ||
1448 jindex_command != system_lyxrc.jindex_command) {
1449 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1453 case RC_SPLITINDEX_COMMAND:
1454 if (ignore_system_lyxrc ||
1455 splitindex_command != system_lyxrc.splitindex_command) {
1456 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1460 case RC_NOMENCL_COMMAND:
1461 if (ignore_system_lyxrc ||
1462 nomencl_command != system_lyxrc.nomencl_command) {
1463 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1467 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1468 if (ignore_system_lyxrc ||
1469 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1470 os << "\\tex_expects_windows_paths "
1471 << convert<string>(windows_style_tex_paths) << '\n';
1475 case RC_TEX_ALLOWS_SPACES:
1476 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1477 os << "\\tex_allows_spaces "
1478 << convert<string>(tex_allows_spaces) << '\n';
1483 if (ignore_system_lyxrc ||
1484 use_kbmap != system_lyxrc.use_kbmap) {
1485 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1489 case RC_KBMAP_PRIMARY:
1490 if (ignore_system_lyxrc ||
1491 primary_kbmap != system_lyxrc.primary_kbmap) {
1492 string const path = os::external_path(primary_kbmap);
1493 os << "\\kbmap_primary \"" << path << "\"\n";
1497 case RC_KBMAP_SECONDARY:
1498 if (ignore_system_lyxrc ||
1499 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1500 string const path = os::external_path(secondary_kbmap);
1501 os << "\\kbmap_secondary \"" << path << "\"\n";
1506 if (ignore_system_lyxrc ||
1507 lyxpipes != system_lyxrc.lyxpipes) {
1508 string const path = os::external_path(lyxpipes);
1509 os << "\\serverpipe \"" << path << "\"\n";
1513 case RC_DATE_INSERT_FORMAT:
1514 if (ignore_system_lyxrc ||
1515 date_insert_format != system_lyxrc.date_insert_format) {
1516 os << "\\date_insert_format \"" << date_insert_format
1521 case RC_LABEL_INIT_LENGTH:
1522 if (ignore_system_lyxrc ||
1523 label_init_length != system_lyxrc.label_init_length) {
1524 os << "\\label_init_length " << label_init_length
1531 os << "\\user_name \"" << user_name << "\"\n";
1536 os << "\\user_email \"" << user_email << "\"\n";
1540 case RC_SHOW_BANNER:
1541 if (ignore_system_lyxrc ||
1542 show_banner != system_lyxrc.show_banner) {
1543 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1549 if (ignore_system_lyxrc ||
1550 preview != system_lyxrc.preview) {
1556 case PREVIEW_NO_MATH:
1563 os << "\\preview " << status << '\n';
1568 case RC_PREVIEW_HASHED_LABELS:
1569 if (ignore_system_lyxrc ||
1570 preview_hashed_labels !=
1571 system_lyxrc.preview_hashed_labels) {
1572 os << "\\preview_hashed_labels "
1573 << convert<string>(preview_hashed_labels) << '\n';
1578 case RC_PREVIEW_SCALE_FACTOR:
1579 if (ignore_system_lyxrc ||
1580 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1581 os << "\\preview_scale_factor "
1582 << preview_scale_factor << '\n';
1587 case RC_USE_CONVERTER_CACHE:
1588 if (ignore_system_lyxrc ||
1589 use_converter_cache != system_lyxrc.use_converter_cache) {
1590 os << "\\use_converter_cache "
1591 << convert<string>(use_converter_cache) << '\n';
1596 case RC_CONVERTER_CACHE_MAXAGE:
1597 if (ignore_system_lyxrc ||
1598 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1599 os << "\\converter_cache_maxage "
1600 << converter_cache_maxage << '\n';
1606 << "# SCREEN & FONTS SECTION ############################\n"
1610 if (ignore_system_lyxrc ||
1611 dpi != system_lyxrc.dpi) {
1612 os << "\\screen_dpi " << dpi << '\n';
1616 case RC_SCREEN_ZOOM:
1617 if (ignore_system_lyxrc ||
1618 zoom != system_lyxrc.zoom) {
1619 os << "\\screen_zoom " << zoom << '\n';
1623 case RC_GEOMETRY_SESSION:
1624 if (ignore_system_lyxrc ||
1625 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1626 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1631 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1632 if (ignore_system_lyxrc ||
1633 cursor_follows_scrollbar
1634 != system_lyxrc.cursor_follows_scrollbar) {
1635 os << "\\cursor_follows_scrollbar "
1636 << convert<string>(cursor_follows_scrollbar) << '\n';
1640 case RC_SCROLL_BELOW_DOCUMENT:
1641 if (ignore_system_lyxrc ||
1642 scroll_below_document
1643 != system_lyxrc.scroll_below_document) {
1644 os << "\\scroll_below_document "
1645 << convert<string>(scroll_below_document) << '\n';
1649 case RC_PARAGRAPH_MARKERS:
1650 if (ignore_system_lyxrc ||
1652 != system_lyxrc.paragraph_markers) {
1653 os << "\\paragraph_markers "
1654 << convert<string>(paragraph_markers) << '\n';
1658 case RC_MAC_LIKE_WORD_MOVEMENT:
1659 if (ignore_system_lyxrc ||
1660 mac_like_word_movement
1661 != system_lyxrc.mac_like_word_movement) {
1662 os << "\\mac_like_word_movement "
1663 << convert<string>(mac_like_word_movement) << '\n';
1667 case RC_MACRO_EDIT_STYLE:
1668 if (ignore_system_lyxrc ||
1670 != system_lyxrc.macro_edit_style) {
1671 os << "\\macro_edit_style ";
1672 switch (macro_edit_style) {
1673 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1674 case MACRO_EDIT_INLINE: os << "1\n"; break;
1675 case MACRO_EDIT_LIST: os << "2\n"; break;
1680 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1681 if (ignore_system_lyxrc ||
1682 dialogs_iconify_with_main
1683 != system_lyxrc.dialogs_iconify_with_main) {
1684 os << "\\dialogs_iconify_with_main "
1685 << convert<string>(dialogs_iconify_with_main) << '\n';
1689 case RC_SCREEN_FONT_ROMAN:
1690 if (ignore_system_lyxrc ||
1691 roman_font_name != system_lyxrc.roman_font_name) {
1692 os << "\\screen_font_roman \"" << roman_font_name
1697 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1698 if (ignore_system_lyxrc ||
1699 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1700 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1705 case RC_SCREEN_FONT_SANS:
1706 if (ignore_system_lyxrc ||
1707 sans_font_name != system_lyxrc.sans_font_name) {
1708 os << "\\screen_font_sans \"" << sans_font_name
1713 case RC_SCREEN_FONT_SANS_FOUNDRY:
1714 if (ignore_system_lyxrc ||
1715 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1716 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1721 case RC_SCREEN_FONT_TYPEWRITER:
1722 if (ignore_system_lyxrc ||
1723 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1724 os << "\\screen_font_typewriter \""
1725 << typewriter_font_name << "\"\n";
1729 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1730 if (ignore_system_lyxrc ||
1731 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1732 os << "\\screen_font_typewriter_foundry \""
1733 << typewriter_font_foundry << "\"\n";
1738 case RC_SCREEN_FONT_SCALABLE:
1739 if (ignore_system_lyxrc ||
1740 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1741 os << "\\screen_font_scalable "
1742 << convert<string>(use_scalable_fonts)
1747 case RC_SCREEN_FONT_SIZES:
1748 if (ignore_system_lyxrc ||
1749 font_sizes[FONT_SIZE_TINY]
1750 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1751 font_sizes[FONT_SIZE_SCRIPT]
1752 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1753 font_sizes[FONT_SIZE_FOOTNOTE]
1754 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1755 font_sizes[FONT_SIZE_SMALL]
1756 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1757 font_sizes[FONT_SIZE_NORMAL]
1758 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1759 font_sizes[FONT_SIZE_LARGE]
1760 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1761 font_sizes[FONT_SIZE_LARGER]
1762 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1763 font_sizes[FONT_SIZE_LARGEST]
1764 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1765 font_sizes[FONT_SIZE_HUGE]
1766 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1767 font_sizes[FONT_SIZE_HUGER]
1768 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1769 os.setf(ios::fixed);
1771 os << "\\screen_font_sizes"
1772 << ' ' << font_sizes[FONT_SIZE_TINY]
1773 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1774 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1775 << ' ' << font_sizes[FONT_SIZE_SMALL]
1776 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1777 << ' ' << font_sizes[FONT_SIZE_LARGE]
1778 << ' ' << font_sizes[FONT_SIZE_LARGER]
1779 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1780 << ' ' << font_sizes[FONT_SIZE_HUGE]
1781 << ' ' << font_sizes[FONT_SIZE_HUGER]
1786 case RC_FULL_SCREEN_LIMIT:
1787 if (ignore_system_lyxrc ||
1788 full_screen_limit != system_lyxrc.full_screen_limit) {
1789 os << "\\fullscreen_limit "
1790 << convert<string>(full_screen_limit)
1795 case RC_FULL_SCREEN_TOOLBARS:
1796 if (ignore_system_lyxrc ||
1797 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1798 os << "\\fullscreen_toolbars "
1799 << convert<string>(full_screen_toolbars)
1804 case RC_FULL_SCREEN_SCROLLBAR:
1805 if (ignore_system_lyxrc ||
1806 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1807 os << "\\fullscreen_scrollbar "
1808 << convert<string>(full_screen_scrollbar)
1813 case RC_FULL_SCREEN_TABBAR:
1814 if (ignore_system_lyxrc ||
1815 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1816 os << "\\fullscreen_tabbar "
1817 << convert<string>(full_screen_tabbar)
1822 case RC_FULL_SCREEN_MENUBAR:
1823 if (ignore_system_lyxrc ||
1824 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1825 os << "\\fullscreen_menubar "
1826 << convert<string>(full_screen_menubar)
1831 case RC_FULL_SCREEN_WIDTH:
1832 if (ignore_system_lyxrc ||
1833 full_screen_width != system_lyxrc.full_screen_width) {
1834 os << "\\fullscreen_width "
1835 << convert<string>(full_screen_width)
1840 case RC_OPEN_BUFFERS_IN_TABS:
1841 if (ignore_system_lyxrc ||
1842 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1843 os << "\\open_buffers_in_tabs "
1844 << convert<string>(open_buffers_in_tabs)
1847 case RC_SINGLE_CLOSE_TAB_BUTTON:
1848 if (ignore_system_lyxrc ||
1849 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1850 os << "\\single_close_tab_button "
1851 << convert<string>(single_close_tab_button)
1858 << "# COLOR SECTION ###################################\n"
1862 for (int i = 0; i < Color_ignore; ++i) {
1863 ColorCode lc = static_cast<ColorCode>(i);
1864 string const col = lcolor.getX11Name(lc);
1865 if (ignore_system_lyxrc
1866 || col != system_lcolor.getX11Name(lc)) {
1867 os << "\\set_color \""
1868 << lcolor.getLyXName(lc) << "\" \""
1876 << "# PRINTER SECTION ###################################\n"
1880 if (ignore_system_lyxrc ||
1881 printer != system_lyxrc.printer) {
1882 os << "\\printer \"" << printer << "\"\n";
1886 case RC_PRINT_ADAPTOUTPUT:
1887 if (ignore_system_lyxrc ||
1888 print_adapt_output != system_lyxrc.print_adapt_output) {
1889 os << "\\print_adapt_output "
1890 << convert<string>(print_adapt_output)
1895 case RC_PRINT_COMMAND:
1896 if (ignore_system_lyxrc ||
1897 print_command != system_lyxrc.print_command) {
1898 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1902 case RC_PRINTEXSTRAOPTIONS:
1903 if (ignore_system_lyxrc ||
1904 print_extra_options != system_lyxrc.print_extra_options) {
1905 os << "\\print_extra_options \"" << print_extra_options
1910 case RC_PRINTSPOOL_COMMAND:
1911 if (ignore_system_lyxrc ||
1912 print_spool_command != system_lyxrc.print_spool_command) {
1913 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1918 case RC_PRINTSPOOL_PRINTERPREFIX:
1919 if (ignore_system_lyxrc ||
1920 print_spool_printerprefix
1921 != system_lyxrc.print_spool_printerprefix) {
1922 os << "\\print_spool_printerprefix \""
1923 << print_spool_printerprefix << "\"\n";
1927 case RC_PRINTEVENPAGEFLAG:
1928 if (ignore_system_lyxrc ||
1929 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1930 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1935 case RC_PRINTODDPAGEFLAG:
1936 if (ignore_system_lyxrc ||
1937 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1938 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1943 case RC_PRINTREVERSEFLAG:
1944 if (ignore_system_lyxrc ||
1945 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1946 os << "\\print_reverse_flag \"" << print_reverse_flag
1951 case RC_PRINTLANDSCAPEFLAG:
1952 if (ignore_system_lyxrc ||
1953 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1954 os << "\\print_landscape_flag \"" << print_landscape_flag
1959 case RC_PRINTPAGERANGEFLAG:
1960 if (ignore_system_lyxrc ||
1961 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1962 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1967 case RC_PRINTCOPIESFLAG:
1968 if (ignore_system_lyxrc ||
1969 print_copies_flag != system_lyxrc.print_copies_flag) {
1970 os << "\\print_copies_flag \"" << print_copies_flag
1975 case RC_PRINTCOLLCOPIESFLAG:
1976 if (ignore_system_lyxrc ||
1977 print_collcopies_flag
1978 != system_lyxrc.print_collcopies_flag) {
1979 os << "\\print_collcopies_flag \""
1980 << print_collcopies_flag
1985 case RC_PRINTPAPERFLAG:
1986 if (ignore_system_lyxrc ||
1987 print_paper_flag != system_lyxrc.print_paper_flag) {
1988 os << "\\print_paper_flag \"" << print_paper_flag
1993 case RC_PRINTPAPERDIMENSIONFLAG:
1994 if (ignore_system_lyxrc ||
1995 print_paper_dimension_flag
1996 != system_lyxrc.print_paper_dimension_flag) {
1997 os << "\\print_paper_dimension_flag \""
1998 << print_paper_dimension_flag << "\"\n";
2002 case RC_PRINTTOPRINTER:
2003 if (ignore_system_lyxrc ||
2004 print_to_printer != system_lyxrc.print_to_printer) {
2005 os << "\\print_to_printer \"" << print_to_printer
2010 case RC_PRINTTOFILE:
2011 if (ignore_system_lyxrc ||
2012 print_to_file != system_lyxrc.print_to_file) {
2013 string const path = os::external_path(print_to_file);
2014 os << "\\print_to_file \"" << path << "\"\n";
2018 case RC_PRINTFILEEXTENSION:
2019 if (ignore_system_lyxrc ||
2020 print_file_extension != system_lyxrc.print_file_extension) {
2021 os << "\\print_file_extension \""
2022 << print_file_extension
2029 << "# TEX SECTION #######################################\n"
2032 case RC_FONT_ENCODING:
2033 if (ignore_system_lyxrc ||
2034 fontenc != system_lyxrc.fontenc) {
2035 os << "\\font_encoding \"" << fontenc << "\"\n";
2041 << "# FILE SECTION ######################################\n"
2044 case RC_DOCUMENTPATH:
2045 if (ignore_system_lyxrc ||
2046 document_path != system_lyxrc.document_path) {
2047 string const path = os::external_path(document_path);
2048 os << "\\document_path \"" << path << "\"\n";
2052 case RC_USELASTFILEPOS:
2053 if (ignore_system_lyxrc ||
2054 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2055 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2060 case RC_LOADSESSION:
2061 if (ignore_system_lyxrc ||
2062 load_session != system_lyxrc.load_session) {
2063 os << "\\load_session " << convert<string>(load_session)
2068 case RC_MOUSE_WHEEL_SPEED:
2069 if (ignore_system_lyxrc ||
2070 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2071 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2075 case RC_COMPLETION_INLINE_DELAY:
2076 if (ignore_system_lyxrc ||
2077 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2078 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2082 case RC_COMPLETION_INLINE_MATH:
2083 if (ignore_system_lyxrc ||
2084 completion_inline_math != system_lyxrc.completion_inline_math) {
2085 os << "\\completion_inline_math "
2086 << convert<string>(completion_inline_math) << '\n';
2090 case RC_COMPLETION_INLINE_TEXT:
2091 if (ignore_system_lyxrc ||
2092 completion_inline_text != system_lyxrc.completion_inline_text) {
2093 os << "\\completion_inline_text "
2094 << convert<string>(completion_inline_text) << '\n';
2098 case RC_COMPLETION_INLINE_DOTS:
2099 if (ignore_system_lyxrc ||
2100 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2101 os << "\\completion_inline_dots "
2102 << convert<string>(completion_inline_dots) << '\n';
2106 case RC_AUTOCORRECTION_MATH:
2107 if (ignore_system_lyxrc ||
2108 autocorrection_math != system_lyxrc.autocorrection_math) {
2109 os << "\\autocorrection_math "
2110 << convert<string>(autocorrection_math) << '\n';
2114 case RC_COMPLETION_POPUP_DELAY:
2115 if (ignore_system_lyxrc ||
2116 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2117 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2121 case RC_COMPLETION_POPUP_MATH:
2122 if (ignore_system_lyxrc ||
2123 completion_popup_math != system_lyxrc.completion_popup_math) {
2124 os << "\\completion_popup_math "
2125 << convert<string>(completion_popup_math) << '\n';
2129 case RC_COMPLETION_POPUP_TEXT:
2130 if (ignore_system_lyxrc ||
2131 completion_popup_text != system_lyxrc.completion_popup_text) {
2132 os << "\\completion_popup_text "
2133 << convert<string>(completion_popup_text) << '\n';
2137 case RC_COMPLETION_CURSOR_TEXT:
2138 if (ignore_system_lyxrc ||
2139 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2140 os << "\\completion_cursor_text "
2141 << convert<string>(completion_cursor_text) << '\n';
2145 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2146 if (ignore_system_lyxrc ||
2147 completion_popup_after_complete
2148 != system_lyxrc.completion_popup_after_complete) {
2149 os << "\\completion_popup_after_complete "
2150 << convert<string>(completion_popup_after_complete) << '\n';
2154 case RC_NUMLASTFILES:
2155 if (ignore_system_lyxrc ||
2156 num_lastfiles != system_lyxrc.num_lastfiles) {
2157 os << "\\num_lastfiles " << num_lastfiles << '\n';
2161 case RC_CHECKLASTFILES:
2162 if (ignore_system_lyxrc ||
2163 check_lastfiles != system_lyxrc.check_lastfiles) {
2164 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2169 case RC_EXAMPLEPATH:
2170 if (ignore_system_lyxrc ||
2171 example_path != system_lyxrc.example_path) {
2172 string const path = os::external_path(example_path);
2173 os << "\\example_path \"" << path << "\"\n";
2177 case RC_TEMPLATEPATH:
2178 if (ignore_system_lyxrc ||
2179 template_path != system_lyxrc.template_path) {
2180 string const path = os::external_path(template_path);
2181 os << "\\template_path \"" << path << "\"\n";
2185 case RC_TEMPDIRPATH:
2186 if (ignore_system_lyxrc ||
2187 tempdir_path != system_lyxrc.tempdir_path) {
2188 string const path = os::external_path(tempdir_path);
2189 os << "\\tempdir_path \"" << path << "\"\n";
2193 case RC_THESAURUSDIRPATH:
2194 if (ignore_system_lyxrc ||
2195 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2196 string const path = os::external_path(thesaurusdir_path);
2197 os << "\\thesaurusdir_path \"" << path << "\"\n";
2201 case RC_HUNSPELLDIR_PATH:
2202 if (ignore_system_lyxrc ||
2203 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2204 string const path = os::external_path(hunspelldir_path);
2205 os << "\\hunspelldir_path \"" << path << "\"\n";
2213 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2216 case RC_PLAINTEXT_LINELEN:
2217 if (ignore_system_lyxrc ||
2218 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2219 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2223 case RC_MAKE_BACKUP:
2224 if (ignore_system_lyxrc ||
2225 make_backup != system_lyxrc.make_backup) {
2226 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2230 case RC_BACKUPDIR_PATH:
2231 if (ignore_system_lyxrc ||
2232 backupdir_path != system_lyxrc.backupdir_path) {
2233 string const path = os::external_path(backupdir_path);
2234 os << "\\backupdir_path \"" << path << "\"\n";
2240 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2244 << "# SPELLCHECKER SECTION ##############################\n"
2247 case RC_SPELL_COMMAND:
2248 case RC_USE_SPELL_LIB:
2252 case RC_ACCEPT_COMPOUND:
2253 if (ignore_system_lyxrc ||
2254 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2255 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2260 case RC_USE_ALT_LANG:
2265 if (ignore_system_lyxrc ||
2266 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2267 os << "\\alternate_language \"" << spellchecker_alt_lang
2272 case RC_USE_ESC_CHARS:
2276 if (ignore_system_lyxrc ||
2277 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2278 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2282 case RC_USE_PERS_DICT:
2286 case RC_USE_TOOLTIP:
2287 if (ignore_system_lyxrc ||
2288 use_tooltip != system_lyxrc.use_tooltip) {
2289 os << "\\use_tooltip "
2290 << convert<string>(use_tooltip)
2295 case RC_USE_PIXMAP_CACHE:
2296 if (ignore_system_lyxrc ||
2297 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2298 os << "\\use_pixmap_cache "
2299 << convert<string>(use_pixmap_cache)
2308 case RC_USE_INP_ENC:
2314 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2319 case RC_SPELLCHECKER:
2320 if (ignore_system_lyxrc ||
2321 spellchecker != system_lyxrc.spellchecker) {
2322 os << "\\spellchecker " << spellchecker << '\n';
2327 case RC_SPELLCHECK_CONTINUOUSLY:
2328 if (ignore_system_lyxrc ||
2329 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2330 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
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_LABEL_INIT_LENGTH:
2698 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2699 case LyXRC::RC_LANGUAGE_AUTO_END:
2700 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2701 case LyXRC::RC_LANGUAGE_COMMAND_END:
2702 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2703 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2704 case LyXRC::RC_LANGUAGE_PACKAGE:
2705 case LyXRC::RC_LANGUAGE_USE_BABEL:
2706 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2707 case LyXRC::RC_MACRO_EDIT_STYLE:
2708 case LyXRC::RC_MAKE_BACKUP:
2709 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2710 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2711 case LyXRC::RC_NUMLASTFILES:
2712 case LyXRC::RC_PARAGRAPH_MARKERS:
2713 case LyXRC::RC_PATH_PREFIX:
2714 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2715 prependEnvPath("PATH", lyxrc.path_prefix);
2717 case LyXRC::RC_PERS_DICT:
2718 case LyXRC::RC_PREVIEW:
2719 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2720 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2721 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2722 case LyXRC::RC_PRINTCOPIESFLAG:
2723 case LyXRC::RC_PRINTER:
2724 case LyXRC::RC_PRINTEVENPAGEFLAG:
2725 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2726 case LyXRC::RC_PRINTFILEEXTENSION:
2727 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2728 case LyXRC::RC_PRINTODDPAGEFLAG:
2729 case LyXRC::RC_PRINTPAGERANGEFLAG:
2730 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2731 case LyXRC::RC_PRINTPAPERFLAG:
2732 case LyXRC::RC_PRINTREVERSEFLAG:
2733 case LyXRC::RC_PRINTSPOOL_COMMAND:
2734 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2735 case LyXRC::RC_PRINTTOFILE:
2736 case LyXRC::RC_PRINTTOPRINTER:
2737 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2738 case LyXRC::RC_PRINT_COMMAND:
2739 case LyXRC::RC_RTL_SUPPORT:
2740 case LyXRC::RC_SCREEN_DPI:
2741 case LyXRC::RC_SCREEN_FONT_ROMAN:
2742 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2743 case LyXRC::RC_SCREEN_FONT_SANS:
2744 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2745 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2746 case LyXRC::RC_SCREEN_FONT_SIZES:
2747 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2748 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2749 case LyXRC::RC_GEOMETRY_SESSION:
2750 case LyXRC::RC_SCREEN_ZOOM:
2751 case LyXRC::RC_SERVERPIPE:
2752 case LyXRC::RC_SET_COLOR:
2753 case LyXRC::RC_SHOW_BANNER:
2754 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2755 case LyXRC::RC_SPELL_COMMAND:
2756 case LyXRC::RC_SPELLCHECKER:
2757 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
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_LABEL_INIT_LENGTH:
2952 str = _("Maximum number of words in the initialization string for a new label");
2955 case RC_LANGUAGE_AUTO_BEGIN:
2956 str = _("Select if a language switching command is needed at the beginning of the document.");
2959 case RC_LANGUAGE_AUTO_END:
2960 str = _("Select if a language switching command is needed at the end of the document.");
2963 case RC_LANGUAGE_COMMAND_BEGIN:
2964 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.");
2967 case RC_LANGUAGE_COMMAND_END:
2968 str = _("The LaTeX command for changing back to the language of the document.");
2971 case RC_LANGUAGE_COMMAND_LOCAL:
2972 str = _("The LaTeX command for local changing of the language.");
2975 case RC_LANGUAGE_GLOBAL_OPTIONS:
2976 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2979 case RC_LANGUAGE_PACKAGE:
2980 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2983 case RC_LANGUAGE_USE_BABEL:
2984 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2987 case RC_USELASTFILEPOS:
2988 str = _("De-select if you do not want LyX to scroll to saved position.");
2991 case RC_LOADSESSION:
2992 str = _("De-select to prevent loading files opened from the last LyX session.");
2995 case RC_MAKE_BACKUP:
2996 str = _("De-select if you don't want LyX to create backup files.");
2999 case RC_MARK_FOREIGN_LANGUAGE:
3000 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3003 case RC_MOUSE_WHEEL_SPEED:
3004 str = bformat(_("The scrolling speed of the mouse wheel."),
3008 case RC_COMPLETION_POPUP_DELAY:
3009 str = _("The completion popup delay.");
3012 case RC_COMPLETION_POPUP_MATH:
3013 str = _("Select to display the completion popup in math mode.");
3016 case RC_COMPLETION_POPUP_TEXT:
3017 str = _("Select to display the completion popup in text mode.");
3020 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3021 str = _("Show the completion popup without delay after non-unique completion attempt.");
3024 case RC_COMPLETION_POPUP_TEXT:
3025 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3028 case RC_COMPLETION_POPUP_DELAY:
3029 str = _("The inline completion delay.");
3032 case RC_COMPLETION_INLINE_MATH:
3033 str = _("Select to display the inline completion in math mode.");
3036 case RC_COMPLETION_INLINE_TEXT:
3037 str = _("Select to display the inline completion in text mode.");
3040 case RC_COMPLETION_INLINE_DOTS:
3041 str = _("Use \"...\" to shorten long completions.");
3044 case RC_AUTOCORRECTION_MATH:
3045 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3048 case RC_NUMLASTFILES:
3049 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3053 case RC_PATH_PREFIX:
3054 str = _("Specify those directories which should be "
3055 "prepended to the PATH environment variable. "
3056 "Use the OS native format.");
3060 str = _("Shows a typeset preview of things such as math");
3063 case RC_PREVIEW_HASHED_LABELS:
3064 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3067 case RC_PREVIEW_SCALE_FACTOR:
3068 str = _("Scale the preview size to suit.");
3071 case RC_PRINTCOLLCOPIESFLAG:
3072 str = _("The option for specifying whether the copies should be collated.");
3075 case RC_PRINTCOPIESFLAG:
3076 str = _("The option for specifying the number of copies to print.");
3080 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3083 case RC_PRINTEVENPAGEFLAG:
3084 str = _("The option to print only even pages.");
3087 case RC_PRINTEXSTRAOPTIONS:
3088 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3091 case RC_PRINTFILEEXTENSION:
3092 str = _("Extension of printer program output file. Usually \".ps\".");
3095 case RC_PRINTLANDSCAPEFLAG:
3096 str = _("The option to print out in landscape.");
3099 case RC_PRINTODDPAGEFLAG:
3100 str = _("The option to print only odd pages.");
3103 case RC_PRINTPAGERANGEFLAG:
3104 str = _("The option for specifying a comma-separated list of pages to print.");
3107 case RC_PRINTPAPERDIMENSIONFLAG:
3108 str = _("Option to specify the dimensions of the print paper.");
3111 case RC_PRINTPAPERFLAG:
3112 str = _("The option to specify paper type.");
3115 case RC_PRINTREVERSEFLAG:
3116 str = _("The option to reverse the order of the pages printed.");
3119 case RC_PRINTSPOOL_COMMAND:
3120 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.");
3123 case RC_PRINTSPOOL_PRINTERPREFIX:
3124 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.");
3127 case RC_PRINTTOFILE:
3128 str = _("Option to pass to the print program to print to a file.");
3131 case RC_PRINTTOPRINTER:
3132 str = _("Option to pass to the print program to print on a specific printer.");
3135 case RC_PRINT_ADAPTOUTPUT:
3136 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3139 case RC_PRINT_COMMAND:
3140 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3143 case RC_RTL_SUPPORT:
3144 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3147 case RC_VISUAL_CURSOR:
3148 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3152 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3155 case RC_SCREEN_FONT_ROMAN:
3156 case RC_SCREEN_FONT_SANS:
3157 case RC_SCREEN_FONT_TYPEWRITER:
3158 str = _("The screen fonts used to display the text while editing.");
3161 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3162 case RC_SCREEN_FONT_SANS_FOUNDRY:
3163 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3166 case RC_SCREEN_FONT_SCALABLE:
3167 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.");
3170 case RC_SCREEN_FONT_SIZES:
3171 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3174 case RC_SCREEN_ZOOM:
3175 //xgettext:no-c-format
3176 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3179 case RC_GEOMETRY_SESSION:
3180 str = _("Allow session manager to save and restore windows geometry.");
3184 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3190 case RC_SHOW_BANNER:
3191 str = _("De-select if you don't want the startup banner.");
3194 case RC_TEMPDIRPATH:
3195 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3198 case RC_THESAURUSDIRPATH:
3199 str = _("This is the place where the files of the thesaurus library reside.");
3202 case RC_TEMPLATEPATH:
3203 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3206 case RC_TEX_ALLOWS_SPACES:
3209 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3213 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3225 case RC_USE_TOOLTIP:
3226 str = _("Enable the automatic appearance of tool tips in the work area.");
3229 case RC_USE_PIXMAP_CACHE:
3230 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3233 case RC_USE_SPELL_LIB:
3236 case RC_VIEWDVI_PAPEROPTION:
3237 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3252 // The global instance
3255 // The global copy of the system lyxrc entries (everything except preferences)