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"
31 #include "graphics/GraphicsTypes.h"
33 #include "support/convert.h"
34 #include "support/debug.h"
35 #include "support/environment.h"
36 #include "support/FileName.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/Package.h"
42 #include "support/userinfo.h"
48 using namespace lyx::support;
52 namespace os = support::os;
56 // when adding something to this array keep it sorted!
57 LexerKeyword lyxrcTags[] = {
58 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
59 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
60 { "\\alternate_language", LyXRC::RC_ALT_LANG },
61 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
62 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
63 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
64 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
65 { "\\autosave", LyXRC::RC_AUTOSAVE },
66 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
67 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
68 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
69 { "\\bind_file", LyXRC::RC_BINDFILE },
70 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
71 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
72 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
73 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
74 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
75 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
76 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
77 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
78 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
79 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
80 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
81 { "\\converter", LyXRC::RC_CONVERTER },
82 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
83 { "\\copier", LyXRC::RC_COPIER },
84 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
85 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
86 { "\\def_file", LyXRC::RC_DEFFILE },
87 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
88 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
89 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
90 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
91 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
92 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
93 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
94 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
95 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
96 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
97 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
98 { "\\format", LyXRC::RC_FORMAT },
99 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
100 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
101 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
102 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
103 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
104 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
105 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
106 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
107 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
108 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
109 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
110 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
111 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
112 { "\\input", LyXRC::RC_INPUT },
113 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
114 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
115 { "\\kbmap", LyXRC::RC_KBMAP },
116 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
117 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
118 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
119 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
120 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
121 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
122 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
123 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
124 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
125 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
126 { "\\load_session", LyXRC::RC_LOADSESSION },
127 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
128 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
129 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
130 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
131 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
132 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
133 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
134 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
135 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
136 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
137 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
138 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
139 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
140 { "\\preview", LyXRC::RC_PREVIEW },
141 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
142 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
143 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
144 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
145 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
146 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
147 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
148 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
149 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
150 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
151 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
152 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
153 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
154 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
155 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
156 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
157 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
158 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
159 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
160 { "\\printer", LyXRC::RC_PRINTER },
161 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
162 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
163 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
164 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
165 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
166 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
167 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
168 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
169 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
170 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
171 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
172 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
173 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
174 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
175 { "\\set_color", LyXRC::RC_SET_COLOR },
176 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
177 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
178 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
179 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
180 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
181 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
182 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
183 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
184 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
185 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
186 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
187 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
188 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
189 { "\\ui_file", LyXRC::RC_UIFILE },
190 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
191 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
192 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
193 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
194 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
195 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
196 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
197 // compatibility with versions older than 1.4.0 only
198 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
201 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
202 { "\\user_email", LyXRC::RC_USER_EMAIL },
203 { "\\user_name", LyXRC::RC_USER_NAME },
204 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
205 // compatibility with versions older than 1.4.0 only
206 { "\\viewer", LyXRC::RC_VIEWER},
207 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
208 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
211 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
222 void LyXRC::setDefaults()
225 def_file = "default";
227 // Get printer from the environment. If fail, use default "",
228 // assuming that everything is set up correctly.
229 printer = getEnv("PRINTER");
230 print_adapt_output = false;
231 print_command = "dvips";
232 print_evenpage_flag = "-B";
233 print_oddpage_flag = "-A";
234 print_pagerange_flag = "-pp";
235 print_copies_flag = "-c";
236 print_collcopies_flag = "-C";
237 print_reverse_flag = "-r";
238 print_landscape_flag = "-t landscape";
239 print_to_printer = "-P";
240 print_to_file = "-o ";
241 print_file_extension = ".ps";
242 print_paper_flag = "-t";
243 print_paper_dimension_flag = "-T";
244 document_path.erase();
245 view_dvi_paper_option.erase();
246 default_papersize = PAPER_DEFAULT;
247 default_view_format = "pdf2";
248 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
249 bibtex_command = "bibtex";
251 index_command = "makeindex -c -q";
252 nomencl_command = "makeindex -s nomencl.ist";
254 // Because a screen is typically wider than a piece of paper:
256 allow_geometry_session = true;
257 // Default LaTeX font size:
258 font_sizes[FONT_SIZE_TINY] = "5.0";
259 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
260 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
261 font_sizes[FONT_SIZE_SMALL] = "9.0";
262 font_sizes[FONT_SIZE_NORMAL] = "10.0";
263 font_sizes[FONT_SIZE_LARGE] = "12.0";
264 font_sizes[FONT_SIZE_LARGER] = "14.4";
265 font_sizes[FONT_SIZE_LARGEST] = "17.26";
266 font_sizes[FONT_SIZE_HUGE] = "20.74";
267 font_sizes[FONT_SIZE_HUGER] = "24.88";
268 use_scalable_fonts = true;
269 roman_font_name = "";
271 typewriter_font_name = "";
273 auto_region_delete = true;
274 auto_reset_options = false;
275 plaintext_linelen = 65;
276 mouse_wheel_speed = 1.0;
277 num_lastfiles = maxlastfiles;
278 check_lastfiles = true;
279 use_lastfilepos = true;
280 load_session = false;
282 save_compressed = false;
283 backupdir_path.erase();
284 display_graphics = true;
285 // Spellchecker settings:
286 #if defined(USE_ASPELL)
287 spellchecker = "aspell";
288 #elif defined(USE_HUNSPELL)
289 spellchecker = "hunspell";
291 spellchecker = "aspell";
293 spellchecker_accept_compound = false;
294 spellcheck_continuously = false;
295 spellcheck_notes = true;
298 visual_cursor = false;
300 mark_foreign_language = true;
301 language_auto_begin = true;
302 language_auto_end = true;
303 language_global_options = true;
304 language_use_babel = true;
305 language_package = "\\usepackage{babel}";
306 language_command_begin = "\\selectlanguage{$$lang}";
307 language_command_local = "\\foreignlanguage{$$lang}{";
308 sort_layouts = false;
309 group_layouts = true;
310 default_language = "english";
311 gui_language = "auto";
313 windows_style_tex_paths = false;
314 tex_allows_spaces = false;
315 date_insert_format = "%x";
316 cursor_follows_scrollbar = false;
317 scroll_below_document = false;
318 paragraph_markers = false;
319 mac_like_word_movement = false;
320 macro_edit_style = MACRO_EDIT_INLINE_BOX;
321 dialogs_iconify_with_main = false;
322 preview = PREVIEW_OFF;
323 preview_hashed_labels = false;
324 preview_scale_factor = 1.0;
325 use_converter_cache = true;
327 use_pixmap_cache = false;
328 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
329 user_name = to_utf8(support::user_name());
330 user_email = to_utf8(support::user_email());
331 open_buffers_in_tabs = true;
332 single_close_tab_button = false;
333 forward_search_dvi = string();
334 forward_search_pdf = string();
335 export_overwrite = NO_FILES;
337 // Fullscreen settings
338 full_screen_limit = false;
339 full_screen_toolbars = true;
340 full_screen_tabbar = true;
341 full_screen_menubar = true;
342 full_screen_scrollbar = true;
343 full_screen_width = 700;
345 completion_cursor_text = true;
346 completion_popup_math = true;
347 completion_popup_text = false;
348 completion_popup_delay = 2.0;
349 completion_popup_after_complete = true;
350 autocorrection_math = false;
351 completion_inline_math = true;
352 completion_inline_text = false;
353 completion_inline_dots = -1;
354 completion_inline_delay = 0.2;
360 void oldFontFormat(string & family, string & foundry)
362 if (family.empty() || family[0] != '-')
364 foundry = token(family, '-', 1);
365 family = token(family, '-', 2);
373 int LyXRC::read(FileName const & filename)
375 Lexer lexrc(lyxrcTags);
376 if (lyxerr.debugging(Debug::PARSER))
377 lexrc.printTable(lyxerr);
379 lexrc.setFile(filename);
383 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
389 int LyXRC::read(istream & is)
391 Lexer lexrc(lyxrcTags);
392 if (lyxerr.debugging(Debug::PARSER))
393 lexrc.printTable(lyxerr);
399 LYXERR(Debug::LYXRC, "Reading istream...");
405 int LyXRC::read(Lexer & lexrc)
410 while (lexrc.isOK()) {
411 // By using two switches we take advantage of the compiler
412 // telling us if we have missed a LyXRCTags element in
413 // the second switch.
414 // Note that this also shows a problem with Lexer since it
415 // helps us avoid taking advantage of the strictness of the
418 int le = lexrc.lex();
420 case Lexer::LEX_UNDEF:
421 lexrc.printError("Unknown tag `$$Token'");
423 case Lexer::LEX_FEOF:
428 switch (static_cast<LyXRCTags>(le)) {
429 case RC_INPUT: // Include file
432 libFileSearch(string(),
435 lexrc.printError("Error reading "
436 "included file: " + tmp.absFileName());
442 bind_file = os::internal_path(lexrc.getString());
447 def_file = os::internal_path(lexrc.getString());
452 ui_file = os::internal_path(lexrc.getString());
455 case RC_AUTORESET_OPTIONS:
456 lexrc >> auto_reset_options;
459 case RC_DISPLAY_GRAPHICS:
461 display_graphics = lexrc.getString() == "true";
464 case RC_TEX_EXPECTS_WINDOWS_PATHS:
465 lexrc >> windows_style_tex_paths;
468 case RC_TEX_ALLOWS_SPACES:
469 lexrc >> tex_allows_spaces;
476 case RC_KBMAP_PRIMARY:
478 string const kmap(os::internal_path(lexrc.getString()));
479 if (!libFileSearch("kbd", kmap, "kmap").empty()
481 primary_kbmap = kmap;
483 lexrc.printError("LyX: Keymap `$$Token' not found");
488 case RC_KBMAP_SECONDARY:
490 string const kmap(os::internal_path(lexrc.getString()));
491 if (!libFileSearch("kbd", kmap, "kmap").empty()
493 secondary_kbmap = kmap;
495 lexrc.printError("LyX: Keymap `$$Token' not found");
500 case RC_FONT_ENCODING:
508 case RC_PRINT_COMMAND:
509 if (lexrc.next(true)) {
510 print_command = lexrc.getString();
514 case RC_PRINTEVENPAGEFLAG:
515 lexrc >> print_evenpage_flag;
518 case RC_PRINTODDPAGEFLAG:
519 lexrc >> print_oddpage_flag;
522 case RC_PRINTPAGERANGEFLAG:
523 lexrc >> print_pagerange_flag;
526 case RC_PRINTCOPIESFLAG:
527 lexrc >> print_copies_flag;
530 case RC_PRINTCOLLCOPIESFLAG:
531 lexrc >> print_collcopies_flag;
534 case RC_PRINTREVERSEFLAG:
535 lexrc >> print_reverse_flag;
538 case RC_PRINTLANDSCAPEFLAG:
539 lexrc >> print_landscape_flag;
542 case RC_PRINTTOPRINTER:
543 lexrc >> print_to_printer;
546 case RC_PRINT_ADAPTOUTPUT:
547 lexrc >> print_adapt_output;
552 print_to_file = os::internal_path(lexrc.getString());
556 case RC_PRINTFILEEXTENSION:
557 lexrc >> print_file_extension;
560 case RC_PRINTEXSTRAOPTIONS:
561 lexrc >> print_extra_options;
564 case RC_PRINTSPOOL_COMMAND:
565 if (lexrc.next(true)) {
566 print_spool_command = lexrc.getString();
570 case RC_PRINTSPOOL_PRINTERPREFIX:
571 lexrc >> print_spool_printerprefix;
574 case RC_PRINTPAPERDIMENSIONFLAG:
575 lexrc >> print_paper_dimension_flag;
578 case RC_PRINTPAPERFLAG:
579 lexrc >> print_paper_flag;
582 case RC_DEFAULT_PAPERSIZE:
584 string const size = ascii_lowercase(lexrc.getString());
585 if (size == "usletter")
586 default_papersize = PAPER_USLETTER;
587 else if (size == "legal")
588 default_papersize = PAPER_USLEGAL;
589 else if (size == "executive")
590 default_papersize = PAPER_USEXECUTIVE;
591 else if (size == "a3")
592 default_papersize = PAPER_A3;
593 else if (size == "a4")
594 default_papersize = PAPER_A4;
595 else if (size == "a5")
596 default_papersize = PAPER_A5;
597 else if (size == "b5")
598 default_papersize = PAPER_B5;
599 else if (size == "default")
600 default_papersize = PAPER_DEFAULT;
604 case RC_VIEWDVI_PAPEROPTION:
606 view_dvi_paper_option = lexrc.getString();
608 view_dvi_paper_option.erase();
611 case RC_CHKTEX_COMMAND:
612 if (lexrc.next(true)) {
613 chktex_command = lexrc.getString();
617 case RC_BIBTEX_ALTERNATIVES:
618 if (lexrc.next(true)) {
619 bibtex_alternatives.insert(lexrc.getString());
623 case RC_BIBTEX_COMMAND:
624 if (lexrc.next(true)) {
625 bibtex_command = lexrc.getString();
629 case RC_JBIBTEX_COMMAND:
630 if (lexrc.next(true)) {
631 jbibtex_command = lexrc.getString();
635 case RC_INDEX_ALTERNATIVES:
636 if (lexrc.next(true)) {
637 index_alternatives.insert(lexrc.getString());
641 case RC_INDEX_COMMAND:
642 if (lexrc.next(true)) {
643 index_command = lexrc.getString();
647 case RC_JINDEX_COMMAND:
648 if (lexrc.next(true)) {
649 jindex_command = lexrc.getString();
653 case RC_SPLITINDEX_COMMAND:
654 if (lexrc.next(true)) {
655 splitindex_command = lexrc.getString();
659 case RC_NOMENCL_COMMAND:
660 if (lexrc.next(true)) {
661 nomencl_command = lexrc.getString();
673 case RC_GEOMETRY_SESSION:
674 lexrc >> allow_geometry_session;
677 case RC_SCREEN_FONT_SIZES:
678 lexrc >> font_sizes[FONT_SIZE_TINY];
679 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
680 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
681 lexrc >> font_sizes[FONT_SIZE_SMALL];
682 lexrc >> font_sizes[FONT_SIZE_NORMAL];
683 lexrc >> font_sizes[FONT_SIZE_LARGE];
684 lexrc >> font_sizes[FONT_SIZE_LARGER];
685 lexrc >> font_sizes[FONT_SIZE_LARGEST];
686 lexrc >> font_sizes[FONT_SIZE_HUGE];
687 lexrc >> font_sizes[FONT_SIZE_HUGER];
690 case RC_SCREEN_FONT_SCALABLE:
691 lexrc >> use_scalable_fonts;
698 case RC_DOCUMENTPATH:
700 document_path = os::internal_path(lexrc.getString());
701 document_path = expandPath(document_path);
707 example_path = os::internal_path(lexrc.getString());
708 example_path = expandPath(example_path);
712 case RC_TEMPLATEPATH:
714 template_path = os::internal_path(lexrc.getString());
715 template_path = expandPath(template_path);
721 tempdir_path = os::internal_path(lexrc.getString());
722 tempdir_path = expandPath(tempdir_path);
726 case RC_THESAURUSDIRPATH:
728 thesaurusdir_path = os::internal_path(lexrc.getString());
729 thesaurusdir_path = expandPath(thesaurusdir_path);
733 case RC_HUNSPELLDIR_PATH:
735 hunspelldir_path = os::internal_path(lexrc.getString());
736 hunspelldir_path = expandPath(hunspelldir_path);
740 case RC_USELASTFILEPOS:
741 lexrc >> use_lastfilepos;
745 lexrc >> load_session;
748 case RC_MOUSE_WHEEL_SPEED:
749 lexrc >> mouse_wheel_speed;
752 case RC_COMPLETION_INLINE_DELAY:
753 lexrc >> completion_inline_delay;
756 case RC_COMPLETION_INLINE_MATH:
757 lexrc >> completion_inline_math;
760 case RC_COMPLETION_INLINE_TEXT:
761 lexrc >> completion_inline_text;
764 case RC_COMPLETION_INLINE_DOTS:
765 lexrc >> completion_inline_dots;
768 case RC_AUTOCORRECTION_MATH:
769 lexrc >> autocorrection_math;
772 case RC_COMPLETION_POPUP_DELAY:
773 lexrc >> completion_popup_delay;
776 case RC_COMPLETION_POPUP_MATH:
777 lexrc >> completion_popup_math;
780 case RC_COMPLETION_POPUP_TEXT:
781 lexrc >> completion_popup_text;
784 case RC_COMPLETION_CURSOR_TEXT:
785 lexrc >> completion_cursor_text;
788 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
789 lexrc >> completion_popup_after_complete;
792 case RC_NUMLASTFILES:
793 lexrc >> num_lastfiles;
796 case RC_CHECKLASTFILES:
797 lexrc >> check_lastfiles;
800 case RC_SCREEN_FONT_ROMAN:
802 roman_font_name = lexrc.getString();
803 oldFontFormat(roman_font_name,
808 case RC_SCREEN_FONT_SANS:
810 sans_font_name = lexrc.getString();
811 oldFontFormat(sans_font_name, sans_font_foundry);
815 case RC_SCREEN_FONT_TYPEWRITER:
817 typewriter_font_name = lexrc.getString();
818 oldFontFormat(typewriter_font_name,
819 typewriter_font_foundry);
823 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
824 lexrc >> roman_font_foundry;
827 case RC_SCREEN_FONT_SANS_FOUNDRY:
828 lexrc >> sans_font_foundry;
831 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
832 lexrc >> typewriter_font_foundry;
837 lexrc.printError("Missing color tag.");
840 string lyx_name = lexrc.getString();
843 lexrc.printError("Missing color name for color: `$$Token'");
846 string x11_name = lexrc.getString();
848 ColorCode const col =
849 lcolor.getFromLyXName(lyx_name);
850 if (col == Color_none ||
851 col == Color_inherit ||
855 if (!lcolor.setColor(col, x11_name))
856 LYXERR0("Bad lyxrc set_color for " << lyx_name);
860 case RC_AUTOREGIONDELETE:
861 // Auto region delete defaults to true
862 lexrc >> auto_region_delete;
867 lyxpipes = os::internal_path(lexrc.getString());
868 lyxpipes = expandPath(lyxpipes);
872 case RC_CURSOR_FOLLOWS_SCROLLBAR:
873 lexrc >> cursor_follows_scrollbar;
876 case RC_SCROLL_BELOW_DOCUMENT:
877 lexrc >> scroll_below_document;
880 case RC_PARAGRAPH_MARKERS:
881 lexrc >> paragraph_markers;
884 case RC_MAC_LIKE_WORD_MOVEMENT:
885 lexrc >> mac_like_word_movement;
888 case RC_MACRO_EDIT_STYLE:
890 switch (lexrc.getInteger()) {
891 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
892 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
893 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
898 case RC_DIALOGS_ICONIFY_WITH_MAIN:
899 lexrc >> dialogs_iconify_with_main;
902 case RC_PLAINTEXT_LINELEN:
903 lexrc >> plaintext_linelen;
905 // Spellchecker settings:
906 case RC_ACCEPT_COMPOUND:
907 lexrc >> spellchecker_accept_compound;
910 lexrc >> use_tooltip;
912 case RC_USE_PIXMAP_CACHE:
913 lexrc >> use_pixmap_cache;
915 case RC_SPELLCHECKER:
916 lexrc >> spellchecker;
919 lexrc >> spellchecker_alt_lang;
922 lexrc >> spellchecker_esc_chars;
924 case RC_SPELLCHECK_CONTINUOUSLY:
925 lexrc >> spellcheck_continuously;
927 case RC_SPELLCHECK_NOTES:
928 lexrc >> spellcheck_notes;
931 lexrc >> make_backup;
933 case RC_SAVE_COMPRESSED:
934 lexrc >> save_compressed;
936 case RC_BACKUPDIR_PATH:
938 backupdir_path = os::internal_path(lexrc.getString());
939 backupdir_path = expandPath(backupdir_path);
942 case RC_DATE_INSERT_FORMAT:
943 lexrc >> date_insert_format;
945 case RC_LANGUAGE_PACKAGE:
946 lexrc >> language_package;
948 case RC_LANGUAGE_AUTO_BEGIN:
949 lexrc >> language_auto_begin;
951 case RC_LANGUAGE_AUTO_END:
952 lexrc >> language_auto_end;
954 case RC_LANGUAGE_GLOBAL_OPTIONS:
955 lexrc >> language_global_options;
957 case RC_LANGUAGE_USE_BABEL:
958 lexrc >> language_use_babel;
960 case RC_LANGUAGE_COMMAND_BEGIN:
961 lexrc >> language_command_begin;
963 case RC_LANGUAGE_COMMAND_END:
964 lexrc >> language_command_end;
966 case RC_LANGUAGE_COMMAND_LOCAL:
967 lexrc >> language_command_local;
970 lexrc >> rtl_support;
972 case RC_VISUAL_CURSOR:
973 lexrc >> visual_cursor;
976 lexrc >> auto_number;
978 case RC_MARK_FOREIGN_LANGUAGE:
979 lexrc >> mark_foreign_language;
985 fmt = lexrc.getString();
986 if (lexrc.next(true))
987 command = lexrc.getString();
988 setMover(fmt, command);
993 string from, to, command, flags;
995 from = lexrc.getString();
997 to = lexrc.getString();
998 if (lexrc.next(true))
999 command = lexrc.getString();
1001 flags = lexrc.getString();
1002 if (command.empty())
1003 theConverters().erase(from, to);
1005 theConverters().add(from, to, command, flags);
1008 // compatibility with versions older than 1.4.0 only
1010 string format, command;
1011 lexrc >> format >> command;
1012 formats.setViewer(format, command);
1016 string format, extension, prettyname, shortcut;
1017 lexrc >> format >> extension >> prettyname >> shortcut;
1018 string viewer, editor;
1019 if (lexrc.next(true))
1020 viewer = lexrc.getString();
1021 if (lexrc.next(true))
1022 editor = lexrc.getString();
1024 // Hack to ensure compatibility with versions older
1026 int le = lexrc.lex();
1027 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1028 flags = lexrc.getString();
1029 if (le != Lexer::LEX_DATA) {
1030 // We have got a known token.
1031 // Therefore this is an old style
1032 // format definition without
1034 lexrc.pushToken(flags);
1038 int flgs = Format::none;
1039 while (!flags.empty()) {
1041 flags = split(flags, flag, ',');
1042 if (flag == "document")
1043 flgs |= Format::document;
1044 else if (flag == "vector")
1045 flgs |= Format::vector;
1047 LYXERR0("Ignoring unknown flag `"
1048 << flag << "' for format `"
1051 if (prettyname.empty()) {
1052 if (theConverters().formatIsUsed(format))
1053 LYXERR0("Can't delete format " << format);
1055 formats.erase(format);
1057 formats.add(format, extension, prettyname,
1058 shortcut, viewer, editor, flgs);
1062 case RC_VIEWER_ALTERNATIVES: {
1063 string format, command;
1065 format = lexrc.getString();
1066 if (lexrc.eatLine())
1067 command = lexrc.getString();
1068 viewer_alternatives[format].insert(command);
1071 case RC_EDITOR_ALTERNATIVES: {
1072 string format, command;
1073 lexrc >> format >> command;
1074 editor_alternatives[format].insert(command);
1078 case RC_DEFAULT_VIEW_FORMAT:
1079 lexrc >> default_view_format;
1082 case RC_DEFAULT_LANGUAGE:
1083 lexrc >> default_language;
1086 case RC_GUI_LANGUAGE:
1087 lexrc >> gui_language;
1090 case RC_SHOW_BANNER:
1091 lexrc >> show_banner;
1096 string const tmp = lexrc.getString();
1097 if (tmp == "true" || tmp == "on")
1098 preview = PREVIEW_ON;
1099 else if (tmp == "no_math")
1100 preview = PREVIEW_NO_MATH;
1102 preview = PREVIEW_OFF;
1103 if (tmp != "false" && tmp != "off")
1104 LYXERR0("Unrecognized preview status \""
1110 case RC_PREVIEW_HASHED_LABELS:
1111 lexrc >> preview_hashed_labels;
1114 case RC_PREVIEW_SCALE_FACTOR:
1115 lexrc >> preview_scale_factor;
1122 lexrc >> user_email;
1125 case RC_PATH_PREFIX:
1126 lexrc >> path_prefix;
1129 case RC_USE_CONVERTER_CACHE:
1130 lexrc >> use_converter_cache;
1132 case RC_CONVERTER_CACHE_MAXAGE:
1133 lexrc >> converter_cache_maxage;
1136 case RC_SORT_LAYOUTS:
1137 lexrc >> sort_layouts;
1139 case RC_GROUP_LAYOUTS:
1140 lexrc >> group_layouts;
1142 case RC_FULL_SCREEN_LIMIT:
1143 lexrc >> full_screen_limit;
1145 case RC_FULL_SCREEN_TOOLBARS:
1146 lexrc >> full_screen_toolbars;
1148 case RC_FULL_SCREEN_SCROLLBAR:
1149 lexrc >> full_screen_scrollbar;
1151 case RC_FULL_SCREEN_TABBAR:
1152 lexrc >> full_screen_tabbar;
1154 case RC_FULL_SCREEN_MENUBAR:
1155 lexrc >> full_screen_menubar;
1157 case RC_FULL_SCREEN_WIDTH:
1158 lexrc >> full_screen_width;
1160 case RC_OPEN_BUFFERS_IN_TABS:
1161 lexrc >> open_buffers_in_tabs;
1163 case RC_SINGLE_CLOSE_TAB_BUTTON:
1164 lexrc >> single_close_tab_button;
1166 case RC_FORWARD_SEARCH_DVI:
1167 if (lexrc.next(true))
1168 forward_search_dvi = lexrc.getString();
1170 case RC_FORWARD_SEARCH_PDF:
1171 if (lexrc.next(true))
1172 forward_search_pdf = lexrc.getString();
1174 case RC_EXPORT_OVERWRITE:
1176 string const tmp = lexrc.getString();
1177 if (tmp == "all" || tmp == "true")
1178 export_overwrite = ALL_FILES;
1179 else if (tmp == "main")
1180 export_overwrite = MAIN_FILE;
1182 export_overwrite = NO_FILES;
1183 if (tmp != "ask" && tmp != "false")
1184 LYXERR0("Unrecognized export_overwrite status \""
1190 // Obsoteted in 1.4.0
1193 case RC_SPELL_COMMAND:
1195 case RC_PLAINTEXT_ROFF_COMMAND:
1196 case RC_USE_ALT_LANG:
1197 case RC_USE_ESC_CHARS:
1198 case RC_USE_INP_ENC:
1199 case RC_USE_PERS_DICT:
1200 case RC_USE_SPELL_LIB:
1201 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1202 << lexrc.getString() << "'.");
1207 break; // this is just a dummy
1211 /// Update converters data-structures
1212 theConverters().update(formats);
1213 theConverters().buildGraph();
1219 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1221 ofstream ofs(filename.toFilesystemEncoding().c_str());
1223 write(ofs, ignore_system_lyxrc);
1227 void LyXRC::print() const
1229 if (lyxerr.debugging())
1230 write(lyxerr, false);
1238 typedef pair<string, SpecialisedMover> Data;
1240 SameMover(Data const & comparison)
1241 : comparison_(comparison) {}
1243 bool operator()(Data const & data) const
1245 return data.first == comparison_.first &&
1246 data.second.command() == comparison_.second.command();
1256 // Escape \ and " so that LyXLex can read the string later
1257 string escapeCommand(string const & str) {
1258 return subst(subst(str , "\\", "\\\\"),
1265 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1267 LyXRCTags tag = RC_LAST;
1269 if (!name.empty()) {
1270 for (int i = 0; i != lyxrcCount; ++i)
1271 if ("\\" + name == lyxrcTags[i].tag)
1272 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1276 os << "# LyX " << lyx_version
1277 << " generated this file. If you want to make your own\n"
1278 << "# modifications you should do them from inside LyX and save.\n"
1281 // Why the switch you might ask. It is a trick to ensure that all
1282 // the elements in the LyXRCTags enum are handled. As you can see
1283 // there are no breaks at all. So it is just a huge fall-through.
1284 // The nice thing is that we will get a warning from the compiler
1285 // if we forget an element.
1289 // input/include files are not done here
1291 if (ignore_system_lyxrc ||
1292 bind_file != system_lyxrc.bind_file) {
1293 string const path = os::external_path(bind_file);
1294 os << "\\bind_file \"" << path << "\"\n";
1300 if (ignore_system_lyxrc ||
1301 def_file != system_lyxrc.def_file) {
1302 string const path = os::external_path(def_file);
1303 os << "\\def_file \"" << path << "\"\n";
1312 << "# MISC SECTION ######################################\n"
1314 // bind files are not done here.
1316 case RC_PATH_PREFIX:
1317 if (ignore_system_lyxrc ||
1318 path_prefix != system_lyxrc.path_prefix) {
1319 os << "\\path_prefix \"" << path_prefix << "\"\n";
1324 if (ignore_system_lyxrc ||
1325 ui_file != system_lyxrc.ui_file) {
1326 string const path = os::external_path(ui_file);
1327 os << "\\ui_file \"" << path << "\"\n";
1331 case RC_AUTOREGIONDELETE:
1332 if (ignore_system_lyxrc ||
1333 auto_region_delete != system_lyxrc.auto_region_delete) {
1334 os << "# Set to false to inhibit automatic replacement of\n"
1335 << "# the current selection.\n"
1336 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1341 case RC_AUTORESET_OPTIONS:
1342 if (ignore_system_lyxrc ||
1343 auto_reset_options != system_lyxrc.auto_reset_options) {
1344 os << "# Set to false to inhibit automatic reset of\n"
1345 << "# the class options to defaults on class change.\n"
1346 << "\\auto_reset_options "
1347 << convert<string>(auto_reset_options)
1353 if (ignore_system_lyxrc ||
1354 autosave != system_lyxrc.autosave) {
1355 os << "# The time interval between auto-saves in seconds.\n"
1356 << "\\autosave " << autosave << '\n';
1360 case RC_DISPLAY_GRAPHICS:
1361 if (ignore_system_lyxrc ||
1362 display_graphics != system_lyxrc.display_graphics) {
1363 os << "# Display graphics within LyX\n"
1365 << "\\display_graphics "
1366 << (display_graphics ? "true" : "false")
1371 case RC_SORT_LAYOUTS:
1372 if (ignore_system_lyxrc ||
1373 sort_layouts != system_lyxrc.sort_layouts) {
1374 os << "# Sort layouts alphabetically.\n"
1375 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1379 case RC_GROUP_LAYOUTS:
1380 if (ignore_system_lyxrc ||
1381 group_layouts != system_lyxrc.group_layouts) {
1382 os << "# Group layouts by their category.\n"
1383 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1387 case RC_VIEWDVI_PAPEROPTION:
1388 if (ignore_system_lyxrc ||
1389 view_dvi_paper_option
1390 != system_lyxrc.view_dvi_paper_option) {
1391 os << "# Options used to specify paper size to the\n"
1392 << "# view_dvi_command (e.g. -paper)\n"
1393 << "\\view_dvi_paper_option \""
1394 << view_dvi_paper_option << "\"\n";
1398 case RC_DEFAULT_PAPERSIZE:
1399 if (ignore_system_lyxrc ||
1400 default_papersize != system_lyxrc.default_papersize) {
1401 os << "# The default papersize to use.\n"
1402 << "\\default_papersize \"";
1403 switch (default_papersize) {
1405 os << "default"; break;
1406 case PAPER_USLETTER:
1407 os << "usletter"; break;
1409 os << "legal"; break;
1410 case PAPER_USEXECUTIVE:
1411 os << "executive"; break;
1437 case PAPER_JISB6: break;
1443 case RC_CHKTEX_COMMAND:
1444 if (ignore_system_lyxrc ||
1445 chktex_command != system_lyxrc.chktex_command) {
1446 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1450 case RC_BIBTEX_ALTERNATIVES: {
1451 CommandSet::const_iterator it = bibtex_alternatives.begin();
1452 CommandSet::const_iterator end = bibtex_alternatives.end();
1453 for ( ; it != end; ++it) {
1454 if (ignore_system_lyxrc
1455 || !system_lyxrc.bibtex_alternatives.count(*it))
1456 os << "\\bibtex_alternatives \""
1462 case RC_BIBTEX_COMMAND:
1463 if (ignore_system_lyxrc ||
1464 bibtex_command != system_lyxrc.bibtex_command) {
1465 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1469 case RC_JBIBTEX_COMMAND:
1470 if (ignore_system_lyxrc ||
1471 jbibtex_command != system_lyxrc.jbibtex_command) {
1472 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1476 case RC_INDEX_ALTERNATIVES: {
1477 CommandSet::const_iterator it = index_alternatives.begin();
1478 CommandSet::const_iterator end = index_alternatives.end();
1479 for ( ; it != end; ++it) {
1480 if (ignore_system_lyxrc
1481 || !system_lyxrc.index_alternatives.count(*it))
1482 os << "\\index_alternatives \""
1488 case RC_INDEX_COMMAND:
1489 if (ignore_system_lyxrc ||
1490 index_command != system_lyxrc.index_command) {
1491 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1495 case RC_JINDEX_COMMAND:
1496 if (ignore_system_lyxrc ||
1497 jindex_command != system_lyxrc.jindex_command) {
1498 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1502 case RC_SPLITINDEX_COMMAND:
1503 if (ignore_system_lyxrc ||
1504 splitindex_command != system_lyxrc.splitindex_command) {
1505 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1509 case RC_NOMENCL_COMMAND:
1510 if (ignore_system_lyxrc ||
1511 nomencl_command != system_lyxrc.nomencl_command) {
1512 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1516 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1517 if (ignore_system_lyxrc ||
1518 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1519 os << "\\tex_expects_windows_paths "
1520 << convert<string>(windows_style_tex_paths) << '\n';
1524 case RC_TEX_ALLOWS_SPACES:
1525 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1526 os << "\\tex_allows_spaces "
1527 << convert<string>(tex_allows_spaces) << '\n';
1532 if (ignore_system_lyxrc ||
1533 use_kbmap != system_lyxrc.use_kbmap) {
1534 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1538 case RC_KBMAP_PRIMARY:
1539 if (ignore_system_lyxrc ||
1540 primary_kbmap != system_lyxrc.primary_kbmap) {
1541 string const path = os::external_path(primary_kbmap);
1542 os << "\\kbmap_primary \"" << path << "\"\n";
1546 case RC_KBMAP_SECONDARY:
1547 if (ignore_system_lyxrc ||
1548 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1549 string const path = os::external_path(secondary_kbmap);
1550 os << "\\kbmap_secondary \"" << path << "\"\n";
1555 if (ignore_system_lyxrc ||
1556 lyxpipes != system_lyxrc.lyxpipes) {
1557 string const path = os::external_path(lyxpipes);
1558 os << "\\serverpipe \"" << path << "\"\n";
1562 case RC_DATE_INSERT_FORMAT:
1563 if (ignore_system_lyxrc ||
1564 date_insert_format != system_lyxrc.date_insert_format) {
1565 os << "\\date_insert_format \"" << date_insert_format
1572 os << "\\user_name \"" << user_name << "\"\n";
1577 os << "\\user_email \"" << user_email << "\"\n";
1581 case RC_SHOW_BANNER:
1582 if (ignore_system_lyxrc ||
1583 show_banner != system_lyxrc.show_banner) {
1584 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1590 if (ignore_system_lyxrc ||
1591 preview != system_lyxrc.preview) {
1597 case PREVIEW_NO_MATH:
1604 os << "\\preview " << status << '\n';
1609 case RC_PREVIEW_HASHED_LABELS:
1610 if (ignore_system_lyxrc ||
1611 preview_hashed_labels !=
1612 system_lyxrc.preview_hashed_labels) {
1613 os << "\\preview_hashed_labels "
1614 << convert<string>(preview_hashed_labels) << '\n';
1619 case RC_PREVIEW_SCALE_FACTOR:
1620 if (ignore_system_lyxrc ||
1621 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1622 os << "\\preview_scale_factor "
1623 << preview_scale_factor << '\n';
1628 case RC_USE_CONVERTER_CACHE:
1629 if (ignore_system_lyxrc ||
1630 use_converter_cache != system_lyxrc.use_converter_cache) {
1631 os << "\\use_converter_cache "
1632 << convert<string>(use_converter_cache) << '\n';
1637 case RC_CONVERTER_CACHE_MAXAGE:
1638 if (ignore_system_lyxrc ||
1639 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1640 os << "\\converter_cache_maxage "
1641 << converter_cache_maxage << '\n';
1647 << "# SCREEN & FONTS SECTION ############################\n"
1651 if (ignore_system_lyxrc ||
1652 dpi != system_lyxrc.dpi) {
1653 os << "\\screen_dpi " << dpi << '\n';
1657 case RC_SCREEN_ZOOM:
1658 if (ignore_system_lyxrc ||
1659 zoom != system_lyxrc.zoom) {
1660 os << "\\screen_zoom " << zoom << '\n';
1664 case RC_GEOMETRY_SESSION:
1665 if (ignore_system_lyxrc ||
1666 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1667 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1672 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1673 if (ignore_system_lyxrc ||
1674 cursor_follows_scrollbar
1675 != system_lyxrc.cursor_follows_scrollbar) {
1676 os << "\\cursor_follows_scrollbar "
1677 << convert<string>(cursor_follows_scrollbar) << '\n';
1681 case RC_SCROLL_BELOW_DOCUMENT:
1682 if (ignore_system_lyxrc ||
1683 scroll_below_document
1684 != system_lyxrc.scroll_below_document) {
1685 os << "\\scroll_below_document "
1686 << convert<string>(scroll_below_document) << '\n';
1690 case RC_PARAGRAPH_MARKERS:
1691 if (ignore_system_lyxrc ||
1693 != system_lyxrc.paragraph_markers) {
1694 os << "\\paragraph_markers "
1695 << convert<string>(paragraph_markers) << '\n';
1699 case RC_MAC_LIKE_WORD_MOVEMENT:
1700 if (ignore_system_lyxrc ||
1701 mac_like_word_movement
1702 != system_lyxrc.mac_like_word_movement) {
1703 os << "\\mac_like_word_movement "
1704 << convert<string>(mac_like_word_movement) << '\n';
1708 case RC_MACRO_EDIT_STYLE:
1709 if (ignore_system_lyxrc ||
1711 != system_lyxrc.macro_edit_style) {
1712 os << "\\macro_edit_style ";
1713 switch (macro_edit_style) {
1714 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1715 case MACRO_EDIT_INLINE: os << "1\n"; break;
1716 case MACRO_EDIT_LIST: os << "2\n"; break;
1721 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1722 if (ignore_system_lyxrc ||
1723 dialogs_iconify_with_main
1724 != system_lyxrc.dialogs_iconify_with_main) {
1725 os << "\\dialogs_iconify_with_main "
1726 << convert<string>(dialogs_iconify_with_main) << '\n';
1730 case RC_SCREEN_FONT_ROMAN:
1731 if (ignore_system_lyxrc ||
1732 roman_font_name != system_lyxrc.roman_font_name) {
1733 os << "\\screen_font_roman \"" << roman_font_name
1738 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1739 if (ignore_system_lyxrc ||
1740 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1741 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1746 case RC_SCREEN_FONT_SANS:
1747 if (ignore_system_lyxrc ||
1748 sans_font_name != system_lyxrc.sans_font_name) {
1749 os << "\\screen_font_sans \"" << sans_font_name
1754 case RC_SCREEN_FONT_SANS_FOUNDRY:
1755 if (ignore_system_lyxrc ||
1756 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1757 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1762 case RC_SCREEN_FONT_TYPEWRITER:
1763 if (ignore_system_lyxrc ||
1764 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1765 os << "\\screen_font_typewriter \""
1766 << typewriter_font_name << "\"\n";
1770 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1771 if (ignore_system_lyxrc ||
1772 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1773 os << "\\screen_font_typewriter_foundry \""
1774 << typewriter_font_foundry << "\"\n";
1779 case RC_SCREEN_FONT_SCALABLE:
1780 if (ignore_system_lyxrc ||
1781 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1782 os << "\\screen_font_scalable "
1783 << convert<string>(use_scalable_fonts)
1788 case RC_SCREEN_FONT_SIZES:
1789 if (ignore_system_lyxrc ||
1790 font_sizes[FONT_SIZE_TINY]
1791 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1792 font_sizes[FONT_SIZE_SCRIPT]
1793 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1794 font_sizes[FONT_SIZE_FOOTNOTE]
1795 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1796 font_sizes[FONT_SIZE_SMALL]
1797 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1798 font_sizes[FONT_SIZE_NORMAL]
1799 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1800 font_sizes[FONT_SIZE_LARGE]
1801 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1802 font_sizes[FONT_SIZE_LARGER]
1803 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1804 font_sizes[FONT_SIZE_LARGEST]
1805 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1806 font_sizes[FONT_SIZE_HUGE]
1807 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1808 font_sizes[FONT_SIZE_HUGER]
1809 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1810 os.setf(ios::fixed);
1812 os << "\\screen_font_sizes"
1813 << ' ' << font_sizes[FONT_SIZE_TINY]
1814 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1815 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1816 << ' ' << font_sizes[FONT_SIZE_SMALL]
1817 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1818 << ' ' << font_sizes[FONT_SIZE_LARGE]
1819 << ' ' << font_sizes[FONT_SIZE_LARGER]
1820 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1821 << ' ' << font_sizes[FONT_SIZE_HUGE]
1822 << ' ' << font_sizes[FONT_SIZE_HUGER]
1827 case RC_FULL_SCREEN_LIMIT:
1828 if (ignore_system_lyxrc ||
1829 full_screen_limit != system_lyxrc.full_screen_limit) {
1830 os << "\\fullscreen_limit "
1831 << convert<string>(full_screen_limit)
1836 case RC_FULL_SCREEN_TOOLBARS:
1837 if (ignore_system_lyxrc ||
1838 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1839 os << "\\fullscreen_toolbars "
1840 << convert<string>(full_screen_toolbars)
1845 case RC_FULL_SCREEN_SCROLLBAR:
1846 if (ignore_system_lyxrc ||
1847 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1848 os << "\\fullscreen_scrollbar "
1849 << convert<string>(full_screen_scrollbar)
1854 case RC_FULL_SCREEN_TABBAR:
1855 if (ignore_system_lyxrc ||
1856 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1857 os << "\\fullscreen_tabbar "
1858 << convert<string>(full_screen_tabbar)
1863 case RC_FULL_SCREEN_MENUBAR:
1864 if (ignore_system_lyxrc ||
1865 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1866 os << "\\fullscreen_menubar "
1867 << convert<string>(full_screen_menubar)
1872 case RC_FULL_SCREEN_WIDTH:
1873 if (ignore_system_lyxrc ||
1874 full_screen_width != system_lyxrc.full_screen_width) {
1875 os << "\\fullscreen_width "
1876 << convert<string>(full_screen_width)
1881 case RC_OPEN_BUFFERS_IN_TABS:
1882 if (ignore_system_lyxrc ||
1883 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1884 os << "\\open_buffers_in_tabs "
1885 << convert<string>(open_buffers_in_tabs)
1890 case RC_SINGLE_CLOSE_TAB_BUTTON:
1891 if (ignore_system_lyxrc ||
1892 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1893 os << "\\single_close_tab_button "
1894 << convert<string>(single_close_tab_button)
1899 case RC_FORWARD_SEARCH_DVI:
1900 if (ignore_system_lyxrc ||
1901 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1902 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1906 case RC_FORWARD_SEARCH_PDF:
1907 if (ignore_system_lyxrc ||
1908 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1909 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1915 << "# COLOR SECTION ###################################\n"
1919 for (int i = 0; i < Color_ignore; ++i) {
1920 ColorCode lc = static_cast<ColorCode>(i);
1921 string const col = lcolor.getX11Name(lc);
1922 if (ignore_system_lyxrc
1923 || col != system_lcolor.getX11Name(lc)) {
1924 os << "\\set_color \""
1925 << lcolor.getLyXName(lc) << "\" \""
1933 << "# PRINTER SECTION ###################################\n"
1937 if (ignore_system_lyxrc ||
1938 printer != system_lyxrc.printer) {
1939 os << "\\printer \"" << printer << "\"\n";
1943 case RC_PRINT_ADAPTOUTPUT:
1944 if (ignore_system_lyxrc ||
1945 print_adapt_output != system_lyxrc.print_adapt_output) {
1946 os << "\\print_adapt_output "
1947 << convert<string>(print_adapt_output)
1952 case RC_PRINT_COMMAND:
1953 if (ignore_system_lyxrc ||
1954 print_command != system_lyxrc.print_command) {
1955 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1959 case RC_PRINTEXSTRAOPTIONS:
1960 if (ignore_system_lyxrc ||
1961 print_extra_options != system_lyxrc.print_extra_options) {
1962 os << "\\print_extra_options \"" << print_extra_options
1967 case RC_PRINTSPOOL_COMMAND:
1968 if (ignore_system_lyxrc ||
1969 print_spool_command != system_lyxrc.print_spool_command) {
1970 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1975 case RC_PRINTSPOOL_PRINTERPREFIX:
1976 if (ignore_system_lyxrc ||
1977 print_spool_printerprefix
1978 != system_lyxrc.print_spool_printerprefix) {
1979 os << "\\print_spool_printerprefix \""
1980 << print_spool_printerprefix << "\"\n";
1984 case RC_PRINTEVENPAGEFLAG:
1985 if (ignore_system_lyxrc ||
1986 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1987 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1992 case RC_PRINTODDPAGEFLAG:
1993 if (ignore_system_lyxrc ||
1994 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1995 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2000 case RC_PRINTREVERSEFLAG:
2001 if (ignore_system_lyxrc ||
2002 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2003 os << "\\print_reverse_flag \"" << print_reverse_flag
2008 case RC_PRINTLANDSCAPEFLAG:
2009 if (ignore_system_lyxrc ||
2010 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2011 os << "\\print_landscape_flag \"" << print_landscape_flag
2016 case RC_PRINTPAGERANGEFLAG:
2017 if (ignore_system_lyxrc ||
2018 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2019 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2024 case RC_PRINTCOPIESFLAG:
2025 if (ignore_system_lyxrc ||
2026 print_copies_flag != system_lyxrc.print_copies_flag) {
2027 os << "\\print_copies_flag \"" << print_copies_flag
2032 case RC_PRINTCOLLCOPIESFLAG:
2033 if (ignore_system_lyxrc ||
2034 print_collcopies_flag
2035 != system_lyxrc.print_collcopies_flag) {
2036 os << "\\print_collcopies_flag \""
2037 << print_collcopies_flag
2042 case RC_PRINTPAPERFLAG:
2043 if (ignore_system_lyxrc ||
2044 print_paper_flag != system_lyxrc.print_paper_flag) {
2045 os << "\\print_paper_flag \"" << print_paper_flag
2050 case RC_PRINTPAPERDIMENSIONFLAG:
2051 if (ignore_system_lyxrc ||
2052 print_paper_dimension_flag
2053 != system_lyxrc.print_paper_dimension_flag) {
2054 os << "\\print_paper_dimension_flag \""
2055 << print_paper_dimension_flag << "\"\n";
2059 case RC_PRINTTOPRINTER:
2060 if (ignore_system_lyxrc ||
2061 print_to_printer != system_lyxrc.print_to_printer) {
2062 os << "\\print_to_printer \"" << print_to_printer
2067 case RC_PRINTTOFILE:
2068 if (ignore_system_lyxrc ||
2069 print_to_file != system_lyxrc.print_to_file) {
2070 string const path = os::external_path(print_to_file);
2071 os << "\\print_to_file \"" << path << "\"\n";
2075 case RC_PRINTFILEEXTENSION:
2076 if (ignore_system_lyxrc ||
2077 print_file_extension != system_lyxrc.print_file_extension) {
2078 os << "\\print_file_extension \""
2079 << print_file_extension
2086 << "# TEX SECTION #######################################\n"
2089 case RC_FONT_ENCODING:
2090 if (ignore_system_lyxrc ||
2091 fontenc != system_lyxrc.fontenc) {
2092 os << "\\font_encoding \"" << fontenc << "\"\n";
2098 << "# FILE SECTION ######################################\n"
2101 case RC_DOCUMENTPATH:
2102 if (ignore_system_lyxrc ||
2103 document_path != system_lyxrc.document_path) {
2104 string const path = os::external_path(document_path);
2105 os << "\\document_path \"" << path << "\"\n";
2109 case RC_USELASTFILEPOS:
2110 if (ignore_system_lyxrc ||
2111 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2112 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2117 case RC_LOADSESSION:
2118 if (ignore_system_lyxrc ||
2119 load_session != system_lyxrc.load_session) {
2120 os << "\\load_session " << convert<string>(load_session)
2125 case RC_MOUSE_WHEEL_SPEED:
2126 if (ignore_system_lyxrc ||
2127 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2128 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2132 case RC_COMPLETION_INLINE_DELAY:
2133 if (ignore_system_lyxrc ||
2134 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2135 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2139 case RC_COMPLETION_INLINE_MATH:
2140 if (ignore_system_lyxrc ||
2141 completion_inline_math != system_lyxrc.completion_inline_math) {
2142 os << "\\completion_inline_math "
2143 << convert<string>(completion_inline_math) << '\n';
2147 case RC_COMPLETION_INLINE_TEXT:
2148 if (ignore_system_lyxrc ||
2149 completion_inline_text != system_lyxrc.completion_inline_text) {
2150 os << "\\completion_inline_text "
2151 << convert<string>(completion_inline_text) << '\n';
2155 case RC_COMPLETION_INLINE_DOTS:
2156 if (ignore_system_lyxrc ||
2157 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2158 os << "\\completion_inline_dots "
2159 << convert<string>(completion_inline_dots) << '\n';
2163 case RC_AUTOCORRECTION_MATH:
2164 if (ignore_system_lyxrc ||
2165 autocorrection_math != system_lyxrc.autocorrection_math) {
2166 os << "\\autocorrection_math "
2167 << convert<string>(autocorrection_math) << '\n';
2171 case RC_COMPLETION_POPUP_DELAY:
2172 if (ignore_system_lyxrc ||
2173 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2174 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2178 case RC_COMPLETION_POPUP_MATH:
2179 if (ignore_system_lyxrc ||
2180 completion_popup_math != system_lyxrc.completion_popup_math) {
2181 os << "\\completion_popup_math "
2182 << convert<string>(completion_popup_math) << '\n';
2186 case RC_COMPLETION_POPUP_TEXT:
2187 if (ignore_system_lyxrc ||
2188 completion_popup_text != system_lyxrc.completion_popup_text) {
2189 os << "\\completion_popup_text "
2190 << convert<string>(completion_popup_text) << '\n';
2194 case RC_COMPLETION_CURSOR_TEXT:
2195 if (ignore_system_lyxrc ||
2196 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2197 os << "\\completion_cursor_text "
2198 << convert<string>(completion_cursor_text) << '\n';
2202 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2203 if (ignore_system_lyxrc ||
2204 completion_popup_after_complete
2205 != system_lyxrc.completion_popup_after_complete) {
2206 os << "\\completion_popup_after_complete "
2207 << convert<string>(completion_popup_after_complete) << '\n';
2211 case RC_NUMLASTFILES:
2212 if (ignore_system_lyxrc ||
2213 num_lastfiles != system_lyxrc.num_lastfiles) {
2214 os << "\\num_lastfiles " << num_lastfiles << '\n';
2218 case RC_CHECKLASTFILES:
2219 if (ignore_system_lyxrc ||
2220 check_lastfiles != system_lyxrc.check_lastfiles) {
2221 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2226 case RC_EXAMPLEPATH:
2227 if (ignore_system_lyxrc ||
2228 example_path != system_lyxrc.example_path) {
2229 string const path = os::external_path(example_path);
2230 os << "\\example_path \"" << path << "\"\n";
2234 case RC_TEMPLATEPATH:
2235 if (ignore_system_lyxrc ||
2236 template_path != system_lyxrc.template_path) {
2237 string const path = os::external_path(template_path);
2238 os << "\\template_path \"" << path << "\"\n";
2242 case RC_TEMPDIRPATH:
2243 if (ignore_system_lyxrc ||
2244 tempdir_path != system_lyxrc.tempdir_path) {
2245 string const path = os::external_path(tempdir_path);
2246 os << "\\tempdir_path \"" << path << "\"\n";
2250 case RC_THESAURUSDIRPATH:
2251 if (ignore_system_lyxrc ||
2252 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2253 string const path = os::external_path(thesaurusdir_path);
2254 os << "\\thesaurusdir_path \"" << path << "\"\n";
2258 case RC_HUNSPELLDIR_PATH:
2259 if (ignore_system_lyxrc ||
2260 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2261 string const path = os::external_path(hunspelldir_path);
2262 os << "\\hunspelldir_path \"" << path << "\"\n";
2270 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2273 case RC_PLAINTEXT_LINELEN:
2274 if (ignore_system_lyxrc ||
2275 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2276 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2280 case RC_MAKE_BACKUP:
2281 if (ignore_system_lyxrc ||
2282 make_backup != system_lyxrc.make_backup) {
2283 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2287 case RC_SAVE_COMPRESSED:
2288 if (ignore_system_lyxrc ||
2289 save_compressed != system_lyxrc.save_compressed) {
2290 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2294 case RC_BACKUPDIR_PATH:
2295 if (ignore_system_lyxrc ||
2296 backupdir_path != system_lyxrc.backupdir_path) {
2297 string const path = os::external_path(backupdir_path);
2298 os << "\\backupdir_path \"" << path << "\"\n";
2304 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2308 << "# SPELLCHECKER SECTION ##############################\n"
2311 case RC_SPELL_COMMAND:
2312 case RC_USE_SPELL_LIB:
2316 case RC_ACCEPT_COMPOUND:
2317 if (ignore_system_lyxrc ||
2318 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2319 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2324 case RC_USE_ALT_LANG:
2329 if (ignore_system_lyxrc ||
2330 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2331 os << "\\alternate_language \"" << spellchecker_alt_lang
2336 case RC_USE_ESC_CHARS:
2340 if (ignore_system_lyxrc ||
2341 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2342 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2346 case RC_USE_PERS_DICT:
2350 case RC_USE_TOOLTIP:
2351 if (ignore_system_lyxrc ||
2352 use_tooltip != system_lyxrc.use_tooltip) {
2353 os << "\\use_tooltip "
2354 << convert<string>(use_tooltip)
2359 case RC_USE_PIXMAP_CACHE:
2360 if (ignore_system_lyxrc ||
2361 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2362 os << "\\use_pixmap_cache "
2363 << convert<string>(use_pixmap_cache)
2372 case RC_USE_INP_ENC:
2378 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2383 case RC_SPELLCHECKER:
2384 if (ignore_system_lyxrc ||
2385 spellchecker != system_lyxrc.spellchecker) {
2386 os << "\\spellchecker " << spellchecker << '\n';
2391 case RC_SPELLCHECK_CONTINUOUSLY:
2392 if (ignore_system_lyxrc ||
2393 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2394 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2400 case RC_SPELLCHECK_NOTES:
2401 if (ignore_system_lyxrc ||
2402 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2403 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2409 case RC_RTL_SUPPORT:
2410 if (ignore_system_lyxrc ||
2411 rtl_support != system_lyxrc.rtl_support) {
2412 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2416 case RC_VISUAL_CURSOR:
2417 if (ignore_system_lyxrc ||
2418 visual_cursor != system_lyxrc.visual_cursor) {
2419 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2423 case RC_LANGUAGE_PACKAGE:
2424 if (ignore_system_lyxrc ||
2425 language_package != system_lyxrc.language_package) {
2426 os << "\\language_package \"" << language_package
2431 case RC_LANGUAGE_GLOBAL_OPTIONS:
2432 if (ignore_system_lyxrc ||
2433 language_global_options
2434 != system_lyxrc.language_global_options) {
2435 os << "\\language_global_options \""
2436 << convert<string>(language_global_options)
2441 case RC_LANGUAGE_USE_BABEL:
2442 if (ignore_system_lyxrc ||
2443 language_use_babel != system_lyxrc.language_use_babel) {
2444 os << "\\language_use_babel \""
2445 << convert<string>(language_use_babel)
2450 case RC_LANGUAGE_COMMAND_BEGIN:
2451 if (ignore_system_lyxrc ||
2452 language_command_begin
2453 != system_lyxrc.language_command_begin) {
2454 os << "\\language_command_begin \""
2455 << language_command_begin
2460 case RC_LANGUAGE_COMMAND_END:
2461 if (ignore_system_lyxrc ||
2462 language_command_end
2463 != system_lyxrc.language_command_end) {
2464 os << "\\language_command_end \"" << language_command_end
2469 case RC_LANGUAGE_COMMAND_LOCAL:
2470 if (ignore_system_lyxrc ||
2471 language_command_local
2472 != system_lyxrc.language_command_local) {
2473 os << "\\language_command_local \""
2474 << language_command_local
2479 case RC_LANGUAGE_AUTO_BEGIN:
2480 if (ignore_system_lyxrc ||
2481 language_auto_begin != system_lyxrc.language_auto_begin) {
2482 os << "\\language_auto_begin "
2483 << convert<string>(language_auto_begin) << '\n';
2487 case RC_LANGUAGE_AUTO_END:
2488 if (ignore_system_lyxrc ||
2489 language_auto_end != system_lyxrc.language_auto_end) {
2490 os << "\\language_auto_end "
2491 << convert<string>(language_auto_end) << '\n';
2495 case RC_MARK_FOREIGN_LANGUAGE:
2496 if (ignore_system_lyxrc ||
2497 mark_foreign_language
2498 != system_lyxrc.mark_foreign_language) {
2499 os << "\\mark_foreign_language " <<
2500 convert<string>(mark_foreign_language) << '\n';
2506 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2509 case RC_AUTO_NUMBER:
2510 if (ignore_system_lyxrc ||
2511 auto_number != system_lyxrc.auto_number) {
2512 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2516 case RC_DEFAULT_LANGUAGE:
2517 if (ignore_system_lyxrc ||
2518 default_language != system_lyxrc.default_language) {
2519 os << "\\default_language " << default_language << '\n';
2523 case RC_GUI_LANGUAGE:
2524 if (ignore_system_lyxrc ||
2525 gui_language != system_lyxrc.gui_language) {
2526 os << "\\gui_language " << gui_language << '\n';
2530 case RC_EXPORT_OVERWRITE:
2531 if (ignore_system_lyxrc ||
2532 export_overwrite != system_lyxrc.export_overwrite) {
2534 switch (export_overwrite) {
2545 os << "\\export_overwrite " << status << '\n';
2551 << "# FORMATS SECTION ##########################\n"
2555 // New/modified formats
2556 for (Formats::const_iterator cit = formats.begin();
2557 cit != formats.end(); ++cit) {
2558 Format const * format =
2559 system_formats.getFormat(cit->name());
2561 format->extension() != cit->extension() ||
2562 format->prettyname() != cit->prettyname() ||
2563 format->shortcut() != cit->shortcut() ||
2564 format->viewer() != cit->viewer() ||
2565 format->editor() != cit->editor() ||
2566 format->documentFormat() != cit->documentFormat() ||
2567 format->vectorFormat() != cit->vectorFormat()) {
2568 os << "\\format \"" << cit->name() << "\" \""
2569 << cit->extension() << "\" \""
2570 << cit->prettyname() << "\" \""
2571 << cit->shortcut() << "\" \""
2572 << escapeCommand(cit->viewer()) << "\" \""
2573 << escapeCommand(cit->editor()) << "\" \"";
2574 vector<string> flags;
2575 if (cit->documentFormat())
2576 flags.push_back("document");
2577 if (cit->vectorFormat())
2578 flags.push_back("vector");
2579 os << getStringFromVector(flags);
2584 // Look for deleted formats
2585 for (Formats::const_iterator cit = system_formats.begin();
2586 cit != system_formats.end(); ++cit)
2587 if (!formats.getFormat(cit->name()))
2588 os << "\\format \"" << cit->name()
2589 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2592 case RC_VIEWER_ALTERNATIVES: {
2593 Alternatives::const_iterator it = viewer_alternatives.begin();
2594 Alternatives::const_iterator const en = viewer_alternatives.end();
2595 Alternatives::const_iterator const sysend =
2596 system_lyxrc.viewer_alternatives.end();
2597 for (; it != en; ++it) {
2598 string const & fmt = it->first;
2599 CommandSet const & cmd = it->second;
2600 CommandSet::const_iterator sit = cmd.begin();
2601 CommandSet::const_iterator const sen = cmd.end();
2602 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2603 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2604 system_lyxrc.viewer_alternatives.find(fmt);
2605 for (; sit != sen; ++sit) {
2606 string const & cmd = *sit;
2607 if (ignore_system_lyxrc
2608 || sysfmt == sysend // format not found
2609 || sysfmt->second.count(cmd) == 0 // this command not found
2611 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2617 case RC_EDITOR_ALTERNATIVES: {
2618 Alternatives::const_iterator it = editor_alternatives.begin();
2619 Alternatives::const_iterator const en = editor_alternatives.end();
2620 Alternatives::const_iterator const sysend =
2621 system_lyxrc.editor_alternatives.end();
2622 for (; it != en; ++it) {
2623 string const & fmt = it->first;
2624 CommandSet const & cmd = it->second;
2625 CommandSet::const_iterator sit = cmd.begin();
2626 CommandSet::const_iterator const sen = cmd.end();
2627 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2628 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2629 system_lyxrc.editor_alternatives.find(fmt);
2630 for (; sit != sen; ++sit) {
2631 string const & cmd = *sit;
2632 if (ignore_system_lyxrc
2633 || sysfmt == sysend // format not found
2634 || sysfmt->second.count(cmd) == 0 // this command not found
2636 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2642 case RC_DEFAULT_VIEW_FORMAT:
2643 if (ignore_system_lyxrc ||
2644 default_view_format != system_lyxrc.default_view_format) {
2645 os << "\\default_view_format " << default_view_format << '\n';
2655 << "# CONVERTERS SECTION ##########################\n"
2659 // Look for new converters
2660 for (Converters::const_iterator cit = theConverters().begin();
2661 cit != theConverters().end(); ++cit) {
2662 Converter const * converter =
2663 theSystemConverters().getConverter(cit->from,
2666 converter->command != cit->command ||
2667 converter->flags != cit->flags)
2668 os << "\\converter \"" << cit->from << "\" \""
2669 << cit->to << "\" \""
2670 << escapeCommand(cit->command) << "\" \""
2671 << cit->flags << "\"\n";
2674 // New/modifed converters
2675 for (Converters::const_iterator cit = theSystemConverters().begin();
2676 cit != theSystemConverters().end(); ++cit)
2677 if (!theConverters().getConverter(cit->from, cit->to))
2678 os << "\\converter \"" << cit->from
2679 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2686 << "# COPIERS SECTION ##########################\n"
2689 // Look for new movers
2690 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2691 Movers::const_iterator const sysend = theSystemMovers().end();
2692 Movers::const_iterator it = theMovers().begin();
2693 Movers::const_iterator end = theMovers().end();
2695 for (; it != end; ++it) {
2696 Movers::const_iterator const sysit =
2697 find_if(sysbegin, sysend, SameMover(*it));
2698 if (sysit == sysend) {
2699 string const & fmt = it->first;
2700 string const & command =
2701 it->second.command();
2703 os << "\\copier " << fmt
2704 << " \"" << escapeCommand(command) << "\"\n";
2710 // We don't actually delete SpecialisedMover(s) from the
2711 // map, just clear their 'command', so there's no need
2712 // to test for anything else.
2719 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2721 // Why the switch you might ask. It is a trick to ensure that all
2722 // the elements in the LyXRCTags enum is handled. As you can see
2723 // there are no breaks at all. So it is just a huge fall-through.
2724 // The nice thing is that we will get a warning from the compiler
2725 // if we forget an element.
2726 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2728 case LyXRC::RC_ACCEPT_COMPOUND:
2729 case LyXRC::RC_ALT_LANG:
2730 case LyXRC::RC_PLAINTEXT_LINELEN:
2731 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2732 case LyXRC::RC_AUTOCORRECTION_MATH:
2733 case LyXRC::RC_AUTOREGIONDELETE:
2734 case LyXRC::RC_AUTORESET_OPTIONS:
2735 case LyXRC::RC_AUTOSAVE:
2736 case LyXRC::RC_AUTO_NUMBER:
2737 case LyXRC::RC_BACKUPDIR_PATH:
2738 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2739 case LyXRC::RC_BIBTEX_COMMAND:
2740 case LyXRC::RC_BINDFILE:
2741 case LyXRC::RC_CHECKLASTFILES:
2742 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2743 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2744 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2745 case LyXRC::RC_COMPLETION_INLINE_MATH:
2746 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2747 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2748 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2749 case LyXRC::RC_COMPLETION_POPUP_MATH:
2750 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2751 case LyXRC::RC_USELASTFILEPOS:
2752 case LyXRC::RC_LOADSESSION:
2753 case LyXRC::RC_CHKTEX_COMMAND:
2754 case LyXRC::RC_CONVERTER:
2755 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2756 case LyXRC::RC_COPIER:
2757 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2758 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2759 case LyXRC::RC_DATE_INSERT_FORMAT:
2760 case LyXRC::RC_DEFAULT_LANGUAGE:
2761 case LyXRC::RC_GUI_LANGUAGE:
2762 case LyXRC::RC_DEFAULT_PAPERSIZE:
2763 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2764 case LyXRC::RC_DEFFILE:
2765 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2766 case LyXRC::RC_DISPLAY_GRAPHICS:
2767 case LyXRC::RC_DOCUMENTPATH:
2768 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2769 FileName path(lyxrc_new.document_path);
2770 if (path.exists() && path.isDirectory())
2771 package().document_dir() = FileName(lyxrc.document_path);
2773 case LyXRC::RC_EDITOR_ALTERNATIVES:
2774 case LyXRC::RC_ESC_CHARS:
2775 case LyXRC::RC_EXAMPLEPATH:
2776 case LyXRC::RC_FONT_ENCODING:
2777 case LyXRC::RC_FORMAT:
2778 case LyXRC::RC_GROUP_LAYOUTS:
2779 case LyXRC::RC_HUNSPELLDIR_PATH:
2780 case LyXRC::RC_INDEX_ALTERNATIVES:
2781 case LyXRC::RC_INDEX_COMMAND:
2782 case LyXRC::RC_JBIBTEX_COMMAND:
2783 case LyXRC::RC_JINDEX_COMMAND:
2784 case LyXRC::RC_NOMENCL_COMMAND:
2785 case LyXRC::RC_INPUT:
2786 case LyXRC::RC_KBMAP:
2787 case LyXRC::RC_KBMAP_PRIMARY:
2788 case LyXRC::RC_KBMAP_SECONDARY:
2789 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2790 case LyXRC::RC_LANGUAGE_AUTO_END:
2791 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2792 case LyXRC::RC_LANGUAGE_COMMAND_END:
2793 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2794 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2795 case LyXRC::RC_LANGUAGE_PACKAGE:
2796 case LyXRC::RC_LANGUAGE_USE_BABEL:
2797 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2798 case LyXRC::RC_MACRO_EDIT_STYLE:
2799 case LyXRC::RC_MAKE_BACKUP:
2800 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2801 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2802 case LyXRC::RC_NUMLASTFILES:
2803 case LyXRC::RC_PARAGRAPH_MARKERS:
2804 case LyXRC::RC_PATH_PREFIX:
2805 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2806 prependEnvPath("PATH", lyxrc.path_prefix);
2808 case LyXRC::RC_PERS_DICT:
2809 case LyXRC::RC_PREVIEW:
2810 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2811 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2812 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2813 case LyXRC::RC_PRINTCOPIESFLAG:
2814 case LyXRC::RC_PRINTER:
2815 case LyXRC::RC_PRINTEVENPAGEFLAG:
2816 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2817 case LyXRC::RC_PRINTFILEEXTENSION:
2818 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2819 case LyXRC::RC_PRINTODDPAGEFLAG:
2820 case LyXRC::RC_PRINTPAGERANGEFLAG:
2821 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2822 case LyXRC::RC_PRINTPAPERFLAG:
2823 case LyXRC::RC_PRINTREVERSEFLAG:
2824 case LyXRC::RC_PRINTSPOOL_COMMAND:
2825 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2826 case LyXRC::RC_PRINTTOFILE:
2827 case LyXRC::RC_PRINTTOPRINTER:
2828 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2829 case LyXRC::RC_PRINT_COMMAND:
2830 case LyXRC::RC_RTL_SUPPORT:
2831 case LyXRC::RC_SAVE_COMPRESSED:
2832 case LyXRC::RC_SCREEN_DPI:
2833 case LyXRC::RC_SCREEN_FONT_ROMAN:
2834 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2835 case LyXRC::RC_SCREEN_FONT_SANS:
2836 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2837 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2838 case LyXRC::RC_SCREEN_FONT_SIZES:
2839 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2840 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2841 case LyXRC::RC_GEOMETRY_SESSION:
2842 case LyXRC::RC_SCREEN_ZOOM:
2843 case LyXRC::RC_SERVERPIPE:
2844 case LyXRC::RC_SET_COLOR:
2845 case LyXRC::RC_SHOW_BANNER:
2846 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2847 case LyXRC::RC_SPELL_COMMAND:
2848 case LyXRC::RC_SPELLCHECKER:
2849 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2850 case LyXRC::RC_SPELLCHECK_NOTES:
2851 case LyXRC::RC_SPLITINDEX_COMMAND:
2852 case LyXRC::RC_TEMPDIRPATH:
2853 case LyXRC::RC_TEMPLATEPATH:
2854 case LyXRC::RC_TEX_ALLOWS_SPACES:
2855 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2856 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2857 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2859 case LyXRC::RC_THESAURUSDIRPATH:
2860 case LyXRC::RC_UIFILE:
2861 case LyXRC::RC_USER_EMAIL:
2862 case LyXRC::RC_USER_NAME:
2863 case LyXRC::RC_USETEMPDIR:
2864 case LyXRC::RC_USE_ALT_LANG:
2865 case LyXRC::RC_USE_CONVERTER_CACHE:
2866 case LyXRC::RC_USE_ESC_CHARS:
2867 case LyXRC::RC_USE_INP_ENC:
2868 case LyXRC::RC_USE_PERS_DICT:
2869 case LyXRC::RC_USE_TOOLTIP:
2870 case LyXRC::RC_USE_PIXMAP_CACHE:
2871 case LyXRC::RC_USE_SPELL_LIB:
2872 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2873 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2874 case LyXRC::RC_SORT_LAYOUTS:
2875 case LyXRC::RC_FULL_SCREEN_LIMIT:
2876 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2877 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2878 case LyXRC::RC_FULL_SCREEN_TABBAR:
2879 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2880 case LyXRC::RC_FULL_SCREEN_WIDTH:
2881 case LyXRC::RC_VISUAL_CURSOR:
2882 case LyXRC::RC_VIEWER:
2883 case LyXRC::RC_VIEWER_ALTERNATIVES:
2884 case LyXRC::RC_FORWARD_SEARCH_DVI:
2885 case LyXRC::RC_FORWARD_SEARCH_PDF:
2886 case LyXRC::RC_EXPORT_OVERWRITE:
2887 case LyXRC::RC_LAST:
2894 string const LyXRC::getDescription(LyXRCTags tag)
2899 case RC_ACCEPT_COMPOUND:
2900 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2904 case RC_USE_ALT_LANG:
2905 str = _("Specify an alternate language. The default is to use the language of the document.");
2908 case RC_PLAINTEXT_ROFF_COMMAND:
2909 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.");
2912 case RC_PLAINTEXT_LINELEN:
2913 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.");
2916 case RC_AUTOREGIONDELETE:
2917 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2920 case RC_AUTORESET_OPTIONS:
2921 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2925 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2928 case RC_AUTO_NUMBER:
2931 case RC_BACKUPDIR_PATH:
2932 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.");
2935 case RC_BIBTEX_COMMAND:
2936 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2939 case RC_JBIBTEX_COMMAND:
2940 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2944 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2947 case RC_CHECKLASTFILES:
2948 str = _("Select to check whether the lastfiles still exist.");
2951 case RC_CHKTEX_COMMAND:
2952 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2961 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2962 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.");
2965 case RC_SCROLL_BELOW_DOCUMENT:
2966 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");
2969 case RC_MAC_LIKE_WORD_MOVEMENT:
2970 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2973 case RC_SHOW_MACRO_LABEL:
2974 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2977 case RC_DATE_INSERT_FORMAT:
2978 //xgettext:no-c-format
2979 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2983 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2986 case RC_DEFAULT_VIEW_FORMAT:
2987 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2990 case RC_DEFAULT_LANGUAGE:
2991 str = _("New documents will be assigned this language.");
2994 case RC_DEFAULT_PAPERSIZE:
2995 str = _("Specify the default paper size.");
2998 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2999 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3002 case RC_DISPLAY_GRAPHICS:
3003 str = _("Select how LyX will display any graphics.");
3006 case RC_DOCUMENTPATH:
3007 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3011 case RC_USE_ESC_CHARS:
3012 str = _("Specify additional chars that can be part of a word.");
3015 case RC_EXAMPLEPATH:
3016 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3019 case RC_FONT_ENCODING:
3020 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3026 case RC_INDEX_COMMAND:
3027 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\".");
3030 case RC_JINDEX_COMMAND:
3031 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3034 case RC_NOMENCL_COMMAND:
3035 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3042 case RC_KBMAP_PRIMARY:
3043 case RC_KBMAP_SECONDARY:
3044 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.");
3047 case RC_LANGUAGE_AUTO_BEGIN:
3048 str = _("Select if a language switching command is needed at the beginning of the document.");
3051 case RC_LANGUAGE_AUTO_END:
3052 str = _("Select if a language switching command is needed at the end of the document.");
3055 case RC_LANGUAGE_COMMAND_BEGIN:
3056 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.");
3059 case RC_LANGUAGE_COMMAND_END:
3060 str = _("The LaTeX command for changing back to the language of the document.");
3063 case RC_LANGUAGE_COMMAND_LOCAL:
3064 str = _("The LaTeX command for local changing of the language.");
3067 case RC_LANGUAGE_GLOBAL_OPTIONS:
3068 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3071 case RC_LANGUAGE_PACKAGE:
3072 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3075 case RC_LANGUAGE_USE_BABEL:
3076 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3079 case RC_USELASTFILEPOS:
3080 str = _("De-select if you do not want LyX to scroll to saved position.");
3083 case RC_LOADSESSION:
3084 str = _("De-select to prevent loading files opened from the last LyX session.");
3087 case RC_MAKE_BACKUP:
3088 str = _("De-select if you don't want LyX to create backup files.");
3091 case RC_MARK_FOREIGN_LANGUAGE:
3092 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3095 case RC_MOUSE_WHEEL_SPEED:
3096 str = bformat(_("The scrolling speed of the mouse wheel."),
3100 case RC_COMPLETION_POPUP_DELAY:
3101 str = _("The completion popup delay.");
3104 case RC_COMPLETION_POPUP_MATH:
3105 str = _("Select to display the completion popup in math mode.");
3108 case RC_COMPLETION_POPUP_TEXT:
3109 str = _("Select to display the completion popup in text mode.");
3112 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3113 str = _("Show the completion popup without delay after non-unique completion attempt.");
3116 case RC_COMPLETION_POPUP_TEXT:
3117 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3120 case RC_COMPLETION_POPUP_DELAY:
3121 str = _("The inline completion delay.");
3124 case RC_COMPLETION_INLINE_MATH:
3125 str = _("Select to display the inline completion in math mode.");
3128 case RC_COMPLETION_INLINE_TEXT:
3129 str = _("Select to display the inline completion in text mode.");
3132 case RC_COMPLETION_INLINE_DOTS:
3133 str = _("Use \"...\" to shorten long completions.");
3136 case RC_AUTOCORRECTION_MATH:
3137 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3140 case RC_NUMLASTFILES:
3141 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3145 case RC_PATH_PREFIX:
3146 str = _("Specify those directories which should be "
3147 "prepended to the PATH environment variable. "
3148 "Use the OS native format.");
3152 str = _("Shows a typeset preview of things such as math");
3155 case RC_PREVIEW_HASHED_LABELS:
3156 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3159 case RC_PREVIEW_SCALE_FACTOR:
3160 str = _("Scale the preview size to suit.");
3163 case RC_PRINTCOLLCOPIESFLAG:
3164 str = _("The option for specifying whether the copies should be collated.");
3167 case RC_PRINTCOPIESFLAG:
3168 str = _("The option for specifying the number of copies to print.");
3172 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3175 case RC_PRINTEVENPAGEFLAG:
3176 str = _("The option to print only even pages.");
3179 case RC_PRINTEXSTRAOPTIONS:
3180 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3183 case RC_PRINTFILEEXTENSION:
3184 str = _("Extension of printer program output file. Usually \".ps\".");
3187 case RC_PRINTLANDSCAPEFLAG:
3188 str = _("The option to print out in landscape.");
3191 case RC_PRINTODDPAGEFLAG:
3192 str = _("The option to print only odd pages.");
3195 case RC_PRINTPAGERANGEFLAG:
3196 str = _("The option for specifying a comma-separated list of pages to print.");
3199 case RC_PRINTPAPERDIMENSIONFLAG:
3200 str = _("Option to specify the dimensions of the print paper.");
3203 case RC_PRINTPAPERFLAG:
3204 str = _("The option to specify paper type.");
3207 case RC_PRINTREVERSEFLAG:
3208 str = _("The option to reverse the order of the pages printed.");
3211 case RC_PRINTSPOOL_COMMAND:
3212 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.");
3215 case RC_PRINTSPOOL_PRINTERPREFIX:
3216 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.");
3219 case RC_PRINTTOFILE:
3220 str = _("Option to pass to the print program to print to a file.");
3223 case RC_PRINTTOPRINTER:
3224 str = _("Option to pass to the print program to print on a specific printer.");
3227 case RC_PRINT_ADAPTOUTPUT:
3228 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3231 case RC_PRINT_COMMAND:
3232 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3235 case RC_RTL_SUPPORT:
3236 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3239 case RC_VISUAL_CURSOR:
3240 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3244 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3247 case RC_SCREEN_FONT_ROMAN:
3248 case RC_SCREEN_FONT_SANS:
3249 case RC_SCREEN_FONT_TYPEWRITER:
3250 str = _("The screen fonts used to display the text while editing.");
3253 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3254 case RC_SCREEN_FONT_SANS_FOUNDRY:
3255 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3258 case RC_SCREEN_FONT_SCALABLE:
3259 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.");
3262 case RC_SCREEN_FONT_SIZES:
3263 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3266 case RC_SCREEN_ZOOM:
3267 //xgettext:no-c-format
3268 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3271 case RC_GEOMETRY_SESSION:
3272 str = _("Allow session manager to save and restore windows geometry.");
3276 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3282 case RC_SHOW_BANNER:
3283 str = _("De-select if you don't want the startup banner.");
3286 case RC_TEMPDIRPATH:
3287 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3290 case RC_THESAURUSDIRPATH:
3291 str = _("This is the place where the files of the thesaurus library reside.");
3294 case RC_TEMPLATEPATH:
3295 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3298 case RC_TEX_ALLOWS_SPACES:
3301 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3305 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3317 case RC_USE_TOOLTIP:
3318 str = _("Enable the automatic appearance of tool tips in the work area.");
3321 case RC_USE_PIXMAP_CACHE:
3322 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3325 case RC_USE_SPELL_LIB:
3328 case RC_VIEWDVI_PAPEROPTION:
3329 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3344 // The global instance
3347 // The global copy of the system lyxrc entries (everything except preferences)