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.
21 #include "BufferList.h"
23 #include "Converter.h"
24 #include "FontEnums.h"
27 #include "FuncRequest.h"
32 #include "SpellChecker.h"
35 #include "graphics/GraphicsTypes.h"
37 #include "support/convert.h"
38 #include "support/debug.h"
39 #include "support/environment.h"
40 #include "support/FileName.h"
41 #include "support/filetools.h"
42 #include "support/gettext.h"
43 #include "support/lstrings.h"
44 #include "support/os.h"
45 #include "support/Package.h"
46 #include "support/TempFile.h"
47 #include "support/userinfo.h"
54 using namespace lyx::support;
58 namespace os = support::os;
62 // The format should also be updated in configure.py, and conversion code
63 // should be added to prefs2prefs_prefs.py.
64 static unsigned int const LYXRC_FILEFORMAT = 29; // spitz: remove \\date_insert_format
65 // when adding something to this array keep it sorted!
66 LexerKeyword lyxrcTags[] = {
67 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
68 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
69 { "\\alternate_language", LyXRC::RC_ALT_LANG },
70 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
71 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
72 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
73 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
74 { "\\autosave", LyXRC::RC_AUTOSAVE },
75 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
76 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
77 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
78 { "\\bind_file", LyXRC::RC_BINDFILE },
79 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
80 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
81 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
82 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
83 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
84 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
85 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
86 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
87 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
88 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
89 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
90 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
91 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
92 { "\\converter", LyXRC::RC_CONVERTER },
93 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
94 { "\\copier", LyXRC::RC_COPIER },
95 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
96 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
97 { "\\def_file", LyXRC::RC_DEFFILE },
98 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
99 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
100 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
101 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
102 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
103 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
104 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
105 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
106 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
107 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
108 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
109 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
110 { "\\format", LyXRC::RC_FILEFORMAT },
111 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
112 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
113 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
114 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
115 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
116 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
117 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
118 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
119 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
120 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
121 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
122 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
123 { "\\icon_set", LyXRC::RC_ICON_SET },
124 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
125 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
126 { "\\input", LyXRC::RC_INPUT },
127 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
128 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
129 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
130 { "\\kbmap", LyXRC::RC_KBMAP },
131 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
132 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
133 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
134 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
135 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
136 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
137 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
138 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
139 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
140 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
141 { "\\load_session", LyXRC::RC_LOADSESSION },
142 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
143 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
144 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
145 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
146 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
147 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
148 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
149 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
150 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
151 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
152 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
153 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
154 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
155 { "\\preview", LyXRC::RC_PREVIEW },
156 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
157 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
160 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
161 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
162 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
163 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
164 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
165 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
166 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
167 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
168 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
169 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
170 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
171 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
172 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
173 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
174 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
175 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
176 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
177 { "\\set_color", LyXRC::RC_SET_COLOR },
178 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
179 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
180 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
181 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
182 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
183 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
184 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
185 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
186 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
187 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
188 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
189 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
190 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
191 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
192 { "\\ui_file", LyXRC::RC_UIFILE },
193 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
194 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
195 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
196 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
197 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
198 // compatibility with versions older than 1.4.0 only
199 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
200 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
201 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
202 { "\\user_email", LyXRC::RC_USER_EMAIL },
203 { "\\user_name", LyXRC::RC_USER_NAME },
204 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
205 // compatibility with versions older than 1.4.0 only
206 { "\\viewer", LyXRC::RC_VIEWER},
207 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
208 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
209 { "format", LyXRC::RC_LYXRCFORMAT }
212 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
215 void oldFontFormat(string & family, string & foundry)
217 if (family.empty() || family[0] != '-')
219 foundry = token(family, '-', 1);
220 family = token(family, '-', 2);
228 bool LyXRC::read(FileName const & filename, bool check_format)
230 Lexer lexrc(lyxrcTags);
231 lexrc.setFile(filename);
232 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
233 ReturnValues retval = read(lexrc, check_format);
234 if (!check_format || retval != FormatMismatch)
235 return retval == ReadOK;
237 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
238 TempFile tmp("convert_lyxrc");
239 FileName const tempfile = tmp.name();
240 bool const success = prefs2prefs(filename, tempfile, false);
242 LYXERR0 ("Unable to convert " << filename.absFileName() <<
243 " to format " << LYXRC_FILEFORMAT);
246 // Keep this in the else branch, such that lexrc2 goes out
247 // of scope and releases the lock on tempfile before we
248 // attempt to remove it. This matters on Windows.
249 Lexer lexrc2(lyxrcTags);
250 lexrc2.setFile(tempfile);
251 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
252 retval = read(lexrc2, check_format);
253 if (retval == FormatMismatch)
254 LYXERR0("Conversion failed for " << filename.absFileName());
256 return retval == ReadOK;
260 // don't need to worry about conversion, because this is always
261 // from an internal source
262 bool LyXRC::read(istream & is)
264 Lexer lexrc(lyxrcTags);
266 LYXERR(Debug::LYXRC, "Reading istream...");
267 return read(lexrc, false) == ReadOK;
271 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
273 if (lyxerr.debugging(Debug::PARSER))
274 lexrc.printTable(lyxerr);
279 // format prior to 2.0 and introduction of format tag
280 unsigned int rc_format = 0;
282 while (lexrc.isOK()) {
283 // By using two switches we take advantage of the compiler
284 // telling us if we have missed a LyXRCTags element in
285 // the second switch.
286 // Note that this also shows a problem with Lexer since it
287 // helps us avoid taking advantage of the strictness of the
290 int le = lexrc.lex();
292 case Lexer::LEX_UNDEF:
293 lexrc.printError("Unknown tag `$$Token'");
295 case Lexer::LEX_FEOF:
300 switch (static_cast<LyXRCTags>(le)) {
303 rc_format = lexrc.getInteger();
305 case RC_INPUT: // Include file
308 libFileSearch(string(),
310 if (!read(tmp, check_format)) {
312 "Error reading included file: " + tmp.absFileName());
318 bind_file = os::internal_path(lexrc.getString());
323 def_file = os::internal_path(lexrc.getString());
328 ui_file = os::internal_path(lexrc.getString());
331 case RC_AUTORESET_OPTIONS:
332 lexrc >> auto_reset_options;
335 case RC_DISPLAY_GRAPHICS:
337 display_graphics = lexrc.getString() == "true";
340 case RC_TEX_EXPECTS_WINDOWS_PATHS:
341 lexrc >> windows_style_tex_paths;
344 case RC_TEX_ALLOWS_SPACES:
345 lexrc >> tex_allows_spaces;
348 case RC_TEXINPUTS_PREFIX:
349 lexrc >> texinputs_prefix;
356 case RC_KBMAP_PRIMARY:
358 string const kmap(os::internal_path(lexrc.getString()));
359 if (!libFileSearch("kbd", kmap, "kmap").empty()
361 primary_kbmap = kmap;
363 lexrc.printError("LyX: Keymap `$$Token' not found");
368 case RC_KBMAP_SECONDARY:
370 string const kmap(os::internal_path(lexrc.getString()));
371 if (!libFileSearch("kbd", kmap, "kmap").empty()
373 secondary_kbmap = kmap;
375 lexrc.printError("LyX: Keymap `$$Token' not found");
380 case RC_PRINTLANDSCAPEFLAG:
381 lexrc >> print_landscape_flag;
384 case RC_PRINTPAPERDIMENSIONFLAG:
385 lexrc >> print_paper_dimension_flag;
388 case RC_PRINTPAPERFLAG:
389 lexrc >> print_paper_flag;
392 case RC_PYGMENTIZE_COMMAND:
393 if (lexrc.next(true)) {
394 pygmentize_command = lexrc.getString();
398 case RC_VIEWDVI_PAPEROPTION:
400 view_dvi_paper_option = lexrc.getString();
402 view_dvi_paper_option.erase();
405 case RC_CHKTEX_COMMAND:
406 if (lexrc.next(true)) {
407 chktex_command = lexrc.getString();
411 case RC_BIBTEX_ALTERNATIVES:
412 if (lexrc.next(true)) {
413 bibtex_alternatives.insert(lexrc.getString());
417 case RC_BIBTEX_COMMAND:
418 if (lexrc.next(true)) {
419 bibtex_command = lexrc.getString();
423 case RC_JBIBTEX_COMMAND:
424 if (lexrc.next(true)) {
425 jbibtex_command = lexrc.getString();
429 case RC_JBIBTEX_ALTERNATIVES:
430 if (lexrc.next(true)) {
431 jbibtex_alternatives.insert(lexrc.getString());
435 case RC_INDEX_ALTERNATIVES:
436 if (lexrc.next(true)) {
437 index_alternatives.insert(lexrc.getString());
441 case RC_INDEX_COMMAND:
442 if (lexrc.next(true)) {
443 index_command = lexrc.getString();
447 case RC_JINDEX_COMMAND:
448 if (lexrc.next(true)) {
449 jindex_command = lexrc.getString();
453 case RC_SPLITINDEX_COMMAND:
454 if (lexrc.next(true)) {
455 splitindex_command = lexrc.getString();
459 case RC_NOMENCL_COMMAND:
460 if (lexrc.next(true)) {
461 nomencl_command = lexrc.getString();
470 lexrc >> defaultZoom;
471 if (defaultZoom < 10)
475 case RC_GEOMETRY_SESSION:
476 lexrc >> allow_geometry_session;
479 case RC_SCREEN_FONT_SIZES:
480 lexrc >> font_sizes[TINY_SIZE];
481 lexrc >> font_sizes[SCRIPT_SIZE];
482 lexrc >> font_sizes[FOOTNOTE_SIZE];
483 lexrc >> font_sizes[SMALL_SIZE];
484 lexrc >> font_sizes[NORMAL_SIZE];
485 lexrc >> font_sizes[LARGE_SIZE];
486 lexrc >> font_sizes[LARGER_SIZE];
487 lexrc >> font_sizes[LARGEST_SIZE];
488 lexrc >> font_sizes[HUGE_SIZE];
489 lexrc >> font_sizes[HUGER_SIZE];
492 case RC_SCREEN_FONT_SCALABLE:
493 lexrc >> use_scalable_fonts;
500 case RC_DOCUMENTPATH:
502 document_path = os::internal_path(lexrc.getString());
507 example_path = os::internal_path(lexrc.getString());
510 case RC_TEMPLATEPATH:
512 template_path = os::internal_path(lexrc.getString());
517 tempdir_path = os::internal_path(lexrc.getString());
520 case RC_THESAURUSDIRPATH:
522 thesaurusdir_path = os::internal_path(lexrc.getString());
525 case RC_HUNSPELLDIR_PATH:
527 hunspelldir_path = os::internal_path(lexrc.getString());
530 case RC_USELASTFILEPOS:
531 lexrc >> use_lastfilepos;
535 lexrc >> load_session;
538 case RC_MOUSE_WHEEL_SPEED:
539 lexrc >> mouse_wheel_speed;
542 case RC_COMPLETION_INLINE_DELAY:
543 lexrc >> completion_inline_delay;
546 case RC_COMPLETION_INLINE_MATH:
547 lexrc >> completion_inline_math;
550 case RC_COMPLETION_INLINE_TEXT:
551 lexrc >> completion_inline_text;
554 case RC_COMPLETION_INLINE_DOTS:
555 lexrc >> completion_inline_dots;
558 case RC_AUTOCORRECTION_MATH:
559 lexrc >> autocorrection_math;
562 case RC_COMPLETION_POPUP_DELAY:
563 lexrc >> completion_popup_delay;
566 case RC_COMPLETION_POPUP_MATH:
567 lexrc >> completion_popup_math;
570 case RC_COMPLETION_POPUP_TEXT:
571 lexrc >> completion_popup_text;
574 case RC_COMPLETION_CURSOR_TEXT:
575 lexrc >> completion_cursor_text;
578 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
579 lexrc >> completion_popup_after_complete;
582 case RC_COMPLETION_MINLENGTH:
583 lexrc >> completion_minlength;
586 case RC_NUMLASTFILES:
587 lexrc >> num_lastfiles;
590 case RC_CHECKLASTFILES:
591 lexrc >> check_lastfiles;
598 case RC_USE_SYSTEM_THEME_ICONS:
599 lexrc >> use_system_theme_icons;
602 case RC_SCREEN_FONT_ROMAN:
604 roman_font_name = lexrc.getString();
605 oldFontFormat(roman_font_name,
610 case RC_SCREEN_FONT_SANS:
612 sans_font_name = lexrc.getString();
613 oldFontFormat(sans_font_name, sans_font_foundry);
617 case RC_SCREEN_FONT_TYPEWRITER:
619 typewriter_font_name = lexrc.getString();
620 oldFontFormat(typewriter_font_name,
621 typewriter_font_foundry);
625 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
626 lexrc >> roman_font_foundry;
629 case RC_SCREEN_FONT_SANS_FOUNDRY:
630 lexrc >> sans_font_foundry;
633 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
634 lexrc >> typewriter_font_foundry;
639 lexrc.printError("Missing color tag.");
642 string lyx_name = lexrc.getString();
645 lexrc.printError("Missing color name for color: `$$Token'");
648 string x11_name = lexrc.getString();
650 ColorCode const col =
651 lcolor.getFromLyXName(lyx_name);
652 if (col == Color_none ||
653 col == Color_inherit ||
657 if (!lcolor.setColor(col, x11_name))
658 LYXERR0("Bad lyxrc set_color for " << lyx_name);
662 case RC_AUTOREGIONDELETE:
663 // Auto region delete defaults to true
664 lexrc >> auto_region_delete;
669 lyxpipes = os::internal_path(lexrc.getString());
672 case RC_CURSOR_FOLLOWS_SCROLLBAR:
673 lexrc >> cursor_follows_scrollbar;
676 case RC_CURSOR_WIDTH:
677 lexrc >> cursor_width;
680 case RC_SCROLL_BELOW_DOCUMENT:
681 lexrc >> scroll_below_document;
684 case RC_PARAGRAPH_MARKERS:
685 lexrc >> paragraph_markers;
688 case RC_MAC_DONTSWAP_CTRL_META:
689 lexrc >> mac_dontswap_ctrl_meta;
692 case RC_MAC_LIKE_CURSOR_MOVEMENT:
693 lexrc >> mac_like_cursor_movement;
696 case RC_MACRO_EDIT_STYLE:
698 switch (lexrc.getInteger()) {
699 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
700 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
701 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
706 case RC_DIALOGS_ICONIFY_WITH_MAIN:
707 lexrc >> dialogs_iconify_with_main;
710 case RC_PLAINTEXT_LINELEN:
711 lexrc >> plaintext_linelen;
713 // Spellchecker settings:
714 case RC_ACCEPT_COMPOUND:
715 lexrc >> spellchecker_accept_compound;
717 case RC_USE_NATIVE_FILEDIALOG:
718 lexrc >> use_native_filedialog;
720 case RC_USE_SYSTEM_COLORS:
721 lexrc >> use_system_colors;
724 lexrc >> use_tooltip;
726 case RC_SPELLCHECKER:
727 lexrc >> spellchecker;
730 lexrc >> spellchecker_alt_lang;
733 lexrc >> spellchecker_esc_chars;
735 case RC_SPELLCHECK_CONTINUOUSLY:
736 lexrc >> spellcheck_continuously;
738 case RC_SPELLCHECK_NOTES:
739 lexrc >> spellcheck_notes;
742 lexrc >> make_backup;
744 case RC_SAVE_COMPRESSED:
745 lexrc >> save_compressed;
748 lexrc >> save_origin;
750 case RC_BACKUPDIR_PATH:
752 backupdir_path = os::internal_path(lexrc.getString());
754 case RC_DEFAULT_DECIMAL_POINT:
755 lexrc >> default_decimal_point;
757 case RC_DEFAULT_LENGTH_UNIT:
759 default_length_unit = (Length::UNIT) lexrc.getInteger();
761 case RC_LANGUAGE_CUSTOM_PACKAGE:
762 lexrc >> language_custom_package;
764 case RC_LANGUAGE_AUTO_BEGIN:
765 lexrc >> language_auto_begin;
767 case RC_LANGUAGE_AUTO_END:
768 lexrc >> language_auto_end;
770 case RC_LANGUAGE_GLOBAL_OPTIONS:
771 lexrc >> language_global_options;
773 case RC_LANGUAGE_PACKAGE_SELECTION:
775 switch (lexrc.getInteger()) {
777 language_package_selection = LP_AUTO;
780 language_package_selection = LP_BABEL;
783 language_package_selection = LP_CUSTOM;
786 language_package_selection = LP_NONE;
791 case RC_LANGUAGE_COMMAND_BEGIN:
792 lexrc >> language_command_begin;
794 case RC_LANGUAGE_COMMAND_END:
795 lexrc >> language_command_end;
797 case RC_LANGUAGE_COMMAND_LOCAL:
798 lexrc >> language_command_local;
800 case RC_VISUAL_CURSOR:
801 lexrc >> visual_cursor;
803 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
804 lexrc >> close_buffer_with_last_view;
807 lexrc >> auto_number;
809 case RC_MARK_FOREIGN_LANGUAGE:
810 lexrc >> mark_foreign_language;
816 fmt = lexrc.getString();
817 if (lexrc.next(true))
818 command = lexrc.getString();
819 setMover(fmt, command);
824 string from, to, command, flags;
826 from = lexrc.getString();
828 to = lexrc.getString();
829 if (lexrc.next(true))
830 command = lexrc.getString();
832 flags = lexrc.getString();
834 theConverters().erase(from, to);
836 theConverters().add(from, to, command, flags);
839 // compatibility with versions older than 1.4.0 only
841 string format, command;
842 lexrc >> format >> command;
843 theFormats().setViewer(format, command);
846 case RC_FILEFORMAT: {
848 string format, extensions, shortcut;
849 docstring prettyname;
850 if (!(lexrc >> format >> extensions))
852 if (ok && lexrc.next(true))
853 prettyname = lexrc.getDocString();
857 if(!(lexrc >> shortcut))
859 string viewer, editor;
860 if (ok && lexrc.next(true))
861 viewer = lexrc.getString();
864 if (ok && lexrc.next(true))
865 editor = lexrc.getString();
869 if (!(lexrc >> flags >> mime))
871 int flgs = Format::none;
872 while (!flags.empty()) {
874 flags = split(flags, flag, ',');
875 if (flag == "document")
876 flgs |= Format::document;
877 else if (flag == "vector")
878 flgs |= Format::vector;
879 else if (flag == "zipped=native")
880 flgs |= Format::zipped_native;
881 else if (flag == "menu=export")
882 flgs |= Format::export_menu;
884 LYXERR0("Ignoring unknown flag `"
885 << flag << "' for format `"
889 LYXERR0("Syntax error in format " << format);
890 else if (prettyname.empty()) {
891 if (theConverters().formatIsUsed(format))
892 LYXERR0("Can't delete format " << format);
894 theFormats().erase(format);
896 theFormats().add(format, extensions, prettyname,
897 shortcut, viewer, editor, mime, flgs);
901 case RC_VIEWER_ALTERNATIVES: {
902 string format, command;
903 if ((lexrc >> format) && lexrc.next(true)) {
904 command = lexrc.getString();
905 viewer_alternatives[format].insert(command);
909 case RC_EDITOR_ALTERNATIVES: {
910 string format, command;
911 if ((lexrc >> format) && lexrc.next(true)) {
912 command = lexrc.getString();
913 editor_alternatives[format].insert(command);
918 case RC_DEFAULT_OTF_VIEW_FORMAT:
919 lexrc >> default_otf_view_format;
922 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
923 lexrc >> default_platex_view_format;
926 case RC_DEFAULT_VIEW_FORMAT:
927 lexrc >> default_view_format;
930 case RC_GUI_LANGUAGE:
931 lexrc >> gui_language;
935 lexrc >> show_banner;
940 string const tmp = lexrc.getString();
941 if (tmp == "true" || tmp == "on")
942 preview = PREVIEW_ON;
943 else if (tmp == "no_math")
944 preview = PREVIEW_NO_MATH;
946 preview = PREVIEW_OFF;
947 if (tmp != "false" && tmp != "off")
948 LYXERR0("Unrecognized preview status \""
954 case RC_PREVIEW_HASHED_LABELS:
955 lexrc >> preview_hashed_labels;
958 case RC_PREVIEW_SCALE_FACTOR:
959 lexrc >> preview_scale_factor;
970 lexrc >> path_prefix;
973 case RC_USE_CONVERTER_CACHE:
974 lexrc >> use_converter_cache;
976 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
977 lexrc >> use_converter_needauth_forbidden;
979 case RC_USE_CONVERTER_NEEDAUTH:
980 lexrc >> use_converter_needauth;
982 case RC_CONVERTER_CACHE_MAXAGE:
983 lexrc >> converter_cache_maxage;
986 case RC_SORT_LAYOUTS:
987 lexrc >> sort_layouts;
989 case RC_GROUP_LAYOUTS:
990 lexrc >> group_layouts;
992 case RC_FULL_SCREEN_LIMIT:
993 lexrc >> full_screen_limit;
995 case RC_FULL_SCREEN_TOOLBARS:
996 lexrc >> full_screen_toolbars;
998 case RC_FULL_SCREEN_SCROLLBAR:
999 lexrc >> full_screen_scrollbar;
1001 case RC_FULL_SCREEN_STATUSBAR:
1002 lexrc >> full_screen_statusbar;
1004 case RC_FULL_SCREEN_TABBAR:
1005 lexrc >> full_screen_tabbar;
1007 case RC_FULL_SCREEN_MENUBAR:
1008 lexrc >> full_screen_menubar;
1010 case RC_FULL_SCREEN_WIDTH:
1011 lexrc >> full_screen_width;
1013 case RC_OPEN_BUFFERS_IN_TABS:
1014 lexrc >> open_buffers_in_tabs;
1016 case RC_SINGLE_CLOSE_TAB_BUTTON:
1017 lexrc >> single_close_tab_button;
1019 case RC_SINGLE_INSTANCE:
1020 lexrc >> single_instance;
1021 if (run_mode == PREFERRED)
1022 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1024 case RC_FORWARD_SEARCH_DVI:
1025 if (lexrc.next(true))
1026 forward_search_dvi = lexrc.getString();
1028 case RC_FORWARD_SEARCH_PDF:
1029 if (lexrc.next(true))
1030 forward_search_pdf = lexrc.getString();
1032 case RC_EXPORT_OVERWRITE:
1034 string const tmp = lexrc.getString();
1035 if (tmp == "all" || tmp == "true")
1036 export_overwrite = ALL_FILES;
1037 else if (tmp == "main")
1038 export_overwrite = MAIN_FILE;
1040 export_overwrite = NO_FILES;
1041 if (tmp != "ask" && tmp != "false")
1042 LYXERR0("Unrecognized export_overwrite status \""
1047 case RC_SCROLL_WHEEL_ZOOM:
1049 string const tmp = lexrc.getString();
1051 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1052 else if (tmp == "shift")
1053 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1054 else if (tmp == "alt")
1055 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1057 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1058 if (tmp != "off" && tmp != "false")
1059 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1065 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1066 lexrc >> mouse_middlebutton_paste;
1070 break; // this is just a dummy
1073 // This is triggered the first time through the loop unless
1074 // we hit a format tag.
1075 if (check_format && rc_format != LYXRC_FILEFORMAT)
1076 return FormatMismatch;
1079 /// Update converters data-structures
1080 theConverters().update(theFormats());
1081 theConverters().buildGraph();
1082 theBufferList().invalidateConverterCache();
1088 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1090 ofstream ofs(filename.toFilesystemEncoding().c_str());
1092 write(ofs, ignore_system_lyxrc);
1096 void LyXRC::print() const
1098 if (lyxerr.debugging())
1099 write(lyxerr, false);
1107 typedef pair<string, SpecialisedMover> Data;
1109 SameMover(Data const & comparison)
1110 : comparison_(comparison) {}
1112 bool operator()(Data const & data) const
1114 return data.first == comparison_.first &&
1115 data.second.command() == comparison_.second.command();
1125 // Escape \ and " so that LyXLex can read the string later
1126 string escapeCommand(string const & str) {
1127 return subst(subst(str , "\\", "\\\\"),
1134 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1136 LyXRCTags tag = RC_LAST;
1138 if (!name.empty()) {
1139 for (int i = 0; i != lyxrcCount; ++i)
1140 if ("\\" + name == lyxrcTags[i].tag)
1141 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1145 os << "# LyX " << lyx_version
1146 << " generated this file. If you want to make your own\n"
1147 << "# modifications you should do them from inside LyX and save.\n\n"
1148 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1150 // Why the switch you might ask. It is a trick to ensure that all
1151 // the elements in the LyXRCTags enum are handled. As you can see
1152 // there are no breaks at all. So it is just a huge fall-through.
1153 // The nice thing is that we will get a warning from the compiler
1154 // if we forget an element.
1158 // input/include files are not done here
1159 case RC_LYXRCFORMAT:
1161 if (ignore_system_lyxrc ||
1162 bind_file != system_lyxrc.bind_file) {
1163 string const path = os::external_path(bind_file);
1164 os << "\\bind_file \"" << path << "\"\n";
1170 if (ignore_system_lyxrc ||
1171 def_file != system_lyxrc.def_file) {
1172 string const path = os::external_path(def_file);
1173 os << "\\def_file \"" << path << "\"\n";
1182 << "# MISC SECTION ######################################\n"
1184 // bind files are not done here.
1186 case RC_PATH_PREFIX:
1187 if (ignore_system_lyxrc ||
1188 path_prefix != system_lyxrc.path_prefix) {
1189 os << "\\path_prefix \"" << path_prefix << "\"\n";
1195 if (ignore_system_lyxrc ||
1196 ui_file != system_lyxrc.ui_file) {
1197 string const path = os::external_path(ui_file);
1198 os << "\\ui_file \"" << path << "\"\n";
1203 case RC_AUTOREGIONDELETE:
1204 if (ignore_system_lyxrc ||
1205 auto_region_delete != system_lyxrc.auto_region_delete) {
1206 os << "# Set to false to inhibit automatic replacement of\n"
1207 << "# the current selection.\n"
1208 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1214 case RC_AUTORESET_OPTIONS:
1215 if (ignore_system_lyxrc ||
1216 auto_reset_options != system_lyxrc.auto_reset_options) {
1217 os << "# Set to false to inhibit automatic reset of\n"
1218 << "# the class options to defaults on class change.\n"
1219 << "\\auto_reset_options "
1220 << convert<string>(auto_reset_options)
1227 if (ignore_system_lyxrc ||
1228 autosave != system_lyxrc.autosave) {
1229 os << "# The time interval between auto-saves in seconds.\n"
1230 << "\\autosave " << autosave << '\n';
1235 case RC_DISPLAY_GRAPHICS:
1236 if (ignore_system_lyxrc ||
1237 display_graphics != system_lyxrc.display_graphics) {
1238 os << "# Display graphics within LyX\n"
1240 << "\\display_graphics "
1241 << (display_graphics ? "true" : "false")
1247 case RC_SORT_LAYOUTS:
1248 if (ignore_system_lyxrc ||
1249 sort_layouts != system_lyxrc.sort_layouts) {
1250 os << "# Sort layouts alphabetically.\n"
1251 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1256 case RC_GROUP_LAYOUTS:
1257 if (ignore_system_lyxrc ||
1258 group_layouts != system_lyxrc.group_layouts) {
1259 os << "# Group layouts by their category.\n"
1260 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1265 case RC_VIEWDVI_PAPEROPTION:
1266 if (ignore_system_lyxrc ||
1267 view_dvi_paper_option
1268 != system_lyxrc.view_dvi_paper_option) {
1269 os << "# Options used to specify paper size to the\n"
1270 << "# view_dvi_command (e.g. -paper)\n"
1271 << "\\view_dvi_paper_option \""
1272 << view_dvi_paper_option << "\"\n";
1277 case RC_CHKTEX_COMMAND:
1278 if (ignore_system_lyxrc ||
1279 chktex_command != system_lyxrc.chktex_command) {
1280 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1285 case RC_BIBTEX_ALTERNATIVES: {
1286 CommandSet::const_iterator it = bibtex_alternatives.begin();
1287 CommandSet::const_iterator end = bibtex_alternatives.end();
1288 for ( ; it != end; ++it) {
1289 if (ignore_system_lyxrc
1290 || !system_lyxrc.bibtex_alternatives.count(*it))
1291 os << "\\bibtex_alternatives \""
1298 case RC_BIBTEX_COMMAND:
1299 if (ignore_system_lyxrc ||
1300 bibtex_command != system_lyxrc.bibtex_command) {
1301 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1306 case RC_JBIBTEX_COMMAND:
1307 if (ignore_system_lyxrc ||
1308 jbibtex_command != system_lyxrc.jbibtex_command) {
1309 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1314 case RC_JBIBTEX_ALTERNATIVES: {
1315 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1316 CommandSet::const_iterator end = jbibtex_alternatives.end();
1317 for ( ; it != end; ++it) {
1318 if (ignore_system_lyxrc
1319 || !system_lyxrc.jbibtex_alternatives.count(*it))
1320 os << "\\jbibtex_alternatives \""
1327 case RC_INDEX_ALTERNATIVES: {
1328 CommandSet::const_iterator it = index_alternatives.begin();
1329 CommandSet::const_iterator end = index_alternatives.end();
1330 for ( ; it != end; ++it) {
1331 if (ignore_system_lyxrc
1332 || !system_lyxrc.index_alternatives.count(*it))
1333 os << "\\index_alternatives \""
1340 case RC_INDEX_COMMAND:
1341 if (ignore_system_lyxrc ||
1342 index_command != system_lyxrc.index_command) {
1343 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1348 case RC_JINDEX_COMMAND:
1349 if (ignore_system_lyxrc ||
1350 jindex_command != system_lyxrc.jindex_command) {
1351 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1356 case RC_SPLITINDEX_COMMAND:
1357 if (ignore_system_lyxrc ||
1358 splitindex_command != system_lyxrc.splitindex_command) {
1359 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1364 case RC_NOMENCL_COMMAND:
1365 if (ignore_system_lyxrc ||
1366 nomencl_command != system_lyxrc.nomencl_command) {
1367 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1372 case RC_PYGMENTIZE_COMMAND:
1373 if (ignore_system_lyxrc ||
1374 pygmentize_command != system_lyxrc.pygmentize_command) {
1375 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1380 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1381 // Don't write this setting to the preferences file,
1382 // but allow temporary changes (bug 7557).
1383 if (ignore_system_lyxrc) {
1384 os << "\\tex_expects_windows_paths "
1385 << convert<string>(windows_style_tex_paths) << '\n';
1390 case RC_TEX_ALLOWS_SPACES:
1391 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1392 os << "\\tex_allows_spaces "
1393 << convert<string>(tex_allows_spaces) << '\n';
1399 if (ignore_system_lyxrc ||
1400 use_kbmap != system_lyxrc.use_kbmap) {
1401 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1406 case RC_KBMAP_PRIMARY:
1407 if (ignore_system_lyxrc ||
1408 primary_kbmap != system_lyxrc.primary_kbmap) {
1409 string const path = os::external_path(primary_kbmap);
1410 os << "\\kbmap_primary \"" << path << "\"\n";
1415 case RC_KBMAP_SECONDARY:
1416 if (ignore_system_lyxrc ||
1417 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1418 string const path = os::external_path(secondary_kbmap);
1419 os << "\\kbmap_secondary \"" << path << "\"\n";
1425 if (ignore_system_lyxrc ||
1426 lyxpipes != system_lyxrc.lyxpipes) {
1427 string const path = os::external_path(lyxpipes);
1428 os << "\\serverpipe \"" << path << "\"\n";
1434 os << "\\user_name \"" << user_name << "\"\n";
1439 os << "\\user_email \"" << user_email << "\"\n";
1443 case RC_SHOW_BANNER:
1444 if (ignore_system_lyxrc ||
1445 show_banner != system_lyxrc.show_banner) {
1446 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1452 if (ignore_system_lyxrc ||
1453 preview != system_lyxrc.preview) {
1459 case PREVIEW_NO_MATH:
1466 os << "\\preview " << status << '\n';
1471 case RC_PREVIEW_HASHED_LABELS:
1472 if (ignore_system_lyxrc ||
1473 preview_hashed_labels !=
1474 system_lyxrc.preview_hashed_labels) {
1475 os << "\\preview_hashed_labels "
1476 << convert<string>(preview_hashed_labels) << '\n';
1481 case RC_PREVIEW_SCALE_FACTOR:
1482 if (ignore_system_lyxrc ||
1483 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1484 os << "\\preview_scale_factor "
1485 << preview_scale_factor << '\n';
1490 case RC_USE_CONVERTER_CACHE:
1491 if (ignore_system_lyxrc ||
1492 use_converter_cache != system_lyxrc.use_converter_cache) {
1493 os << "\\use_converter_cache "
1494 << convert<string>(use_converter_cache) << '\n';
1499 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1500 if (ignore_system_lyxrc ||
1501 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1502 os << "\\use_converter_needauth_forbidden "
1503 << convert<string>(use_converter_needauth_forbidden) << '\n';
1508 case RC_USE_CONVERTER_NEEDAUTH:
1509 if (ignore_system_lyxrc ||
1510 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1511 os << "\\use_converter_needauth "
1512 << convert<string>(use_converter_needauth) << '\n';
1517 case RC_CONVERTER_CACHE_MAXAGE:
1518 if (ignore_system_lyxrc ||
1519 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1520 os << "\\converter_cache_maxage "
1521 << converter_cache_maxage << '\n';
1527 << "# SCREEN & FONTS SECTION ############################\n"
1531 if (ignore_system_lyxrc ||
1532 icon_set != system_lyxrc.icon_set) {
1533 os << "\\icon_set \"" << icon_set
1539 case RC_USE_SYSTEM_THEME_ICONS:
1540 if (ignore_system_lyxrc ||
1541 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1542 os << "\\use_system_theme_icons "
1543 << convert<string>(use_system_theme_icons)
1550 if (ignore_system_lyxrc ||
1551 dpi != system_lyxrc.dpi) {
1552 os << "\\screen_dpi " << dpi << '\n';
1557 case RC_SCREEN_ZOOM:
1558 if (ignore_system_lyxrc ||
1559 defaultZoom != system_lyxrc.defaultZoom) {
1560 os << "\\screen_zoom " << defaultZoom << '\n';
1565 case RC_GEOMETRY_SESSION:
1566 if (ignore_system_lyxrc ||
1567 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1568 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1574 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1575 if (ignore_system_lyxrc ||
1576 cursor_follows_scrollbar
1577 != system_lyxrc.cursor_follows_scrollbar) {
1578 os << "\\cursor_follows_scrollbar "
1579 << convert<string>(cursor_follows_scrollbar) << '\n';
1584 case RC_CURSOR_WIDTH:
1585 if (ignore_system_lyxrc ||
1587 != system_lyxrc.cursor_width) {
1588 os << "\\cursor_width "
1589 << cursor_width << '\n';
1594 case RC_SCROLL_BELOW_DOCUMENT:
1595 if (ignore_system_lyxrc ||
1596 scroll_below_document
1597 != system_lyxrc.scroll_below_document) {
1598 os << "\\scroll_below_document "
1599 << convert<string>(scroll_below_document) << '\n';
1604 case RC_PARAGRAPH_MARKERS:
1605 if (ignore_system_lyxrc ||
1607 != system_lyxrc.paragraph_markers) {
1608 os << "\\paragraph_markers "
1609 << convert<string>(paragraph_markers) << '\n';
1614 case RC_MAC_DONTSWAP_CTRL_META:
1615 if (ignore_system_lyxrc ||
1616 mac_dontswap_ctrl_meta
1617 != system_lyxrc.mac_dontswap_ctrl_meta) {
1618 os << "\\mac_dontswap_ctrl_meta "
1619 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1624 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1625 if (ignore_system_lyxrc ||
1626 mac_like_cursor_movement
1627 != system_lyxrc.mac_like_cursor_movement) {
1628 os << "\\mac_like_cursor_movement "
1629 << convert<string>(mac_like_cursor_movement) << '\n';
1634 case RC_MACRO_EDIT_STYLE:
1635 if (ignore_system_lyxrc ||
1637 != system_lyxrc.macro_edit_style) {
1638 os << "\\macro_edit_style ";
1639 switch (macro_edit_style) {
1640 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1641 case MACRO_EDIT_INLINE: os << "1\n"; break;
1642 case MACRO_EDIT_LIST: os << "2\n"; break;
1648 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1649 if (ignore_system_lyxrc ||
1650 dialogs_iconify_with_main
1651 != system_lyxrc.dialogs_iconify_with_main) {
1652 os << "\\dialogs_iconify_with_main "
1653 << 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
1667 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1668 if (ignore_system_lyxrc ||
1669 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1670 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1676 case RC_SCREEN_FONT_SANS:
1677 if (ignore_system_lyxrc ||
1678 sans_font_name != system_lyxrc.sans_font_name) {
1679 os << "\\screen_font_sans \"" << sans_font_name
1685 case RC_SCREEN_FONT_SANS_FOUNDRY:
1686 if (ignore_system_lyxrc ||
1687 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1688 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1694 case RC_SCREEN_FONT_TYPEWRITER:
1695 if (ignore_system_lyxrc ||
1696 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1697 os << "\\screen_font_typewriter \""
1698 << typewriter_font_name << "\"\n";
1703 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1704 if (ignore_system_lyxrc ||
1705 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1706 os << "\\screen_font_typewriter_foundry \""
1707 << typewriter_font_foundry << "\"\n";
1712 case RC_SCREEN_FONT_SCALABLE:
1713 if (ignore_system_lyxrc ||
1714 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1715 os << "\\screen_font_scalable "
1716 << convert<string>(use_scalable_fonts)
1722 case RC_SCREEN_FONT_SIZES:
1723 if (ignore_system_lyxrc ||
1724 font_sizes[TINY_SIZE]
1725 != system_lyxrc.font_sizes[TINY_SIZE] ||
1726 font_sizes[SCRIPT_SIZE]
1727 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1728 font_sizes[FOOTNOTE_SIZE]
1729 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1730 font_sizes[SMALL_SIZE]
1731 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1732 font_sizes[NORMAL_SIZE]
1733 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1734 font_sizes[LARGE_SIZE]
1735 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1736 font_sizes[LARGER_SIZE]
1737 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1738 font_sizes[LARGEST_SIZE]
1739 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1740 font_sizes[HUGE_SIZE]
1741 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1742 font_sizes[HUGER_SIZE]
1743 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1744 streamsize old_prec = os.precision();
1745 os.setf(ios::fixed);
1747 os << "\\screen_font_sizes"
1748 << ' ' << font_sizes[TINY_SIZE]
1749 << ' ' << font_sizes[SCRIPT_SIZE]
1750 << ' ' << font_sizes[FOOTNOTE_SIZE]
1751 << ' ' << font_sizes[SMALL_SIZE]
1752 << ' ' << font_sizes[NORMAL_SIZE]
1753 << ' ' << font_sizes[LARGE_SIZE]
1754 << ' ' << font_sizes[LARGER_SIZE]
1755 << ' ' << font_sizes[LARGEST_SIZE]
1756 << ' ' << font_sizes[HUGE_SIZE]
1757 << ' ' << font_sizes[HUGER_SIZE]
1759 os.precision(old_prec);
1760 os.unsetf(ios::fixed);
1765 case RC_FULL_SCREEN_LIMIT:
1766 if (ignore_system_lyxrc ||
1767 full_screen_limit != system_lyxrc.full_screen_limit) {
1768 os << "\\fullscreen_limit "
1769 << convert<string>(full_screen_limit)
1775 case RC_FULL_SCREEN_TOOLBARS:
1776 if (ignore_system_lyxrc ||
1777 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1778 os << "\\fullscreen_toolbars "
1779 << convert<string>(full_screen_toolbars)
1785 case RC_FULL_SCREEN_SCROLLBAR:
1786 if (ignore_system_lyxrc ||
1787 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1788 os << "\\fullscreen_scrollbar "
1789 << convert<string>(full_screen_scrollbar)
1795 case RC_FULL_SCREEN_STATUSBAR:
1796 if (ignore_system_lyxrc ||
1797 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1798 os << "\\fullscreen_statusbar "
1799 << convert<string>(full_screen_statusbar)
1805 case RC_FULL_SCREEN_TABBAR:
1806 if (ignore_system_lyxrc ||
1807 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1808 os << "\\fullscreen_tabbar "
1809 << convert<string>(full_screen_tabbar)
1815 case RC_FULL_SCREEN_MENUBAR:
1816 if (ignore_system_lyxrc ||
1817 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1818 os << "\\fullscreen_menubar "
1819 << convert<string>(full_screen_menubar)
1825 case RC_FULL_SCREEN_WIDTH:
1826 if (ignore_system_lyxrc ||
1827 full_screen_width != system_lyxrc.full_screen_width) {
1828 os << "\\fullscreen_width "
1829 << convert<string>(full_screen_width)
1835 case RC_OPEN_BUFFERS_IN_TABS:
1836 if (ignore_system_lyxrc ||
1837 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1838 os << "\\open_buffers_in_tabs "
1839 << convert<string>(open_buffers_in_tabs)
1845 case RC_SINGLE_CLOSE_TAB_BUTTON:
1846 if (ignore_system_lyxrc ||
1847 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1848 os << "\\single_close_tab_button "
1849 << convert<string>(single_close_tab_button)
1855 case RC_SINGLE_INSTANCE:
1856 if (ignore_system_lyxrc ||
1857 single_instance != system_lyxrc.single_instance) {
1858 os << "\\single_instance "
1859 << convert<string>(single_instance)
1865 case RC_FORWARD_SEARCH_DVI:
1866 if (ignore_system_lyxrc ||
1867 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1868 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1873 case RC_FORWARD_SEARCH_PDF:
1874 if (ignore_system_lyxrc ||
1875 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1876 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1882 << "# COLOR SECTION ###################################\n"
1887 for (int i = 0; i < Color_ignore; ++i) {
1888 ColorCode lc = static_cast<ColorCode>(i);
1889 string const col = lcolor.getX11Name(lc);
1890 if (ignore_system_lyxrc
1891 || col != system_lcolor.getX11Name(lc)) {
1892 os << "\\set_color \""
1893 << lcolor.getLyXName(lc) << "\" \""
1901 << "# PRINTER SECTION ###################################\n"
1905 case RC_PRINTLANDSCAPEFLAG:
1906 if (ignore_system_lyxrc ||
1907 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1908 os << "\\print_landscape_flag \"" << print_landscape_flag
1914 case RC_PRINTPAPERFLAG:
1915 if (ignore_system_lyxrc ||
1916 print_paper_flag != system_lyxrc.print_paper_flag) {
1917 os << "\\print_paper_flag \"" << print_paper_flag
1923 case RC_PRINTPAPERDIMENSIONFLAG:
1924 if (ignore_system_lyxrc ||
1925 print_paper_dimension_flag
1926 != system_lyxrc.print_paper_dimension_flag) {
1927 os << "\\print_paper_dimension_flag \""
1928 << print_paper_dimension_flag << "\"\n";
1934 << "# TEX SECTION #######################################\n"
1938 case RC_TEXINPUTS_PREFIX:
1939 if (ignore_system_lyxrc ||
1940 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1941 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1947 << "# FILE SECTION ######################################\n"
1950 case RC_DOCUMENTPATH:
1951 if (ignore_system_lyxrc ||
1952 document_path != system_lyxrc.document_path) {
1953 string const path = os::external_path(document_path);
1954 os << "\\document_path \"" << path << "\"\n";
1959 case RC_USELASTFILEPOS:
1960 if (ignore_system_lyxrc ||
1961 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1962 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1968 case RC_LOADSESSION:
1969 if (ignore_system_lyxrc ||
1970 load_session != system_lyxrc.load_session) {
1971 os << "\\load_session " << convert<string>(load_session)
1977 case RC_MOUSE_WHEEL_SPEED:
1978 if (ignore_system_lyxrc ||
1979 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1980 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1985 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1986 if (ignore_system_lyxrc ||
1987 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
1988 os << "\\mouse_middlebutton_paste "
1989 << convert<string>(mouse_middlebutton_paste) << '\n';
1994 case RC_COMPLETION_INLINE_DELAY:
1995 if (ignore_system_lyxrc ||
1996 completion_inline_delay != system_lyxrc.completion_inline_delay) {
1997 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2002 case RC_COMPLETION_INLINE_MATH:
2003 if (ignore_system_lyxrc ||
2004 completion_inline_math != system_lyxrc.completion_inline_math) {
2005 os << "\\completion_inline_math "
2006 << convert<string>(completion_inline_math) << '\n';
2011 case RC_COMPLETION_INLINE_TEXT:
2012 if (ignore_system_lyxrc ||
2013 completion_inline_text != system_lyxrc.completion_inline_text) {
2014 os << "\\completion_inline_text "
2015 << convert<string>(completion_inline_text) << '\n';
2020 case RC_COMPLETION_INLINE_DOTS:
2021 if (ignore_system_lyxrc ||
2022 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2023 os << "\\completion_inline_dots "
2024 << convert<string>(completion_inline_dots) << '\n';
2029 case RC_AUTOCORRECTION_MATH:
2030 if (ignore_system_lyxrc ||
2031 autocorrection_math != system_lyxrc.autocorrection_math) {
2032 os << "\\autocorrection_math "
2033 << convert<string>(autocorrection_math) << '\n';
2038 case RC_COMPLETION_POPUP_DELAY:
2039 if (ignore_system_lyxrc ||
2040 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2041 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2046 case RC_COMPLETION_POPUP_MATH:
2047 if (ignore_system_lyxrc ||
2048 completion_popup_math != system_lyxrc.completion_popup_math) {
2049 os << "\\completion_popup_math "
2050 << convert<string>(completion_popup_math) << '\n';
2055 case RC_COMPLETION_POPUP_TEXT:
2056 if (ignore_system_lyxrc ||
2057 completion_popup_text != system_lyxrc.completion_popup_text) {
2058 os << "\\completion_popup_text "
2059 << convert<string>(completion_popup_text) << '\n';
2064 case RC_COMPLETION_CURSOR_TEXT:
2065 if (ignore_system_lyxrc ||
2066 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2067 os << "\\completion_cursor_text "
2068 << convert<string>(completion_cursor_text) << '\n';
2073 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2074 if (ignore_system_lyxrc ||
2075 completion_popup_after_complete
2076 != system_lyxrc.completion_popup_after_complete) {
2077 os << "\\completion_popup_after_complete "
2078 << convert<string>(completion_popup_after_complete) << '\n';
2083 case RC_COMPLETION_MINLENGTH:
2084 if (ignore_system_lyxrc ||
2085 completion_minlength != system_lyxrc.completion_minlength) {
2086 os << "\\completion_minlength " << convert<string>(completion_minlength)
2092 case RC_NUMLASTFILES:
2093 if (ignore_system_lyxrc ||
2094 num_lastfiles != system_lyxrc.num_lastfiles) {
2095 os << "\\num_lastfiles " << num_lastfiles << '\n';
2100 case RC_CHECKLASTFILES:
2101 if (ignore_system_lyxrc ||
2102 check_lastfiles != system_lyxrc.check_lastfiles) {
2103 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2109 case RC_EXAMPLEPATH:
2110 if (ignore_system_lyxrc ||
2111 example_path != system_lyxrc.example_path) {
2112 string const path = os::external_path(example_path);
2113 os << "\\example_path \"" << path << "\"\n";
2118 case RC_TEMPLATEPATH:
2119 if (ignore_system_lyxrc ||
2120 template_path != system_lyxrc.template_path) {
2121 string const path = os::external_path(template_path);
2122 os << "\\template_path \"" << path << "\"\n";
2127 case RC_TEMPDIRPATH:
2128 if (ignore_system_lyxrc ||
2129 tempdir_path != system_lyxrc.tempdir_path) {
2130 string const path = os::external_path(tempdir_path);
2131 os << "\\tempdir_path \"" << path << "\"\n";
2136 case RC_THESAURUSDIRPATH:
2137 if (ignore_system_lyxrc ||
2138 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2139 string const path = os::external_path(thesaurusdir_path);
2140 os << "\\thesaurusdir_path \"" << path << "\"\n";
2145 case RC_HUNSPELLDIR_PATH:
2146 if (ignore_system_lyxrc ||
2147 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2148 string const path = os::external_path(hunspelldir_path);
2149 os << "\\hunspelldir_path \"" << path << "\"\n";
2154 case RC_PLAINTEXT_LINELEN:
2155 if (ignore_system_lyxrc ||
2156 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2157 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2162 case RC_MAKE_BACKUP:
2163 if (ignore_system_lyxrc ||
2164 make_backup != system_lyxrc.make_backup) {
2165 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2170 case RC_SAVE_COMPRESSED:
2171 if (ignore_system_lyxrc ||
2172 save_compressed != system_lyxrc.save_compressed) {
2173 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2178 case RC_SAVE_ORIGIN:
2179 if (ignore_system_lyxrc ||
2180 save_origin != system_lyxrc.save_origin) {
2181 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2186 case RC_BACKUPDIR_PATH:
2187 if (ignore_system_lyxrc ||
2188 backupdir_path != system_lyxrc.backupdir_path) {
2189 string const path = os::external_path(backupdir_path);
2190 os << "\\backupdir_path \"" << path << "\"\n";
2196 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2200 << "# SPELLCHECKER SECTION ##############################\n"
2204 case RC_ACCEPT_COMPOUND:
2205 if (ignore_system_lyxrc ||
2206 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2207 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2214 if (ignore_system_lyxrc ||
2215 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2216 os << "\\alternate_language \"" << spellchecker_alt_lang
2223 if (ignore_system_lyxrc ||
2224 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2225 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2230 case RC_USE_NATIVE_FILEDIALOG:
2231 if (ignore_system_lyxrc ||
2232 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2233 os << "\\use_native_filedialog "
2234 << convert<string>(use_native_filedialog)
2240 case RC_USE_SYSTEM_COLORS:
2241 if (ignore_system_lyxrc ||
2242 use_system_colors != system_lyxrc.use_system_colors) {
2243 os << "\\use_system_colors "
2244 << convert<string>(use_system_colors)
2250 case RC_USE_TOOLTIP:
2251 if (ignore_system_lyxrc ||
2252 use_tooltip != system_lyxrc.use_tooltip) {
2253 os << "\\use_tooltip "
2254 << convert<string>(use_tooltip)
2262 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2266 case RC_DEFAULT_DECIMAL_POINT:
2267 if (ignore_system_lyxrc ||
2268 default_decimal_point != system_lyxrc.default_decimal_point) {
2269 os << "\\default_decimal_point " << default_decimal_point << '\n';
2274 case RC_DEFAULT_LENGTH_UNIT:
2275 if (ignore_system_lyxrc ||
2276 default_length_unit != system_lyxrc.default_length_unit) {
2277 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2282 case RC_SPELLCHECKER:
2283 if (ignore_system_lyxrc ||
2284 spellchecker != system_lyxrc.spellchecker) {
2285 os << "\\spellchecker " << spellchecker << '\n';
2290 case RC_SPELLCHECK_CONTINUOUSLY:
2291 if (ignore_system_lyxrc ||
2292 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2293 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2299 case RC_SPELLCHECK_NOTES:
2300 if (ignore_system_lyxrc ||
2301 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2302 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2308 case RC_VISUAL_CURSOR:
2309 if (ignore_system_lyxrc ||
2310 visual_cursor != system_lyxrc.visual_cursor) {
2311 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2316 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2317 if (ignore_system_lyxrc ||
2318 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2319 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2320 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2325 case RC_LANGUAGE_CUSTOM_PACKAGE:
2326 if (ignore_system_lyxrc ||
2327 language_custom_package != system_lyxrc.language_custom_package) {
2328 os << "\\language_custom_package \"" << language_custom_package
2334 case RC_LANGUAGE_GLOBAL_OPTIONS:
2335 if (ignore_system_lyxrc ||
2336 language_global_options
2337 != system_lyxrc.language_global_options) {
2338 os << "\\language_global_options \""
2339 << convert<string>(language_global_options)
2345 case RC_LANGUAGE_PACKAGE_SELECTION:
2346 if (ignore_system_lyxrc ||
2347 language_package_selection != system_lyxrc.language_package_selection) {
2348 os << "\\language_package_selection ";
2349 switch (language_package_selection) {
2367 case RC_LANGUAGE_COMMAND_BEGIN:
2368 if (ignore_system_lyxrc ||
2369 language_command_begin
2370 != system_lyxrc.language_command_begin) {
2371 os << "\\language_command_begin \""
2372 << language_command_begin
2378 case RC_LANGUAGE_COMMAND_END:
2379 if (ignore_system_lyxrc ||
2380 language_command_end
2381 != system_lyxrc.language_command_end) {
2382 os << "\\language_command_end \"" << language_command_end
2388 case RC_LANGUAGE_COMMAND_LOCAL:
2389 if (ignore_system_lyxrc ||
2390 language_command_local
2391 != system_lyxrc.language_command_local) {
2392 os << "\\language_command_local \""
2393 << language_command_local
2399 case RC_LANGUAGE_AUTO_BEGIN:
2400 if (ignore_system_lyxrc ||
2401 language_auto_begin != system_lyxrc.language_auto_begin) {
2402 os << "\\language_auto_begin "
2403 << convert<string>(language_auto_begin) << '\n';
2408 case RC_LANGUAGE_AUTO_END:
2409 if (ignore_system_lyxrc ||
2410 language_auto_end != system_lyxrc.language_auto_end) {
2411 os << "\\language_auto_end "
2412 << convert<string>(language_auto_end) << '\n';
2417 case RC_MARK_FOREIGN_LANGUAGE:
2418 if (ignore_system_lyxrc ||
2419 mark_foreign_language
2420 != system_lyxrc.mark_foreign_language) {
2421 os << "\\mark_foreign_language " <<
2422 convert<string>(mark_foreign_language) << '\n';
2428 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2432 case RC_AUTO_NUMBER:
2433 if (ignore_system_lyxrc ||
2434 auto_number != system_lyxrc.auto_number) {
2435 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2440 case RC_GUI_LANGUAGE:
2441 if (ignore_system_lyxrc ||
2442 gui_language != system_lyxrc.gui_language) {
2443 os << "\\gui_language " << gui_language << '\n';
2448 case RC_EXPORT_OVERWRITE:
2449 if (ignore_system_lyxrc ||
2450 export_overwrite != system_lyxrc.export_overwrite) {
2452 switch (export_overwrite) {
2463 os << "\\export_overwrite " << status << '\n';
2468 case RC_SCROLL_WHEEL_ZOOM:
2469 if (ignore_system_lyxrc ||
2470 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2472 switch (scroll_wheel_zoom) {
2473 case SCROLL_WHEEL_ZOOM_OFF:
2476 case SCROLL_WHEEL_ZOOM_CTRL:
2479 case SCROLL_WHEEL_ZOOM_SHIFT:
2482 case SCROLL_WHEEL_ZOOM_ALT:
2486 os << "\\scroll_wheel_zoom " << status << '\n';
2492 << "# FORMATS SECTION ##########################\n"
2497 // New/modified formats
2498 for (Formats::const_iterator cit = theFormats().begin();
2499 cit != theFormats().end(); ++cit) {
2500 Format const * format =
2501 theSystemFormats().getFormat(cit->name());
2503 format->extensions() != cit->extensions() ||
2504 format->prettyname() != cit->prettyname() ||
2505 format->shortcut() != cit->shortcut() ||
2506 format->viewer() != cit->viewer() ||
2507 format->editor() != cit->editor() ||
2508 format->documentFormat() != cit->documentFormat() ||
2509 format->vectorFormat() != cit->vectorFormat() ||
2510 format->inExportMenu() != cit->inExportMenu() ||
2511 format->mime() != cit->mime()) {
2512 os << "\\format \"" << cit->name() << "\" \""
2513 << cit->extensions() << "\" \""
2514 << to_utf8(cit->prettyname()) << "\" \""
2515 << cit->shortcut() << "\" \""
2516 << escapeCommand(cit->viewer()) << "\" \""
2517 << escapeCommand(cit->editor()) << "\" \"";
2518 vector<string> flags;
2519 if (cit->documentFormat())
2520 flags.push_back("document");
2521 if (cit->vectorFormat())
2522 flags.push_back("vector");
2523 if (cit->zippedNative())
2524 flags.push_back("zipped=native");
2525 if (cit->inExportMenu())
2526 flags.push_back("menu=export");
2528 os << getStringFromVector(flags);
2529 os << "\" \"" << cit->mime() << "\"\n";
2533 // Look for deleted formats
2534 for (Formats::const_iterator cit = theSystemFormats().begin();
2535 cit != theSystemFormats().end(); ++cit)
2536 if (!theFormats().getFormat(cit->name()))
2537 os << "\\format \"" << cit->name()
2538 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2542 case RC_VIEWER_ALTERNATIVES: {
2543 Alternatives::const_iterator it = viewer_alternatives.begin();
2544 Alternatives::const_iterator const en = viewer_alternatives.end();
2545 Alternatives::const_iterator const sysend =
2546 system_lyxrc.viewer_alternatives.end();
2547 for (; it != en; ++it) {
2548 string const & fmt = it->first;
2549 CommandSet const & cmd = it->second;
2550 CommandSet::const_iterator sit = cmd.begin();
2551 CommandSet::const_iterator const sen = cmd.end();
2552 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2553 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2554 system_lyxrc.viewer_alternatives.find(fmt);
2555 for (; sit != sen; ++sit) {
2556 string const & cmd = *sit;
2557 if (ignore_system_lyxrc
2558 || sysfmt == sysend // format not found
2559 || sysfmt->second.count(cmd) == 0 // this command not found
2561 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2568 case RC_EDITOR_ALTERNATIVES: {
2569 Alternatives::const_iterator it = editor_alternatives.begin();
2570 Alternatives::const_iterator const en = editor_alternatives.end();
2571 Alternatives::const_iterator const sysend =
2572 system_lyxrc.editor_alternatives.end();
2573 for (; it != en; ++it) {
2574 string const & fmt = it->first;
2575 CommandSet const & cmd = it->second;
2576 CommandSet::const_iterator sit = cmd.begin();
2577 CommandSet::const_iterator const sen = cmd.end();
2578 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2579 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2580 system_lyxrc.editor_alternatives.find(fmt);
2581 for (; sit != sen; ++sit) {
2582 string const & cmd = *sit;
2583 if (ignore_system_lyxrc
2584 || sysfmt == sysend // format not found
2585 || sysfmt->second.count(cmd) == 0 // this command not found
2587 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2594 case RC_DEFAULT_OTF_VIEW_FORMAT:
2595 if ((ignore_system_lyxrc ||
2596 default_otf_view_format != system_lyxrc.default_otf_view_format)
2597 && !default_otf_view_format.empty()) {
2598 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2603 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2604 if ((ignore_system_lyxrc ||
2605 default_platex_view_format != system_lyxrc.default_platex_view_format)
2606 && !default_platex_view_format.empty()) {
2607 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2612 case RC_DEFAULT_VIEW_FORMAT:
2613 if (ignore_system_lyxrc ||
2614 default_view_format != system_lyxrc.default_view_format) {
2615 os << "\\default_view_format " << default_view_format << '\n';
2626 << "# CONVERTERS SECTION ##########################\n"
2631 // Look for new converters
2632 for (Converters::const_iterator cit = theConverters().begin();
2633 cit != theConverters().end(); ++cit) {
2634 Converter const * converter =
2635 theSystemConverters().getConverter(cit->from(),
2638 converter->command() != cit->command() ||
2639 converter->flags() != cit->flags())
2640 os << "\\converter \"" << cit->from() << "\" \""
2641 << cit->to() << "\" \""
2642 << escapeCommand(cit->command()) << "\" \""
2643 << cit->flags() << "\"\n";
2646 // New/modifed converters
2647 for (Converters::const_iterator cit = theSystemConverters().begin();
2648 cit != theSystemConverters().end(); ++cit)
2649 if (!theConverters().getConverter(cit->from(), cit->to()))
2650 os << "\\converter \"" << cit->from()
2651 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2658 << "# COPIERS SECTION ##########################\n"
2661 // Look for new movers
2662 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2663 Movers::const_iterator const sysend = theSystemMovers().end();
2664 Movers::const_iterator it = theMovers().begin();
2665 Movers::const_iterator end = theMovers().end();
2667 for (; it != end; ++it) {
2668 Movers::const_iterator const sysit =
2669 find_if(sysbegin, sysend, SameMover(*it));
2670 if (sysit == sysend) {
2671 string const & fmt = it->first;
2672 string const & command =
2673 it->second.command();
2675 os << "\\copier " << fmt
2676 << " \"" << escapeCommand(command) << "\"\n";
2682 // We don't actually delete SpecialisedMover(s) from the
2683 // map, just clear their 'command', so there's no need
2684 // to test for anything else.
2691 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2693 // Why the switch you might ask. It is a trick to ensure that all
2694 // the elements in the LyXRCTags enum is handled. As you can see
2695 // there are no breaks at all. So it is just a huge fall-through.
2696 // The nice thing is that we will get a warning from the compiler
2697 // if we forget an element.
2698 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2700 case LyXRC::RC_LAST:
2701 case LyXRC::RC_ACCEPT_COMPOUND:
2702 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2703 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2705 case LyXRC::RC_ALT_LANG:
2706 case LyXRC::RC_PLAINTEXT_LINELEN:
2707 case LyXRC::RC_AUTOCORRECTION_MATH:
2708 case LyXRC::RC_AUTOREGIONDELETE:
2709 case LyXRC::RC_AUTORESET_OPTIONS:
2710 case LyXRC::RC_AUTOSAVE:
2711 case LyXRC::RC_AUTO_NUMBER:
2712 case LyXRC::RC_BACKUPDIR_PATH:
2713 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2714 case LyXRC::RC_BIBTEX_COMMAND:
2715 case LyXRC::RC_BINDFILE:
2716 case LyXRC::RC_CHECKLASTFILES:
2717 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2718 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2719 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2720 case LyXRC::RC_COMPLETION_INLINE_MATH:
2721 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2722 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2723 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2724 case LyXRC::RC_COMPLETION_POPUP_MATH:
2725 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2726 case LyXRC::RC_COMPLETION_MINLENGTH:
2727 case LyXRC::RC_USELASTFILEPOS:
2728 case LyXRC::RC_LOADSESSION:
2729 case LyXRC::RC_CHKTEX_COMMAND:
2730 case LyXRC::RC_CONVERTER:
2731 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2732 case LyXRC::RC_COPIER:
2733 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2734 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2735 case LyXRC::RC_GUI_LANGUAGE:
2736 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2737 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2738 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2739 case LyXRC::RC_DEFFILE:
2740 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2741 case LyXRC::RC_DISPLAY_GRAPHICS:
2742 case LyXRC::RC_DOCUMENTPATH:
2743 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2744 FileName path(lyxrc_new.document_path);
2745 if (path.exists() && path.isDirectory())
2746 package().document_dir() = FileName(lyxrc.document_path);
2749 case LyXRC::RC_EDITOR_ALTERNATIVES:
2750 case LyXRC::RC_ESC_CHARS:
2751 case LyXRC::RC_EXAMPLEPATH:
2752 case LyXRC::RC_FILEFORMAT:
2753 case LyXRC::RC_GROUP_LAYOUTS:
2754 case LyXRC::RC_HUNSPELLDIR_PATH:
2755 case LyXRC::RC_ICON_SET:
2756 case LyXRC::RC_INDEX_ALTERNATIVES:
2757 case LyXRC::RC_INDEX_COMMAND:
2758 case LyXRC::RC_JBIBTEX_COMMAND:
2759 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2760 case LyXRC::RC_JINDEX_COMMAND:
2761 case LyXRC::RC_NOMENCL_COMMAND:
2762 case LyXRC::RC_PYGMENTIZE_COMMAND:
2763 case LyXRC::RC_INPUT:
2764 case LyXRC::RC_KBMAP:
2765 case LyXRC::RC_KBMAP_PRIMARY:
2766 case LyXRC::RC_KBMAP_SECONDARY:
2767 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2768 case LyXRC::RC_LANGUAGE_AUTO_END:
2769 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2770 case LyXRC::RC_LANGUAGE_COMMAND_END:
2771 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2772 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2773 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2774 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2775 case LyXRC::RC_LYXRCFORMAT:
2776 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2777 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2778 case LyXRC::RC_MACRO_EDIT_STYLE:
2779 case LyXRC::RC_MAKE_BACKUP:
2780 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2781 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2782 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2783 case LyXRC::RC_NUMLASTFILES:
2784 case LyXRC::RC_PARAGRAPH_MARKERS:
2785 case LyXRC::RC_PATH_PREFIX:
2786 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2787 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2788 // Resets python path
2789 support::os::python(true);
2792 case LyXRC::RC_PREVIEW:
2793 if (lyxrc_orig.preview != lyxrc_new.preview) {
2794 // Update all previews of all documents.
2795 /* FIXME: this can be very expensive. It would be cheaper
2796 * to kill all existing previews and update visible
2798 theBufferList().updatePreviews();
2801 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2802 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2803 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2804 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2805 case LyXRC::RC_PRINTPAPERFLAG:
2806 case LyXRC::RC_SAVE_COMPRESSED:
2807 case LyXRC::RC_SAVE_ORIGIN:
2808 case LyXRC::RC_SCREEN_DPI:
2810 case LyXRC::RC_SCREEN_FONT_ROMAN:
2811 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2812 case LyXRC::RC_SCREEN_FONT_SANS:
2813 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2814 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2815 case LyXRC::RC_SCREEN_FONT_SIZES:
2816 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2817 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2818 case LyXRC::RC_SCREEN_ZOOM:
2819 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2820 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2821 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2822 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2823 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2824 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2825 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2826 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2827 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2828 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2831 case LyXRC::RC_GEOMETRY_SESSION:
2832 case LyXRC::RC_SERVERPIPE:
2833 case LyXRC::RC_SET_COLOR:
2834 case LyXRC::RC_SHOW_BANNER:
2835 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2836 case LyXRC::RC_SPELLCHECKER:
2837 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2840 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2841 case LyXRC::RC_SPELLCHECK_NOTES:
2842 case LyXRC::RC_SPLITINDEX_COMMAND:
2843 case LyXRC::RC_TEMPDIRPATH:
2844 case LyXRC::RC_TEMPLATEPATH:
2845 case LyXRC::RC_TEX_ALLOWS_SPACES:
2846 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2847 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2848 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2851 case LyXRC::RC_TEXINPUTS_PREFIX:
2852 case LyXRC::RC_THESAURUSDIRPATH:
2853 case LyXRC::RC_UIFILE:
2854 case LyXRC::RC_USER_EMAIL:
2855 case LyXRC::RC_USER_NAME:
2856 case LyXRC::RC_USE_CONVERTER_CACHE:
2857 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2858 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2859 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2860 case LyXRC::RC_USE_SYSTEM_COLORS:
2861 case LyXRC::RC_USE_TOOLTIP:
2862 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2863 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2864 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2865 case LyXRC::RC_SINGLE_INSTANCE:
2866 case LyXRC::RC_SORT_LAYOUTS:
2867 case LyXRC::RC_FULL_SCREEN_LIMIT:
2868 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2869 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2870 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2871 case LyXRC::RC_FULL_SCREEN_TABBAR:
2872 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2873 case LyXRC::RC_FULL_SCREEN_WIDTH:
2874 case LyXRC::RC_VISUAL_CURSOR:
2875 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2876 case LyXRC::RC_VIEWER:
2877 case LyXRC::RC_VIEWER_ALTERNATIVES:
2878 case LyXRC::RC_FORWARD_SEARCH_DVI:
2879 case LyXRC::RC_FORWARD_SEARCH_PDF:
2880 case LyXRC::RC_EXPORT_OVERWRITE:
2881 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2882 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2883 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2884 case LyXRC::RC_CURSOR_WIDTH:
2890 set<string> LyXRC::getRCs()
2893 for (int i = 0; i != lyxrcCount; ++i)
2894 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2900 string const LyXRC::getDescription(LyXRCTags tag)
2905 case RC_ACCEPT_COMPOUND:
2906 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2910 str = _("Specify an alternate language. The default is to use the language of the document.");
2913 case RC_PLAINTEXT_LINELEN:
2914 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.");
2917 case RC_AUTOREGIONDELETE:
2918 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2921 case RC_AUTORESET_OPTIONS:
2922 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2926 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2929 case RC_AUTO_NUMBER:
2932 case RC_BACKUPDIR_PATH:
2933 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.");
2936 case RC_BIBTEX_COMMAND:
2937 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2940 case RC_JBIBTEX_COMMAND:
2941 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2945 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2948 case RC_CHECKLASTFILES:
2949 str = _("Select to check whether the lastfiles still exist.");
2952 case RC_CHKTEX_COMMAND:
2953 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2959 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
2960 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
2963 case RC_CONVERTER_NEEDAUTH:
2964 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
2970 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2971 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.");
2974 case RC_CURSOR_WIDTH:
2975 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2978 case RC_SCROLL_BELOW_DOCUMENT:
2979 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");
2982 case RC_MAC_DONTSWAP_CTRL_META:
2983 str = _("Make Apple key act as Meta and Control key as Ctrl.");
2986 case RC_MAC_LIKE_CURSOR_MOVEMENT:
2987 str = _("Use the Mac OS X conventions for cursor movement");
2990 case RC_SHOW_MACRO_LABEL:
2991 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2995 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2998 case RC_DEFAULT_OTF_VIEW_FORMAT:
2999 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3002 case RC_DEFAULT_VIEW_FORMAT:
3003 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3006 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3007 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3010 case RC_DISPLAY_GRAPHICS:
3011 str = _("Select how LyX will display any graphics.");
3014 case RC_DOCUMENTPATH:
3015 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3019 str = _("Specify additional chars that can be part of a word.");
3022 case RC_EXAMPLEPATH:
3023 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3029 case RC_INDEX_COMMAND:
3030 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\".");
3033 case RC_JINDEX_COMMAND:
3034 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3037 case RC_NOMENCL_COMMAND:
3038 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3041 case RC_PYGMENTIZE_COMMAND:
3042 str = _("The command to run the python pygments syntax highlighter.");
3049 case RC_KBMAP_PRIMARY:
3050 case RC_KBMAP_SECONDARY:
3051 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.");
3054 case RC_LANGUAGE_AUTO_BEGIN:
3055 str = _("Select if a language switching command is needed at the beginning of the document.");
3058 case RC_LANGUAGE_AUTO_END:
3059 str = _("Select if a language switching command is needed at the end of the document.");
3062 case RC_LANGUAGE_COMMAND_BEGIN:
3063 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.");
3066 case RC_LANGUAGE_COMMAND_END:
3067 str = _("The LaTeX command for changing back to the language of the document.");
3070 case RC_LANGUAGE_COMMAND_LOCAL:
3071 str = _("The LaTeX command for local changing of the language.");
3074 case RC_LANGUAGE_GLOBAL_OPTIONS:
3075 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3078 case RC_LANGUAGE_CUSTOM_PACKAGE:
3079 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3082 case RC_LANGUAGE_PACKAGE_SELECTION:
3083 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3086 case RC_USELASTFILEPOS:
3087 str = _("De-select if you do not want LyX to scroll to saved position.");
3090 case RC_LOADSESSION:
3091 str = _("De-select to prevent loading files opened from the last LyX session.");
3094 case RC_MAKE_BACKUP:
3095 str = _("De-select if you don't want LyX to create backup files.");
3098 case RC_MARK_FOREIGN_LANGUAGE:
3099 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3102 case RC_MOUSE_WHEEL_SPEED:
3103 str = _("The scrolling speed of the mouse wheel.");
3106 case RC_COMPLETION_POPUP_DELAY:
3107 str = _("The completion popup delay.");
3110 case RC_COMPLETION_POPUP_MATH:
3111 str = _("Select to display the completion popup in math mode.");
3114 case RC_COMPLETION_POPUP_TEXT:
3115 str = _("Select to display the completion popup in text mode.");
3118 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3119 str = _("Show the completion popup without delay after non-unique completion attempt.");
3122 case RC_COMPLETION_POPUP_TEXT:
3123 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3126 case RC_COMPLETION_POPUP_DELAY:
3127 str = _("The inline completion delay.");
3130 case RC_COMPLETION_INLINE_MATH:
3131 str = _("Select to display the inline completion in math mode.");
3134 case RC_COMPLETION_INLINE_TEXT:
3135 str = _("Select to display the inline completion in text mode.");
3138 case RC_COMPLETION_INLINE_DOTS:
3139 str = _("Use \"...\" to shorten long completions.");
3142 case RC_AUTOCORRECTION_MATH:
3143 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3146 case RC_NUMLASTFILES:
3147 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3151 case RC_PATH_PREFIX:
3152 str = _("Specify those directories which should be "
3153 "prepended to the PATH environment variable.\n"
3154 "Use the OS native format.");
3158 str = _("Shows a typeset preview of things such as math");
3161 case RC_PREVIEW_HASHED_LABELS:
3162 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3165 case RC_PREVIEW_SCALE_FACTOR:
3166 str = _("Scale the preview size to suit.");
3169 case RC_PRINTLANDSCAPEFLAG:
3170 str = _("The option to print out in landscape.");
3173 case RC_PRINTPAPERDIMENSIONFLAG:
3174 str = _("Option to specify the dimensions of the print paper.");
3177 case RC_PRINTPAPERFLAG:
3178 str = _("The option to specify paper type.");
3181 case RC_VISUAL_CURSOR:
3182 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3185 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3186 str = _("Specify whether, closing the last view of an open document, LyX should close the document (yes), hide it (no), or ask the user (ask).");
3190 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3193 case RC_SCREEN_FONT_ROMAN:
3194 case RC_SCREEN_FONT_SANS:
3195 case RC_SCREEN_FONT_TYPEWRITER:
3196 str = _("The screen fonts used to display the text while editing.");
3199 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3200 case RC_SCREEN_FONT_SANS_FOUNDRY:
3201 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3204 case RC_SCREEN_FONT_SCALABLE:
3205 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.");
3208 case RC_SCREEN_FONT_SIZES:
3209 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3212 case RC_SCREEN_ZOOM:
3213 //xgettext:no-c-format
3214 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3217 case RC_GEOMETRY_SESSION:
3218 str = _("Allow session manager to save and restore windows geometry.");
3222 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3228 case RC_SHOW_BANNER:
3229 str = _("De-select if you don't want the startup banner.");
3232 case RC_TEMPDIRPATH:
3233 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3236 case RC_THESAURUSDIRPATH:
3237 str = _("This is the place where the files of the thesaurus library reside.");
3240 case RC_TEMPLATEPATH:
3241 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3244 case RC_TEX_ALLOWS_SPACES:
3247 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3250 case RC_TEXINPUTS_PREFIX:
3251 str = _("Specify those directories which should be "
3252 "prepended to the TEXINPUTS environment variable.\n"
3253 "A '.' represents the current document directory. "
3254 "Use the OS native format.");
3258 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3267 case RC_USE_USE_SYSTEM_COLORS:
3268 str = _("Enable use the system colors for some things like main window background and selection.");
3271 case RC_USE_TOOLTIP:
3272 str = _("Enable the automatic appearance of tool tips in the work area.");
3275 case RC_VIEWDVI_PAPEROPTION:
3276 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3291 // The global instance
3294 // The global copy of the system lyxrc entries (everything except preferences)