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 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
178 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
179 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
180 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
181 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
182 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
183 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
184 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
185 { "\\ui_file", LyXRC::RC_UIFILE },
186 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
187 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
188 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
189 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
190 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
191 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
192 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
193 // compatibility with versions older than 1.4.0 only
194 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
195 // compatibility with versions older than 1.4.0 only
196 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
197 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
198 { "\\user_email", LyXRC::RC_USER_EMAIL },
199 { "\\user_name", LyXRC::RC_USER_NAME },
200 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
201 // compatibility with versions older than 1.4.0 only
202 { "\\viewer", LyXRC::RC_VIEWER},
203 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
204 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
207 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
218 void LyXRC::setDefaults()
221 def_file = "default";
223 // Get printer from the environment. If fail, use default "",
224 // assuming that everything is set up correctly.
225 printer = getEnv("PRINTER");
226 print_adapt_output = false;
227 print_command = "dvips";
228 print_evenpage_flag = "-B";
229 print_oddpage_flag = "-A";
230 print_pagerange_flag = "-pp";
231 print_copies_flag = "-c";
232 print_collcopies_flag = "-C";
233 print_reverse_flag = "-r";
234 print_landscape_flag = "-t landscape";
235 print_to_printer = "-P";
236 print_to_file = "-o ";
237 print_file_extension = ".ps";
238 print_paper_flag = "-t";
239 print_paper_dimension_flag = "-T";
240 document_path.erase();
241 view_dvi_paper_option.erase();
242 default_papersize = PAPER_DEFAULT;
243 default_view_format = "pdf2";
244 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
245 bibtex_command = "bibtex";
247 index_command = "makeindex -c -q";
248 nomencl_command = "makeindex -s nomencl.ist";
250 // Because a screen is typically wider than a piece of paper:
252 allow_geometry_session = true;
253 // Default LaTeX font size:
254 font_sizes[FONT_SIZE_TINY] = "5.0";
255 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
256 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
257 font_sizes[FONT_SIZE_SMALL] = "9.0";
258 font_sizes[FONT_SIZE_NORMAL] = "10.0";
259 font_sizes[FONT_SIZE_LARGE] = "12.0";
260 font_sizes[FONT_SIZE_LARGER] = "14.4";
261 font_sizes[FONT_SIZE_LARGEST] = "17.26";
262 font_sizes[FONT_SIZE_HUGE] = "20.74";
263 font_sizes[FONT_SIZE_HUGER] = "24.88";
264 use_scalable_fonts = true;
265 roman_font_name = "";
267 typewriter_font_name = "";
269 auto_region_delete = true;
270 auto_reset_options = false;
271 plaintext_linelen = 65;
272 mouse_wheel_speed = 1.0;
273 num_lastfiles = maxlastfiles;
274 check_lastfiles = true;
275 use_lastfilepos = true;
276 load_session = false;
278 backupdir_path.erase();
279 display_graphics = true;
280 // Spellchecker settings:
281 #if defined(USE_ASPELL)
282 spellchecker = "aspell";
283 #elif defined(USE_HUNSPELL)
284 spellchecker = "hunspell";
286 spellchecker = "aspell";
288 spellchecker_accept_compound = false;
289 spellcheck_continuously = false;
290 spellcheck_notes = true;
293 visual_cursor = false;
295 mark_foreign_language = true;
296 language_auto_begin = true;
297 language_auto_end = true;
298 language_global_options = true;
299 language_use_babel = true;
300 language_package = "\\usepackage{babel}";
301 language_command_begin = "\\selectlanguage{$$lang}";
302 language_command_local = "\\foreignlanguage{$$lang}{";
303 sort_layouts = false;
304 group_layouts = true;
305 default_language = "english";
306 gui_language = "auto";
308 windows_style_tex_paths = false;
309 tex_allows_spaces = false;
310 date_insert_format = "%x";
311 cursor_follows_scrollbar = false;
312 scroll_below_document = false;
313 paragraph_markers = false;
314 mac_like_word_movement = false;
315 macro_edit_style = MACRO_EDIT_INLINE_BOX;
316 dialogs_iconify_with_main = false;
317 label_init_length = 3;
318 preview = PREVIEW_OFF;
319 preview_hashed_labels = false;
320 preview_scale_factor = 1.0;
321 use_converter_cache = true;
323 use_pixmap_cache = false;
324 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
325 user_name = to_utf8(support::user_name());
326 user_email = to_utf8(support::user_email());
327 open_buffers_in_tabs = true;
328 single_close_tab_button = false;
330 // Fullscreen settings
331 full_screen_limit = false;
332 full_screen_toolbars = true;
333 full_screen_tabbar = true;
334 full_screen_menubar = true;
335 full_screen_scrollbar = true;
336 full_screen_width = 700;
338 completion_cursor_text = true;
339 completion_popup_math = true;
340 completion_popup_text = false;
341 completion_popup_delay = 2.0;
342 completion_popup_after_complete = true;
343 autocorrection_math = false;
344 completion_inline_math = true;
345 completion_inline_text = false;
346 completion_inline_dots = -1;
347 completion_inline_delay = 0.2;
353 void oldFontFormat(string & family, string & foundry)
355 if (family.empty() || family[0] != '-')
357 foundry = token(family, '-', 1);
358 family = token(family, '-', 2);
366 int LyXRC::read(FileName const & filename)
368 Lexer lexrc(lyxrcTags);
369 if (lyxerr.debugging(Debug::PARSER))
370 lexrc.printTable(lyxerr);
372 lexrc.setFile(filename);
376 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
382 int LyXRC::read(istream & is)
384 Lexer lexrc(lyxrcTags);
385 if (lyxerr.debugging(Debug::PARSER))
386 lexrc.printTable(lyxerr);
392 LYXERR(Debug::LYXRC, "Reading istream...");
398 int LyXRC::read(Lexer & lexrc)
403 while (lexrc.isOK()) {
404 // By using two switches we take advantage of the compiler
405 // telling us if we have missed a LyXRCTags element in
406 // the second switch.
407 // Note that this also shows a problem with Lexer since it
408 // helps us avoid taking advantage of the strictness of the
411 int le = lexrc.lex();
413 case Lexer::LEX_UNDEF:
414 lexrc.printError("Unknown tag `$$Token'");
416 case Lexer::LEX_FEOF:
421 switch (static_cast<LyXRCTags>(le)) {
422 case RC_INPUT: // Include file
425 libFileSearch(string(),
428 lexrc.printError("Error reading "
429 "included file: " + tmp.absFilename());
435 bind_file = os::internal_path(lexrc.getString());
440 def_file = os::internal_path(lexrc.getString());
445 ui_file = os::internal_path(lexrc.getString());
448 case RC_AUTORESET_OPTIONS:
449 lexrc >> auto_reset_options;
452 case RC_DISPLAY_GRAPHICS:
454 display_graphics = lexrc.getString() == "true";
457 case RC_TEX_EXPECTS_WINDOWS_PATHS:
458 lexrc >> windows_style_tex_paths;
461 case RC_TEX_ALLOWS_SPACES:
462 lexrc >> tex_allows_spaces;
469 case RC_KBMAP_PRIMARY:
471 string const kmap(os::internal_path(lexrc.getString()));
472 if (!libFileSearch("kbd", kmap, "kmap").empty()
474 primary_kbmap = kmap;
476 lexrc.printError("LyX: Keymap `$$Token' not found");
481 case RC_KBMAP_SECONDARY:
483 string const kmap(os::internal_path(lexrc.getString()));
484 if (!libFileSearch("kbd", kmap, "kmap").empty()
486 secondary_kbmap = kmap;
488 lexrc.printError("LyX: Keymap `$$Token' not found");
493 case RC_FONT_ENCODING:
501 case RC_PRINT_COMMAND:
502 if (lexrc.next(true)) {
503 print_command = lexrc.getString();
507 case RC_PRINTEVENPAGEFLAG:
508 lexrc >> print_evenpage_flag;
511 case RC_PRINTODDPAGEFLAG:
512 lexrc >> print_oddpage_flag;
515 case RC_PRINTPAGERANGEFLAG:
516 lexrc >> print_pagerange_flag;
519 case RC_PRINTCOPIESFLAG:
520 lexrc >> print_copies_flag;
523 case RC_PRINTCOLLCOPIESFLAG:
524 lexrc >> print_collcopies_flag;
527 case RC_PRINTREVERSEFLAG:
528 lexrc >> print_reverse_flag;
531 case RC_PRINTLANDSCAPEFLAG:
532 lexrc >> print_landscape_flag;
535 case RC_PRINTTOPRINTER:
536 lexrc >> print_to_printer;
539 case RC_PRINT_ADAPTOUTPUT:
540 lexrc >> print_adapt_output;
545 print_to_file = os::internal_path(lexrc.getString());
549 case RC_PRINTFILEEXTENSION:
550 lexrc >> print_file_extension;
553 case RC_PRINTEXSTRAOPTIONS:
554 lexrc >> print_extra_options;
557 case RC_PRINTSPOOL_COMMAND:
558 if (lexrc.next(true)) {
559 print_spool_command = lexrc.getString();
563 case RC_PRINTSPOOL_PRINTERPREFIX:
564 lexrc >> print_spool_printerprefix;
567 case RC_PRINTPAPERDIMENSIONFLAG:
568 lexrc >> print_paper_dimension_flag;
571 case RC_PRINTPAPERFLAG:
572 lexrc >> print_paper_flag;
575 case RC_DEFAULT_PAPERSIZE:
577 string const size = ascii_lowercase(lexrc.getString());
578 if (size == "usletter")
579 default_papersize = PAPER_USLETTER;
580 else if (size == "legal")
581 default_papersize = PAPER_USLEGAL;
582 else if (size == "executive")
583 default_papersize = PAPER_USEXECUTIVE;
584 else if (size == "a3")
585 default_papersize = PAPER_A3;
586 else if (size == "a4")
587 default_papersize = PAPER_A4;
588 else if (size == "a5")
589 default_papersize = PAPER_A5;
590 else if (size == "b5")
591 default_papersize = PAPER_B5;
592 else if (size == "default")
593 default_papersize = PAPER_DEFAULT;
597 case RC_VIEWDVI_PAPEROPTION:
599 view_dvi_paper_option = lexrc.getString();
601 view_dvi_paper_option.erase();
604 case RC_CHKTEX_COMMAND:
605 if (lexrc.next(true)) {
606 chktex_command = lexrc.getString();
610 case RC_BIBTEX_ALTERNATIVES:
611 if (lexrc.next(true)) {
612 bibtex_alternatives.insert(lexrc.getString());
616 case RC_BIBTEX_COMMAND:
617 if (lexrc.next(true)) {
618 bibtex_command = lexrc.getString();
622 case RC_JBIBTEX_COMMAND:
623 if (lexrc.next(true)) {
624 jbibtex_command = lexrc.getString();
628 case RC_INDEX_ALTERNATIVES:
629 if (lexrc.next(true)) {
630 index_alternatives.insert(lexrc.getString());
634 case RC_INDEX_COMMAND:
635 if (lexrc.next(true)) {
636 index_command = lexrc.getString();
640 case RC_JINDEX_COMMAND:
641 if (lexrc.next(true)) {
642 jindex_command = lexrc.getString();
646 case RC_SPLITINDEX_COMMAND:
647 if (lexrc.next(true)) {
648 splitindex_command = lexrc.getString();
652 case RC_NOMENCL_COMMAND:
653 if (lexrc.next(true)) {
654 nomencl_command = lexrc.getString();
666 case RC_GEOMETRY_SESSION:
667 lexrc >> allow_geometry_session;
670 case RC_SCREEN_FONT_SIZES:
671 lexrc >> font_sizes[FONT_SIZE_TINY];
672 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
673 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
674 lexrc >> font_sizes[FONT_SIZE_SMALL];
675 lexrc >> font_sizes[FONT_SIZE_NORMAL];
676 lexrc >> font_sizes[FONT_SIZE_LARGE];
677 lexrc >> font_sizes[FONT_SIZE_LARGER];
678 lexrc >> font_sizes[FONT_SIZE_LARGEST];
679 lexrc >> font_sizes[FONT_SIZE_HUGE];
680 lexrc >> font_sizes[FONT_SIZE_HUGER];
683 case RC_SCREEN_FONT_SCALABLE:
684 lexrc >> use_scalable_fonts;
691 case RC_DOCUMENTPATH:
693 document_path = os::internal_path(lexrc.getString());
694 document_path = expandPath(document_path);
700 example_path = os::internal_path(lexrc.getString());
701 example_path = expandPath(example_path);
705 case RC_TEMPLATEPATH:
707 template_path = os::internal_path(lexrc.getString());
708 template_path = expandPath(template_path);
714 tempdir_path = os::internal_path(lexrc.getString());
715 tempdir_path = expandPath(tempdir_path);
719 case RC_THESAURUSDIRPATH:
721 thesaurusdir_path = os::internal_path(lexrc.getString());
722 thesaurusdir_path = expandPath(thesaurusdir_path);
726 case RC_HUNSPELLDIR_PATH:
728 hunspelldir_path = os::internal_path(lexrc.getString());
729 hunspelldir_path = expandPath(hunspelldir_path);
733 case RC_USELASTFILEPOS:
734 lexrc >> use_lastfilepos;
738 lexrc >> load_session;
741 case RC_MOUSE_WHEEL_SPEED:
742 lexrc >> mouse_wheel_speed;
745 case RC_COMPLETION_INLINE_DELAY:
746 lexrc >> completion_inline_delay;
749 case RC_COMPLETION_INLINE_MATH:
750 lexrc >> completion_inline_math;
753 case RC_COMPLETION_INLINE_TEXT:
754 lexrc >> completion_inline_text;
757 case RC_COMPLETION_INLINE_DOTS:
758 lexrc >> completion_inline_dots;
761 case RC_AUTOCORRECTION_MATH:
762 lexrc >> autocorrection_math;
765 case RC_COMPLETION_POPUP_DELAY:
766 lexrc >> completion_popup_delay;
769 case RC_COMPLETION_POPUP_MATH:
770 lexrc >> completion_popup_math;
773 case RC_COMPLETION_POPUP_TEXT:
774 lexrc >> completion_popup_text;
777 case RC_COMPLETION_CURSOR_TEXT:
778 lexrc >> completion_cursor_text;
781 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
782 lexrc >> completion_popup_after_complete;
785 case RC_NUMLASTFILES:
786 lexrc >> num_lastfiles;
789 case RC_CHECKLASTFILES:
790 lexrc >> check_lastfiles;
793 case RC_SCREEN_FONT_ROMAN:
795 roman_font_name = lexrc.getString();
796 oldFontFormat(roman_font_name,
801 case RC_SCREEN_FONT_SANS:
803 sans_font_name = lexrc.getString();
804 oldFontFormat(sans_font_name, sans_font_foundry);
808 case RC_SCREEN_FONT_TYPEWRITER:
810 typewriter_font_name = lexrc.getString();
811 oldFontFormat(typewriter_font_name,
812 typewriter_font_foundry);
816 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
817 lexrc >> roman_font_foundry;
820 case RC_SCREEN_FONT_SANS_FOUNDRY:
821 lexrc >> sans_font_foundry;
824 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
825 lexrc >> typewriter_font_foundry;
830 lexrc.printError("Missing color tag.");
833 string lyx_name = lexrc.getString();
836 lexrc.printError("Missing color name for color: `$$Token'");
839 string x11_name = lexrc.getString();
841 ColorCode const col =
842 lcolor.getFromLyXName(lyx_name);
843 if (col == Color_none ||
844 col == Color_inherit ||
848 if (!lcolor.setColor(col, x11_name))
849 LYXERR0("Bad lyxrc set_color for " << lyx_name);
853 case RC_AUTOREGIONDELETE:
854 // Auto region delete defaults to true
855 lexrc >> auto_region_delete;
860 lyxpipes = os::internal_path(lexrc.getString());
861 lyxpipes = expandPath(lyxpipes);
865 case RC_CURSOR_FOLLOWS_SCROLLBAR:
866 lexrc >> cursor_follows_scrollbar;
869 case RC_SCROLL_BELOW_DOCUMENT:
870 lexrc >> scroll_below_document;
873 case RC_PARAGRAPH_MARKERS:
874 lexrc >> paragraph_markers;
877 case RC_MAC_LIKE_WORD_MOVEMENT:
878 lexrc >> mac_like_word_movement;
881 case RC_MACRO_EDIT_STYLE:
883 switch (lexrc.getInteger()) {
884 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
885 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
886 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
891 case RC_DIALOGS_ICONIFY_WITH_MAIN:
892 lexrc >> dialogs_iconify_with_main;
895 case RC_PLAINTEXT_LINELEN:
896 lexrc >> plaintext_linelen;
898 // Spellchecker settings:
899 case RC_ACCEPT_COMPOUND:
900 lexrc >> spellchecker_accept_compound;
903 lexrc >> use_tooltip;
905 case RC_USE_PIXMAP_CACHE:
906 lexrc >> use_pixmap_cache;
908 case RC_SPELLCHECKER:
909 lexrc >> spellchecker;
912 lexrc >> spellchecker_alt_lang;
915 lexrc >> spellchecker_esc_chars;
917 case RC_SPELLCHECK_CONTINUOUSLY:
918 lexrc >> spellcheck_continuously;
920 case RC_SPELLCHECK_NOTES:
921 lexrc >> spellcheck_notes;
924 lexrc >> make_backup;
926 case RC_BACKUPDIR_PATH:
928 backupdir_path = os::internal_path(lexrc.getString());
929 backupdir_path = expandPath(backupdir_path);
932 case RC_DATE_INSERT_FORMAT:
933 lexrc >> date_insert_format;
935 case RC_LANGUAGE_PACKAGE:
936 lexrc >> language_package;
938 case RC_LANGUAGE_AUTO_BEGIN:
939 lexrc >> language_auto_begin;
941 case RC_LANGUAGE_AUTO_END:
942 lexrc >> language_auto_end;
944 case RC_LANGUAGE_GLOBAL_OPTIONS:
945 lexrc >> language_global_options;
947 case RC_LANGUAGE_USE_BABEL:
948 lexrc >> language_use_babel;
950 case RC_LANGUAGE_COMMAND_BEGIN:
951 lexrc >> language_command_begin;
953 case RC_LANGUAGE_COMMAND_END:
954 lexrc >> language_command_end;
956 case RC_LANGUAGE_COMMAND_LOCAL:
957 lexrc >> language_command_local;
960 lexrc >> rtl_support;
962 case RC_VISUAL_CURSOR:
963 lexrc >> visual_cursor;
966 lexrc >> auto_number;
968 case RC_MARK_FOREIGN_LANGUAGE:
969 lexrc >> mark_foreign_language;
975 fmt = lexrc.getString();
976 if (lexrc.next(true))
977 command = lexrc.getString();
978 setMover(fmt, command);
983 string from, to, command, flags;
985 from = lexrc.getString();
987 to = lexrc.getString();
988 if (lexrc.next(true))
989 command = lexrc.getString();
991 flags = lexrc.getString();
993 theConverters().erase(from, to);
995 theConverters().add(from, to, command, flags);
998 // compatibility with versions older than 1.4.0 only
1000 string format, command;
1001 lexrc >> format >> command;
1002 formats.setViewer(format, command);
1006 string format, extension, prettyname, shortcut;
1007 lexrc >> format >> extension >> prettyname >> shortcut;
1008 string viewer, editor;
1009 if (lexrc.next(true))
1010 viewer = lexrc.getString();
1011 if (lexrc.next(true))
1012 editor = lexrc.getString();
1014 // Hack to ensure compatibility with versions older
1016 int le = lexrc.lex();
1017 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1018 flags = lexrc.getString();
1019 if (le != Lexer::LEX_DATA) {
1020 // We have got a known token.
1021 // Therefore this is an old style
1022 // format definition without
1024 lexrc.pushToken(flags);
1028 int flgs = Format::none;
1029 while (!flags.empty()) {
1031 flags = split(flags, flag, ',');
1032 if (flag == "document")
1033 flgs |= Format::document;
1034 else if (flag == "vector")
1035 flgs |= Format::vector;
1037 LYXERR0("Ignoring unknown flag `"
1038 << flag << "' for format `"
1041 if (prettyname.empty()) {
1042 if (theConverters().formatIsUsed(format))
1043 LYXERR0("Can't delete format " << format);
1045 formats.erase(format);
1047 formats.add(format, extension, prettyname,
1048 shortcut, viewer, editor, flgs);
1052 case RC_VIEWER_ALTERNATIVES: {
1053 string format, command;
1055 format = lexrc.getString();
1056 if (lexrc.eatLine())
1057 command = lexrc.getString();
1058 viewer_alternatives[format].insert(command);
1061 case RC_EDITOR_ALTERNATIVES: {
1062 string format, command;
1063 lexrc >> format >> command;
1064 editor_alternatives[format].insert(command);
1068 case RC_DEFAULT_VIEW_FORMAT:
1069 lexrc >> default_view_format;
1072 case RC_DEFAULT_LANGUAGE:
1073 lexrc >> default_language;
1076 case RC_GUI_LANGUAGE:
1077 lexrc >> gui_language;
1080 case RC_LABEL_INIT_LENGTH:
1081 lexrc >> label_init_length;
1084 case RC_SHOW_BANNER:
1085 lexrc >> show_banner;
1090 string const tmp = lexrc.getString();
1091 if (tmp == "true" || tmp == "on")
1092 preview = PREVIEW_ON;
1093 else if (tmp == "no_math")
1094 preview = PREVIEW_NO_MATH;
1096 preview = PREVIEW_OFF;
1097 if (tmp != "false" && tmp != "off")
1098 LYXERR0("Unrecognized preview status \""
1104 case RC_PREVIEW_HASHED_LABELS:
1105 lexrc >> preview_hashed_labels;
1108 case RC_PREVIEW_SCALE_FACTOR:
1109 lexrc >> preview_scale_factor;
1116 lexrc >> user_email;
1119 case RC_PATH_PREFIX:
1120 lexrc >> path_prefix;
1123 case RC_USE_CONVERTER_CACHE:
1124 lexrc >> use_converter_cache;
1126 case RC_CONVERTER_CACHE_MAXAGE:
1127 lexrc >> converter_cache_maxage;
1130 case RC_SORT_LAYOUTS:
1131 lexrc >> sort_layouts;
1133 case RC_GROUP_LAYOUTS:
1134 lexrc >> group_layouts;
1136 case RC_FULL_SCREEN_LIMIT:
1137 lexrc >> full_screen_limit;
1139 case RC_FULL_SCREEN_TOOLBARS:
1140 lexrc >> full_screen_toolbars;
1142 case RC_FULL_SCREEN_SCROLLBAR:
1143 lexrc >> full_screen_scrollbar;
1145 case RC_FULL_SCREEN_TABBAR:
1146 lexrc >> full_screen_tabbar;
1148 case RC_FULL_SCREEN_MENUBAR:
1149 lexrc >> full_screen_menubar;
1151 case RC_FULL_SCREEN_WIDTH:
1152 lexrc >> full_screen_width;
1154 case RC_OPEN_BUFFERS_IN_TABS:
1155 lexrc >> open_buffers_in_tabs;
1157 case RC_SINGLE_CLOSE_TAB_BUTTON:
1158 lexrc >> single_close_tab_button;
1161 // Obsoteted in 1.4.0
1164 case RC_SPELL_COMMAND:
1166 case RC_PLAINTEXT_ROFF_COMMAND:
1167 case RC_USE_ALT_LANG:
1168 case RC_USE_ESC_CHARS:
1169 case RC_USE_INP_ENC:
1170 case RC_USE_PERS_DICT:
1171 case RC_USE_SPELL_LIB:
1172 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1173 << lexrc.getString() << "'.");
1178 break; // this is just a dummy
1182 /// Update converters data-structures
1183 theConverters().update(formats);
1184 theConverters().buildGraph();
1190 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1192 ofstream ofs(filename.toFilesystemEncoding().c_str());
1194 write(ofs, ignore_system_lyxrc);
1198 void LyXRC::print() const
1200 if (lyxerr.debugging())
1201 write(lyxerr, false);
1209 typedef pair<string, SpecialisedMover> Data;
1211 SameMover(Data const & comparison)
1212 : comparison_(comparison) {}
1214 bool operator()(Data const & data) const
1216 return data.first == comparison_.first &&
1217 data.second.command() == comparison_.second.command();
1227 // Escape \ and " so that LyXLex can read the string later
1228 string escapeCommand(string const & str) {
1229 return subst(subst(str , "\\", "\\\\"),
1236 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1238 LyXRCTags tag = RC_LAST;
1240 if (!name.empty()) {
1241 for (int i = 0; i != lyxrcCount; ++i)
1242 if ("\\" + name == lyxrcTags[i].tag)
1243 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1247 os << "# LyX " << lyx_version
1248 << " generated this file. If you want to make your own\n"
1249 << "# modifications you should do them from inside LyX and save.\n"
1252 // Why the switch you might ask. It is a trick to ensure that all
1253 // the elements in the LyXRCTags enum are handled. As you can see
1254 // there are no breaks at all. So it is just a huge fall-through.
1255 // The nice thing is that we will get a warning from the compiler
1256 // if we forget an element.
1260 // input/include files are not done here
1262 if (ignore_system_lyxrc ||
1263 bind_file != system_lyxrc.bind_file) {
1264 string const path = os::external_path(bind_file);
1265 os << "\\bind_file \"" << path << "\"\n";
1271 if (ignore_system_lyxrc ||
1272 def_file != system_lyxrc.def_file) {
1273 string const path = os::external_path(def_file);
1274 os << "\\def_file \"" << path << "\"\n";
1283 << "# MISC SECTION ######################################\n"
1285 // bind files are not done here.
1287 case RC_PATH_PREFIX:
1288 if (ignore_system_lyxrc ||
1289 path_prefix != system_lyxrc.path_prefix) {
1290 os << "\\path_prefix \"" << path_prefix << "\"\n";
1295 if (ignore_system_lyxrc ||
1296 ui_file != system_lyxrc.ui_file) {
1297 string const path = os::external_path(ui_file);
1298 os << "\\ui_file \"" << path << "\"\n";
1302 case RC_AUTOREGIONDELETE:
1303 if (ignore_system_lyxrc ||
1304 auto_region_delete != system_lyxrc.auto_region_delete) {
1305 os << "# Set to false to inhibit automatic replacement of\n"
1306 << "# the current selection.\n"
1307 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1312 case RC_AUTORESET_OPTIONS:
1313 if (ignore_system_lyxrc ||
1314 auto_reset_options != system_lyxrc.auto_reset_options) {
1315 os << "# Set to false to inhibit automatic reset of\n"
1316 << "# the class options to defaults on class change.\n"
1317 << "\\auto_reset_options "
1318 << convert<string>(auto_reset_options)
1324 if (ignore_system_lyxrc ||
1325 autosave != system_lyxrc.autosave) {
1326 os << "# The time interval between auto-saves in seconds.\n"
1327 << "\\autosave " << autosave << '\n';
1331 case RC_DISPLAY_GRAPHICS:
1332 if (ignore_system_lyxrc ||
1333 display_graphics != system_lyxrc.display_graphics) {
1334 os << "# Display graphics within LyX\n"
1336 << "\\display_graphics "
1337 << (display_graphics ? "true" : "false")
1342 case RC_SORT_LAYOUTS:
1343 if (ignore_system_lyxrc ||
1344 sort_layouts != system_lyxrc.sort_layouts) {
1345 os << "# Sort layouts alphabetically.\n"
1346 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1350 case RC_GROUP_LAYOUTS:
1351 if (ignore_system_lyxrc ||
1352 group_layouts != system_lyxrc.group_layouts) {
1353 os << "# Group layouts by their category.\n"
1354 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1358 case RC_VIEWDVI_PAPEROPTION:
1359 if (ignore_system_lyxrc ||
1360 view_dvi_paper_option
1361 != system_lyxrc.view_dvi_paper_option) {
1362 os << "# Options used to specify paper size to the\n"
1363 << "# view_dvi_command (e.g. -paper)\n"
1364 << "\\view_dvi_paper_option \""
1365 << view_dvi_paper_option << "\"\n";
1369 case RC_DEFAULT_PAPERSIZE:
1370 if (ignore_system_lyxrc ||
1371 default_papersize != system_lyxrc.default_papersize) {
1372 os << "# The default papersize to use.\n"
1373 << "\\default_papersize \"";
1374 switch (default_papersize) {
1376 os << "default"; break;
1377 case PAPER_USLETTER:
1378 os << "usletter"; break;
1380 os << "legal"; break;
1381 case PAPER_USEXECUTIVE:
1382 os << "executive"; break;
1393 case PAPER_B4: break;
1399 case RC_CHKTEX_COMMAND:
1400 if (ignore_system_lyxrc ||
1401 chktex_command != system_lyxrc.chktex_command) {
1402 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1406 case RC_BIBTEX_ALTERNATIVES: {
1407 CommandSet::const_iterator it = bibtex_alternatives.begin();
1408 CommandSet::const_iterator end = bibtex_alternatives.end();
1409 for ( ; it != end; ++it) {
1410 if (ignore_system_lyxrc
1411 || !system_lyxrc.bibtex_alternatives.count(*it))
1412 os << "\\bibtex_alternatives \""
1418 case RC_BIBTEX_COMMAND:
1419 if (ignore_system_lyxrc ||
1420 bibtex_command != system_lyxrc.bibtex_command) {
1421 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1425 case RC_JBIBTEX_COMMAND:
1426 if (ignore_system_lyxrc ||
1427 jbibtex_command != system_lyxrc.jbibtex_command) {
1428 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1432 case RC_INDEX_ALTERNATIVES: {
1433 CommandSet::const_iterator it = index_alternatives.begin();
1434 CommandSet::const_iterator end = index_alternatives.end();
1435 for ( ; it != end; ++it) {
1436 if (ignore_system_lyxrc
1437 || !system_lyxrc.index_alternatives.count(*it))
1438 os << "\\index_alternatives \""
1444 case RC_INDEX_COMMAND:
1445 if (ignore_system_lyxrc ||
1446 index_command != system_lyxrc.index_command) {
1447 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1451 case RC_JINDEX_COMMAND:
1452 if (ignore_system_lyxrc ||
1453 jindex_command != system_lyxrc.jindex_command) {
1454 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1458 case RC_SPLITINDEX_COMMAND:
1459 if (ignore_system_lyxrc ||
1460 splitindex_command != system_lyxrc.splitindex_command) {
1461 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1465 case RC_NOMENCL_COMMAND:
1466 if (ignore_system_lyxrc ||
1467 nomencl_command != system_lyxrc.nomencl_command) {
1468 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1472 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1473 if (ignore_system_lyxrc ||
1474 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1475 os << "\\tex_expects_windows_paths "
1476 << convert<string>(windows_style_tex_paths) << '\n';
1480 case RC_TEX_ALLOWS_SPACES:
1481 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1482 os << "\\tex_allows_spaces "
1483 << convert<string>(tex_allows_spaces) << '\n';
1488 if (ignore_system_lyxrc ||
1489 use_kbmap != system_lyxrc.use_kbmap) {
1490 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1494 case RC_KBMAP_PRIMARY:
1495 if (ignore_system_lyxrc ||
1496 primary_kbmap != system_lyxrc.primary_kbmap) {
1497 string const path = os::external_path(primary_kbmap);
1498 os << "\\kbmap_primary \"" << path << "\"\n";
1502 case RC_KBMAP_SECONDARY:
1503 if (ignore_system_lyxrc ||
1504 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1505 string const path = os::external_path(secondary_kbmap);
1506 os << "\\kbmap_secondary \"" << path << "\"\n";
1511 if (ignore_system_lyxrc ||
1512 lyxpipes != system_lyxrc.lyxpipes) {
1513 string const path = os::external_path(lyxpipes);
1514 os << "\\serverpipe \"" << path << "\"\n";
1518 case RC_DATE_INSERT_FORMAT:
1519 if (ignore_system_lyxrc ||
1520 date_insert_format != system_lyxrc.date_insert_format) {
1521 os << "\\date_insert_format \"" << date_insert_format
1526 case RC_LABEL_INIT_LENGTH:
1527 if (ignore_system_lyxrc ||
1528 label_init_length != system_lyxrc.label_init_length) {
1529 os << "\\label_init_length " << label_init_length
1536 os << "\\user_name \"" << user_name << "\"\n";
1541 os << "\\user_email \"" << user_email << "\"\n";
1545 case RC_SHOW_BANNER:
1546 if (ignore_system_lyxrc ||
1547 show_banner != system_lyxrc.show_banner) {
1548 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1554 if (ignore_system_lyxrc ||
1555 preview != system_lyxrc.preview) {
1561 case PREVIEW_NO_MATH:
1568 os << "\\preview " << status << '\n';
1573 case RC_PREVIEW_HASHED_LABELS:
1574 if (ignore_system_lyxrc ||
1575 preview_hashed_labels !=
1576 system_lyxrc.preview_hashed_labels) {
1577 os << "\\preview_hashed_labels "
1578 << convert<string>(preview_hashed_labels) << '\n';
1583 case RC_PREVIEW_SCALE_FACTOR:
1584 if (ignore_system_lyxrc ||
1585 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1586 os << "\\preview_scale_factor "
1587 << preview_scale_factor << '\n';
1592 case RC_USE_CONVERTER_CACHE:
1593 if (ignore_system_lyxrc ||
1594 use_converter_cache != system_lyxrc.use_converter_cache) {
1595 os << "\\use_converter_cache "
1596 << convert<string>(use_converter_cache) << '\n';
1601 case RC_CONVERTER_CACHE_MAXAGE:
1602 if (ignore_system_lyxrc ||
1603 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1604 os << "\\converter_cache_maxage "
1605 << converter_cache_maxage << '\n';
1611 << "# SCREEN & FONTS SECTION ############################\n"
1615 if (ignore_system_lyxrc ||
1616 dpi != system_lyxrc.dpi) {
1617 os << "\\screen_dpi " << dpi << '\n';
1621 case RC_SCREEN_ZOOM:
1622 if (ignore_system_lyxrc ||
1623 zoom != system_lyxrc.zoom) {
1624 os << "\\screen_zoom " << zoom << '\n';
1628 case RC_GEOMETRY_SESSION:
1629 if (ignore_system_lyxrc ||
1630 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1631 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1636 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1637 if (ignore_system_lyxrc ||
1638 cursor_follows_scrollbar
1639 != system_lyxrc.cursor_follows_scrollbar) {
1640 os << "\\cursor_follows_scrollbar "
1641 << convert<string>(cursor_follows_scrollbar) << '\n';
1645 case RC_SCROLL_BELOW_DOCUMENT:
1646 if (ignore_system_lyxrc ||
1647 scroll_below_document
1648 != system_lyxrc.scroll_below_document) {
1649 os << "\\scroll_below_document "
1650 << convert<string>(scroll_below_document) << '\n';
1654 case RC_PARAGRAPH_MARKERS:
1655 if (ignore_system_lyxrc ||
1657 != system_lyxrc.paragraph_markers) {
1658 os << "\\paragraph_markers "
1659 << convert<string>(paragraph_markers) << '\n';
1663 case RC_MAC_LIKE_WORD_MOVEMENT:
1664 if (ignore_system_lyxrc ||
1665 mac_like_word_movement
1666 != system_lyxrc.mac_like_word_movement) {
1667 os << "\\mac_like_word_movement "
1668 << convert<string>(mac_like_word_movement) << '\n';
1672 case RC_MACRO_EDIT_STYLE:
1673 if (ignore_system_lyxrc ||
1675 != system_lyxrc.macro_edit_style) {
1676 os << "\\macro_edit_style ";
1677 switch (macro_edit_style) {
1678 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1679 case MACRO_EDIT_INLINE: os << "1\n"; break;
1680 case MACRO_EDIT_LIST: os << "2\n"; break;
1685 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1686 if (ignore_system_lyxrc ||
1687 dialogs_iconify_with_main
1688 != system_lyxrc.dialogs_iconify_with_main) {
1689 os << "\\dialogs_iconify_with_main "
1690 << convert<string>(dialogs_iconify_with_main) << '\n';
1694 case RC_SCREEN_FONT_ROMAN:
1695 if (ignore_system_lyxrc ||
1696 roman_font_name != system_lyxrc.roman_font_name) {
1697 os << "\\screen_font_roman \"" << roman_font_name
1702 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1703 if (ignore_system_lyxrc ||
1704 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1705 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1710 case RC_SCREEN_FONT_SANS:
1711 if (ignore_system_lyxrc ||
1712 sans_font_name != system_lyxrc.sans_font_name) {
1713 os << "\\screen_font_sans \"" << sans_font_name
1718 case RC_SCREEN_FONT_SANS_FOUNDRY:
1719 if (ignore_system_lyxrc ||
1720 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1721 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1726 case RC_SCREEN_FONT_TYPEWRITER:
1727 if (ignore_system_lyxrc ||
1728 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1729 os << "\\screen_font_typewriter \""
1730 << typewriter_font_name << "\"\n";
1734 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1735 if (ignore_system_lyxrc ||
1736 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1737 os << "\\screen_font_typewriter_foundry \""
1738 << typewriter_font_foundry << "\"\n";
1743 case RC_SCREEN_FONT_SCALABLE:
1744 if (ignore_system_lyxrc ||
1745 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1746 os << "\\screen_font_scalable "
1747 << convert<string>(use_scalable_fonts)
1752 case RC_SCREEN_FONT_SIZES:
1753 if (ignore_system_lyxrc ||
1754 font_sizes[FONT_SIZE_TINY]
1755 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1756 font_sizes[FONT_SIZE_SCRIPT]
1757 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1758 font_sizes[FONT_SIZE_FOOTNOTE]
1759 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1760 font_sizes[FONT_SIZE_SMALL]
1761 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1762 font_sizes[FONT_SIZE_NORMAL]
1763 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1764 font_sizes[FONT_SIZE_LARGE]
1765 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1766 font_sizes[FONT_SIZE_LARGER]
1767 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1768 font_sizes[FONT_SIZE_LARGEST]
1769 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1770 font_sizes[FONT_SIZE_HUGE]
1771 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1772 font_sizes[FONT_SIZE_HUGER]
1773 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1774 os.setf(ios::fixed);
1776 os << "\\screen_font_sizes"
1777 << ' ' << font_sizes[FONT_SIZE_TINY]
1778 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1779 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1780 << ' ' << font_sizes[FONT_SIZE_SMALL]
1781 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1782 << ' ' << font_sizes[FONT_SIZE_LARGE]
1783 << ' ' << font_sizes[FONT_SIZE_LARGER]
1784 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1785 << ' ' << font_sizes[FONT_SIZE_HUGE]
1786 << ' ' << font_sizes[FONT_SIZE_HUGER]
1791 case RC_FULL_SCREEN_LIMIT:
1792 if (ignore_system_lyxrc ||
1793 full_screen_limit != system_lyxrc.full_screen_limit) {
1794 os << "\\fullscreen_limit "
1795 << convert<string>(full_screen_limit)
1800 case RC_FULL_SCREEN_TOOLBARS:
1801 if (ignore_system_lyxrc ||
1802 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1803 os << "\\fullscreen_toolbars "
1804 << convert<string>(full_screen_toolbars)
1809 case RC_FULL_SCREEN_SCROLLBAR:
1810 if (ignore_system_lyxrc ||
1811 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1812 os << "\\fullscreen_scrollbar "
1813 << convert<string>(full_screen_scrollbar)
1818 case RC_FULL_SCREEN_TABBAR:
1819 if (ignore_system_lyxrc ||
1820 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1821 os << "\\fullscreen_tabbar "
1822 << convert<string>(full_screen_tabbar)
1827 case RC_FULL_SCREEN_MENUBAR:
1828 if (ignore_system_lyxrc ||
1829 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1830 os << "\\fullscreen_menubar "
1831 << convert<string>(full_screen_menubar)
1836 case RC_FULL_SCREEN_WIDTH:
1837 if (ignore_system_lyxrc ||
1838 full_screen_width != system_lyxrc.full_screen_width) {
1839 os << "\\fullscreen_width "
1840 << convert<string>(full_screen_width)
1845 case RC_OPEN_BUFFERS_IN_TABS:
1846 if (ignore_system_lyxrc ||
1847 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1848 os << "\\open_buffers_in_tabs "
1849 << convert<string>(open_buffers_in_tabs)
1852 case RC_SINGLE_CLOSE_TAB_BUTTON:
1853 if (ignore_system_lyxrc ||
1854 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1855 os << "\\single_close_tab_button "
1856 << convert<string>(single_close_tab_button)
1863 << "# COLOR SECTION ###################################\n"
1867 for (int i = 0; i < Color_ignore; ++i) {
1868 ColorCode lc = static_cast<ColorCode>(i);
1869 string const col = lcolor.getX11Name(lc);
1870 if (ignore_system_lyxrc
1871 || col != system_lcolor.getX11Name(lc)) {
1872 os << "\\set_color \""
1873 << lcolor.getLyXName(lc) << "\" \""
1881 << "# PRINTER SECTION ###################################\n"
1885 if (ignore_system_lyxrc ||
1886 printer != system_lyxrc.printer) {
1887 os << "\\printer \"" << printer << "\"\n";
1891 case RC_PRINT_ADAPTOUTPUT:
1892 if (ignore_system_lyxrc ||
1893 print_adapt_output != system_lyxrc.print_adapt_output) {
1894 os << "\\print_adapt_output "
1895 << convert<string>(print_adapt_output)
1900 case RC_PRINT_COMMAND:
1901 if (ignore_system_lyxrc ||
1902 print_command != system_lyxrc.print_command) {
1903 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1907 case RC_PRINTEXSTRAOPTIONS:
1908 if (ignore_system_lyxrc ||
1909 print_extra_options != system_lyxrc.print_extra_options) {
1910 os << "\\print_extra_options \"" << print_extra_options
1915 case RC_PRINTSPOOL_COMMAND:
1916 if (ignore_system_lyxrc ||
1917 print_spool_command != system_lyxrc.print_spool_command) {
1918 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1923 case RC_PRINTSPOOL_PRINTERPREFIX:
1924 if (ignore_system_lyxrc ||
1925 print_spool_printerprefix
1926 != system_lyxrc.print_spool_printerprefix) {
1927 os << "\\print_spool_printerprefix \""
1928 << print_spool_printerprefix << "\"\n";
1932 case RC_PRINTEVENPAGEFLAG:
1933 if (ignore_system_lyxrc ||
1934 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1935 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1940 case RC_PRINTODDPAGEFLAG:
1941 if (ignore_system_lyxrc ||
1942 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1943 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1948 case RC_PRINTREVERSEFLAG:
1949 if (ignore_system_lyxrc ||
1950 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1951 os << "\\print_reverse_flag \"" << print_reverse_flag
1956 case RC_PRINTLANDSCAPEFLAG:
1957 if (ignore_system_lyxrc ||
1958 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1959 os << "\\print_landscape_flag \"" << print_landscape_flag
1964 case RC_PRINTPAGERANGEFLAG:
1965 if (ignore_system_lyxrc ||
1966 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1967 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1972 case RC_PRINTCOPIESFLAG:
1973 if (ignore_system_lyxrc ||
1974 print_copies_flag != system_lyxrc.print_copies_flag) {
1975 os << "\\print_copies_flag \"" << print_copies_flag
1980 case RC_PRINTCOLLCOPIESFLAG:
1981 if (ignore_system_lyxrc ||
1982 print_collcopies_flag
1983 != system_lyxrc.print_collcopies_flag) {
1984 os << "\\print_collcopies_flag \""
1985 << print_collcopies_flag
1990 case RC_PRINTPAPERFLAG:
1991 if (ignore_system_lyxrc ||
1992 print_paper_flag != system_lyxrc.print_paper_flag) {
1993 os << "\\print_paper_flag \"" << print_paper_flag
1998 case RC_PRINTPAPERDIMENSIONFLAG:
1999 if (ignore_system_lyxrc ||
2000 print_paper_dimension_flag
2001 != system_lyxrc.print_paper_dimension_flag) {
2002 os << "\\print_paper_dimension_flag \""
2003 << print_paper_dimension_flag << "\"\n";
2007 case RC_PRINTTOPRINTER:
2008 if (ignore_system_lyxrc ||
2009 print_to_printer != system_lyxrc.print_to_printer) {
2010 os << "\\print_to_printer \"" << print_to_printer
2015 case RC_PRINTTOFILE:
2016 if (ignore_system_lyxrc ||
2017 print_to_file != system_lyxrc.print_to_file) {
2018 string const path = os::external_path(print_to_file);
2019 os << "\\print_to_file \"" << path << "\"\n";
2023 case RC_PRINTFILEEXTENSION:
2024 if (ignore_system_lyxrc ||
2025 print_file_extension != system_lyxrc.print_file_extension) {
2026 os << "\\print_file_extension \""
2027 << print_file_extension
2034 << "# TEX SECTION #######################################\n"
2037 case RC_FONT_ENCODING:
2038 if (ignore_system_lyxrc ||
2039 fontenc != system_lyxrc.fontenc) {
2040 os << "\\font_encoding \"" << fontenc << "\"\n";
2046 << "# FILE SECTION ######################################\n"
2049 case RC_DOCUMENTPATH:
2050 if (ignore_system_lyxrc ||
2051 document_path != system_lyxrc.document_path) {
2052 string const path = os::external_path(document_path);
2053 os << "\\document_path \"" << path << "\"\n";
2057 case RC_USELASTFILEPOS:
2058 if (ignore_system_lyxrc ||
2059 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2060 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2065 case RC_LOADSESSION:
2066 if (ignore_system_lyxrc ||
2067 load_session != system_lyxrc.load_session) {
2068 os << "\\load_session " << convert<string>(load_session)
2073 case RC_MOUSE_WHEEL_SPEED:
2074 if (ignore_system_lyxrc ||
2075 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2076 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2080 case RC_COMPLETION_INLINE_DELAY:
2081 if (ignore_system_lyxrc ||
2082 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2083 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2087 case RC_COMPLETION_INLINE_MATH:
2088 if (ignore_system_lyxrc ||
2089 completion_inline_math != system_lyxrc.completion_inline_math) {
2090 os << "\\completion_inline_math "
2091 << convert<string>(completion_inline_math) << '\n';
2095 case RC_COMPLETION_INLINE_TEXT:
2096 if (ignore_system_lyxrc ||
2097 completion_inline_text != system_lyxrc.completion_inline_text) {
2098 os << "\\completion_inline_text "
2099 << convert<string>(completion_inline_text) << '\n';
2103 case RC_COMPLETION_INLINE_DOTS:
2104 if (ignore_system_lyxrc ||
2105 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2106 os << "\\completion_inline_dots "
2107 << convert<string>(completion_inline_dots) << '\n';
2111 case RC_AUTOCORRECTION_MATH:
2112 if (ignore_system_lyxrc ||
2113 autocorrection_math != system_lyxrc.autocorrection_math) {
2114 os << "\\autocorrection_math "
2115 << convert<string>(autocorrection_math) << '\n';
2119 case RC_COMPLETION_POPUP_DELAY:
2120 if (ignore_system_lyxrc ||
2121 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2122 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2126 case RC_COMPLETION_POPUP_MATH:
2127 if (ignore_system_lyxrc ||
2128 completion_popup_math != system_lyxrc.completion_popup_math) {
2129 os << "\\completion_popup_math "
2130 << convert<string>(completion_popup_math) << '\n';
2134 case RC_COMPLETION_POPUP_TEXT:
2135 if (ignore_system_lyxrc ||
2136 completion_popup_text != system_lyxrc.completion_popup_text) {
2137 os << "\\completion_popup_text "
2138 << convert<string>(completion_popup_text) << '\n';
2142 case RC_COMPLETION_CURSOR_TEXT:
2143 if (ignore_system_lyxrc ||
2144 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2145 os << "\\completion_cursor_text "
2146 << convert<string>(completion_cursor_text) << '\n';
2150 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2151 if (ignore_system_lyxrc ||
2152 completion_popup_after_complete
2153 != system_lyxrc.completion_popup_after_complete) {
2154 os << "\\completion_popup_after_complete "
2155 << convert<string>(completion_popup_after_complete) << '\n';
2159 case RC_NUMLASTFILES:
2160 if (ignore_system_lyxrc ||
2161 num_lastfiles != system_lyxrc.num_lastfiles) {
2162 os << "\\num_lastfiles " << num_lastfiles << '\n';
2166 case RC_CHECKLASTFILES:
2167 if (ignore_system_lyxrc ||
2168 check_lastfiles != system_lyxrc.check_lastfiles) {
2169 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2174 case RC_EXAMPLEPATH:
2175 if (ignore_system_lyxrc ||
2176 example_path != system_lyxrc.example_path) {
2177 string const path = os::external_path(example_path);
2178 os << "\\example_path \"" << path << "\"\n";
2182 case RC_TEMPLATEPATH:
2183 if (ignore_system_lyxrc ||
2184 template_path != system_lyxrc.template_path) {
2185 string const path = os::external_path(template_path);
2186 os << "\\template_path \"" << path << "\"\n";
2190 case RC_TEMPDIRPATH:
2191 if (ignore_system_lyxrc ||
2192 tempdir_path != system_lyxrc.tempdir_path) {
2193 string const path = os::external_path(tempdir_path);
2194 os << "\\tempdir_path \"" << path << "\"\n";
2198 case RC_THESAURUSDIRPATH:
2199 if (ignore_system_lyxrc ||
2200 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2201 string const path = os::external_path(thesaurusdir_path);
2202 os << "\\thesaurusdir_path \"" << path << "\"\n";
2206 case RC_HUNSPELLDIR_PATH:
2207 if (ignore_system_lyxrc ||
2208 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2209 string const path = os::external_path(hunspelldir_path);
2210 os << "\\hunspelldir_path \"" << path << "\"\n";
2218 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2221 case RC_PLAINTEXT_LINELEN:
2222 if (ignore_system_lyxrc ||
2223 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2224 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2228 case RC_MAKE_BACKUP:
2229 if (ignore_system_lyxrc ||
2230 make_backup != system_lyxrc.make_backup) {
2231 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2235 case RC_BACKUPDIR_PATH:
2236 if (ignore_system_lyxrc ||
2237 backupdir_path != system_lyxrc.backupdir_path) {
2238 string const path = os::external_path(backupdir_path);
2239 os << "\\backupdir_path \"" << path << "\"\n";
2245 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2249 << "# SPELLCHECKER SECTION ##############################\n"
2252 case RC_SPELL_COMMAND:
2253 case RC_USE_SPELL_LIB:
2257 case RC_ACCEPT_COMPOUND:
2258 if (ignore_system_lyxrc ||
2259 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2260 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2265 case RC_USE_ALT_LANG:
2270 if (ignore_system_lyxrc ||
2271 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2272 os << "\\alternate_language \"" << spellchecker_alt_lang
2277 case RC_USE_ESC_CHARS:
2281 if (ignore_system_lyxrc ||
2282 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2283 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2287 case RC_USE_PERS_DICT:
2291 case RC_USE_TOOLTIP:
2292 if (ignore_system_lyxrc ||
2293 use_tooltip != system_lyxrc.use_tooltip) {
2294 os << "\\use_tooltip "
2295 << convert<string>(use_tooltip)
2300 case RC_USE_PIXMAP_CACHE:
2301 if (ignore_system_lyxrc ||
2302 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2303 os << "\\use_pixmap_cache "
2304 << convert<string>(use_pixmap_cache)
2313 case RC_USE_INP_ENC:
2319 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2324 case RC_SPELLCHECKER:
2325 if (ignore_system_lyxrc ||
2326 spellchecker != system_lyxrc.spellchecker) {
2327 os << "\\spellchecker " << spellchecker << '\n';
2332 case RC_SPELLCHECK_CONTINUOUSLY:
2333 if (ignore_system_lyxrc ||
2334 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2335 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2341 case RC_SPELLCHECK_NOTES:
2342 if (ignore_system_lyxrc ||
2343 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2344 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2350 case RC_RTL_SUPPORT:
2351 if (ignore_system_lyxrc ||
2352 rtl_support != system_lyxrc.rtl_support) {
2353 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2357 case RC_VISUAL_CURSOR:
2358 if (ignore_system_lyxrc ||
2359 visual_cursor != system_lyxrc.visual_cursor) {
2360 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2364 case RC_LANGUAGE_PACKAGE:
2365 if (ignore_system_lyxrc ||
2366 language_package != system_lyxrc.language_package) {
2367 os << "\\language_package \"" << language_package
2372 case RC_LANGUAGE_GLOBAL_OPTIONS:
2373 if (ignore_system_lyxrc ||
2374 language_global_options
2375 != system_lyxrc.language_global_options) {
2376 os << "\\language_global_options \""
2377 << convert<string>(language_global_options)
2382 case RC_LANGUAGE_USE_BABEL:
2383 if (ignore_system_lyxrc ||
2384 language_use_babel != system_lyxrc.language_use_babel) {
2385 os << "\\language_use_babel \""
2386 << convert<string>(language_use_babel)
2391 case RC_LANGUAGE_COMMAND_BEGIN:
2392 if (ignore_system_lyxrc ||
2393 language_command_begin
2394 != system_lyxrc.language_command_begin) {
2395 os << "\\language_command_begin \""
2396 << language_command_begin
2401 case RC_LANGUAGE_COMMAND_END:
2402 if (ignore_system_lyxrc ||
2403 language_command_end
2404 != system_lyxrc.language_command_end) {
2405 os << "\\language_command_end \"" << language_command_end
2410 case RC_LANGUAGE_COMMAND_LOCAL:
2411 if (ignore_system_lyxrc ||
2412 language_command_local
2413 != system_lyxrc.language_command_local) {
2414 os << "\\language_command_local \""
2415 << language_command_local
2420 case RC_LANGUAGE_AUTO_BEGIN:
2421 if (ignore_system_lyxrc ||
2422 language_auto_begin != system_lyxrc.language_auto_begin) {
2423 os << "\\language_auto_begin "
2424 << convert<string>(language_auto_begin) << '\n';
2428 case RC_LANGUAGE_AUTO_END:
2429 if (ignore_system_lyxrc ||
2430 language_auto_end != system_lyxrc.language_auto_end) {
2431 os << "\\language_auto_end "
2432 << convert<string>(language_auto_end) << '\n';
2436 case RC_MARK_FOREIGN_LANGUAGE:
2437 if (ignore_system_lyxrc ||
2438 mark_foreign_language
2439 != system_lyxrc.mark_foreign_language) {
2440 os << "\\mark_foreign_language " <<
2441 convert<string>(mark_foreign_language) << '\n';
2447 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2450 case RC_AUTO_NUMBER:
2451 if (ignore_system_lyxrc ||
2452 auto_number != system_lyxrc.auto_number) {
2453 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2457 case RC_DEFAULT_LANGUAGE:
2458 if (ignore_system_lyxrc ||
2459 default_language != system_lyxrc.default_language) {
2460 os << "\\default_language " << default_language << '\n';
2464 case RC_GUI_LANGUAGE:
2465 if (ignore_system_lyxrc ||
2466 gui_language != system_lyxrc.gui_language) {
2467 os << "\\gui_language " << gui_language << '\n';
2473 << "# FORMATS SECTION ##########################\n"
2477 // New/modified formats
2478 for (Formats::const_iterator cit = formats.begin();
2479 cit != formats.end(); ++cit) {
2480 Format const * format =
2481 system_formats.getFormat(cit->name());
2483 format->extension() != cit->extension() ||
2484 format->prettyname() != cit->prettyname() ||
2485 format->shortcut() != cit->shortcut() ||
2486 format->viewer() != cit->viewer() ||
2487 format->editor() != cit->editor() ||
2488 format->documentFormat() != cit->documentFormat() ||
2489 format->vectorFormat() != cit->vectorFormat()) {
2490 os << "\\format \"" << cit->name() << "\" \""
2491 << cit->extension() << "\" \""
2492 << cit->prettyname() << "\" \""
2493 << cit->shortcut() << "\" \""
2494 << escapeCommand(cit->viewer()) << "\" \""
2495 << escapeCommand(cit->editor()) << "\" \"";
2496 vector<string> flags;
2497 if (cit->documentFormat())
2498 flags.push_back("document");
2499 if (cit->vectorFormat())
2500 flags.push_back("vector");
2501 os << getStringFromVector(flags);
2506 // Look for deleted formats
2507 for (Formats::const_iterator cit = system_formats.begin();
2508 cit != system_formats.end(); ++cit)
2509 if (!formats.getFormat(cit->name()))
2510 os << "\\format \"" << cit->name()
2511 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2514 case RC_VIEWER_ALTERNATIVES: {
2515 Alternatives::const_iterator it = viewer_alternatives.begin();
2516 Alternatives::const_iterator const en = viewer_alternatives.end();
2517 Alternatives::const_iterator const sysend =
2518 system_lyxrc.viewer_alternatives.end();
2519 for (; it != en; ++it) {
2520 string const & fmt = it->first;
2521 CommandSet const & cmd = it->second;
2522 CommandSet::const_iterator sit = cmd.begin();
2523 CommandSet::const_iterator const sen = cmd.end();
2524 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2525 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2526 system_lyxrc.viewer_alternatives.find(fmt);
2527 for (; sit != sen; ++sit) {
2528 string const & cmd = *sit;
2529 if (ignore_system_lyxrc
2530 || sysfmt == sysend // format not found
2531 || sysfmt->second.count(cmd) == 0 // this command not found
2533 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2539 case RC_EDITOR_ALTERNATIVES: {
2540 Alternatives::const_iterator it = editor_alternatives.begin();
2541 Alternatives::const_iterator const en = editor_alternatives.end();
2542 Alternatives::const_iterator const sysend =
2543 system_lyxrc.editor_alternatives.end();
2544 for (; it != en; ++it) {
2545 string const & fmt = it->first;
2546 CommandSet const & cmd = it->second;
2547 CommandSet::const_iterator sit = cmd.begin();
2548 CommandSet::const_iterator const sen = cmd.end();
2549 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2550 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2551 system_lyxrc.editor_alternatives.find(fmt);
2552 for (; sit != sen; ++sit) {
2553 string const & cmd = *sit;
2554 if (ignore_system_lyxrc
2555 || sysfmt == sysend // format not found
2556 || sysfmt->second.count(cmd) == 0 // this command not found
2558 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2564 case RC_DEFAULT_VIEW_FORMAT:
2565 if (ignore_system_lyxrc ||
2566 default_view_format != system_lyxrc.default_view_format) {
2567 os << "\\default_view_format " << default_view_format << '\n';
2577 << "# CONVERTERS SECTION ##########################\n"
2581 // Look for new converters
2582 for (Converters::const_iterator cit = theConverters().begin();
2583 cit != theConverters().end(); ++cit) {
2584 Converter const * converter =
2585 theSystemConverters().getConverter(cit->from,
2588 converter->command != cit->command ||
2589 converter->flags != cit->flags)
2590 os << "\\converter \"" << cit->from << "\" \""
2591 << cit->to << "\" \""
2592 << escapeCommand(cit->command) << "\" \""
2593 << cit->flags << "\"\n";
2596 // New/modifed converters
2597 for (Converters::const_iterator cit = theSystemConverters().begin();
2598 cit != theSystemConverters().end(); ++cit)
2599 if (!theConverters().getConverter(cit->from, cit->to))
2600 os << "\\converter \"" << cit->from
2601 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2608 << "# COPIERS SECTION ##########################\n"
2611 // Look for new movers
2612 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2613 Movers::const_iterator const sysend = theSystemMovers().end();
2614 Movers::const_iterator it = theMovers().begin();
2615 Movers::const_iterator end = theMovers().end();
2617 for (; it != end; ++it) {
2618 Movers::const_iterator const sysit =
2619 find_if(sysbegin, sysend, SameMover(*it));
2620 if (sysit == sysend) {
2621 string const & fmt = it->first;
2622 string const & command =
2623 it->second.command();
2625 os << "\\copier " << fmt
2626 << " \"" << escapeCommand(command) << "\"\n";
2632 // We don't actually delete SpecialisedMover(s) from the
2633 // map, just clear their 'command', so there's no need
2634 // to test for anything else.
2641 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2643 // Why the switch you might ask. It is a trick to ensure that all
2644 // the elements in the LyXRCTags enum is handled. As you can see
2645 // there are no breaks at all. So it is just a huge fall-through.
2646 // The nice thing is that we will get a warning from the compiler
2647 // if we forget an element.
2648 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2650 case LyXRC::RC_ACCEPT_COMPOUND:
2651 case LyXRC::RC_ALT_LANG:
2652 case LyXRC::RC_PLAINTEXT_LINELEN:
2653 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2654 case LyXRC::RC_AUTOCORRECTION_MATH:
2655 case LyXRC::RC_AUTOREGIONDELETE:
2656 case LyXRC::RC_AUTORESET_OPTIONS:
2657 case LyXRC::RC_AUTOSAVE:
2658 case LyXRC::RC_AUTO_NUMBER:
2659 case LyXRC::RC_BACKUPDIR_PATH:
2660 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2661 case LyXRC::RC_BIBTEX_COMMAND:
2662 case LyXRC::RC_BINDFILE:
2663 case LyXRC::RC_CHECKLASTFILES:
2664 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2665 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2666 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2667 case LyXRC::RC_COMPLETION_INLINE_MATH:
2668 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2669 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2670 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2671 case LyXRC::RC_COMPLETION_POPUP_MATH:
2672 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2673 case LyXRC::RC_USELASTFILEPOS:
2674 case LyXRC::RC_LOADSESSION:
2675 case LyXRC::RC_CHKTEX_COMMAND:
2676 case LyXRC::RC_CONVERTER:
2677 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2678 case LyXRC::RC_COPIER:
2679 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2680 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2681 case LyXRC::RC_DATE_INSERT_FORMAT:
2682 case LyXRC::RC_DEFAULT_LANGUAGE:
2683 case LyXRC::RC_GUI_LANGUAGE:
2684 case LyXRC::RC_DEFAULT_PAPERSIZE:
2685 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2686 case LyXRC::RC_DEFFILE:
2687 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2688 case LyXRC::RC_DISPLAY_GRAPHICS:
2689 case LyXRC::RC_DOCUMENTPATH:
2690 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2691 FileName path(lyxrc_new.document_path);
2692 if (path.exists() && path.isDirectory())
2693 package().document_dir() = FileName(lyxrc.document_path);
2695 case LyXRC::RC_EDITOR_ALTERNATIVES:
2696 case LyXRC::RC_ESC_CHARS:
2697 case LyXRC::RC_EXAMPLEPATH:
2698 case LyXRC::RC_FONT_ENCODING:
2699 case LyXRC::RC_FORMAT:
2700 case LyXRC::RC_GROUP_LAYOUTS:
2701 case LyXRC::RC_HUNSPELLDIR_PATH:
2702 case LyXRC::RC_INDEX_ALTERNATIVES:
2703 case LyXRC::RC_INDEX_COMMAND:
2704 case LyXRC::RC_JBIBTEX_COMMAND:
2705 case LyXRC::RC_JINDEX_COMMAND:
2706 case LyXRC::RC_NOMENCL_COMMAND:
2707 case LyXRC::RC_INPUT:
2708 case LyXRC::RC_KBMAP:
2709 case LyXRC::RC_KBMAP_PRIMARY:
2710 case LyXRC::RC_KBMAP_SECONDARY:
2711 case LyXRC::RC_LABEL_INIT_LENGTH:
2712 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2713 case LyXRC::RC_LANGUAGE_AUTO_END:
2714 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2715 case LyXRC::RC_LANGUAGE_COMMAND_END:
2716 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2717 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2718 case LyXRC::RC_LANGUAGE_PACKAGE:
2719 case LyXRC::RC_LANGUAGE_USE_BABEL:
2720 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2721 case LyXRC::RC_MACRO_EDIT_STYLE:
2722 case LyXRC::RC_MAKE_BACKUP:
2723 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2724 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2725 case LyXRC::RC_NUMLASTFILES:
2726 case LyXRC::RC_PARAGRAPH_MARKERS:
2727 case LyXRC::RC_PATH_PREFIX:
2728 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2729 prependEnvPath("PATH", lyxrc.path_prefix);
2731 case LyXRC::RC_PERS_DICT:
2732 case LyXRC::RC_PREVIEW:
2733 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2734 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2735 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2736 case LyXRC::RC_PRINTCOPIESFLAG:
2737 case LyXRC::RC_PRINTER:
2738 case LyXRC::RC_PRINTEVENPAGEFLAG:
2739 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2740 case LyXRC::RC_PRINTFILEEXTENSION:
2741 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2742 case LyXRC::RC_PRINTODDPAGEFLAG:
2743 case LyXRC::RC_PRINTPAGERANGEFLAG:
2744 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2745 case LyXRC::RC_PRINTPAPERFLAG:
2746 case LyXRC::RC_PRINTREVERSEFLAG:
2747 case LyXRC::RC_PRINTSPOOL_COMMAND:
2748 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2749 case LyXRC::RC_PRINTTOFILE:
2750 case LyXRC::RC_PRINTTOPRINTER:
2751 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2752 case LyXRC::RC_PRINT_COMMAND:
2753 case LyXRC::RC_RTL_SUPPORT:
2754 case LyXRC::RC_SCREEN_DPI:
2755 case LyXRC::RC_SCREEN_FONT_ROMAN:
2756 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2757 case LyXRC::RC_SCREEN_FONT_SANS:
2758 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2759 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2760 case LyXRC::RC_SCREEN_FONT_SIZES:
2761 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2762 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2763 case LyXRC::RC_GEOMETRY_SESSION:
2764 case LyXRC::RC_SCREEN_ZOOM:
2765 case LyXRC::RC_SERVERPIPE:
2766 case LyXRC::RC_SET_COLOR:
2767 case LyXRC::RC_SHOW_BANNER:
2768 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2769 case LyXRC::RC_SPELL_COMMAND:
2770 case LyXRC::RC_SPELLCHECKER:
2771 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2772 case LyXRC::RC_SPELLCHECK_NOTES:
2773 case LyXRC::RC_SPLITINDEX_COMMAND:
2774 case LyXRC::RC_TEMPDIRPATH:
2775 case LyXRC::RC_TEMPLATEPATH:
2776 case LyXRC::RC_TEX_ALLOWS_SPACES:
2777 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2778 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2779 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2781 case LyXRC::RC_THESAURUSDIRPATH:
2782 case LyXRC::RC_UIFILE:
2783 case LyXRC::RC_USER_EMAIL:
2784 case LyXRC::RC_USER_NAME:
2785 case LyXRC::RC_USETEMPDIR:
2786 case LyXRC::RC_USE_ALT_LANG:
2787 case LyXRC::RC_USE_CONVERTER_CACHE:
2788 case LyXRC::RC_USE_ESC_CHARS:
2789 case LyXRC::RC_USE_INP_ENC:
2790 case LyXRC::RC_USE_PERS_DICT:
2791 case LyXRC::RC_USE_TOOLTIP:
2792 case LyXRC::RC_USE_PIXMAP_CACHE:
2793 case LyXRC::RC_USE_SPELL_LIB:
2794 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2795 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2796 case LyXRC::RC_SORT_LAYOUTS:
2797 case LyXRC::RC_FULL_SCREEN_LIMIT:
2798 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2799 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2800 case LyXRC::RC_FULL_SCREEN_TABBAR:
2801 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2802 case LyXRC::RC_FULL_SCREEN_WIDTH:
2803 case LyXRC::RC_VISUAL_CURSOR:
2804 case LyXRC::RC_VIEWER:
2805 case LyXRC::RC_VIEWER_ALTERNATIVES:
2806 case LyXRC::RC_LAST:
2813 string const LyXRC::getDescription(LyXRCTags tag)
2818 case RC_ACCEPT_COMPOUND:
2819 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2823 case RC_USE_ALT_LANG:
2824 str = _("Specify an alternate language. The default is to use the language of the document.");
2827 case RC_PLAINTEXT_ROFF_COMMAND:
2828 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.");
2831 case RC_PLAINTEXT_LINELEN:
2832 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.");
2835 case RC_AUTOREGIONDELETE:
2836 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2839 case RC_AUTORESET_OPTIONS:
2840 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2844 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2847 case RC_AUTO_NUMBER:
2850 case RC_BACKUPDIR_PATH:
2851 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.");
2854 case RC_BIBTEX_COMMAND:
2855 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2858 case RC_JBIBTEX_COMMAND:
2859 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2863 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2866 case RC_CHECKLASTFILES:
2867 str = _("Select to check whether the lastfiles still exist.");
2870 case RC_CHKTEX_COMMAND:
2871 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2880 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2881 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.");
2884 case RC_SCROLL_BELOW_DOCUMENT:
2885 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");
2888 case RC_MAC_LIKE_WORD_MOVEMENT:
2889 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2892 case RC_SHOW_MACRO_LABEL:
2893 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2896 case RC_DATE_INSERT_FORMAT:
2897 //xgettext:no-c-format
2898 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2902 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2905 case RC_DEFAULT_VIEW_FORMAT:
2906 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2909 case RC_DEFAULT_LANGUAGE:
2910 str = _("New documents will be assigned this language.");
2913 case RC_DEFAULT_PAPERSIZE:
2914 str = _("Specify the default paper size.");
2917 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2918 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2921 case RC_DISPLAY_GRAPHICS:
2922 str = _("Select how LyX will display any graphics.");
2925 case RC_DOCUMENTPATH:
2926 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2930 case RC_USE_ESC_CHARS:
2931 str = _("Specify additional chars that can be part of a word.");
2934 case RC_EXAMPLEPATH:
2935 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2938 case RC_FONT_ENCODING:
2939 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2945 case RC_INDEX_COMMAND:
2946 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\".");
2949 case RC_JINDEX_COMMAND:
2950 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2953 case RC_NOMENCL_COMMAND:
2954 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2961 case RC_KBMAP_PRIMARY:
2962 case RC_KBMAP_SECONDARY:
2963 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.");
2966 case RC_LABEL_INIT_LENGTH:
2967 str = _("Maximum number of words in the initialization string for a new label");
2970 case RC_LANGUAGE_AUTO_BEGIN:
2971 str = _("Select if a language switching command is needed at the beginning of the document.");
2974 case RC_LANGUAGE_AUTO_END:
2975 str = _("Select if a language switching command is needed at the end of the document.");
2978 case RC_LANGUAGE_COMMAND_BEGIN:
2979 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.");
2982 case RC_LANGUAGE_COMMAND_END:
2983 str = _("The LaTeX command for changing back to the language of the document.");
2986 case RC_LANGUAGE_COMMAND_LOCAL:
2987 str = _("The LaTeX command for local changing of the language.");
2990 case RC_LANGUAGE_GLOBAL_OPTIONS:
2991 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2994 case RC_LANGUAGE_PACKAGE:
2995 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2998 case RC_LANGUAGE_USE_BABEL:
2999 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3002 case RC_USELASTFILEPOS:
3003 str = _("De-select if you do not want LyX to scroll to saved position.");
3006 case RC_LOADSESSION:
3007 str = _("De-select to prevent loading files opened from the last LyX session.");
3010 case RC_MAKE_BACKUP:
3011 str = _("De-select if you don't want LyX to create backup files.");
3014 case RC_MARK_FOREIGN_LANGUAGE:
3015 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3018 case RC_MOUSE_WHEEL_SPEED:
3019 str = bformat(_("The scrolling speed of the mouse wheel."),
3023 case RC_COMPLETION_POPUP_DELAY:
3024 str = _("The completion popup delay.");
3027 case RC_COMPLETION_POPUP_MATH:
3028 str = _("Select to display the completion popup in math mode.");
3031 case RC_COMPLETION_POPUP_TEXT:
3032 str = _("Select to display the completion popup in text mode.");
3035 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3036 str = _("Show the completion popup without delay after non-unique completion attempt.");
3039 case RC_COMPLETION_POPUP_TEXT:
3040 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3043 case RC_COMPLETION_POPUP_DELAY:
3044 str = _("The inline completion delay.");
3047 case RC_COMPLETION_INLINE_MATH:
3048 str = _("Select to display the inline completion in math mode.");
3051 case RC_COMPLETION_INLINE_TEXT:
3052 str = _("Select to display the inline completion in text mode.");
3055 case RC_COMPLETION_INLINE_DOTS:
3056 str = _("Use \"...\" to shorten long completions.");
3059 case RC_AUTOCORRECTION_MATH:
3060 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3063 case RC_NUMLASTFILES:
3064 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3068 case RC_PATH_PREFIX:
3069 str = _("Specify those directories which should be "
3070 "prepended to the PATH environment variable. "
3071 "Use the OS native format.");
3075 str = _("Shows a typeset preview of things such as math");
3078 case RC_PREVIEW_HASHED_LABELS:
3079 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3082 case RC_PREVIEW_SCALE_FACTOR:
3083 str = _("Scale the preview size to suit.");
3086 case RC_PRINTCOLLCOPIESFLAG:
3087 str = _("The option for specifying whether the copies should be collated.");
3090 case RC_PRINTCOPIESFLAG:
3091 str = _("The option for specifying the number of copies to print.");
3095 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3098 case RC_PRINTEVENPAGEFLAG:
3099 str = _("The option to print only even pages.");
3102 case RC_PRINTEXSTRAOPTIONS:
3103 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3106 case RC_PRINTFILEEXTENSION:
3107 str = _("Extension of printer program output file. Usually \".ps\".");
3110 case RC_PRINTLANDSCAPEFLAG:
3111 str = _("The option to print out in landscape.");
3114 case RC_PRINTODDPAGEFLAG:
3115 str = _("The option to print only odd pages.");
3118 case RC_PRINTPAGERANGEFLAG:
3119 str = _("The option for specifying a comma-separated list of pages to print.");
3122 case RC_PRINTPAPERDIMENSIONFLAG:
3123 str = _("Option to specify the dimensions of the print paper.");
3126 case RC_PRINTPAPERFLAG:
3127 str = _("The option to specify paper type.");
3130 case RC_PRINTREVERSEFLAG:
3131 str = _("The option to reverse the order of the pages printed.");
3134 case RC_PRINTSPOOL_COMMAND:
3135 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.");
3138 case RC_PRINTSPOOL_PRINTERPREFIX:
3139 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.");
3142 case RC_PRINTTOFILE:
3143 str = _("Option to pass to the print program to print to a file.");
3146 case RC_PRINTTOPRINTER:
3147 str = _("Option to pass to the print program to print on a specific printer.");
3150 case RC_PRINT_ADAPTOUTPUT:
3151 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3154 case RC_PRINT_COMMAND:
3155 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3158 case RC_RTL_SUPPORT:
3159 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3162 case RC_VISUAL_CURSOR:
3163 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3167 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3170 case RC_SCREEN_FONT_ROMAN:
3171 case RC_SCREEN_FONT_SANS:
3172 case RC_SCREEN_FONT_TYPEWRITER:
3173 str = _("The screen fonts used to display the text while editing.");
3176 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3177 case RC_SCREEN_FONT_SANS_FOUNDRY:
3178 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3181 case RC_SCREEN_FONT_SCALABLE:
3182 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.");
3185 case RC_SCREEN_FONT_SIZES:
3186 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3189 case RC_SCREEN_ZOOM:
3190 //xgettext:no-c-format
3191 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3194 case RC_GEOMETRY_SESSION:
3195 str = _("Allow session manager to save and restore windows geometry.");
3199 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3205 case RC_SHOW_BANNER:
3206 str = _("De-select if you don't want the startup banner.");
3209 case RC_TEMPDIRPATH:
3210 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3213 case RC_THESAURUSDIRPATH:
3214 str = _("This is the place where the files of the thesaurus library reside.");
3217 case RC_TEMPLATEPATH:
3218 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3221 case RC_TEX_ALLOWS_SPACES:
3224 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3228 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3240 case RC_USE_TOOLTIP:
3241 str = _("Enable the automatic appearance of tool tips in the work area.");
3244 case RC_USE_PIXMAP_CACHE:
3245 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3248 case RC_USE_SPELL_LIB:
3251 case RC_VIEWDVI_PAPEROPTION:
3252 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3267 // The global instance
3270 // The global copy of the system lyxrc entries (everything except preferences)