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 lexrc >> forward_search;
1165 // Obsoteted in 1.4.0
1168 case RC_SPELL_COMMAND:
1170 case RC_PLAINTEXT_ROFF_COMMAND:
1171 case RC_USE_ALT_LANG:
1172 case RC_USE_ESC_CHARS:
1173 case RC_USE_INP_ENC:
1174 case RC_USE_PERS_DICT:
1175 case RC_USE_SPELL_LIB:
1176 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1177 << lexrc.getString() << "'.");
1182 break; // this is just a dummy
1186 /// Update converters data-structures
1187 theConverters().update(formats);
1188 theConverters().buildGraph();
1194 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1196 ofstream ofs(filename.toFilesystemEncoding().c_str());
1198 write(ofs, ignore_system_lyxrc);
1202 void LyXRC::print() const
1204 if (lyxerr.debugging())
1205 write(lyxerr, false);
1213 typedef pair<string, SpecialisedMover> Data;
1215 SameMover(Data const & comparison)
1216 : comparison_(comparison) {}
1218 bool operator()(Data const & data) const
1220 return data.first == comparison_.first &&
1221 data.second.command() == comparison_.second.command();
1231 // Escape \ and " so that LyXLex can read the string later
1232 string escapeCommand(string const & str) {
1233 return subst(subst(str , "\\", "\\\\"),
1240 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1242 LyXRCTags tag = RC_LAST;
1244 if (!name.empty()) {
1245 for (int i = 0; i != lyxrcCount; ++i)
1246 if ("\\" + name == lyxrcTags[i].tag)
1247 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1251 os << "# LyX " << lyx_version
1252 << " generated this file. If you want to make your own\n"
1253 << "# modifications you should do them from inside LyX and save.\n"
1256 // Why the switch you might ask. It is a trick to ensure that all
1257 // the elements in the LyXRCTags enum are handled. As you can see
1258 // there are no breaks at all. So it is just a huge fall-through.
1259 // The nice thing is that we will get a warning from the compiler
1260 // if we forget an element.
1264 // input/include files are not done here
1266 if (ignore_system_lyxrc ||
1267 bind_file != system_lyxrc.bind_file) {
1268 string const path = os::external_path(bind_file);
1269 os << "\\bind_file \"" << path << "\"\n";
1275 if (ignore_system_lyxrc ||
1276 def_file != system_lyxrc.def_file) {
1277 string const path = os::external_path(def_file);
1278 os << "\\def_file \"" << path << "\"\n";
1287 << "# MISC SECTION ######################################\n"
1289 // bind files are not done here.
1291 case RC_PATH_PREFIX:
1292 if (ignore_system_lyxrc ||
1293 path_prefix != system_lyxrc.path_prefix) {
1294 os << "\\path_prefix \"" << path_prefix << "\"\n";
1299 if (ignore_system_lyxrc ||
1300 ui_file != system_lyxrc.ui_file) {
1301 string const path = os::external_path(ui_file);
1302 os << "\\ui_file \"" << path << "\"\n";
1306 case RC_AUTOREGIONDELETE:
1307 if (ignore_system_lyxrc ||
1308 auto_region_delete != system_lyxrc.auto_region_delete) {
1309 os << "# Set to false to inhibit automatic replacement of\n"
1310 << "# the current selection.\n"
1311 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1316 case RC_AUTORESET_OPTIONS:
1317 if (ignore_system_lyxrc ||
1318 auto_reset_options != system_lyxrc.auto_reset_options) {
1319 os << "# Set to false to inhibit automatic reset of\n"
1320 << "# the class options to defaults on class change.\n"
1321 << "\\auto_reset_options "
1322 << convert<string>(auto_reset_options)
1328 if (ignore_system_lyxrc ||
1329 autosave != system_lyxrc.autosave) {
1330 os << "# The time interval between auto-saves in seconds.\n"
1331 << "\\autosave " << autosave << '\n';
1335 case RC_DISPLAY_GRAPHICS:
1336 if (ignore_system_lyxrc ||
1337 display_graphics != system_lyxrc.display_graphics) {
1338 os << "# Display graphics within LyX\n"
1340 << "\\display_graphics "
1341 << (display_graphics ? "true" : "false")
1346 case RC_SORT_LAYOUTS:
1347 if (ignore_system_lyxrc ||
1348 sort_layouts != system_lyxrc.sort_layouts) {
1349 os << "# Sort layouts alphabetically.\n"
1350 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1354 case RC_GROUP_LAYOUTS:
1355 if (ignore_system_lyxrc ||
1356 group_layouts != system_lyxrc.group_layouts) {
1357 os << "# Group layouts by their category.\n"
1358 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1362 case RC_VIEWDVI_PAPEROPTION:
1363 if (ignore_system_lyxrc ||
1364 view_dvi_paper_option
1365 != system_lyxrc.view_dvi_paper_option) {
1366 os << "# Options used to specify paper size to the\n"
1367 << "# view_dvi_command (e.g. -paper)\n"
1368 << "\\view_dvi_paper_option \""
1369 << view_dvi_paper_option << "\"\n";
1373 case RC_DEFAULT_PAPERSIZE:
1374 if (ignore_system_lyxrc ||
1375 default_papersize != system_lyxrc.default_papersize) {
1376 os << "# The default papersize to use.\n"
1377 << "\\default_papersize \"";
1378 switch (default_papersize) {
1380 os << "default"; break;
1381 case PAPER_USLETTER:
1382 os << "usletter"; break;
1384 os << "legal"; break;
1385 case PAPER_USEXECUTIVE:
1386 os << "executive"; break;
1397 case PAPER_B4: break;
1403 case RC_CHKTEX_COMMAND:
1404 if (ignore_system_lyxrc ||
1405 chktex_command != system_lyxrc.chktex_command) {
1406 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1410 case RC_BIBTEX_ALTERNATIVES: {
1411 CommandSet::const_iterator it = bibtex_alternatives.begin();
1412 CommandSet::const_iterator end = bibtex_alternatives.end();
1413 for ( ; it != end; ++it) {
1414 if (ignore_system_lyxrc
1415 || !system_lyxrc.bibtex_alternatives.count(*it))
1416 os << "\\bibtex_alternatives \""
1422 case RC_BIBTEX_COMMAND:
1423 if (ignore_system_lyxrc ||
1424 bibtex_command != system_lyxrc.bibtex_command) {
1425 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1429 case RC_JBIBTEX_COMMAND:
1430 if (ignore_system_lyxrc ||
1431 jbibtex_command != system_lyxrc.jbibtex_command) {
1432 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1436 case RC_INDEX_ALTERNATIVES: {
1437 CommandSet::const_iterator it = index_alternatives.begin();
1438 CommandSet::const_iterator end = index_alternatives.end();
1439 for ( ; it != end; ++it) {
1440 if (ignore_system_lyxrc
1441 || !system_lyxrc.index_alternatives.count(*it))
1442 os << "\\index_alternatives \""
1448 case RC_INDEX_COMMAND:
1449 if (ignore_system_lyxrc ||
1450 index_command != system_lyxrc.index_command) {
1451 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1455 case RC_JINDEX_COMMAND:
1456 if (ignore_system_lyxrc ||
1457 jindex_command != system_lyxrc.jindex_command) {
1458 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1462 case RC_SPLITINDEX_COMMAND:
1463 if (ignore_system_lyxrc ||
1464 splitindex_command != system_lyxrc.splitindex_command) {
1465 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1469 case RC_NOMENCL_COMMAND:
1470 if (ignore_system_lyxrc ||
1471 nomencl_command != system_lyxrc.nomencl_command) {
1472 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1476 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1477 if (ignore_system_lyxrc ||
1478 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1479 os << "\\tex_expects_windows_paths "
1480 << convert<string>(windows_style_tex_paths) << '\n';
1484 case RC_TEX_ALLOWS_SPACES:
1485 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1486 os << "\\tex_allows_spaces "
1487 << convert<string>(tex_allows_spaces) << '\n';
1492 if (ignore_system_lyxrc ||
1493 use_kbmap != system_lyxrc.use_kbmap) {
1494 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1498 case RC_KBMAP_PRIMARY:
1499 if (ignore_system_lyxrc ||
1500 primary_kbmap != system_lyxrc.primary_kbmap) {
1501 string const path = os::external_path(primary_kbmap);
1502 os << "\\kbmap_primary \"" << path << "\"\n";
1506 case RC_KBMAP_SECONDARY:
1507 if (ignore_system_lyxrc ||
1508 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1509 string const path = os::external_path(secondary_kbmap);
1510 os << "\\kbmap_secondary \"" << path << "\"\n";
1515 if (ignore_system_lyxrc ||
1516 lyxpipes != system_lyxrc.lyxpipes) {
1517 string const path = os::external_path(lyxpipes);
1518 os << "\\serverpipe \"" << path << "\"\n";
1522 case RC_DATE_INSERT_FORMAT:
1523 if (ignore_system_lyxrc ||
1524 date_insert_format != system_lyxrc.date_insert_format) {
1525 os << "\\date_insert_format \"" << date_insert_format
1532 os << "\\user_name \"" << user_name << "\"\n";
1537 os << "\\user_email \"" << user_email << "\"\n";
1541 case RC_SHOW_BANNER:
1542 if (ignore_system_lyxrc ||
1543 show_banner != system_lyxrc.show_banner) {
1544 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1550 if (ignore_system_lyxrc ||
1551 preview != system_lyxrc.preview) {
1557 case PREVIEW_NO_MATH:
1564 os << "\\preview " << status << '\n';
1569 case RC_PREVIEW_HASHED_LABELS:
1570 if (ignore_system_lyxrc ||
1571 preview_hashed_labels !=
1572 system_lyxrc.preview_hashed_labels) {
1573 os << "\\preview_hashed_labels "
1574 << convert<string>(preview_hashed_labels) << '\n';
1579 case RC_PREVIEW_SCALE_FACTOR:
1580 if (ignore_system_lyxrc ||
1581 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1582 os << "\\preview_scale_factor "
1583 << preview_scale_factor << '\n';
1588 case RC_USE_CONVERTER_CACHE:
1589 if (ignore_system_lyxrc ||
1590 use_converter_cache != system_lyxrc.use_converter_cache) {
1591 os << "\\use_converter_cache "
1592 << convert<string>(use_converter_cache) << '\n';
1597 case RC_CONVERTER_CACHE_MAXAGE:
1598 if (ignore_system_lyxrc ||
1599 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1600 os << "\\converter_cache_maxage "
1601 << converter_cache_maxage << '\n';
1607 << "# SCREEN & FONTS SECTION ############################\n"
1611 if (ignore_system_lyxrc ||
1612 dpi != system_lyxrc.dpi) {
1613 os << "\\screen_dpi " << dpi << '\n';
1617 case RC_SCREEN_ZOOM:
1618 if (ignore_system_lyxrc ||
1619 zoom != system_lyxrc.zoom) {
1620 os << "\\screen_zoom " << zoom << '\n';
1624 case RC_GEOMETRY_SESSION:
1625 if (ignore_system_lyxrc ||
1626 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1627 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1632 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1633 if (ignore_system_lyxrc ||
1634 cursor_follows_scrollbar
1635 != system_lyxrc.cursor_follows_scrollbar) {
1636 os << "\\cursor_follows_scrollbar "
1637 << convert<string>(cursor_follows_scrollbar) << '\n';
1641 case RC_SCROLL_BELOW_DOCUMENT:
1642 if (ignore_system_lyxrc ||
1643 scroll_below_document
1644 != system_lyxrc.scroll_below_document) {
1645 os << "\\scroll_below_document "
1646 << convert<string>(scroll_below_document) << '\n';
1650 case RC_PARAGRAPH_MARKERS:
1651 if (ignore_system_lyxrc ||
1653 != system_lyxrc.paragraph_markers) {
1654 os << "\\paragraph_markers "
1655 << convert<string>(paragraph_markers) << '\n';
1659 case RC_MAC_LIKE_WORD_MOVEMENT:
1660 if (ignore_system_lyxrc ||
1661 mac_like_word_movement
1662 != system_lyxrc.mac_like_word_movement) {
1663 os << "\\mac_like_word_movement "
1664 << convert<string>(mac_like_word_movement) << '\n';
1668 case RC_MACRO_EDIT_STYLE:
1669 if (ignore_system_lyxrc ||
1671 != system_lyxrc.macro_edit_style) {
1672 os << "\\macro_edit_style ";
1673 switch (macro_edit_style) {
1674 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1675 case MACRO_EDIT_INLINE: os << "1\n"; break;
1676 case MACRO_EDIT_LIST: os << "2\n"; break;
1681 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1682 if (ignore_system_lyxrc ||
1683 dialogs_iconify_with_main
1684 != system_lyxrc.dialogs_iconify_with_main) {
1685 os << "\\dialogs_iconify_with_main "
1686 << convert<string>(dialogs_iconify_with_main) << '\n';
1690 case RC_SCREEN_FONT_ROMAN:
1691 if (ignore_system_lyxrc ||
1692 roman_font_name != system_lyxrc.roman_font_name) {
1693 os << "\\screen_font_roman \"" << roman_font_name
1698 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1699 if (ignore_system_lyxrc ||
1700 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1701 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1706 case RC_SCREEN_FONT_SANS:
1707 if (ignore_system_lyxrc ||
1708 sans_font_name != system_lyxrc.sans_font_name) {
1709 os << "\\screen_font_sans \"" << sans_font_name
1714 case RC_SCREEN_FONT_SANS_FOUNDRY:
1715 if (ignore_system_lyxrc ||
1716 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1717 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1722 case RC_SCREEN_FONT_TYPEWRITER:
1723 if (ignore_system_lyxrc ||
1724 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1725 os << "\\screen_font_typewriter \""
1726 << typewriter_font_name << "\"\n";
1730 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1731 if (ignore_system_lyxrc ||
1732 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1733 os << "\\screen_font_typewriter_foundry \""
1734 << typewriter_font_foundry << "\"\n";
1739 case RC_SCREEN_FONT_SCALABLE:
1740 if (ignore_system_lyxrc ||
1741 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1742 os << "\\screen_font_scalable "
1743 << convert<string>(use_scalable_fonts)
1748 case RC_SCREEN_FONT_SIZES:
1749 if (ignore_system_lyxrc ||
1750 font_sizes[FONT_SIZE_TINY]
1751 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1752 font_sizes[FONT_SIZE_SCRIPT]
1753 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1754 font_sizes[FONT_SIZE_FOOTNOTE]
1755 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1756 font_sizes[FONT_SIZE_SMALL]
1757 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1758 font_sizes[FONT_SIZE_NORMAL]
1759 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1760 font_sizes[FONT_SIZE_LARGE]
1761 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1762 font_sizes[FONT_SIZE_LARGER]
1763 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1764 font_sizes[FONT_SIZE_LARGEST]
1765 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1766 font_sizes[FONT_SIZE_HUGE]
1767 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1768 font_sizes[FONT_SIZE_HUGER]
1769 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1770 os.setf(ios::fixed);
1772 os << "\\screen_font_sizes"
1773 << ' ' << font_sizes[FONT_SIZE_TINY]
1774 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1775 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1776 << ' ' << font_sizes[FONT_SIZE_SMALL]
1777 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1778 << ' ' << font_sizes[FONT_SIZE_LARGE]
1779 << ' ' << font_sizes[FONT_SIZE_LARGER]
1780 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1781 << ' ' << font_sizes[FONT_SIZE_HUGE]
1782 << ' ' << font_sizes[FONT_SIZE_HUGER]
1787 case RC_FULL_SCREEN_LIMIT:
1788 if (ignore_system_lyxrc ||
1789 full_screen_limit != system_lyxrc.full_screen_limit) {
1790 os << "\\fullscreen_limit "
1791 << convert<string>(full_screen_limit)
1796 case RC_FULL_SCREEN_TOOLBARS:
1797 if (ignore_system_lyxrc ||
1798 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1799 os << "\\fullscreen_toolbars "
1800 << convert<string>(full_screen_toolbars)
1805 case RC_FULL_SCREEN_SCROLLBAR:
1806 if (ignore_system_lyxrc ||
1807 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1808 os << "\\fullscreen_scrollbar "
1809 << convert<string>(full_screen_scrollbar)
1814 case RC_FULL_SCREEN_TABBAR:
1815 if (ignore_system_lyxrc ||
1816 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1817 os << "\\fullscreen_tabbar "
1818 << convert<string>(full_screen_tabbar)
1823 case RC_FULL_SCREEN_MENUBAR:
1824 if (ignore_system_lyxrc ||
1825 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1826 os << "\\fullscreen_menubar "
1827 << convert<string>(full_screen_menubar)
1832 case RC_FULL_SCREEN_WIDTH:
1833 if (ignore_system_lyxrc ||
1834 full_screen_width != system_lyxrc.full_screen_width) {
1835 os << "\\fullscreen_width "
1836 << convert<string>(full_screen_width)
1841 case RC_OPEN_BUFFERS_IN_TABS:
1842 if (ignore_system_lyxrc ||
1843 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1844 os << "\\open_buffers_in_tabs "
1845 << convert<string>(open_buffers_in_tabs)
1850 case RC_SINGLE_CLOSE_TAB_BUTTON:
1851 if (ignore_system_lyxrc ||
1852 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1853 os << "\\single_close_tab_button "
1854 << convert<string>(single_close_tab_button)
1859 case RC_FORWARD_SEARCH:
1860 if (ignore_system_lyxrc ||
1861 forward_search != system_lyxrc.forward_search) {
1862 os << "\\forward_search " << forward_search << '\n';
1868 << "# COLOR SECTION ###################################\n"
1872 for (int i = 0; i < Color_ignore; ++i) {
1873 ColorCode lc = static_cast<ColorCode>(i);
1874 string const col = lcolor.getX11Name(lc);
1875 if (ignore_system_lyxrc
1876 || col != system_lcolor.getX11Name(lc)) {
1877 os << "\\set_color \""
1878 << lcolor.getLyXName(lc) << "\" \""
1886 << "# PRINTER SECTION ###################################\n"
1890 if (ignore_system_lyxrc ||
1891 printer != system_lyxrc.printer) {
1892 os << "\\printer \"" << printer << "\"\n";
1896 case RC_PRINT_ADAPTOUTPUT:
1897 if (ignore_system_lyxrc ||
1898 print_adapt_output != system_lyxrc.print_adapt_output) {
1899 os << "\\print_adapt_output "
1900 << convert<string>(print_adapt_output)
1905 case RC_PRINT_COMMAND:
1906 if (ignore_system_lyxrc ||
1907 print_command != system_lyxrc.print_command) {
1908 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1912 case RC_PRINTEXSTRAOPTIONS:
1913 if (ignore_system_lyxrc ||
1914 print_extra_options != system_lyxrc.print_extra_options) {
1915 os << "\\print_extra_options \"" << print_extra_options
1920 case RC_PRINTSPOOL_COMMAND:
1921 if (ignore_system_lyxrc ||
1922 print_spool_command != system_lyxrc.print_spool_command) {
1923 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1928 case RC_PRINTSPOOL_PRINTERPREFIX:
1929 if (ignore_system_lyxrc ||
1930 print_spool_printerprefix
1931 != system_lyxrc.print_spool_printerprefix) {
1932 os << "\\print_spool_printerprefix \""
1933 << print_spool_printerprefix << "\"\n";
1937 case RC_PRINTEVENPAGEFLAG:
1938 if (ignore_system_lyxrc ||
1939 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1940 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1945 case RC_PRINTODDPAGEFLAG:
1946 if (ignore_system_lyxrc ||
1947 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1948 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1953 case RC_PRINTREVERSEFLAG:
1954 if (ignore_system_lyxrc ||
1955 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1956 os << "\\print_reverse_flag \"" << print_reverse_flag
1961 case RC_PRINTLANDSCAPEFLAG:
1962 if (ignore_system_lyxrc ||
1963 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1964 os << "\\print_landscape_flag \"" << print_landscape_flag
1969 case RC_PRINTPAGERANGEFLAG:
1970 if (ignore_system_lyxrc ||
1971 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1972 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1977 case RC_PRINTCOPIESFLAG:
1978 if (ignore_system_lyxrc ||
1979 print_copies_flag != system_lyxrc.print_copies_flag) {
1980 os << "\\print_copies_flag \"" << print_copies_flag
1985 case RC_PRINTCOLLCOPIESFLAG:
1986 if (ignore_system_lyxrc ||
1987 print_collcopies_flag
1988 != system_lyxrc.print_collcopies_flag) {
1989 os << "\\print_collcopies_flag \""
1990 << print_collcopies_flag
1995 case RC_PRINTPAPERFLAG:
1996 if (ignore_system_lyxrc ||
1997 print_paper_flag != system_lyxrc.print_paper_flag) {
1998 os << "\\print_paper_flag \"" << print_paper_flag
2003 case RC_PRINTPAPERDIMENSIONFLAG:
2004 if (ignore_system_lyxrc ||
2005 print_paper_dimension_flag
2006 != system_lyxrc.print_paper_dimension_flag) {
2007 os << "\\print_paper_dimension_flag \""
2008 << print_paper_dimension_flag << "\"\n";
2012 case RC_PRINTTOPRINTER:
2013 if (ignore_system_lyxrc ||
2014 print_to_printer != system_lyxrc.print_to_printer) {
2015 os << "\\print_to_printer \"" << print_to_printer
2020 case RC_PRINTTOFILE:
2021 if (ignore_system_lyxrc ||
2022 print_to_file != system_lyxrc.print_to_file) {
2023 string const path = os::external_path(print_to_file);
2024 os << "\\print_to_file \"" << path << "\"\n";
2028 case RC_PRINTFILEEXTENSION:
2029 if (ignore_system_lyxrc ||
2030 print_file_extension != system_lyxrc.print_file_extension) {
2031 os << "\\print_file_extension \""
2032 << print_file_extension
2039 << "# TEX SECTION #######################################\n"
2042 case RC_FONT_ENCODING:
2043 if (ignore_system_lyxrc ||
2044 fontenc != system_lyxrc.fontenc) {
2045 os << "\\font_encoding \"" << fontenc << "\"\n";
2051 << "# FILE SECTION ######################################\n"
2054 case RC_DOCUMENTPATH:
2055 if (ignore_system_lyxrc ||
2056 document_path != system_lyxrc.document_path) {
2057 string const path = os::external_path(document_path);
2058 os << "\\document_path \"" << path << "\"\n";
2062 case RC_USELASTFILEPOS:
2063 if (ignore_system_lyxrc ||
2064 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2065 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2070 case RC_LOADSESSION:
2071 if (ignore_system_lyxrc ||
2072 load_session != system_lyxrc.load_session) {
2073 os << "\\load_session " << convert<string>(load_session)
2078 case RC_MOUSE_WHEEL_SPEED:
2079 if (ignore_system_lyxrc ||
2080 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2081 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2085 case RC_COMPLETION_INLINE_DELAY:
2086 if (ignore_system_lyxrc ||
2087 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2088 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2092 case RC_COMPLETION_INLINE_MATH:
2093 if (ignore_system_lyxrc ||
2094 completion_inline_math != system_lyxrc.completion_inline_math) {
2095 os << "\\completion_inline_math "
2096 << convert<string>(completion_inline_math) << '\n';
2100 case RC_COMPLETION_INLINE_TEXT:
2101 if (ignore_system_lyxrc ||
2102 completion_inline_text != system_lyxrc.completion_inline_text) {
2103 os << "\\completion_inline_text "
2104 << convert<string>(completion_inline_text) << '\n';
2108 case RC_COMPLETION_INLINE_DOTS:
2109 if (ignore_system_lyxrc ||
2110 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2111 os << "\\completion_inline_dots "
2112 << convert<string>(completion_inline_dots) << '\n';
2116 case RC_AUTOCORRECTION_MATH:
2117 if (ignore_system_lyxrc ||
2118 autocorrection_math != system_lyxrc.autocorrection_math) {
2119 os << "\\autocorrection_math "
2120 << convert<string>(autocorrection_math) << '\n';
2124 case RC_COMPLETION_POPUP_DELAY:
2125 if (ignore_system_lyxrc ||
2126 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2127 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2131 case RC_COMPLETION_POPUP_MATH:
2132 if (ignore_system_lyxrc ||
2133 completion_popup_math != system_lyxrc.completion_popup_math) {
2134 os << "\\completion_popup_math "
2135 << convert<string>(completion_popup_math) << '\n';
2139 case RC_COMPLETION_POPUP_TEXT:
2140 if (ignore_system_lyxrc ||
2141 completion_popup_text != system_lyxrc.completion_popup_text) {
2142 os << "\\completion_popup_text "
2143 << convert<string>(completion_popup_text) << '\n';
2147 case RC_COMPLETION_CURSOR_TEXT:
2148 if (ignore_system_lyxrc ||
2149 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2150 os << "\\completion_cursor_text "
2151 << convert<string>(completion_cursor_text) << '\n';
2155 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2156 if (ignore_system_lyxrc ||
2157 completion_popup_after_complete
2158 != system_lyxrc.completion_popup_after_complete) {
2159 os << "\\completion_popup_after_complete "
2160 << convert<string>(completion_popup_after_complete) << '\n';
2164 case RC_NUMLASTFILES:
2165 if (ignore_system_lyxrc ||
2166 num_lastfiles != system_lyxrc.num_lastfiles) {
2167 os << "\\num_lastfiles " << num_lastfiles << '\n';
2171 case RC_CHECKLASTFILES:
2172 if (ignore_system_lyxrc ||
2173 check_lastfiles != system_lyxrc.check_lastfiles) {
2174 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2179 case RC_EXAMPLEPATH:
2180 if (ignore_system_lyxrc ||
2181 example_path != system_lyxrc.example_path) {
2182 string const path = os::external_path(example_path);
2183 os << "\\example_path \"" << path << "\"\n";
2187 case RC_TEMPLATEPATH:
2188 if (ignore_system_lyxrc ||
2189 template_path != system_lyxrc.template_path) {
2190 string const path = os::external_path(template_path);
2191 os << "\\template_path \"" << path << "\"\n";
2195 case RC_TEMPDIRPATH:
2196 if (ignore_system_lyxrc ||
2197 tempdir_path != system_lyxrc.tempdir_path) {
2198 string const path = os::external_path(tempdir_path);
2199 os << "\\tempdir_path \"" << path << "\"\n";
2203 case RC_THESAURUSDIRPATH:
2204 if (ignore_system_lyxrc ||
2205 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2206 string const path = os::external_path(thesaurusdir_path);
2207 os << "\\thesaurusdir_path \"" << path << "\"\n";
2211 case RC_HUNSPELLDIR_PATH:
2212 if (ignore_system_lyxrc ||
2213 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2214 string const path = os::external_path(hunspelldir_path);
2215 os << "\\hunspelldir_path \"" << path << "\"\n";
2223 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2226 case RC_PLAINTEXT_LINELEN:
2227 if (ignore_system_lyxrc ||
2228 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2229 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2233 case RC_MAKE_BACKUP:
2234 if (ignore_system_lyxrc ||
2235 make_backup != system_lyxrc.make_backup) {
2236 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2240 case RC_SAVE_COMPRESSED:
2241 if (ignore_system_lyxrc ||
2242 save_compressed != system_lyxrc.save_compressed) {
2243 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2247 case RC_BACKUPDIR_PATH:
2248 if (ignore_system_lyxrc ||
2249 backupdir_path != system_lyxrc.backupdir_path) {
2250 string const path = os::external_path(backupdir_path);
2251 os << "\\backupdir_path \"" << path << "\"\n";
2257 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2261 << "# SPELLCHECKER SECTION ##############################\n"
2264 case RC_SPELL_COMMAND:
2265 case RC_USE_SPELL_LIB:
2269 case RC_ACCEPT_COMPOUND:
2270 if (ignore_system_lyxrc ||
2271 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2272 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2277 case RC_USE_ALT_LANG:
2282 if (ignore_system_lyxrc ||
2283 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2284 os << "\\alternate_language \"" << spellchecker_alt_lang
2289 case RC_USE_ESC_CHARS:
2293 if (ignore_system_lyxrc ||
2294 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2295 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2299 case RC_USE_PERS_DICT:
2303 case RC_USE_TOOLTIP:
2304 if (ignore_system_lyxrc ||
2305 use_tooltip != system_lyxrc.use_tooltip) {
2306 os << "\\use_tooltip "
2307 << convert<string>(use_tooltip)
2312 case RC_USE_PIXMAP_CACHE:
2313 if (ignore_system_lyxrc ||
2314 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2315 os << "\\use_pixmap_cache "
2316 << convert<string>(use_pixmap_cache)
2325 case RC_USE_INP_ENC:
2331 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2336 case RC_SPELLCHECKER:
2337 if (ignore_system_lyxrc ||
2338 spellchecker != system_lyxrc.spellchecker) {
2339 os << "\\spellchecker " << spellchecker << '\n';
2344 case RC_SPELLCHECK_CONTINUOUSLY:
2345 if (ignore_system_lyxrc ||
2346 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2347 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2353 case RC_SPELLCHECK_NOTES:
2354 if (ignore_system_lyxrc ||
2355 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2356 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2362 case RC_RTL_SUPPORT:
2363 if (ignore_system_lyxrc ||
2364 rtl_support != system_lyxrc.rtl_support) {
2365 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2369 case RC_VISUAL_CURSOR:
2370 if (ignore_system_lyxrc ||
2371 visual_cursor != system_lyxrc.visual_cursor) {
2372 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2376 case RC_LANGUAGE_PACKAGE:
2377 if (ignore_system_lyxrc ||
2378 language_package != system_lyxrc.language_package) {
2379 os << "\\language_package \"" << language_package
2384 case RC_LANGUAGE_GLOBAL_OPTIONS:
2385 if (ignore_system_lyxrc ||
2386 language_global_options
2387 != system_lyxrc.language_global_options) {
2388 os << "\\language_global_options \""
2389 << convert<string>(language_global_options)
2394 case RC_LANGUAGE_USE_BABEL:
2395 if (ignore_system_lyxrc ||
2396 language_use_babel != system_lyxrc.language_use_babel) {
2397 os << "\\language_use_babel \""
2398 << convert<string>(language_use_babel)
2403 case RC_LANGUAGE_COMMAND_BEGIN:
2404 if (ignore_system_lyxrc ||
2405 language_command_begin
2406 != system_lyxrc.language_command_begin) {
2407 os << "\\language_command_begin \""
2408 << language_command_begin
2413 case RC_LANGUAGE_COMMAND_END:
2414 if (ignore_system_lyxrc ||
2415 language_command_end
2416 != system_lyxrc.language_command_end) {
2417 os << "\\language_command_end \"" << language_command_end
2422 case RC_LANGUAGE_COMMAND_LOCAL:
2423 if (ignore_system_lyxrc ||
2424 language_command_local
2425 != system_lyxrc.language_command_local) {
2426 os << "\\language_command_local \""
2427 << language_command_local
2432 case RC_LANGUAGE_AUTO_BEGIN:
2433 if (ignore_system_lyxrc ||
2434 language_auto_begin != system_lyxrc.language_auto_begin) {
2435 os << "\\language_auto_begin "
2436 << convert<string>(language_auto_begin) << '\n';
2440 case RC_LANGUAGE_AUTO_END:
2441 if (ignore_system_lyxrc ||
2442 language_auto_end != system_lyxrc.language_auto_end) {
2443 os << "\\language_auto_end "
2444 << convert<string>(language_auto_end) << '\n';
2448 case RC_MARK_FOREIGN_LANGUAGE:
2449 if (ignore_system_lyxrc ||
2450 mark_foreign_language
2451 != system_lyxrc.mark_foreign_language) {
2452 os << "\\mark_foreign_language " <<
2453 convert<string>(mark_foreign_language) << '\n';
2459 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2462 case RC_AUTO_NUMBER:
2463 if (ignore_system_lyxrc ||
2464 auto_number != system_lyxrc.auto_number) {
2465 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2469 case RC_DEFAULT_LANGUAGE:
2470 if (ignore_system_lyxrc ||
2471 default_language != system_lyxrc.default_language) {
2472 os << "\\default_language " << default_language << '\n';
2476 case RC_GUI_LANGUAGE:
2477 if (ignore_system_lyxrc ||
2478 gui_language != system_lyxrc.gui_language) {
2479 os << "\\gui_language " << gui_language << '\n';
2485 << "# FORMATS SECTION ##########################\n"
2489 // New/modified formats
2490 for (Formats::const_iterator cit = formats.begin();
2491 cit != formats.end(); ++cit) {
2492 Format const * format =
2493 system_formats.getFormat(cit->name());
2495 format->extension() != cit->extension() ||
2496 format->prettyname() != cit->prettyname() ||
2497 format->shortcut() != cit->shortcut() ||
2498 format->viewer() != cit->viewer() ||
2499 format->editor() != cit->editor() ||
2500 format->documentFormat() != cit->documentFormat() ||
2501 format->vectorFormat() != cit->vectorFormat()) {
2502 os << "\\format \"" << cit->name() << "\" \""
2503 << cit->extension() << "\" \""
2504 << cit->prettyname() << "\" \""
2505 << cit->shortcut() << "\" \""
2506 << escapeCommand(cit->viewer()) << "\" \""
2507 << escapeCommand(cit->editor()) << "\" \"";
2508 vector<string> flags;
2509 if (cit->documentFormat())
2510 flags.push_back("document");
2511 if (cit->vectorFormat())
2512 flags.push_back("vector");
2513 os << getStringFromVector(flags);
2518 // Look for deleted formats
2519 for (Formats::const_iterator cit = system_formats.begin();
2520 cit != system_formats.end(); ++cit)
2521 if (!formats.getFormat(cit->name()))
2522 os << "\\format \"" << cit->name()
2523 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2526 case RC_VIEWER_ALTERNATIVES: {
2527 Alternatives::const_iterator it = viewer_alternatives.begin();
2528 Alternatives::const_iterator const en = viewer_alternatives.end();
2529 Alternatives::const_iterator const sysend =
2530 system_lyxrc.viewer_alternatives.end();
2531 for (; it != en; ++it) {
2532 string const & fmt = it->first;
2533 CommandSet const & cmd = it->second;
2534 CommandSet::const_iterator sit = cmd.begin();
2535 CommandSet::const_iterator const sen = cmd.end();
2536 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2537 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2538 system_lyxrc.viewer_alternatives.find(fmt);
2539 for (; sit != sen; ++sit) {
2540 string const & cmd = *sit;
2541 if (ignore_system_lyxrc
2542 || sysfmt == sysend // format not found
2543 || sysfmt->second.count(cmd) == 0 // this command not found
2545 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2551 case RC_EDITOR_ALTERNATIVES: {
2552 Alternatives::const_iterator it = editor_alternatives.begin();
2553 Alternatives::const_iterator const en = editor_alternatives.end();
2554 Alternatives::const_iterator const sysend =
2555 system_lyxrc.editor_alternatives.end();
2556 for (; it != en; ++it) {
2557 string const & fmt = it->first;
2558 CommandSet const & cmd = it->second;
2559 CommandSet::const_iterator sit = cmd.begin();
2560 CommandSet::const_iterator const sen = cmd.end();
2561 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2562 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2563 system_lyxrc.editor_alternatives.find(fmt);
2564 for (; sit != sen; ++sit) {
2565 string const & cmd = *sit;
2566 if (ignore_system_lyxrc
2567 || sysfmt == sysend // format not found
2568 || sysfmt->second.count(cmd) == 0 // this command not found
2570 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2576 case RC_DEFAULT_VIEW_FORMAT:
2577 if (ignore_system_lyxrc ||
2578 default_view_format != system_lyxrc.default_view_format) {
2579 os << "\\default_view_format " << default_view_format << '\n';
2589 << "# CONVERTERS SECTION ##########################\n"
2593 // Look for new converters
2594 for (Converters::const_iterator cit = theConverters().begin();
2595 cit != theConverters().end(); ++cit) {
2596 Converter const * converter =
2597 theSystemConverters().getConverter(cit->from,
2600 converter->command != cit->command ||
2601 converter->flags != cit->flags)
2602 os << "\\converter \"" << cit->from << "\" \""
2603 << cit->to << "\" \""
2604 << escapeCommand(cit->command) << "\" \""
2605 << cit->flags << "\"\n";
2608 // New/modifed converters
2609 for (Converters::const_iterator cit = theSystemConverters().begin();
2610 cit != theSystemConverters().end(); ++cit)
2611 if (!theConverters().getConverter(cit->from, cit->to))
2612 os << "\\converter \"" << cit->from
2613 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2620 << "# COPIERS SECTION ##########################\n"
2623 // Look for new movers
2624 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2625 Movers::const_iterator const sysend = theSystemMovers().end();
2626 Movers::const_iterator it = theMovers().begin();
2627 Movers::const_iterator end = theMovers().end();
2629 for (; it != end; ++it) {
2630 Movers::const_iterator const sysit =
2631 find_if(sysbegin, sysend, SameMover(*it));
2632 if (sysit == sysend) {
2633 string const & fmt = it->first;
2634 string const & command =
2635 it->second.command();
2637 os << "\\copier " << fmt
2638 << " \"" << escapeCommand(command) << "\"\n";
2644 // We don't actually delete SpecialisedMover(s) from the
2645 // map, just clear their 'command', so there's no need
2646 // to test for anything else.
2653 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2655 // Why the switch you might ask. It is a trick to ensure that all
2656 // the elements in the LyXRCTags enum is handled. As you can see
2657 // there are no breaks at all. So it is just a huge fall-through.
2658 // The nice thing is that we will get a warning from the compiler
2659 // if we forget an element.
2660 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2662 case LyXRC::RC_ACCEPT_COMPOUND:
2663 case LyXRC::RC_ALT_LANG:
2664 case LyXRC::RC_PLAINTEXT_LINELEN:
2665 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2666 case LyXRC::RC_AUTOCORRECTION_MATH:
2667 case LyXRC::RC_AUTOREGIONDELETE:
2668 case LyXRC::RC_AUTORESET_OPTIONS:
2669 case LyXRC::RC_AUTOSAVE:
2670 case LyXRC::RC_AUTO_NUMBER:
2671 case LyXRC::RC_BACKUPDIR_PATH:
2672 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2673 case LyXRC::RC_BIBTEX_COMMAND:
2674 case LyXRC::RC_BINDFILE:
2675 case LyXRC::RC_CHECKLASTFILES:
2676 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2677 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2678 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2679 case LyXRC::RC_COMPLETION_INLINE_MATH:
2680 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2681 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2682 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2683 case LyXRC::RC_COMPLETION_POPUP_MATH:
2684 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2685 case LyXRC::RC_USELASTFILEPOS:
2686 case LyXRC::RC_LOADSESSION:
2687 case LyXRC::RC_CHKTEX_COMMAND:
2688 case LyXRC::RC_CONVERTER:
2689 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2690 case LyXRC::RC_COPIER:
2691 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2692 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2693 case LyXRC::RC_DATE_INSERT_FORMAT:
2694 case LyXRC::RC_DEFAULT_LANGUAGE:
2695 case LyXRC::RC_GUI_LANGUAGE:
2696 case LyXRC::RC_DEFAULT_PAPERSIZE:
2697 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2698 case LyXRC::RC_DEFFILE:
2699 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2700 case LyXRC::RC_DISPLAY_GRAPHICS:
2701 case LyXRC::RC_DOCUMENTPATH:
2702 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2703 FileName path(lyxrc_new.document_path);
2704 if (path.exists() && path.isDirectory())
2705 package().document_dir() = FileName(lyxrc.document_path);
2707 case LyXRC::RC_EDITOR_ALTERNATIVES:
2708 case LyXRC::RC_ESC_CHARS:
2709 case LyXRC::RC_EXAMPLEPATH:
2710 case LyXRC::RC_FONT_ENCODING:
2711 case LyXRC::RC_FORMAT:
2712 case LyXRC::RC_GROUP_LAYOUTS:
2713 case LyXRC::RC_HUNSPELLDIR_PATH:
2714 case LyXRC::RC_INDEX_ALTERNATIVES:
2715 case LyXRC::RC_INDEX_COMMAND:
2716 case LyXRC::RC_JBIBTEX_COMMAND:
2717 case LyXRC::RC_JINDEX_COMMAND:
2718 case LyXRC::RC_NOMENCL_COMMAND:
2719 case LyXRC::RC_INPUT:
2720 case LyXRC::RC_KBMAP:
2721 case LyXRC::RC_KBMAP_PRIMARY:
2722 case LyXRC::RC_KBMAP_SECONDARY:
2723 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2724 case LyXRC::RC_LANGUAGE_AUTO_END:
2725 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2726 case LyXRC::RC_LANGUAGE_COMMAND_END:
2727 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2728 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2729 case LyXRC::RC_LANGUAGE_PACKAGE:
2730 case LyXRC::RC_LANGUAGE_USE_BABEL:
2731 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2732 case LyXRC::RC_MACRO_EDIT_STYLE:
2733 case LyXRC::RC_MAKE_BACKUP:
2734 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2735 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2736 case LyXRC::RC_NUMLASTFILES:
2737 case LyXRC::RC_PARAGRAPH_MARKERS:
2738 case LyXRC::RC_PATH_PREFIX:
2739 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2740 prependEnvPath("PATH", lyxrc.path_prefix);
2742 case LyXRC::RC_PERS_DICT:
2743 case LyXRC::RC_PREVIEW:
2744 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2745 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2746 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2747 case LyXRC::RC_PRINTCOPIESFLAG:
2748 case LyXRC::RC_PRINTER:
2749 case LyXRC::RC_PRINTEVENPAGEFLAG:
2750 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2751 case LyXRC::RC_PRINTFILEEXTENSION:
2752 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2753 case LyXRC::RC_PRINTODDPAGEFLAG:
2754 case LyXRC::RC_PRINTPAGERANGEFLAG:
2755 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2756 case LyXRC::RC_PRINTPAPERFLAG:
2757 case LyXRC::RC_PRINTREVERSEFLAG:
2758 case LyXRC::RC_PRINTSPOOL_COMMAND:
2759 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2760 case LyXRC::RC_PRINTTOFILE:
2761 case LyXRC::RC_PRINTTOPRINTER:
2762 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2763 case LyXRC::RC_PRINT_COMMAND:
2764 case LyXRC::RC_RTL_SUPPORT:
2765 case LyXRC::RC_SAVE_COMPRESSED:
2766 case LyXRC::RC_SCREEN_DPI:
2767 case LyXRC::RC_SCREEN_FONT_ROMAN:
2768 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2769 case LyXRC::RC_SCREEN_FONT_SANS:
2770 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2771 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2772 case LyXRC::RC_SCREEN_FONT_SIZES:
2773 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2774 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2775 case LyXRC::RC_GEOMETRY_SESSION:
2776 case LyXRC::RC_SCREEN_ZOOM:
2777 case LyXRC::RC_SERVERPIPE:
2778 case LyXRC::RC_SET_COLOR:
2779 case LyXRC::RC_SHOW_BANNER:
2780 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2781 case LyXRC::RC_SPELL_COMMAND:
2782 case LyXRC::RC_SPELLCHECKER:
2783 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2784 case LyXRC::RC_SPELLCHECK_NOTES:
2785 case LyXRC::RC_SPLITINDEX_COMMAND:
2786 case LyXRC::RC_TEMPDIRPATH:
2787 case LyXRC::RC_TEMPLATEPATH:
2788 case LyXRC::RC_TEX_ALLOWS_SPACES:
2789 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2790 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2791 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2793 case LyXRC::RC_THESAURUSDIRPATH:
2794 case LyXRC::RC_UIFILE:
2795 case LyXRC::RC_USER_EMAIL:
2796 case LyXRC::RC_USER_NAME:
2797 case LyXRC::RC_USETEMPDIR:
2798 case LyXRC::RC_USE_ALT_LANG:
2799 case LyXRC::RC_USE_CONVERTER_CACHE:
2800 case LyXRC::RC_USE_ESC_CHARS:
2801 case LyXRC::RC_USE_INP_ENC:
2802 case LyXRC::RC_USE_PERS_DICT:
2803 case LyXRC::RC_USE_TOOLTIP:
2804 case LyXRC::RC_USE_PIXMAP_CACHE:
2805 case LyXRC::RC_USE_SPELL_LIB:
2806 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2807 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2808 case LyXRC::RC_SORT_LAYOUTS:
2809 case LyXRC::RC_FULL_SCREEN_LIMIT:
2810 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2811 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2812 case LyXRC::RC_FULL_SCREEN_TABBAR:
2813 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2814 case LyXRC::RC_FULL_SCREEN_WIDTH:
2815 case LyXRC::RC_VISUAL_CURSOR:
2816 case LyXRC::RC_VIEWER:
2817 case LyXRC::RC_VIEWER_ALTERNATIVES:
2818 case LyXRC::RC_FORWARD_SEARCH:
2819 case LyXRC::RC_LAST:
2826 string const LyXRC::getDescription(LyXRCTags tag)
2831 case RC_ACCEPT_COMPOUND:
2832 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2836 case RC_USE_ALT_LANG:
2837 str = _("Specify an alternate language. The default is to use the language of the document.");
2840 case RC_PLAINTEXT_ROFF_COMMAND:
2841 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.");
2844 case RC_PLAINTEXT_LINELEN:
2845 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.");
2848 case RC_AUTOREGIONDELETE:
2849 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2852 case RC_AUTORESET_OPTIONS:
2853 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2857 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2860 case RC_AUTO_NUMBER:
2863 case RC_BACKUPDIR_PATH:
2864 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.");
2867 case RC_BIBTEX_COMMAND:
2868 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2871 case RC_JBIBTEX_COMMAND:
2872 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2876 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2879 case RC_CHECKLASTFILES:
2880 str = _("Select to check whether the lastfiles still exist.");
2883 case RC_CHKTEX_COMMAND:
2884 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2893 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2894 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.");
2897 case RC_SCROLL_BELOW_DOCUMENT:
2898 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");
2901 case RC_MAC_LIKE_WORD_MOVEMENT:
2902 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2905 case RC_SHOW_MACRO_LABEL:
2906 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2909 case RC_DATE_INSERT_FORMAT:
2910 //xgettext:no-c-format
2911 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2915 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2918 case RC_DEFAULT_VIEW_FORMAT:
2919 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2922 case RC_DEFAULT_LANGUAGE:
2923 str = _("New documents will be assigned this language.");
2926 case RC_DEFAULT_PAPERSIZE:
2927 str = _("Specify the default paper size.");
2930 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2931 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2934 case RC_DISPLAY_GRAPHICS:
2935 str = _("Select how LyX will display any graphics.");
2938 case RC_DOCUMENTPATH:
2939 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2943 case RC_USE_ESC_CHARS:
2944 str = _("Specify additional chars that can be part of a word.");
2947 case RC_EXAMPLEPATH:
2948 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2951 case RC_FONT_ENCODING:
2952 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2958 case RC_INDEX_COMMAND:
2959 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\".");
2962 case RC_JINDEX_COMMAND:
2963 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2966 case RC_NOMENCL_COMMAND:
2967 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2974 case RC_KBMAP_PRIMARY:
2975 case RC_KBMAP_SECONDARY:
2976 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.");
2979 case RC_LANGUAGE_AUTO_BEGIN:
2980 str = _("Select if a language switching command is needed at the beginning of the document.");
2983 case RC_LANGUAGE_AUTO_END:
2984 str = _("Select if a language switching command is needed at the end of the document.");
2987 case RC_LANGUAGE_COMMAND_BEGIN:
2988 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.");
2991 case RC_LANGUAGE_COMMAND_END:
2992 str = _("The LaTeX command for changing back to the language of the document.");
2995 case RC_LANGUAGE_COMMAND_LOCAL:
2996 str = _("The LaTeX command for local changing of the language.");
2999 case RC_LANGUAGE_GLOBAL_OPTIONS:
3000 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3003 case RC_LANGUAGE_PACKAGE:
3004 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3007 case RC_LANGUAGE_USE_BABEL:
3008 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3011 case RC_USELASTFILEPOS:
3012 str = _("De-select if you do not want LyX to scroll to saved position.");
3015 case RC_LOADSESSION:
3016 str = _("De-select to prevent loading files opened from the last LyX session.");
3019 case RC_MAKE_BACKUP:
3020 str = _("De-select if you don't want LyX to create backup files.");
3023 case RC_MARK_FOREIGN_LANGUAGE:
3024 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3027 case RC_MOUSE_WHEEL_SPEED:
3028 str = bformat(_("The scrolling speed of the mouse wheel."),
3032 case RC_COMPLETION_POPUP_DELAY:
3033 str = _("The completion popup delay.");
3036 case RC_COMPLETION_POPUP_MATH:
3037 str = _("Select to display the completion popup in math mode.");
3040 case RC_COMPLETION_POPUP_TEXT:
3041 str = _("Select to display the completion popup in text mode.");
3044 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3045 str = _("Show the completion popup without delay after non-unique completion attempt.");
3048 case RC_COMPLETION_POPUP_TEXT:
3049 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3052 case RC_COMPLETION_POPUP_DELAY:
3053 str = _("The inline completion delay.");
3056 case RC_COMPLETION_INLINE_MATH:
3057 str = _("Select to display the inline completion in math mode.");
3060 case RC_COMPLETION_INLINE_TEXT:
3061 str = _("Select to display the inline completion in text mode.");
3064 case RC_COMPLETION_INLINE_DOTS:
3065 str = _("Use \"...\" to shorten long completions.");
3068 case RC_AUTOCORRECTION_MATH:
3069 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3072 case RC_NUMLASTFILES:
3073 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3077 case RC_PATH_PREFIX:
3078 str = _("Specify those directories which should be "
3079 "prepended to the PATH environment variable. "
3080 "Use the OS native format.");
3084 str = _("Shows a typeset preview of things such as math");
3087 case RC_PREVIEW_HASHED_LABELS:
3088 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3091 case RC_PREVIEW_SCALE_FACTOR:
3092 str = _("Scale the preview size to suit.");
3095 case RC_PRINTCOLLCOPIESFLAG:
3096 str = _("The option for specifying whether the copies should be collated.");
3099 case RC_PRINTCOPIESFLAG:
3100 str = _("The option for specifying the number of copies to print.");
3104 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3107 case RC_PRINTEVENPAGEFLAG:
3108 str = _("The option to print only even pages.");
3111 case RC_PRINTEXSTRAOPTIONS:
3112 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3115 case RC_PRINTFILEEXTENSION:
3116 str = _("Extension of printer program output file. Usually \".ps\".");
3119 case RC_PRINTLANDSCAPEFLAG:
3120 str = _("The option to print out in landscape.");
3123 case RC_PRINTODDPAGEFLAG:
3124 str = _("The option to print only odd pages.");
3127 case RC_PRINTPAGERANGEFLAG:
3128 str = _("The option for specifying a comma-separated list of pages to print.");
3131 case RC_PRINTPAPERDIMENSIONFLAG:
3132 str = _("Option to specify the dimensions of the print paper.");
3135 case RC_PRINTPAPERFLAG:
3136 str = _("The option to specify paper type.");
3139 case RC_PRINTREVERSEFLAG:
3140 str = _("The option to reverse the order of the pages printed.");
3143 case RC_PRINTSPOOL_COMMAND:
3144 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.");
3147 case RC_PRINTSPOOL_PRINTERPREFIX:
3148 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.");
3151 case RC_PRINTTOFILE:
3152 str = _("Option to pass to the print program to print to a file.");
3155 case RC_PRINTTOPRINTER:
3156 str = _("Option to pass to the print program to print on a specific printer.");
3159 case RC_PRINT_ADAPTOUTPUT:
3160 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3163 case RC_PRINT_COMMAND:
3164 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3167 case RC_RTL_SUPPORT:
3168 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3171 case RC_VISUAL_CURSOR:
3172 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3176 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3179 case RC_SCREEN_FONT_ROMAN:
3180 case RC_SCREEN_FONT_SANS:
3181 case RC_SCREEN_FONT_TYPEWRITER:
3182 str = _("The screen fonts used to display the text while editing.");
3185 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3186 case RC_SCREEN_FONT_SANS_FOUNDRY:
3187 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3190 case RC_SCREEN_FONT_SCALABLE:
3191 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.");
3194 case RC_SCREEN_FONT_SIZES:
3195 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3198 case RC_SCREEN_ZOOM:
3199 //xgettext:no-c-format
3200 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3203 case RC_GEOMETRY_SESSION:
3204 str = _("Allow session manager to save and restore windows geometry.");
3208 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3214 case RC_SHOW_BANNER:
3215 str = _("De-select if you don't want the startup banner.");
3218 case RC_TEMPDIRPATH:
3219 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3222 case RC_THESAURUSDIRPATH:
3223 str = _("This is the place where the files of the thesaurus library reside.");
3226 case RC_TEMPLATEPATH:
3227 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3230 case RC_TEX_ALLOWS_SPACES:
3233 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3237 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3249 case RC_USE_TOOLTIP:
3250 str = _("Enable the automatic appearance of tool tips in the work area.");
3253 case RC_USE_PIXMAP_CACHE:
3254 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3257 case RC_USE_SPELL_LIB:
3260 case RC_VIEWDVI_PAPEROPTION:
3261 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3276 // The global instance
3279 // The global copy of the system lyxrc entries (everything except preferences)