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 { "\\forward_search", LyXRC::RC_FORWARD_SEARCH },
98 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
99 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
100 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
101 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
102 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
103 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
104 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
105 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
106 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
107 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
108 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
109 { "\\input", LyXRC::RC_INPUT },
110 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
111 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
112 { "\\kbmap", LyXRC::RC_KBMAP },
113 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
114 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
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 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
160 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
161 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
162 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
163 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
164 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
165 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
166 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
167 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
168 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
169 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
170 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
171 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
172 { "\\set_color", LyXRC::RC_SET_COLOR },
173 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
174 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
175 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
176 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
177 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
178 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
179 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
180 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
181 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
182 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
183 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
184 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
185 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
186 { "\\ui_file", LyXRC::RC_UIFILE },
187 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
188 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
189 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
190 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
191 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
192 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
193 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
194 // compatibility with versions older than 1.4.0 only
195 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
196 // compatibility with versions older than 1.4.0 only
197 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
198 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
199 { "\\user_email", LyXRC::RC_USER_EMAIL },
200 { "\\user_name", LyXRC::RC_USER_NAME },
201 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
202 // compatibility with versions older than 1.4.0 only
203 { "\\viewer", LyXRC::RC_VIEWER},
204 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
205 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
208 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
219 void LyXRC::setDefaults()
222 def_file = "default";
224 // Get printer from the environment. If fail, use default "",
225 // assuming that everything is set up correctly.
226 printer = getEnv("PRINTER");
227 print_adapt_output = false;
228 print_command = "dvips";
229 print_evenpage_flag = "-B";
230 print_oddpage_flag = "-A";
231 print_pagerange_flag = "-pp";
232 print_copies_flag = "-c";
233 print_collcopies_flag = "-C";
234 print_reverse_flag = "-r";
235 print_landscape_flag = "-t landscape";
236 print_to_printer = "-P";
237 print_to_file = "-o ";
238 print_file_extension = ".ps";
239 print_paper_flag = "-t";
240 print_paper_dimension_flag = "-T";
241 document_path.erase();
242 view_dvi_paper_option.erase();
243 default_papersize = PAPER_DEFAULT;
244 default_view_format = "pdf2";
245 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
246 bibtex_command = "bibtex";
248 index_command = "makeindex -c -q";
249 nomencl_command = "makeindex -s nomencl.ist";
251 // Because a screen is typically wider than a piece of paper:
253 allow_geometry_session = true;
254 // Default LaTeX font size:
255 font_sizes[FONT_SIZE_TINY] = "5.0";
256 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
257 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
258 font_sizes[FONT_SIZE_SMALL] = "9.0";
259 font_sizes[FONT_SIZE_NORMAL] = "10.0";
260 font_sizes[FONT_SIZE_LARGE] = "12.0";
261 font_sizes[FONT_SIZE_LARGER] = "14.4";
262 font_sizes[FONT_SIZE_LARGEST] = "17.26";
263 font_sizes[FONT_SIZE_HUGE] = "20.74";
264 font_sizes[FONT_SIZE_HUGER] = "24.88";
265 use_scalable_fonts = true;
266 roman_font_name = "";
268 typewriter_font_name = "";
270 auto_region_delete = true;
271 auto_reset_options = false;
272 plaintext_linelen = 65;
273 mouse_wheel_speed = 1.0;
274 num_lastfiles = maxlastfiles;
275 check_lastfiles = true;
276 use_lastfilepos = true;
277 load_session = false;
279 save_compressed = false;
280 backupdir_path.erase();
281 display_graphics = true;
282 // Spellchecker settings:
283 #if defined(USE_ASPELL)
284 spellchecker = "aspell";
285 #elif defined(USE_HUNSPELL)
286 spellchecker = "hunspell";
288 spellchecker = "aspell";
290 spellchecker_accept_compound = false;
291 spellcheck_continuously = false;
292 spellcheck_notes = true;
295 visual_cursor = false;
297 mark_foreign_language = true;
298 language_auto_begin = true;
299 language_auto_end = true;
300 language_global_options = true;
301 language_use_babel = true;
302 language_package = "\\usepackage{babel}";
303 language_command_begin = "\\selectlanguage{$$lang}";
304 language_command_local = "\\foreignlanguage{$$lang}{";
305 sort_layouts = false;
306 group_layouts = true;
307 default_language = "english";
308 gui_language = "auto";
310 windows_style_tex_paths = false;
311 tex_allows_spaces = false;
312 date_insert_format = "%x";
313 cursor_follows_scrollbar = false;
314 scroll_below_document = false;
315 paragraph_markers = false;
316 mac_like_word_movement = false;
317 macro_edit_style = MACRO_EDIT_INLINE_BOX;
318 dialogs_iconify_with_main = false;
319 preview = PREVIEW_OFF;
320 preview_hashed_labels = false;
321 preview_scale_factor = 1.0;
322 use_converter_cache = true;
324 use_pixmap_cache = false;
325 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
326 user_name = to_utf8(support::user_name());
327 user_email = to_utf8(support::user_email());
328 open_buffers_in_tabs = true;
329 single_close_tab_button = false;
330 forward_search = "xdvi -sourceposition $$n:$$t $$o";
332 // Fullscreen settings
333 full_screen_limit = false;
334 full_screen_toolbars = true;
335 full_screen_tabbar = true;
336 full_screen_menubar = true;
337 full_screen_scrollbar = true;
338 full_screen_width = 700;
340 completion_cursor_text = true;
341 completion_popup_math = true;
342 completion_popup_text = false;
343 completion_popup_delay = 2.0;
344 completion_popup_after_complete = true;
345 autocorrection_math = false;
346 completion_inline_math = true;
347 completion_inline_text = false;
348 completion_inline_dots = -1;
349 completion_inline_delay = 0.2;
355 void oldFontFormat(string & family, string & foundry)
357 if (family.empty() || family[0] != '-')
359 foundry = token(family, '-', 1);
360 family = token(family, '-', 2);
368 int LyXRC::read(FileName const & filename)
370 Lexer lexrc(lyxrcTags);
371 if (lyxerr.debugging(Debug::PARSER))
372 lexrc.printTable(lyxerr);
374 lexrc.setFile(filename);
378 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
384 int LyXRC::read(istream & is)
386 Lexer lexrc(lyxrcTags);
387 if (lyxerr.debugging(Debug::PARSER))
388 lexrc.printTable(lyxerr);
394 LYXERR(Debug::LYXRC, "Reading istream...");
400 int LyXRC::read(Lexer & lexrc)
405 while (lexrc.isOK()) {
406 // By using two switches we take advantage of the compiler
407 // telling us if we have missed a LyXRCTags element in
408 // the second switch.
409 // Note that this also shows a problem with Lexer since it
410 // helps us avoid taking advantage of the strictness of the
413 int le = lexrc.lex();
415 case Lexer::LEX_UNDEF:
416 lexrc.printError("Unknown tag `$$Token'");
418 case Lexer::LEX_FEOF:
423 switch (static_cast<LyXRCTags>(le)) {
424 case RC_INPUT: // Include file
427 libFileSearch(string(),
430 lexrc.printError("Error reading "
431 "included file: " + tmp.absFilename());
437 bind_file = os::internal_path(lexrc.getString());
442 def_file = os::internal_path(lexrc.getString());
447 ui_file = os::internal_path(lexrc.getString());
450 case RC_AUTORESET_OPTIONS:
451 lexrc >> auto_reset_options;
454 case RC_DISPLAY_GRAPHICS:
456 display_graphics = lexrc.getString() == "true";
459 case RC_TEX_EXPECTS_WINDOWS_PATHS:
460 lexrc >> windows_style_tex_paths;
463 case RC_TEX_ALLOWS_SPACES:
464 lexrc >> tex_allows_spaces;
471 case RC_KBMAP_PRIMARY:
473 string const kmap(os::internal_path(lexrc.getString()));
474 if (!libFileSearch("kbd", kmap, "kmap").empty()
476 primary_kbmap = kmap;
478 lexrc.printError("LyX: Keymap `$$Token' not found");
483 case RC_KBMAP_SECONDARY:
485 string const kmap(os::internal_path(lexrc.getString()));
486 if (!libFileSearch("kbd", kmap, "kmap").empty()
488 secondary_kbmap = kmap;
490 lexrc.printError("LyX: Keymap `$$Token' not found");
495 case RC_FONT_ENCODING:
503 case RC_PRINT_COMMAND:
504 if (lexrc.next(true)) {
505 print_command = lexrc.getString();
509 case RC_PRINTEVENPAGEFLAG:
510 lexrc >> print_evenpage_flag;
513 case RC_PRINTODDPAGEFLAG:
514 lexrc >> print_oddpage_flag;
517 case RC_PRINTPAGERANGEFLAG:
518 lexrc >> print_pagerange_flag;
521 case RC_PRINTCOPIESFLAG:
522 lexrc >> print_copies_flag;
525 case RC_PRINTCOLLCOPIESFLAG:
526 lexrc >> print_collcopies_flag;
529 case RC_PRINTREVERSEFLAG:
530 lexrc >> print_reverse_flag;
533 case RC_PRINTLANDSCAPEFLAG:
534 lexrc >> print_landscape_flag;
537 case RC_PRINTTOPRINTER:
538 lexrc >> print_to_printer;
541 case RC_PRINT_ADAPTOUTPUT:
542 lexrc >> print_adapt_output;
547 print_to_file = os::internal_path(lexrc.getString());
551 case RC_PRINTFILEEXTENSION:
552 lexrc >> print_file_extension;
555 case RC_PRINTEXSTRAOPTIONS:
556 lexrc >> print_extra_options;
559 case RC_PRINTSPOOL_COMMAND:
560 if (lexrc.next(true)) {
561 print_spool_command = lexrc.getString();
565 case RC_PRINTSPOOL_PRINTERPREFIX:
566 lexrc >> print_spool_printerprefix;
569 case RC_PRINTPAPERDIMENSIONFLAG:
570 lexrc >> print_paper_dimension_flag;
573 case RC_PRINTPAPERFLAG:
574 lexrc >> print_paper_flag;
577 case RC_DEFAULT_PAPERSIZE:
579 string const size = ascii_lowercase(lexrc.getString());
580 if (size == "usletter")
581 default_papersize = PAPER_USLETTER;
582 else if (size == "legal")
583 default_papersize = PAPER_USLEGAL;
584 else if (size == "executive")
585 default_papersize = PAPER_USEXECUTIVE;
586 else if (size == "a3")
587 default_papersize = PAPER_A3;
588 else if (size == "a4")
589 default_papersize = PAPER_A4;
590 else if (size == "a5")
591 default_papersize = PAPER_A5;
592 else if (size == "b5")
593 default_papersize = PAPER_B5;
594 else if (size == "default")
595 default_papersize = PAPER_DEFAULT;
599 case RC_VIEWDVI_PAPEROPTION:
601 view_dvi_paper_option = lexrc.getString();
603 view_dvi_paper_option.erase();
606 case RC_CHKTEX_COMMAND:
607 if (lexrc.next(true)) {
608 chktex_command = lexrc.getString();
612 case RC_BIBTEX_ALTERNATIVES:
613 if (lexrc.next(true)) {
614 bibtex_alternatives.insert(lexrc.getString());
618 case RC_BIBTEX_COMMAND:
619 if (lexrc.next(true)) {
620 bibtex_command = lexrc.getString();
624 case RC_JBIBTEX_COMMAND:
625 if (lexrc.next(true)) {
626 jbibtex_command = lexrc.getString();
630 case RC_INDEX_ALTERNATIVES:
631 if (lexrc.next(true)) {
632 index_alternatives.insert(lexrc.getString());
636 case RC_INDEX_COMMAND:
637 if (lexrc.next(true)) {
638 index_command = lexrc.getString();
642 case RC_JINDEX_COMMAND:
643 if (lexrc.next(true)) {
644 jindex_command = lexrc.getString();
648 case RC_SPLITINDEX_COMMAND:
649 if (lexrc.next(true)) {
650 splitindex_command = lexrc.getString();
654 case RC_NOMENCL_COMMAND:
655 if (lexrc.next(true)) {
656 nomencl_command = lexrc.getString();
668 case RC_GEOMETRY_SESSION:
669 lexrc >> allow_geometry_session;
672 case RC_SCREEN_FONT_SIZES:
673 lexrc >> font_sizes[FONT_SIZE_TINY];
674 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
675 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
676 lexrc >> font_sizes[FONT_SIZE_SMALL];
677 lexrc >> font_sizes[FONT_SIZE_NORMAL];
678 lexrc >> font_sizes[FONT_SIZE_LARGE];
679 lexrc >> font_sizes[FONT_SIZE_LARGER];
680 lexrc >> font_sizes[FONT_SIZE_LARGEST];
681 lexrc >> font_sizes[FONT_SIZE_HUGE];
682 lexrc >> font_sizes[FONT_SIZE_HUGER];
685 case RC_SCREEN_FONT_SCALABLE:
686 lexrc >> use_scalable_fonts;
693 case RC_DOCUMENTPATH:
695 document_path = os::internal_path(lexrc.getString());
696 document_path = expandPath(document_path);
702 example_path = os::internal_path(lexrc.getString());
703 example_path = expandPath(example_path);
707 case RC_TEMPLATEPATH:
709 template_path = os::internal_path(lexrc.getString());
710 template_path = expandPath(template_path);
716 tempdir_path = os::internal_path(lexrc.getString());
717 tempdir_path = expandPath(tempdir_path);
721 case RC_THESAURUSDIRPATH:
723 thesaurusdir_path = os::internal_path(lexrc.getString());
724 thesaurusdir_path = expandPath(thesaurusdir_path);
728 case RC_HUNSPELLDIR_PATH:
730 hunspelldir_path = os::internal_path(lexrc.getString());
731 hunspelldir_path = expandPath(hunspelldir_path);
735 case RC_USELASTFILEPOS:
736 lexrc >> use_lastfilepos;
740 lexrc >> load_session;
743 case RC_MOUSE_WHEEL_SPEED:
744 lexrc >> mouse_wheel_speed;
747 case RC_COMPLETION_INLINE_DELAY:
748 lexrc >> completion_inline_delay;
751 case RC_COMPLETION_INLINE_MATH:
752 lexrc >> completion_inline_math;
755 case RC_COMPLETION_INLINE_TEXT:
756 lexrc >> completion_inline_text;
759 case RC_COMPLETION_INLINE_DOTS:
760 lexrc >> completion_inline_dots;
763 case RC_AUTOCORRECTION_MATH:
764 lexrc >> autocorrection_math;
767 case RC_COMPLETION_POPUP_DELAY:
768 lexrc >> completion_popup_delay;
771 case RC_COMPLETION_POPUP_MATH:
772 lexrc >> completion_popup_math;
775 case RC_COMPLETION_POPUP_TEXT:
776 lexrc >> completion_popup_text;
779 case RC_COMPLETION_CURSOR_TEXT:
780 lexrc >> completion_cursor_text;
783 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
784 lexrc >> completion_popup_after_complete;
787 case RC_NUMLASTFILES:
788 lexrc >> num_lastfiles;
791 case RC_CHECKLASTFILES:
792 lexrc >> check_lastfiles;
795 case RC_SCREEN_FONT_ROMAN:
797 roman_font_name = lexrc.getString();
798 oldFontFormat(roman_font_name,
803 case RC_SCREEN_FONT_SANS:
805 sans_font_name = lexrc.getString();
806 oldFontFormat(sans_font_name, sans_font_foundry);
810 case RC_SCREEN_FONT_TYPEWRITER:
812 typewriter_font_name = lexrc.getString();
813 oldFontFormat(typewriter_font_name,
814 typewriter_font_foundry);
818 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
819 lexrc >> roman_font_foundry;
822 case RC_SCREEN_FONT_SANS_FOUNDRY:
823 lexrc >> sans_font_foundry;
826 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
827 lexrc >> typewriter_font_foundry;
832 lexrc.printError("Missing color tag.");
835 string lyx_name = lexrc.getString();
838 lexrc.printError("Missing color name for color: `$$Token'");
841 string x11_name = lexrc.getString();
843 ColorCode const col =
844 lcolor.getFromLyXName(lyx_name);
845 if (col == Color_none ||
846 col == Color_inherit ||
850 if (!lcolor.setColor(col, x11_name))
851 LYXERR0("Bad lyxrc set_color for " << lyx_name);
855 case RC_AUTOREGIONDELETE:
856 // Auto region delete defaults to true
857 lexrc >> auto_region_delete;
862 lyxpipes = os::internal_path(lexrc.getString());
863 lyxpipes = expandPath(lyxpipes);
867 case RC_CURSOR_FOLLOWS_SCROLLBAR:
868 lexrc >> cursor_follows_scrollbar;
871 case RC_SCROLL_BELOW_DOCUMENT:
872 lexrc >> scroll_below_document;
875 case RC_PARAGRAPH_MARKERS:
876 lexrc >> paragraph_markers;
879 case RC_MAC_LIKE_WORD_MOVEMENT:
880 lexrc >> mac_like_word_movement;
883 case RC_MACRO_EDIT_STYLE:
885 switch (lexrc.getInteger()) {
886 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
887 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
888 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
893 case RC_DIALOGS_ICONIFY_WITH_MAIN:
894 lexrc >> dialogs_iconify_with_main;
897 case RC_PLAINTEXT_LINELEN:
898 lexrc >> plaintext_linelen;
900 // Spellchecker settings:
901 case RC_ACCEPT_COMPOUND:
902 lexrc >> spellchecker_accept_compound;
905 lexrc >> use_tooltip;
907 case RC_USE_PIXMAP_CACHE:
908 lexrc >> use_pixmap_cache;
910 case RC_SPELLCHECKER:
911 lexrc >> spellchecker;
914 lexrc >> spellchecker_alt_lang;
917 lexrc >> spellchecker_esc_chars;
919 case RC_SPELLCHECK_CONTINUOUSLY:
920 lexrc >> spellcheck_continuously;
922 case RC_SPELLCHECK_NOTES:
923 lexrc >> spellcheck_notes;
926 lexrc >> make_backup;
928 case RC_SAVE_COMPRESSED:
929 lexrc >> save_compressed;
931 case RC_BACKUPDIR_PATH:
933 backupdir_path = os::internal_path(lexrc.getString());
934 backupdir_path = expandPath(backupdir_path);
937 case RC_DATE_INSERT_FORMAT:
938 lexrc >> date_insert_format;
940 case RC_LANGUAGE_PACKAGE:
941 lexrc >> language_package;
943 case RC_LANGUAGE_AUTO_BEGIN:
944 lexrc >> language_auto_begin;
946 case RC_LANGUAGE_AUTO_END:
947 lexrc >> language_auto_end;
949 case RC_LANGUAGE_GLOBAL_OPTIONS:
950 lexrc >> language_global_options;
952 case RC_LANGUAGE_USE_BABEL:
953 lexrc >> language_use_babel;
955 case RC_LANGUAGE_COMMAND_BEGIN:
956 lexrc >> language_command_begin;
958 case RC_LANGUAGE_COMMAND_END:
959 lexrc >> language_command_end;
961 case RC_LANGUAGE_COMMAND_LOCAL:
962 lexrc >> language_command_local;
965 lexrc >> rtl_support;
967 case RC_VISUAL_CURSOR:
968 lexrc >> visual_cursor;
971 lexrc >> auto_number;
973 case RC_MARK_FOREIGN_LANGUAGE:
974 lexrc >> mark_foreign_language;
980 fmt = lexrc.getString();
981 if (lexrc.next(true))
982 command = lexrc.getString();
983 setMover(fmt, command);
988 string from, to, command, flags;
990 from = lexrc.getString();
992 to = lexrc.getString();
993 if (lexrc.next(true))
994 command = lexrc.getString();
996 flags = lexrc.getString();
998 theConverters().erase(from, to);
1000 theConverters().add(from, to, command, flags);
1003 // compatibility with versions older than 1.4.0 only
1005 string format, command;
1006 lexrc >> format >> command;
1007 formats.setViewer(format, command);
1011 string format, extension, prettyname, shortcut;
1012 lexrc >> format >> extension >> prettyname >> shortcut;
1013 string viewer, editor;
1014 if (lexrc.next(true))
1015 viewer = lexrc.getString();
1016 if (lexrc.next(true))
1017 editor = lexrc.getString();
1019 // Hack to ensure compatibility with versions older
1021 int le = lexrc.lex();
1022 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1023 flags = lexrc.getString();
1024 if (le != Lexer::LEX_DATA) {
1025 // We have got a known token.
1026 // Therefore this is an old style
1027 // format definition without
1029 lexrc.pushToken(flags);
1033 int flgs = Format::none;
1034 while (!flags.empty()) {
1036 flags = split(flags, flag, ',');
1037 if (flag == "document")
1038 flgs |= Format::document;
1039 else if (flag == "vector")
1040 flgs |= Format::vector;
1042 LYXERR0("Ignoring unknown flag `"
1043 << flag << "' for format `"
1046 if (prettyname.empty()) {
1047 if (theConverters().formatIsUsed(format))
1048 LYXERR0("Can't delete format " << format);
1050 formats.erase(format);
1052 formats.add(format, extension, prettyname,
1053 shortcut, viewer, editor, flgs);
1057 case RC_VIEWER_ALTERNATIVES: {
1058 string format, command;
1060 format = lexrc.getString();
1061 if (lexrc.eatLine())
1062 command = lexrc.getString();
1063 viewer_alternatives[format].insert(command);
1066 case RC_EDITOR_ALTERNATIVES: {
1067 string format, command;
1068 lexrc >> format >> command;
1069 editor_alternatives[format].insert(command);
1073 case RC_DEFAULT_VIEW_FORMAT:
1074 lexrc >> default_view_format;
1077 case RC_DEFAULT_LANGUAGE:
1078 lexrc >> default_language;
1081 case RC_GUI_LANGUAGE:
1082 lexrc >> gui_language;
1085 case RC_SHOW_BANNER:
1086 lexrc >> show_banner;
1091 string const tmp = lexrc.getString();
1092 if (tmp == "true" || tmp == "on")
1093 preview = PREVIEW_ON;
1094 else if (tmp == "no_math")
1095 preview = PREVIEW_NO_MATH;
1097 preview = PREVIEW_OFF;
1098 if (tmp != "false" && tmp != "off")
1099 LYXERR0("Unrecognized preview status \""
1105 case RC_PREVIEW_HASHED_LABELS:
1106 lexrc >> preview_hashed_labels;
1109 case RC_PREVIEW_SCALE_FACTOR:
1110 lexrc >> preview_scale_factor;
1117 lexrc >> user_email;
1120 case RC_PATH_PREFIX:
1121 lexrc >> path_prefix;
1124 case RC_USE_CONVERTER_CACHE:
1125 lexrc >> use_converter_cache;
1127 case RC_CONVERTER_CACHE_MAXAGE:
1128 lexrc >> converter_cache_maxage;
1131 case RC_SORT_LAYOUTS:
1132 lexrc >> sort_layouts;
1134 case RC_GROUP_LAYOUTS:
1135 lexrc >> group_layouts;
1137 case RC_FULL_SCREEN_LIMIT:
1138 lexrc >> full_screen_limit;
1140 case RC_FULL_SCREEN_TOOLBARS:
1141 lexrc >> full_screen_toolbars;
1143 case RC_FULL_SCREEN_SCROLLBAR:
1144 lexrc >> full_screen_scrollbar;
1146 case RC_FULL_SCREEN_TABBAR:
1147 lexrc >> full_screen_tabbar;
1149 case RC_FULL_SCREEN_MENUBAR:
1150 lexrc >> full_screen_menubar;
1152 case RC_FULL_SCREEN_WIDTH:
1153 lexrc >> full_screen_width;
1155 case RC_OPEN_BUFFERS_IN_TABS:
1156 lexrc >> open_buffers_in_tabs;
1158 case RC_SINGLE_CLOSE_TAB_BUTTON:
1159 lexrc >> single_close_tab_button;
1161 case RC_FORWARD_SEARCH:
1162 if (lexrc.next(true))
1163 forward_search = lexrc.getString();
1166 // Obsoteted in 1.4.0
1169 case RC_SPELL_COMMAND:
1171 case RC_PLAINTEXT_ROFF_COMMAND:
1172 case RC_USE_ALT_LANG:
1173 case RC_USE_ESC_CHARS:
1174 case RC_USE_INP_ENC:
1175 case RC_USE_PERS_DICT:
1176 case RC_USE_SPELL_LIB:
1177 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1178 << lexrc.getString() << "'.");
1183 break; // this is just a dummy
1187 /// Update converters data-structures
1188 theConverters().update(formats);
1189 theConverters().buildGraph();
1195 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1197 ofstream ofs(filename.toFilesystemEncoding().c_str());
1199 write(ofs, ignore_system_lyxrc);
1203 void LyXRC::print() const
1205 if (lyxerr.debugging())
1206 write(lyxerr, false);
1214 typedef pair<string, SpecialisedMover> Data;
1216 SameMover(Data const & comparison)
1217 : comparison_(comparison) {}
1219 bool operator()(Data const & data) const
1221 return data.first == comparison_.first &&
1222 data.second.command() == comparison_.second.command();
1232 // Escape \ and " so that LyXLex can read the string later
1233 string escapeCommand(string const & str) {
1234 return subst(subst(str , "\\", "\\\\"),
1241 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1243 LyXRCTags tag = RC_LAST;
1245 if (!name.empty()) {
1246 for (int i = 0; i != lyxrcCount; ++i)
1247 if ("\\" + name == lyxrcTags[i].tag)
1248 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1252 os << "# LyX " << lyx_version
1253 << " generated this file. If you want to make your own\n"
1254 << "# modifications you should do them from inside LyX and save.\n"
1257 // Why the switch you might ask. It is a trick to ensure that all
1258 // the elements in the LyXRCTags enum are handled. As you can see
1259 // there are no breaks at all. So it is just a huge fall-through.
1260 // The nice thing is that we will get a warning from the compiler
1261 // if we forget an element.
1265 // input/include files are not done here
1267 if (ignore_system_lyxrc ||
1268 bind_file != system_lyxrc.bind_file) {
1269 string const path = os::external_path(bind_file);
1270 os << "\\bind_file \"" << path << "\"\n";
1276 if (ignore_system_lyxrc ||
1277 def_file != system_lyxrc.def_file) {
1278 string const path = os::external_path(def_file);
1279 os << "\\def_file \"" << path << "\"\n";
1288 << "# MISC SECTION ######################################\n"
1290 // bind files are not done here.
1292 case RC_PATH_PREFIX:
1293 if (ignore_system_lyxrc ||
1294 path_prefix != system_lyxrc.path_prefix) {
1295 os << "\\path_prefix \"" << path_prefix << "\"\n";
1300 if (ignore_system_lyxrc ||
1301 ui_file != system_lyxrc.ui_file) {
1302 string const path = os::external_path(ui_file);
1303 os << "\\ui_file \"" << path << "\"\n";
1307 case RC_AUTOREGIONDELETE:
1308 if (ignore_system_lyxrc ||
1309 auto_region_delete != system_lyxrc.auto_region_delete) {
1310 os << "# Set to false to inhibit automatic replacement of\n"
1311 << "# the current selection.\n"
1312 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1317 case RC_AUTORESET_OPTIONS:
1318 if (ignore_system_lyxrc ||
1319 auto_reset_options != system_lyxrc.auto_reset_options) {
1320 os << "# Set to false to inhibit automatic reset of\n"
1321 << "# the class options to defaults on class change.\n"
1322 << "\\auto_reset_options "
1323 << convert<string>(auto_reset_options)
1329 if (ignore_system_lyxrc ||
1330 autosave != system_lyxrc.autosave) {
1331 os << "# The time interval between auto-saves in seconds.\n"
1332 << "\\autosave " << autosave << '\n';
1336 case RC_DISPLAY_GRAPHICS:
1337 if (ignore_system_lyxrc ||
1338 display_graphics != system_lyxrc.display_graphics) {
1339 os << "# Display graphics within LyX\n"
1341 << "\\display_graphics "
1342 << (display_graphics ? "true" : "false")
1347 case RC_SORT_LAYOUTS:
1348 if (ignore_system_lyxrc ||
1349 sort_layouts != system_lyxrc.sort_layouts) {
1350 os << "# Sort layouts alphabetically.\n"
1351 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1355 case RC_GROUP_LAYOUTS:
1356 if (ignore_system_lyxrc ||
1357 group_layouts != system_lyxrc.group_layouts) {
1358 os << "# Group layouts by their category.\n"
1359 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1363 case RC_VIEWDVI_PAPEROPTION:
1364 if (ignore_system_lyxrc ||
1365 view_dvi_paper_option
1366 != system_lyxrc.view_dvi_paper_option) {
1367 os << "# Options used to specify paper size to the\n"
1368 << "# view_dvi_command (e.g. -paper)\n"
1369 << "\\view_dvi_paper_option \""
1370 << view_dvi_paper_option << "\"\n";
1374 case RC_DEFAULT_PAPERSIZE:
1375 if (ignore_system_lyxrc ||
1376 default_papersize != system_lyxrc.default_papersize) {
1377 os << "# The default papersize to use.\n"
1378 << "\\default_papersize \"";
1379 switch (default_papersize) {
1381 os << "default"; break;
1382 case PAPER_USLETTER:
1383 os << "usletter"; break;
1385 os << "legal"; break;
1386 case PAPER_USEXECUTIVE:
1387 os << "executive"; break;
1398 case PAPER_B4: break;
1404 case RC_CHKTEX_COMMAND:
1405 if (ignore_system_lyxrc ||
1406 chktex_command != system_lyxrc.chktex_command) {
1407 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1411 case RC_BIBTEX_ALTERNATIVES: {
1412 CommandSet::const_iterator it = bibtex_alternatives.begin();
1413 CommandSet::const_iterator end = bibtex_alternatives.end();
1414 for ( ; it != end; ++it) {
1415 if (ignore_system_lyxrc
1416 || !system_lyxrc.bibtex_alternatives.count(*it))
1417 os << "\\bibtex_alternatives \""
1423 case RC_BIBTEX_COMMAND:
1424 if (ignore_system_lyxrc ||
1425 bibtex_command != system_lyxrc.bibtex_command) {
1426 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1430 case RC_JBIBTEX_COMMAND:
1431 if (ignore_system_lyxrc ||
1432 jbibtex_command != system_lyxrc.jbibtex_command) {
1433 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1437 case RC_INDEX_ALTERNATIVES: {
1438 CommandSet::const_iterator it = index_alternatives.begin();
1439 CommandSet::const_iterator end = index_alternatives.end();
1440 for ( ; it != end; ++it) {
1441 if (ignore_system_lyxrc
1442 || !system_lyxrc.index_alternatives.count(*it))
1443 os << "\\index_alternatives \""
1449 case RC_INDEX_COMMAND:
1450 if (ignore_system_lyxrc ||
1451 index_command != system_lyxrc.index_command) {
1452 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1456 case RC_JINDEX_COMMAND:
1457 if (ignore_system_lyxrc ||
1458 jindex_command != system_lyxrc.jindex_command) {
1459 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1463 case RC_SPLITINDEX_COMMAND:
1464 if (ignore_system_lyxrc ||
1465 splitindex_command != system_lyxrc.splitindex_command) {
1466 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1470 case RC_NOMENCL_COMMAND:
1471 if (ignore_system_lyxrc ||
1472 nomencl_command != system_lyxrc.nomencl_command) {
1473 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1477 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1478 if (ignore_system_lyxrc ||
1479 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1480 os << "\\tex_expects_windows_paths "
1481 << convert<string>(windows_style_tex_paths) << '\n';
1485 case RC_TEX_ALLOWS_SPACES:
1486 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1487 os << "\\tex_allows_spaces "
1488 << convert<string>(tex_allows_spaces) << '\n';
1493 if (ignore_system_lyxrc ||
1494 use_kbmap != system_lyxrc.use_kbmap) {
1495 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1499 case RC_KBMAP_PRIMARY:
1500 if (ignore_system_lyxrc ||
1501 primary_kbmap != system_lyxrc.primary_kbmap) {
1502 string const path = os::external_path(primary_kbmap);
1503 os << "\\kbmap_primary \"" << path << "\"\n";
1507 case RC_KBMAP_SECONDARY:
1508 if (ignore_system_lyxrc ||
1509 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1510 string const path = os::external_path(secondary_kbmap);
1511 os << "\\kbmap_secondary \"" << path << "\"\n";
1516 if (ignore_system_lyxrc ||
1517 lyxpipes != system_lyxrc.lyxpipes) {
1518 string const path = os::external_path(lyxpipes);
1519 os << "\\serverpipe \"" << path << "\"\n";
1523 case RC_DATE_INSERT_FORMAT:
1524 if (ignore_system_lyxrc ||
1525 date_insert_format != system_lyxrc.date_insert_format) {
1526 os << "\\date_insert_format \"" << date_insert_format
1533 os << "\\user_name \"" << user_name << "\"\n";
1538 os << "\\user_email \"" << user_email << "\"\n";
1542 case RC_SHOW_BANNER:
1543 if (ignore_system_lyxrc ||
1544 show_banner != system_lyxrc.show_banner) {
1545 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1551 if (ignore_system_lyxrc ||
1552 preview != system_lyxrc.preview) {
1558 case PREVIEW_NO_MATH:
1565 os << "\\preview " << status << '\n';
1570 case RC_PREVIEW_HASHED_LABELS:
1571 if (ignore_system_lyxrc ||
1572 preview_hashed_labels !=
1573 system_lyxrc.preview_hashed_labels) {
1574 os << "\\preview_hashed_labels "
1575 << convert<string>(preview_hashed_labels) << '\n';
1580 case RC_PREVIEW_SCALE_FACTOR:
1581 if (ignore_system_lyxrc ||
1582 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1583 os << "\\preview_scale_factor "
1584 << preview_scale_factor << '\n';
1589 case RC_USE_CONVERTER_CACHE:
1590 if (ignore_system_lyxrc ||
1591 use_converter_cache != system_lyxrc.use_converter_cache) {
1592 os << "\\use_converter_cache "
1593 << convert<string>(use_converter_cache) << '\n';
1598 case RC_CONVERTER_CACHE_MAXAGE:
1599 if (ignore_system_lyxrc ||
1600 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1601 os << "\\converter_cache_maxage "
1602 << converter_cache_maxage << '\n';
1608 << "# SCREEN & FONTS SECTION ############################\n"
1612 if (ignore_system_lyxrc ||
1613 dpi != system_lyxrc.dpi) {
1614 os << "\\screen_dpi " << dpi << '\n';
1618 case RC_SCREEN_ZOOM:
1619 if (ignore_system_lyxrc ||
1620 zoom != system_lyxrc.zoom) {
1621 os << "\\screen_zoom " << zoom << '\n';
1625 case RC_GEOMETRY_SESSION:
1626 if (ignore_system_lyxrc ||
1627 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1628 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1633 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1634 if (ignore_system_lyxrc ||
1635 cursor_follows_scrollbar
1636 != system_lyxrc.cursor_follows_scrollbar) {
1637 os << "\\cursor_follows_scrollbar "
1638 << convert<string>(cursor_follows_scrollbar) << '\n';
1642 case RC_SCROLL_BELOW_DOCUMENT:
1643 if (ignore_system_lyxrc ||
1644 scroll_below_document
1645 != system_lyxrc.scroll_below_document) {
1646 os << "\\scroll_below_document "
1647 << convert<string>(scroll_below_document) << '\n';
1651 case RC_PARAGRAPH_MARKERS:
1652 if (ignore_system_lyxrc ||
1654 != system_lyxrc.paragraph_markers) {
1655 os << "\\paragraph_markers "
1656 << convert<string>(paragraph_markers) << '\n';
1660 case RC_MAC_LIKE_WORD_MOVEMENT:
1661 if (ignore_system_lyxrc ||
1662 mac_like_word_movement
1663 != system_lyxrc.mac_like_word_movement) {
1664 os << "\\mac_like_word_movement "
1665 << convert<string>(mac_like_word_movement) << '\n';
1669 case RC_MACRO_EDIT_STYLE:
1670 if (ignore_system_lyxrc ||
1672 != system_lyxrc.macro_edit_style) {
1673 os << "\\macro_edit_style ";
1674 switch (macro_edit_style) {
1675 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1676 case MACRO_EDIT_INLINE: os << "1\n"; break;
1677 case MACRO_EDIT_LIST: os << "2\n"; break;
1682 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1683 if (ignore_system_lyxrc ||
1684 dialogs_iconify_with_main
1685 != system_lyxrc.dialogs_iconify_with_main) {
1686 os << "\\dialogs_iconify_with_main "
1687 << convert<string>(dialogs_iconify_with_main) << '\n';
1691 case RC_SCREEN_FONT_ROMAN:
1692 if (ignore_system_lyxrc ||
1693 roman_font_name != system_lyxrc.roman_font_name) {
1694 os << "\\screen_font_roman \"" << roman_font_name
1699 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1700 if (ignore_system_lyxrc ||
1701 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1702 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1707 case RC_SCREEN_FONT_SANS:
1708 if (ignore_system_lyxrc ||
1709 sans_font_name != system_lyxrc.sans_font_name) {
1710 os << "\\screen_font_sans \"" << sans_font_name
1715 case RC_SCREEN_FONT_SANS_FOUNDRY:
1716 if (ignore_system_lyxrc ||
1717 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1718 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1723 case RC_SCREEN_FONT_TYPEWRITER:
1724 if (ignore_system_lyxrc ||
1725 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1726 os << "\\screen_font_typewriter \""
1727 << typewriter_font_name << "\"\n";
1731 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1732 if (ignore_system_lyxrc ||
1733 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1734 os << "\\screen_font_typewriter_foundry \""
1735 << typewriter_font_foundry << "\"\n";
1740 case RC_SCREEN_FONT_SCALABLE:
1741 if (ignore_system_lyxrc ||
1742 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1743 os << "\\screen_font_scalable "
1744 << convert<string>(use_scalable_fonts)
1749 case RC_SCREEN_FONT_SIZES:
1750 if (ignore_system_lyxrc ||
1751 font_sizes[FONT_SIZE_TINY]
1752 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1753 font_sizes[FONT_SIZE_SCRIPT]
1754 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1755 font_sizes[FONT_SIZE_FOOTNOTE]
1756 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1757 font_sizes[FONT_SIZE_SMALL]
1758 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1759 font_sizes[FONT_SIZE_NORMAL]
1760 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1761 font_sizes[FONT_SIZE_LARGE]
1762 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1763 font_sizes[FONT_SIZE_LARGER]
1764 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1765 font_sizes[FONT_SIZE_LARGEST]
1766 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1767 font_sizes[FONT_SIZE_HUGE]
1768 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1769 font_sizes[FONT_SIZE_HUGER]
1770 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1771 os.setf(ios::fixed);
1773 os << "\\screen_font_sizes"
1774 << ' ' << font_sizes[FONT_SIZE_TINY]
1775 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1776 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1777 << ' ' << font_sizes[FONT_SIZE_SMALL]
1778 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1779 << ' ' << font_sizes[FONT_SIZE_LARGE]
1780 << ' ' << font_sizes[FONT_SIZE_LARGER]
1781 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1782 << ' ' << font_sizes[FONT_SIZE_HUGE]
1783 << ' ' << font_sizes[FONT_SIZE_HUGER]
1788 case RC_FULL_SCREEN_LIMIT:
1789 if (ignore_system_lyxrc ||
1790 full_screen_limit != system_lyxrc.full_screen_limit) {
1791 os << "\\fullscreen_limit "
1792 << convert<string>(full_screen_limit)
1797 case RC_FULL_SCREEN_TOOLBARS:
1798 if (ignore_system_lyxrc ||
1799 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1800 os << "\\fullscreen_toolbars "
1801 << convert<string>(full_screen_toolbars)
1806 case RC_FULL_SCREEN_SCROLLBAR:
1807 if (ignore_system_lyxrc ||
1808 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1809 os << "\\fullscreen_scrollbar "
1810 << convert<string>(full_screen_scrollbar)
1815 case RC_FULL_SCREEN_TABBAR:
1816 if (ignore_system_lyxrc ||
1817 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1818 os << "\\fullscreen_tabbar "
1819 << convert<string>(full_screen_tabbar)
1824 case RC_FULL_SCREEN_MENUBAR:
1825 if (ignore_system_lyxrc ||
1826 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1827 os << "\\fullscreen_menubar "
1828 << convert<string>(full_screen_menubar)
1833 case RC_FULL_SCREEN_WIDTH:
1834 if (ignore_system_lyxrc ||
1835 full_screen_width != system_lyxrc.full_screen_width) {
1836 os << "\\fullscreen_width "
1837 << convert<string>(full_screen_width)
1842 case RC_OPEN_BUFFERS_IN_TABS:
1843 if (ignore_system_lyxrc ||
1844 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1845 os << "\\open_buffers_in_tabs "
1846 << convert<string>(open_buffers_in_tabs)
1851 case RC_SINGLE_CLOSE_TAB_BUTTON:
1852 if (ignore_system_lyxrc ||
1853 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1854 os << "\\single_close_tab_button "
1855 << convert<string>(single_close_tab_button)
1860 case RC_FORWARD_SEARCH:
1861 if (ignore_system_lyxrc ||
1862 forward_search != system_lyxrc.forward_search) {
1863 os << "\\forward_search \"" << forward_search << "\"\n";
1869 << "# COLOR SECTION ###################################\n"
1873 for (int i = 0; i < Color_ignore; ++i) {
1874 ColorCode lc = static_cast<ColorCode>(i);
1875 string const col = lcolor.getX11Name(lc);
1876 if (ignore_system_lyxrc
1877 || col != system_lcolor.getX11Name(lc)) {
1878 os << "\\set_color \""
1879 << lcolor.getLyXName(lc) << "\" \""
1887 << "# PRINTER SECTION ###################################\n"
1891 if (ignore_system_lyxrc ||
1892 printer != system_lyxrc.printer) {
1893 os << "\\printer \"" << printer << "\"\n";
1897 case RC_PRINT_ADAPTOUTPUT:
1898 if (ignore_system_lyxrc ||
1899 print_adapt_output != system_lyxrc.print_adapt_output) {
1900 os << "\\print_adapt_output "
1901 << convert<string>(print_adapt_output)
1906 case RC_PRINT_COMMAND:
1907 if (ignore_system_lyxrc ||
1908 print_command != system_lyxrc.print_command) {
1909 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1913 case RC_PRINTEXSTRAOPTIONS:
1914 if (ignore_system_lyxrc ||
1915 print_extra_options != system_lyxrc.print_extra_options) {
1916 os << "\\print_extra_options \"" << print_extra_options
1921 case RC_PRINTSPOOL_COMMAND:
1922 if (ignore_system_lyxrc ||
1923 print_spool_command != system_lyxrc.print_spool_command) {
1924 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1929 case RC_PRINTSPOOL_PRINTERPREFIX:
1930 if (ignore_system_lyxrc ||
1931 print_spool_printerprefix
1932 != system_lyxrc.print_spool_printerprefix) {
1933 os << "\\print_spool_printerprefix \""
1934 << print_spool_printerprefix << "\"\n";
1938 case RC_PRINTEVENPAGEFLAG:
1939 if (ignore_system_lyxrc ||
1940 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1941 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1946 case RC_PRINTODDPAGEFLAG:
1947 if (ignore_system_lyxrc ||
1948 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1949 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1954 case RC_PRINTREVERSEFLAG:
1955 if (ignore_system_lyxrc ||
1956 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1957 os << "\\print_reverse_flag \"" << print_reverse_flag
1962 case RC_PRINTLANDSCAPEFLAG:
1963 if (ignore_system_lyxrc ||
1964 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1965 os << "\\print_landscape_flag \"" << print_landscape_flag
1970 case RC_PRINTPAGERANGEFLAG:
1971 if (ignore_system_lyxrc ||
1972 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1973 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1978 case RC_PRINTCOPIESFLAG:
1979 if (ignore_system_lyxrc ||
1980 print_copies_flag != system_lyxrc.print_copies_flag) {
1981 os << "\\print_copies_flag \"" << print_copies_flag
1986 case RC_PRINTCOLLCOPIESFLAG:
1987 if (ignore_system_lyxrc ||
1988 print_collcopies_flag
1989 != system_lyxrc.print_collcopies_flag) {
1990 os << "\\print_collcopies_flag \""
1991 << print_collcopies_flag
1996 case RC_PRINTPAPERFLAG:
1997 if (ignore_system_lyxrc ||
1998 print_paper_flag != system_lyxrc.print_paper_flag) {
1999 os << "\\print_paper_flag \"" << print_paper_flag
2004 case RC_PRINTPAPERDIMENSIONFLAG:
2005 if (ignore_system_lyxrc ||
2006 print_paper_dimension_flag
2007 != system_lyxrc.print_paper_dimension_flag) {
2008 os << "\\print_paper_dimension_flag \""
2009 << print_paper_dimension_flag << "\"\n";
2013 case RC_PRINTTOPRINTER:
2014 if (ignore_system_lyxrc ||
2015 print_to_printer != system_lyxrc.print_to_printer) {
2016 os << "\\print_to_printer \"" << print_to_printer
2021 case RC_PRINTTOFILE:
2022 if (ignore_system_lyxrc ||
2023 print_to_file != system_lyxrc.print_to_file) {
2024 string const path = os::external_path(print_to_file);
2025 os << "\\print_to_file \"" << path << "\"\n";
2029 case RC_PRINTFILEEXTENSION:
2030 if (ignore_system_lyxrc ||
2031 print_file_extension != system_lyxrc.print_file_extension) {
2032 os << "\\print_file_extension \""
2033 << print_file_extension
2040 << "# TEX SECTION #######################################\n"
2043 case RC_FONT_ENCODING:
2044 if (ignore_system_lyxrc ||
2045 fontenc != system_lyxrc.fontenc) {
2046 os << "\\font_encoding \"" << fontenc << "\"\n";
2052 << "# FILE SECTION ######################################\n"
2055 case RC_DOCUMENTPATH:
2056 if (ignore_system_lyxrc ||
2057 document_path != system_lyxrc.document_path) {
2058 string const path = os::external_path(document_path);
2059 os << "\\document_path \"" << path << "\"\n";
2063 case RC_USELASTFILEPOS:
2064 if (ignore_system_lyxrc ||
2065 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2066 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2071 case RC_LOADSESSION:
2072 if (ignore_system_lyxrc ||
2073 load_session != system_lyxrc.load_session) {
2074 os << "\\load_session " << convert<string>(load_session)
2079 case RC_MOUSE_WHEEL_SPEED:
2080 if (ignore_system_lyxrc ||
2081 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2082 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2086 case RC_COMPLETION_INLINE_DELAY:
2087 if (ignore_system_lyxrc ||
2088 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2089 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2093 case RC_COMPLETION_INLINE_MATH:
2094 if (ignore_system_lyxrc ||
2095 completion_inline_math != system_lyxrc.completion_inline_math) {
2096 os << "\\completion_inline_math "
2097 << convert<string>(completion_inline_math) << '\n';
2101 case RC_COMPLETION_INLINE_TEXT:
2102 if (ignore_system_lyxrc ||
2103 completion_inline_text != system_lyxrc.completion_inline_text) {
2104 os << "\\completion_inline_text "
2105 << convert<string>(completion_inline_text) << '\n';
2109 case RC_COMPLETION_INLINE_DOTS:
2110 if (ignore_system_lyxrc ||
2111 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2112 os << "\\completion_inline_dots "
2113 << convert<string>(completion_inline_dots) << '\n';
2117 case RC_AUTOCORRECTION_MATH:
2118 if (ignore_system_lyxrc ||
2119 autocorrection_math != system_lyxrc.autocorrection_math) {
2120 os << "\\autocorrection_math "
2121 << convert<string>(autocorrection_math) << '\n';
2125 case RC_COMPLETION_POPUP_DELAY:
2126 if (ignore_system_lyxrc ||
2127 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2128 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2132 case RC_COMPLETION_POPUP_MATH:
2133 if (ignore_system_lyxrc ||
2134 completion_popup_math != system_lyxrc.completion_popup_math) {
2135 os << "\\completion_popup_math "
2136 << convert<string>(completion_popup_math) << '\n';
2140 case RC_COMPLETION_POPUP_TEXT:
2141 if (ignore_system_lyxrc ||
2142 completion_popup_text != system_lyxrc.completion_popup_text) {
2143 os << "\\completion_popup_text "
2144 << convert<string>(completion_popup_text) << '\n';
2148 case RC_COMPLETION_CURSOR_TEXT:
2149 if (ignore_system_lyxrc ||
2150 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2151 os << "\\completion_cursor_text "
2152 << convert<string>(completion_cursor_text) << '\n';
2156 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2157 if (ignore_system_lyxrc ||
2158 completion_popup_after_complete
2159 != system_lyxrc.completion_popup_after_complete) {
2160 os << "\\completion_popup_after_complete "
2161 << convert<string>(completion_popup_after_complete) << '\n';
2165 case RC_NUMLASTFILES:
2166 if (ignore_system_lyxrc ||
2167 num_lastfiles != system_lyxrc.num_lastfiles) {
2168 os << "\\num_lastfiles " << num_lastfiles << '\n';
2172 case RC_CHECKLASTFILES:
2173 if (ignore_system_lyxrc ||
2174 check_lastfiles != system_lyxrc.check_lastfiles) {
2175 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2180 case RC_EXAMPLEPATH:
2181 if (ignore_system_lyxrc ||
2182 example_path != system_lyxrc.example_path) {
2183 string const path = os::external_path(example_path);
2184 os << "\\example_path \"" << path << "\"\n";
2188 case RC_TEMPLATEPATH:
2189 if (ignore_system_lyxrc ||
2190 template_path != system_lyxrc.template_path) {
2191 string const path = os::external_path(template_path);
2192 os << "\\template_path \"" << path << "\"\n";
2196 case RC_TEMPDIRPATH:
2197 if (ignore_system_lyxrc ||
2198 tempdir_path != system_lyxrc.tempdir_path) {
2199 string const path = os::external_path(tempdir_path);
2200 os << "\\tempdir_path \"" << path << "\"\n";
2204 case RC_THESAURUSDIRPATH:
2205 if (ignore_system_lyxrc ||
2206 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2207 string const path = os::external_path(thesaurusdir_path);
2208 os << "\\thesaurusdir_path \"" << path << "\"\n";
2212 case RC_HUNSPELLDIR_PATH:
2213 if (ignore_system_lyxrc ||
2214 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2215 string const path = os::external_path(hunspelldir_path);
2216 os << "\\hunspelldir_path \"" << path << "\"\n";
2224 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2227 case RC_PLAINTEXT_LINELEN:
2228 if (ignore_system_lyxrc ||
2229 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2230 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2234 case RC_MAKE_BACKUP:
2235 if (ignore_system_lyxrc ||
2236 make_backup != system_lyxrc.make_backup) {
2237 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2241 case RC_SAVE_COMPRESSED:
2242 if (ignore_system_lyxrc ||
2243 save_compressed != system_lyxrc.save_compressed) {
2244 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2248 case RC_BACKUPDIR_PATH:
2249 if (ignore_system_lyxrc ||
2250 backupdir_path != system_lyxrc.backupdir_path) {
2251 string const path = os::external_path(backupdir_path);
2252 os << "\\backupdir_path \"" << path << "\"\n";
2258 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2262 << "# SPELLCHECKER SECTION ##############################\n"
2265 case RC_SPELL_COMMAND:
2266 case RC_USE_SPELL_LIB:
2270 case RC_ACCEPT_COMPOUND:
2271 if (ignore_system_lyxrc ||
2272 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2273 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2278 case RC_USE_ALT_LANG:
2283 if (ignore_system_lyxrc ||
2284 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2285 os << "\\alternate_language \"" << spellchecker_alt_lang
2290 case RC_USE_ESC_CHARS:
2294 if (ignore_system_lyxrc ||
2295 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2296 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2300 case RC_USE_PERS_DICT:
2304 case RC_USE_TOOLTIP:
2305 if (ignore_system_lyxrc ||
2306 use_tooltip != system_lyxrc.use_tooltip) {
2307 os << "\\use_tooltip "
2308 << convert<string>(use_tooltip)
2313 case RC_USE_PIXMAP_CACHE:
2314 if (ignore_system_lyxrc ||
2315 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2316 os << "\\use_pixmap_cache "
2317 << convert<string>(use_pixmap_cache)
2326 case RC_USE_INP_ENC:
2332 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2337 case RC_SPELLCHECKER:
2338 if (ignore_system_lyxrc ||
2339 spellchecker != system_lyxrc.spellchecker) {
2340 os << "\\spellchecker " << spellchecker << '\n';
2345 case RC_SPELLCHECK_CONTINUOUSLY:
2346 if (ignore_system_lyxrc ||
2347 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2348 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2354 case RC_SPELLCHECK_NOTES:
2355 if (ignore_system_lyxrc ||
2356 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2357 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2363 case RC_RTL_SUPPORT:
2364 if (ignore_system_lyxrc ||
2365 rtl_support != system_lyxrc.rtl_support) {
2366 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2370 case RC_VISUAL_CURSOR:
2371 if (ignore_system_lyxrc ||
2372 visual_cursor != system_lyxrc.visual_cursor) {
2373 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2377 case RC_LANGUAGE_PACKAGE:
2378 if (ignore_system_lyxrc ||
2379 language_package != system_lyxrc.language_package) {
2380 os << "\\language_package \"" << language_package
2385 case RC_LANGUAGE_GLOBAL_OPTIONS:
2386 if (ignore_system_lyxrc ||
2387 language_global_options
2388 != system_lyxrc.language_global_options) {
2389 os << "\\language_global_options \""
2390 << convert<string>(language_global_options)
2395 case RC_LANGUAGE_USE_BABEL:
2396 if (ignore_system_lyxrc ||
2397 language_use_babel != system_lyxrc.language_use_babel) {
2398 os << "\\language_use_babel \""
2399 << convert<string>(language_use_babel)
2404 case RC_LANGUAGE_COMMAND_BEGIN:
2405 if (ignore_system_lyxrc ||
2406 language_command_begin
2407 != system_lyxrc.language_command_begin) {
2408 os << "\\language_command_begin \""
2409 << language_command_begin
2414 case RC_LANGUAGE_COMMAND_END:
2415 if (ignore_system_lyxrc ||
2416 language_command_end
2417 != system_lyxrc.language_command_end) {
2418 os << "\\language_command_end \"" << language_command_end
2423 case RC_LANGUAGE_COMMAND_LOCAL:
2424 if (ignore_system_lyxrc ||
2425 language_command_local
2426 != system_lyxrc.language_command_local) {
2427 os << "\\language_command_local \""
2428 << language_command_local
2433 case RC_LANGUAGE_AUTO_BEGIN:
2434 if (ignore_system_lyxrc ||
2435 language_auto_begin != system_lyxrc.language_auto_begin) {
2436 os << "\\language_auto_begin "
2437 << convert<string>(language_auto_begin) << '\n';
2441 case RC_LANGUAGE_AUTO_END:
2442 if (ignore_system_lyxrc ||
2443 language_auto_end != system_lyxrc.language_auto_end) {
2444 os << "\\language_auto_end "
2445 << convert<string>(language_auto_end) << '\n';
2449 case RC_MARK_FOREIGN_LANGUAGE:
2450 if (ignore_system_lyxrc ||
2451 mark_foreign_language
2452 != system_lyxrc.mark_foreign_language) {
2453 os << "\\mark_foreign_language " <<
2454 convert<string>(mark_foreign_language) << '\n';
2460 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2463 case RC_AUTO_NUMBER:
2464 if (ignore_system_lyxrc ||
2465 auto_number != system_lyxrc.auto_number) {
2466 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2470 case RC_DEFAULT_LANGUAGE:
2471 if (ignore_system_lyxrc ||
2472 default_language != system_lyxrc.default_language) {
2473 os << "\\default_language " << default_language << '\n';
2477 case RC_GUI_LANGUAGE:
2478 if (ignore_system_lyxrc ||
2479 gui_language != system_lyxrc.gui_language) {
2480 os << "\\gui_language " << gui_language << '\n';
2486 << "# FORMATS SECTION ##########################\n"
2490 // New/modified formats
2491 for (Formats::const_iterator cit = formats.begin();
2492 cit != formats.end(); ++cit) {
2493 Format const * format =
2494 system_formats.getFormat(cit->name());
2496 format->extension() != cit->extension() ||
2497 format->prettyname() != cit->prettyname() ||
2498 format->shortcut() != cit->shortcut() ||
2499 format->viewer() != cit->viewer() ||
2500 format->editor() != cit->editor() ||
2501 format->documentFormat() != cit->documentFormat() ||
2502 format->vectorFormat() != cit->vectorFormat()) {
2503 os << "\\format \"" << cit->name() << "\" \""
2504 << cit->extension() << "\" \""
2505 << cit->prettyname() << "\" \""
2506 << cit->shortcut() << "\" \""
2507 << escapeCommand(cit->viewer()) << "\" \""
2508 << escapeCommand(cit->editor()) << "\" \"";
2509 vector<string> flags;
2510 if (cit->documentFormat())
2511 flags.push_back("document");
2512 if (cit->vectorFormat())
2513 flags.push_back("vector");
2514 os << getStringFromVector(flags);
2519 // Look for deleted formats
2520 for (Formats::const_iterator cit = system_formats.begin();
2521 cit != system_formats.end(); ++cit)
2522 if (!formats.getFormat(cit->name()))
2523 os << "\\format \"" << cit->name()
2524 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2527 case RC_VIEWER_ALTERNATIVES: {
2528 Alternatives::const_iterator it = viewer_alternatives.begin();
2529 Alternatives::const_iterator const en = viewer_alternatives.end();
2530 Alternatives::const_iterator const sysend =
2531 system_lyxrc.viewer_alternatives.end();
2532 for (; it != en; ++it) {
2533 string const & fmt = it->first;
2534 CommandSet const & cmd = it->second;
2535 CommandSet::const_iterator sit = cmd.begin();
2536 CommandSet::const_iterator const sen = cmd.end();
2537 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2538 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2539 system_lyxrc.viewer_alternatives.find(fmt);
2540 for (; sit != sen; ++sit) {
2541 string const & cmd = *sit;
2542 if (ignore_system_lyxrc
2543 || sysfmt == sysend // format not found
2544 || sysfmt->second.count(cmd) == 0 // this command not found
2546 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2552 case RC_EDITOR_ALTERNATIVES: {
2553 Alternatives::const_iterator it = editor_alternatives.begin();
2554 Alternatives::const_iterator const en = editor_alternatives.end();
2555 Alternatives::const_iterator const sysend =
2556 system_lyxrc.editor_alternatives.end();
2557 for (; it != en; ++it) {
2558 string const & fmt = it->first;
2559 CommandSet const & cmd = it->second;
2560 CommandSet::const_iterator sit = cmd.begin();
2561 CommandSet::const_iterator const sen = cmd.end();
2562 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2563 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2564 system_lyxrc.editor_alternatives.find(fmt);
2565 for (; sit != sen; ++sit) {
2566 string const & cmd = *sit;
2567 if (ignore_system_lyxrc
2568 || sysfmt == sysend // format not found
2569 || sysfmt->second.count(cmd) == 0 // this command not found
2571 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2577 case RC_DEFAULT_VIEW_FORMAT:
2578 if (ignore_system_lyxrc ||
2579 default_view_format != system_lyxrc.default_view_format) {
2580 os << "\\default_view_format " << default_view_format << '\n';
2590 << "# CONVERTERS SECTION ##########################\n"
2594 // Look for new converters
2595 for (Converters::const_iterator cit = theConverters().begin();
2596 cit != theConverters().end(); ++cit) {
2597 Converter const * converter =
2598 theSystemConverters().getConverter(cit->from,
2601 converter->command != cit->command ||
2602 converter->flags != cit->flags)
2603 os << "\\converter \"" << cit->from << "\" \""
2604 << cit->to << "\" \""
2605 << escapeCommand(cit->command) << "\" \""
2606 << cit->flags << "\"\n";
2609 // New/modifed converters
2610 for (Converters::const_iterator cit = theSystemConverters().begin();
2611 cit != theSystemConverters().end(); ++cit)
2612 if (!theConverters().getConverter(cit->from, cit->to))
2613 os << "\\converter \"" << cit->from
2614 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2621 << "# COPIERS SECTION ##########################\n"
2624 // Look for new movers
2625 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2626 Movers::const_iterator const sysend = theSystemMovers().end();
2627 Movers::const_iterator it = theMovers().begin();
2628 Movers::const_iterator end = theMovers().end();
2630 for (; it != end; ++it) {
2631 Movers::const_iterator const sysit =
2632 find_if(sysbegin, sysend, SameMover(*it));
2633 if (sysit == sysend) {
2634 string const & fmt = it->first;
2635 string const & command =
2636 it->second.command();
2638 os << "\\copier " << fmt
2639 << " \"" << escapeCommand(command) << "\"\n";
2645 // We don't actually delete SpecialisedMover(s) from the
2646 // map, just clear their 'command', so there's no need
2647 // to test for anything else.
2654 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2656 // Why the switch you might ask. It is a trick to ensure that all
2657 // the elements in the LyXRCTags enum is handled. As you can see
2658 // there are no breaks at all. So it is just a huge fall-through.
2659 // The nice thing is that we will get a warning from the compiler
2660 // if we forget an element.
2661 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2663 case LyXRC::RC_ACCEPT_COMPOUND:
2664 case LyXRC::RC_ALT_LANG:
2665 case LyXRC::RC_PLAINTEXT_LINELEN:
2666 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2667 case LyXRC::RC_AUTOCORRECTION_MATH:
2668 case LyXRC::RC_AUTOREGIONDELETE:
2669 case LyXRC::RC_AUTORESET_OPTIONS:
2670 case LyXRC::RC_AUTOSAVE:
2671 case LyXRC::RC_AUTO_NUMBER:
2672 case LyXRC::RC_BACKUPDIR_PATH:
2673 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2674 case LyXRC::RC_BIBTEX_COMMAND:
2675 case LyXRC::RC_BINDFILE:
2676 case LyXRC::RC_CHECKLASTFILES:
2677 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2678 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2679 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2680 case LyXRC::RC_COMPLETION_INLINE_MATH:
2681 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2682 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2683 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2684 case LyXRC::RC_COMPLETION_POPUP_MATH:
2685 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2686 case LyXRC::RC_USELASTFILEPOS:
2687 case LyXRC::RC_LOADSESSION:
2688 case LyXRC::RC_CHKTEX_COMMAND:
2689 case LyXRC::RC_CONVERTER:
2690 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2691 case LyXRC::RC_COPIER:
2692 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2693 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2694 case LyXRC::RC_DATE_INSERT_FORMAT:
2695 case LyXRC::RC_DEFAULT_LANGUAGE:
2696 case LyXRC::RC_GUI_LANGUAGE:
2697 case LyXRC::RC_DEFAULT_PAPERSIZE:
2698 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2699 case LyXRC::RC_DEFFILE:
2700 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2701 case LyXRC::RC_DISPLAY_GRAPHICS:
2702 case LyXRC::RC_DOCUMENTPATH:
2703 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2704 FileName path(lyxrc_new.document_path);
2705 if (path.exists() && path.isDirectory())
2706 package().document_dir() = FileName(lyxrc.document_path);
2708 case LyXRC::RC_EDITOR_ALTERNATIVES:
2709 case LyXRC::RC_ESC_CHARS:
2710 case LyXRC::RC_EXAMPLEPATH:
2711 case LyXRC::RC_FONT_ENCODING:
2712 case LyXRC::RC_FORMAT:
2713 case LyXRC::RC_GROUP_LAYOUTS:
2714 case LyXRC::RC_HUNSPELLDIR_PATH:
2715 case LyXRC::RC_INDEX_ALTERNATIVES:
2716 case LyXRC::RC_INDEX_COMMAND:
2717 case LyXRC::RC_JBIBTEX_COMMAND:
2718 case LyXRC::RC_JINDEX_COMMAND:
2719 case LyXRC::RC_NOMENCL_COMMAND:
2720 case LyXRC::RC_INPUT:
2721 case LyXRC::RC_KBMAP:
2722 case LyXRC::RC_KBMAP_PRIMARY:
2723 case LyXRC::RC_KBMAP_SECONDARY:
2724 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2725 case LyXRC::RC_LANGUAGE_AUTO_END:
2726 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2727 case LyXRC::RC_LANGUAGE_COMMAND_END:
2728 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2729 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2730 case LyXRC::RC_LANGUAGE_PACKAGE:
2731 case LyXRC::RC_LANGUAGE_USE_BABEL:
2732 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2733 case LyXRC::RC_MACRO_EDIT_STYLE:
2734 case LyXRC::RC_MAKE_BACKUP:
2735 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2736 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2737 case LyXRC::RC_NUMLASTFILES:
2738 case LyXRC::RC_PARAGRAPH_MARKERS:
2739 case LyXRC::RC_PATH_PREFIX:
2740 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2741 prependEnvPath("PATH", lyxrc.path_prefix);
2743 case LyXRC::RC_PERS_DICT:
2744 case LyXRC::RC_PREVIEW:
2745 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2746 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2747 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2748 case LyXRC::RC_PRINTCOPIESFLAG:
2749 case LyXRC::RC_PRINTER:
2750 case LyXRC::RC_PRINTEVENPAGEFLAG:
2751 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2752 case LyXRC::RC_PRINTFILEEXTENSION:
2753 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2754 case LyXRC::RC_PRINTODDPAGEFLAG:
2755 case LyXRC::RC_PRINTPAGERANGEFLAG:
2756 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2757 case LyXRC::RC_PRINTPAPERFLAG:
2758 case LyXRC::RC_PRINTREVERSEFLAG:
2759 case LyXRC::RC_PRINTSPOOL_COMMAND:
2760 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2761 case LyXRC::RC_PRINTTOFILE:
2762 case LyXRC::RC_PRINTTOPRINTER:
2763 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2764 case LyXRC::RC_PRINT_COMMAND:
2765 case LyXRC::RC_RTL_SUPPORT:
2766 case LyXRC::RC_SAVE_COMPRESSED:
2767 case LyXRC::RC_SCREEN_DPI:
2768 case LyXRC::RC_SCREEN_FONT_ROMAN:
2769 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2770 case LyXRC::RC_SCREEN_FONT_SANS:
2771 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2772 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2773 case LyXRC::RC_SCREEN_FONT_SIZES:
2774 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2775 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2776 case LyXRC::RC_GEOMETRY_SESSION:
2777 case LyXRC::RC_SCREEN_ZOOM:
2778 case LyXRC::RC_SERVERPIPE:
2779 case LyXRC::RC_SET_COLOR:
2780 case LyXRC::RC_SHOW_BANNER:
2781 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2782 case LyXRC::RC_SPELL_COMMAND:
2783 case LyXRC::RC_SPELLCHECKER:
2784 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2785 case LyXRC::RC_SPELLCHECK_NOTES:
2786 case LyXRC::RC_SPLITINDEX_COMMAND:
2787 case LyXRC::RC_TEMPDIRPATH:
2788 case LyXRC::RC_TEMPLATEPATH:
2789 case LyXRC::RC_TEX_ALLOWS_SPACES:
2790 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2791 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2792 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2794 case LyXRC::RC_THESAURUSDIRPATH:
2795 case LyXRC::RC_UIFILE:
2796 case LyXRC::RC_USER_EMAIL:
2797 case LyXRC::RC_USER_NAME:
2798 case LyXRC::RC_USETEMPDIR:
2799 case LyXRC::RC_USE_ALT_LANG:
2800 case LyXRC::RC_USE_CONVERTER_CACHE:
2801 case LyXRC::RC_USE_ESC_CHARS:
2802 case LyXRC::RC_USE_INP_ENC:
2803 case LyXRC::RC_USE_PERS_DICT:
2804 case LyXRC::RC_USE_TOOLTIP:
2805 case LyXRC::RC_USE_PIXMAP_CACHE:
2806 case LyXRC::RC_USE_SPELL_LIB:
2807 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2808 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2809 case LyXRC::RC_SORT_LAYOUTS:
2810 case LyXRC::RC_FULL_SCREEN_LIMIT:
2811 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2812 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2813 case LyXRC::RC_FULL_SCREEN_TABBAR:
2814 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2815 case LyXRC::RC_FULL_SCREEN_WIDTH:
2816 case LyXRC::RC_VISUAL_CURSOR:
2817 case LyXRC::RC_VIEWER:
2818 case LyXRC::RC_VIEWER_ALTERNATIVES:
2819 case LyXRC::RC_FORWARD_SEARCH:
2820 case LyXRC::RC_LAST:
2827 string const LyXRC::getDescription(LyXRCTags tag)
2832 case RC_ACCEPT_COMPOUND:
2833 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2837 case RC_USE_ALT_LANG:
2838 str = _("Specify an alternate language. The default is to use the language of the document.");
2841 case RC_PLAINTEXT_ROFF_COMMAND:
2842 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.");
2845 case RC_PLAINTEXT_LINELEN:
2846 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.");
2849 case RC_AUTOREGIONDELETE:
2850 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2853 case RC_AUTORESET_OPTIONS:
2854 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2858 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2861 case RC_AUTO_NUMBER:
2864 case RC_BACKUPDIR_PATH:
2865 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.");
2868 case RC_BIBTEX_COMMAND:
2869 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2872 case RC_JBIBTEX_COMMAND:
2873 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2877 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2880 case RC_CHECKLASTFILES:
2881 str = _("Select to check whether the lastfiles still exist.");
2884 case RC_CHKTEX_COMMAND:
2885 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2894 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2895 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.");
2898 case RC_SCROLL_BELOW_DOCUMENT:
2899 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");
2902 case RC_MAC_LIKE_WORD_MOVEMENT:
2903 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2906 case RC_SHOW_MACRO_LABEL:
2907 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2910 case RC_DATE_INSERT_FORMAT:
2911 //xgettext:no-c-format
2912 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2916 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2919 case RC_DEFAULT_VIEW_FORMAT:
2920 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2923 case RC_DEFAULT_LANGUAGE:
2924 str = _("New documents will be assigned this language.");
2927 case RC_DEFAULT_PAPERSIZE:
2928 str = _("Specify the default paper size.");
2931 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2932 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2935 case RC_DISPLAY_GRAPHICS:
2936 str = _("Select how LyX will display any graphics.");
2939 case RC_DOCUMENTPATH:
2940 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2944 case RC_USE_ESC_CHARS:
2945 str = _("Specify additional chars that can be part of a word.");
2948 case RC_EXAMPLEPATH:
2949 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2952 case RC_FONT_ENCODING:
2953 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2959 case RC_INDEX_COMMAND:
2960 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\".");
2963 case RC_JINDEX_COMMAND:
2964 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2967 case RC_NOMENCL_COMMAND:
2968 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2975 case RC_KBMAP_PRIMARY:
2976 case RC_KBMAP_SECONDARY:
2977 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.");
2980 case RC_LANGUAGE_AUTO_BEGIN:
2981 str = _("Select if a language switching command is needed at the beginning of the document.");
2984 case RC_LANGUAGE_AUTO_END:
2985 str = _("Select if a language switching command is needed at the end of the document.");
2988 case RC_LANGUAGE_COMMAND_BEGIN:
2989 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.");
2992 case RC_LANGUAGE_COMMAND_END:
2993 str = _("The LaTeX command for changing back to the language of the document.");
2996 case RC_LANGUAGE_COMMAND_LOCAL:
2997 str = _("The LaTeX command for local changing of the language.");
3000 case RC_LANGUAGE_GLOBAL_OPTIONS:
3001 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3004 case RC_LANGUAGE_PACKAGE:
3005 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3008 case RC_LANGUAGE_USE_BABEL:
3009 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3012 case RC_USELASTFILEPOS:
3013 str = _("De-select if you do not want LyX to scroll to saved position.");
3016 case RC_LOADSESSION:
3017 str = _("De-select to prevent loading files opened from the last LyX session.");
3020 case RC_MAKE_BACKUP:
3021 str = _("De-select if you don't want LyX to create backup files.");
3024 case RC_MARK_FOREIGN_LANGUAGE:
3025 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3028 case RC_MOUSE_WHEEL_SPEED:
3029 str = bformat(_("The scrolling speed of the mouse wheel."),
3033 case RC_COMPLETION_POPUP_DELAY:
3034 str = _("The completion popup delay.");
3037 case RC_COMPLETION_POPUP_MATH:
3038 str = _("Select to display the completion popup in math mode.");
3041 case RC_COMPLETION_POPUP_TEXT:
3042 str = _("Select to display the completion popup in text mode.");
3045 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3046 str = _("Show the completion popup without delay after non-unique completion attempt.");
3049 case RC_COMPLETION_POPUP_TEXT:
3050 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3053 case RC_COMPLETION_POPUP_DELAY:
3054 str = _("The inline completion delay.");
3057 case RC_COMPLETION_INLINE_MATH:
3058 str = _("Select to display the inline completion in math mode.");
3061 case RC_COMPLETION_INLINE_TEXT:
3062 str = _("Select to display the inline completion in text mode.");
3065 case RC_COMPLETION_INLINE_DOTS:
3066 str = _("Use \"...\" to shorten long completions.");
3069 case RC_AUTOCORRECTION_MATH:
3070 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3073 case RC_NUMLASTFILES:
3074 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3078 case RC_PATH_PREFIX:
3079 str = _("Specify those directories which should be "
3080 "prepended to the PATH environment variable. "
3081 "Use the OS native format.");
3085 str = _("Shows a typeset preview of things such as math");
3088 case RC_PREVIEW_HASHED_LABELS:
3089 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3092 case RC_PREVIEW_SCALE_FACTOR:
3093 str = _("Scale the preview size to suit.");
3096 case RC_PRINTCOLLCOPIESFLAG:
3097 str = _("The option for specifying whether the copies should be collated.");
3100 case RC_PRINTCOPIESFLAG:
3101 str = _("The option for specifying the number of copies to print.");
3105 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3108 case RC_PRINTEVENPAGEFLAG:
3109 str = _("The option to print only even pages.");
3112 case RC_PRINTEXSTRAOPTIONS:
3113 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3116 case RC_PRINTFILEEXTENSION:
3117 str = _("Extension of printer program output file. Usually \".ps\".");
3120 case RC_PRINTLANDSCAPEFLAG:
3121 str = _("The option to print out in landscape.");
3124 case RC_PRINTODDPAGEFLAG:
3125 str = _("The option to print only odd pages.");
3128 case RC_PRINTPAGERANGEFLAG:
3129 str = _("The option for specifying a comma-separated list of pages to print.");
3132 case RC_PRINTPAPERDIMENSIONFLAG:
3133 str = _("Option to specify the dimensions of the print paper.");
3136 case RC_PRINTPAPERFLAG:
3137 str = _("The option to specify paper type.");
3140 case RC_PRINTREVERSEFLAG:
3141 str = _("The option to reverse the order of the pages printed.");
3144 case RC_PRINTSPOOL_COMMAND:
3145 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.");
3148 case RC_PRINTSPOOL_PRINTERPREFIX:
3149 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.");
3152 case RC_PRINTTOFILE:
3153 str = _("Option to pass to the print program to print to a file.");
3156 case RC_PRINTTOPRINTER:
3157 str = _("Option to pass to the print program to print on a specific printer.");
3160 case RC_PRINT_ADAPTOUTPUT:
3161 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3164 case RC_PRINT_COMMAND:
3165 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3168 case RC_RTL_SUPPORT:
3169 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3172 case RC_VISUAL_CURSOR:
3173 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3177 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3180 case RC_SCREEN_FONT_ROMAN:
3181 case RC_SCREEN_FONT_SANS:
3182 case RC_SCREEN_FONT_TYPEWRITER:
3183 str = _("The screen fonts used to display the text while editing.");
3186 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3187 case RC_SCREEN_FONT_SANS_FOUNDRY:
3188 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3191 case RC_SCREEN_FONT_SCALABLE:
3192 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.");
3195 case RC_SCREEN_FONT_SIZES:
3196 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3199 case RC_SCREEN_ZOOM:
3200 //xgettext:no-c-format
3201 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3204 case RC_GEOMETRY_SESSION:
3205 str = _("Allow session manager to save and restore windows geometry.");
3209 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3215 case RC_SHOW_BANNER:
3216 str = _("De-select if you don't want the startup banner.");
3219 case RC_TEMPDIRPATH:
3220 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3223 case RC_THESAURUSDIRPATH:
3224 str = _("This is the place where the files of the thesaurus library reside.");
3227 case RC_TEMPLATEPATH:
3228 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3231 case RC_TEX_ALLOWS_SPACES:
3234 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3238 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3250 case RC_USE_TOOLTIP:
3251 str = _("Enable the automatic appearance of tool tips in the work area.");
3254 case RC_USE_PIXMAP_CACHE:
3255 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3258 case RC_USE_SPELL_LIB:
3261 case RC_VIEWDVI_PAPEROPTION:
3262 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3277 // The global instance
3280 // The global copy of the system lyxrc entries (everything except preferences)