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/filetools.h"
36 #include "support/gettext.h"
37 #include "support/lstrings.h"
38 #include "support/os.h"
39 #include "support/userinfo.h"
45 using namespace lyx::support;
49 namespace os = support::os;
53 // when adding something to this array keep it sorted!
54 LexerKeyword lyxrcTags[] = {
55 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
56 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
57 { "\\alternate_language", LyXRC::RC_ALT_LANG },
58 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
59 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
60 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
61 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
62 { "\\autosave", LyXRC::RC_AUTOSAVE },
63 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
64 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
65 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
66 { "\\bind_file", LyXRC::RC_BINDFILE },
67 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
68 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
69 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
70 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
71 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
72 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
73 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
74 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
75 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
76 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
77 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
78 { "\\converter", LyXRC::RC_CONVERTER },
79 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
80 { "\\copier", LyXRC::RC_COPIER },
81 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
82 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
83 { "\\def_file", LyXRC::RC_DEFFILE },
84 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
85 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
86 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
87 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
88 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
89 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
90 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
91 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
92 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
93 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
94 { "\\format", LyXRC::RC_FORMAT },
95 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
96 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
97 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
98 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
99 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
100 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
101 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
102 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
103 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
104 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
105 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
106 { "\\input", LyXRC::RC_INPUT },
107 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
108 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
109 { "\\kbmap", LyXRC::RC_KBMAP },
110 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
111 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
112 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
113 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
114 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
115 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
116 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
117 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
118 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
119 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
120 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
121 { "\\load_session", LyXRC::RC_LOADSESSION },
122 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
123 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
124 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
125 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
126 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
127 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
128 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
129 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
130 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
131 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
132 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
133 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
134 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
135 { "\\preview", LyXRC::RC_PREVIEW },
136 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
137 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
138 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
139 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
140 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
141 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
142 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
143 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
144 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
145 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
146 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
147 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
148 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
149 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
150 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
151 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
152 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
153 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
154 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
155 { "\\printer", LyXRC::RC_PRINTER },
156 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
157 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
158 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
159 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
160 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
161 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
162 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
163 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
164 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
165 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
166 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
167 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
168 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
169 { "\\set_color", LyXRC::RC_SET_COLOR },
170 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
171 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
172 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
173 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
174 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
175 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
176 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
177 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
178 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
179 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
180 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
181 { "\\ui_file", LyXRC::RC_UIFILE },
182 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
183 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
184 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
185 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
186 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
187 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
188 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
189 // compatibility with versions older than 1.4.0 only
190 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
191 // compatibility with versions older than 1.4.0 only
192 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
193 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
194 { "\\user_email", LyXRC::RC_USER_EMAIL },
195 { "\\user_name", LyXRC::RC_USER_NAME },
196 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
197 // compatibility with versions older than 1.4.0 only
198 { "\\viewer", LyXRC::RC_VIEWER},
199 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
200 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
203 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
214 void LyXRC::setDefaults()
217 def_file = "default";
219 // Get printer from the environment. If fail, use default "",
220 // assuming that everything is set up correctly.
221 printer = getEnv("PRINTER");
222 print_adapt_output = false;
223 print_command = "dvips";
224 print_evenpage_flag = "-B";
225 print_oddpage_flag = "-A";
226 print_pagerange_flag = "-pp";
227 print_copies_flag = "-c";
228 print_collcopies_flag = "-C";
229 print_reverse_flag = "-r";
230 print_landscape_flag = "-t landscape";
231 print_to_printer = "-P";
232 print_to_file = "-o ";
233 print_file_extension = ".ps";
234 print_paper_flag = "-t";
235 print_paper_dimension_flag = "-T";
236 document_path.erase();
237 view_dvi_paper_option.erase();
238 default_papersize = PAPER_DEFAULT;
239 default_view_format = "pdf2";
240 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
241 bibtex_command = "bibtex";
243 index_command = "makeindex -c -q";
244 nomencl_command = "makeindex -s nomencl.ist";
246 // Because a screen typically is wider than a piece of paper:
248 allow_geometry_session = true;
249 // Default LaTeX font size:
250 font_sizes[FONT_SIZE_TINY] = "5.0";
251 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
252 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
253 font_sizes[FONT_SIZE_SMALL] = "9.0";
254 font_sizes[FONT_SIZE_NORMAL] = "10.0";
255 font_sizes[FONT_SIZE_LARGE] = "12.0";
256 font_sizes[FONT_SIZE_LARGER] = "14.4";
257 font_sizes[FONT_SIZE_LARGEST] = "17.26";
258 font_sizes[FONT_SIZE_HUGE] = "20.74";
259 font_sizes[FONT_SIZE_HUGER] = "24.88";
260 use_scalable_fonts = true;
261 roman_font_name = "";
263 typewriter_font_name = "";
265 auto_region_delete = true;
266 auto_reset_options = false;
267 plaintext_linelen = 65;
268 mouse_wheel_speed = 1.0;
269 num_lastfiles = maxlastfiles;
270 check_lastfiles = true;
271 use_lastfilepos = true;
272 load_session = false;
274 backupdir_path.erase();
275 display_graphics = true;
276 // Spellchecker settings:
277 spellchecker = "aspell";
278 spellchecker_accept_compound = false;
279 spellcheck_continuously = false;
282 visual_cursor = false;
284 mark_foreign_language = true;
285 language_auto_begin = true;
286 language_auto_end = true;
287 language_global_options = true;
288 language_use_babel = true;
289 language_package = "\\usepackage{babel}";
290 language_command_begin = "\\selectlanguage{$$lang}";
291 language_command_local = "\\foreignlanguage{$$lang}{";
292 sort_layouts = false;
293 group_layouts = true;
294 default_language = "english";
295 gui_language = "auto";
297 windows_style_tex_paths = false;
298 tex_allows_spaces = false;
299 date_insert_format = "%x";
300 cursor_follows_scrollbar = false;
301 scroll_below_document = false;
302 paragraph_markers = false;
303 mac_like_word_movement = false;
304 macro_edit_style = MACRO_EDIT_INLINE_BOX;
305 dialogs_iconify_with_main = false;
306 label_init_length = 3;
307 preview = PREVIEW_OFF;
308 preview_hashed_labels = false;
309 preview_scale_factor = "0.9";
310 use_converter_cache = true;
312 use_pixmap_cache = false;
313 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
314 user_name = to_utf8(support::user_name());
315 user_email = to_utf8(support::user_email());
316 open_buffers_in_tabs = true;
318 // Fullscreen settings
319 full_screen_limit = false;
320 full_screen_toolbars = true;
321 full_screen_tabbar = true;
322 full_screen_menubar = true;
323 full_screen_scrollbar = true;
324 full_screen_width = 700;
326 completion_cursor_text = true;
327 completion_popup_math = true;
328 completion_popup_text = false;
329 completion_popup_delay = 2.0;
330 completion_popup_after_complete = true;
331 autocorrection_math = false;
332 completion_inline_math = true;
333 completion_inline_text = false;
334 completion_inline_dots = -1;
335 completion_inline_delay = 0.2;
341 void oldFontFormat(string & family, string & foundry)
343 if (family.empty() || family[0] != '-')
345 foundry = token(family, '-', 1);
346 family = token(family, '-', 2);
354 int LyXRC::read(FileName const & filename)
356 Lexer lexrc(lyxrcTags);
357 if (lyxerr.debugging(Debug::PARSER))
358 lexrc.printTable(lyxerr);
360 lexrc.setFile(filename);
364 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
370 int LyXRC::read(istream & is)
372 Lexer lexrc(lyxrcTags);
373 if (lyxerr.debugging(Debug::PARSER))
374 lexrc.printTable(lyxerr);
380 LYXERR(Debug::LYXRC, "Reading istream...");
386 int LyXRC::read(Lexer & lexrc)
391 while (lexrc.isOK()) {
392 // By using two switches we take advantage of the compiler
393 // telling us if we have missed a LyXRCTags element in
394 // the second switch.
395 // Note that this also shows a problem with Lexer since it
396 // helps us avoid taking advantage of the strictness of the
399 int le = lexrc.lex();
401 case Lexer::LEX_UNDEF:
402 lexrc.printError("Unknown tag `$$Token'");
404 case Lexer::LEX_FEOF:
409 switch (static_cast<LyXRCTags>(le)) {
410 case RC_INPUT: // Include file
413 libFileSearch(string(),
416 lexrc.printError("Error reading "
417 "included file: " + tmp.absFilename());
423 bind_file = os::internal_path(lexrc.getString());
428 def_file = os::internal_path(lexrc.getString());
433 ui_file = os::internal_path(lexrc.getString());
436 case RC_AUTORESET_OPTIONS:
437 lexrc >> auto_reset_options;
440 case RC_DISPLAY_GRAPHICS:
442 display_graphics = lexrc.getString() == "true";
445 case RC_TEX_EXPECTS_WINDOWS_PATHS:
446 lexrc >> windows_style_tex_paths;
449 case RC_TEX_ALLOWS_SPACES:
450 lexrc >> tex_allows_spaces;
457 case RC_KBMAP_PRIMARY:
459 string const kmap(os::internal_path(lexrc.getString()));
460 if (!libFileSearch("kbd", kmap, "kmap").empty()
462 primary_kbmap = kmap;
464 lexrc.printError("LyX: Keymap `$$Token' not found");
469 case RC_KBMAP_SECONDARY:
471 string const kmap(os::internal_path(lexrc.getString()));
472 if (!libFileSearch("kbd", kmap, "kmap").empty()
474 secondary_kbmap = kmap;
476 lexrc.printError("LyX: Keymap `$$Token' not found");
481 case RC_FONT_ENCODING:
489 case RC_PRINT_COMMAND:
490 if (lexrc.next(true)) {
491 print_command = lexrc.getString();
495 case RC_PRINTEVENPAGEFLAG:
496 lexrc >> print_evenpage_flag;
499 case RC_PRINTODDPAGEFLAG:
500 lexrc >> print_oddpage_flag;
503 case RC_PRINTPAGERANGEFLAG:
504 lexrc >> print_pagerange_flag;
507 case RC_PRINTCOPIESFLAG:
508 lexrc >> print_copies_flag;
511 case RC_PRINTCOLLCOPIESFLAG:
512 lexrc >> print_collcopies_flag;
515 case RC_PRINTREVERSEFLAG:
516 lexrc >> print_reverse_flag;
519 case RC_PRINTLANDSCAPEFLAG:
520 lexrc >> print_landscape_flag;
523 case RC_PRINTTOPRINTER:
524 lexrc >> print_to_printer;
527 case RC_PRINT_ADAPTOUTPUT:
528 lexrc >> print_adapt_output;
533 print_to_file = os::internal_path(lexrc.getString());
537 case RC_PRINTFILEEXTENSION:
538 lexrc >> print_file_extension;
541 case RC_PRINTEXSTRAOPTIONS:
542 lexrc >> print_extra_options;
545 case RC_PRINTSPOOL_COMMAND:
546 if (lexrc.next(true)) {
547 print_spool_command = lexrc.getString();
551 case RC_PRINTSPOOL_PRINTERPREFIX:
552 lexrc >> print_spool_printerprefix;
555 case RC_PRINTPAPERDIMENSIONFLAG:
556 lexrc >> print_paper_dimension_flag;
559 case RC_PRINTPAPERFLAG:
560 lexrc >> print_paper_flag;
563 case RC_DEFAULT_PAPERSIZE:
565 string const size = ascii_lowercase(lexrc.getString());
566 if (size == "usletter")
567 default_papersize = PAPER_USLETTER;
568 else if (size == "legal")
569 default_papersize = PAPER_USLEGAL;
570 else if (size == "executive")
571 default_papersize = PAPER_USEXECUTIVE;
572 else if (size == "a3")
573 default_papersize = PAPER_A3;
574 else if (size == "a4")
575 default_papersize = PAPER_A4;
576 else if (size == "a5")
577 default_papersize = PAPER_A5;
578 else if (size == "b5")
579 default_papersize = PAPER_B5;
580 else if (size == "default")
581 default_papersize = PAPER_DEFAULT;
585 case RC_VIEWDVI_PAPEROPTION:
587 view_dvi_paper_option = lexrc.getString();
589 view_dvi_paper_option.erase();
592 case RC_CHKTEX_COMMAND:
593 if (lexrc.next(true)) {
594 chktex_command = lexrc.getString();
598 case RC_BIBTEX_ALTERNATIVES:
599 if (lexrc.next(true)) {
600 bibtex_alternatives.insert(lexrc.getString());
604 case RC_BIBTEX_COMMAND:
605 if (lexrc.next(true)) {
606 bibtex_command = lexrc.getString();
610 case RC_JBIBTEX_COMMAND:
611 if (lexrc.next(true)) {
612 jbibtex_command = lexrc.getString();
616 case RC_INDEX_ALTERNATIVES:
617 if (lexrc.next(true)) {
618 index_alternatives.insert(lexrc.getString());
622 case RC_INDEX_COMMAND:
623 if (lexrc.next(true)) {
624 index_command = lexrc.getString();
628 case RC_JINDEX_COMMAND:
629 if (lexrc.next(true)) {
630 jindex_command = lexrc.getString();
634 case RC_SPLITINDEX_COMMAND:
635 if (lexrc.next(true)) {
636 splitindex_command = lexrc.getString();
640 case RC_NOMENCL_COMMAND:
641 if (lexrc.next(true)) {
642 nomencl_command = lexrc.getString();
654 case RC_GEOMETRY_SESSION:
655 lexrc >> allow_geometry_session;
658 case RC_SCREEN_FONT_SIZES:
659 lexrc >> font_sizes[FONT_SIZE_TINY];
660 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
661 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
662 lexrc >> font_sizes[FONT_SIZE_SMALL];
663 lexrc >> font_sizes[FONT_SIZE_NORMAL];
664 lexrc >> font_sizes[FONT_SIZE_LARGE];
665 lexrc >> font_sizes[FONT_SIZE_LARGER];
666 lexrc >> font_sizes[FONT_SIZE_LARGEST];
667 lexrc >> font_sizes[FONT_SIZE_HUGE];
668 lexrc >> font_sizes[FONT_SIZE_HUGER];
671 case RC_SCREEN_FONT_SCALABLE:
672 lexrc >> use_scalable_fonts;
679 case RC_DOCUMENTPATH:
681 document_path = os::internal_path(lexrc.getString());
682 document_path = expandPath(document_path);
688 example_path = os::internal_path(lexrc.getString());
689 example_path = expandPath(example_path);
693 case RC_TEMPLATEPATH:
695 template_path = os::internal_path(lexrc.getString());
696 template_path = expandPath(template_path);
702 tempdir_path = os::internal_path(lexrc.getString());
703 tempdir_path = expandPath(tempdir_path);
707 case RC_THESAURUSDIRPATH:
709 thesaurusdir_path = os::internal_path(lexrc.getString());
710 thesaurusdir_path = expandPath(thesaurusdir_path);
714 case RC_HUNSPELLDIR_PATH:
716 hunspelldir_path = os::internal_path(lexrc.getString());
717 hunspelldir_path = expandPath(hunspelldir_path);
721 case RC_USELASTFILEPOS:
722 lexrc >> use_lastfilepos;
726 lexrc >> load_session;
729 case RC_MOUSE_WHEEL_SPEED:
730 lexrc >> mouse_wheel_speed;
733 case RC_COMPLETION_INLINE_DELAY:
734 lexrc >> completion_inline_delay;
737 case RC_COMPLETION_INLINE_MATH:
738 lexrc >> completion_inline_math;
741 case RC_COMPLETION_INLINE_TEXT:
742 lexrc >> completion_inline_text;
745 case RC_COMPLETION_INLINE_DOTS:
746 lexrc >> completion_inline_dots;
749 case RC_AUTOCORRECTION_MATH:
750 lexrc >> autocorrection_math;
753 case RC_COMPLETION_POPUP_DELAY:
754 lexrc >> completion_popup_delay;
757 case RC_COMPLETION_POPUP_MATH:
758 lexrc >> completion_popup_math;
761 case RC_COMPLETION_POPUP_TEXT:
762 lexrc >> completion_popup_text;
765 case RC_COMPLETION_CURSOR_TEXT:
766 lexrc >> completion_cursor_text;
769 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
770 lexrc >> completion_popup_after_complete;
773 case RC_NUMLASTFILES:
774 lexrc >> num_lastfiles;
777 case RC_CHECKLASTFILES:
778 lexrc >> check_lastfiles;
781 case RC_SCREEN_FONT_ROMAN:
783 roman_font_name = lexrc.getString();
784 oldFontFormat(roman_font_name,
789 case RC_SCREEN_FONT_SANS:
791 sans_font_name = lexrc.getString();
792 oldFontFormat(sans_font_name, sans_font_foundry);
796 case RC_SCREEN_FONT_TYPEWRITER:
798 typewriter_font_name = lexrc.getString();
799 oldFontFormat(typewriter_font_name,
800 typewriter_font_foundry);
804 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
805 lexrc >> roman_font_foundry;
808 case RC_SCREEN_FONT_SANS_FOUNDRY:
809 lexrc >> sans_font_foundry;
812 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
813 lexrc >> typewriter_font_foundry;
818 lexrc.printError("Missing color tag.");
821 string lyx_name = lexrc.getString();
824 lexrc.printError("Missing color name for color: `$$Token'");
827 string x11_name = lexrc.getString();
829 ColorCode const col =
830 lcolor.getFromLyXName(lyx_name);
831 if (col == Color_none ||
832 col == Color_inherit ||
836 if (!lcolor.setColor(col, x11_name))
837 LYXERR0("Bad lyxrc set_color for " << lyx_name);
841 case RC_AUTOREGIONDELETE:
842 // Auto region delete defaults to true
843 lexrc >> auto_region_delete;
848 lyxpipes = os::internal_path(lexrc.getString());
849 lyxpipes = expandPath(lyxpipes);
853 case RC_CURSOR_FOLLOWS_SCROLLBAR:
854 lexrc >> cursor_follows_scrollbar;
857 case RC_SCROLL_BELOW_DOCUMENT:
858 lexrc >> scroll_below_document;
861 case RC_PARAGRAPH_MARKERS:
862 lexrc >> paragraph_markers;
865 case RC_MAC_LIKE_WORD_MOVEMENT:
866 lexrc >> mac_like_word_movement;
869 case RC_MACRO_EDIT_STYLE:
871 switch (lexrc.getInteger()) {
872 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
873 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
874 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
879 case RC_DIALOGS_ICONIFY_WITH_MAIN:
880 lexrc >> dialogs_iconify_with_main;
883 case RC_PLAINTEXT_LINELEN:
884 lexrc >> plaintext_linelen;
886 // Spellchecker settings:
887 case RC_ACCEPT_COMPOUND:
888 lexrc >> spellchecker_accept_compound;
891 lexrc >> use_tooltip;
893 case RC_USE_PIXMAP_CACHE:
894 lexrc >> use_pixmap_cache;
896 case RC_SPELLCHECKER:
897 lexrc >> spellchecker;
900 lexrc >> spellchecker_alt_lang;
903 lexrc >> spellchecker_esc_chars;
905 case RC_SPELLCHECK_CONTINUOUSLY:
906 lexrc >> spellcheck_continuously;
909 lexrc >> make_backup;
911 case RC_BACKUPDIR_PATH:
913 backupdir_path = os::internal_path(lexrc.getString());
914 backupdir_path = expandPath(backupdir_path);
917 case RC_DATE_INSERT_FORMAT:
918 lexrc >> date_insert_format;
920 case RC_LANGUAGE_PACKAGE:
921 lexrc >> language_package;
923 case RC_LANGUAGE_AUTO_BEGIN:
924 lexrc >> language_auto_begin;
926 case RC_LANGUAGE_AUTO_END:
927 lexrc >> language_auto_end;
929 case RC_LANGUAGE_GLOBAL_OPTIONS:
930 lexrc >> language_global_options;
932 case RC_LANGUAGE_USE_BABEL:
933 lexrc >> language_use_babel;
935 case RC_LANGUAGE_COMMAND_BEGIN:
936 lexrc >> language_command_begin;
938 case RC_LANGUAGE_COMMAND_END:
939 lexrc >> language_command_end;
941 case RC_LANGUAGE_COMMAND_LOCAL:
942 lexrc >> language_command_local;
945 lexrc >> rtl_support;
947 case RC_VISUAL_CURSOR:
948 lexrc >> visual_cursor;
951 lexrc >> auto_number;
953 case RC_MARK_FOREIGN_LANGUAGE:
954 lexrc >> mark_foreign_language;
960 fmt = lexrc.getString();
961 if (lexrc.next(true))
962 command = lexrc.getString();
963 setMover(fmt, command);
968 string from, to, command, flags;
970 from = lexrc.getString();
972 to = lexrc.getString();
973 if (lexrc.next(true))
974 command = lexrc.getString();
976 flags = lexrc.getString();
978 theConverters().erase(from, to);
980 theConverters().add(from, to, command, flags);
983 // compatibility with versions older than 1.4.0 only
985 string format, command;
986 lexrc >> format >> command;
987 formats.setViewer(format, command);
991 string format, extension, prettyname, shortcut;
992 lexrc >> format >> extension >> prettyname >> shortcut;
993 string viewer, editor;
994 if (lexrc.next(true))
995 viewer = lexrc.getString();
996 if (lexrc.next(true))
997 editor = lexrc.getString();
999 // Hack to ensure compatibility with versions older
1001 int le = lexrc.lex();
1002 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1003 flags = lexrc.getString();
1004 if (le != Lexer::LEX_DATA) {
1005 // We have got a known token.
1006 // Therefore this is an old style
1007 // format definition without
1009 lexrc.pushToken(flags);
1013 int flgs = Format::none;
1014 while (!flags.empty()) {
1016 flags = split(flags, flag, ',');
1017 if (flag == "document")
1018 flgs |= Format::document;
1019 else if (flag == "vector")
1020 flgs |= Format::vector;
1022 LYXERR0("Ignoring unknown flag `"
1023 << flag << "' for format `"
1026 if (prettyname.empty()) {
1027 if (theConverters().formatIsUsed(format))
1028 LYXERR0("Can't delete format " << format);
1030 formats.erase(format);
1032 formats.add(format, extension, prettyname,
1033 shortcut, viewer, editor, flgs);
1037 case RC_VIEWER_ALTERNATIVES: {
1038 string format, command;
1040 format = lexrc.getString();
1041 if (lexrc.eatLine())
1042 command = lexrc.getString();
1043 viewer_alternatives.push_back(make_pair(format, command));
1046 case RC_EDITOR_ALTERNATIVES: {
1047 string format, command;
1048 lexrc >> format >> command;
1049 editor_alternatives.push_back(make_pair(format, command));
1053 case RC_DEFAULT_VIEW_FORMAT:
1054 lexrc >> default_view_format;
1057 case RC_DEFAULT_LANGUAGE:
1058 lexrc >> default_language;
1061 case RC_GUI_LANGUAGE:
1062 lexrc >> gui_language;
1065 case RC_LABEL_INIT_LENGTH:
1066 lexrc >> label_init_length;
1069 case RC_SHOW_BANNER:
1070 lexrc >> show_banner;
1075 string const tmp = lexrc.getString();
1076 if (tmp == "true" || tmp == "on")
1077 preview = PREVIEW_ON;
1078 else if (tmp == "no_math")
1079 preview = PREVIEW_NO_MATH;
1081 preview = PREVIEW_OFF;
1082 if (tmp != "false" && tmp != "off")
1083 LYXERR0("Unrecognized preview status \""
1089 case RC_PREVIEW_HASHED_LABELS:
1090 lexrc >> preview_hashed_labels;
1093 case RC_PREVIEW_SCALE_FACTOR:
1094 lexrc >> preview_scale_factor;
1101 lexrc >> user_email;
1104 case RC_PATH_PREFIX:
1105 lexrc >> path_prefix;
1108 case RC_USE_CONVERTER_CACHE:
1109 lexrc >> use_converter_cache;
1111 case RC_CONVERTER_CACHE_MAXAGE:
1112 lexrc >> converter_cache_maxage;
1115 case RC_SORT_LAYOUTS:
1116 lexrc >> sort_layouts;
1118 case RC_GROUP_LAYOUTS:
1119 lexrc >> group_layouts;
1121 case RC_FULL_SCREEN_LIMIT:
1122 lexrc >> full_screen_limit;
1124 case RC_FULL_SCREEN_TOOLBARS:
1125 lexrc >> full_screen_toolbars;
1127 case RC_FULL_SCREEN_SCROLLBAR:
1128 lexrc >> full_screen_scrollbar;
1130 case RC_FULL_SCREEN_TABBAR:
1131 lexrc >> full_screen_tabbar;
1133 case RC_FULL_SCREEN_MENUBAR:
1134 lexrc >> full_screen_menubar;
1136 case RC_FULL_SCREEN_WIDTH:
1137 lexrc >> full_screen_width;
1139 case RC_OPEN_BUFFERS_IN_TABS:
1140 lexrc >> open_buffers_in_tabs;
1143 // Obsoteted in 1.4.0
1146 case RC_SPELL_COMMAND:
1148 case RC_PLAINTEXT_ROFF_COMMAND:
1149 case RC_USE_ALT_LANG:
1150 case RC_USE_ESC_CHARS:
1151 case RC_USE_INP_ENC:
1152 case RC_USE_PERS_DICT:
1153 case RC_USE_SPELL_LIB:
1154 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1155 << lexrc.getString() << "'.");
1160 break; // this is just a dummy
1164 /// Update converters data-structures
1165 theConverters().update(formats);
1166 theConverters().buildGraph();
1172 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1174 ofstream ofs(filename.toFilesystemEncoding().c_str());
1176 write(ofs, ignore_system_lyxrc);
1180 void LyXRC::print() const
1182 if (lyxerr.debugging())
1183 write(lyxerr, false);
1191 typedef pair<string, SpecialisedMover> Data;
1193 SameMover(Data const & comparison)
1194 : comparison_(comparison) {}
1196 bool operator()(Data const & data) const
1198 return data.first == comparison_.first &&
1199 data.second.command() == comparison_.second.command();
1209 // Escape \ and " so that LyXLex can read the string later
1210 string escapeCommand(string const & str) {
1211 return subst(subst(str , "\\", "\\\\"),
1218 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1220 LyXRCTags tag = RC_LAST;
1222 if (!name.empty()) {
1223 for (int i = 0; i != lyxrcCount; ++i)
1224 if ("\\" + name == lyxrcTags[i].tag)
1225 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1229 os << "# LyX " << lyx_version
1230 << " generated this file. If you want to make your own\n"
1231 << "# modifications you should do them from inside LyX and save.\n"
1234 // Why the switch you might ask. It is a trick to ensure that all
1235 // the elements in the LyXRCTags enum are handled. As you can see
1236 // there are no breaks at all. So it is just a huge fall-through.
1237 // The nice thing is that we will get a warning from the compiler
1238 // if we forget an element.
1242 // input/include files are not done here
1244 if (ignore_system_lyxrc ||
1245 bind_file != system_lyxrc.bind_file) {
1246 string const path = os::external_path(bind_file);
1247 os << "\\bind_file \"" << path << "\"\n";
1253 if (ignore_system_lyxrc ||
1254 def_file != system_lyxrc.def_file) {
1255 string const path = os::external_path(def_file);
1256 os << "\\def_file \"" << path << "\"\n";
1265 << "# MISC SECTION ######################################\n"
1267 // bind files are not done here.
1269 case RC_PATH_PREFIX:
1270 if (ignore_system_lyxrc ||
1271 path_prefix != system_lyxrc.path_prefix) {
1272 os << "\\path_prefix \"" << path_prefix << "\"\n";
1277 if (ignore_system_lyxrc ||
1278 ui_file != system_lyxrc.ui_file) {
1279 string const path = os::external_path(ui_file);
1280 os << "\\ui_file \"" << path << "\"\n";
1284 case RC_AUTOREGIONDELETE:
1285 if (ignore_system_lyxrc ||
1286 auto_region_delete != system_lyxrc.auto_region_delete) {
1287 os << "# Set to false to inhibit automatic replacement of\n"
1288 << "# the current selection.\n"
1289 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1294 case RC_AUTORESET_OPTIONS:
1295 if (ignore_system_lyxrc ||
1296 auto_reset_options != system_lyxrc.auto_reset_options) {
1297 os << "# Set to false to inhibit automatic reset of\n"
1298 << "# the class options to defaults on class change.\n"
1299 << "\\auto_reset_options "
1300 << convert<string>(auto_reset_options)
1306 if (ignore_system_lyxrc ||
1307 autosave != system_lyxrc.autosave) {
1308 os << "# The time interval between auto-saves in seconds.\n"
1309 << "\\autosave " << autosave << '\n';
1313 case RC_DISPLAY_GRAPHICS:
1314 if (ignore_system_lyxrc ||
1315 display_graphics != system_lyxrc.display_graphics) {
1316 os << "# Display graphics within LyX\n"
1318 << "\\display_graphics "
1319 << (display_graphics ? "true" : "false")
1324 case RC_SORT_LAYOUTS:
1325 if (ignore_system_lyxrc ||
1326 sort_layouts != system_lyxrc.sort_layouts) {
1327 os << "# Sort layouts alphabetically.\n"
1328 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1332 case RC_GROUP_LAYOUTS:
1333 if (ignore_system_lyxrc ||
1334 group_layouts != system_lyxrc.group_layouts) {
1335 os << "# Group layouts by their category.\n"
1336 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1340 case RC_VIEWDVI_PAPEROPTION:
1341 if (ignore_system_lyxrc ||
1342 view_dvi_paper_option
1343 != system_lyxrc.view_dvi_paper_option) {
1344 os << "# Options used to specify paper size to the\n"
1345 << "# view_dvi_command (e.g. -paper)\n"
1346 << "\\view_dvi_paper_option \""
1347 << view_dvi_paper_option << "\"\n";
1351 case RC_DEFAULT_PAPERSIZE:
1352 if (ignore_system_lyxrc ||
1353 default_papersize != system_lyxrc.default_papersize) {
1354 os << "# The default papersize to use.\n"
1355 << "\\default_papersize \"";
1356 switch (default_papersize) {
1358 os << "default"; break;
1359 case PAPER_USLETTER:
1360 os << "usletter"; break;
1362 os << "legal"; break;
1363 case PAPER_USEXECUTIVE:
1364 os << "executive"; break;
1375 case PAPER_B4: break;
1381 case RC_CHKTEX_COMMAND:
1382 if (ignore_system_lyxrc ||
1383 chktex_command != system_lyxrc.chktex_command) {
1384 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1388 case RC_BIBTEX_ALTERNATIVES: {
1389 set<string>::const_iterator it = bibtex_alternatives.begin();
1390 set<string>::const_iterator end = bibtex_alternatives.end();
1391 for ( ; it != end; ++it) {
1392 if (ignore_system_lyxrc
1393 || !system_lyxrc.bibtex_alternatives.count(*it))
1394 os << "\\bibtex_alternatives \""
1400 case RC_BIBTEX_COMMAND:
1401 if (ignore_system_lyxrc ||
1402 bibtex_command != system_lyxrc.bibtex_command) {
1403 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1407 case RC_JBIBTEX_COMMAND:
1408 if (ignore_system_lyxrc ||
1409 jbibtex_command != system_lyxrc.jbibtex_command) {
1410 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1414 case RC_INDEX_ALTERNATIVES: {
1415 set<string>::const_iterator it = index_alternatives.begin();
1416 set<string>::const_iterator end = index_alternatives.end();
1417 for ( ; it != end; ++it) {
1418 if (ignore_system_lyxrc
1419 || !system_lyxrc.index_alternatives.count(*it))
1420 os << "\\index_alternatives \""
1426 case RC_INDEX_COMMAND:
1427 if (ignore_system_lyxrc ||
1428 index_command != system_lyxrc.index_command) {
1429 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1433 case RC_JINDEX_COMMAND:
1434 if (ignore_system_lyxrc ||
1435 jindex_command != system_lyxrc.jindex_command) {
1436 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1440 case RC_SPLITINDEX_COMMAND:
1441 if (ignore_system_lyxrc ||
1442 splitindex_command != system_lyxrc.splitindex_command) {
1443 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1447 case RC_NOMENCL_COMMAND:
1448 if (ignore_system_lyxrc ||
1449 nomencl_command != system_lyxrc.nomencl_command) {
1450 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1454 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1455 if (ignore_system_lyxrc ||
1456 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1457 os << "\\tex_expects_windows_paths "
1458 << convert<string>(windows_style_tex_paths) << '\n';
1462 case RC_TEX_ALLOWS_SPACES:
1463 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1464 os << "\\tex_allows_spaces "
1465 << convert<string>(tex_allows_spaces) << '\n';
1470 if (ignore_system_lyxrc ||
1471 use_kbmap != system_lyxrc.use_kbmap) {
1472 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1476 case RC_KBMAP_PRIMARY:
1477 if (ignore_system_lyxrc ||
1478 primary_kbmap != system_lyxrc.primary_kbmap) {
1479 string const path = os::external_path(primary_kbmap);
1480 os << "\\kbmap_primary \"" << path << "\"\n";
1484 case RC_KBMAP_SECONDARY:
1485 if (ignore_system_lyxrc ||
1486 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1487 string const path = os::external_path(secondary_kbmap);
1488 os << "\\kbmap_secondary \"" << path << "\"\n";
1493 if (ignore_system_lyxrc ||
1494 lyxpipes != system_lyxrc.lyxpipes) {
1495 string const path = os::external_path(lyxpipes);
1496 os << "\\serverpipe \"" << path << "\"\n";
1500 case RC_DATE_INSERT_FORMAT:
1501 if (ignore_system_lyxrc ||
1502 date_insert_format != system_lyxrc.date_insert_format) {
1503 os << "\\date_insert_format \"" << date_insert_format
1508 case RC_LABEL_INIT_LENGTH:
1509 if (ignore_system_lyxrc ||
1510 label_init_length != system_lyxrc.label_init_length) {
1511 os << "\\label_init_length " << label_init_length
1518 os << "\\user_name \"" << user_name << "\"\n";
1523 os << "\\user_email \"" << user_email << "\"\n";
1527 case RC_SHOW_BANNER:
1528 if (ignore_system_lyxrc ||
1529 show_banner != system_lyxrc.show_banner) {
1530 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1536 if (ignore_system_lyxrc ||
1537 preview != system_lyxrc.preview) {
1543 case PREVIEW_NO_MATH:
1550 os << "\\preview " << status << '\n';
1555 case RC_PREVIEW_HASHED_LABELS:
1556 if (ignore_system_lyxrc ||
1557 preview_hashed_labels !=
1558 system_lyxrc.preview_hashed_labels) {
1559 os << "\\preview_hashed_labels "
1560 << convert<string>(preview_hashed_labels) << '\n';
1565 case RC_PREVIEW_SCALE_FACTOR:
1566 if (ignore_system_lyxrc ||
1567 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1568 os << "\\preview_scale_factor "
1569 << preview_scale_factor << '\n';
1574 case RC_USE_CONVERTER_CACHE:
1575 if (ignore_system_lyxrc ||
1576 use_converter_cache != system_lyxrc.use_converter_cache) {
1577 os << "\\use_converter_cache "
1578 << convert<string>(use_converter_cache) << '\n';
1583 case RC_CONVERTER_CACHE_MAXAGE:
1584 if (ignore_system_lyxrc ||
1585 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1586 os << "\\converter_cache_maxage "
1587 << converter_cache_maxage << '\n';
1593 << "# SCREEN & FONTS SECTION ############################\n"
1597 if (ignore_system_lyxrc ||
1598 dpi != system_lyxrc.dpi) {
1599 os << "\\screen_dpi " << dpi << '\n';
1603 case RC_SCREEN_ZOOM:
1604 if (ignore_system_lyxrc ||
1605 zoom != system_lyxrc.zoom) {
1606 os << "\\screen_zoom " << zoom << '\n';
1610 case RC_GEOMETRY_SESSION:
1611 if (ignore_system_lyxrc ||
1612 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1613 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1618 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1619 if (ignore_system_lyxrc ||
1620 cursor_follows_scrollbar
1621 != system_lyxrc.cursor_follows_scrollbar) {
1622 os << "\\cursor_follows_scrollbar "
1623 << convert<string>(cursor_follows_scrollbar) << '\n';
1627 case RC_SCROLL_BELOW_DOCUMENT:
1628 if (ignore_system_lyxrc ||
1629 scroll_below_document
1630 != system_lyxrc.scroll_below_document) {
1631 os << "\\scroll_below_document "
1632 << convert<string>(scroll_below_document) << '\n';
1636 case RC_PARAGRAPH_MARKERS:
1637 if (ignore_system_lyxrc ||
1639 != system_lyxrc.paragraph_markers) {
1640 os << "\\paragraph_markers "
1641 << convert<string>(paragraph_markers) << '\n';
1645 case RC_MAC_LIKE_WORD_MOVEMENT:
1646 if (ignore_system_lyxrc ||
1647 mac_like_word_movement
1648 != system_lyxrc.mac_like_word_movement) {
1649 os << "\\mac_like_word_movement "
1650 << convert<string>(mac_like_word_movement) << '\n';
1654 case RC_MACRO_EDIT_STYLE:
1655 if (ignore_system_lyxrc ||
1657 != system_lyxrc.macro_edit_style) {
1658 os << "\\macro_edit_style ";
1659 switch (macro_edit_style) {
1660 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1661 case MACRO_EDIT_INLINE: os << "1\n"; break;
1662 case MACRO_EDIT_LIST: os << "2\n"; break;
1667 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1668 if (ignore_system_lyxrc ||
1669 dialogs_iconify_with_main
1670 != system_lyxrc.dialogs_iconify_with_main) {
1671 os << "\\dialogs_iconify_with_main "
1672 << convert<string>(dialogs_iconify_with_main) << '\n';
1676 case RC_SCREEN_FONT_ROMAN:
1677 if (ignore_system_lyxrc ||
1678 roman_font_name != system_lyxrc.roman_font_name) {
1679 os << "\\screen_font_roman \"" << roman_font_name
1684 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1685 if (ignore_system_lyxrc ||
1686 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1687 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1692 case RC_SCREEN_FONT_SANS:
1693 if (ignore_system_lyxrc ||
1694 sans_font_name != system_lyxrc.sans_font_name) {
1695 os << "\\screen_font_sans \"" << sans_font_name
1700 case RC_SCREEN_FONT_SANS_FOUNDRY:
1701 if (ignore_system_lyxrc ||
1702 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1703 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1708 case RC_SCREEN_FONT_TYPEWRITER:
1709 if (ignore_system_lyxrc ||
1710 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1711 os << "\\screen_font_typewriter \""
1712 << typewriter_font_name << "\"\n";
1716 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1717 if (ignore_system_lyxrc ||
1718 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1719 os << "\\screen_font_typewriter_foundry \""
1720 << typewriter_font_foundry << "\"\n";
1725 case RC_SCREEN_FONT_SCALABLE:
1726 if (ignore_system_lyxrc ||
1727 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1728 os << "\\screen_font_scalable "
1729 << convert<string>(use_scalable_fonts)
1734 case RC_SCREEN_FONT_SIZES:
1735 if (ignore_system_lyxrc ||
1736 font_sizes[FONT_SIZE_TINY]
1737 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1738 font_sizes[FONT_SIZE_SCRIPT]
1739 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1740 font_sizes[FONT_SIZE_FOOTNOTE]
1741 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1742 font_sizes[FONT_SIZE_SMALL]
1743 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1744 font_sizes[FONT_SIZE_NORMAL]
1745 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1746 font_sizes[FONT_SIZE_LARGE]
1747 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1748 font_sizes[FONT_SIZE_LARGER]
1749 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1750 font_sizes[FONT_SIZE_LARGEST]
1751 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1752 font_sizes[FONT_SIZE_HUGE]
1753 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1754 font_sizes[FONT_SIZE_HUGER]
1755 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1756 os.setf(ios::fixed);
1758 os << "\\screen_font_sizes"
1759 << ' ' << font_sizes[FONT_SIZE_TINY]
1760 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1761 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1762 << ' ' << font_sizes[FONT_SIZE_SMALL]
1763 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1764 << ' ' << font_sizes[FONT_SIZE_LARGE]
1765 << ' ' << font_sizes[FONT_SIZE_LARGER]
1766 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1767 << ' ' << font_sizes[FONT_SIZE_HUGE]
1768 << ' ' << font_sizes[FONT_SIZE_HUGER]
1773 case RC_FULL_SCREEN_LIMIT:
1774 if (ignore_system_lyxrc ||
1775 full_screen_limit != system_lyxrc.full_screen_limit) {
1776 os << "\\fullscreen_limit "
1777 << convert<string>(full_screen_limit)
1782 case RC_FULL_SCREEN_TOOLBARS:
1783 if (ignore_system_lyxrc ||
1784 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1785 os << "\\fullscreen_toolbars "
1786 << convert<string>(full_screen_toolbars)
1791 case RC_FULL_SCREEN_SCROLLBAR:
1792 if (ignore_system_lyxrc ||
1793 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1794 os << "\\fullscreen_scrollbar "
1795 << convert<string>(full_screen_scrollbar)
1800 case RC_FULL_SCREEN_TABBAR:
1801 if (ignore_system_lyxrc ||
1802 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1803 os << "\\fullscreen_tabbar "
1804 << convert<string>(full_screen_tabbar)
1809 case RC_FULL_SCREEN_MENUBAR:
1810 if (ignore_system_lyxrc ||
1811 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1812 os << "\\fullscreen_menubar "
1813 << convert<string>(full_screen_menubar)
1818 case RC_FULL_SCREEN_WIDTH:
1819 if (ignore_system_lyxrc ||
1820 full_screen_width != system_lyxrc.full_screen_width) {
1821 os << "\\fullscreen_width "
1822 << convert<string>(full_screen_width)
1827 case RC_OPEN_BUFFERS_IN_TABS:
1828 if (ignore_system_lyxrc ||
1829 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1830 os << "\\open_buffers_in_tabs "
1831 << convert<string>(open_buffers_in_tabs)
1838 << "# COLOR SECTION ###################################\n"
1842 for (int i = 0; i < Color_ignore; ++i) {
1843 ColorCode lc = static_cast<ColorCode>(i);
1844 string const col = lcolor.getX11Name(lc);
1845 if (ignore_system_lyxrc
1846 || col != system_lcolor.getX11Name(lc)) {
1847 os << "\\set_color \""
1848 << lcolor.getLyXName(lc) << "\" \""
1856 << "# PRINTER SECTION ###################################\n"
1860 if (ignore_system_lyxrc ||
1861 printer != system_lyxrc.printer) {
1862 os << "\\printer \"" << printer << "\"\n";
1866 case RC_PRINT_ADAPTOUTPUT:
1867 if (ignore_system_lyxrc ||
1868 print_adapt_output != system_lyxrc.print_adapt_output) {
1869 os << "\\print_adapt_output "
1870 << convert<string>(print_adapt_output)
1875 case RC_PRINT_COMMAND:
1876 if (ignore_system_lyxrc ||
1877 print_command != system_lyxrc.print_command) {
1878 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1882 case RC_PRINTEXSTRAOPTIONS:
1883 if (ignore_system_lyxrc ||
1884 print_extra_options != system_lyxrc.print_extra_options) {
1885 os << "\\print_extra_options \"" << print_extra_options
1890 case RC_PRINTSPOOL_COMMAND:
1891 if (ignore_system_lyxrc ||
1892 print_spool_command != system_lyxrc.print_spool_command) {
1893 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1898 case RC_PRINTSPOOL_PRINTERPREFIX:
1899 if (ignore_system_lyxrc ||
1900 print_spool_printerprefix
1901 != system_lyxrc.print_spool_printerprefix) {
1902 os << "\\print_spool_printerprefix \""
1903 << print_spool_printerprefix << "\"\n";
1907 case RC_PRINTEVENPAGEFLAG:
1908 if (ignore_system_lyxrc ||
1909 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1910 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1915 case RC_PRINTODDPAGEFLAG:
1916 if (ignore_system_lyxrc ||
1917 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1918 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1923 case RC_PRINTREVERSEFLAG:
1924 if (ignore_system_lyxrc ||
1925 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1926 os << "\\print_reverse_flag \"" << print_reverse_flag
1931 case RC_PRINTLANDSCAPEFLAG:
1932 if (ignore_system_lyxrc ||
1933 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1934 os << "\\print_landscape_flag \"" << print_landscape_flag
1939 case RC_PRINTPAGERANGEFLAG:
1940 if (ignore_system_lyxrc ||
1941 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1942 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1947 case RC_PRINTCOPIESFLAG:
1948 if (ignore_system_lyxrc ||
1949 print_copies_flag != system_lyxrc.print_copies_flag) {
1950 os << "\\print_copies_flag \"" << print_copies_flag
1955 case RC_PRINTCOLLCOPIESFLAG:
1956 if (ignore_system_lyxrc ||
1957 print_collcopies_flag
1958 != system_lyxrc.print_collcopies_flag) {
1959 os << "\\print_collcopies_flag \""
1960 << print_collcopies_flag
1965 case RC_PRINTPAPERFLAG:
1966 if (ignore_system_lyxrc ||
1967 print_paper_flag != system_lyxrc.print_paper_flag) {
1968 os << "\\print_paper_flag \"" << print_paper_flag
1973 case RC_PRINTPAPERDIMENSIONFLAG:
1974 if (ignore_system_lyxrc ||
1975 print_paper_dimension_flag
1976 != system_lyxrc.print_paper_dimension_flag) {
1977 os << "\\print_paper_dimension_flag \""
1978 << print_paper_dimension_flag << "\"\n";
1982 case RC_PRINTTOPRINTER:
1983 if (ignore_system_lyxrc ||
1984 print_to_printer != system_lyxrc.print_to_printer) {
1985 os << "\\print_to_printer \"" << print_to_printer
1990 case RC_PRINTTOFILE:
1991 if (ignore_system_lyxrc ||
1992 print_to_file != system_lyxrc.print_to_file) {
1993 string const path = os::external_path(print_to_file);
1994 os << "\\print_to_file \"" << path << "\"\n";
1998 case RC_PRINTFILEEXTENSION:
1999 if (ignore_system_lyxrc ||
2000 print_file_extension != system_lyxrc.print_file_extension) {
2001 os << "\\print_file_extension \""
2002 << print_file_extension
2009 << "# TEX SECTION #######################################\n"
2012 case RC_FONT_ENCODING:
2013 if (ignore_system_lyxrc ||
2014 fontenc != system_lyxrc.fontenc) {
2015 os << "\\font_encoding \"" << fontenc << "\"\n";
2021 << "# FILE SECTION ######################################\n"
2024 case RC_DOCUMENTPATH:
2025 if (ignore_system_lyxrc ||
2026 document_path != system_lyxrc.document_path) {
2027 string const path = os::external_path(document_path);
2028 os << "\\document_path \"" << path << "\"\n";
2032 case RC_USELASTFILEPOS:
2033 if (ignore_system_lyxrc ||
2034 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2035 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2040 case RC_LOADSESSION:
2041 if (ignore_system_lyxrc ||
2042 load_session != system_lyxrc.load_session) {
2043 os << "\\load_session " << convert<string>(load_session)
2048 case RC_MOUSE_WHEEL_SPEED:
2049 if (ignore_system_lyxrc ||
2050 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2051 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2055 case RC_COMPLETION_INLINE_DELAY:
2056 if (ignore_system_lyxrc ||
2057 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2058 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2062 case RC_COMPLETION_INLINE_MATH:
2063 if (ignore_system_lyxrc ||
2064 completion_inline_math != system_lyxrc.completion_inline_math) {
2065 os << "\\completion_inline_math "
2066 << convert<string>(completion_inline_math) << '\n';
2070 case RC_COMPLETION_INLINE_TEXT:
2071 if (ignore_system_lyxrc ||
2072 completion_inline_text != system_lyxrc.completion_inline_text) {
2073 os << "\\completion_inline_text "
2074 << convert<string>(completion_inline_text) << '\n';
2078 case RC_COMPLETION_INLINE_DOTS:
2079 if (ignore_system_lyxrc ||
2080 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2081 os << "\\completion_inline_dots "
2082 << convert<string>(completion_inline_dots) << '\n';
2086 case RC_AUTOCORRECTION_MATH:
2087 if (ignore_system_lyxrc ||
2088 autocorrection_math != system_lyxrc.autocorrection_math) {
2089 os << "\\autocorrection_math "
2090 << convert<string>(autocorrection_math) << '\n';
2094 case RC_COMPLETION_POPUP_DELAY:
2095 if (ignore_system_lyxrc ||
2096 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2097 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2101 case RC_COMPLETION_POPUP_MATH:
2102 if (ignore_system_lyxrc ||
2103 completion_popup_math != system_lyxrc.completion_popup_math) {
2104 os << "\\completion_popup_math "
2105 << convert<string>(completion_popup_math) << '\n';
2109 case RC_COMPLETION_POPUP_TEXT:
2110 if (ignore_system_lyxrc ||
2111 completion_popup_text != system_lyxrc.completion_popup_text) {
2112 os << "\\completion_popup_text "
2113 << convert<string>(completion_popup_text) << '\n';
2117 case RC_COMPLETION_CURSOR_TEXT:
2118 if (ignore_system_lyxrc ||
2119 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2120 os << "\\completion_cursor_text "
2121 << convert<string>(completion_cursor_text) << '\n';
2125 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2126 if (ignore_system_lyxrc ||
2127 completion_popup_after_complete
2128 != system_lyxrc.completion_popup_after_complete) {
2129 os << "\\completion_popup_after_complete "
2130 << convert<string>(completion_popup_after_complete) << '\n';
2134 case RC_NUMLASTFILES:
2135 if (ignore_system_lyxrc ||
2136 num_lastfiles != system_lyxrc.num_lastfiles) {
2137 os << "\\num_lastfiles " << num_lastfiles << '\n';
2141 case RC_CHECKLASTFILES:
2142 if (ignore_system_lyxrc ||
2143 check_lastfiles != system_lyxrc.check_lastfiles) {
2144 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2149 case RC_EXAMPLEPATH:
2150 if (ignore_system_lyxrc ||
2151 example_path != system_lyxrc.example_path) {
2152 string const path = os::external_path(example_path);
2153 os << "\\example_path \"" << path << "\"\n";
2157 case RC_TEMPLATEPATH:
2158 if (ignore_system_lyxrc ||
2159 template_path != system_lyxrc.template_path) {
2160 string const path = os::external_path(template_path);
2161 os << "\\template_path \"" << path << "\"\n";
2165 case RC_TEMPDIRPATH:
2166 if (ignore_system_lyxrc ||
2167 tempdir_path != system_lyxrc.tempdir_path) {
2168 string const path = os::external_path(tempdir_path);
2169 os << "\\tempdir_path \"" << path << "\"\n";
2173 case RC_THESAURUSDIRPATH:
2174 if (ignore_system_lyxrc ||
2175 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2176 string const path = os::external_path(thesaurusdir_path);
2177 os << "\\thesaurusdir_path \"" << path << "\"\n";
2181 case RC_HUNSPELLDIR_PATH:
2182 if (ignore_system_lyxrc ||
2183 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2184 string const path = os::external_path(hunspelldir_path);
2185 os << "\\hunspelldir_path \"" << path << "\"\n";
2193 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2196 case RC_PLAINTEXT_LINELEN:
2197 if (ignore_system_lyxrc ||
2198 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2199 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2203 case RC_MAKE_BACKUP:
2204 if (ignore_system_lyxrc ||
2205 make_backup != system_lyxrc.make_backup) {
2206 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2210 case RC_BACKUPDIR_PATH:
2211 if (ignore_system_lyxrc ||
2212 backupdir_path != system_lyxrc.backupdir_path) {
2213 string const path = os::external_path(backupdir_path);
2214 os << "\\backupdir_path \"" << path << "\"\n";
2220 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2224 << "# SPELLCHECKER SECTION ##############################\n"
2227 case RC_SPELL_COMMAND:
2228 case RC_USE_SPELL_LIB:
2232 case RC_ACCEPT_COMPOUND:
2233 if (ignore_system_lyxrc ||
2234 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2235 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2240 case RC_USE_ALT_LANG:
2245 if (ignore_system_lyxrc ||
2246 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2247 os << "\\alternate_language \"" << spellchecker_alt_lang
2252 case RC_USE_ESC_CHARS:
2256 if (ignore_system_lyxrc ||
2257 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2258 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2262 case RC_USE_PERS_DICT:
2266 case RC_USE_TOOLTIP:
2267 if (ignore_system_lyxrc ||
2268 use_tooltip != system_lyxrc.use_tooltip) {
2269 os << "\\use_tooltip "
2270 << convert<string>(use_tooltip)
2275 case RC_USE_PIXMAP_CACHE:
2276 if (ignore_system_lyxrc ||
2277 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2278 os << "\\use_pixmap_cache "
2279 << convert<string>(use_pixmap_cache)
2288 case RC_USE_INP_ENC:
2294 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2299 case RC_SPELLCHECKER:
2300 if (ignore_system_lyxrc ||
2301 spellchecker != system_lyxrc.spellchecker) {
2302 os << "\\spellchecker " << spellchecker << '\n';
2307 case RC_SPELLCHECK_CONTINUOUSLY:
2308 if (ignore_system_lyxrc ||
2309 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2310 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2316 case RC_RTL_SUPPORT:
2317 if (ignore_system_lyxrc ||
2318 rtl_support != system_lyxrc.rtl_support) {
2319 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2323 case RC_VISUAL_CURSOR:
2324 if (ignore_system_lyxrc ||
2325 visual_cursor != system_lyxrc.visual_cursor) {
2326 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2330 case RC_LANGUAGE_PACKAGE:
2331 if (ignore_system_lyxrc ||
2332 language_package != system_lyxrc.language_package) {
2333 os << "\\language_package \"" << language_package
2338 case RC_LANGUAGE_GLOBAL_OPTIONS:
2339 if (ignore_system_lyxrc ||
2340 language_global_options
2341 != system_lyxrc.language_global_options) {
2342 os << "\\language_global_options \""
2343 << convert<string>(language_global_options)
2348 case RC_LANGUAGE_USE_BABEL:
2349 if (ignore_system_lyxrc ||
2350 language_use_babel != system_lyxrc.language_use_babel) {
2351 os << "\\language_use_babel \""
2352 << convert<string>(language_use_babel)
2357 case RC_LANGUAGE_COMMAND_BEGIN:
2358 if (ignore_system_lyxrc ||
2359 language_command_begin
2360 != system_lyxrc.language_command_begin) {
2361 os << "\\language_command_begin \""
2362 << language_command_begin
2367 case RC_LANGUAGE_COMMAND_END:
2368 if (ignore_system_lyxrc ||
2369 language_command_end
2370 != system_lyxrc.language_command_end) {
2371 os << "\\language_command_end \"" << language_command_end
2376 case RC_LANGUAGE_COMMAND_LOCAL:
2377 if (ignore_system_lyxrc ||
2378 language_command_local
2379 != system_lyxrc.language_command_local) {
2380 os << "\\language_command_local \""
2381 << language_command_local
2386 case RC_LANGUAGE_AUTO_BEGIN:
2387 if (ignore_system_lyxrc ||
2388 language_auto_begin != system_lyxrc.language_auto_begin) {
2389 os << "\\language_auto_begin "
2390 << convert<string>(language_auto_begin) << '\n';
2394 case RC_LANGUAGE_AUTO_END:
2395 if (ignore_system_lyxrc ||
2396 language_auto_end != system_lyxrc.language_auto_end) {
2397 os << "\\language_auto_end "
2398 << convert<string>(language_auto_end) << '\n';
2402 case RC_MARK_FOREIGN_LANGUAGE:
2403 if (ignore_system_lyxrc ||
2404 mark_foreign_language
2405 != system_lyxrc.mark_foreign_language) {
2406 os << "\\mark_foreign_language " <<
2407 convert<string>(mark_foreign_language) << '\n';
2413 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2416 case RC_AUTO_NUMBER:
2417 if (ignore_system_lyxrc ||
2418 auto_number != system_lyxrc.auto_number) {
2419 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2423 case RC_DEFAULT_LANGUAGE:
2424 if (ignore_system_lyxrc ||
2425 default_language != system_lyxrc.default_language) {
2426 os << "\\default_language " << default_language << '\n';
2430 case RC_GUI_LANGUAGE:
2431 if (ignore_system_lyxrc ||
2432 gui_language != system_lyxrc.gui_language) {
2433 os << "\\gui_language " << gui_language << '\n';
2439 << "# FORMATS SECTION ##########################\n"
2443 // New/modified formats
2444 for (Formats::const_iterator cit = formats.begin();
2445 cit != formats.end(); ++cit) {
2446 Format const * format =
2447 system_formats.getFormat(cit->name());
2449 format->extension() != cit->extension() ||
2450 format->prettyname() != cit->prettyname() ||
2451 format->shortcut() != cit->shortcut() ||
2452 format->viewer() != cit->viewer() ||
2453 format->editor() != cit->editor() ||
2454 format->documentFormat() != cit->documentFormat() ||
2455 format->vectorFormat() != cit->vectorFormat()) {
2456 os << "\\format \"" << cit->name() << "\" \""
2457 << cit->extension() << "\" \""
2458 << cit->prettyname() << "\" \""
2459 << cit->shortcut() << "\" \""
2460 << escapeCommand(cit->viewer()) << "\" \""
2461 << escapeCommand(cit->editor()) << "\" \"";
2462 vector<string> flags;
2463 if (cit->documentFormat())
2464 flags.push_back("document");
2465 if (cit->vectorFormat())
2466 flags.push_back("vector");
2467 os << getStringFromVector(flags);
2472 // Look for deleted formats
2473 for (Formats::const_iterator cit = system_formats.begin();
2474 cit != system_formats.end(); ++cit)
2475 if (!formats.getFormat(cit->name()))
2476 os << "\\format \"" << cit->name()
2477 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2480 case RC_VIEWER_ALTERNATIVES:
2481 if (ignore_system_lyxrc ||
2482 viewer_alternatives != system_lyxrc.viewer_alternatives) {
2483 for (vector<pair<string, string> >::const_iterator it = viewer_alternatives.begin();
2484 it != viewer_alternatives.end(); ++it)
2485 os << "\\viewer_alternatives "
2486 << it->first << " " << it->second << "\n";
2490 case RC_EDITOR_ALTERNATIVES:
2491 if (ignore_system_lyxrc ||
2492 editor_alternatives != system_lyxrc.editor_alternatives) {
2493 for (vector<pair<string, string> >::const_iterator it = editor_alternatives.begin();
2494 it != editor_alternatives.end(); ++it)
2495 os << "\\editor_alternatives "
2496 << it->first << " " << it->second << "\n";
2500 case RC_DEFAULT_VIEW_FORMAT:
2501 if (ignore_system_lyxrc ||
2502 default_view_format != system_lyxrc.default_view_format) {
2503 os << "\\default_view_format " << default_view_format << '\n';
2513 << "# CONVERTERS SECTION ##########################\n"
2517 // Look for new converters
2518 for (Converters::const_iterator cit = theConverters().begin();
2519 cit != theConverters().end(); ++cit) {
2520 Converter const * converter =
2521 theSystemConverters().getConverter(cit->from,
2524 converter->command != cit->command ||
2525 converter->flags != cit->flags)
2526 os << "\\converter \"" << cit->from << "\" \""
2527 << cit->to << "\" \""
2528 << escapeCommand(cit->command) << "\" \""
2529 << cit->flags << "\"\n";
2532 // New/modifed converters
2533 for (Converters::const_iterator cit = theSystemConverters().begin();
2534 cit != theSystemConverters().end(); ++cit)
2535 if (!theConverters().getConverter(cit->from, cit->to))
2536 os << "\\converter \"" << cit->from
2537 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2544 << "# COPIERS SECTION ##########################\n"
2547 // Look for new movers
2548 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2549 Movers::const_iterator const sysend = theSystemMovers().end();
2550 Movers::const_iterator it = theMovers().begin();
2551 Movers::const_iterator end = theMovers().end();
2553 for (; it != end; ++it) {
2554 Movers::const_iterator const sysit =
2555 find_if(sysbegin, sysend, SameMover(*it));
2556 if (sysit == sysend) {
2557 string const & fmt = it->first;
2558 string const & command =
2559 it->second.command();
2561 os << "\\copier " << fmt
2562 << " \"" << escapeCommand(command) << "\"\n";
2568 // We don't actually delete SpecialisedMover(s) from the
2569 // map, just clear their 'command', so there's no need
2570 // to test for anything else.
2578 string const LyXRC::getDescription(LyXRCTags tag)
2583 case RC_ACCEPT_COMPOUND:
2584 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2588 case RC_USE_ALT_LANG:
2589 str = _("Specify an alternate language. The default is to use the language of the document.");
2592 case RC_PLAINTEXT_ROFF_COMMAND:
2593 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.");
2596 case RC_PLAINTEXT_LINELEN:
2597 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.");
2600 case RC_AUTOREGIONDELETE:
2601 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2604 case RC_AUTORESET_OPTIONS:
2605 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2609 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2612 case RC_AUTO_NUMBER:
2615 case RC_BACKUPDIR_PATH:
2616 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.");
2619 case RC_BIBTEX_COMMAND:
2620 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2623 case RC_JBIBTEX_COMMAND:
2624 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2628 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2631 case RC_CHECKLASTFILES:
2632 str = _("Select to check whether the lastfiles still exist.");
2635 case RC_CHKTEX_COMMAND:
2636 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2645 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2646 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.");
2649 case RC_SCROLL_BELOW_DOCUMENT:
2650 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");
2653 case RC_MAC_LIKE_WORD_MOVEMENT:
2654 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2657 case RC_SHOW_MACRO_LABEL:
2658 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2661 case RC_DATE_INSERT_FORMAT:
2662 //xgettext:no-c-format
2663 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2667 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2670 case RC_DEFAULT_VIEW_FORMAT:
2671 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2674 case RC_DEFAULT_LANGUAGE:
2675 str = _("New documents will be assigned this language.");
2678 case RC_DEFAULT_PAPERSIZE:
2679 str = _("Specify the default paper size.");
2682 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2683 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2686 case RC_DISPLAY_GRAPHICS:
2687 str = _("Select how LyX will display any graphics.");
2690 case RC_DOCUMENTPATH:
2691 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2695 case RC_USE_ESC_CHARS:
2696 str = _("Specify additional chars that can be part of a word.");
2699 case RC_EXAMPLEPATH:
2700 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2703 case RC_FONT_ENCODING:
2704 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2710 case RC_INDEX_COMMAND:
2711 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\".");
2714 case RC_JINDEX_COMMAND:
2715 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2718 case RC_NOMENCL_COMMAND:
2719 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2726 case RC_KBMAP_PRIMARY:
2727 case RC_KBMAP_SECONDARY:
2728 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.");
2731 case RC_LABEL_INIT_LENGTH:
2732 str = _("Maximum number of words in the initialization string for a new label");
2735 case RC_LANGUAGE_AUTO_BEGIN:
2736 str = _("Select if a language switching command is needed at the beginning of the document.");
2739 case RC_LANGUAGE_AUTO_END:
2740 str = _("Select if a language switching command is needed at the end of the document.");
2743 case RC_LANGUAGE_COMMAND_BEGIN:
2744 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.");
2747 case RC_LANGUAGE_COMMAND_END:
2748 str = _("The LaTeX command for changing back to the language of the document.");
2751 case RC_LANGUAGE_COMMAND_LOCAL:
2752 str = _("The LaTeX command for local changing of the language.");
2755 case RC_LANGUAGE_GLOBAL_OPTIONS:
2756 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2759 case RC_LANGUAGE_PACKAGE:
2760 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2763 case RC_LANGUAGE_USE_BABEL:
2764 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2767 case RC_USELASTFILEPOS:
2768 str = _("De-select if you do not want LyX to scroll to saved position.");
2771 case RC_LOADSESSION:
2772 str = _("De-select to prevent loading files opened from the last LyX session.");
2775 case RC_MAKE_BACKUP:
2776 str = _("De-select if you don't want LyX to create backup files.");
2779 case RC_MARK_FOREIGN_LANGUAGE:
2780 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2783 case RC_MOUSE_WHEEL_SPEED:
2784 str = bformat(_("The scrolling speed of the mouse wheel."),
2788 case RC_COMPLETION_POPUP_DELAY:
2789 str = _("The completion popup delay.");
2792 case RC_COMPLETION_POPUP_MATH:
2793 str = _("Select to display the completion popup in math mode.");
2796 case RC_COMPLETION_POPUP_TEXT:
2797 str = _("Select to display the completion popup in text mode.");
2800 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2801 str = _("Show the completion popup without delay after non-unique completion attempt.");
2804 case RC_COMPLETION_POPUP_TEXT:
2805 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2808 case RC_COMPLETION_POPUP_DELAY:
2809 str = _("The inline completion delay.");
2812 case RC_COMPLETION_INLINE_MATH:
2813 str = _("Select to display the inline completion in math mode.");
2816 case RC_COMPLETION_INLINE_TEXT:
2817 str = _("Select to display the inline completion in text mode.");
2820 case RC_COMPLETION_INLINE_DOTS:
2821 str = _("Use \"...\" to shorten long completions.");
2824 case RC_AUTOCORRECTION_MATH:
2825 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2828 case RC_NUMLASTFILES:
2829 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2833 case RC_PATH_PREFIX:
2834 str = _("Specify those directories which should be "
2835 "prepended to the PATH environment variable. "
2836 "Use the OS native format.");
2840 str = _("Shows a typeset preview of things such as math");
2843 case RC_PREVIEW_HASHED_LABELS:
2844 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2847 case RC_PREVIEW_SCALE_FACTOR:
2848 str = _("Scale the preview size to suit.");
2851 case RC_PRINTCOLLCOPIESFLAG:
2852 str = _("The option for specifying whether the copies should be collated.");
2855 case RC_PRINTCOPIESFLAG:
2856 str = _("The option for specifying the number of copies to print.");
2860 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2863 case RC_PRINTEVENPAGEFLAG:
2864 str = _("The option to print only even pages.");
2867 case RC_PRINTEXSTRAOPTIONS:
2868 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2871 case RC_PRINTFILEEXTENSION:
2872 str = _("Extension of printer program output file. Usually \".ps\".");
2875 case RC_PRINTLANDSCAPEFLAG:
2876 str = _("The option to print out in landscape.");
2879 case RC_PRINTODDPAGEFLAG:
2880 str = _("The option to print only odd pages.");
2883 case RC_PRINTPAGERANGEFLAG:
2884 str = _("The option for specifying a comma-separated list of pages to print.");
2887 case RC_PRINTPAPERDIMENSIONFLAG:
2888 str = _("Option to specify the dimensions of the print paper.");
2891 case RC_PRINTPAPERFLAG:
2892 str = _("The option to specify paper type.");
2895 case RC_PRINTREVERSEFLAG:
2896 str = _("The option to reverse the order of the pages printed.");
2899 case RC_PRINTSPOOL_COMMAND:
2900 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.");
2903 case RC_PRINTSPOOL_PRINTERPREFIX:
2904 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.");
2907 case RC_PRINTTOFILE:
2908 str = _("Option to pass to the print program to print to a file.");
2911 case RC_PRINTTOPRINTER:
2912 str = _("Option to pass to the print program to print on a specific printer.");
2915 case RC_PRINT_ADAPTOUTPUT:
2916 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2919 case RC_PRINT_COMMAND:
2920 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2923 case RC_RTL_SUPPORT:
2924 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2927 case RC_VISUAL_CURSOR:
2928 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2932 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2935 case RC_SCREEN_FONT_ROMAN:
2936 case RC_SCREEN_FONT_SANS:
2937 case RC_SCREEN_FONT_TYPEWRITER:
2938 str = _("The screen fonts used to display the text while editing.");
2941 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2942 case RC_SCREEN_FONT_SANS_FOUNDRY:
2943 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2946 case RC_SCREEN_FONT_SCALABLE:
2947 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.");
2950 case RC_SCREEN_FONT_SIZES:
2951 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2954 case RC_SCREEN_ZOOM:
2955 //xgettext:no-c-format
2956 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2959 case RC_GEOMETRY_SESSION:
2960 str = _("Allow session manager to save and restore windows geometry.");
2964 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2970 case RC_SHOW_BANNER:
2971 str = _("De-select if you don't want the startup banner.");
2974 case RC_TEMPDIRPATH:
2975 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2978 case RC_THESAURUSDIRPATH:
2979 str = _("This is the place where the files of the thesaurus library reside.");
2982 case RC_TEMPLATEPATH:
2983 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2986 case RC_TEX_ALLOWS_SPACES:
2989 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2993 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3005 case RC_USE_TOOLTIP:
3006 str = _("Enable the automatic appearance of tool tips in the work area.");
3009 case RC_USE_PIXMAP_CACHE:
3010 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3013 case RC_USE_SPELL_LIB:
3016 case RC_VIEWDVI_PAPEROPTION:
3017 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3032 // The global instance
3035 // The global copy of the system lyxrc entries (everything except preferences)