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 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
91 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
92 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
93 { "\\format", LyXRC::RC_FORMAT },
94 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
95 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
96 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
97 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
98 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
99 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
100 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
101 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
102 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
103 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
104 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
105 { "\\input", LyXRC::RC_INPUT },
106 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
107 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
108 { "\\kbmap", LyXRC::RC_KBMAP },
109 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
110 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
111 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
112 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
113 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
114 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
115 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
116 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
117 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
118 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
119 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
120 { "\\load_session", LyXRC::RC_LOADSESSION },
121 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
122 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
123 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
124 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
125 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
126 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
127 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
128 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
129 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
130 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
131 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
132 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
133 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
134 { "\\preview", LyXRC::RC_PREVIEW },
135 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
136 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
137 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
138 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
139 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
140 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
141 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
142 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
143 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
144 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
145 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
146 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
147 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
148 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
149 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
150 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
151 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
152 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
153 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
154 { "\\printer", LyXRC::RC_PRINTER },
155 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
156 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
157 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
158 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
159 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
160 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
161 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
162 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
163 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
164 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
165 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
166 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
167 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
168 { "\\set_color", LyXRC::RC_SET_COLOR },
169 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
170 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
171 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
172 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
173 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
174 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
175 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
176 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
177 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
178 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
179 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
180 { "\\ui_file", LyXRC::RC_UIFILE },
181 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
182 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
183 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
184 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
185 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
186 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
187 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
188 // compatibility with versions older than 1.4.0 only
189 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
190 // compatibility with versions older than 1.4.0 only
191 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
192 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
193 { "\\user_email", LyXRC::RC_USER_EMAIL },
194 { "\\user_name", LyXRC::RC_USER_NAME },
195 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
196 // compatibility with versions older than 1.4.0 only
197 { "\\viewer", LyXRC::RC_VIEWER},
198 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
201 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
212 void LyXRC::setDefaults()
215 def_file = "default";
217 // Get printer from the environment. If fail, use default "",
218 // assuming that everything is set up correctly.
219 printer = getEnv("PRINTER");
220 print_adapt_output = false;
221 print_command = "dvips";
222 print_evenpage_flag = "-B";
223 print_oddpage_flag = "-A";
224 print_pagerange_flag = "-pp";
225 print_copies_flag = "-c";
226 print_collcopies_flag = "-C";
227 print_reverse_flag = "-r";
228 print_landscape_flag = "-t landscape";
229 print_to_printer = "-P";
230 print_to_file = "-o ";
231 print_file_extension = ".ps";
232 print_paper_flag = "-t";
233 print_paper_dimension_flag = "-T";
234 document_path.erase();
235 view_dvi_paper_option.erase();
236 default_papersize = PAPER_DEFAULT;
237 default_view_format = "pdf2";
238 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
239 bibtex_command = "bibtex";
241 index_command = "makeindex -c -q";
242 nomencl_command = "makeindex -s nomencl.ist";
244 // Because a screen typically is wider than a piece of paper:
246 allow_geometry_session = true;
247 // Default LaTeX font size:
248 font_sizes[FONT_SIZE_TINY] = "5.0";
249 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
250 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
251 font_sizes[FONT_SIZE_SMALL] = "9.0";
252 font_sizes[FONT_SIZE_NORMAL] = "10.0";
253 font_sizes[FONT_SIZE_LARGE] = "12.0";
254 font_sizes[FONT_SIZE_LARGER] = "14.4";
255 font_sizes[FONT_SIZE_LARGEST] = "17.26";
256 font_sizes[FONT_SIZE_HUGE] = "20.74";
257 font_sizes[FONT_SIZE_HUGER] = "24.88";
258 use_scalable_fonts = true;
259 roman_font_name = "";
261 typewriter_font_name = "";
263 auto_region_delete = true;
264 auto_reset_options = false;
265 plaintext_linelen = 65;
266 mouse_wheel_speed = 1.0;
267 num_lastfiles = maxlastfiles;
268 check_lastfiles = true;
269 use_lastfilepos = true;
270 load_session = false;
272 backupdir_path.erase();
273 display_graphics = true;
274 // Spellchecker settings:
275 spellchecker = "aspell";
276 spellchecker_accept_compound = false;
277 spellcheck_continuously = false;
280 visual_cursor = false;
282 mark_foreign_language = true;
283 language_auto_begin = true;
284 language_auto_end = true;
285 language_global_options = true;
286 language_use_babel = true;
287 language_package = "\\usepackage{babel}";
288 language_command_begin = "\\selectlanguage{$$lang}";
289 language_command_local = "\\foreignlanguage{$$lang}{";
290 sort_layouts = false;
291 group_layouts = true;
292 default_language = "english";
293 gui_language = "auto";
295 windows_style_tex_paths = false;
296 tex_allows_spaces = false;
297 date_insert_format = "%x";
298 cursor_follows_scrollbar = false;
299 scroll_below_document = false;
300 paragraph_markers = false;
301 mac_like_word_movement = false;
302 macro_edit_style = MACRO_EDIT_INLINE_BOX;
303 dialogs_iconify_with_main = false;
304 label_init_length = 3;
305 preview = PREVIEW_OFF;
306 preview_hashed_labels = false;
307 preview_scale_factor = "0.9";
308 use_converter_cache = true;
310 use_pixmap_cache = false;
311 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
312 user_name = to_utf8(support::user_name());
313 user_email = to_utf8(support::user_email());
314 open_buffers_in_tabs = true;
316 // Fullscreen settings
317 full_screen_limit = false;
318 full_screen_toolbars = true;
319 full_screen_tabbar = true;
320 full_screen_menubar = true;
321 full_screen_scrollbar = true;
322 full_screen_width = 700;
324 completion_cursor_text = true;
325 completion_popup_math = true;
326 completion_popup_text = false;
327 completion_popup_delay = 2.0;
328 completion_popup_after_complete = true;
329 autocorrection_math = false;
330 completion_inline_math = true;
331 completion_inline_text = false;
332 completion_inline_dots = -1;
333 completion_inline_delay = 0.2;
339 void oldFontFormat(string & family, string & foundry)
341 if (family.empty() || family[0] != '-')
343 foundry = token(family, '-', 1);
344 family = token(family, '-', 2);
352 int LyXRC::read(FileName const & filename)
354 Lexer lexrc(lyxrcTags);
355 if (lyxerr.debugging(Debug::PARSER))
356 lexrc.printTable(lyxerr);
358 lexrc.setFile(filename);
362 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
368 int LyXRC::read(istream & is)
370 Lexer lexrc(lyxrcTags);
371 if (lyxerr.debugging(Debug::PARSER))
372 lexrc.printTable(lyxerr);
378 LYXERR(Debug::LYXRC, "Reading istream...");
384 int LyXRC::read(Lexer & lexrc)
389 while (lexrc.isOK()) {
390 // By using two switches we take advantage of the compiler
391 // telling us if we have missed a LyXRCTags element in
392 // the second switch.
393 // Note that this also shows a problem with Lexer since it
394 // helps us avoid taking advantage of the strictness of the
397 int le = lexrc.lex();
399 case Lexer::LEX_UNDEF:
400 lexrc.printError("Unknown tag `$$Token'");
402 case Lexer::LEX_FEOF:
407 switch (static_cast<LyXRCTags>(le)) {
408 case RC_INPUT: // Include file
411 libFileSearch(string(),
414 lexrc.printError("Error reading "
415 "included file: " + tmp.absFilename());
421 bind_file = os::internal_path(lexrc.getString());
426 def_file = os::internal_path(lexrc.getString());
431 ui_file = os::internal_path(lexrc.getString());
434 case RC_AUTORESET_OPTIONS:
435 lexrc >> auto_reset_options;
438 case RC_DISPLAY_GRAPHICS:
440 display_graphics = lexrc.getString() == "true";
443 case RC_TEX_EXPECTS_WINDOWS_PATHS:
444 lexrc >> windows_style_tex_paths;
447 case RC_TEX_ALLOWS_SPACES:
448 lexrc >> tex_allows_spaces;
455 case RC_KBMAP_PRIMARY:
457 string const kmap(os::internal_path(lexrc.getString()));
458 if (!libFileSearch("kbd", kmap, "kmap").empty()
460 primary_kbmap = kmap;
462 lexrc.printError("LyX: Keymap `$$Token' not found");
467 case RC_KBMAP_SECONDARY:
469 string const kmap(os::internal_path(lexrc.getString()));
470 if (!libFileSearch("kbd", kmap, "kmap").empty()
472 secondary_kbmap = kmap;
474 lexrc.printError("LyX: Keymap `$$Token' not found");
479 case RC_FONT_ENCODING:
487 case RC_PRINT_COMMAND:
488 if (lexrc.next(true)) {
489 print_command = lexrc.getString();
493 case RC_PRINTEVENPAGEFLAG:
494 lexrc >> print_evenpage_flag;
497 case RC_PRINTODDPAGEFLAG:
498 lexrc >> print_oddpage_flag;
501 case RC_PRINTPAGERANGEFLAG:
502 lexrc >> print_pagerange_flag;
505 case RC_PRINTCOPIESFLAG:
506 lexrc >> print_copies_flag;
509 case RC_PRINTCOLLCOPIESFLAG:
510 lexrc >> print_collcopies_flag;
513 case RC_PRINTREVERSEFLAG:
514 lexrc >> print_reverse_flag;
517 case RC_PRINTLANDSCAPEFLAG:
518 lexrc >> print_landscape_flag;
521 case RC_PRINTTOPRINTER:
522 lexrc >> print_to_printer;
525 case RC_PRINT_ADAPTOUTPUT:
526 lexrc >> print_adapt_output;
531 print_to_file = os::internal_path(lexrc.getString());
535 case RC_PRINTFILEEXTENSION:
536 lexrc >> print_file_extension;
539 case RC_PRINTEXSTRAOPTIONS:
540 lexrc >> print_extra_options;
543 case RC_PRINTSPOOL_COMMAND:
544 if (lexrc.next(true)) {
545 print_spool_command = lexrc.getString();
549 case RC_PRINTSPOOL_PRINTERPREFIX:
550 lexrc >> print_spool_printerprefix;
553 case RC_PRINTPAPERDIMENSIONFLAG:
554 lexrc >> print_paper_dimension_flag;
557 case RC_PRINTPAPERFLAG:
558 lexrc >> print_paper_flag;
561 case RC_DEFAULT_PAPERSIZE:
563 string const size = ascii_lowercase(lexrc.getString());
564 if (size == "usletter")
565 default_papersize = PAPER_USLETTER;
566 else if (size == "legal")
567 default_papersize = PAPER_USLEGAL;
568 else if (size == "executive")
569 default_papersize = PAPER_USEXECUTIVE;
570 else if (size == "a3")
571 default_papersize = PAPER_A3;
572 else if (size == "a4")
573 default_papersize = PAPER_A4;
574 else if (size == "a5")
575 default_papersize = PAPER_A5;
576 else if (size == "b5")
577 default_papersize = PAPER_B5;
578 else if (size == "default")
579 default_papersize = PAPER_DEFAULT;
583 case RC_VIEWDVI_PAPEROPTION:
585 view_dvi_paper_option = lexrc.getString();
587 view_dvi_paper_option.erase();
590 case RC_CHKTEX_COMMAND:
591 if (lexrc.next(true)) {
592 chktex_command = lexrc.getString();
596 case RC_BIBTEX_ALTERNATIVES:
597 if (lexrc.next(true)) {
598 bibtex_alternatives.insert(lexrc.getString());
602 case RC_BIBTEX_COMMAND:
603 if (lexrc.next(true)) {
604 bibtex_command = lexrc.getString();
608 case RC_JBIBTEX_COMMAND:
609 if (lexrc.next(true)) {
610 jbibtex_command = lexrc.getString();
614 case RC_INDEX_ALTERNATIVES:
615 if (lexrc.next(true)) {
616 index_alternatives.insert(lexrc.getString());
620 case RC_INDEX_COMMAND:
621 if (lexrc.next(true)) {
622 index_command = lexrc.getString();
626 case RC_JINDEX_COMMAND:
627 if (lexrc.next(true)) {
628 jindex_command = lexrc.getString();
632 case RC_SPLITINDEX_COMMAND:
633 if (lexrc.next(true)) {
634 splitindex_command = lexrc.getString();
638 case RC_NOMENCL_COMMAND:
639 if (lexrc.next(true)) {
640 nomencl_command = lexrc.getString();
652 case RC_GEOMETRY_SESSION:
653 lexrc >> allow_geometry_session;
656 case RC_SCREEN_FONT_SIZES:
657 lexrc >> font_sizes[FONT_SIZE_TINY];
658 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
659 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
660 lexrc >> font_sizes[FONT_SIZE_SMALL];
661 lexrc >> font_sizes[FONT_SIZE_NORMAL];
662 lexrc >> font_sizes[FONT_SIZE_LARGE];
663 lexrc >> font_sizes[FONT_SIZE_LARGER];
664 lexrc >> font_sizes[FONT_SIZE_LARGEST];
665 lexrc >> font_sizes[FONT_SIZE_HUGE];
666 lexrc >> font_sizes[FONT_SIZE_HUGER];
669 case RC_SCREEN_FONT_SCALABLE:
670 lexrc >> use_scalable_fonts;
677 case RC_DOCUMENTPATH:
679 document_path = os::internal_path(lexrc.getString());
680 document_path = expandPath(document_path);
686 example_path = os::internal_path(lexrc.getString());
687 example_path = expandPath(example_path);
691 case RC_TEMPLATEPATH:
693 template_path = os::internal_path(lexrc.getString());
694 template_path = expandPath(template_path);
700 tempdir_path = os::internal_path(lexrc.getString());
701 tempdir_path = expandPath(tempdir_path);
705 case RC_THESAURUSDIRPATH:
707 thesaurusdir_path = os::internal_path(lexrc.getString());
708 thesaurusdir_path = expandPath(thesaurusdir_path);
712 case RC_HUNSPELLDIR_PATH:
714 hunspelldir_path = os::internal_path(lexrc.getString());
715 hunspelldir_path = expandPath(hunspelldir_path);
719 case RC_USELASTFILEPOS:
720 lexrc >> use_lastfilepos;
724 lexrc >> load_session;
727 case RC_MOUSE_WHEEL_SPEED:
728 lexrc >> mouse_wheel_speed;
731 case RC_COMPLETION_INLINE_DELAY:
732 lexrc >> completion_inline_delay;
735 case RC_COMPLETION_INLINE_MATH:
736 lexrc >> completion_inline_math;
739 case RC_COMPLETION_INLINE_TEXT:
740 lexrc >> completion_inline_text;
743 case RC_COMPLETION_INLINE_DOTS:
744 lexrc >> completion_inline_dots;
747 case RC_AUTOCORRECTION_MATH:
748 lexrc >> autocorrection_math;
751 case RC_COMPLETION_POPUP_DELAY:
752 lexrc >> completion_popup_delay;
755 case RC_COMPLETION_POPUP_MATH:
756 lexrc >> completion_popup_math;
759 case RC_COMPLETION_POPUP_TEXT:
760 lexrc >> completion_popup_text;
763 case RC_COMPLETION_CURSOR_TEXT:
764 lexrc >> completion_cursor_text;
767 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
768 lexrc >> completion_popup_after_complete;
771 case RC_NUMLASTFILES:
772 lexrc >> num_lastfiles;
775 case RC_CHECKLASTFILES:
776 lexrc >> check_lastfiles;
779 case RC_SCREEN_FONT_ROMAN:
781 roman_font_name = lexrc.getString();
782 oldFontFormat(roman_font_name,
787 case RC_SCREEN_FONT_SANS:
789 sans_font_name = lexrc.getString();
790 oldFontFormat(sans_font_name, sans_font_foundry);
794 case RC_SCREEN_FONT_TYPEWRITER:
796 typewriter_font_name = lexrc.getString();
797 oldFontFormat(typewriter_font_name,
798 typewriter_font_foundry);
802 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
803 lexrc >> roman_font_foundry;
806 case RC_SCREEN_FONT_SANS_FOUNDRY:
807 lexrc >> sans_font_foundry;
810 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
811 lexrc >> typewriter_font_foundry;
816 lexrc.printError("Missing color tag.");
819 string lyx_name = lexrc.getString();
822 lexrc.printError("Missing color name for color: `$$Token'");
825 string x11_name = lexrc.getString();
827 ColorCode const col =
828 lcolor.getFromLyXName(lyx_name);
829 if (col == Color_none ||
830 col == Color_inherit ||
834 if (!lcolor.setColor(col, x11_name))
835 LYXERR0("Bad lyxrc set_color for " << lyx_name);
839 case RC_AUTOREGIONDELETE:
840 // Auto region delete defaults to true
841 lexrc >> auto_region_delete;
846 lyxpipes = os::internal_path(lexrc.getString());
847 lyxpipes = expandPath(lyxpipes);
851 case RC_CURSOR_FOLLOWS_SCROLLBAR:
852 lexrc >> cursor_follows_scrollbar;
855 case RC_SCROLL_BELOW_DOCUMENT:
856 lexrc >> scroll_below_document;
859 case RC_PARAGRAPH_MARKERS:
860 lexrc >> paragraph_markers;
863 case RC_MAC_LIKE_WORD_MOVEMENT:
864 lexrc >> mac_like_word_movement;
867 case RC_MACRO_EDIT_STYLE:
869 switch (lexrc.getInteger()) {
870 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
871 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
872 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
877 case RC_DIALOGS_ICONIFY_WITH_MAIN:
878 lexrc >> dialogs_iconify_with_main;
881 case RC_PLAINTEXT_LINELEN:
882 lexrc >> plaintext_linelen;
884 // Spellchecker settings:
885 case RC_ACCEPT_COMPOUND:
886 lexrc >> spellchecker_accept_compound;
889 lexrc >> use_tooltip;
891 case RC_USE_PIXMAP_CACHE:
892 lexrc >> use_pixmap_cache;
894 case RC_SPELLCHECKER:
895 lexrc >> spellchecker;
898 lexrc >> spellchecker_alt_lang;
901 lexrc >> spellchecker_esc_chars;
903 case RC_SPELLCHECK_CONTINUOUSLY:
904 lexrc >> spellcheck_continuously;
907 lexrc >> make_backup;
909 case RC_BACKUPDIR_PATH:
911 backupdir_path = os::internal_path(lexrc.getString());
912 backupdir_path = expandPath(backupdir_path);
915 case RC_DATE_INSERT_FORMAT:
916 lexrc >> date_insert_format;
918 case RC_LANGUAGE_PACKAGE:
919 lexrc >> language_package;
921 case RC_LANGUAGE_AUTO_BEGIN:
922 lexrc >> language_auto_begin;
924 case RC_LANGUAGE_AUTO_END:
925 lexrc >> language_auto_end;
927 case RC_LANGUAGE_GLOBAL_OPTIONS:
928 lexrc >> language_global_options;
930 case RC_LANGUAGE_USE_BABEL:
931 lexrc >> language_use_babel;
933 case RC_LANGUAGE_COMMAND_BEGIN:
934 lexrc >> language_command_begin;
936 case RC_LANGUAGE_COMMAND_END:
937 lexrc >> language_command_end;
939 case RC_LANGUAGE_COMMAND_LOCAL:
940 lexrc >> language_command_local;
943 lexrc >> rtl_support;
945 case RC_VISUAL_CURSOR:
946 lexrc >> visual_cursor;
949 lexrc >> auto_number;
951 case RC_MARK_FOREIGN_LANGUAGE:
952 lexrc >> mark_foreign_language;
958 fmt = lexrc.getString();
959 if (lexrc.next(true))
960 command = lexrc.getString();
961 setMover(fmt, command);
966 string from, to, command, flags;
968 from = lexrc.getString();
970 to = lexrc.getString();
971 if (lexrc.next(true))
972 command = lexrc.getString();
974 flags = lexrc.getString();
976 theConverters().erase(from, to);
978 theConverters().add(from, to, command, flags);
981 // compatibility with versions older than 1.4.0 only
983 string format, command;
984 lexrc >> format >> command;
985 formats.setViewer(format, command);
989 string format, extension, prettyname, shortcut;
990 lexrc >> format >> extension >> prettyname >> shortcut;
991 string viewer, editor;
992 if (lexrc.next(true))
993 viewer = lexrc.getString();
994 if (lexrc.next(true))
995 editor = lexrc.getString();
997 // Hack to ensure compatibility with versions older
999 int le = lexrc.lex();
1000 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1001 flags = lexrc.getString();
1002 if (le != Lexer::LEX_DATA) {
1003 // We have got a known token.
1004 // Therefore this is an old style
1005 // format definition without
1007 lexrc.pushToken(flags);
1011 int flgs = Format::none;
1012 while (!flags.empty()) {
1014 flags = split(flags, flag, ',');
1015 if (flag == "document")
1016 flgs |= Format::document;
1017 else if (flag == "vector")
1018 flgs |= Format::vector;
1020 LYXERR0("Ignoring unknown flag `"
1021 << flag << "' for format `"
1024 if (prettyname.empty()) {
1025 if (theConverters().formatIsUsed(format))
1026 LYXERR0("Can't delete format " << format);
1028 formats.erase(format);
1030 formats.add(format, extension, prettyname,
1031 shortcut, viewer, editor, flgs);
1035 case RC_DEFAULT_VIEW_FORMAT:
1036 lexrc >> default_view_format;
1039 case RC_DEFAULT_LANGUAGE:
1040 lexrc >> default_language;
1043 case RC_GUI_LANGUAGE:
1044 lexrc >> gui_language;
1047 case RC_LABEL_INIT_LENGTH:
1048 lexrc >> label_init_length;
1051 case RC_SHOW_BANNER:
1052 lexrc >> show_banner;
1057 string const tmp = lexrc.getString();
1058 if (tmp == "true" || tmp == "on")
1059 preview = PREVIEW_ON;
1060 else if (tmp == "no_math")
1061 preview = PREVIEW_NO_MATH;
1063 preview = PREVIEW_OFF;
1064 if (tmp != "false" && tmp != "off")
1065 LYXERR0("Unrecognized preview status \""
1071 case RC_PREVIEW_HASHED_LABELS:
1072 lexrc >> preview_hashed_labels;
1075 case RC_PREVIEW_SCALE_FACTOR:
1076 lexrc >> preview_scale_factor;
1083 lexrc >> user_email;
1086 case RC_PATH_PREFIX:
1087 lexrc >> path_prefix;
1090 case RC_USE_CONVERTER_CACHE:
1091 lexrc >> use_converter_cache;
1093 case RC_CONVERTER_CACHE_MAXAGE:
1094 lexrc >> converter_cache_maxage;
1097 case RC_SORT_LAYOUTS:
1098 lexrc >> sort_layouts;
1100 case RC_GROUP_LAYOUTS:
1101 lexrc >> group_layouts;
1103 case RC_FULL_SCREEN_LIMIT:
1104 lexrc >> full_screen_limit;
1106 case RC_FULL_SCREEN_TOOLBARS:
1107 lexrc >> full_screen_toolbars;
1109 case RC_FULL_SCREEN_SCROLLBAR:
1110 lexrc >> full_screen_scrollbar;
1112 case RC_FULL_SCREEN_TABBAR:
1113 lexrc >> full_screen_tabbar;
1115 case RC_FULL_SCREEN_MENUBAR:
1116 lexrc >> full_screen_menubar;
1118 case RC_FULL_SCREEN_WIDTH:
1119 lexrc >> full_screen_width;
1121 case RC_OPEN_BUFFERS_IN_TABS:
1122 lexrc >> open_buffers_in_tabs;
1125 // Obsoteted in 1.4.0
1128 case RC_SPELL_COMMAND:
1130 case RC_PLAINTEXT_ROFF_COMMAND:
1131 case RC_USE_ALT_LANG:
1132 case RC_USE_ESC_CHARS:
1133 case RC_USE_INP_ENC:
1134 case RC_USE_PERS_DICT:
1135 case RC_USE_SPELL_LIB:
1136 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1137 << lexrc.getString() << "'.");
1142 break; // this is just a dummy
1146 /// Update converters data-structures
1147 theConverters().update(formats);
1148 theConverters().buildGraph();
1154 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1156 ofstream ofs(filename.toFilesystemEncoding().c_str());
1158 write(ofs, ignore_system_lyxrc);
1162 void LyXRC::print() const
1164 if (lyxerr.debugging())
1165 write(lyxerr, false);
1173 typedef pair<string, SpecialisedMover> Data;
1175 SameMover(Data const & comparison)
1176 : comparison_(comparison) {}
1178 bool operator()(Data const & data) const
1180 return data.first == comparison_.first &&
1181 data.second.command() == comparison_.second.command();
1191 // Escape \ and " so that LyXLex can read the string later
1192 string escapeCommand(string const & str) {
1193 return subst(subst(str , "\\", "\\\\"),
1200 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1202 LyXRCTags tag = RC_LAST;
1204 if (!name.empty()) {
1205 for (int i = 0; i != lyxrcCount; ++i)
1206 if ("\\" + name == lyxrcTags[i].tag)
1207 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1211 os << "# LyX " << lyx_version
1212 << " generated this file. If you want to make your own\n"
1213 << "# modifications you should do them from inside LyX and save.\n"
1216 // Why the switch you might ask. It is a trick to ensure that all
1217 // the elements in the LyXRCTags enum are handled. As you can see
1218 // there are no breaks at all. So it is just a huge fall-through.
1219 // The nice thing is that we will get a warning from the compiler
1220 // if we forget an element.
1224 // input/include files are not done here
1226 if (ignore_system_lyxrc ||
1227 bind_file != system_lyxrc.bind_file) {
1228 string const path = os::external_path(bind_file);
1229 os << "\\bind_file \"" << path << "\"\n";
1235 if (ignore_system_lyxrc ||
1236 def_file != system_lyxrc.def_file) {
1237 string const path = os::external_path(def_file);
1238 os << "\\def_file \"" << path << "\"\n";
1247 << "# MISC SECTION ######################################\n"
1249 // bind files are not done here.
1251 case RC_PATH_PREFIX:
1252 if (ignore_system_lyxrc ||
1253 path_prefix != system_lyxrc.path_prefix) {
1254 os << "\\path_prefix \"" << path_prefix << "\"\n";
1259 if (ignore_system_lyxrc ||
1260 ui_file != system_lyxrc.ui_file) {
1261 string const path = os::external_path(ui_file);
1262 os << "\\ui_file \"" << path << "\"\n";
1266 case RC_AUTOREGIONDELETE:
1267 if (ignore_system_lyxrc ||
1268 auto_region_delete != system_lyxrc.auto_region_delete) {
1269 os << "# Set to false to inhibit automatic replacement of\n"
1270 << "# the current selection.\n"
1271 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1276 case RC_AUTORESET_OPTIONS:
1277 if (ignore_system_lyxrc ||
1278 auto_reset_options != system_lyxrc.auto_reset_options) {
1279 os << "# Set to false to inhibit automatic reset of\n"
1280 << "# the class options to defaults on class change.\n"
1281 << "\\auto_reset_options "
1282 << convert<string>(auto_reset_options)
1288 if (ignore_system_lyxrc ||
1289 autosave != system_lyxrc.autosave) {
1290 os << "# The time interval between auto-saves in seconds.\n"
1291 << "\\autosave " << autosave << '\n';
1295 case RC_DISPLAY_GRAPHICS:
1296 if (ignore_system_lyxrc ||
1297 display_graphics != system_lyxrc.display_graphics) {
1298 os << "# Display graphics within LyX\n"
1300 << "\\display_graphics "
1301 << (display_graphics ? "true" : "false")
1306 case RC_SORT_LAYOUTS:
1307 if (ignore_system_lyxrc ||
1308 sort_layouts != system_lyxrc.sort_layouts) {
1309 os << "# Sort layouts alphabetically.\n"
1310 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1314 case RC_GROUP_LAYOUTS:
1315 if (ignore_system_lyxrc ||
1316 group_layouts != system_lyxrc.group_layouts) {
1317 os << "# Group layouts by their category.\n"
1318 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1322 case RC_VIEWDVI_PAPEROPTION:
1323 if (ignore_system_lyxrc ||
1324 view_dvi_paper_option
1325 != system_lyxrc.view_dvi_paper_option) {
1326 os << "# Options used to specify paper size to the\n"
1327 << "# view_dvi_command (e.g. -paper)\n"
1328 << "\\view_dvi_paper_option \""
1329 << view_dvi_paper_option << "\"\n";
1333 case RC_DEFAULT_PAPERSIZE:
1334 if (ignore_system_lyxrc ||
1335 default_papersize != system_lyxrc.default_papersize) {
1336 os << "# The default papersize to use.\n"
1337 << "\\default_papersize \"";
1338 switch (default_papersize) {
1340 os << "default"; break;
1341 case PAPER_USLETTER:
1342 os << "usletter"; break;
1344 os << "legal"; break;
1345 case PAPER_USEXECUTIVE:
1346 os << "executive"; break;
1357 case PAPER_B4: break;
1363 case RC_CHKTEX_COMMAND:
1364 if (ignore_system_lyxrc ||
1365 chktex_command != system_lyxrc.chktex_command) {
1366 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1370 case RC_BIBTEX_ALTERNATIVES: {
1371 set<string>::const_iterator it = bibtex_alternatives.begin();
1372 set<string>::const_iterator end = bibtex_alternatives.end();
1373 for ( ; it != end; ++it) {
1374 if (ignore_system_lyxrc
1375 || !system_lyxrc.bibtex_alternatives.count(*it))
1376 os << "\\bibtex_alternatives \""
1382 case RC_BIBTEX_COMMAND:
1383 if (ignore_system_lyxrc ||
1384 bibtex_command != system_lyxrc.bibtex_command) {
1385 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1389 case RC_JBIBTEX_COMMAND:
1390 if (ignore_system_lyxrc ||
1391 jbibtex_command != system_lyxrc.jbibtex_command) {
1392 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1396 case RC_INDEX_ALTERNATIVES: {
1397 set<string>::const_iterator it = index_alternatives.begin();
1398 set<string>::const_iterator end = index_alternatives.end();
1399 for ( ; it != end; ++it) {
1400 if (ignore_system_lyxrc
1401 || !system_lyxrc.index_alternatives.count(*it))
1402 os << "\\index_alternatives \""
1408 case RC_INDEX_COMMAND:
1409 if (ignore_system_lyxrc ||
1410 index_command != system_lyxrc.index_command) {
1411 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1415 case RC_JINDEX_COMMAND:
1416 if (ignore_system_lyxrc ||
1417 jindex_command != system_lyxrc.jindex_command) {
1418 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1422 case RC_SPLITINDEX_COMMAND:
1423 if (ignore_system_lyxrc ||
1424 splitindex_command != system_lyxrc.splitindex_command) {
1425 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1429 case RC_NOMENCL_COMMAND:
1430 if (ignore_system_lyxrc ||
1431 nomencl_command != system_lyxrc.nomencl_command) {
1432 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1436 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1437 if (ignore_system_lyxrc ||
1438 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1439 os << "\\tex_expects_windows_paths "
1440 << convert<string>(windows_style_tex_paths) << '\n';
1444 case RC_TEX_ALLOWS_SPACES:
1445 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1446 os << "\\tex_allows_spaces "
1447 << convert<string>(tex_allows_spaces) << '\n';
1452 if (ignore_system_lyxrc ||
1453 use_kbmap != system_lyxrc.use_kbmap) {
1454 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1458 case RC_KBMAP_PRIMARY:
1459 if (ignore_system_lyxrc ||
1460 primary_kbmap != system_lyxrc.primary_kbmap) {
1461 string const path = os::external_path(primary_kbmap);
1462 os << "\\kbmap_primary \"" << path << "\"\n";
1466 case RC_KBMAP_SECONDARY:
1467 if (ignore_system_lyxrc ||
1468 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1469 string const path = os::external_path(secondary_kbmap);
1470 os << "\\kbmap_secondary \"" << path << "\"\n";
1475 if (ignore_system_lyxrc ||
1476 lyxpipes != system_lyxrc.lyxpipes) {
1477 string const path = os::external_path(lyxpipes);
1478 os << "\\serverpipe \"" << path << "\"\n";
1482 case RC_DATE_INSERT_FORMAT:
1483 if (ignore_system_lyxrc ||
1484 date_insert_format != system_lyxrc.date_insert_format) {
1485 os << "\\date_insert_format \"" << date_insert_format
1490 case RC_LABEL_INIT_LENGTH:
1491 if (ignore_system_lyxrc ||
1492 label_init_length != system_lyxrc.label_init_length) {
1493 os << "\\label_init_length " << label_init_length
1500 os << "\\user_name \"" << user_name << "\"\n";
1505 os << "\\user_email \"" << user_email << "\"\n";
1509 case RC_SHOW_BANNER:
1510 if (ignore_system_lyxrc ||
1511 show_banner != system_lyxrc.show_banner) {
1512 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1518 if (ignore_system_lyxrc ||
1519 preview != system_lyxrc.preview) {
1525 case PREVIEW_NO_MATH:
1532 os << "\\preview " << status << '\n';
1537 case RC_PREVIEW_HASHED_LABELS:
1538 if (ignore_system_lyxrc ||
1539 preview_hashed_labels !=
1540 system_lyxrc.preview_hashed_labels) {
1541 os << "\\preview_hashed_labels "
1542 << convert<string>(preview_hashed_labels) << '\n';
1547 case RC_PREVIEW_SCALE_FACTOR:
1548 if (ignore_system_lyxrc ||
1549 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1550 os << "\\preview_scale_factor "
1551 << preview_scale_factor << '\n';
1556 case RC_USE_CONVERTER_CACHE:
1557 if (ignore_system_lyxrc ||
1558 use_converter_cache != system_lyxrc.use_converter_cache) {
1559 os << "\\use_converter_cache "
1560 << convert<string>(use_converter_cache) << '\n';
1565 case RC_CONVERTER_CACHE_MAXAGE:
1566 if (ignore_system_lyxrc ||
1567 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1568 os << "\\converter_cache_maxage "
1569 << converter_cache_maxage << '\n';
1575 << "# SCREEN & FONTS SECTION ############################\n"
1579 if (ignore_system_lyxrc ||
1580 dpi != system_lyxrc.dpi) {
1581 os << "\\screen_dpi " << dpi << '\n';
1585 case RC_SCREEN_ZOOM:
1586 if (ignore_system_lyxrc ||
1587 zoom != system_lyxrc.zoom) {
1588 os << "\\screen_zoom " << zoom << '\n';
1592 case RC_GEOMETRY_SESSION:
1593 if (ignore_system_lyxrc ||
1594 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1595 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1600 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1601 if (ignore_system_lyxrc ||
1602 cursor_follows_scrollbar
1603 != system_lyxrc.cursor_follows_scrollbar) {
1604 os << "\\cursor_follows_scrollbar "
1605 << convert<string>(cursor_follows_scrollbar) << '\n';
1609 case RC_SCROLL_BELOW_DOCUMENT:
1610 if (ignore_system_lyxrc ||
1611 scroll_below_document
1612 != system_lyxrc.scroll_below_document) {
1613 os << "\\scroll_below_document "
1614 << convert<string>(scroll_below_document) << '\n';
1618 case RC_PARAGRAPH_MARKERS:
1619 if (ignore_system_lyxrc ||
1621 != system_lyxrc.paragraph_markers) {
1622 os << "\\paragraph_markers "
1623 << convert<string>(paragraph_markers) << '\n';
1627 case RC_MAC_LIKE_WORD_MOVEMENT:
1628 if (ignore_system_lyxrc ||
1629 mac_like_word_movement
1630 != system_lyxrc.mac_like_word_movement) {
1631 os << "\\mac_like_word_movement "
1632 << convert<string>(mac_like_word_movement) << '\n';
1636 case RC_MACRO_EDIT_STYLE:
1637 if (ignore_system_lyxrc ||
1639 != system_lyxrc.macro_edit_style) {
1640 os << "\\macro_edit_style ";
1641 switch (macro_edit_style) {
1642 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1643 case MACRO_EDIT_INLINE: os << "1\n"; break;
1644 case MACRO_EDIT_LIST: os << "2\n"; break;
1649 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1650 if (ignore_system_lyxrc ||
1651 dialogs_iconify_with_main
1652 != system_lyxrc.dialogs_iconify_with_main) {
1653 os << "\\dialogs_iconify_with_main "
1654 << convert<string>(dialogs_iconify_with_main) << '\n';
1658 case RC_SCREEN_FONT_ROMAN:
1659 if (ignore_system_lyxrc ||
1660 roman_font_name != system_lyxrc.roman_font_name) {
1661 os << "\\screen_font_roman \"" << roman_font_name
1666 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1667 if (ignore_system_lyxrc ||
1668 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1669 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1674 case RC_SCREEN_FONT_SANS:
1675 if (ignore_system_lyxrc ||
1676 sans_font_name != system_lyxrc.sans_font_name) {
1677 os << "\\screen_font_sans \"" << sans_font_name
1682 case RC_SCREEN_FONT_SANS_FOUNDRY:
1683 if (ignore_system_lyxrc ||
1684 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1685 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1690 case RC_SCREEN_FONT_TYPEWRITER:
1691 if (ignore_system_lyxrc ||
1692 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1693 os << "\\screen_font_typewriter \""
1694 << typewriter_font_name << "\"\n";
1698 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1699 if (ignore_system_lyxrc ||
1700 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1701 os << "\\screen_font_typewriter_foundry \""
1702 << typewriter_font_foundry << "\"\n";
1707 case RC_SCREEN_FONT_SCALABLE:
1708 if (ignore_system_lyxrc ||
1709 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1710 os << "\\screen_font_scalable "
1711 << convert<string>(use_scalable_fonts)
1716 case RC_SCREEN_FONT_SIZES:
1717 if (ignore_system_lyxrc ||
1718 font_sizes[FONT_SIZE_TINY]
1719 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1720 font_sizes[FONT_SIZE_SCRIPT]
1721 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1722 font_sizes[FONT_SIZE_FOOTNOTE]
1723 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1724 font_sizes[FONT_SIZE_SMALL]
1725 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1726 font_sizes[FONT_SIZE_NORMAL]
1727 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1728 font_sizes[FONT_SIZE_LARGE]
1729 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1730 font_sizes[FONT_SIZE_LARGER]
1731 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1732 font_sizes[FONT_SIZE_LARGEST]
1733 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1734 font_sizes[FONT_SIZE_HUGE]
1735 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1736 font_sizes[FONT_SIZE_HUGER]
1737 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1738 os.setf(ios::fixed);
1740 os << "\\screen_font_sizes"
1741 << ' ' << font_sizes[FONT_SIZE_TINY]
1742 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1743 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1744 << ' ' << font_sizes[FONT_SIZE_SMALL]
1745 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1746 << ' ' << font_sizes[FONT_SIZE_LARGE]
1747 << ' ' << font_sizes[FONT_SIZE_LARGER]
1748 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1749 << ' ' << font_sizes[FONT_SIZE_HUGE]
1750 << ' ' << font_sizes[FONT_SIZE_HUGER]
1755 case RC_FULL_SCREEN_LIMIT:
1756 if (ignore_system_lyxrc ||
1757 full_screen_limit != system_lyxrc.full_screen_limit) {
1758 os << "\\fullscreen_limit "
1759 << convert<string>(full_screen_limit)
1764 case RC_FULL_SCREEN_TOOLBARS:
1765 if (ignore_system_lyxrc ||
1766 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1767 os << "\\fullscreen_toolbars "
1768 << convert<string>(full_screen_toolbars)
1773 case RC_FULL_SCREEN_SCROLLBAR:
1774 if (ignore_system_lyxrc ||
1775 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1776 os << "\\fullscreen_scrollbar "
1777 << convert<string>(full_screen_scrollbar)
1782 case RC_FULL_SCREEN_TABBAR:
1783 if (ignore_system_lyxrc ||
1784 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1785 os << "\\fullscreen_tabbar "
1786 << convert<string>(full_screen_tabbar)
1791 case RC_FULL_SCREEN_MENUBAR:
1792 if (ignore_system_lyxrc ||
1793 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1794 os << "\\fullscreen_menubar "
1795 << convert<string>(full_screen_menubar)
1800 case RC_FULL_SCREEN_WIDTH:
1801 if (ignore_system_lyxrc ||
1802 full_screen_width != system_lyxrc.full_screen_width) {
1803 os << "\\fullscreen_width "
1804 << convert<string>(full_screen_width)
1809 case RC_OPEN_BUFFERS_IN_TABS:
1810 if (ignore_system_lyxrc ||
1811 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1812 os << "\\open_buffers_in_tabs "
1813 << convert<string>(open_buffers_in_tabs)
1820 << "# COLOR SECTION ###################################\n"
1824 for (int i = 0; i < Color_ignore; ++i) {
1825 ColorCode lc = static_cast<ColorCode>(i);
1826 string const col = lcolor.getX11Name(lc);
1827 if (ignore_system_lyxrc
1828 || col != system_lcolor.getX11Name(lc)) {
1829 os << "\\set_color \""
1830 << lcolor.getLyXName(lc) << "\" \""
1838 << "# PRINTER SECTION ###################################\n"
1842 if (ignore_system_lyxrc ||
1843 printer != system_lyxrc.printer) {
1844 os << "\\printer \"" << printer << "\"\n";
1848 case RC_PRINT_ADAPTOUTPUT:
1849 if (ignore_system_lyxrc ||
1850 print_adapt_output != system_lyxrc.print_adapt_output) {
1851 os << "\\print_adapt_output "
1852 << convert<string>(print_adapt_output)
1857 case RC_PRINT_COMMAND:
1858 if (ignore_system_lyxrc ||
1859 print_command != system_lyxrc.print_command) {
1860 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1864 case RC_PRINTEXSTRAOPTIONS:
1865 if (ignore_system_lyxrc ||
1866 print_extra_options != system_lyxrc.print_extra_options) {
1867 os << "\\print_extra_options \"" << print_extra_options
1872 case RC_PRINTSPOOL_COMMAND:
1873 if (ignore_system_lyxrc ||
1874 print_spool_command != system_lyxrc.print_spool_command) {
1875 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1880 case RC_PRINTSPOOL_PRINTERPREFIX:
1881 if (ignore_system_lyxrc ||
1882 print_spool_printerprefix
1883 != system_lyxrc.print_spool_printerprefix) {
1884 os << "\\print_spool_printerprefix \""
1885 << print_spool_printerprefix << "\"\n";
1889 case RC_PRINTEVENPAGEFLAG:
1890 if (ignore_system_lyxrc ||
1891 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1892 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1897 case RC_PRINTODDPAGEFLAG:
1898 if (ignore_system_lyxrc ||
1899 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1900 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1905 case RC_PRINTREVERSEFLAG:
1906 if (ignore_system_lyxrc ||
1907 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1908 os << "\\print_reverse_flag \"" << print_reverse_flag
1913 case RC_PRINTLANDSCAPEFLAG:
1914 if (ignore_system_lyxrc ||
1915 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1916 os << "\\print_landscape_flag \"" << print_landscape_flag
1921 case RC_PRINTPAGERANGEFLAG:
1922 if (ignore_system_lyxrc ||
1923 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1924 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1929 case RC_PRINTCOPIESFLAG:
1930 if (ignore_system_lyxrc ||
1931 print_copies_flag != system_lyxrc.print_copies_flag) {
1932 os << "\\print_copies_flag \"" << print_copies_flag
1937 case RC_PRINTCOLLCOPIESFLAG:
1938 if (ignore_system_lyxrc ||
1939 print_collcopies_flag
1940 != system_lyxrc.print_collcopies_flag) {
1941 os << "\\print_collcopies_flag \""
1942 << print_collcopies_flag
1947 case RC_PRINTPAPERFLAG:
1948 if (ignore_system_lyxrc ||
1949 print_paper_flag != system_lyxrc.print_paper_flag) {
1950 os << "\\print_paper_flag \"" << print_paper_flag
1955 case RC_PRINTPAPERDIMENSIONFLAG:
1956 if (ignore_system_lyxrc ||
1957 print_paper_dimension_flag
1958 != system_lyxrc.print_paper_dimension_flag) {
1959 os << "\\print_paper_dimension_flag \""
1960 << print_paper_dimension_flag << "\"\n";
1964 case RC_PRINTTOPRINTER:
1965 if (ignore_system_lyxrc ||
1966 print_to_printer != system_lyxrc.print_to_printer) {
1967 os << "\\print_to_printer \"" << print_to_printer
1972 case RC_PRINTTOFILE:
1973 if (ignore_system_lyxrc ||
1974 print_to_file != system_lyxrc.print_to_file) {
1975 string const path = os::external_path(print_to_file);
1976 os << "\\print_to_file \"" << path << "\"\n";
1980 case RC_PRINTFILEEXTENSION:
1981 if (ignore_system_lyxrc ||
1982 print_file_extension != system_lyxrc.print_file_extension) {
1983 os << "\\print_file_extension \""
1984 << print_file_extension
1991 << "# TEX SECTION #######################################\n"
1994 case RC_FONT_ENCODING:
1995 if (ignore_system_lyxrc ||
1996 fontenc != system_lyxrc.fontenc) {
1997 os << "\\font_encoding \"" << fontenc << "\"\n";
2003 << "# FILE SECTION ######################################\n"
2006 case RC_DOCUMENTPATH:
2007 if (ignore_system_lyxrc ||
2008 document_path != system_lyxrc.document_path) {
2009 string const path = os::external_path(document_path);
2010 os << "\\document_path \"" << path << "\"\n";
2014 case RC_USELASTFILEPOS:
2015 if (ignore_system_lyxrc ||
2016 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2017 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2022 case RC_LOADSESSION:
2023 if (ignore_system_lyxrc ||
2024 load_session != system_lyxrc.load_session) {
2025 os << "\\load_session " << convert<string>(load_session)
2030 case RC_MOUSE_WHEEL_SPEED:
2031 if (ignore_system_lyxrc ||
2032 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2033 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2037 case RC_COMPLETION_INLINE_DELAY:
2038 if (ignore_system_lyxrc ||
2039 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2040 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2044 case RC_COMPLETION_INLINE_MATH:
2045 if (ignore_system_lyxrc ||
2046 completion_inline_math != system_lyxrc.completion_inline_math) {
2047 os << "\\completion_inline_math "
2048 << convert<string>(completion_inline_math) << '\n';
2052 case RC_COMPLETION_INLINE_TEXT:
2053 if (ignore_system_lyxrc ||
2054 completion_inline_text != system_lyxrc.completion_inline_text) {
2055 os << "\\completion_inline_text "
2056 << convert<string>(completion_inline_text) << '\n';
2060 case RC_COMPLETION_INLINE_DOTS:
2061 if (ignore_system_lyxrc ||
2062 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2063 os << "\\completion_inline_dots "
2064 << convert<string>(completion_inline_dots) << '\n';
2068 case RC_AUTOCORRECTION_MATH:
2069 if (ignore_system_lyxrc ||
2070 autocorrection_math != system_lyxrc.autocorrection_math) {
2071 os << "\\autocorrection_math "
2072 << convert<string>(autocorrection_math) << '\n';
2076 case RC_COMPLETION_POPUP_DELAY:
2077 if (ignore_system_lyxrc ||
2078 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2079 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2083 case RC_COMPLETION_POPUP_MATH:
2084 if (ignore_system_lyxrc ||
2085 completion_popup_math != system_lyxrc.completion_popup_math) {
2086 os << "\\completion_popup_math "
2087 << convert<string>(completion_popup_math) << '\n';
2091 case RC_COMPLETION_POPUP_TEXT:
2092 if (ignore_system_lyxrc ||
2093 completion_popup_text != system_lyxrc.completion_popup_text) {
2094 os << "\\completion_popup_text "
2095 << convert<string>(completion_popup_text) << '\n';
2099 case RC_COMPLETION_CURSOR_TEXT:
2100 if (ignore_system_lyxrc ||
2101 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2102 os << "\\completion_cursor_text "
2103 << convert<string>(completion_cursor_text) << '\n';
2107 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2108 if (ignore_system_lyxrc ||
2109 completion_popup_after_complete
2110 != system_lyxrc.completion_popup_after_complete) {
2111 os << "\\completion_popup_after_complete "
2112 << convert<string>(completion_popup_after_complete) << '\n';
2116 case RC_NUMLASTFILES:
2117 if (ignore_system_lyxrc ||
2118 num_lastfiles != system_lyxrc.num_lastfiles) {
2119 os << "\\num_lastfiles " << num_lastfiles << '\n';
2123 case RC_CHECKLASTFILES:
2124 if (ignore_system_lyxrc ||
2125 check_lastfiles != system_lyxrc.check_lastfiles) {
2126 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2131 case RC_EXAMPLEPATH:
2132 if (ignore_system_lyxrc ||
2133 example_path != system_lyxrc.example_path) {
2134 string const path = os::external_path(example_path);
2135 os << "\\example_path \"" << path << "\"\n";
2139 case RC_TEMPLATEPATH:
2140 if (ignore_system_lyxrc ||
2141 template_path != system_lyxrc.template_path) {
2142 string const path = os::external_path(template_path);
2143 os << "\\template_path \"" << path << "\"\n";
2147 case RC_TEMPDIRPATH:
2148 if (ignore_system_lyxrc ||
2149 tempdir_path != system_lyxrc.tempdir_path) {
2150 string const path = os::external_path(tempdir_path);
2151 os << "\\tempdir_path \"" << path << "\"\n";
2155 case RC_THESAURUSDIRPATH:
2156 if (ignore_system_lyxrc ||
2157 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2158 string const path = os::external_path(thesaurusdir_path);
2159 os << "\\thesaurusdir_path \"" << path << "\"\n";
2163 case RC_HUNSPELLDIR_PATH:
2164 if (ignore_system_lyxrc ||
2165 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2166 string const path = os::external_path(hunspelldir_path);
2167 os << "\\hunspelldir_path \"" << path << "\"\n";
2175 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2178 case RC_PLAINTEXT_LINELEN:
2179 if (ignore_system_lyxrc ||
2180 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2181 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2185 case RC_MAKE_BACKUP:
2186 if (ignore_system_lyxrc ||
2187 make_backup != system_lyxrc.make_backup) {
2188 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2192 case RC_BACKUPDIR_PATH:
2193 if (ignore_system_lyxrc ||
2194 backupdir_path != system_lyxrc.backupdir_path) {
2195 string const path = os::external_path(backupdir_path);
2196 os << "\\backupdir_path \"" << path << "\"\n";
2202 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2206 << "# SPELLCHECKER SECTION ##############################\n"
2209 case RC_SPELL_COMMAND:
2210 case RC_USE_SPELL_LIB:
2214 case RC_ACCEPT_COMPOUND:
2215 if (ignore_system_lyxrc ||
2216 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2217 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2222 case RC_USE_ALT_LANG:
2227 if (ignore_system_lyxrc ||
2228 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2229 os << "\\alternate_language \"" << spellchecker_alt_lang
2234 case RC_USE_ESC_CHARS:
2238 if (ignore_system_lyxrc ||
2239 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2240 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2244 case RC_USE_PERS_DICT:
2248 case RC_USE_TOOLTIP:
2249 if (ignore_system_lyxrc ||
2250 use_tooltip != system_lyxrc.use_tooltip) {
2251 os << "\\use_tooltip "
2252 << convert<string>(use_tooltip)
2257 case RC_USE_PIXMAP_CACHE:
2258 if (ignore_system_lyxrc ||
2259 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2260 os << "\\use_pixmap_cache "
2261 << convert<string>(use_pixmap_cache)
2270 case RC_USE_INP_ENC:
2276 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2281 case RC_SPELLCHECKER:
2282 if (ignore_system_lyxrc ||
2283 spellchecker != system_lyxrc.spellchecker) {
2284 os << "\\spellchecker " << spellchecker << '\n';
2289 case RC_SPELLCHECK_CONTINUOUSLY:
2290 if (ignore_system_lyxrc ||
2291 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2292 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2298 case RC_RTL_SUPPORT:
2299 if (ignore_system_lyxrc ||
2300 rtl_support != system_lyxrc.rtl_support) {
2301 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2305 case RC_VISUAL_CURSOR:
2306 if (ignore_system_lyxrc ||
2307 visual_cursor != system_lyxrc.visual_cursor) {
2308 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2312 case RC_LANGUAGE_PACKAGE:
2313 if (ignore_system_lyxrc ||
2314 language_package != system_lyxrc.language_package) {
2315 os << "\\language_package \"" << language_package
2320 case RC_LANGUAGE_GLOBAL_OPTIONS:
2321 if (ignore_system_lyxrc ||
2322 language_global_options
2323 != system_lyxrc.language_global_options) {
2324 os << "\\language_global_options \""
2325 << convert<string>(language_global_options)
2330 case RC_LANGUAGE_USE_BABEL:
2331 if (ignore_system_lyxrc ||
2332 language_use_babel != system_lyxrc.language_use_babel) {
2333 os << "\\language_use_babel \""
2334 << convert<string>(language_use_babel)
2339 case RC_LANGUAGE_COMMAND_BEGIN:
2340 if (ignore_system_lyxrc ||
2341 language_command_begin
2342 != system_lyxrc.language_command_begin) {
2343 os << "\\language_command_begin \""
2344 << language_command_begin
2349 case RC_LANGUAGE_COMMAND_END:
2350 if (ignore_system_lyxrc ||
2351 language_command_end
2352 != system_lyxrc.language_command_end) {
2353 os << "\\language_command_end \"" << language_command_end
2358 case RC_LANGUAGE_COMMAND_LOCAL:
2359 if (ignore_system_lyxrc ||
2360 language_command_local
2361 != system_lyxrc.language_command_local) {
2362 os << "\\language_command_local \""
2363 << language_command_local
2368 case RC_LANGUAGE_AUTO_BEGIN:
2369 if (ignore_system_lyxrc ||
2370 language_auto_begin != system_lyxrc.language_auto_begin) {
2371 os << "\\language_auto_begin "
2372 << convert<string>(language_auto_begin) << '\n';
2376 case RC_LANGUAGE_AUTO_END:
2377 if (ignore_system_lyxrc ||
2378 language_auto_end != system_lyxrc.language_auto_end) {
2379 os << "\\language_auto_end "
2380 << convert<string>(language_auto_end) << '\n';
2384 case RC_MARK_FOREIGN_LANGUAGE:
2385 if (ignore_system_lyxrc ||
2386 mark_foreign_language
2387 != system_lyxrc.mark_foreign_language) {
2388 os << "\\mark_foreign_language " <<
2389 convert<string>(mark_foreign_language) << '\n';
2395 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2398 case RC_AUTO_NUMBER:
2399 if (ignore_system_lyxrc ||
2400 auto_number != system_lyxrc.auto_number) {
2401 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2405 case RC_DEFAULT_LANGUAGE:
2406 if (ignore_system_lyxrc ||
2407 default_language != system_lyxrc.default_language) {
2408 os << "\\default_language " << default_language << '\n';
2412 case RC_GUI_LANGUAGE:
2413 if (ignore_system_lyxrc ||
2414 gui_language != system_lyxrc.gui_language) {
2415 os << "\\gui_language " << gui_language << '\n';
2421 << "# FORMATS SECTION ##########################\n"
2425 // New/modified formats
2426 for (Formats::const_iterator cit = formats.begin();
2427 cit != formats.end(); ++cit) {
2428 Format const * format =
2429 system_formats.getFormat(cit->name());
2431 format->extension() != cit->extension() ||
2432 format->prettyname() != cit->prettyname() ||
2433 format->shortcut() != cit->shortcut() ||
2434 format->viewer() != cit->viewer() ||
2435 format->editor() != cit->editor() ||
2436 format->documentFormat() != cit->documentFormat() ||
2437 format->vectorFormat() != cit->vectorFormat()) {
2438 os << "\\format \"" << cit->name() << "\" \""
2439 << cit->extension() << "\" \""
2440 << cit->prettyname() << "\" \""
2441 << cit->shortcut() << "\" \""
2442 << escapeCommand(cit->viewer()) << "\" \""
2443 << escapeCommand(cit->editor()) << "\" \"";
2444 vector<string> flags;
2445 if (cit->documentFormat())
2446 flags.push_back("document");
2447 if (cit->vectorFormat())
2448 flags.push_back("vector");
2449 os << getStringFromVector(flags);
2454 // Look for deleted formats
2455 for (Formats::const_iterator cit = system_formats.begin();
2456 cit != system_formats.end(); ++cit)
2457 if (!formats.getFormat(cit->name()))
2458 os << "\\format \"" << cit->name()
2459 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2462 case RC_DEFAULT_VIEW_FORMAT:
2463 if (ignore_system_lyxrc ||
2464 default_view_format != system_lyxrc.default_view_format) {
2465 os << "\\default_view_format " << default_view_format << '\n';
2475 << "# CONVERTERS SECTION ##########################\n"
2479 // Look for new converters
2480 for (Converters::const_iterator cit = theConverters().begin();
2481 cit != theConverters().end(); ++cit) {
2482 Converter const * converter =
2483 theSystemConverters().getConverter(cit->from,
2486 converter->command != cit->command ||
2487 converter->flags != cit->flags)
2488 os << "\\converter \"" << cit->from << "\" \""
2489 << cit->to << "\" \""
2490 << escapeCommand(cit->command) << "\" \""
2491 << cit->flags << "\"\n";
2494 // New/modifed converters
2495 for (Converters::const_iterator cit = theSystemConverters().begin();
2496 cit != theSystemConverters().end(); ++cit)
2497 if (!theConverters().getConverter(cit->from, cit->to))
2498 os << "\\converter \"" << cit->from
2499 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2506 << "# COPIERS SECTION ##########################\n"
2509 // Look for new movers
2510 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2511 Movers::const_iterator const sysend = theSystemMovers().end();
2512 Movers::const_iterator it = theMovers().begin();
2513 Movers::const_iterator end = theMovers().end();
2515 for (; it != end; ++it) {
2516 Movers::const_iterator const sysit =
2517 find_if(sysbegin, sysend, SameMover(*it));
2518 if (sysit == sysend) {
2519 string const & fmt = it->first;
2520 string const & command =
2521 it->second.command();
2523 os << "\\copier " << fmt
2524 << " \"" << escapeCommand(command) << "\"\n";
2530 // We don't actually delete SpecialisedMover(s) from the
2531 // map, just clear their 'command', so there's no need
2532 // to test for anything else.
2540 string const LyXRC::getDescription(LyXRCTags tag)
2545 case RC_ACCEPT_COMPOUND:
2546 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2550 case RC_USE_ALT_LANG:
2551 str = _("Specify an alternate language. The default is to use the language of the document.");
2554 case RC_PLAINTEXT_ROFF_COMMAND:
2555 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.");
2558 case RC_PLAINTEXT_LINELEN:
2559 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.");
2562 case RC_AUTOREGIONDELETE:
2563 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2566 case RC_AUTORESET_OPTIONS:
2567 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2571 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2574 case RC_AUTO_NUMBER:
2577 case RC_BACKUPDIR_PATH:
2578 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.");
2581 case RC_BIBTEX_COMMAND:
2582 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2585 case RC_JBIBTEX_COMMAND:
2586 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2590 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2593 case RC_CHECKLASTFILES:
2594 str = _("Select to check whether the lastfiles still exist.");
2597 case RC_CHKTEX_COMMAND:
2598 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2607 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2608 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.");
2611 case RC_SCROLL_BELOW_DOCUMENT:
2612 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");
2615 case RC_MAC_LIKE_WORD_MOVEMENT:
2616 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2619 case RC_SHOW_MACRO_LABEL:
2620 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2623 case RC_DATE_INSERT_FORMAT:
2624 //xgettext:no-c-format
2625 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2629 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2632 case RC_DEFAULT_VIEW_FORMAT:
2633 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2636 case RC_DEFAULT_LANGUAGE:
2637 str = _("New documents will be assigned this language.");
2640 case RC_DEFAULT_PAPERSIZE:
2641 str = _("Specify the default paper size.");
2644 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2645 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2648 case RC_DISPLAY_GRAPHICS:
2649 str = _("Select how LyX will display any graphics.");
2652 case RC_DOCUMENTPATH:
2653 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2657 case RC_USE_ESC_CHARS:
2658 str = _("Specify additional chars that can be part of a word.");
2661 case RC_EXAMPLEPATH:
2662 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2665 case RC_FONT_ENCODING:
2666 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2672 case RC_INDEX_COMMAND:
2673 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\".");
2676 case RC_JINDEX_COMMAND:
2677 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2680 case RC_NOMENCL_COMMAND:
2681 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2688 case RC_KBMAP_PRIMARY:
2689 case RC_KBMAP_SECONDARY:
2690 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.");
2693 case RC_LABEL_INIT_LENGTH:
2694 str = _("Maximum number of words in the initialization string for a new label");
2697 case RC_LANGUAGE_AUTO_BEGIN:
2698 str = _("Select if a language switching command is needed at the beginning of the document.");
2701 case RC_LANGUAGE_AUTO_END:
2702 str = _("Select if a language switching command is needed at the end of the document.");
2705 case RC_LANGUAGE_COMMAND_BEGIN:
2706 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.");
2709 case RC_LANGUAGE_COMMAND_END:
2710 str = _("The LaTeX command for changing back to the language of the document.");
2713 case RC_LANGUAGE_COMMAND_LOCAL:
2714 str = _("The LaTeX command for local changing of the language.");
2717 case RC_LANGUAGE_GLOBAL_OPTIONS:
2718 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2721 case RC_LANGUAGE_PACKAGE:
2722 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2725 case RC_LANGUAGE_USE_BABEL:
2726 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2729 case RC_USELASTFILEPOS:
2730 str = _("De-select if you do not want LyX to scroll to saved position.");
2733 case RC_LOADSESSION:
2734 str = _("De-select to prevent loading files opened from the last LyX session.");
2737 case RC_MAKE_BACKUP:
2738 str = _("De-select if you don't want LyX to create backup files.");
2741 case RC_MARK_FOREIGN_LANGUAGE:
2742 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2745 case RC_MOUSE_WHEEL_SPEED:
2746 str = bformat(_("The scrolling speed of the mouse wheel."),
2750 case RC_COMPLETION_POPUP_DELAY:
2751 str = _("The completion popup delay.");
2754 case RC_COMPLETION_POPUP_MATH:
2755 str = _("Select to display the completion popup in math mode.");
2758 case RC_COMPLETION_POPUP_TEXT:
2759 str = _("Select to display the completion popup in text mode.");
2762 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2763 str = _("Show the completion popup without delay after non-unique completion attempt.");
2766 case RC_COMPLETION_POPUP_TEXT:
2767 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2770 case RC_COMPLETION_POPUP_DELAY:
2771 str = _("The inline completion delay.");
2774 case RC_COMPLETION_INLINE_MATH:
2775 str = _("Select to display the inline completion in math mode.");
2778 case RC_COMPLETION_INLINE_TEXT:
2779 str = _("Select to display the inline completion in text mode.");
2782 case RC_COMPLETION_INLINE_DOTS:
2783 str = _("Use \"...\" to shorten long completions.");
2786 case RC_AUTOCORRECTION_MATH:
2787 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2790 case RC_NUMLASTFILES:
2791 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2795 case RC_PATH_PREFIX:
2796 str = _("Specify those directories which should be "
2797 "prepended to the PATH environment variable. "
2798 "Use the OS native format.");
2802 str = _("Shows a typeset preview of things such as math");
2805 case RC_PREVIEW_HASHED_LABELS:
2806 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2809 case RC_PREVIEW_SCALE_FACTOR:
2810 str = _("Scale the preview size to suit.");
2813 case RC_PRINTCOLLCOPIESFLAG:
2814 str = _("The option for specifying whether the copies should be collated.");
2817 case RC_PRINTCOPIESFLAG:
2818 str = _("The option for specifying the number of copies to print.");
2822 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2825 case RC_PRINTEVENPAGEFLAG:
2826 str = _("The option to print only even pages.");
2829 case RC_PRINTEXSTRAOPTIONS:
2830 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2833 case RC_PRINTFILEEXTENSION:
2834 str = _("Extension of printer program output file. Usually \".ps\".");
2837 case RC_PRINTLANDSCAPEFLAG:
2838 str = _("The option to print out in landscape.");
2841 case RC_PRINTODDPAGEFLAG:
2842 str = _("The option to print only odd pages.");
2845 case RC_PRINTPAGERANGEFLAG:
2846 str = _("The option for specifying a comma-separated list of pages to print.");
2849 case RC_PRINTPAPERDIMENSIONFLAG:
2850 str = _("Option to specify the dimensions of the print paper.");
2853 case RC_PRINTPAPERFLAG:
2854 str = _("The option to specify paper type.");
2857 case RC_PRINTREVERSEFLAG:
2858 str = _("The option to reverse the order of the pages printed.");
2861 case RC_PRINTSPOOL_COMMAND:
2862 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.");
2865 case RC_PRINTSPOOL_PRINTERPREFIX:
2866 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.");
2869 case RC_PRINTTOFILE:
2870 str = _("Option to pass to the print program to print to a file.");
2873 case RC_PRINTTOPRINTER:
2874 str = _("Option to pass to the print program to print on a specific printer.");
2877 case RC_PRINT_ADAPTOUTPUT:
2878 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2881 case RC_PRINT_COMMAND:
2882 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2885 case RC_RTL_SUPPORT:
2886 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2889 case RC_VISUAL_CURSOR:
2890 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2894 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2897 case RC_SCREEN_FONT_ROMAN:
2898 case RC_SCREEN_FONT_SANS:
2899 case RC_SCREEN_FONT_TYPEWRITER:
2900 str = _("The screen fonts used to display the text while editing.");
2903 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2904 case RC_SCREEN_FONT_SANS_FOUNDRY:
2905 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2908 case RC_SCREEN_FONT_SCALABLE:
2909 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.");
2912 case RC_SCREEN_FONT_SIZES:
2913 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2916 case RC_SCREEN_ZOOM:
2917 //xgettext:no-c-format
2918 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2921 case RC_GEOMETRY_SESSION:
2922 str = _("Allow session manager to save and restore windows geometry.");
2926 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2932 case RC_SHOW_BANNER:
2933 str = _("De-select if you don't want the startup banner.");
2936 case RC_TEMPDIRPATH:
2937 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2940 case RC_THESAURUSDIRPATH:
2941 str = _("This is the place where the files of the thesaurus library reside.");
2944 case RC_TEMPLATEPATH:
2945 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2948 case RC_TEX_ALLOWS_SPACES:
2951 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2955 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2967 case RC_USE_TOOLTIP:
2968 str = _("Enable the automatic appearance of tool tips in the work area.");
2971 case RC_USE_PIXMAP_CACHE:
2972 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2975 case RC_USE_SPELL_LIB:
2978 case RC_VIEWDVI_PAPEROPTION:
2979 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2994 // The global instance
2997 // The global copy of the system lyxrc entries (everything except preferences)