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_command", LyXRC::RC_BIBTEX_COMMAND },
65 { "\\bind_file", LyXRC::RC_BINDFILE },
66 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
67 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
68 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
69 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
70 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
71 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
72 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
73 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
74 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
75 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
76 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
77 { "\\converter", LyXRC::RC_CONVERTER },
78 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
79 { "\\copier", LyXRC::RC_COPIER },
80 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
81 { "\\custom_export_command", LyXRC::RC_CUSTOM_EXPORT_COMMAND },
82 { "\\custom_export_format", LyXRC::RC_CUSTOM_EXPORT_FORMAT },
83 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
84 { "\\def_file", LyXRC::RC_DEFFILE },
85 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
86 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
87 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
88 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
89 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
90 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
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_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 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
103 { "\\input", LyXRC::RC_INPUT },
104 { "\\kbmap", LyXRC::RC_KBMAP },
105 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
106 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
107 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
108 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
109 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
110 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
111 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
112 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
113 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
114 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
115 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
116 { "\\load_session", LyXRC::RC_LOADSESSION },
117 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
118 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
119 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
120 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
121 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
122 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
123 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
124 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
125 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
126 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
127 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
128 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
129 { "\\preview", LyXRC::RC_PREVIEW },
130 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
131 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
132 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
133 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
134 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
135 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
136 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
137 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
138 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
139 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
140 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
141 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
142 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
143 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
144 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
145 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
146 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
147 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
148 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
149 { "\\printer", LyXRC::RC_PRINTER },
150 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
151 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
152 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
153 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
154 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
155 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
156 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
157 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
158 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
159 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
160 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
161 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
162 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
163 { "\\set_color", LyXRC::RC_SET_COLOR },
164 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
165 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
166 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
167 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
168 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
169 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
170 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
171 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
172 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
173 { "\\ui_file", LyXRC::RC_UIFILE },
174 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
175 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
176 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
177 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
178 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
179 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
180 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
181 // compatibility with versions older than 1.4.0 only
182 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
183 // compatibility with versions older than 1.4.0 only
184 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
185 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
186 { "\\user_email", LyXRC::RC_USER_EMAIL },
187 { "\\user_name", LyXRC::RC_USER_NAME },
188 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
189 // compatibility with versions older than 1.4.0 only
190 { "\\viewer", LyXRC::RC_VIEWER},
191 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
194 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
205 void LyXRC::setDefaults()
208 def_file = "default";
210 // Get printer from the environment. If fail, use default "",
211 // assuming that everything is set up correctly.
212 printer = getEnv("PRINTER");
213 print_adapt_output = false;
214 print_command = "dvips";
215 print_evenpage_flag = "-B";
216 print_oddpage_flag = "-A";
217 print_pagerange_flag = "-pp";
218 print_copies_flag = "-c";
219 print_collcopies_flag = "-C";
220 print_reverse_flag = "-r";
221 print_landscape_flag = "-t landscape";
222 print_to_printer = "-P";
223 print_to_file = "-o ";
224 print_file_extension = ".ps";
225 print_paper_flag = "-t";
226 print_paper_dimension_flag = "-T";
227 document_path.erase();
228 view_dvi_paper_option.erase();
229 default_papersize = PAPER_DEFAULT;
230 custom_export_format = "ps";
231 default_view_format = "pdf2";
232 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
233 bibtex_command = "bibtex";
235 index_command = "makeindex -c -q";
236 nomencl_command = "makeindex -s nomencl.ist";
238 // Because a screen typically is wider than a piece of paper:
240 allow_geometry_session = true;
241 // Default LaTeX font size:
242 font_sizes[FONT_SIZE_TINY] = "5.0";
243 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
244 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
245 font_sizes[FONT_SIZE_SMALL] = "9.0";
246 font_sizes[FONT_SIZE_NORMAL] = "10.0";
247 font_sizes[FONT_SIZE_LARGE] = "12.0";
248 font_sizes[FONT_SIZE_LARGER] = "14.4";
249 font_sizes[FONT_SIZE_LARGEST] = "17.26";
250 font_sizes[FONT_SIZE_HUGE] = "20.74";
251 font_sizes[FONT_SIZE_HUGER] = "24.88";
252 use_scalable_fonts = true;
253 roman_font_name = "";
255 typewriter_font_name = "";
257 auto_region_delete = true;
258 auto_reset_options = false;
259 plaintext_linelen = 65;
260 mouse_wheel_speed = 1.0;
261 num_lastfiles = maxlastfiles;
262 check_lastfiles = true;
263 use_lastfilepos = true;
264 load_session = false;
266 backupdir_path.erase();
267 display_graphics = true;
268 // Spellchecker settings:
269 spellchecker_accept_compound = false;
270 spellchecker_use_input_encoding = false;
271 spellchecker_use_alt_lang = false;
272 spellchecker_use_pers_dict = false;
273 spellchecker_use_esc_chars = false;
274 spellcheck_continuously = false;
277 visual_cursor = false;
279 mark_foreign_language = true;
280 language_auto_begin = true;
281 language_auto_end = true;
282 language_global_options = true;
283 language_use_babel = true;
284 language_package = "\\usepackage{babel}";
285 language_command_begin = "\\selectlanguage{$$lang}";
286 language_command_local = "\\foreignlanguage{$$lang}{";
287 sort_layouts = false;
288 group_layouts = true;
289 default_language = "english";
290 gui_language = "auto";
292 windows_style_tex_paths = false;
293 tex_allows_spaces = false;
294 date_insert_format = "%x";
295 cursor_follows_scrollbar = false;
296 scroll_below_document = false;
297 mac_like_word_movement = false;
298 macro_edit_style = MACRO_EDIT_INLINE_BOX;
299 dialogs_iconify_with_main = false;
300 label_init_length = 3;
301 preview = PREVIEW_OFF;
302 preview_hashed_labels = false;
303 preview_scale_factor = "0.9";
304 use_converter_cache = true;
306 use_pixmap_cache = false;
307 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
308 user_name = to_utf8(support::user_name());
309 user_email = to_utf8(support::user_email());
310 open_buffers_in_tabs = true;
312 // Fullscreen settings
313 full_screen_limit = false;
314 full_screen_toolbars = true;
315 full_screen_tabbar = true;
316 full_screen_scrollbar = true;
317 full_screen_width = 700;
319 completion_cursor_text = true;
320 completion_popup_math = true;
321 completion_popup_text = false;
322 completion_popup_delay = 2.0;
323 completion_popup_after_complete = true;
324 autocorrection_math = false;
325 completion_inline_math = true;
326 completion_inline_text = false;
327 completion_inline_dots = -1;
328 completion_inline_delay = 0.2;
334 void oldFontFormat(string & family, string & foundry)
336 if (family.empty() || family[0] != '-')
338 foundry = token(family, '-', 1);
339 family = token(family, '-', 2);
347 int LyXRC::read(FileName const & filename)
349 Lexer lexrc(lyxrcTags);
350 if (lyxerr.debugging(Debug::PARSER))
351 lexrc.printTable(lyxerr);
353 lexrc.setFile(filename);
357 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
363 int LyXRC::read(istream & is)
365 Lexer lexrc(lyxrcTags);
366 if (lyxerr.debugging(Debug::PARSER))
367 lexrc.printTable(lyxerr);
373 LYXERR(Debug::LYXRC, "Reading istream...");
379 int LyXRC::read(Lexer & lexrc)
384 while (lexrc.isOK()) {
385 // By using two switches we take advantage of the compiler
386 // telling us if we have missed a LyXRCTags element in
387 // the second switch.
388 // Note that this also shows a problem with Lexer since it
389 // helps us avoid taking advantage of the strictness of the
392 int le = lexrc.lex();
394 case Lexer::LEX_UNDEF:
395 lexrc.printError("Unknown tag `$$Token'");
397 case Lexer::LEX_FEOF:
402 switch (static_cast<LyXRCTags>(le)) {
403 case RC_INPUT: // Include file
406 libFileSearch(string(),
409 lexrc.printError("Error reading "
410 "included file: " + tmp.absFilename());
416 bind_file = os::internal_path(lexrc.getString());
421 def_file = os::internal_path(lexrc.getString());
426 ui_file = os::internal_path(lexrc.getString());
429 case RC_AUTORESET_OPTIONS:
430 lexrc >> auto_reset_options;
433 case RC_DISPLAY_GRAPHICS:
435 display_graphics = lexrc.getString() == "true";
438 case RC_TEX_EXPECTS_WINDOWS_PATHS:
439 lexrc >> windows_style_tex_paths;
442 case RC_TEX_ALLOWS_SPACES:
443 lexrc >> tex_allows_spaces;
450 case RC_KBMAP_PRIMARY:
452 string const kmap(os::internal_path(lexrc.getString()));
455 } else if (!libFileSearch("kbd", kmap,
457 primary_kbmap = kmap;
459 lexrc.printError("LyX: Keymap `$$Token' not found");
464 case RC_KBMAP_SECONDARY:
466 string const kmap(os::internal_path(lexrc.getString()));
469 } else if (!libFileSearch("kbd", kmap,
471 secondary_kbmap = kmap;
473 lexrc.printError("LyX: Keymap `$$Token' not found");
478 case RC_FONT_ENCODING:
486 case RC_PRINT_COMMAND:
487 if (lexrc.next(true)) {
488 print_command = lexrc.getString();
492 case RC_PRINTEVENPAGEFLAG:
493 lexrc >> print_evenpage_flag;
496 case RC_PRINTODDPAGEFLAG:
497 lexrc >> print_oddpage_flag;
500 case RC_PRINTPAGERANGEFLAG:
501 lexrc >> print_pagerange_flag;
504 case RC_PRINTCOPIESFLAG:
505 lexrc >> print_copies_flag;
508 case RC_PRINTCOLLCOPIESFLAG:
509 lexrc >> print_collcopies_flag;
512 case RC_PRINTREVERSEFLAG:
513 lexrc >> print_reverse_flag;
516 case RC_PRINTLANDSCAPEFLAG:
517 lexrc >> print_landscape_flag;
520 case RC_PRINTTOPRINTER:
521 lexrc >> print_to_printer;
524 case RC_PRINT_ADAPTOUTPUT:
525 lexrc >> print_adapt_output;
530 print_to_file = os::internal_path(lexrc.getString());
534 case RC_PRINTFILEEXTENSION:
535 lexrc >> print_file_extension;
538 case RC_PRINTEXSTRAOPTIONS:
539 lexrc >> print_extra_options;
542 case RC_PRINTSPOOL_COMMAND:
543 if (lexrc.next(true)) {
544 print_spool_command = lexrc.getString();
548 case RC_PRINTSPOOL_PRINTERPREFIX:
549 lexrc >> print_spool_printerprefix;
552 case RC_PRINTPAPERDIMENSIONFLAG:
553 lexrc >> print_paper_dimension_flag;
556 case RC_PRINTPAPERFLAG:
557 lexrc >> print_paper_flag;
560 case RC_CUSTOM_EXPORT_COMMAND:
561 lexrc >> custom_export_command;
564 case RC_CUSTOM_EXPORT_FORMAT:
565 lexrc >> custom_export_format;
568 case RC_DEFAULT_PAPERSIZE:
570 string const size = ascii_lowercase(lexrc.getString());
571 if (size == "usletter")
572 default_papersize = PAPER_USLETTER;
573 else if (size == "legal")
574 default_papersize = PAPER_USLEGAL;
575 else if (size == "executive")
576 default_papersize = PAPER_USEXECUTIVE;
577 else if (size == "a3")
578 default_papersize = PAPER_A3;
579 else if (size == "a4")
580 default_papersize = PAPER_A4;
581 else if (size == "a5")
582 default_papersize = PAPER_A5;
583 else if (size == "b5")
584 default_papersize = PAPER_B5;
585 else if (size == "default")
586 default_papersize = PAPER_DEFAULT;
590 case RC_VIEWDVI_PAPEROPTION:
592 view_dvi_paper_option = lexrc.getString();
594 view_dvi_paper_option.erase();
597 case RC_CHKTEX_COMMAND:
598 if (lexrc.next(true)) {
599 chktex_command = lexrc.getString();
603 case RC_BIBTEX_COMMAND:
604 if (lexrc.next(true)) {
605 bibtex_command = lexrc.getString();
609 case RC_INDEX_COMMAND:
610 if (lexrc.next(true)) {
611 index_command = lexrc.getString();
615 case RC_NOMENCL_COMMAND:
616 if (lexrc.next(true)) {
617 nomencl_command = lexrc.getString();
629 case RC_GEOMETRY_SESSION:
630 lexrc >> allow_geometry_session;
633 case RC_SCREEN_FONT_SIZES:
634 lexrc >> font_sizes[FONT_SIZE_TINY];
635 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
636 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
637 lexrc >> font_sizes[FONT_SIZE_SMALL];
638 lexrc >> font_sizes[FONT_SIZE_NORMAL];
639 lexrc >> font_sizes[FONT_SIZE_LARGE];
640 lexrc >> font_sizes[FONT_SIZE_LARGER];
641 lexrc >> font_sizes[FONT_SIZE_LARGEST];
642 lexrc >> font_sizes[FONT_SIZE_HUGE];
643 lexrc >> font_sizes[FONT_SIZE_HUGER];
646 case RC_SCREEN_FONT_SCALABLE:
647 lexrc >> use_scalable_fonts;
654 case RC_DOCUMENTPATH:
656 document_path = os::internal_path(lexrc.getString());
657 document_path = expandPath(document_path);
663 example_path = os::internal_path(lexrc.getString());
664 example_path = expandPath(example_path);
668 case RC_TEMPLATEPATH:
670 template_path = os::internal_path(lexrc.getString());
671 template_path = expandPath(template_path);
677 tempdir_path = os::internal_path(lexrc.getString());
678 tempdir_path = expandPath(tempdir_path);
682 case RC_THESAURUSDIRPATH:
684 thesaurusdir_path = os::internal_path(lexrc.getString());
685 thesaurusdir_path = expandPath(thesaurusdir_path);
691 LYXERR0("Ignoring obsolete use_tempdir flag.");
694 case RC_USELASTFILEPOS:
695 lexrc >> use_lastfilepos;
699 lexrc >> load_session;
702 case RC_MOUSE_WHEEL_SPEED:
703 lexrc >> mouse_wheel_speed;
706 case RC_COMPLETION_INLINE_DELAY:
707 lexrc >> completion_inline_delay;
710 case RC_COMPLETION_INLINE_MATH:
711 lexrc >> completion_inline_math;
714 case RC_COMPLETION_INLINE_TEXT:
715 lexrc >> completion_inline_text;
718 case RC_COMPLETION_INLINE_DOTS:
719 lexrc >> completion_inline_dots;
722 case RC_AUTOCORRECTION_MATH:
723 lexrc >> autocorrection_math;
726 case RC_COMPLETION_POPUP_DELAY:
727 lexrc >> completion_popup_delay;
730 case RC_COMPLETION_POPUP_MATH:
731 lexrc >> completion_popup_math;
734 case RC_COMPLETION_POPUP_TEXT:
735 lexrc >> completion_popup_text;
738 case RC_COMPLETION_CURSOR_TEXT:
739 lexrc >> completion_cursor_text;
742 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
743 lexrc >> completion_popup_after_complete;
746 case RC_NUMLASTFILES:
747 lexrc >> num_lastfiles;
750 case RC_CHECKLASTFILES:
751 lexrc >> check_lastfiles;
754 case RC_SCREEN_FONT_ROMAN:
756 roman_font_name = lexrc.getString();
757 oldFontFormat(roman_font_name,
762 case RC_SCREEN_FONT_SANS:
764 sans_font_name = lexrc.getString();
765 oldFontFormat(sans_font_name, sans_font_foundry);
769 case RC_SCREEN_FONT_TYPEWRITER:
771 typewriter_font_name = lexrc.getString();
772 oldFontFormat(typewriter_font_name,
773 typewriter_font_foundry);
777 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
778 lexrc >> roman_font_foundry;
781 case RC_SCREEN_FONT_SANS_FOUNDRY:
782 lexrc >> sans_font_foundry;
785 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
786 lexrc >> typewriter_font_foundry;
791 lexrc.printError("Missing color tag.");
794 string lyx_name = lexrc.getString();
797 lexrc.printError("Missing color name for color: `$$Token'");
800 string x11_name = lexrc.getString();
802 ColorCode const col =
803 lcolor.getFromLyXName(lyx_name);
804 if (col == Color_none ||
805 col == Color_inherit ||
809 if (!lcolor.setColor(col, x11_name))
810 LYXERR0("Bad lyxrc set_color for " << lyx_name);
814 case RC_AUTOREGIONDELETE:
815 // Auto region delete defaults to true
816 lexrc >> auto_region_delete;
821 lyxpipes = os::internal_path(lexrc.getString());
822 lyxpipes = expandPath(lyxpipes);
826 case RC_CURSOR_FOLLOWS_SCROLLBAR:
827 lexrc >> cursor_follows_scrollbar;
830 case RC_SCROLL_BELOW_DOCUMENT:
831 lexrc >> scroll_below_document;
834 case RC_MAC_LIKE_WORD_MOVEMENT:
835 lexrc >> mac_like_word_movement;
838 case RC_MACRO_EDIT_STYLE:
840 switch (lexrc.getInteger()) {
841 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
842 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
843 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
848 case RC_DIALOGS_ICONIFY_WITH_MAIN:
849 lexrc >> dialogs_iconify_with_main;
852 case RC_PLAINTEXT_ROFF_COMMAND:
853 (void) lexrc.getString(); // Obsoleted in 2.0
855 case RC_PLAINTEXT_LINELEN:
856 lexrc >> plaintext_linelen;
858 // Spellchecker settings:
859 case RC_ACCEPT_COMPOUND:
860 lexrc >> spellchecker_accept_compound;
863 lexrc >> spellchecker_use_input_encoding;
865 case RC_USE_ALT_LANG:
866 lexrc >> spellchecker_use_alt_lang;
868 case RC_USE_PERS_DICT:
869 lexrc >> spellchecker_use_pers_dict;
872 lexrc >> use_tooltip;
874 case RC_USE_PIXMAP_CACHE:
875 lexrc >> use_pixmap_cache;
877 case RC_USE_ESC_CHARS:
878 lexrc >> spellchecker_use_esc_chars;
881 lexrc >> spellchecker_alt_lang;
885 spellchecker_pers_dict = os::internal_path(lexrc.getString());
888 lexrc >> spellchecker_esc_chars;
890 case RC_SPELLCHECK_CONTINUOUSLY:
891 lexrc >> spellcheck_continuously;
894 lexrc >> make_backup;
896 case RC_BACKUPDIR_PATH:
898 backupdir_path = os::internal_path(lexrc.getString());
899 backupdir_path = expandPath(backupdir_path);
902 case RC_DATE_INSERT_FORMAT:
903 lexrc >> date_insert_format;
905 case RC_LANGUAGE_PACKAGE:
906 lexrc >> language_package;
908 case RC_LANGUAGE_AUTO_BEGIN:
909 lexrc >> language_auto_begin;
911 case RC_LANGUAGE_AUTO_END:
912 lexrc >> language_auto_end;
914 case RC_LANGUAGE_GLOBAL_OPTIONS:
915 lexrc >> language_global_options;
917 case RC_LANGUAGE_USE_BABEL:
918 lexrc >> language_use_babel;
920 case RC_LANGUAGE_COMMAND_BEGIN:
921 lexrc >> language_command_begin;
923 case RC_LANGUAGE_COMMAND_END:
924 lexrc >> language_command_end;
926 case RC_LANGUAGE_COMMAND_LOCAL:
927 lexrc >> language_command_local;
930 lexrc >> rtl_support;
932 case RC_VISUAL_CURSOR:
933 lexrc >> visual_cursor;
936 lexrc >> auto_number;
938 case RC_MARK_FOREIGN_LANGUAGE:
939 lexrc >> mark_foreign_language;
945 fmt = lexrc.getString();
946 if (lexrc.next(true))
947 command = lexrc.getString();
948 setMover(fmt, command);
953 string from, to, command, flags;
955 from = lexrc.getString();
957 to = lexrc.getString();
958 if (lexrc.next(true))
959 command = lexrc.getString();
961 flags = lexrc.getString();
963 theConverters().erase(from, to);
965 theConverters().add(from, to, command, flags);
968 // compatibility with versions older than 1.4.0 only
970 string format, command;
971 lexrc >> format >> command;
972 formats.setViewer(format, command);
976 string format, extension, prettyname, shortcut;
977 lexrc >> format >> extension >> prettyname >> shortcut;
978 string viewer, editor;
979 if (lexrc.next(true))
980 viewer = lexrc.getString();
981 if (lexrc.next(true))
982 editor = lexrc.getString();
984 // Hack to ensure compatibility with versions older
986 int le = lexrc.lex();
987 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
988 flags = lexrc.getString();
989 if (le != Lexer::LEX_DATA) {
990 // We have got a known token.
991 // Therefore this is an old style
992 // format definition without
994 lexrc.pushToken(flags);
998 int flgs = Format::none;
999 while (!flags.empty()) {
1001 flags = split(flags, flag, ',');
1002 if (flag == "document")
1003 flgs |= Format::document;
1004 else if (flag == "vector")
1005 flgs |= Format::vector;
1007 LYXERR0("Ignoring unknown flag `"
1008 << flag << "' for format `"
1011 if (prettyname.empty()) {
1012 if (theConverters().formatIsUsed(format))
1013 LYXERR0("Can't delete format " << format);
1015 formats.erase(format);
1017 formats.add(format, extension, prettyname,
1018 shortcut, viewer, editor, flgs);
1022 case RC_DEFAULT_VIEW_FORMAT:
1023 lexrc >> default_view_format;
1026 case RC_DEFAULT_LANGUAGE:
1027 lexrc >> default_language;
1030 case RC_GUI_LANGUAGE:
1031 lexrc >> gui_language;
1034 case RC_LABEL_INIT_LENGTH:
1035 lexrc >> label_init_length;
1038 case RC_SHOW_BANNER:
1039 lexrc >> show_banner;
1044 string const tmp = lexrc.getString();
1045 if (tmp == "true" || tmp == "on")
1046 preview = PREVIEW_ON;
1047 else if (tmp == "no_math")
1048 preview = PREVIEW_NO_MATH;
1050 preview = PREVIEW_OFF;
1051 if (tmp != "false" && tmp != "off")
1052 LYXERR0("Unrecognized preview status \""
1058 case RC_PREVIEW_HASHED_LABELS:
1059 lexrc >> preview_hashed_labels;
1062 case RC_PREVIEW_SCALE_FACTOR:
1063 lexrc >> preview_scale_factor;
1070 lexrc >> user_email;
1073 case RC_PATH_PREFIX:
1074 lexrc >> path_prefix;
1077 case RC_USE_CONVERTER_CACHE:
1078 lexrc >> use_converter_cache;
1080 case RC_CONVERTER_CACHE_MAXAGE:
1081 lexrc >> converter_cache_maxage;
1084 case RC_SORT_LAYOUTS:
1085 lexrc >> sort_layouts;
1087 case RC_GROUP_LAYOUTS:
1088 lexrc >> group_layouts;
1090 case RC_FULL_SCREEN_LIMIT:
1091 lexrc >> full_screen_limit;
1093 case RC_FULL_SCREEN_TOOLBARS:
1094 lexrc >> full_screen_toolbars;
1096 case RC_FULL_SCREEN_SCROLLBAR:
1097 lexrc >> full_screen_scrollbar;
1099 case RC_FULL_SCREEN_TABBAR:
1100 lexrc >> full_screen_tabbar;
1102 case RC_FULL_SCREEN_WIDTH:
1103 lexrc >> full_screen_width;
1105 case RC_OPEN_BUFFERS_IN_TABS:
1106 lexrc >> open_buffers_in_tabs;
1110 case RC_SPELL_COMMAND:
1111 case RC_USE_SPELL_LIB:
1112 (void) lexrc.getString();
1116 break; // this is just a dummy
1120 /// Update converters data-structures
1121 theConverters().update(formats);
1122 theConverters().buildGraph();
1128 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1130 ofstream ofs(filename.toFilesystemEncoding().c_str());
1132 write(ofs, ignore_system_lyxrc);
1136 void LyXRC::print() const
1138 if (lyxerr.debugging())
1139 write(lyxerr, false);
1147 typedef pair<string, SpecialisedMover> Data;
1149 SameMover(Data const & comparison)
1150 : comparison_(comparison) {}
1152 bool operator()(Data const & data) const
1154 return data.first == comparison_.first &&
1155 data.second.command() == comparison_.second.command();
1165 // Escape \ and " so that LyXLex can read the string later
1166 string escapeCommand(string const & str) {
1167 return subst(subst(str , "\\", "\\\\"),
1174 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1176 LyXRCTags tag = RC_LAST;
1178 if (!name.empty()) {
1179 for (int i = 0; i != lyxrcCount; ++i)
1180 if ("\\" + name == lyxrcTags[i].tag)
1181 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1185 os << "# LyX " << lyx_version
1186 << " generated this file. If you want to make your own\n"
1187 << "# modifications you should do them from inside LyX and save.\n"
1190 // Why the switch you might ask. It is a trick to ensure that all
1191 // the elements in the LyXRCTags enum are handled. As you can see
1192 // there are no breaks at all. So it is just a huge fall-through.
1193 // The nice thing is that we will get a warning from the compiler
1194 // if we forget an element.
1198 // input/include files are not done here
1200 if (ignore_system_lyxrc ||
1201 bind_file != system_lyxrc.bind_file) {
1202 string const path = os::external_path(bind_file);
1203 os << "\\bind_file \"" << path << "\"\n";
1209 if (ignore_system_lyxrc ||
1210 def_file != system_lyxrc.def_file) {
1211 string const path = os::external_path(def_file);
1212 os << "\\def_file \"" << path << "\"\n";
1221 << "# MISC SECTION ######################################\n"
1223 // bind files are not done here.
1225 case RC_PATH_PREFIX:
1226 if (ignore_system_lyxrc ||
1227 path_prefix != system_lyxrc.path_prefix) {
1228 os << "\\path_prefix \"" << path_prefix << "\"\n";
1233 if (ignore_system_lyxrc ||
1234 ui_file != system_lyxrc.ui_file) {
1235 string const path = os::external_path(ui_file);
1236 os << "\\ui_file \"" << path << "\"\n";
1240 case RC_AUTOREGIONDELETE:
1241 if (ignore_system_lyxrc ||
1242 auto_region_delete != system_lyxrc.auto_region_delete) {
1243 os << "# Set to false to inhibit automatic replacement of\n"
1244 << "# the current selection.\n"
1245 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1250 case RC_AUTORESET_OPTIONS:
1251 if (ignore_system_lyxrc ||
1252 auto_reset_options != system_lyxrc.auto_reset_options) {
1253 os << "# Set to false to inhibit automatic reset of\n"
1254 << "# the class options to defaults on class change.\n"
1255 << "\\auto_reset_options "
1256 << convert<string>(auto_reset_options)
1262 if (ignore_system_lyxrc ||
1263 autosave != system_lyxrc.autosave) {
1264 os << "# The time interval between auto-saves in seconds.\n"
1265 << "\\autosave " << autosave << '\n';
1269 case RC_DISPLAY_GRAPHICS:
1270 if (ignore_system_lyxrc ||
1271 display_graphics != system_lyxrc.display_graphics) {
1272 os << "# Display graphics within LyX\n"
1274 << "\\display_graphics "
1275 << (display_graphics ? "true" : "false")
1280 case RC_SORT_LAYOUTS:
1281 if (ignore_system_lyxrc ||
1282 sort_layouts != system_lyxrc.sort_layouts) {
1283 os << "# Sort layouts alphabetically.\n"
1284 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1288 case RC_GROUP_LAYOUTS:
1289 if (ignore_system_lyxrc ||
1290 group_layouts != system_lyxrc.group_layouts) {
1291 os << "# Group layouts by their category.\n"
1292 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1296 case RC_VIEWDVI_PAPEROPTION:
1297 if (ignore_system_lyxrc ||
1298 view_dvi_paper_option
1299 != system_lyxrc.view_dvi_paper_option) {
1300 os << "# Options used to specify paper size to the\n"
1301 << "# view_dvi_command (e.g. -paper)\n"
1302 << "\\view_dvi_paper_option \""
1303 << view_dvi_paper_option << "\"\n";
1307 case RC_DEFAULT_PAPERSIZE:
1308 if (ignore_system_lyxrc ||
1309 default_papersize != system_lyxrc.default_papersize) {
1310 os << "# The default papersize to use.\n"
1311 << "\\default_papersize \"";
1312 switch (default_papersize) {
1314 os << "default"; break;
1315 case PAPER_USLETTER:
1316 os << "usletter"; break;
1318 os << "legal"; break;
1319 case PAPER_USEXECUTIVE:
1320 os << "executive"; break;
1331 case PAPER_B4: break;
1337 case RC_CHKTEX_COMMAND:
1338 if (ignore_system_lyxrc ||
1339 chktex_command != system_lyxrc.chktex_command) {
1340 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1344 case RC_BIBTEX_COMMAND:
1345 if (ignore_system_lyxrc ||
1346 bibtex_command != system_lyxrc.bibtex_command) {
1347 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1351 case RC_INDEX_COMMAND:
1352 if (ignore_system_lyxrc ||
1353 index_command != system_lyxrc.index_command) {
1354 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1358 case RC_NOMENCL_COMMAND:
1359 if (ignore_system_lyxrc ||
1360 nomencl_command != system_lyxrc.nomencl_command) {
1361 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1365 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1366 if (ignore_system_lyxrc ||
1367 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1368 os << "\\tex_expects_windows_paths "
1369 << convert<string>(windows_style_tex_paths) << '\n';
1373 case RC_TEX_ALLOWS_SPACES:
1374 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1375 os << "\\tex_allows_spaces "
1376 << convert<string>(tex_allows_spaces) << '\n';
1381 if (ignore_system_lyxrc ||
1382 use_kbmap != system_lyxrc.use_kbmap) {
1383 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1387 case RC_KBMAP_PRIMARY:
1388 if (ignore_system_lyxrc ||
1389 primary_kbmap != system_lyxrc.primary_kbmap) {
1390 string const path = os::external_path(primary_kbmap);
1391 os << "\\kbmap_primary \"" << path << "\"\n";
1395 case RC_KBMAP_SECONDARY:
1396 if (ignore_system_lyxrc ||
1397 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1398 string const path = os::external_path(secondary_kbmap);
1399 os << "\\kbmap_secondary \"" << path << "\"\n";
1404 if (ignore_system_lyxrc ||
1405 lyxpipes != system_lyxrc.lyxpipes) {
1406 string const path = os::external_path(lyxpipes);
1407 os << "\\serverpipe \"" << path << "\"\n";
1411 case RC_DATE_INSERT_FORMAT:
1412 if (ignore_system_lyxrc ||
1413 date_insert_format != system_lyxrc.date_insert_format) {
1414 os << "\\date_insert_format \"" << date_insert_format
1419 case RC_LABEL_INIT_LENGTH:
1420 if (ignore_system_lyxrc ||
1421 label_init_length != system_lyxrc.label_init_length) {
1422 os << "\\label_init_length " << label_init_length
1429 os << "\\user_name \"" << user_name << "\"\n";
1434 os << "\\user_email \"" << user_email << "\"\n";
1438 case RC_SHOW_BANNER:
1439 if (ignore_system_lyxrc ||
1440 show_banner != system_lyxrc.show_banner) {
1441 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1447 if (ignore_system_lyxrc ||
1448 preview != system_lyxrc.preview) {
1454 case PREVIEW_NO_MATH:
1461 os << "\\preview " << status << '\n';
1466 case RC_PREVIEW_HASHED_LABELS:
1467 if (ignore_system_lyxrc ||
1468 preview_hashed_labels !=
1469 system_lyxrc.preview_hashed_labels) {
1470 os << "\\preview_hashed_labels "
1471 << convert<string>(preview_hashed_labels) << '\n';
1476 case RC_PREVIEW_SCALE_FACTOR:
1477 if (ignore_system_lyxrc ||
1478 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1479 os << "\\preview_scale_factor "
1480 << preview_scale_factor << '\n';
1485 case RC_USE_CONVERTER_CACHE:
1486 if (ignore_system_lyxrc ||
1487 use_converter_cache != system_lyxrc.use_converter_cache) {
1488 os << "\\use_converter_cache "
1489 << convert<string>(use_converter_cache) << '\n';
1494 case RC_CONVERTER_CACHE_MAXAGE:
1495 if (ignore_system_lyxrc ||
1496 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1497 os << "\\converter_cache_maxage "
1498 << converter_cache_maxage << '\n';
1504 << "# SCREEN & FONTS SECTION ############################\n"
1508 if (ignore_system_lyxrc ||
1509 dpi != system_lyxrc.dpi) {
1510 os << "\\screen_dpi " << dpi << '\n';
1514 case RC_SCREEN_ZOOM:
1515 if (ignore_system_lyxrc ||
1516 zoom != system_lyxrc.zoom) {
1517 os << "\\screen_zoom " << zoom << '\n';
1521 case RC_GEOMETRY_SESSION:
1522 if (ignore_system_lyxrc ||
1523 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1524 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1529 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1530 if (ignore_system_lyxrc ||
1531 cursor_follows_scrollbar
1532 != system_lyxrc.cursor_follows_scrollbar) {
1533 os << "\\cursor_follows_scrollbar "
1534 << convert<string>(cursor_follows_scrollbar) << '\n';
1538 case RC_SCROLL_BELOW_DOCUMENT:
1539 if (ignore_system_lyxrc ||
1540 scroll_below_document
1541 != system_lyxrc.scroll_below_document) {
1542 os << "\\scroll_below_document "
1543 << convert<string>(scroll_below_document) << '\n';
1547 case RC_MAC_LIKE_WORD_MOVEMENT:
1548 if (ignore_system_lyxrc ||
1549 mac_like_word_movement
1550 != system_lyxrc.mac_like_word_movement) {
1551 os << "\\mac_like_word_movement "
1552 << convert<string>(mac_like_word_movement) << '\n';
1556 case RC_MACRO_EDIT_STYLE:
1557 if (ignore_system_lyxrc ||
1559 != system_lyxrc.macro_edit_style) {
1560 os << "\\macro_edit_style ";
1561 switch (macro_edit_style) {
1562 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1563 case MACRO_EDIT_INLINE: os << "1\n"; break;
1564 case MACRO_EDIT_LIST: os << "2\n"; break;
1569 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1570 if (ignore_system_lyxrc ||
1571 dialogs_iconify_with_main
1572 != system_lyxrc.dialogs_iconify_with_main) {
1573 os << "\\dialogs_iconify_with_main "
1574 << convert<string>(dialogs_iconify_with_main) << '\n';
1578 case RC_SCREEN_FONT_ROMAN:
1579 if (ignore_system_lyxrc ||
1580 roman_font_name != system_lyxrc.roman_font_name) {
1581 os << "\\screen_font_roman \"" << roman_font_name
1586 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1587 if (ignore_system_lyxrc ||
1588 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1589 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1594 case RC_SCREEN_FONT_SANS:
1595 if (ignore_system_lyxrc ||
1596 sans_font_name != system_lyxrc.sans_font_name) {
1597 os << "\\screen_font_sans \"" << sans_font_name
1602 case RC_SCREEN_FONT_SANS_FOUNDRY:
1603 if (ignore_system_lyxrc ||
1604 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1605 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1610 case RC_SCREEN_FONT_TYPEWRITER:
1611 if (ignore_system_lyxrc ||
1612 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1613 os << "\\screen_font_typewriter \""
1614 << typewriter_font_name << "\"\n";
1618 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1619 if (ignore_system_lyxrc ||
1620 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1621 os << "\\screen_font_typewriter_foundry \""
1622 << typewriter_font_foundry << "\"\n";
1627 case RC_SCREEN_FONT_SCALABLE:
1628 if (ignore_system_lyxrc ||
1629 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1630 os << "\\screen_font_scalable "
1631 << convert<string>(use_scalable_fonts)
1636 case RC_SCREEN_FONT_SIZES:
1637 if (ignore_system_lyxrc ||
1638 font_sizes[FONT_SIZE_TINY]
1639 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1640 font_sizes[FONT_SIZE_SCRIPT]
1641 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1642 font_sizes[FONT_SIZE_FOOTNOTE]
1643 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1644 font_sizes[FONT_SIZE_SMALL]
1645 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1646 font_sizes[FONT_SIZE_NORMAL]
1647 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1648 font_sizes[FONT_SIZE_LARGE]
1649 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1650 font_sizes[FONT_SIZE_LARGER]
1651 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1652 font_sizes[FONT_SIZE_LARGEST]
1653 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1654 font_sizes[FONT_SIZE_HUGE]
1655 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1656 font_sizes[FONT_SIZE_HUGER]
1657 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1658 os.setf(ios::fixed);
1660 os << "\\screen_font_sizes"
1661 << ' ' << font_sizes[FONT_SIZE_TINY]
1662 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1663 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1664 << ' ' << font_sizes[FONT_SIZE_SMALL]
1665 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1666 << ' ' << font_sizes[FONT_SIZE_LARGE]
1667 << ' ' << font_sizes[FONT_SIZE_LARGER]
1668 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1669 << ' ' << font_sizes[FONT_SIZE_HUGE]
1670 << ' ' << font_sizes[FONT_SIZE_HUGER]
1675 case RC_FULL_SCREEN_LIMIT:
1676 if (ignore_system_lyxrc ||
1677 full_screen_limit != system_lyxrc.full_screen_limit) {
1678 os << "\\fullscreen_limit "
1679 << convert<string>(full_screen_limit)
1684 case RC_FULL_SCREEN_TOOLBARS:
1685 if (ignore_system_lyxrc ||
1686 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1687 os << "\\fullscreen_toolbars "
1688 << convert<string>(full_screen_toolbars)
1693 case RC_FULL_SCREEN_SCROLLBAR:
1694 if (ignore_system_lyxrc ||
1695 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1696 os << "\\fullscreen_scrollbar "
1697 << convert<string>(full_screen_scrollbar)
1702 case RC_FULL_SCREEN_TABBAR:
1703 if (ignore_system_lyxrc ||
1704 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1705 os << "\\fullscreen_tabbar "
1706 << convert<string>(full_screen_tabbar)
1711 case RC_FULL_SCREEN_WIDTH:
1712 if (ignore_system_lyxrc ||
1713 full_screen_width != system_lyxrc.full_screen_width) {
1714 os << "\\fullscreen_width "
1715 << convert<string>(full_screen_width)
1720 case RC_OPEN_BUFFERS_IN_TABS:
1721 if (ignore_system_lyxrc ||
1722 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1723 os << "\\open_buffers_in_tabs "
1724 << convert<string>(open_buffers_in_tabs)
1731 << "# COLOR SECTION ###################################\n"
1735 for (int i = 0; i < Color_ignore; ++i) {
1736 ColorCode lc = static_cast<ColorCode>(i);
1737 string const col = lcolor.getX11Name(lc);
1738 if (ignore_system_lyxrc
1739 || col != system_lcolor.getX11Name(lc)) {
1740 os << "\\set_color \""
1741 << lcolor.getLyXName(lc) << "\" \""
1749 << "# PRINTER SECTION ###################################\n"
1753 if (ignore_system_lyxrc ||
1754 printer != system_lyxrc.printer) {
1755 os << "\\printer \"" << printer << "\"\n";
1759 case RC_PRINT_ADAPTOUTPUT:
1760 if (ignore_system_lyxrc ||
1761 print_adapt_output != system_lyxrc.print_adapt_output) {
1762 os << "\\print_adapt_output "
1763 << convert<string>(print_adapt_output)
1768 case RC_PRINT_COMMAND:
1769 if (ignore_system_lyxrc ||
1770 print_command != system_lyxrc.print_command) {
1771 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1775 case RC_PRINTEXSTRAOPTIONS:
1776 if (ignore_system_lyxrc ||
1777 print_extra_options != system_lyxrc.print_extra_options) {
1778 os << "\\print_extra_options \"" << print_extra_options
1783 case RC_PRINTSPOOL_COMMAND:
1784 if (ignore_system_lyxrc ||
1785 print_spool_command != system_lyxrc.print_spool_command) {
1786 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1791 case RC_PRINTSPOOL_PRINTERPREFIX:
1792 if (ignore_system_lyxrc ||
1793 print_spool_printerprefix
1794 != system_lyxrc.print_spool_printerprefix) {
1795 os << "\\print_spool_printerprefix \""
1796 << print_spool_printerprefix << "\"\n";
1800 case RC_PRINTEVENPAGEFLAG:
1801 if (ignore_system_lyxrc ||
1802 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1803 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1808 case RC_PRINTODDPAGEFLAG:
1809 if (ignore_system_lyxrc ||
1810 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1811 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1816 case RC_PRINTREVERSEFLAG:
1817 if (ignore_system_lyxrc ||
1818 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1819 os << "\\print_reverse_flag \"" << print_reverse_flag
1824 case RC_PRINTLANDSCAPEFLAG:
1825 if (ignore_system_lyxrc ||
1826 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1827 os << "\\print_landscape_flag \"" << print_landscape_flag
1832 case RC_PRINTPAGERANGEFLAG:
1833 if (ignore_system_lyxrc ||
1834 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1835 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1840 case RC_PRINTCOPIESFLAG:
1841 if (ignore_system_lyxrc ||
1842 print_copies_flag != system_lyxrc.print_copies_flag) {
1843 os << "\\print_copies_flag \"" << print_copies_flag
1848 case RC_PRINTCOLLCOPIESFLAG:
1849 if (ignore_system_lyxrc ||
1850 print_collcopies_flag
1851 != system_lyxrc.print_collcopies_flag) {
1852 os << "\\print_collcopies_flag \""
1853 << print_collcopies_flag
1858 case RC_PRINTPAPERFLAG:
1859 if (ignore_system_lyxrc ||
1860 print_paper_flag != system_lyxrc.print_paper_flag) {
1861 os << "\\print_paper_flag \"" << print_paper_flag
1866 case RC_PRINTPAPERDIMENSIONFLAG:
1867 if (ignore_system_lyxrc ||
1868 print_paper_dimension_flag
1869 != system_lyxrc.print_paper_dimension_flag) {
1870 os << "\\print_paper_dimension_flag \""
1871 << print_paper_dimension_flag << "\"\n";
1875 case RC_PRINTTOPRINTER:
1876 if (ignore_system_lyxrc ||
1877 print_to_printer != system_lyxrc.print_to_printer) {
1878 os << "\\print_to_printer \"" << print_to_printer
1883 case RC_PRINTTOFILE:
1884 if (ignore_system_lyxrc ||
1885 print_to_file != system_lyxrc.print_to_file) {
1886 string const path = os::external_path(print_to_file);
1887 os << "\\print_to_file \"" << path << "\"\n";
1891 case RC_PRINTFILEEXTENSION:
1892 if (ignore_system_lyxrc ||
1893 print_file_extension != system_lyxrc.print_file_extension) {
1894 os << "\\print_file_extension \""
1895 << print_file_extension
1902 << "# EXPORT SECTION ####################################\n"
1905 case RC_CUSTOM_EXPORT_COMMAND:
1906 if (ignore_system_lyxrc ||
1907 custom_export_command
1908 != system_lyxrc.custom_export_command) {
1909 os << "\\custom_export_command \""
1910 << custom_export_command
1915 case RC_CUSTOM_EXPORT_FORMAT:
1916 if (ignore_system_lyxrc ||
1917 custom_export_format
1918 != system_lyxrc.custom_export_format) {
1919 os << "\\custom_export_format \"" << custom_export_format
1926 << "# TEX SECTION #######################################\n"
1929 case RC_FONT_ENCODING:
1930 if (ignore_system_lyxrc ||
1931 fontenc != system_lyxrc.fontenc) {
1932 os << "\\font_encoding \"" << fontenc << "\"\n";
1938 << "# FILE SECTION ######################################\n"
1941 case RC_DOCUMENTPATH:
1942 if (ignore_system_lyxrc ||
1943 document_path != system_lyxrc.document_path) {
1944 string const path = os::external_path(document_path);
1945 os << "\\document_path \"" << path << "\"\n";
1949 case RC_USELASTFILEPOS:
1950 if (ignore_system_lyxrc ||
1951 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1952 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1957 case RC_LOADSESSION:
1958 if (ignore_system_lyxrc ||
1959 load_session != system_lyxrc.load_session) {
1960 os << "\\load_session " << convert<string>(load_session)
1965 case RC_MOUSE_WHEEL_SPEED:
1966 if (ignore_system_lyxrc ||
1967 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1968 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1972 case RC_COMPLETION_INLINE_DELAY:
1973 if (ignore_system_lyxrc ||
1974 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1975 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
1979 case RC_COMPLETION_INLINE_MATH:
1980 if (ignore_system_lyxrc ||
1981 completion_inline_math != system_lyxrc.completion_inline_math) {
1982 os << "\\completion_inline_math "
1983 << convert<string>(completion_inline_math) << '\n';
1987 case RC_COMPLETION_INLINE_TEXT:
1988 if (ignore_system_lyxrc ||
1989 completion_inline_text != system_lyxrc.completion_inline_text) {
1990 os << "\\completion_inline_text "
1991 << convert<string>(completion_inline_text) << '\n';
1995 case RC_COMPLETION_INLINE_DOTS:
1996 if (ignore_system_lyxrc ||
1997 completion_inline_dots != system_lyxrc.completion_inline_dots) {
1998 os << "\\completion_inline_dots "
1999 << convert<string>(completion_inline_dots) << '\n';
2003 case RC_AUTOCORRECTION_MATH:
2004 if (ignore_system_lyxrc ||
2005 autocorrection_math != system_lyxrc.autocorrection_math) {
2006 os << "\\autocorrection_math "
2007 << convert<string>(autocorrection_math) << '\n';
2011 case RC_COMPLETION_POPUP_DELAY:
2012 if (ignore_system_lyxrc ||
2013 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2014 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2018 case RC_COMPLETION_POPUP_MATH:
2019 if (ignore_system_lyxrc ||
2020 completion_popup_math != system_lyxrc.completion_popup_math) {
2021 os << "\\completion_popup_math "
2022 << convert<string>(completion_popup_math) << '\n';
2026 case RC_COMPLETION_POPUP_TEXT:
2027 if (ignore_system_lyxrc ||
2028 completion_popup_text != system_lyxrc.completion_popup_text) {
2029 os << "\\completion_popup_text "
2030 << convert<string>(completion_popup_text) << '\n';
2034 case RC_COMPLETION_CURSOR_TEXT:
2035 if (ignore_system_lyxrc ||
2036 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2037 os << "\\completion_cursor_text "
2038 << convert<string>(completion_cursor_text) << '\n';
2042 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2043 if (ignore_system_lyxrc ||
2044 completion_popup_after_complete
2045 != system_lyxrc.completion_popup_after_complete) {
2046 os << "\\completion_popup_after_complete "
2047 << convert<string>(completion_popup_after_complete) << '\n';
2051 case RC_NUMLASTFILES:
2052 if (ignore_system_lyxrc ||
2053 num_lastfiles != system_lyxrc.num_lastfiles) {
2054 os << "\\num_lastfiles " << num_lastfiles << '\n';
2058 case RC_CHECKLASTFILES:
2059 if (ignore_system_lyxrc ||
2060 check_lastfiles != system_lyxrc.check_lastfiles) {
2061 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2066 case RC_EXAMPLEPATH:
2067 if (ignore_system_lyxrc ||
2068 example_path != system_lyxrc.example_path) {
2069 string const path = os::external_path(example_path);
2070 os << "\\example_path \"" << path << "\"\n";
2074 case RC_TEMPLATEPATH:
2075 if (ignore_system_lyxrc ||
2076 template_path != system_lyxrc.template_path) {
2077 string const path = os::external_path(template_path);
2078 os << "\\template_path \"" << path << "\"\n";
2082 case RC_TEMPDIRPATH:
2083 if (ignore_system_lyxrc ||
2084 tempdir_path != system_lyxrc.tempdir_path) {
2085 string const path = os::external_path(tempdir_path);
2086 os << "\\tempdir_path \"" << path << "\"\n";
2090 case RC_THESAURUSDIRPATH:
2091 if (ignore_system_lyxrc ||
2092 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2093 string const path = os::external_path(thesaurusdir_path);
2094 os << "\\thesaurusdir_path \"" << path << "\"\n";
2102 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2105 case RC_PLAINTEXT_LINELEN:
2106 if (ignore_system_lyxrc ||
2107 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2108 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2112 case RC_MAKE_BACKUP:
2113 if (ignore_system_lyxrc ||
2114 make_backup != system_lyxrc.make_backup) {
2115 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2119 case RC_BACKUPDIR_PATH:
2120 if (ignore_system_lyxrc ||
2121 backupdir_path != system_lyxrc.backupdir_path) {
2122 string const path = os::external_path(backupdir_path);
2123 os << "\\backupdir_path \"" << path << "\"\n";
2129 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2133 << "# SPELLCHECKER SECTION ##############################\n"
2136 case RC_SPELL_COMMAND:
2137 case RC_USE_SPELL_LIB:
2141 case RC_ACCEPT_COMPOUND:
2142 if (ignore_system_lyxrc ||
2143 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2144 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2149 case RC_USE_ALT_LANG:
2150 if (ignore_system_lyxrc ||
2151 spellchecker_use_alt_lang != system_lyxrc.spellchecker_use_alt_lang) {
2152 os << "\\use_alt_language " << convert<string>(spellchecker_use_alt_lang)
2158 if (ignore_system_lyxrc ||
2159 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2160 os << "\\alternate_language \"" << spellchecker_alt_lang
2165 case RC_USE_ESC_CHARS:
2166 if (ignore_system_lyxrc ||
2167 spellchecker_use_esc_chars != system_lyxrc.spellchecker_use_esc_chars) {
2168 os << "\\use_escape_chars " << convert<string>(spellchecker_use_esc_chars)
2174 if (ignore_system_lyxrc ||
2175 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2176 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2180 case RC_USE_PERS_DICT:
2181 if (ignore_system_lyxrc ||
2182 spellchecker_use_pers_dict != system_lyxrc.spellchecker_use_pers_dict) {
2183 os << "\\use_personal_dictionary "
2184 << convert<string>(spellchecker_use_pers_dict)
2189 case RC_USE_TOOLTIP:
2190 if (ignore_system_lyxrc ||
2191 use_tooltip != system_lyxrc.use_tooltip) {
2192 os << "\\use_tooltip "
2193 << convert<string>(use_tooltip)
2196 case RC_USE_PIXMAP_CACHE:
2197 if (ignore_system_lyxrc ||
2198 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2199 os << "\\use_pixmap_cache "
2200 << convert<string>(use_pixmap_cache)
2204 if (spellchecker_pers_dict != system_lyxrc.spellchecker_pers_dict) {
2205 string const path = os::external_path(spellchecker_pers_dict);
2206 os << "\\personal_dictionary \"" << path << "\"\n";
2210 case RC_USE_INP_ENC:
2211 if (ignore_system_lyxrc ||
2212 spellchecker_use_input_encoding
2213 != system_lyxrc.spellchecker_use_input_encoding) {
2214 os << "\\use_input_encoding "
2215 << convert<string>(spellchecker_use_input_encoding)
2222 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2225 case RC_SPELLCHECK_CONTINUOUSLY:
2226 if (ignore_system_lyxrc ||
2227 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2228 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2234 case RC_RTL_SUPPORT:
2235 if (ignore_system_lyxrc ||
2236 rtl_support != system_lyxrc.rtl_support) {
2237 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2241 case RC_VISUAL_CURSOR:
2242 if (ignore_system_lyxrc ||
2243 visual_cursor != system_lyxrc.visual_cursor) {
2244 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2248 case RC_LANGUAGE_PACKAGE:
2249 if (ignore_system_lyxrc ||
2250 language_package != system_lyxrc.language_package) {
2251 os << "\\language_package \"" << language_package
2256 case RC_LANGUAGE_GLOBAL_OPTIONS:
2257 if (ignore_system_lyxrc ||
2258 language_global_options
2259 != system_lyxrc.language_global_options) {
2260 os << "\\language_global_options \""
2261 << convert<string>(language_global_options)
2266 case RC_LANGUAGE_USE_BABEL:
2267 if (ignore_system_lyxrc ||
2268 language_use_babel != system_lyxrc.language_use_babel) {
2269 os << "\\language_use_babel \""
2270 << convert<string>(language_use_babel)
2275 case RC_LANGUAGE_COMMAND_BEGIN:
2276 if (ignore_system_lyxrc ||
2277 language_command_begin
2278 != system_lyxrc.language_command_begin) {
2279 os << "\\language_command_begin \""
2280 << language_command_begin
2285 case RC_LANGUAGE_COMMAND_END:
2286 if (ignore_system_lyxrc ||
2287 language_command_end
2288 != system_lyxrc.language_command_end) {
2289 os << "\\language_command_end \"" << language_command_end
2294 case RC_LANGUAGE_COMMAND_LOCAL:
2295 if (ignore_system_lyxrc ||
2296 language_command_local
2297 != system_lyxrc.language_command_local) {
2298 os << "\\language_command_local \""
2299 << language_command_local
2304 case RC_LANGUAGE_AUTO_BEGIN:
2305 if (ignore_system_lyxrc ||
2306 language_auto_begin != system_lyxrc.language_auto_begin) {
2307 os << "\\language_auto_begin "
2308 << convert<string>(language_auto_begin) << '\n';
2312 case RC_LANGUAGE_AUTO_END:
2313 if (ignore_system_lyxrc ||
2314 language_auto_end != system_lyxrc.language_auto_end) {
2315 os << "\\language_auto_end "
2316 << convert<string>(language_auto_end) << '\n';
2320 case RC_MARK_FOREIGN_LANGUAGE:
2321 if (ignore_system_lyxrc ||
2322 mark_foreign_language
2323 != system_lyxrc.mark_foreign_language) {
2324 os << "\\mark_foreign_language " <<
2325 convert<string>(mark_foreign_language) << '\n';
2331 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2334 case RC_AUTO_NUMBER:
2335 if (ignore_system_lyxrc ||
2336 auto_number != system_lyxrc.auto_number) {
2337 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2341 case RC_DEFAULT_LANGUAGE:
2342 if (ignore_system_lyxrc ||
2343 default_language != system_lyxrc.default_language) {
2344 os << "\\default_language " << default_language << '\n';
2348 case RC_GUI_LANGUAGE:
2349 if (ignore_system_lyxrc ||
2350 gui_language != system_lyxrc.gui_language) {
2351 os << "\\gui_language " << gui_language << '\n';
2357 << "# FORMATS SECTION ##########################\n"
2361 // New/modified formats
2362 for (Formats::const_iterator cit = formats.begin();
2363 cit != formats.end(); ++cit) {
2364 Format const * format =
2365 system_formats.getFormat(cit->name());
2367 format->extension() != cit->extension() ||
2368 format->prettyname() != cit->prettyname() ||
2369 format->shortcut() != cit->shortcut() ||
2370 format->viewer() != cit->viewer() ||
2371 format->editor() != cit->editor() ||
2372 format->documentFormat() != cit->documentFormat() ||
2373 format->vectorFormat() != cit->vectorFormat()) {
2374 os << "\\format \"" << cit->name() << "\" \""
2375 << cit->extension() << "\" \""
2376 << cit->prettyname() << "\" \""
2377 << cit->shortcut() << "\" \""
2378 << escapeCommand(cit->viewer()) << "\" \""
2379 << escapeCommand(cit->editor()) << "\" \"";
2380 vector<string> flags;
2381 if (cit->documentFormat())
2382 flags.push_back("document");
2383 if (cit->vectorFormat())
2384 flags.push_back("vector");
2385 os << getStringFromVector(flags);
2390 // Look for deleted formats
2391 for (Formats::const_iterator cit = system_formats.begin();
2392 cit != system_formats.end(); ++cit)
2393 if (!formats.getFormat(cit->name()))
2394 os << "\\format \"" << cit->name()
2395 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2398 case RC_DEFAULT_VIEW_FORMAT:
2399 if (ignore_system_lyxrc ||
2400 default_view_format != system_lyxrc.default_view_format) {
2401 os << "\\default_view_format " << default_view_format << '\n';
2411 << "# CONVERTERS SECTION ##########################\n"
2415 // Look for new converters
2416 for (Converters::const_iterator cit = theConverters().begin();
2417 cit != theConverters().end(); ++cit) {
2418 Converter const * converter =
2419 theSystemConverters().getConverter(cit->from,
2422 converter->command != cit->command ||
2423 converter->flags != cit->flags)
2424 os << "\\converter \"" << cit->from << "\" \""
2425 << cit->to << "\" \""
2426 << escapeCommand(cit->command) << "\" \""
2427 << cit->flags << "\"\n";
2430 // New/modifed converters
2431 for (Converters::const_iterator cit = theSystemConverters().begin();
2432 cit != theSystemConverters().end(); ++cit)
2433 if (!theConverters().getConverter(cit->from, cit->to))
2434 os << "\\converter \"" << cit->from
2435 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2442 << "# COPIERS SECTION ##########################\n"
2445 // Look for new movers
2446 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2447 Movers::const_iterator const sysend = theSystemMovers().end();
2448 Movers::const_iterator it = theMovers().begin();
2449 Movers::const_iterator end = theMovers().end();
2451 for (; it != end; ++it) {
2452 Movers::const_iterator const sysit =
2453 find_if(sysbegin, sysend, SameMover(*it));
2454 if (sysit == sysend) {
2455 string const & fmt = it->first;
2456 string const & command =
2457 it->second.command();
2459 os << "\\copier " << fmt
2460 << " \"" << escapeCommand(command) << "\"\n";
2466 // We don't actually delete SpecialisedMover(s) from the
2467 // map, just clear their 'command', so there's no need
2468 // to test for anything else.
2476 string const LyXRC::getDescription(LyXRCTags tag)
2481 case RC_ACCEPT_COMPOUND:
2482 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2486 case RC_USE_ALT_LANG:
2487 str = _("Specify an alternate language. The default is to use the language of the document.");
2490 case RC_PLAINTEXT_ROFF_COMMAND:
2491 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.");
2494 case RC_PLAINTEXT_LINELEN:
2495 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.");
2498 case RC_AUTOREGIONDELETE:
2499 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2502 case RC_AUTORESET_OPTIONS:
2503 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2507 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2510 case RC_AUTO_NUMBER:
2513 case RC_BACKUPDIR_PATH:
2514 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.");
2517 case RC_BIBTEX_COMMAND:
2518 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2522 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2525 case RC_CHECKLASTFILES:
2526 str = _("Select to check whether the lastfiles still exist.");
2529 case RC_CHKTEX_COMMAND:
2530 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2539 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2540 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.");
2543 case RC_SCROLL_BELOW_DOCUMENT:
2544 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");
2547 case RC_MAC_LIKE_WORD_MOVEMENT:
2548 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2551 case RC_SHOW_MACRO_LABEL:
2552 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2555 case RC_CUSTOM_EXPORT_COMMAND:
2558 case RC_CUSTOM_EXPORT_FORMAT:
2561 case RC_DATE_INSERT_FORMAT:
2562 //xgettext:no-c-format
2563 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2567 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2570 case RC_DEFAULT_VIEW_FORMAT:
2571 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2574 case RC_DEFAULT_LANGUAGE:
2575 str = _("New documents will be assigned this language.");
2578 case RC_DEFAULT_PAPERSIZE:
2579 str = _("Specify the default paper size.");
2582 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2583 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2586 case RC_DISPLAY_GRAPHICS:
2587 str = _("Select how LyX will display any graphics.");
2590 case RC_DOCUMENTPATH:
2591 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2595 case RC_USE_ESC_CHARS:
2596 str = _("Specify additional chars that can be part of a word.");
2599 case RC_EXAMPLEPATH:
2600 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2603 case RC_FONT_ENCODING:
2604 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2610 case RC_INDEX_COMMAND:
2611 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\".");
2614 case RC_NOMENCL_COMMAND:
2615 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2622 case RC_KBMAP_PRIMARY:
2623 case RC_KBMAP_SECONDARY:
2624 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.");
2627 case RC_LABEL_INIT_LENGTH:
2628 str = _("Maximum number of words in the initialization string for a new label");
2631 case RC_LANGUAGE_AUTO_BEGIN:
2632 str = _("Select if a language switching command is needed at the beginning of the document.");
2635 case RC_LANGUAGE_AUTO_END:
2636 str = _("Select if a language switching command is needed at the end of the document.");
2639 case RC_LANGUAGE_COMMAND_BEGIN:
2640 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.");
2643 case RC_LANGUAGE_COMMAND_END:
2644 str = _("The LaTeX command for changing back to the language of the document.");
2647 case RC_LANGUAGE_COMMAND_LOCAL:
2648 str = _("The LaTeX command for local changing of the language.");
2651 case RC_LANGUAGE_GLOBAL_OPTIONS:
2652 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2655 case RC_LANGUAGE_PACKAGE:
2656 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2659 case RC_LANGUAGE_USE_BABEL:
2660 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2663 case RC_USELASTFILEPOS:
2664 str = _("De-select if you do not want LyX to scroll to saved position.");
2667 case RC_LOADSESSION:
2668 str = _("De-select to prevent loading files opened from the last LyX session.");
2671 case RC_MAKE_BACKUP:
2672 str = _("De-select if you don't want LyX to create backup files.");
2675 case RC_MARK_FOREIGN_LANGUAGE:
2676 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2679 case RC_MOUSE_WHEEL_SPEED:
2680 str = bformat(_("The scrolling speed of the mouse wheel."),
2684 case RC_COMPLETION_POPUP_DELAY:
2685 str = _("The completion popup delay.");
2688 case RC_COMPLETION_POPUP_MATH:
2689 str = _("Select to display the completion popup in math mode.");
2692 case RC_COMPLETION_POPUP_TEXT:
2693 str = _("Select to display the completion popup in text mode.");
2696 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2697 str = _("Show the completion popup without delay after non-unique completion attempt.");
2700 case RC_COMPLETION_POPUP_TEXT:
2701 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2704 case RC_COMPLETION_POPUP_DELAY:
2705 str = _("The inline completion delay.");
2708 case RC_COMPLETION_INLINE_MATH:
2709 str = _("Select to display the inline completion in math mode.");
2712 case RC_COMPLETION_INLINE_TEXT:
2713 str = _("Select to display the inline completion in text mode.");
2716 case RC_COMPLETION_INLINE_DOTS:
2717 str = _("Use \"...\" to shorten long completions.");
2720 case RC_AUTOCORRECTION_MATH:
2721 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2724 case RC_NUMLASTFILES:
2725 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
2729 case RC_PATH_PREFIX:
2730 str = _("Specify those directories which should be "
2731 "prepended to the PATH environment variable. "
2732 "Use the OS native format.");
2736 case RC_USE_PERS_DICT:
2737 str = _("Specify an alternate personal dictionary file. E.g. \".aspell_english\".");
2741 str = _("Shows a typeset preview of things such as math");
2744 case RC_PREVIEW_HASHED_LABELS:
2745 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
2748 case RC_PREVIEW_SCALE_FACTOR:
2749 str = _("Scale the preview size to suit.");
2752 case RC_PRINTCOLLCOPIESFLAG:
2753 str = _("The option for specifying whether the copies should be collated.");
2756 case RC_PRINTCOPIESFLAG:
2757 str = _("The option for specifying the number of copies to print.");
2761 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
2764 case RC_PRINTEVENPAGEFLAG:
2765 str = _("The option to print only even pages.");
2768 case RC_PRINTEXSTRAOPTIONS:
2769 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
2772 case RC_PRINTFILEEXTENSION:
2773 str = _("Extension of printer program output file. Usually \".ps\".");
2776 case RC_PRINTLANDSCAPEFLAG:
2777 str = _("The option to print out in landscape.");
2780 case RC_PRINTODDPAGEFLAG:
2781 str = _("The option to print only odd pages.");
2784 case RC_PRINTPAGERANGEFLAG:
2785 str = _("The option for specifying a comma-separated list of pages to print.");
2788 case RC_PRINTPAPERDIMENSIONFLAG:
2789 str = _("Option to specify the dimensions of the print paper.");
2792 case RC_PRINTPAPERFLAG:
2793 str = _("The option to specify paper type.");
2796 case RC_PRINTREVERSEFLAG:
2797 str = _("The option to reverse the order of the pages printed.");
2800 case RC_PRINTSPOOL_COMMAND:
2801 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.");
2804 case RC_PRINTSPOOL_PRINTERPREFIX:
2805 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.");
2808 case RC_PRINTTOFILE:
2809 str = _("Option to pass to the print program to print to a file.");
2812 case RC_PRINTTOPRINTER:
2813 str = _("Option to pass to the print program to print on a specific printer.");
2816 case RC_PRINT_ADAPTOUTPUT:
2817 str = _("Select for LyX to pass the name of the destination printer to your print command.");
2820 case RC_PRINT_COMMAND:
2821 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
2824 case RC_RTL_SUPPORT:
2825 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
2828 case RC_VISUAL_CURSOR:
2829 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
2833 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
2836 case RC_SCREEN_FONT_ROMAN:
2837 case RC_SCREEN_FONT_SANS:
2838 case RC_SCREEN_FONT_TYPEWRITER:
2839 str = _("The screen fonts used to display the text while editing.");
2842 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
2843 case RC_SCREEN_FONT_SANS_FOUNDRY:
2844 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2847 case RC_SCREEN_FONT_SCALABLE:
2848 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.");
2851 case RC_SCREEN_FONT_SIZES:
2852 str = _("The font sizes used for calculating the scaling of the screen fonts.");
2855 case RC_SCREEN_ZOOM:
2856 //xgettext:no-c-format
2857 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
2860 case RC_GEOMETRY_SESSION:
2861 str = _("Allow session manager to save and restore windows geometry.");
2865 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
2871 case RC_SHOW_BANNER:
2872 str = _("De-select if you don't want the startup banner.");
2875 case RC_TEMPDIRPATH:
2876 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
2879 case RC_THESAURUSDIRPATH:
2880 str = _("This is the place where the files of the thesaurus library reside.");
2883 case RC_TEMPLATEPATH:
2884 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
2887 case RC_TEX_ALLOWS_SPACES:
2890 case RC_TEX_EXPECTS_WINDOWS_PATHS:
2894 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
2906 case RC_USE_INP_ENC:
2907 str = _("Specify whether to pass the -T input encoding option to aspell. Enable this if you cannot check the spelling of words containing accented letters. This may not work with all dictionaries.");
2910 case RC_USE_TOOLTIP:
2911 str = _("Enable the automatic appearance of tool tips in the work area.");
2914 case RC_USE_PIXMAP_CACHE:
2915 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
2918 case RC_USE_SPELL_LIB:
2921 case RC_VIEWDVI_PAPEROPTION:
2922 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
2937 // The global instance
2940 // The global copy of the system lyxrc entries (everything except preferences)