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 = 31; // lasgouttes: add \ct_additions_underlined
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 { "\\ct_additions_underlined", LyXRC::RC_CT_ADDITIONS_UNDERLINED },
96 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
97 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
98 { "\\def_file", LyXRC::RC_DEFFILE },
99 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
100 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
101 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
102 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
103 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
104 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
105 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
106 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
107 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
108 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
109 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
110 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
111 { "\\format", LyXRC::RC_FILEFORMAT },
112 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
113 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
114 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
115 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
116 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
117 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
118 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
119 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
120 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
121 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
122 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
123 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
124 { "\\icon_set", LyXRC::RC_ICON_SET },
125 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
126 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
127 { "\\input", LyXRC::RC_INPUT },
128 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
129 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
130 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
131 { "\\kbmap", LyXRC::RC_KBMAP },
132 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
133 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
134 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
135 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
136 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
137 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
138 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
139 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
140 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
141 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
142 { "\\load_session", LyXRC::RC_LOADSESSION },
143 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
144 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
145 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
146 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
147 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
148 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
149 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
150 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
151 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
152 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
153 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
154 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
155 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
156 { "\\preview", LyXRC::RC_PREVIEW },
157 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
158 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
159 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
160 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
161 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
162 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
163 { "\\respect_os_kbd_language", LyXRC::RC_RESPECT_OS_KBD_LANGUAGE },
164 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
165 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
166 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
167 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
168 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
169 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
170 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
171 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
172 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
173 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
174 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
175 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
176 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
177 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
178 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
179 { "\\set_color", LyXRC::RC_SET_COLOR },
180 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
181 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
182 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
183 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
184 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
185 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
186 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
187 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
188 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
189 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
190 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
191 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
192 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
193 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
194 { "\\ui_file", LyXRC::RC_UIFILE },
195 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
196 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
197 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
198 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
199 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
200 // compatibility with versions older than 1.4.0 only
201 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
202 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
203 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
204 { "\\user_email", LyXRC::RC_USER_EMAIL },
205 { "\\user_initials", LyXRC::RC_USER_INITIALS },
206 { "\\user_name", LyXRC::RC_USER_NAME },
207 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
208 // compatibility with versions older than 1.4.0 only
209 { "\\viewer", LyXRC::RC_VIEWER},
210 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
211 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
212 { "format", LyXRC::RC_LYXRCFORMAT }
215 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
218 void oldFontFormat(string & family, string & foundry)
220 if (family.empty() || family[0] != '-')
222 foundry = token(family, '-', 1);
223 family = token(family, '-', 2);
231 bool LyXRC::read(FileName const & filename, bool check_format)
233 Lexer lexrc(lyxrcTags);
234 lexrc.setFile(filename);
235 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
236 ReturnValues retval = read(lexrc, check_format);
237 if (!check_format || retval != FormatMismatch)
238 return retval == ReadOK;
240 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
241 TempFile tmp("convert_lyxrc");
242 FileName const tempfile = tmp.name();
243 bool const success = prefs2prefs(filename, tempfile, false);
245 LYXERR0 ("Unable to convert " << filename.absFileName() <<
246 " to format " << LYXRC_FILEFORMAT);
249 // Keep this in the else branch, such that lexrc2 goes out
250 // of scope and releases the lock on tempfile before we
251 // attempt to remove it. This matters on Windows.
252 Lexer lexrc2(lyxrcTags);
253 lexrc2.setFile(tempfile);
254 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
255 retval = read(lexrc2, check_format);
256 if (retval == FormatMismatch)
257 LYXERR0("Conversion failed for " << filename.absFileName());
259 return retval == ReadOK;
263 // don't need to worry about conversion, because this is always
264 // from an internal source
265 bool LyXRC::read(istream & is)
267 Lexer lexrc(lyxrcTags);
269 LYXERR(Debug::LYXRC, "Reading istream...");
270 return read(lexrc, false) == ReadOK;
274 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
276 if (lyxerr.debugging(Debug::PARSER))
277 lexrc.printTable(lyxerr);
282 // format prior to 2.0 and introduction of format tag
283 unsigned int rc_format = 0;
285 while (lexrc.isOK()) {
286 // By using two switches we take advantage of the compiler
287 // telling us if we have missed a LyXRCTags element in
288 // the second switch.
289 // Note that this also shows a problem with Lexer since it
290 // helps us avoid taking advantage of the strictness of the
293 int le = lexrc.lex();
295 case Lexer::LEX_UNDEF:
296 lexrc.printError("Unknown tag `$$Token'");
298 case Lexer::LEX_FEOF:
303 switch (static_cast<LyXRCTags>(le)) {
306 rc_format = lexrc.getInteger();
308 case RC_INPUT: // Include file
311 libFileSearch(string(),
313 if (!read(tmp, check_format)) {
315 "Error reading included file: " + tmp.absFileName());
321 bind_file = os::internal_path(lexrc.getString());
326 def_file = os::internal_path(lexrc.getString());
331 ui_file = os::internal_path(lexrc.getString());
334 case RC_AUTORESET_OPTIONS:
335 lexrc >> auto_reset_options;
338 case RC_DISPLAY_GRAPHICS:
340 display_graphics = lexrc.getString() == "true";
343 case RC_TEX_EXPECTS_WINDOWS_PATHS:
344 lexrc >> windows_style_tex_paths;
347 case RC_TEX_ALLOWS_SPACES:
348 lexrc >> tex_allows_spaces;
351 case RC_TEXINPUTS_PREFIX:
352 lexrc >> texinputs_prefix;
359 case RC_KBMAP_PRIMARY:
361 string const kmap(os::internal_path(lexrc.getString()));
362 if (!libFileSearch("kbd", kmap, "kmap").empty()
364 primary_kbmap = kmap;
366 lexrc.printError("LyX: Keymap `$$Token' not found");
371 case RC_KBMAP_SECONDARY:
373 string const kmap(os::internal_path(lexrc.getString()));
374 if (!libFileSearch("kbd", kmap, "kmap").empty()
376 secondary_kbmap = kmap;
378 lexrc.printError("LyX: Keymap `$$Token' not found");
383 case RC_PRINTLANDSCAPEFLAG:
384 lexrc >> print_landscape_flag;
387 case RC_PRINTPAPERDIMENSIONFLAG:
388 lexrc >> print_paper_dimension_flag;
391 case RC_PRINTPAPERFLAG:
392 lexrc >> print_paper_flag;
395 case RC_PYGMENTIZE_COMMAND:
396 if (lexrc.next(true)) {
397 pygmentize_command = lexrc.getString();
401 case RC_VIEWDVI_PAPEROPTION:
403 view_dvi_paper_option = lexrc.getString();
405 view_dvi_paper_option.erase();
408 case RC_CHKTEX_COMMAND:
409 if (lexrc.next(true)) {
410 chktex_command = lexrc.getString();
414 case RC_BIBTEX_ALTERNATIVES:
415 if (lexrc.next(true)) {
416 bibtex_alternatives.insert(lexrc.getString());
420 case RC_BIBTEX_COMMAND:
421 if (lexrc.next(true)) {
422 bibtex_command = lexrc.getString();
426 case RC_JBIBTEX_COMMAND:
427 if (lexrc.next(true)) {
428 jbibtex_command = lexrc.getString();
432 case RC_JBIBTEX_ALTERNATIVES:
433 if (lexrc.next(true)) {
434 jbibtex_alternatives.insert(lexrc.getString());
438 case RC_INDEX_ALTERNATIVES:
439 if (lexrc.next(true)) {
440 index_alternatives.insert(lexrc.getString());
444 case RC_INDEX_COMMAND:
445 if (lexrc.next(true)) {
446 index_command = lexrc.getString();
450 case RC_JINDEX_COMMAND:
451 if (lexrc.next(true)) {
452 jindex_command = lexrc.getString();
456 case RC_SPLITINDEX_COMMAND:
457 if (lexrc.next(true)) {
458 splitindex_command = lexrc.getString();
462 case RC_NOMENCL_COMMAND:
463 if (lexrc.next(true)) {
464 nomencl_command = lexrc.getString();
473 lexrc >> defaultZoom;
474 if (defaultZoom < 10)
478 case RC_GEOMETRY_SESSION:
479 lexrc >> allow_geometry_session;
482 case RC_SCREEN_FONT_SIZES:
483 lexrc >> font_sizes[TINY_SIZE];
484 lexrc >> font_sizes[SCRIPT_SIZE];
485 lexrc >> font_sizes[FOOTNOTE_SIZE];
486 lexrc >> font_sizes[SMALL_SIZE];
487 lexrc >> font_sizes[NORMAL_SIZE];
488 lexrc >> font_sizes[LARGE_SIZE];
489 lexrc >> font_sizes[LARGER_SIZE];
490 lexrc >> font_sizes[LARGEST_SIZE];
491 lexrc >> font_sizes[HUGE_SIZE];
492 lexrc >> font_sizes[HUGER_SIZE];
495 case RC_SCREEN_FONT_SCALABLE:
496 lexrc >> use_scalable_fonts;
503 case RC_DOCUMENTPATH:
505 document_path = os::internal_path(lexrc.getString());
510 example_path = os::internal_path(lexrc.getString());
513 case RC_TEMPLATEPATH:
515 template_path = os::internal_path(lexrc.getString());
520 tempdir_path = os::internal_path(lexrc.getString());
523 case RC_THESAURUSDIRPATH:
525 thesaurusdir_path = os::internal_path(lexrc.getString());
528 case RC_HUNSPELLDIR_PATH:
530 hunspelldir_path = os::internal_path(lexrc.getString());
533 case RC_USELASTFILEPOS:
534 lexrc >> use_lastfilepos;
538 lexrc >> load_session;
541 case RC_MOUSE_WHEEL_SPEED:
542 lexrc >> mouse_wheel_speed;
545 case RC_COMPLETION_INLINE_DELAY:
546 lexrc >> completion_inline_delay;
549 case RC_COMPLETION_INLINE_MATH:
550 lexrc >> completion_inline_math;
553 case RC_COMPLETION_INLINE_TEXT:
554 lexrc >> completion_inline_text;
557 case RC_COMPLETION_INLINE_DOTS:
558 lexrc >> completion_inline_dots;
561 case RC_AUTOCORRECTION_MATH:
562 lexrc >> autocorrection_math;
565 case RC_COMPLETION_POPUP_DELAY:
566 lexrc >> completion_popup_delay;
569 case RC_COMPLETION_POPUP_MATH:
570 lexrc >> completion_popup_math;
573 case RC_COMPLETION_POPUP_TEXT:
574 lexrc >> completion_popup_text;
577 case RC_COMPLETION_CURSOR_TEXT:
578 lexrc >> completion_cursor_text;
581 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
582 lexrc >> completion_popup_after_complete;
585 case RC_COMPLETION_MINLENGTH:
586 lexrc >> completion_minlength;
589 case RC_NUMLASTFILES:
590 lexrc >> num_lastfiles;
593 case RC_CHECKLASTFILES:
594 lexrc >> check_lastfiles;
601 case RC_USE_SYSTEM_THEME_ICONS:
602 lexrc >> use_system_theme_icons;
605 case RC_SCREEN_FONT_ROMAN:
607 roman_font_name = lexrc.getString();
608 oldFontFormat(roman_font_name,
613 case RC_SCREEN_FONT_SANS:
615 sans_font_name = lexrc.getString();
616 oldFontFormat(sans_font_name, sans_font_foundry);
620 case RC_SCREEN_FONT_TYPEWRITER:
622 typewriter_font_name = lexrc.getString();
623 oldFontFormat(typewriter_font_name,
624 typewriter_font_foundry);
628 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
629 lexrc >> roman_font_foundry;
632 case RC_SCREEN_FONT_SANS_FOUNDRY:
633 lexrc >> sans_font_foundry;
636 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
637 lexrc >> typewriter_font_foundry;
642 lexrc.printError("Missing color tag.");
645 string lyx_name = lexrc.getString();
648 lexrc.printError("Missing color name for color: `$$Token'");
651 string x11_name = lexrc.getString();
653 ColorCode const col =
654 lcolor.getFromLyXName(lyx_name);
655 if (col == Color_none ||
656 col == Color_inherit ||
660 if (!lcolor.setColor(col, x11_name))
661 LYXERR0("Bad lyxrc set_color for " << lyx_name);
665 case RC_AUTOREGIONDELETE:
666 // Auto region delete defaults to true
667 lexrc >> auto_region_delete;
672 lyxpipes = os::internal_path(lexrc.getString());
675 case RC_CT_ADDITIONS_UNDERLINED:
676 lexrc >> ct_additions_underlined;
679 case RC_CURSOR_FOLLOWS_SCROLLBAR:
680 lexrc >> cursor_follows_scrollbar;
683 case RC_CURSOR_WIDTH:
684 lexrc >> cursor_width;
687 case RC_SCROLL_BELOW_DOCUMENT:
688 lexrc >> scroll_below_document;
691 case RC_PARAGRAPH_MARKERS:
692 lexrc >> paragraph_markers;
695 case RC_MAC_DONTSWAP_CTRL_META:
696 lexrc >> mac_dontswap_ctrl_meta;
699 case RC_MAC_LIKE_CURSOR_MOVEMENT:
700 lexrc >> mac_like_cursor_movement;
703 case RC_MACRO_EDIT_STYLE:
705 switch (lexrc.getInteger()) {
706 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
707 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
708 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
713 case RC_DIALOGS_ICONIFY_WITH_MAIN:
714 lexrc >> dialogs_iconify_with_main;
717 case RC_PLAINTEXT_LINELEN:
718 lexrc >> plaintext_linelen;
720 // Spellchecker settings:
721 case RC_ACCEPT_COMPOUND:
722 lexrc >> spellchecker_accept_compound;
724 case RC_USE_NATIVE_FILEDIALOG:
725 lexrc >> use_native_filedialog;
727 case RC_USE_SYSTEM_COLORS:
728 lexrc >> use_system_colors;
731 lexrc >> use_tooltip;
733 case RC_SPELLCHECKER:
734 lexrc >> spellchecker;
737 lexrc >> spellchecker_alt_lang;
740 lexrc >> spellchecker_esc_chars;
742 case RC_SPELLCHECK_CONTINUOUSLY:
743 lexrc >> spellcheck_continuously;
745 case RC_SPELLCHECK_NOTES:
746 lexrc >> spellcheck_notes;
749 lexrc >> make_backup;
751 case RC_SAVE_COMPRESSED:
752 lexrc >> save_compressed;
755 lexrc >> save_origin;
757 case RC_BACKUPDIR_PATH:
759 backupdir_path = os::internal_path(lexrc.getString());
761 case RC_DEFAULT_DECIMAL_SEP:
762 lexrc >> default_decimal_sep;
764 case RC_DEFAULT_LENGTH_UNIT:
766 default_length_unit = (Length::UNIT) lexrc.getInteger();
768 case RC_LANGUAGE_CUSTOM_PACKAGE:
769 lexrc >> language_custom_package;
771 case RC_LANGUAGE_AUTO_BEGIN:
772 lexrc >> language_auto_begin;
774 case RC_LANGUAGE_AUTO_END:
775 lexrc >> language_auto_end;
777 case RC_LANGUAGE_GLOBAL_OPTIONS:
778 lexrc >> language_global_options;
780 case RC_LANGUAGE_PACKAGE_SELECTION:
782 switch (lexrc.getInteger()) {
784 language_package_selection = LP_AUTO;
787 language_package_selection = LP_BABEL;
790 language_package_selection = LP_CUSTOM;
793 language_package_selection = LP_NONE;
798 case RC_LANGUAGE_COMMAND_BEGIN:
799 lexrc >> language_command_begin;
801 case RC_LANGUAGE_COMMAND_END:
802 lexrc >> language_command_end;
804 case RC_LANGUAGE_COMMAND_LOCAL:
805 lexrc >> language_command_local;
807 case RC_RESPECT_OS_KBD_LANGUAGE:
808 lexrc >> respect_os_kbd_language;
810 case RC_VISUAL_CURSOR:
811 lexrc >> visual_cursor;
813 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
814 lexrc >> close_buffer_with_last_view;
817 lexrc >> auto_number;
819 case RC_MARK_FOREIGN_LANGUAGE:
820 lexrc >> mark_foreign_language;
826 fmt = lexrc.getString();
827 if (lexrc.next(true))
828 command = lexrc.getString();
829 setMover(fmt, command);
834 string from, to, command, flags;
836 from = lexrc.getString();
838 to = lexrc.getString();
839 if (lexrc.next(true))
840 command = lexrc.getString();
842 flags = lexrc.getString();
844 theConverters().erase(from, to);
846 theConverters().add(from, to, command, flags);
849 // compatibility with versions older than 1.4.0 only
851 string format, command;
852 lexrc >> format >> command;
853 theFormats().setViewer(format, command);
856 case RC_FILEFORMAT: {
858 string format, extensions, shortcut;
859 docstring prettyname;
860 if (!(lexrc >> format >> extensions))
862 if (ok && lexrc.next(true))
863 prettyname = lexrc.getDocString();
867 if(!(lexrc >> shortcut))
869 string viewer, editor;
870 if (ok && lexrc.next(true))
871 viewer = lexrc.getString();
874 if (ok && lexrc.next(true))
875 editor = lexrc.getString();
879 if (!(lexrc >> flags >> mime))
881 int flgs = Format::none;
882 while (!flags.empty()) {
884 flags = split(flags, flag, ',');
885 if (flag == "document")
886 flgs |= Format::document;
887 else if (flag == "vector")
888 flgs |= Format::vector;
889 else if (flag == "zipped=native")
890 flgs |= Format::zipped_native;
891 else if (flag == "menu=export")
892 flgs |= Format::export_menu;
893 else if (flag == "menu=none")
894 flgs |= Format::no_menu;
896 LYXERR0("Ignoring unknown flag `"
897 << flag << "' for format `"
901 LYXERR0("Syntax error in format " << format);
902 else if (prettyname.empty()) {
903 if (theConverters().formatIsUsed(format))
904 LYXERR0("Can't delete format " << format);
906 theFormats().erase(format);
908 theFormats().add(format, extensions, prettyname,
909 shortcut, viewer, editor, mime, flgs);
913 case RC_VIEWER_ALTERNATIVES: {
914 string format, command;
915 if ((lexrc >> format) && lexrc.next(true)) {
916 command = lexrc.getString();
917 viewer_alternatives[format].insert(command);
921 case RC_EDITOR_ALTERNATIVES: {
922 string format, command;
923 if ((lexrc >> format) && lexrc.next(true)) {
924 command = lexrc.getString();
925 editor_alternatives[format].insert(command);
930 case RC_DEFAULT_OTF_VIEW_FORMAT:
931 lexrc >> default_otf_view_format;
934 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
935 lexrc >> default_platex_view_format;
938 case RC_DEFAULT_VIEW_FORMAT:
939 lexrc >> default_view_format;
942 case RC_GUI_LANGUAGE:
943 lexrc >> gui_language;
947 lexrc >> show_banner;
952 string const tmp = lexrc.getString();
953 if (tmp == "true" || tmp == "on")
954 preview = PREVIEW_ON;
955 else if (tmp == "no_math")
956 preview = PREVIEW_NO_MATH;
958 preview = PREVIEW_OFF;
959 if (tmp != "false" && tmp != "off")
960 LYXERR0("Unrecognized preview status \""
966 case RC_PREVIEW_HASHED_LABELS:
967 lexrc >> preview_hashed_labels;
970 case RC_PREVIEW_SCALE_FACTOR:
971 lexrc >> preview_scale_factor;
980 case RC_USER_INITIALS:
981 lexrc >> user_initials;
985 lexrc >> path_prefix;
988 case RC_USE_CONVERTER_CACHE:
989 lexrc >> use_converter_cache;
991 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
992 lexrc >> use_converter_needauth_forbidden;
994 case RC_USE_CONVERTER_NEEDAUTH:
995 lexrc >> use_converter_needauth;
997 case RC_CONVERTER_CACHE_MAXAGE:
998 lexrc >> converter_cache_maxage;
1001 case RC_SORT_LAYOUTS:
1002 lexrc >> sort_layouts;
1004 case RC_GROUP_LAYOUTS:
1005 lexrc >> group_layouts;
1007 case RC_FULL_SCREEN_LIMIT:
1008 lexrc >> full_screen_limit;
1010 case RC_FULL_SCREEN_TOOLBARS:
1011 lexrc >> full_screen_toolbars;
1013 case RC_FULL_SCREEN_SCROLLBAR:
1014 lexrc >> full_screen_scrollbar;
1016 case RC_FULL_SCREEN_STATUSBAR:
1017 lexrc >> full_screen_statusbar;
1019 case RC_FULL_SCREEN_TABBAR:
1020 lexrc >> full_screen_tabbar;
1022 case RC_FULL_SCREEN_MENUBAR:
1023 lexrc >> full_screen_menubar;
1025 case RC_FULL_SCREEN_WIDTH:
1026 lexrc >> full_screen_width;
1028 case RC_OPEN_BUFFERS_IN_TABS:
1029 lexrc >> open_buffers_in_tabs;
1031 case RC_SINGLE_CLOSE_TAB_BUTTON:
1032 lexrc >> single_close_tab_button;
1034 case RC_SINGLE_INSTANCE:
1035 lexrc >> single_instance;
1036 if (run_mode == PREFERRED)
1037 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1039 case RC_FORWARD_SEARCH_DVI:
1040 if (lexrc.next(true))
1041 forward_search_dvi = lexrc.getString();
1043 case RC_FORWARD_SEARCH_PDF:
1044 if (lexrc.next(true))
1045 forward_search_pdf = lexrc.getString();
1047 case RC_EXPORT_OVERWRITE:
1049 string const tmp = lexrc.getString();
1050 if (tmp == "all" || tmp == "true")
1051 export_overwrite = ALL_FILES;
1052 else if (tmp == "main")
1053 export_overwrite = MAIN_FILE;
1055 export_overwrite = NO_FILES;
1056 if (tmp != "ask" && tmp != "false")
1057 LYXERR0("Unrecognized export_overwrite status \""
1062 case RC_SCROLL_WHEEL_ZOOM:
1064 string const tmp = lexrc.getString();
1066 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1067 else if (tmp == "shift")
1068 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1069 else if (tmp == "alt")
1070 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1072 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1073 if (tmp != "off" && tmp != "false")
1074 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1080 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1081 lexrc >> mouse_middlebutton_paste;
1085 break; // this is just a dummy
1088 // This is triggered the first time through the loop unless
1089 // we hit a format tag.
1090 if (check_format && rc_format != LYXRC_FILEFORMAT)
1091 return FormatMismatch;
1094 /// Update converters data-structures
1095 theConverters().update(theFormats());
1096 theConverters().buildGraph();
1097 theBufferList().invalidateConverterCache();
1103 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1105 ofstream ofs(filename.toFilesystemEncoding().c_str());
1107 write(ofs, ignore_system_lyxrc);
1111 void LyXRC::print() const
1113 if (lyxerr.debugging())
1114 write(lyxerr, false);
1122 typedef pair<string, SpecialisedMover> Data;
1124 SameMover(Data const & comparison)
1125 : comparison_(comparison) {}
1127 bool operator()(Data const & data) const
1129 return data.first == comparison_.first &&
1130 data.second.command() == comparison_.second.command();
1140 // Escape \ and " so that LyXLex can read the string later
1141 string escapeCommand(string const & str) {
1142 return subst(subst(str , "\\", "\\\\"),
1149 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1151 LyXRCTags tag = RC_LAST;
1153 if (!name.empty()) {
1154 for (int i = 0; i != lyxrcCount; ++i)
1155 if ("\\" + name == lyxrcTags[i].tag)
1156 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1160 os << "# LyX " << lyx_version
1161 << " generated this file. If you want to make your own\n"
1162 << "# modifications you should do them from inside LyX and save.\n\n"
1163 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1165 // Why the switch you might ask. It is a trick to ensure that all
1166 // the elements in the LyXRCTags enum are handled. As you can see
1167 // there are no breaks at all. So it is just a huge fall-through.
1168 // The nice thing is that we will get a warning from the compiler
1169 // if we forget an element.
1173 // input/include files are not done here
1174 case RC_LYXRCFORMAT:
1176 if (ignore_system_lyxrc ||
1177 bind_file != system_lyxrc.bind_file) {
1178 string const path = os::external_path(bind_file);
1179 os << "\\bind_file \"" << path << "\"\n";
1185 if (ignore_system_lyxrc ||
1186 def_file != system_lyxrc.def_file) {
1187 string const path = os::external_path(def_file);
1188 os << "\\def_file \"" << path << "\"\n";
1197 << "# MISC SECTION ######################################\n"
1199 // bind files are not done here.
1201 case RC_PATH_PREFIX:
1202 if (ignore_system_lyxrc ||
1203 path_prefix != system_lyxrc.path_prefix) {
1204 os << "\\path_prefix \"" << path_prefix << "\"\n";
1210 if (ignore_system_lyxrc ||
1211 ui_file != system_lyxrc.ui_file) {
1212 string const path = os::external_path(ui_file);
1213 os << "\\ui_file \"" << path << "\"\n";
1218 case RC_AUTOREGIONDELETE:
1219 if (ignore_system_lyxrc ||
1220 auto_region_delete != system_lyxrc.auto_region_delete) {
1221 os << "# Set to false to inhibit automatic replacement of\n"
1222 << "# the current selection.\n"
1223 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1229 case RC_AUTORESET_OPTIONS:
1230 if (ignore_system_lyxrc ||
1231 auto_reset_options != system_lyxrc.auto_reset_options) {
1232 os << "# Set to false to inhibit automatic reset of\n"
1233 << "# the class options to defaults on class change.\n"
1234 << "\\auto_reset_options "
1235 << convert<string>(auto_reset_options)
1242 if (ignore_system_lyxrc ||
1243 autosave != system_lyxrc.autosave) {
1244 os << "# The time interval between auto-saves in seconds.\n"
1245 << "\\autosave " << autosave << '\n';
1250 case RC_DISPLAY_GRAPHICS:
1251 if (ignore_system_lyxrc ||
1252 display_graphics != system_lyxrc.display_graphics) {
1253 os << "# Display graphics within LyX\n"
1255 << "\\display_graphics "
1256 << (display_graphics ? "true" : "false")
1262 case RC_SORT_LAYOUTS:
1263 if (ignore_system_lyxrc ||
1264 sort_layouts != system_lyxrc.sort_layouts) {
1265 os << "# Sort layouts alphabetically.\n"
1266 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1271 case RC_GROUP_LAYOUTS:
1272 if (ignore_system_lyxrc ||
1273 group_layouts != system_lyxrc.group_layouts) {
1274 os << "# Group layouts by their category.\n"
1275 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1280 case RC_VIEWDVI_PAPEROPTION:
1281 if (ignore_system_lyxrc ||
1282 view_dvi_paper_option
1283 != system_lyxrc.view_dvi_paper_option) {
1284 os << "# Options used to specify paper size to the\n"
1285 << "# view_dvi_command (e.g. -paper)\n"
1286 << "\\view_dvi_paper_option \""
1287 << view_dvi_paper_option << "\"\n";
1292 case RC_CHKTEX_COMMAND:
1293 if (ignore_system_lyxrc ||
1294 chktex_command != system_lyxrc.chktex_command) {
1295 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1300 case RC_BIBTEX_ALTERNATIVES: {
1301 CommandSet::const_iterator it = bibtex_alternatives.begin();
1302 CommandSet::const_iterator end = bibtex_alternatives.end();
1303 for ( ; it != end; ++it) {
1304 if (ignore_system_lyxrc
1305 || !system_lyxrc.bibtex_alternatives.count(*it))
1306 os << "\\bibtex_alternatives \""
1313 case RC_BIBTEX_COMMAND:
1314 if (ignore_system_lyxrc ||
1315 bibtex_command != system_lyxrc.bibtex_command) {
1316 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1321 case RC_JBIBTEX_COMMAND:
1322 if (ignore_system_lyxrc ||
1323 jbibtex_command != system_lyxrc.jbibtex_command) {
1324 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1329 case RC_JBIBTEX_ALTERNATIVES: {
1330 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1331 CommandSet::const_iterator end = jbibtex_alternatives.end();
1332 for ( ; it != end; ++it) {
1333 if (ignore_system_lyxrc
1334 || !system_lyxrc.jbibtex_alternatives.count(*it))
1335 os << "\\jbibtex_alternatives \""
1342 case RC_INDEX_ALTERNATIVES: {
1343 CommandSet::const_iterator it = index_alternatives.begin();
1344 CommandSet::const_iterator end = index_alternatives.end();
1345 for ( ; it != end; ++it) {
1346 if (ignore_system_lyxrc
1347 || !system_lyxrc.index_alternatives.count(*it))
1348 os << "\\index_alternatives \""
1355 case RC_INDEX_COMMAND:
1356 if (ignore_system_lyxrc ||
1357 index_command != system_lyxrc.index_command) {
1358 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1363 case RC_JINDEX_COMMAND:
1364 if (ignore_system_lyxrc ||
1365 jindex_command != system_lyxrc.jindex_command) {
1366 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1371 case RC_SPLITINDEX_COMMAND:
1372 if (ignore_system_lyxrc ||
1373 splitindex_command != system_lyxrc.splitindex_command) {
1374 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1379 case RC_NOMENCL_COMMAND:
1380 if (ignore_system_lyxrc ||
1381 nomencl_command != system_lyxrc.nomencl_command) {
1382 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1387 case RC_PYGMENTIZE_COMMAND:
1388 if (ignore_system_lyxrc ||
1389 pygmentize_command != system_lyxrc.pygmentize_command) {
1390 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1395 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1396 // Don't write this setting to the preferences file,
1397 // but allow temporary changes (bug 7557).
1398 if (ignore_system_lyxrc) {
1399 os << "\\tex_expects_windows_paths "
1400 << convert<string>(windows_style_tex_paths) << '\n';
1405 case RC_TEX_ALLOWS_SPACES:
1406 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1407 os << "\\tex_allows_spaces "
1408 << convert<string>(tex_allows_spaces) << '\n';
1414 if (ignore_system_lyxrc ||
1415 use_kbmap != system_lyxrc.use_kbmap) {
1416 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1421 case RC_KBMAP_PRIMARY:
1422 if (ignore_system_lyxrc ||
1423 primary_kbmap != system_lyxrc.primary_kbmap) {
1424 string const path = os::external_path(primary_kbmap);
1425 os << "\\kbmap_primary \"" << path << "\"\n";
1430 case RC_KBMAP_SECONDARY:
1431 if (ignore_system_lyxrc ||
1432 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1433 string const path = os::external_path(secondary_kbmap);
1434 os << "\\kbmap_secondary \"" << path << "\"\n";
1440 if (ignore_system_lyxrc ||
1441 lyxpipes != system_lyxrc.lyxpipes) {
1442 string const path = os::external_path(lyxpipes);
1443 os << "\\serverpipe \"" << path << "\"\n";
1449 os << "\\user_name \"" << user_name << "\"\n";
1454 os << "\\user_email \"" << user_email << "\"\n";
1458 case RC_USER_INITIALS:
1459 os << "\\user_initials \"" << user_initials << "\"\n";
1463 case RC_SHOW_BANNER:
1464 if (ignore_system_lyxrc ||
1465 show_banner != system_lyxrc.show_banner) {
1466 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1472 if (ignore_system_lyxrc ||
1473 preview != system_lyxrc.preview) {
1479 case PREVIEW_NO_MATH:
1486 os << "\\preview " << status << '\n';
1491 case RC_PREVIEW_HASHED_LABELS:
1492 if (ignore_system_lyxrc ||
1493 preview_hashed_labels !=
1494 system_lyxrc.preview_hashed_labels) {
1495 os << "\\preview_hashed_labels "
1496 << convert<string>(preview_hashed_labels) << '\n';
1501 case RC_PREVIEW_SCALE_FACTOR:
1502 if (ignore_system_lyxrc ||
1503 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1504 os << "\\preview_scale_factor "
1505 << preview_scale_factor << '\n';
1510 case RC_USE_CONVERTER_CACHE:
1511 if (ignore_system_lyxrc ||
1512 use_converter_cache != system_lyxrc.use_converter_cache) {
1513 os << "\\use_converter_cache "
1514 << convert<string>(use_converter_cache) << '\n';
1519 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1520 if (ignore_system_lyxrc ||
1521 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1522 os << "\\use_converter_needauth_forbidden "
1523 << convert<string>(use_converter_needauth_forbidden) << '\n';
1528 case RC_USE_CONVERTER_NEEDAUTH:
1529 if (ignore_system_lyxrc ||
1530 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1531 os << "\\use_converter_needauth "
1532 << convert<string>(use_converter_needauth) << '\n';
1537 case RC_CONVERTER_CACHE_MAXAGE:
1538 if (ignore_system_lyxrc ||
1539 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1540 os << "\\converter_cache_maxage "
1541 << converter_cache_maxage << '\n';
1547 << "# SCREEN & FONTS SECTION ############################\n"
1551 if (ignore_system_lyxrc ||
1552 icon_set != system_lyxrc.icon_set) {
1553 os << "\\icon_set \"" << icon_set
1559 case RC_USE_SYSTEM_THEME_ICONS:
1560 if (ignore_system_lyxrc ||
1561 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1562 os << "\\use_system_theme_icons "
1563 << convert<string>(use_system_theme_icons)
1570 if (ignore_system_lyxrc ||
1571 dpi != system_lyxrc.dpi) {
1572 os << "\\screen_dpi " << dpi << '\n';
1577 case RC_SCREEN_ZOOM:
1578 if (ignore_system_lyxrc ||
1579 defaultZoom != system_lyxrc.defaultZoom) {
1580 os << "\\screen_zoom " << defaultZoom << '\n';
1585 case RC_GEOMETRY_SESSION:
1586 if (ignore_system_lyxrc ||
1587 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1588 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1594 case RC_CT_ADDITIONS_UNDERLINED:
1595 if (ignore_system_lyxrc ||
1596 ct_additions_underlined
1597 != system_lyxrc.ct_additions_underlined) {
1598 os << "\\ct_additions_underlined "
1599 << convert<string>(ct_additions_underlined) << '\n';
1604 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1605 if (ignore_system_lyxrc ||
1606 cursor_follows_scrollbar
1607 != system_lyxrc.cursor_follows_scrollbar) {
1608 os << "\\cursor_follows_scrollbar "
1609 << convert<string>(cursor_follows_scrollbar) << '\n';
1614 case RC_CURSOR_WIDTH:
1615 if (ignore_system_lyxrc ||
1617 != system_lyxrc.cursor_width) {
1618 os << "\\cursor_width "
1619 << cursor_width << '\n';
1624 case RC_SCROLL_BELOW_DOCUMENT:
1625 if (ignore_system_lyxrc ||
1626 scroll_below_document
1627 != system_lyxrc.scroll_below_document) {
1628 os << "\\scroll_below_document "
1629 << convert<string>(scroll_below_document) << '\n';
1634 case RC_PARAGRAPH_MARKERS:
1635 if (ignore_system_lyxrc ||
1637 != system_lyxrc.paragraph_markers) {
1638 os << "\\paragraph_markers "
1639 << convert<string>(paragraph_markers) << '\n';
1644 case RC_MAC_DONTSWAP_CTRL_META:
1645 if (ignore_system_lyxrc ||
1646 mac_dontswap_ctrl_meta
1647 != system_lyxrc.mac_dontswap_ctrl_meta) {
1648 os << "\\mac_dontswap_ctrl_meta "
1649 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1654 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1655 if (ignore_system_lyxrc ||
1656 mac_like_cursor_movement
1657 != system_lyxrc.mac_like_cursor_movement) {
1658 os << "\\mac_like_cursor_movement "
1659 << convert<string>(mac_like_cursor_movement) << '\n';
1664 case RC_MACRO_EDIT_STYLE:
1665 if (ignore_system_lyxrc ||
1667 != system_lyxrc.macro_edit_style) {
1668 os << "\\macro_edit_style ";
1669 switch (macro_edit_style) {
1670 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1671 case MACRO_EDIT_INLINE: os << "1\n"; break;
1672 case MACRO_EDIT_LIST: os << "2\n"; break;
1678 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1679 if (ignore_system_lyxrc ||
1680 dialogs_iconify_with_main
1681 != system_lyxrc.dialogs_iconify_with_main) {
1682 os << "\\dialogs_iconify_with_main "
1683 << convert<string>(dialogs_iconify_with_main) << '\n';
1688 case RC_SCREEN_FONT_ROMAN:
1689 if (ignore_system_lyxrc ||
1690 roman_font_name != system_lyxrc.roman_font_name) {
1691 os << "\\screen_font_roman \"" << roman_font_name
1697 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1698 if (ignore_system_lyxrc ||
1699 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1700 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1706 case RC_SCREEN_FONT_SANS:
1707 if (ignore_system_lyxrc ||
1708 sans_font_name != system_lyxrc.sans_font_name) {
1709 os << "\\screen_font_sans \"" << sans_font_name
1715 case RC_SCREEN_FONT_SANS_FOUNDRY:
1716 if (ignore_system_lyxrc ||
1717 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1718 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1724 case RC_SCREEN_FONT_TYPEWRITER:
1725 if (ignore_system_lyxrc ||
1726 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1727 os << "\\screen_font_typewriter \""
1728 << typewriter_font_name << "\"\n";
1733 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1734 if (ignore_system_lyxrc ||
1735 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1736 os << "\\screen_font_typewriter_foundry \""
1737 << typewriter_font_foundry << "\"\n";
1742 case RC_SCREEN_FONT_SCALABLE:
1743 if (ignore_system_lyxrc ||
1744 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1745 os << "\\screen_font_scalable "
1746 << convert<string>(use_scalable_fonts)
1752 case RC_SCREEN_FONT_SIZES:
1753 if (ignore_system_lyxrc ||
1754 font_sizes[TINY_SIZE]
1755 != system_lyxrc.font_sizes[TINY_SIZE] ||
1756 font_sizes[SCRIPT_SIZE]
1757 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1758 font_sizes[FOOTNOTE_SIZE]
1759 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1760 font_sizes[SMALL_SIZE]
1761 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1762 font_sizes[NORMAL_SIZE]
1763 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1764 font_sizes[LARGE_SIZE]
1765 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1766 font_sizes[LARGER_SIZE]
1767 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1768 font_sizes[LARGEST_SIZE]
1769 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1770 font_sizes[HUGE_SIZE]
1771 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1772 font_sizes[HUGER_SIZE]
1773 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1774 streamsize old_prec = os.precision();
1775 os.setf(ios::fixed);
1777 os << "\\screen_font_sizes"
1778 << ' ' << font_sizes[TINY_SIZE]
1779 << ' ' << font_sizes[SCRIPT_SIZE]
1780 << ' ' << font_sizes[FOOTNOTE_SIZE]
1781 << ' ' << font_sizes[SMALL_SIZE]
1782 << ' ' << font_sizes[NORMAL_SIZE]
1783 << ' ' << font_sizes[LARGE_SIZE]
1784 << ' ' << font_sizes[LARGER_SIZE]
1785 << ' ' << font_sizes[LARGEST_SIZE]
1786 << ' ' << font_sizes[HUGE_SIZE]
1787 << ' ' << font_sizes[HUGER_SIZE]
1789 os.precision(old_prec);
1790 os.unsetf(ios::fixed);
1795 case RC_FULL_SCREEN_LIMIT:
1796 if (ignore_system_lyxrc ||
1797 full_screen_limit != system_lyxrc.full_screen_limit) {
1798 os << "\\fullscreen_limit "
1799 << convert<string>(full_screen_limit)
1805 case RC_FULL_SCREEN_TOOLBARS:
1806 if (ignore_system_lyxrc ||
1807 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1808 os << "\\fullscreen_toolbars "
1809 << convert<string>(full_screen_toolbars)
1815 case RC_FULL_SCREEN_SCROLLBAR:
1816 if (ignore_system_lyxrc ||
1817 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1818 os << "\\fullscreen_scrollbar "
1819 << convert<string>(full_screen_scrollbar)
1825 case RC_FULL_SCREEN_STATUSBAR:
1826 if (ignore_system_lyxrc ||
1827 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1828 os << "\\fullscreen_statusbar "
1829 << convert<string>(full_screen_statusbar)
1835 case RC_FULL_SCREEN_TABBAR:
1836 if (ignore_system_lyxrc ||
1837 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1838 os << "\\fullscreen_tabbar "
1839 << convert<string>(full_screen_tabbar)
1845 case RC_FULL_SCREEN_MENUBAR:
1846 if (ignore_system_lyxrc ||
1847 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1848 os << "\\fullscreen_menubar "
1849 << convert<string>(full_screen_menubar)
1855 case RC_FULL_SCREEN_WIDTH:
1856 if (ignore_system_lyxrc ||
1857 full_screen_width != system_lyxrc.full_screen_width) {
1858 os << "\\fullscreen_width "
1859 << convert<string>(full_screen_width)
1865 case RC_OPEN_BUFFERS_IN_TABS:
1866 if (ignore_system_lyxrc ||
1867 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1868 os << "\\open_buffers_in_tabs "
1869 << convert<string>(open_buffers_in_tabs)
1875 case RC_SINGLE_CLOSE_TAB_BUTTON:
1876 if (ignore_system_lyxrc ||
1877 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1878 os << "\\single_close_tab_button "
1879 << convert<string>(single_close_tab_button)
1885 case RC_SINGLE_INSTANCE:
1886 if (ignore_system_lyxrc ||
1887 single_instance != system_lyxrc.single_instance) {
1888 os << "\\single_instance "
1889 << convert<string>(single_instance)
1895 case RC_FORWARD_SEARCH_DVI:
1896 if (ignore_system_lyxrc ||
1897 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1898 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1903 case RC_FORWARD_SEARCH_PDF:
1904 if (ignore_system_lyxrc ||
1905 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1906 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1912 << "# COLOR SECTION ###################################\n"
1917 for (int i = 0; i < Color_ignore; ++i) {
1918 ColorCode lc = static_cast<ColorCode>(i);
1919 string const col = lcolor.getX11Name(lc);
1920 if (ignore_system_lyxrc
1921 || col != system_lcolor.getX11Name(lc)) {
1922 os << "\\set_color \""
1923 << lcolor.getLyXName(lc) << "\" \""
1931 << "# PRINTER SECTION ###################################\n"
1935 case RC_PRINTLANDSCAPEFLAG:
1936 if (ignore_system_lyxrc ||
1937 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1938 os << "\\print_landscape_flag \"" << print_landscape_flag
1944 case RC_PRINTPAPERFLAG:
1945 if (ignore_system_lyxrc ||
1946 print_paper_flag != system_lyxrc.print_paper_flag) {
1947 os << "\\print_paper_flag \"" << print_paper_flag
1953 case RC_PRINTPAPERDIMENSIONFLAG:
1954 if (ignore_system_lyxrc ||
1955 print_paper_dimension_flag
1956 != system_lyxrc.print_paper_dimension_flag) {
1957 os << "\\print_paper_dimension_flag \""
1958 << print_paper_dimension_flag << "\"\n";
1964 << "# TEX SECTION #######################################\n"
1968 case RC_TEXINPUTS_PREFIX:
1969 if (ignore_system_lyxrc ||
1970 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1971 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1977 << "# FILE SECTION ######################################\n"
1980 case RC_DOCUMENTPATH:
1981 if (ignore_system_lyxrc ||
1982 document_path != system_lyxrc.document_path) {
1983 string const path = os::external_path(document_path);
1984 os << "\\document_path \"" << path << "\"\n";
1989 case RC_USELASTFILEPOS:
1990 if (ignore_system_lyxrc ||
1991 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1992 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1998 case RC_LOADSESSION:
1999 if (ignore_system_lyxrc ||
2000 load_session != system_lyxrc.load_session) {
2001 os << "\\load_session " << convert<string>(load_session)
2007 case RC_MOUSE_WHEEL_SPEED:
2008 if (ignore_system_lyxrc ||
2009 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2010 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2015 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2016 if (ignore_system_lyxrc ||
2017 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2018 os << "\\mouse_middlebutton_paste "
2019 << convert<string>(mouse_middlebutton_paste) << '\n';
2024 case RC_COMPLETION_INLINE_DELAY:
2025 if (ignore_system_lyxrc ||
2026 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2027 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2032 case RC_COMPLETION_INLINE_MATH:
2033 if (ignore_system_lyxrc ||
2034 completion_inline_math != system_lyxrc.completion_inline_math) {
2035 os << "\\completion_inline_math "
2036 << convert<string>(completion_inline_math) << '\n';
2041 case RC_COMPLETION_INLINE_TEXT:
2042 if (ignore_system_lyxrc ||
2043 completion_inline_text != system_lyxrc.completion_inline_text) {
2044 os << "\\completion_inline_text "
2045 << convert<string>(completion_inline_text) << '\n';
2050 case RC_COMPLETION_INLINE_DOTS:
2051 if (ignore_system_lyxrc ||
2052 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2053 os << "\\completion_inline_dots "
2054 << convert<string>(completion_inline_dots) << '\n';
2059 case RC_AUTOCORRECTION_MATH:
2060 if (ignore_system_lyxrc ||
2061 autocorrection_math != system_lyxrc.autocorrection_math) {
2062 os << "\\autocorrection_math "
2063 << convert<string>(autocorrection_math) << '\n';
2068 case RC_COMPLETION_POPUP_DELAY:
2069 if (ignore_system_lyxrc ||
2070 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2071 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2076 case RC_COMPLETION_POPUP_MATH:
2077 if (ignore_system_lyxrc ||
2078 completion_popup_math != system_lyxrc.completion_popup_math) {
2079 os << "\\completion_popup_math "
2080 << convert<string>(completion_popup_math) << '\n';
2085 case RC_COMPLETION_POPUP_TEXT:
2086 if (ignore_system_lyxrc ||
2087 completion_popup_text != system_lyxrc.completion_popup_text) {
2088 os << "\\completion_popup_text "
2089 << convert<string>(completion_popup_text) << '\n';
2094 case RC_COMPLETION_CURSOR_TEXT:
2095 if (ignore_system_lyxrc ||
2096 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2097 os << "\\completion_cursor_text "
2098 << convert<string>(completion_cursor_text) << '\n';
2103 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2104 if (ignore_system_lyxrc ||
2105 completion_popup_after_complete
2106 != system_lyxrc.completion_popup_after_complete) {
2107 os << "\\completion_popup_after_complete "
2108 << convert<string>(completion_popup_after_complete) << '\n';
2113 case RC_COMPLETION_MINLENGTH:
2114 if (ignore_system_lyxrc ||
2115 completion_minlength != system_lyxrc.completion_minlength) {
2116 os << "\\completion_minlength " << convert<string>(completion_minlength)
2122 case RC_NUMLASTFILES:
2123 if (ignore_system_lyxrc ||
2124 num_lastfiles != system_lyxrc.num_lastfiles) {
2125 os << "\\num_lastfiles " << num_lastfiles << '\n';
2130 case RC_CHECKLASTFILES:
2131 if (ignore_system_lyxrc ||
2132 check_lastfiles != system_lyxrc.check_lastfiles) {
2133 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2139 case RC_EXAMPLEPATH:
2140 if (ignore_system_lyxrc ||
2141 example_path != system_lyxrc.example_path) {
2142 string const path = os::external_path(example_path);
2143 os << "\\example_path \"" << path << "\"\n";
2148 case RC_TEMPLATEPATH:
2149 if (ignore_system_lyxrc ||
2150 template_path != system_lyxrc.template_path) {
2151 string const path = os::external_path(template_path);
2152 os << "\\template_path \"" << path << "\"\n";
2157 case RC_TEMPDIRPATH:
2158 if (ignore_system_lyxrc ||
2159 tempdir_path != system_lyxrc.tempdir_path) {
2160 string const path = os::external_path(tempdir_path);
2161 os << "\\tempdir_path \"" << path << "\"\n";
2166 case RC_THESAURUSDIRPATH:
2167 if (ignore_system_lyxrc ||
2168 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2169 string const path = os::external_path(thesaurusdir_path);
2170 os << "\\thesaurusdir_path \"" << path << "\"\n";
2175 case RC_HUNSPELLDIR_PATH:
2176 if (ignore_system_lyxrc ||
2177 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2178 string const path = os::external_path(hunspelldir_path);
2179 os << "\\hunspelldir_path \"" << path << "\"\n";
2184 case RC_PLAINTEXT_LINELEN:
2185 if (ignore_system_lyxrc ||
2186 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2187 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2192 case RC_MAKE_BACKUP:
2193 if (ignore_system_lyxrc ||
2194 make_backup != system_lyxrc.make_backup) {
2195 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2200 case RC_SAVE_COMPRESSED:
2201 if (ignore_system_lyxrc ||
2202 save_compressed != system_lyxrc.save_compressed) {
2203 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2208 case RC_SAVE_ORIGIN:
2209 if (ignore_system_lyxrc ||
2210 save_origin != system_lyxrc.save_origin) {
2211 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2216 case RC_BACKUPDIR_PATH:
2217 if (ignore_system_lyxrc ||
2218 backupdir_path != system_lyxrc.backupdir_path) {
2219 string const path = os::external_path(backupdir_path);
2220 os << "\\backupdir_path \"" << path << "\"\n";
2226 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2230 << "# SPELLCHECKER SECTION ##############################\n"
2234 case RC_ACCEPT_COMPOUND:
2235 if (ignore_system_lyxrc ||
2236 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2237 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2244 if (ignore_system_lyxrc ||
2245 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2246 os << "\\alternate_language \"" << spellchecker_alt_lang
2253 if (ignore_system_lyxrc ||
2254 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2255 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2260 case RC_USE_NATIVE_FILEDIALOG:
2261 if (ignore_system_lyxrc ||
2262 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2263 os << "\\use_native_filedialog "
2264 << convert<string>(use_native_filedialog)
2270 case RC_USE_SYSTEM_COLORS:
2271 if (ignore_system_lyxrc ||
2272 use_system_colors != system_lyxrc.use_system_colors) {
2273 os << "\\use_system_colors "
2274 << convert<string>(use_system_colors)
2280 case RC_USE_TOOLTIP:
2281 if (ignore_system_lyxrc ||
2282 use_tooltip != system_lyxrc.use_tooltip) {
2283 os << "\\use_tooltip "
2284 << convert<string>(use_tooltip)
2292 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2296 case RC_DEFAULT_DECIMAL_SEP:
2297 if (ignore_system_lyxrc ||
2298 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2299 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2304 case RC_DEFAULT_LENGTH_UNIT:
2305 if (ignore_system_lyxrc ||
2306 default_length_unit != system_lyxrc.default_length_unit) {
2307 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2312 case RC_SPELLCHECKER:
2313 if (ignore_system_lyxrc ||
2314 spellchecker != system_lyxrc.spellchecker) {
2315 os << "\\spellchecker " << spellchecker << '\n';
2320 case RC_SPELLCHECK_CONTINUOUSLY:
2321 if (ignore_system_lyxrc ||
2322 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2323 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2329 case RC_SPELLCHECK_NOTES:
2330 if (ignore_system_lyxrc ||
2331 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2332 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2338 case RC_VISUAL_CURSOR:
2339 if (ignore_system_lyxrc ||
2340 visual_cursor != system_lyxrc.visual_cursor) {
2341 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2346 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2347 if (ignore_system_lyxrc ||
2348 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2349 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2350 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2355 case RC_LANGUAGE_CUSTOM_PACKAGE:
2356 if (ignore_system_lyxrc ||
2357 language_custom_package != system_lyxrc.language_custom_package) {
2358 os << "\\language_custom_package \"" << language_custom_package
2364 case RC_LANGUAGE_GLOBAL_OPTIONS:
2365 if (ignore_system_lyxrc ||
2366 language_global_options
2367 != system_lyxrc.language_global_options) {
2368 os << "\\language_global_options \""
2369 << convert<string>(language_global_options)
2375 case RC_LANGUAGE_PACKAGE_SELECTION:
2376 if (ignore_system_lyxrc ||
2377 language_package_selection != system_lyxrc.language_package_selection) {
2378 os << "\\language_package_selection ";
2379 switch (language_package_selection) {
2397 case RC_LANGUAGE_COMMAND_BEGIN:
2398 if (ignore_system_lyxrc ||
2399 language_command_begin
2400 != system_lyxrc.language_command_begin) {
2401 os << "\\language_command_begin \""
2402 << language_command_begin
2408 case RC_LANGUAGE_COMMAND_END:
2409 if (ignore_system_lyxrc ||
2410 language_command_end
2411 != system_lyxrc.language_command_end) {
2412 os << "\\language_command_end \"" << language_command_end
2418 case RC_LANGUAGE_COMMAND_LOCAL:
2419 if (ignore_system_lyxrc ||
2420 language_command_local
2421 != system_lyxrc.language_command_local) {
2422 os << "\\language_command_local \""
2423 << language_command_local
2429 case RC_LANGUAGE_AUTO_BEGIN:
2430 if (ignore_system_lyxrc ||
2431 language_auto_begin != system_lyxrc.language_auto_begin) {
2432 os << "\\language_auto_begin "
2433 << convert<string>(language_auto_begin) << '\n';
2438 case RC_LANGUAGE_AUTO_END:
2439 if (ignore_system_lyxrc ||
2440 language_auto_end != system_lyxrc.language_auto_end) {
2441 os << "\\language_auto_end "
2442 << convert<string>(language_auto_end) << '\n';
2447 case RC_MARK_FOREIGN_LANGUAGE:
2448 if (ignore_system_lyxrc ||
2449 mark_foreign_language
2450 != system_lyxrc.mark_foreign_language) {
2451 os << "\\mark_foreign_language " <<
2452 convert<string>(mark_foreign_language) << '\n';
2455 case RC_RESPECT_OS_KBD_LANGUAGE:
2456 if (ignore_system_lyxrc ||
2457 respect_os_kbd_language
2458 != system_lyxrc.respect_os_kbd_language) {
2459 os << "\\respect_os_kbd_language " <<
2460 convert<string>(respect_os_kbd_language) << '\n';
2467 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2471 case RC_AUTO_NUMBER:
2472 if (ignore_system_lyxrc ||
2473 auto_number != system_lyxrc.auto_number) {
2474 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2479 case RC_GUI_LANGUAGE:
2480 if (ignore_system_lyxrc ||
2481 gui_language != system_lyxrc.gui_language) {
2482 os << "\\gui_language " << gui_language << '\n';
2487 case RC_EXPORT_OVERWRITE:
2488 if (ignore_system_lyxrc ||
2489 export_overwrite != system_lyxrc.export_overwrite) {
2491 switch (export_overwrite) {
2502 os << "\\export_overwrite " << status << '\n';
2507 case RC_SCROLL_WHEEL_ZOOM:
2508 if (ignore_system_lyxrc ||
2509 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2511 switch (scroll_wheel_zoom) {
2512 case SCROLL_WHEEL_ZOOM_OFF:
2515 case SCROLL_WHEEL_ZOOM_CTRL:
2518 case SCROLL_WHEEL_ZOOM_SHIFT:
2521 case SCROLL_WHEEL_ZOOM_ALT:
2525 os << "\\scroll_wheel_zoom " << status << '\n';
2531 << "# FORMATS SECTION ##########################\n"
2536 // New/modified formats
2537 for (Formats::const_iterator cit = theFormats().begin();
2538 cit != theFormats().end(); ++cit) {
2539 Format const * format =
2540 theSystemFormats().getFormat(cit->name());
2542 format->extensions() != cit->extensions() ||
2543 format->prettyname() != cit->prettyname() ||
2544 format->shortcut() != cit->shortcut() ||
2545 format->viewer() != cit->viewer() ||
2546 format->editor() != cit->editor() ||
2547 format->documentFormat() != cit->documentFormat() ||
2548 format->vectorFormat() != cit->vectorFormat() ||
2549 format->inExportMenu() != cit->inExportMenu() ||
2550 format->noMenu() != cit->noMenu() ||
2551 format->mime() != cit->mime()) {
2552 os << "\\format \"" << cit->name() << "\" \""
2553 << cit->extensions() << "\" \""
2554 << to_utf8(cit->prettyname()) << "\" \""
2555 << cit->shortcut() << "\" \""
2556 << escapeCommand(cit->viewer()) << "\" \""
2557 << escapeCommand(cit->editor()) << "\" \"";
2558 vector<string> flags;
2559 if (cit->documentFormat())
2560 flags.push_back("document");
2561 if (cit->vectorFormat())
2562 flags.push_back("vector");
2563 if (cit->zippedNative())
2564 flags.push_back("zipped=native");
2565 if (cit->inExportMenu())
2566 flags.push_back("menu=export");
2568 os << getStringFromVector(flags);
2569 os << "\" \"" << cit->mime() << "\"\n";
2573 // Look for deleted formats
2574 for (Formats::const_iterator cit = theSystemFormats().begin();
2575 cit != theSystemFormats().end(); ++cit)
2576 if (!theFormats().getFormat(cit->name()))
2577 os << "\\format \"" << cit->name()
2578 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2582 case RC_VIEWER_ALTERNATIVES: {
2583 Alternatives::const_iterator it = viewer_alternatives.begin();
2584 Alternatives::const_iterator const en = viewer_alternatives.end();
2585 Alternatives::const_iterator const sysend =
2586 system_lyxrc.viewer_alternatives.end();
2587 for (; it != en; ++it) {
2588 string const & fmt = it->first;
2589 CommandSet const & cmd = it->second;
2590 CommandSet::const_iterator sit = cmd.begin();
2591 CommandSet::const_iterator const sen = cmd.end();
2592 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2593 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2594 system_lyxrc.viewer_alternatives.find(fmt);
2595 for (; sit != sen; ++sit) {
2596 string const & cmd = *sit;
2597 if (ignore_system_lyxrc
2598 || sysfmt == sysend // format not found
2599 || sysfmt->second.count(cmd) == 0 // this command not found
2601 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2608 case RC_EDITOR_ALTERNATIVES: {
2609 Alternatives::const_iterator it = editor_alternatives.begin();
2610 Alternatives::const_iterator const en = editor_alternatives.end();
2611 Alternatives::const_iterator const sysend =
2612 system_lyxrc.editor_alternatives.end();
2613 for (; it != en; ++it) {
2614 string const & fmt = it->first;
2615 CommandSet const & cmd = it->second;
2616 CommandSet::const_iterator sit = cmd.begin();
2617 CommandSet::const_iterator const sen = cmd.end();
2618 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2619 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2620 system_lyxrc.editor_alternatives.find(fmt);
2621 for (; sit != sen; ++sit) {
2622 string const & cmd = *sit;
2623 if (ignore_system_lyxrc
2624 || sysfmt == sysend // format not found
2625 || sysfmt->second.count(cmd) == 0 // this command not found
2627 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2634 case RC_DEFAULT_OTF_VIEW_FORMAT:
2635 if ((ignore_system_lyxrc ||
2636 default_otf_view_format != system_lyxrc.default_otf_view_format)
2637 && !default_otf_view_format.empty()) {
2638 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2643 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2644 if ((ignore_system_lyxrc ||
2645 default_platex_view_format != system_lyxrc.default_platex_view_format)
2646 && !default_platex_view_format.empty()) {
2647 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2652 case RC_DEFAULT_VIEW_FORMAT:
2653 if (ignore_system_lyxrc ||
2654 default_view_format != system_lyxrc.default_view_format) {
2655 os << "\\default_view_format " << default_view_format << '\n';
2666 << "# CONVERTERS SECTION ##########################\n"
2671 // Look for new converters
2672 for (Converters::const_iterator cit = theConverters().begin();
2673 cit != theConverters().end(); ++cit) {
2674 Converter const * converter =
2675 theSystemConverters().getConverter(cit->from(),
2678 converter->command() != cit->command() ||
2679 converter->flags() != cit->flags())
2680 os << "\\converter \"" << cit->from() << "\" \""
2681 << cit->to() << "\" \""
2682 << escapeCommand(cit->command()) << "\" \""
2683 << cit->flags() << "\"\n";
2686 // New/modifed converters
2687 for (Converters::const_iterator cit = theSystemConverters().begin();
2688 cit != theSystemConverters().end(); ++cit)
2689 if (!theConverters().getConverter(cit->from(), cit->to()))
2690 os << "\\converter \"" << cit->from()
2691 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2698 << "# COPIERS SECTION ##########################\n"
2701 // Look for new movers
2702 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2703 Movers::const_iterator const sysend = theSystemMovers().end();
2704 Movers::const_iterator it = theMovers().begin();
2705 Movers::const_iterator end = theMovers().end();
2707 for (; it != end; ++it) {
2708 Movers::const_iterator const sysit =
2709 find_if(sysbegin, sysend, SameMover(*it));
2710 if (sysit == sysend) {
2711 string const & fmt = it->first;
2712 string const & command =
2713 it->second.command();
2715 os << "\\copier " << fmt
2716 << " \"" << escapeCommand(command) << "\"\n";
2722 // We don't actually delete SpecialisedMover(s) from the
2723 // map, just clear their 'command', so there's no need
2724 // to test for anything else.
2731 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2733 // Why the switch you might ask. It is a trick to ensure that all
2734 // the elements in the LyXRCTags enum is handled. As you can see
2735 // there are no breaks at all. So it is just a huge fall-through.
2736 // The nice thing is that we will get a warning from the compiler
2737 // if we forget an element.
2738 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2740 case LyXRC::RC_LAST:
2741 case LyXRC::RC_ACCEPT_COMPOUND:
2742 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2743 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2745 case LyXRC::RC_ALT_LANG:
2746 case LyXRC::RC_PLAINTEXT_LINELEN:
2747 case LyXRC::RC_AUTOCORRECTION_MATH:
2748 case LyXRC::RC_AUTOREGIONDELETE:
2749 case LyXRC::RC_AUTORESET_OPTIONS:
2750 case LyXRC::RC_AUTOSAVE:
2751 case LyXRC::RC_AUTO_NUMBER:
2752 case LyXRC::RC_BACKUPDIR_PATH:
2753 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2754 case LyXRC::RC_BIBTEX_COMMAND:
2755 case LyXRC::RC_BINDFILE:
2756 case LyXRC::RC_CHECKLASTFILES:
2757 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2758 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2759 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2760 case LyXRC::RC_COMPLETION_INLINE_MATH:
2761 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2762 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2763 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2764 case LyXRC::RC_COMPLETION_POPUP_MATH:
2765 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2766 case LyXRC::RC_COMPLETION_MINLENGTH:
2767 case LyXRC::RC_USELASTFILEPOS:
2768 case LyXRC::RC_LOADSESSION:
2769 case LyXRC::RC_CHKTEX_COMMAND:
2770 case LyXRC::RC_CONVERTER:
2771 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2772 case LyXRC::RC_COPIER:
2773 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2774 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2775 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2776 case LyXRC::RC_GUI_LANGUAGE:
2777 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2778 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2779 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2780 case LyXRC::RC_DEFFILE:
2781 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2782 case LyXRC::RC_DISPLAY_GRAPHICS:
2783 case LyXRC::RC_DOCUMENTPATH:
2784 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2785 FileName path(lyxrc_new.document_path);
2786 if (path.exists() && path.isDirectory())
2787 package().document_dir() = FileName(lyxrc.document_path);
2790 case LyXRC::RC_EDITOR_ALTERNATIVES:
2791 case LyXRC::RC_ESC_CHARS:
2792 case LyXRC::RC_EXAMPLEPATH:
2793 case LyXRC::RC_FILEFORMAT:
2794 case LyXRC::RC_GROUP_LAYOUTS:
2795 case LyXRC::RC_HUNSPELLDIR_PATH:
2796 case LyXRC::RC_ICON_SET:
2797 case LyXRC::RC_INDEX_ALTERNATIVES:
2798 case LyXRC::RC_INDEX_COMMAND:
2799 case LyXRC::RC_JBIBTEX_COMMAND:
2800 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2801 case LyXRC::RC_JINDEX_COMMAND:
2802 case LyXRC::RC_NOMENCL_COMMAND:
2803 case LyXRC::RC_PYGMENTIZE_COMMAND:
2804 case LyXRC::RC_INPUT:
2805 case LyXRC::RC_KBMAP:
2806 case LyXRC::RC_KBMAP_PRIMARY:
2807 case LyXRC::RC_KBMAP_SECONDARY:
2808 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2809 case LyXRC::RC_LANGUAGE_AUTO_END:
2810 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2811 case LyXRC::RC_LANGUAGE_COMMAND_END:
2812 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2813 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2814 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2815 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2816 case LyXRC::RC_LYXRCFORMAT:
2817 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2818 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2819 case LyXRC::RC_MACRO_EDIT_STYLE:
2820 case LyXRC::RC_MAKE_BACKUP:
2821 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2822 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2823 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2824 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2825 case LyXRC::RC_NUMLASTFILES:
2826 case LyXRC::RC_PARAGRAPH_MARKERS:
2827 case LyXRC::RC_PATH_PREFIX:
2828 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2829 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2830 // Resets python path
2831 support::os::python(true);
2834 case LyXRC::RC_PREVIEW:
2835 if (lyxrc_orig.preview != lyxrc_new.preview) {
2836 // Update all previews of all documents.
2837 /* FIXME: this can be very expensive. It would be cheaper
2838 * to kill all existing previews and update visible
2840 theBufferList().updatePreviews();
2843 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2844 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2845 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2846 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2847 case LyXRC::RC_PRINTPAPERFLAG:
2848 case LyXRC::RC_SAVE_COMPRESSED:
2849 case LyXRC::RC_SAVE_ORIGIN:
2850 case LyXRC::RC_SCREEN_DPI:
2852 case LyXRC::RC_SCREEN_FONT_ROMAN:
2853 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2854 case LyXRC::RC_SCREEN_FONT_SANS:
2855 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2856 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2857 case LyXRC::RC_SCREEN_FONT_SIZES:
2858 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2859 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2860 case LyXRC::RC_SCREEN_ZOOM:
2861 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2862 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2863 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2864 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2865 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2866 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2867 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2868 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2869 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2870 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2873 case LyXRC::RC_GEOMETRY_SESSION:
2874 case LyXRC::RC_SERVERPIPE:
2875 case LyXRC::RC_SET_COLOR:
2876 case LyXRC::RC_SHOW_BANNER:
2877 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2878 case LyXRC::RC_SPELLCHECKER:
2879 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2882 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2883 case LyXRC::RC_SPELLCHECK_NOTES:
2884 case LyXRC::RC_SPLITINDEX_COMMAND:
2885 case LyXRC::RC_TEMPDIRPATH:
2886 case LyXRC::RC_TEMPLATEPATH:
2887 case LyXRC::RC_TEX_ALLOWS_SPACES:
2888 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2889 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2890 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2893 case LyXRC::RC_TEXINPUTS_PREFIX:
2894 case LyXRC::RC_THESAURUSDIRPATH:
2895 case LyXRC::RC_UIFILE:
2896 case LyXRC::RC_USER_EMAIL:
2897 case LyXRC::RC_USER_INITIALS:
2898 case LyXRC::RC_USER_NAME:
2899 case LyXRC::RC_USE_CONVERTER_CACHE:
2900 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2901 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2902 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2903 case LyXRC::RC_USE_SYSTEM_COLORS:
2904 case LyXRC::RC_USE_TOOLTIP:
2905 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2906 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2907 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2908 case LyXRC::RC_SINGLE_INSTANCE:
2909 case LyXRC::RC_SORT_LAYOUTS:
2910 case LyXRC::RC_FULL_SCREEN_LIMIT:
2911 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2912 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2913 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2914 case LyXRC::RC_FULL_SCREEN_TABBAR:
2915 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2916 case LyXRC::RC_FULL_SCREEN_WIDTH:
2917 case LyXRC::RC_VISUAL_CURSOR:
2918 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2919 case LyXRC::RC_VIEWER:
2920 case LyXRC::RC_VIEWER_ALTERNATIVES:
2921 case LyXRC::RC_FORWARD_SEARCH_DVI:
2922 case LyXRC::RC_FORWARD_SEARCH_PDF:
2923 case LyXRC::RC_EXPORT_OVERWRITE:
2924 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2925 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2926 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2927 case LyXRC::RC_CURSOR_WIDTH:
2933 set<string> LyXRC::getRCs()
2936 for (int i = 0; i != lyxrcCount; ++i)
2937 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2943 string const LyXRC::getDescription(LyXRCTags tag)
2948 case RC_ACCEPT_COMPOUND:
2949 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2953 str = _("Specify an alternate language. The default is to use the language of the document.");
2956 case RC_PLAINTEXT_LINELEN:
2957 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.");
2960 case RC_AUTOREGIONDELETE:
2961 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2964 case RC_AUTORESET_OPTIONS:
2965 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2969 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2972 case RC_AUTO_NUMBER:
2975 case RC_BACKUPDIR_PATH:
2976 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.");
2979 case RC_BIBTEX_COMMAND:
2980 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2983 case RC_JBIBTEX_COMMAND:
2984 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2988 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2991 case RC_CHECKLASTFILES:
2992 str = _("Select to check whether the lastfiles still exist.");
2995 case RC_CHKTEX_COMMAND:
2996 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3002 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3003 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3006 case RC_CONVERTER_NEEDAUTH:
3007 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3013 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3014 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.");
3017 case RC_CURSOR_WIDTH:
3018 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3021 case RC_SCROLL_BELOW_DOCUMENT:
3022 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");
3025 case RC_MAC_DONTSWAP_CTRL_META:
3026 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3029 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3030 str = _("Use the Mac OS X conventions for cursor movement");
3033 case RC_SHOW_MACRO_LABEL:
3034 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3038 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3041 case RC_DEFAULT_OTF_VIEW_FORMAT:
3042 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3045 case RC_DEFAULT_VIEW_FORMAT:
3046 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3049 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3050 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3053 case RC_DISPLAY_GRAPHICS:
3054 str = _("Select how LyX will display any graphics.");
3057 case RC_DOCUMENTPATH:
3058 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3062 str = _("Specify additional chars that can be part of a word.");
3065 case RC_EXAMPLEPATH:
3066 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3072 case RC_INDEX_COMMAND:
3073 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\".");
3076 case RC_JINDEX_COMMAND:
3077 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3080 case RC_NOMENCL_COMMAND:
3081 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3084 case RC_PYGMENTIZE_COMMAND:
3085 str = _("The command to run the python pygments syntax highlighter.");
3092 case RC_KBMAP_PRIMARY:
3093 case RC_KBMAP_SECONDARY:
3094 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.");
3097 case RC_LANGUAGE_AUTO_BEGIN:
3098 str = _("Select if a language switching command is needed at the beginning of the document.");
3101 case RC_LANGUAGE_AUTO_END:
3102 str = _("Select if a language switching command is needed at the end of the document.");
3105 case RC_LANGUAGE_COMMAND_BEGIN:
3106 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.");
3109 case RC_LANGUAGE_COMMAND_END:
3110 str = _("The LaTeX command for changing back to the language of the document.");
3113 case RC_LANGUAGE_COMMAND_LOCAL:
3114 str = _("The LaTeX command for local changing of the language.");
3117 case RC_LANGUAGE_GLOBAL_OPTIONS:
3118 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3121 case RC_LANGUAGE_CUSTOM_PACKAGE:
3122 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3125 case RC_LANGUAGE_PACKAGE_SELECTION:
3126 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3129 case RC_USELASTFILEPOS:
3130 str = _("De-select if you do not want LyX to scroll to saved position.");
3133 case RC_LOADSESSION:
3134 str = _("De-select to prevent loading files opened from the last LyX session.");
3137 case RC_MAKE_BACKUP:
3138 str = _("De-select if you don't want LyX to create backup files.");
3141 case RC_MARK_FOREIGN_LANGUAGE:
3142 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3145 case RC_RESPECT_OS_KBD_LANGUAGE:
3146 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3149 case RC_MOUSE_WHEEL_SPEED:
3150 str = _("The scrolling speed of the mouse wheel.");
3153 case RC_COMPLETION_POPUP_DELAY:
3154 str = _("The completion popup delay.");
3157 case RC_COMPLETION_POPUP_MATH:
3158 str = _("Select to display the completion popup in math mode.");
3161 case RC_COMPLETION_POPUP_TEXT:
3162 str = _("Select to display the completion popup in text mode.");
3165 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3166 str = _("Show the completion popup without delay after non-unique completion attempt.");
3169 case RC_COMPLETION_POPUP_TEXT:
3170 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3173 case RC_COMPLETION_POPUP_DELAY:
3174 str = _("The inline completion delay.");
3177 case RC_COMPLETION_INLINE_MATH:
3178 str = _("Select to display the inline completion in math mode.");
3181 case RC_COMPLETION_INLINE_TEXT:
3182 str = _("Select to display the inline completion in text mode.");
3185 case RC_COMPLETION_INLINE_DOTS:
3186 str = _("Use \"...\" to shorten long completions.");
3189 case RC_AUTOCORRECTION_MATH:
3190 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3193 case RC_NUMLASTFILES:
3194 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3198 case RC_PATH_PREFIX:
3199 str = _("Specify those directories which should be "
3200 "prepended to the PATH environment variable.\n"
3201 "Use the OS native format.");
3205 str = _("Shows a typeset preview of things such as math");
3208 case RC_PREVIEW_HASHED_LABELS:
3209 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3212 case RC_PREVIEW_SCALE_FACTOR:
3213 str = _("Scale the preview size to suit.");
3216 case RC_PRINTLANDSCAPEFLAG:
3217 str = _("The option to print out in landscape.");
3220 case RC_PRINTPAPERDIMENSIONFLAG:
3221 str = _("Option to specify the dimensions of the print paper.");
3224 case RC_PRINTPAPERFLAG:
3225 str = _("The option to specify paper type.");
3228 case RC_VISUAL_CURSOR:
3229 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3232 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3233 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).");
3237 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3240 case RC_SCREEN_FONT_ROMAN:
3241 case RC_SCREEN_FONT_SANS:
3242 case RC_SCREEN_FONT_TYPEWRITER:
3243 str = _("The screen fonts used to display the text while editing.");
3246 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3247 case RC_SCREEN_FONT_SANS_FOUNDRY:
3248 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3251 case RC_SCREEN_FONT_SCALABLE:
3252 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.");
3255 case RC_SCREEN_FONT_SIZES:
3256 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3259 case RC_SCREEN_ZOOM:
3260 //xgettext:no-c-format
3261 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3264 case RC_GEOMETRY_SESSION:
3265 str = _("Allow session manager to save and restore windows geometry.");
3269 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3275 case RC_SHOW_BANNER:
3276 str = _("De-select if you don't want the startup banner.");
3279 case RC_TEMPDIRPATH:
3280 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3283 case RC_THESAURUSDIRPATH:
3284 str = _("This is the place where the files of the thesaurus library reside.");
3287 case RC_TEMPLATEPATH:
3288 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3291 case RC_TEX_ALLOWS_SPACES:
3294 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3297 case RC_TEXINPUTS_PREFIX:
3298 str = _("Specify those directories which should be "
3299 "prepended to the TEXINPUTS environment variable.\n"
3300 "A '.' represents the current document directory. "
3301 "Use the OS native format.");
3305 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3314 case RC_USE_USE_SYSTEM_COLORS:
3315 str = _("Enable use the system colors for some things like main window background and selection.");
3318 case RC_USE_TOOLTIP:
3319 str = _("Enable the automatic appearance of tool tips in the work area.");
3322 case RC_VIEWDVI_PAPEROPTION:
3323 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3338 // The global instance
3341 // The global copy of the system lyxrc entries (everything except preferences)