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 = 32; // spitz: add \ct_markup_copied
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 { "\\ct_markup_copied", LyXRC::RC_CT_MARKUP_COPIED },
97 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
98 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
99 { "\\def_file", LyXRC::RC_DEFFILE },
100 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
101 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
102 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
103 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
104 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
105 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
106 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
107 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
108 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
109 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
110 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
111 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
112 { "\\format", LyXRC::RC_FILEFORMAT },
113 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
114 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
115 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
116 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
117 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
118 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
119 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
120 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
121 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
122 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
123 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
124 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
125 { "\\icon_set", LyXRC::RC_ICON_SET },
126 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
127 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
128 { "\\input", LyXRC::RC_INPUT },
129 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
130 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
131 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
132 { "\\kbmap", LyXRC::RC_KBMAP },
133 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
134 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
135 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
136 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
137 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
138 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
139 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
140 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
141 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
142 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
143 { "\\load_session", LyXRC::RC_LOADSESSION },
144 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
145 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
146 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
147 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
148 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
149 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
150 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
151 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
152 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
153 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
154 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
155 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
156 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
157 { "\\preview", LyXRC::RC_PREVIEW },
158 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
159 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
160 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
161 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
162 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
163 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
164 { "\\respect_os_kbd_language", LyXRC::RC_RESPECT_OS_KBD_LANGUAGE },
165 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
166 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
167 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
168 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
169 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
170 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
171 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
172 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
173 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
174 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
175 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
176 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
177 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
178 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
179 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
180 { "\\set_color", LyXRC::RC_SET_COLOR },
181 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
182 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
183 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
184 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
185 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
186 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
187 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
188 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
189 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
190 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
191 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
192 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
193 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
194 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
195 { "\\ui_file", LyXRC::RC_UIFILE },
196 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
197 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
198 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
199 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
200 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
201 // compatibility with versions older than 1.4.0 only
202 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
203 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
204 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
205 { "\\user_email", LyXRC::RC_USER_EMAIL },
206 { "\\user_initials", LyXRC::RC_USER_INITIALS },
207 { "\\user_name", LyXRC::RC_USER_NAME },
208 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
209 // compatibility with versions older than 1.4.0 only
210 { "\\viewer", LyXRC::RC_VIEWER},
211 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
212 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
213 { "format", LyXRC::RC_LYXRCFORMAT }
216 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
219 void oldFontFormat(string & family, string & foundry)
221 if (family.empty() || family[0] != '-')
223 foundry = token(family, '-', 1);
224 family = token(family, '-', 2);
232 bool LyXRC::read(FileName const & filename, bool check_format)
234 Lexer lexrc(lyxrcTags);
235 lexrc.setFile(filename);
236 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
237 ReturnValues retval = read(lexrc, check_format);
238 if (!check_format || retval != FormatMismatch)
239 return retval == ReadOK;
241 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
242 TempFile tmp("convert_lyxrc");
243 FileName const tempfile = tmp.name();
244 bool const success = prefs2prefs(filename, tempfile, false);
246 LYXERR0 ("Unable to convert " << filename.absFileName() <<
247 " to format " << LYXRC_FILEFORMAT);
250 // Keep this in the else branch, such that lexrc2 goes out
251 // of scope and releases the lock on tempfile before we
252 // attempt to remove it. This matters on Windows.
253 Lexer lexrc2(lyxrcTags);
254 lexrc2.setFile(tempfile);
255 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
256 retval = read(lexrc2, check_format);
257 if (retval == FormatMismatch)
258 LYXERR0("Conversion failed for " << filename.absFileName());
260 return retval == ReadOK;
264 // don't need to worry about conversion, because this is always
265 // from an internal source
266 bool LyXRC::read(istream & is)
268 Lexer lexrc(lyxrcTags);
270 LYXERR(Debug::LYXRC, "Reading istream...");
271 return read(lexrc, false) == ReadOK;
275 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
277 if (lyxerr.debugging(Debug::PARSER))
278 lexrc.printTable(lyxerr);
283 // format prior to 2.0 and introduction of format tag
284 unsigned int rc_format = 0;
286 while (lexrc.isOK()) {
287 // By using two switches we take advantage of the compiler
288 // telling us if we have missed a LyXRCTags element in
289 // the second switch.
290 // Note that this also shows a problem with Lexer since it
291 // helps us avoid taking advantage of the strictness of the
294 int le = lexrc.lex();
296 case Lexer::LEX_UNDEF:
297 lexrc.printError("Unknown tag `$$Token'");
299 case Lexer::LEX_FEOF:
304 switch (static_cast<LyXRCTags>(le)) {
307 rc_format = lexrc.getInteger();
309 case RC_INPUT: // Include file
312 libFileSearch(string(),
314 if (!read(tmp, check_format)) {
316 "Error reading included file: " + tmp.absFileName());
322 bind_file = os::internal_path(lexrc.getString());
327 def_file = os::internal_path(lexrc.getString());
332 ui_file = os::internal_path(lexrc.getString());
335 case RC_AUTORESET_OPTIONS:
336 lexrc >> auto_reset_options;
339 case RC_DISPLAY_GRAPHICS:
341 display_graphics = lexrc.getString() == "true";
344 case RC_TEX_EXPECTS_WINDOWS_PATHS:
345 lexrc >> windows_style_tex_paths;
348 case RC_TEX_ALLOWS_SPACES:
349 lexrc >> tex_allows_spaces;
352 case RC_TEXINPUTS_PREFIX:
353 lexrc >> texinputs_prefix;
360 case RC_KBMAP_PRIMARY:
362 string const kmap(os::internal_path(lexrc.getString()));
363 if (!libFileSearch("kbd", kmap, "kmap").empty()
365 primary_kbmap = kmap;
367 lexrc.printError("LyX: Keymap `$$Token' not found");
372 case RC_KBMAP_SECONDARY:
374 string const kmap(os::internal_path(lexrc.getString()));
375 if (!libFileSearch("kbd", kmap, "kmap").empty()
377 secondary_kbmap = kmap;
379 lexrc.printError("LyX: Keymap `$$Token' not found");
384 case RC_PRINTLANDSCAPEFLAG:
385 lexrc >> print_landscape_flag;
388 case RC_PRINTPAPERDIMENSIONFLAG:
389 lexrc >> print_paper_dimension_flag;
392 case RC_PRINTPAPERFLAG:
393 lexrc >> print_paper_flag;
396 case RC_PYGMENTIZE_COMMAND:
397 if (lexrc.next(true)) {
398 pygmentize_command = lexrc.getString();
402 case RC_VIEWDVI_PAPEROPTION:
404 view_dvi_paper_option = lexrc.getString();
406 view_dvi_paper_option.erase();
409 case RC_CHKTEX_COMMAND:
410 if (lexrc.next(true)) {
411 chktex_command = lexrc.getString();
415 case RC_BIBTEX_ALTERNATIVES:
416 if (lexrc.next(true)) {
417 bibtex_alternatives.insert(lexrc.getString());
421 case RC_BIBTEX_COMMAND:
422 if (lexrc.next(true)) {
423 bibtex_command = lexrc.getString();
427 case RC_JBIBTEX_COMMAND:
428 if (lexrc.next(true)) {
429 jbibtex_command = lexrc.getString();
433 case RC_JBIBTEX_ALTERNATIVES:
434 if (lexrc.next(true)) {
435 jbibtex_alternatives.insert(lexrc.getString());
439 case RC_INDEX_ALTERNATIVES:
440 if (lexrc.next(true)) {
441 index_alternatives.insert(lexrc.getString());
445 case RC_INDEX_COMMAND:
446 if (lexrc.next(true)) {
447 index_command = lexrc.getString();
451 case RC_JINDEX_COMMAND:
452 if (lexrc.next(true)) {
453 jindex_command = lexrc.getString();
457 case RC_SPLITINDEX_COMMAND:
458 if (lexrc.next(true)) {
459 splitindex_command = lexrc.getString();
463 case RC_NOMENCL_COMMAND:
464 if (lexrc.next(true)) {
465 nomencl_command = lexrc.getString();
474 lexrc >> defaultZoom;
475 if (defaultZoom < 10)
479 case RC_GEOMETRY_SESSION:
480 lexrc >> allow_geometry_session;
483 case RC_SCREEN_FONT_SIZES:
484 lexrc >> font_sizes[TINY_SIZE];
485 lexrc >> font_sizes[SCRIPT_SIZE];
486 lexrc >> font_sizes[FOOTNOTE_SIZE];
487 lexrc >> font_sizes[SMALL_SIZE];
488 lexrc >> font_sizes[NORMAL_SIZE];
489 lexrc >> font_sizes[LARGE_SIZE];
490 lexrc >> font_sizes[LARGER_SIZE];
491 lexrc >> font_sizes[LARGEST_SIZE];
492 lexrc >> font_sizes[HUGE_SIZE];
493 lexrc >> font_sizes[HUGER_SIZE];
496 case RC_SCREEN_FONT_SCALABLE:
497 lexrc >> use_scalable_fonts;
504 case RC_DOCUMENTPATH:
506 document_path = os::internal_path(lexrc.getString());
511 example_path = os::internal_path(lexrc.getString());
514 case RC_TEMPLATEPATH:
516 template_path = os::internal_path(lexrc.getString());
521 tempdir_path = os::internal_path(lexrc.getString());
524 case RC_THESAURUSDIRPATH:
526 thesaurusdir_path = os::internal_path(lexrc.getString());
529 case RC_HUNSPELLDIR_PATH:
531 hunspelldir_path = os::internal_path(lexrc.getString());
534 case RC_USELASTFILEPOS:
535 lexrc >> use_lastfilepos;
539 lexrc >> load_session;
542 case RC_MOUSE_WHEEL_SPEED:
543 lexrc >> mouse_wheel_speed;
546 case RC_COMPLETION_INLINE_DELAY:
547 lexrc >> completion_inline_delay;
550 case RC_COMPLETION_INLINE_MATH:
551 lexrc >> completion_inline_math;
554 case RC_COMPLETION_INLINE_TEXT:
555 lexrc >> completion_inline_text;
558 case RC_COMPLETION_INLINE_DOTS:
559 lexrc >> completion_inline_dots;
562 case RC_AUTOCORRECTION_MATH:
563 lexrc >> autocorrection_math;
566 case RC_COMPLETION_POPUP_DELAY:
567 lexrc >> completion_popup_delay;
570 case RC_COMPLETION_POPUP_MATH:
571 lexrc >> completion_popup_math;
574 case RC_COMPLETION_POPUP_TEXT:
575 lexrc >> completion_popup_text;
578 case RC_COMPLETION_CURSOR_TEXT:
579 lexrc >> completion_cursor_text;
582 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
583 lexrc >> completion_popup_after_complete;
586 case RC_COMPLETION_MINLENGTH:
587 lexrc >> completion_minlength;
590 case RC_NUMLASTFILES:
591 lexrc >> num_lastfiles;
594 case RC_CHECKLASTFILES:
595 lexrc >> check_lastfiles;
602 case RC_USE_SYSTEM_THEME_ICONS:
603 lexrc >> use_system_theme_icons;
606 case RC_SCREEN_FONT_ROMAN:
608 roman_font_name = lexrc.getString();
609 oldFontFormat(roman_font_name,
614 case RC_SCREEN_FONT_SANS:
616 sans_font_name = lexrc.getString();
617 oldFontFormat(sans_font_name, sans_font_foundry);
621 case RC_SCREEN_FONT_TYPEWRITER:
623 typewriter_font_name = lexrc.getString();
624 oldFontFormat(typewriter_font_name,
625 typewriter_font_foundry);
629 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
630 lexrc >> roman_font_foundry;
633 case RC_SCREEN_FONT_SANS_FOUNDRY:
634 lexrc >> sans_font_foundry;
637 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
638 lexrc >> typewriter_font_foundry;
643 lexrc.printError("Missing color tag.");
646 string lyx_name = lexrc.getString();
649 lexrc.printError("Missing color name for color: `$$Token'");
652 string x11_name = lexrc.getString();
654 ColorCode const col =
655 lcolor.getFromLyXName(lyx_name);
656 if (col == Color_none ||
657 col == Color_inherit ||
661 if (!lcolor.setColor(col, x11_name))
662 LYXERR0("Bad lyxrc set_color for " << lyx_name);
666 case RC_AUTOREGIONDELETE:
667 // Auto region delete defaults to true
668 lexrc >> auto_region_delete;
673 lyxpipes = subst(os::internal_path(lexrc.getString()), "$$User",
674 package().user_support().absFileName());
677 case RC_CT_ADDITIONS_UNDERLINED:
678 lexrc >> ct_additions_underlined;
681 case RC_CT_MARKUP_COPIED:
682 lexrc >> ct_markup_copied;
685 case RC_CURSOR_FOLLOWS_SCROLLBAR:
686 lexrc >> cursor_follows_scrollbar;
689 case RC_CURSOR_WIDTH:
690 lexrc >> cursor_width;
693 case RC_SCROLL_BELOW_DOCUMENT:
694 lexrc >> scroll_below_document;
697 case RC_PARAGRAPH_MARKERS:
698 lexrc >> paragraph_markers;
701 case RC_MAC_DONTSWAP_CTRL_META:
702 lexrc >> mac_dontswap_ctrl_meta;
705 case RC_MAC_LIKE_CURSOR_MOVEMENT:
706 lexrc >> mac_like_cursor_movement;
709 case RC_MACRO_EDIT_STYLE:
711 switch (lexrc.getInteger()) {
712 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
713 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
714 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
719 case RC_DIALOGS_ICONIFY_WITH_MAIN:
720 lexrc >> dialogs_iconify_with_main;
723 case RC_PLAINTEXT_LINELEN:
724 lexrc >> plaintext_linelen;
726 // Spellchecker settings:
727 case RC_ACCEPT_COMPOUND:
728 lexrc >> spellchecker_accept_compound;
730 case RC_USE_NATIVE_FILEDIALOG:
731 lexrc >> use_native_filedialog;
733 case RC_USE_SYSTEM_COLORS:
734 lexrc >> use_system_colors;
737 lexrc >> use_tooltip;
739 case RC_SPELLCHECKER:
740 lexrc >> spellchecker;
743 lexrc >> spellchecker_alt_lang;
746 lexrc >> spellchecker_esc_chars;
748 case RC_SPELLCHECK_CONTINUOUSLY:
749 lexrc >> spellcheck_continuously;
751 case RC_SPELLCHECK_NOTES:
752 lexrc >> spellcheck_notes;
755 lexrc >> make_backup;
757 case RC_SAVE_COMPRESSED:
758 lexrc >> save_compressed;
761 lexrc >> save_origin;
763 case RC_BACKUPDIR_PATH:
765 backupdir_path = os::internal_path(lexrc.getString());
767 case RC_DEFAULT_DECIMAL_SEP:
768 lexrc >> default_decimal_sep;
770 case RC_DEFAULT_LENGTH_UNIT:
772 default_length_unit = (Length::UNIT) lexrc.getInteger();
774 case RC_LANGUAGE_CUSTOM_PACKAGE:
775 lexrc >> language_custom_package;
777 case RC_LANGUAGE_AUTO_BEGIN:
778 lexrc >> language_auto_begin;
780 case RC_LANGUAGE_AUTO_END:
781 lexrc >> language_auto_end;
783 case RC_LANGUAGE_GLOBAL_OPTIONS:
784 lexrc >> language_global_options;
786 case RC_LANGUAGE_PACKAGE_SELECTION:
788 switch (lexrc.getInteger()) {
790 language_package_selection = LP_AUTO;
793 language_package_selection = LP_BABEL;
796 language_package_selection = LP_CUSTOM;
799 language_package_selection = LP_NONE;
804 case RC_LANGUAGE_COMMAND_BEGIN:
805 lexrc >> language_command_begin;
807 case RC_LANGUAGE_COMMAND_END:
808 lexrc >> language_command_end;
810 case RC_LANGUAGE_COMMAND_LOCAL:
811 lexrc >> language_command_local;
813 case RC_RESPECT_OS_KBD_LANGUAGE:
814 lexrc >> respect_os_kbd_language;
816 case RC_VISUAL_CURSOR:
817 lexrc >> visual_cursor;
819 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
820 lexrc >> close_buffer_with_last_view;
823 lexrc >> auto_number;
825 case RC_MARK_FOREIGN_LANGUAGE:
826 lexrc >> mark_foreign_language;
832 fmt = lexrc.getString();
833 if (lexrc.next(true))
834 command = lexrc.getString();
835 setMover(fmt, command);
840 string from, to, command, flags;
842 from = lexrc.getString();
844 to = lexrc.getString();
845 if (lexrc.next(true))
846 command = lexrc.getString();
848 flags = lexrc.getString();
850 theConverters().erase(from, to);
852 theConverters().add(from, to, command, flags);
855 // compatibility with versions older than 1.4.0 only
857 string format, command;
858 lexrc >> format >> command;
859 theFormats().setViewer(format, command);
862 case RC_FILEFORMAT: {
864 string format, extensions, shortcut;
865 docstring prettyname;
866 if (!(lexrc >> format >> extensions))
868 if (ok && lexrc.next(true))
869 prettyname = lexrc.getDocString();
873 if(!(lexrc >> shortcut))
875 string viewer, editor;
876 if (ok && lexrc.next(true))
877 viewer = lexrc.getString();
880 if (ok && lexrc.next(true))
881 editor = lexrc.getString();
885 if (!(lexrc >> flags >> mime))
887 int flgs = Format::none;
888 while (!flags.empty()) {
890 flags = split(flags, flag, ',');
891 if (flag == "document")
892 flgs |= Format::document;
893 else if (flag == "vector")
894 flgs |= Format::vector;
895 else if (flag == "zipped=native")
896 flgs |= Format::zipped_native;
897 else if (flag == "menu=export")
898 flgs |= Format::export_menu;
899 else if (flag == "menu=none")
900 flgs |= Format::no_menu;
902 LYXERR0("Ignoring unknown flag `"
903 << flag << "' for format `"
907 LYXERR0("Syntax error in format " << format);
908 else if (prettyname.empty()) {
909 if (theConverters().formatIsUsed(format))
910 LYXERR0("Can't delete format " << format);
912 theFormats().erase(format);
914 theFormats().add(format, extensions, prettyname,
915 shortcut, viewer, editor, mime, flgs);
919 case RC_VIEWER_ALTERNATIVES: {
920 string format, command;
921 if ((lexrc >> format) && lexrc.next(true)) {
922 command = lexrc.getString();
923 viewer_alternatives[format].insert(command);
927 case RC_EDITOR_ALTERNATIVES: {
928 string format, command;
929 if ((lexrc >> format) && lexrc.next(true)) {
930 command = lexrc.getString();
931 editor_alternatives[format].insert(command);
936 case RC_DEFAULT_OTF_VIEW_FORMAT:
937 lexrc >> default_otf_view_format;
940 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
941 lexrc >> default_platex_view_format;
944 case RC_DEFAULT_VIEW_FORMAT:
945 lexrc >> default_view_format;
948 case RC_GUI_LANGUAGE:
949 lexrc >> gui_language;
953 lexrc >> show_banner;
958 string const tmp = lexrc.getString();
959 if (tmp == "true" || tmp == "on")
960 preview = PREVIEW_ON;
961 else if (tmp == "no_math")
962 preview = PREVIEW_NO_MATH;
964 preview = PREVIEW_OFF;
965 if (tmp != "false" && tmp != "off")
966 LYXERR0("Unrecognized preview status \""
972 case RC_PREVIEW_HASHED_LABELS:
973 lexrc >> preview_hashed_labels;
976 case RC_PREVIEW_SCALE_FACTOR:
977 lexrc >> preview_scale_factor;
986 case RC_USER_INITIALS:
987 lexrc >> user_initials;
991 lexrc >> path_prefix;
994 case RC_USE_CONVERTER_CACHE:
995 lexrc >> use_converter_cache;
997 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
998 lexrc >> use_converter_needauth_forbidden;
1000 case RC_USE_CONVERTER_NEEDAUTH:
1001 lexrc >> use_converter_needauth;
1003 case RC_CONVERTER_CACHE_MAXAGE:
1004 lexrc >> converter_cache_maxage;
1007 case RC_SORT_LAYOUTS:
1008 lexrc >> sort_layouts;
1010 case RC_GROUP_LAYOUTS:
1011 lexrc >> group_layouts;
1013 case RC_FULL_SCREEN_LIMIT:
1014 lexrc >> full_screen_limit;
1016 case RC_FULL_SCREEN_TOOLBARS:
1017 lexrc >> full_screen_toolbars;
1019 case RC_FULL_SCREEN_SCROLLBAR:
1020 lexrc >> full_screen_scrollbar;
1022 case RC_FULL_SCREEN_STATUSBAR:
1023 lexrc >> full_screen_statusbar;
1025 case RC_FULL_SCREEN_TABBAR:
1026 lexrc >> full_screen_tabbar;
1028 case RC_FULL_SCREEN_MENUBAR:
1029 lexrc >> full_screen_menubar;
1031 case RC_FULL_SCREEN_WIDTH:
1032 lexrc >> full_screen_width;
1034 case RC_OPEN_BUFFERS_IN_TABS:
1035 lexrc >> open_buffers_in_tabs;
1037 case RC_SINGLE_CLOSE_TAB_BUTTON:
1038 lexrc >> single_close_tab_button;
1040 case RC_SINGLE_INSTANCE:
1041 lexrc >> single_instance;
1042 if (run_mode == PREFERRED)
1043 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1045 case RC_FORWARD_SEARCH_DVI:
1046 if (lexrc.next(true))
1047 forward_search_dvi = lexrc.getString();
1049 case RC_FORWARD_SEARCH_PDF:
1050 if (lexrc.next(true))
1051 forward_search_pdf = lexrc.getString();
1053 case RC_EXPORT_OVERWRITE:
1055 string const tmp = lexrc.getString();
1056 if (tmp == "all" || tmp == "true")
1057 export_overwrite = ALL_FILES;
1058 else if (tmp == "main")
1059 export_overwrite = MAIN_FILE;
1061 export_overwrite = NO_FILES;
1062 if (tmp != "ask" && tmp != "false")
1063 LYXERR0("Unrecognized export_overwrite status \""
1068 case RC_SCROLL_WHEEL_ZOOM:
1070 string const tmp = lexrc.getString();
1072 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1073 else if (tmp == "shift")
1074 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1075 else if (tmp == "alt")
1076 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1078 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1079 if (tmp != "off" && tmp != "false")
1080 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1086 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1087 lexrc >> mouse_middlebutton_paste;
1091 break; // this is just a dummy
1094 // This is triggered the first time through the loop unless
1095 // we hit a format tag.
1096 if (check_format && rc_format != LYXRC_FILEFORMAT)
1097 return FormatMismatch;
1100 /// Update converters data-structures
1101 theConverters().update(theFormats());
1102 theConverters().buildGraph();
1103 theBufferList().invalidateConverterCache();
1109 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1111 ofstream ofs(filename.toFilesystemEncoding().c_str());
1113 write(ofs, ignore_system_lyxrc);
1117 void LyXRC::print() const
1119 if (lyxerr.debugging())
1120 write(lyxerr, false);
1128 typedef pair<string, SpecialisedMover> Data;
1130 SameMover(Data const & comparison)
1131 : comparison_(comparison) {}
1133 bool operator()(Data const & data) const
1135 return data.first == comparison_.first &&
1136 data.second.command() == comparison_.second.command();
1146 // Escape \ and " so that LyXLex can read the string later
1147 string escapeCommand(string const & str) {
1148 return subst(subst(str , "\\", "\\\\"),
1155 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1157 LyXRCTags tag = RC_LAST;
1159 if (!name.empty()) {
1160 for (int i = 0; i != lyxrcCount; ++i)
1161 if ("\\" + name == lyxrcTags[i].tag)
1162 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1166 os << "# LyX " << lyx_version
1167 << " generated this file. If you want to make your own\n"
1168 << "# modifications you should do them from inside LyX and save.\n\n"
1169 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1171 // Why the switch you might ask. It is a trick to ensure that all
1172 // the elements in the LyXRCTags enum are handled. As you can see
1173 // there are no breaks at all. So it is just a huge fall-through.
1174 // The nice thing is that we will get a warning from the compiler
1175 // if we forget an element.
1179 // input/include files are not done here
1180 case RC_LYXRCFORMAT:
1182 if (ignore_system_lyxrc ||
1183 bind_file != system_lyxrc.bind_file) {
1184 string const path = os::external_path(bind_file);
1185 os << "\\bind_file \"" << path << "\"\n";
1191 if (ignore_system_lyxrc ||
1192 def_file != system_lyxrc.def_file) {
1193 string const path = os::external_path(def_file);
1194 os << "\\def_file \"" << path << "\"\n";
1203 << "# MISC SECTION ######################################\n"
1205 // bind files are not done here.
1207 case RC_PATH_PREFIX:
1208 if (ignore_system_lyxrc ||
1209 path_prefix != system_lyxrc.path_prefix) {
1210 os << "\\path_prefix \"" << path_prefix << "\"\n";
1216 if (ignore_system_lyxrc ||
1217 ui_file != system_lyxrc.ui_file) {
1218 string const path = os::external_path(ui_file);
1219 os << "\\ui_file \"" << path << "\"\n";
1224 case RC_AUTOREGIONDELETE:
1225 if (ignore_system_lyxrc ||
1226 auto_region_delete != system_lyxrc.auto_region_delete) {
1227 os << "# Set to false to inhibit automatic replacement of\n"
1228 << "# the current selection.\n"
1229 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1235 case RC_AUTORESET_OPTIONS:
1236 if (ignore_system_lyxrc ||
1237 auto_reset_options != system_lyxrc.auto_reset_options) {
1238 os << "# Set to false to inhibit automatic reset of\n"
1239 << "# the class options to defaults on class change.\n"
1240 << "\\auto_reset_options "
1241 << convert<string>(auto_reset_options)
1248 if (ignore_system_lyxrc ||
1249 autosave != system_lyxrc.autosave) {
1250 os << "# The time interval between auto-saves in seconds.\n"
1251 << "\\autosave " << autosave << '\n';
1256 case RC_DISPLAY_GRAPHICS:
1257 if (ignore_system_lyxrc ||
1258 display_graphics != system_lyxrc.display_graphics) {
1259 os << "# Display graphics within LyX\n"
1261 << "\\display_graphics "
1262 << (display_graphics ? "true" : "false")
1268 case RC_SORT_LAYOUTS:
1269 if (ignore_system_lyxrc ||
1270 sort_layouts != system_lyxrc.sort_layouts) {
1271 os << "# Sort layouts alphabetically.\n"
1272 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1277 case RC_GROUP_LAYOUTS:
1278 if (ignore_system_lyxrc ||
1279 group_layouts != system_lyxrc.group_layouts) {
1280 os << "# Group layouts by their category.\n"
1281 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1286 case RC_VIEWDVI_PAPEROPTION:
1287 if (ignore_system_lyxrc ||
1288 view_dvi_paper_option
1289 != system_lyxrc.view_dvi_paper_option) {
1290 os << "# Options used to specify paper size to the\n"
1291 << "# view_dvi_command (e.g. -paper)\n"
1292 << "\\view_dvi_paper_option \""
1293 << view_dvi_paper_option << "\"\n";
1298 case RC_CHKTEX_COMMAND:
1299 if (ignore_system_lyxrc ||
1300 chktex_command != system_lyxrc.chktex_command) {
1301 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1306 case RC_BIBTEX_ALTERNATIVES: {
1307 CommandSet::const_iterator it = bibtex_alternatives.begin();
1308 CommandSet::const_iterator end = bibtex_alternatives.end();
1309 for ( ; it != end; ++it) {
1310 if (ignore_system_lyxrc
1311 || !system_lyxrc.bibtex_alternatives.count(*it))
1312 os << "\\bibtex_alternatives \""
1319 case RC_BIBTEX_COMMAND:
1320 if (ignore_system_lyxrc ||
1321 bibtex_command != system_lyxrc.bibtex_command) {
1322 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1327 case RC_JBIBTEX_COMMAND:
1328 if (ignore_system_lyxrc ||
1329 jbibtex_command != system_lyxrc.jbibtex_command) {
1330 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1335 case RC_JBIBTEX_ALTERNATIVES: {
1336 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1337 CommandSet::const_iterator end = jbibtex_alternatives.end();
1338 for ( ; it != end; ++it) {
1339 if (ignore_system_lyxrc
1340 || !system_lyxrc.jbibtex_alternatives.count(*it))
1341 os << "\\jbibtex_alternatives \""
1348 case RC_INDEX_ALTERNATIVES: {
1349 CommandSet::const_iterator it = index_alternatives.begin();
1350 CommandSet::const_iterator end = index_alternatives.end();
1351 for ( ; it != end; ++it) {
1352 if (ignore_system_lyxrc
1353 || !system_lyxrc.index_alternatives.count(*it))
1354 os << "\\index_alternatives \""
1361 case RC_INDEX_COMMAND:
1362 if (ignore_system_lyxrc ||
1363 index_command != system_lyxrc.index_command) {
1364 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1369 case RC_JINDEX_COMMAND:
1370 if (ignore_system_lyxrc ||
1371 jindex_command != system_lyxrc.jindex_command) {
1372 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1377 case RC_SPLITINDEX_COMMAND:
1378 if (ignore_system_lyxrc ||
1379 splitindex_command != system_lyxrc.splitindex_command) {
1380 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1385 case RC_NOMENCL_COMMAND:
1386 if (ignore_system_lyxrc ||
1387 nomencl_command != system_lyxrc.nomencl_command) {
1388 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1393 case RC_PYGMENTIZE_COMMAND:
1394 if (ignore_system_lyxrc ||
1395 pygmentize_command != system_lyxrc.pygmentize_command) {
1396 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1401 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1402 // Don't write this setting to the preferences file,
1403 // but allow temporary changes (bug 7557).
1404 if (ignore_system_lyxrc) {
1405 os << "\\tex_expects_windows_paths "
1406 << convert<string>(windows_style_tex_paths) << '\n';
1411 case RC_TEX_ALLOWS_SPACES:
1412 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1413 os << "\\tex_allows_spaces "
1414 << convert<string>(tex_allows_spaces) << '\n';
1420 if (ignore_system_lyxrc ||
1421 use_kbmap != system_lyxrc.use_kbmap) {
1422 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1427 case RC_KBMAP_PRIMARY:
1428 if (ignore_system_lyxrc ||
1429 primary_kbmap != system_lyxrc.primary_kbmap) {
1430 string const path = os::external_path(primary_kbmap);
1431 os << "\\kbmap_primary \"" << path << "\"\n";
1436 case RC_KBMAP_SECONDARY:
1437 if (ignore_system_lyxrc ||
1438 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1439 string const path = os::external_path(secondary_kbmap);
1440 os << "\\kbmap_secondary \"" << path << "\"\n";
1446 if (ignore_system_lyxrc ||
1447 lyxpipes != system_lyxrc.lyxpipes) {
1448 string const path = os::external_path(lyxpipes);
1449 os << "\\serverpipe \"" << path << "\"\n";
1455 os << "\\user_name \"" << user_name << "\"\n";
1460 os << "\\user_email \"" << user_email << "\"\n";
1464 case RC_USER_INITIALS:
1465 os << "\\user_initials \"" << user_initials << "\"\n";
1469 case RC_SHOW_BANNER:
1470 if (ignore_system_lyxrc ||
1471 show_banner != system_lyxrc.show_banner) {
1472 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1478 if (ignore_system_lyxrc ||
1479 preview != system_lyxrc.preview) {
1485 case PREVIEW_NO_MATH:
1492 os << "\\preview " << status << '\n';
1497 case RC_PREVIEW_HASHED_LABELS:
1498 if (ignore_system_lyxrc ||
1499 preview_hashed_labels !=
1500 system_lyxrc.preview_hashed_labels) {
1501 os << "\\preview_hashed_labels "
1502 << convert<string>(preview_hashed_labels) << '\n';
1507 case RC_PREVIEW_SCALE_FACTOR:
1508 if (ignore_system_lyxrc ||
1509 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1510 os << "\\preview_scale_factor "
1511 << preview_scale_factor << '\n';
1516 case RC_USE_CONVERTER_CACHE:
1517 if (ignore_system_lyxrc ||
1518 use_converter_cache != system_lyxrc.use_converter_cache) {
1519 os << "\\use_converter_cache "
1520 << convert<string>(use_converter_cache) << '\n';
1525 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1526 if (ignore_system_lyxrc ||
1527 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1528 os << "\\use_converter_needauth_forbidden "
1529 << convert<string>(use_converter_needauth_forbidden) << '\n';
1534 case RC_USE_CONVERTER_NEEDAUTH:
1535 if (ignore_system_lyxrc ||
1536 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1537 os << "\\use_converter_needauth "
1538 << convert<string>(use_converter_needauth) << '\n';
1543 case RC_CONVERTER_CACHE_MAXAGE:
1544 if (ignore_system_lyxrc ||
1545 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1546 os << "\\converter_cache_maxage "
1547 << converter_cache_maxage << '\n';
1553 << "# SCREEN & FONTS SECTION ############################\n"
1557 if (ignore_system_lyxrc ||
1558 icon_set != system_lyxrc.icon_set) {
1559 os << "\\icon_set \"" << icon_set
1565 case RC_USE_SYSTEM_THEME_ICONS:
1566 if (ignore_system_lyxrc ||
1567 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1568 os << "\\use_system_theme_icons "
1569 << convert<string>(use_system_theme_icons)
1576 if (ignore_system_lyxrc ||
1577 dpi != system_lyxrc.dpi) {
1578 os << "\\screen_dpi " << dpi << '\n';
1583 case RC_SCREEN_ZOOM:
1584 if (ignore_system_lyxrc ||
1585 defaultZoom != system_lyxrc.defaultZoom) {
1586 os << "\\screen_zoom " << defaultZoom << '\n';
1591 case RC_GEOMETRY_SESSION:
1592 if (ignore_system_lyxrc ||
1593 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1594 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1600 case RC_CT_ADDITIONS_UNDERLINED:
1601 if (ignore_system_lyxrc ||
1602 ct_additions_underlined
1603 != system_lyxrc.ct_additions_underlined) {
1604 os << "\\ct_additions_underlined "
1605 << convert<string>(ct_additions_underlined) << '\n';
1610 case RC_CT_MARKUP_COPIED:
1611 if (ignore_system_lyxrc ||
1613 != system_lyxrc.ct_markup_copied) {
1614 os << "\\ct_markup_copied "
1615 << convert<string>(ct_markup_copied) << '\n';
1620 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1621 if (ignore_system_lyxrc ||
1622 cursor_follows_scrollbar
1623 != system_lyxrc.cursor_follows_scrollbar) {
1624 os << "\\cursor_follows_scrollbar "
1625 << convert<string>(cursor_follows_scrollbar) << '\n';
1630 case RC_CURSOR_WIDTH:
1631 if (ignore_system_lyxrc ||
1633 != system_lyxrc.cursor_width) {
1634 os << "\\cursor_width "
1635 << cursor_width << '\n';
1640 case RC_SCROLL_BELOW_DOCUMENT:
1641 if (ignore_system_lyxrc ||
1642 scroll_below_document
1643 != system_lyxrc.scroll_below_document) {
1644 os << "\\scroll_below_document "
1645 << convert<string>(scroll_below_document) << '\n';
1650 case RC_PARAGRAPH_MARKERS:
1651 if (ignore_system_lyxrc ||
1653 != system_lyxrc.paragraph_markers) {
1654 os << "\\paragraph_markers "
1655 << convert<string>(paragraph_markers) << '\n';
1660 case RC_MAC_DONTSWAP_CTRL_META:
1661 if (ignore_system_lyxrc ||
1662 mac_dontswap_ctrl_meta
1663 != system_lyxrc.mac_dontswap_ctrl_meta) {
1664 os << "\\mac_dontswap_ctrl_meta "
1665 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1670 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1671 if (ignore_system_lyxrc ||
1672 mac_like_cursor_movement
1673 != system_lyxrc.mac_like_cursor_movement) {
1674 os << "\\mac_like_cursor_movement "
1675 << convert<string>(mac_like_cursor_movement) << '\n';
1680 case RC_MACRO_EDIT_STYLE:
1681 if (ignore_system_lyxrc ||
1683 != system_lyxrc.macro_edit_style) {
1684 os << "\\macro_edit_style ";
1685 switch (macro_edit_style) {
1686 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1687 case MACRO_EDIT_INLINE: os << "1\n"; break;
1688 case MACRO_EDIT_LIST: os << "2\n"; break;
1694 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1695 if (ignore_system_lyxrc ||
1696 dialogs_iconify_with_main
1697 != system_lyxrc.dialogs_iconify_with_main) {
1698 os << "\\dialogs_iconify_with_main "
1699 << convert<string>(dialogs_iconify_with_main) << '\n';
1704 case RC_SCREEN_FONT_ROMAN:
1705 if (ignore_system_lyxrc ||
1706 roman_font_name != system_lyxrc.roman_font_name) {
1707 os << "\\screen_font_roman \"" << roman_font_name
1713 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1714 if (ignore_system_lyxrc ||
1715 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1716 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1722 case RC_SCREEN_FONT_SANS:
1723 if (ignore_system_lyxrc ||
1724 sans_font_name != system_lyxrc.sans_font_name) {
1725 os << "\\screen_font_sans \"" << sans_font_name
1731 case RC_SCREEN_FONT_SANS_FOUNDRY:
1732 if (ignore_system_lyxrc ||
1733 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1734 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1740 case RC_SCREEN_FONT_TYPEWRITER:
1741 if (ignore_system_lyxrc ||
1742 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1743 os << "\\screen_font_typewriter \""
1744 << typewriter_font_name << "\"\n";
1749 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1750 if (ignore_system_lyxrc ||
1751 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1752 os << "\\screen_font_typewriter_foundry \""
1753 << typewriter_font_foundry << "\"\n";
1758 case RC_SCREEN_FONT_SCALABLE:
1759 if (ignore_system_lyxrc ||
1760 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1761 os << "\\screen_font_scalable "
1762 << convert<string>(use_scalable_fonts)
1768 case RC_SCREEN_FONT_SIZES:
1769 if (ignore_system_lyxrc ||
1770 font_sizes[TINY_SIZE]
1771 != system_lyxrc.font_sizes[TINY_SIZE] ||
1772 font_sizes[SCRIPT_SIZE]
1773 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1774 font_sizes[FOOTNOTE_SIZE]
1775 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1776 font_sizes[SMALL_SIZE]
1777 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1778 font_sizes[NORMAL_SIZE]
1779 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1780 font_sizes[LARGE_SIZE]
1781 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1782 font_sizes[LARGER_SIZE]
1783 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1784 font_sizes[LARGEST_SIZE]
1785 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1786 font_sizes[HUGE_SIZE]
1787 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1788 font_sizes[HUGER_SIZE]
1789 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1790 streamsize old_prec = os.precision();
1791 os.setf(ios::fixed);
1793 os << "\\screen_font_sizes"
1794 << ' ' << font_sizes[TINY_SIZE]
1795 << ' ' << font_sizes[SCRIPT_SIZE]
1796 << ' ' << font_sizes[FOOTNOTE_SIZE]
1797 << ' ' << font_sizes[SMALL_SIZE]
1798 << ' ' << font_sizes[NORMAL_SIZE]
1799 << ' ' << font_sizes[LARGE_SIZE]
1800 << ' ' << font_sizes[LARGER_SIZE]
1801 << ' ' << font_sizes[LARGEST_SIZE]
1802 << ' ' << font_sizes[HUGE_SIZE]
1803 << ' ' << font_sizes[HUGER_SIZE]
1805 os.precision(old_prec);
1806 os.unsetf(ios::fixed);
1811 case RC_FULL_SCREEN_LIMIT:
1812 if (ignore_system_lyxrc ||
1813 full_screen_limit != system_lyxrc.full_screen_limit) {
1814 os << "\\fullscreen_limit "
1815 << convert<string>(full_screen_limit)
1821 case RC_FULL_SCREEN_TOOLBARS:
1822 if (ignore_system_lyxrc ||
1823 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1824 os << "\\fullscreen_toolbars "
1825 << convert<string>(full_screen_toolbars)
1831 case RC_FULL_SCREEN_SCROLLBAR:
1832 if (ignore_system_lyxrc ||
1833 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1834 os << "\\fullscreen_scrollbar "
1835 << convert<string>(full_screen_scrollbar)
1841 case RC_FULL_SCREEN_STATUSBAR:
1842 if (ignore_system_lyxrc ||
1843 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1844 os << "\\fullscreen_statusbar "
1845 << convert<string>(full_screen_statusbar)
1851 case RC_FULL_SCREEN_TABBAR:
1852 if (ignore_system_lyxrc ||
1853 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1854 os << "\\fullscreen_tabbar "
1855 << convert<string>(full_screen_tabbar)
1861 case RC_FULL_SCREEN_MENUBAR:
1862 if (ignore_system_lyxrc ||
1863 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1864 os << "\\fullscreen_menubar "
1865 << convert<string>(full_screen_menubar)
1871 case RC_FULL_SCREEN_WIDTH:
1872 if (ignore_system_lyxrc ||
1873 full_screen_width != system_lyxrc.full_screen_width) {
1874 os << "\\fullscreen_width "
1875 << convert<string>(full_screen_width)
1881 case RC_OPEN_BUFFERS_IN_TABS:
1882 if (ignore_system_lyxrc ||
1883 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1884 os << "\\open_buffers_in_tabs "
1885 << convert<string>(open_buffers_in_tabs)
1891 case RC_SINGLE_CLOSE_TAB_BUTTON:
1892 if (ignore_system_lyxrc ||
1893 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1894 os << "\\single_close_tab_button "
1895 << convert<string>(single_close_tab_button)
1901 case RC_SINGLE_INSTANCE:
1902 if (ignore_system_lyxrc ||
1903 single_instance != system_lyxrc.single_instance) {
1904 os << "\\single_instance "
1905 << convert<string>(single_instance)
1911 case RC_FORWARD_SEARCH_DVI:
1912 if (ignore_system_lyxrc ||
1913 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1914 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1919 case RC_FORWARD_SEARCH_PDF:
1920 if (ignore_system_lyxrc ||
1921 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1922 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1928 << "# COLOR SECTION ###################################\n"
1933 for (int i = 0; i < Color_ignore; ++i) {
1934 ColorCode lc = static_cast<ColorCode>(i);
1935 string const col = lcolor.getX11Name(lc);
1936 if (ignore_system_lyxrc
1937 || col != system_lcolor.getX11Name(lc)) {
1938 os << "\\set_color \""
1939 << lcolor.getLyXName(lc) << "\" \""
1947 << "# PRINTER SECTION ###################################\n"
1951 case RC_PRINTLANDSCAPEFLAG:
1952 if (ignore_system_lyxrc ||
1953 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1954 os << "\\print_landscape_flag \"" << print_landscape_flag
1960 case RC_PRINTPAPERFLAG:
1961 if (ignore_system_lyxrc ||
1962 print_paper_flag != system_lyxrc.print_paper_flag) {
1963 os << "\\print_paper_flag \"" << print_paper_flag
1969 case RC_PRINTPAPERDIMENSIONFLAG:
1970 if (ignore_system_lyxrc ||
1971 print_paper_dimension_flag
1972 != system_lyxrc.print_paper_dimension_flag) {
1973 os << "\\print_paper_dimension_flag \""
1974 << print_paper_dimension_flag << "\"\n";
1980 << "# TEX SECTION #######################################\n"
1984 case RC_TEXINPUTS_PREFIX:
1985 if (ignore_system_lyxrc ||
1986 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1987 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1993 << "# FILE SECTION ######################################\n"
1996 case RC_DOCUMENTPATH:
1997 if (ignore_system_lyxrc ||
1998 document_path != system_lyxrc.document_path) {
1999 string const path = os::external_path(document_path);
2000 os << "\\document_path \"" << path << "\"\n";
2005 case RC_USELASTFILEPOS:
2006 if (ignore_system_lyxrc ||
2007 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2008 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2014 case RC_LOADSESSION:
2015 if (ignore_system_lyxrc ||
2016 load_session != system_lyxrc.load_session) {
2017 os << "\\load_session " << convert<string>(load_session)
2023 case RC_MOUSE_WHEEL_SPEED:
2024 if (ignore_system_lyxrc ||
2025 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2026 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2031 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2032 if (ignore_system_lyxrc ||
2033 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2034 os << "\\mouse_middlebutton_paste "
2035 << convert<string>(mouse_middlebutton_paste) << '\n';
2040 case RC_COMPLETION_INLINE_DELAY:
2041 if (ignore_system_lyxrc ||
2042 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2043 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2048 case RC_COMPLETION_INLINE_MATH:
2049 if (ignore_system_lyxrc ||
2050 completion_inline_math != system_lyxrc.completion_inline_math) {
2051 os << "\\completion_inline_math "
2052 << convert<string>(completion_inline_math) << '\n';
2057 case RC_COMPLETION_INLINE_TEXT:
2058 if (ignore_system_lyxrc ||
2059 completion_inline_text != system_lyxrc.completion_inline_text) {
2060 os << "\\completion_inline_text "
2061 << convert<string>(completion_inline_text) << '\n';
2066 case RC_COMPLETION_INLINE_DOTS:
2067 if (ignore_system_lyxrc ||
2068 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2069 os << "\\completion_inline_dots "
2070 << convert<string>(completion_inline_dots) << '\n';
2075 case RC_AUTOCORRECTION_MATH:
2076 if (ignore_system_lyxrc ||
2077 autocorrection_math != system_lyxrc.autocorrection_math) {
2078 os << "\\autocorrection_math "
2079 << convert<string>(autocorrection_math) << '\n';
2084 case RC_COMPLETION_POPUP_DELAY:
2085 if (ignore_system_lyxrc ||
2086 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2087 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2092 case RC_COMPLETION_POPUP_MATH:
2093 if (ignore_system_lyxrc ||
2094 completion_popup_math != system_lyxrc.completion_popup_math) {
2095 os << "\\completion_popup_math "
2096 << convert<string>(completion_popup_math) << '\n';
2101 case RC_COMPLETION_POPUP_TEXT:
2102 if (ignore_system_lyxrc ||
2103 completion_popup_text != system_lyxrc.completion_popup_text) {
2104 os << "\\completion_popup_text "
2105 << convert<string>(completion_popup_text) << '\n';
2110 case RC_COMPLETION_CURSOR_TEXT:
2111 if (ignore_system_lyxrc ||
2112 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2113 os << "\\completion_cursor_text "
2114 << convert<string>(completion_cursor_text) << '\n';
2119 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2120 if (ignore_system_lyxrc ||
2121 completion_popup_after_complete
2122 != system_lyxrc.completion_popup_after_complete) {
2123 os << "\\completion_popup_after_complete "
2124 << convert<string>(completion_popup_after_complete) << '\n';
2129 case RC_COMPLETION_MINLENGTH:
2130 if (ignore_system_lyxrc ||
2131 completion_minlength != system_lyxrc.completion_minlength) {
2132 os << "\\completion_minlength " << convert<string>(completion_minlength)
2138 case RC_NUMLASTFILES:
2139 if (ignore_system_lyxrc ||
2140 num_lastfiles != system_lyxrc.num_lastfiles) {
2141 os << "\\num_lastfiles " << num_lastfiles << '\n';
2146 case RC_CHECKLASTFILES:
2147 if (ignore_system_lyxrc ||
2148 check_lastfiles != system_lyxrc.check_lastfiles) {
2149 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2155 case RC_EXAMPLEPATH:
2156 if (ignore_system_lyxrc ||
2157 example_path != system_lyxrc.example_path) {
2158 string const path = os::external_path(example_path);
2159 os << "\\example_path \"" << path << "\"\n";
2164 case RC_TEMPLATEPATH:
2165 if (ignore_system_lyxrc ||
2166 template_path != system_lyxrc.template_path) {
2167 string const path = os::external_path(template_path);
2168 os << "\\template_path \"" << path << "\"\n";
2173 case RC_TEMPDIRPATH:
2174 if (ignore_system_lyxrc ||
2175 tempdir_path != system_lyxrc.tempdir_path) {
2176 string const path = os::external_path(tempdir_path);
2177 os << "\\tempdir_path \"" << path << "\"\n";
2182 case RC_THESAURUSDIRPATH:
2183 if (ignore_system_lyxrc ||
2184 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2185 string const path = os::external_path(thesaurusdir_path);
2186 os << "\\thesaurusdir_path \"" << path << "\"\n";
2191 case RC_HUNSPELLDIR_PATH:
2192 if (ignore_system_lyxrc ||
2193 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2194 string const path = os::external_path(hunspelldir_path);
2195 os << "\\hunspelldir_path \"" << path << "\"\n";
2200 case RC_PLAINTEXT_LINELEN:
2201 if (ignore_system_lyxrc ||
2202 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2203 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2208 case RC_MAKE_BACKUP:
2209 if (ignore_system_lyxrc ||
2210 make_backup != system_lyxrc.make_backup) {
2211 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2216 case RC_SAVE_COMPRESSED:
2217 if (ignore_system_lyxrc ||
2218 save_compressed != system_lyxrc.save_compressed) {
2219 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2224 case RC_SAVE_ORIGIN:
2225 if (ignore_system_lyxrc ||
2226 save_origin != system_lyxrc.save_origin) {
2227 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2232 case RC_BACKUPDIR_PATH:
2233 if (ignore_system_lyxrc ||
2234 backupdir_path != system_lyxrc.backupdir_path) {
2235 string const path = os::external_path(backupdir_path);
2236 os << "\\backupdir_path \"" << path << "\"\n";
2242 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2246 << "# SPELLCHECKER SECTION ##############################\n"
2250 case RC_ACCEPT_COMPOUND:
2251 if (ignore_system_lyxrc ||
2252 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2253 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2260 if (ignore_system_lyxrc ||
2261 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2262 os << "\\alternate_language \"" << spellchecker_alt_lang
2269 if (ignore_system_lyxrc ||
2270 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2271 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2276 case RC_USE_NATIVE_FILEDIALOG:
2277 if (ignore_system_lyxrc ||
2278 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2279 os << "\\use_native_filedialog "
2280 << convert<string>(use_native_filedialog)
2286 case RC_USE_SYSTEM_COLORS:
2287 if (ignore_system_lyxrc ||
2288 use_system_colors != system_lyxrc.use_system_colors) {
2289 os << "\\use_system_colors "
2290 << convert<string>(use_system_colors)
2296 case RC_USE_TOOLTIP:
2297 if (ignore_system_lyxrc ||
2298 use_tooltip != system_lyxrc.use_tooltip) {
2299 os << "\\use_tooltip "
2300 << convert<string>(use_tooltip)
2308 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2312 case RC_DEFAULT_DECIMAL_SEP:
2313 if (ignore_system_lyxrc ||
2314 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2315 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2320 case RC_DEFAULT_LENGTH_UNIT:
2321 if (ignore_system_lyxrc ||
2322 default_length_unit != system_lyxrc.default_length_unit) {
2323 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2328 case RC_SPELLCHECKER:
2329 if (ignore_system_lyxrc ||
2330 spellchecker != system_lyxrc.spellchecker) {
2331 os << "\\spellchecker " << spellchecker << '\n';
2336 case RC_SPELLCHECK_CONTINUOUSLY:
2337 if (ignore_system_lyxrc ||
2338 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2339 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2345 case RC_SPELLCHECK_NOTES:
2346 if (ignore_system_lyxrc ||
2347 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2348 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2354 case RC_VISUAL_CURSOR:
2355 if (ignore_system_lyxrc ||
2356 visual_cursor != system_lyxrc.visual_cursor) {
2357 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2362 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2363 if (ignore_system_lyxrc ||
2364 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2365 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2366 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2371 case RC_LANGUAGE_CUSTOM_PACKAGE:
2372 if (ignore_system_lyxrc ||
2373 language_custom_package != system_lyxrc.language_custom_package) {
2374 os << "\\language_custom_package \"" << language_custom_package
2380 case RC_LANGUAGE_GLOBAL_OPTIONS:
2381 if (ignore_system_lyxrc ||
2382 language_global_options
2383 != system_lyxrc.language_global_options) {
2384 os << "\\language_global_options \""
2385 << convert<string>(language_global_options)
2391 case RC_LANGUAGE_PACKAGE_SELECTION:
2392 if (ignore_system_lyxrc ||
2393 language_package_selection != system_lyxrc.language_package_selection) {
2394 os << "\\language_package_selection ";
2395 switch (language_package_selection) {
2413 case RC_LANGUAGE_COMMAND_BEGIN:
2414 if (ignore_system_lyxrc ||
2415 language_command_begin
2416 != system_lyxrc.language_command_begin) {
2417 os << "\\language_command_begin \""
2418 << language_command_begin
2424 case RC_LANGUAGE_COMMAND_END:
2425 if (ignore_system_lyxrc ||
2426 language_command_end
2427 != system_lyxrc.language_command_end) {
2428 os << "\\language_command_end \"" << language_command_end
2434 case RC_LANGUAGE_COMMAND_LOCAL:
2435 if (ignore_system_lyxrc ||
2436 language_command_local
2437 != system_lyxrc.language_command_local) {
2438 os << "\\language_command_local \""
2439 << language_command_local
2445 case RC_LANGUAGE_AUTO_BEGIN:
2446 if (ignore_system_lyxrc ||
2447 language_auto_begin != system_lyxrc.language_auto_begin) {
2448 os << "\\language_auto_begin "
2449 << convert<string>(language_auto_begin) << '\n';
2454 case RC_LANGUAGE_AUTO_END:
2455 if (ignore_system_lyxrc ||
2456 language_auto_end != system_lyxrc.language_auto_end) {
2457 os << "\\language_auto_end "
2458 << convert<string>(language_auto_end) << '\n';
2463 case RC_MARK_FOREIGN_LANGUAGE:
2464 if (ignore_system_lyxrc ||
2465 mark_foreign_language
2466 != system_lyxrc.mark_foreign_language) {
2467 os << "\\mark_foreign_language " <<
2468 convert<string>(mark_foreign_language) << '\n';
2471 case RC_RESPECT_OS_KBD_LANGUAGE:
2472 if (ignore_system_lyxrc ||
2473 respect_os_kbd_language
2474 != system_lyxrc.respect_os_kbd_language) {
2475 os << "\\respect_os_kbd_language " <<
2476 convert<string>(respect_os_kbd_language) << '\n';
2483 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2487 case RC_AUTO_NUMBER:
2488 if (ignore_system_lyxrc ||
2489 auto_number != system_lyxrc.auto_number) {
2490 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2495 case RC_GUI_LANGUAGE:
2496 if (ignore_system_lyxrc ||
2497 gui_language != system_lyxrc.gui_language) {
2498 os << "\\gui_language " << gui_language << '\n';
2503 case RC_EXPORT_OVERWRITE:
2504 if (ignore_system_lyxrc ||
2505 export_overwrite != system_lyxrc.export_overwrite) {
2507 switch (export_overwrite) {
2518 os << "\\export_overwrite " << status << '\n';
2523 case RC_SCROLL_WHEEL_ZOOM:
2524 if (ignore_system_lyxrc ||
2525 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2527 switch (scroll_wheel_zoom) {
2528 case SCROLL_WHEEL_ZOOM_OFF:
2531 case SCROLL_WHEEL_ZOOM_CTRL:
2534 case SCROLL_WHEEL_ZOOM_SHIFT:
2537 case SCROLL_WHEEL_ZOOM_ALT:
2541 os << "\\scroll_wheel_zoom " << status << '\n';
2547 << "# FORMATS SECTION ##########################\n"
2552 // New/modified formats
2553 for (Formats::const_iterator cit = theFormats().begin();
2554 cit != theFormats().end(); ++cit) {
2555 Format const * format =
2556 theSystemFormats().getFormat(cit->name());
2558 format->extensions() != cit->extensions() ||
2559 format->prettyname() != cit->prettyname() ||
2560 format->shortcut() != cit->shortcut() ||
2561 format->viewer() != cit->viewer() ||
2562 format->editor() != cit->editor() ||
2563 format->documentFormat() != cit->documentFormat() ||
2564 format->vectorFormat() != cit->vectorFormat() ||
2565 format->inExportMenu() != cit->inExportMenu() ||
2566 format->noMenu() != cit->noMenu() ||
2567 format->mime() != cit->mime()) {
2568 os << "\\format \"" << cit->name() << "\" \""
2569 << cit->extensions() << "\" \""
2570 << to_utf8(cit->prettyname()) << "\" \""
2571 << cit->shortcut() << "\" \""
2572 << escapeCommand(cit->viewer()) << "\" \""
2573 << escapeCommand(cit->editor()) << "\" \"";
2574 vector<string> flags;
2575 if (cit->documentFormat())
2576 flags.push_back("document");
2577 if (cit->vectorFormat())
2578 flags.push_back("vector");
2579 if (cit->zippedNative())
2580 flags.push_back("zipped=native");
2581 if (cit->inExportMenu())
2582 flags.push_back("menu=export");
2584 os << getStringFromVector(flags);
2585 os << "\" \"" << cit->mime() << "\"\n";
2589 // Look for deleted formats
2590 for (Formats::const_iterator cit = theSystemFormats().begin();
2591 cit != theSystemFormats().end(); ++cit)
2592 if (!theFormats().getFormat(cit->name()))
2593 os << "\\format \"" << cit->name()
2594 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2598 case RC_VIEWER_ALTERNATIVES: {
2599 Alternatives::const_iterator it = viewer_alternatives.begin();
2600 Alternatives::const_iterator const en = viewer_alternatives.end();
2601 Alternatives::const_iterator const sysend =
2602 system_lyxrc.viewer_alternatives.end();
2603 for (; it != en; ++it) {
2604 string const & fmt = it->first;
2605 CommandSet const & cmd = it->second;
2606 CommandSet::const_iterator sit = cmd.begin();
2607 CommandSet::const_iterator const sen = cmd.end();
2608 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2609 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2610 system_lyxrc.viewer_alternatives.find(fmt);
2611 for (; sit != sen; ++sit) {
2612 string const & cmd = *sit;
2613 if (ignore_system_lyxrc
2614 || sysfmt == sysend // format not found
2615 || sysfmt->second.count(cmd) == 0 // this command not found
2617 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2624 case RC_EDITOR_ALTERNATIVES: {
2625 Alternatives::const_iterator it = editor_alternatives.begin();
2626 Alternatives::const_iterator const en = editor_alternatives.end();
2627 Alternatives::const_iterator const sysend =
2628 system_lyxrc.editor_alternatives.end();
2629 for (; it != en; ++it) {
2630 string const & fmt = it->first;
2631 CommandSet const & cmd = it->second;
2632 CommandSet::const_iterator sit = cmd.begin();
2633 CommandSet::const_iterator const sen = cmd.end();
2634 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2635 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2636 system_lyxrc.editor_alternatives.find(fmt);
2637 for (; sit != sen; ++sit) {
2638 string const & cmd = *sit;
2639 if (ignore_system_lyxrc
2640 || sysfmt == sysend // format not found
2641 || sysfmt->second.count(cmd) == 0 // this command not found
2643 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2650 case RC_DEFAULT_OTF_VIEW_FORMAT:
2651 if ((ignore_system_lyxrc ||
2652 default_otf_view_format != system_lyxrc.default_otf_view_format)
2653 && !default_otf_view_format.empty()) {
2654 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2659 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2660 if ((ignore_system_lyxrc ||
2661 default_platex_view_format != system_lyxrc.default_platex_view_format)
2662 && !default_platex_view_format.empty()) {
2663 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2668 case RC_DEFAULT_VIEW_FORMAT:
2669 if (ignore_system_lyxrc ||
2670 default_view_format != system_lyxrc.default_view_format) {
2671 os << "\\default_view_format " << default_view_format << '\n';
2682 << "# CONVERTERS SECTION ##########################\n"
2687 // Look for new converters
2688 for (Converters::const_iterator cit = theConverters().begin();
2689 cit != theConverters().end(); ++cit) {
2690 Converter const * converter =
2691 theSystemConverters().getConverter(cit->from(),
2694 converter->command() != cit->command() ||
2695 converter->flags() != cit->flags())
2696 os << "\\converter \"" << cit->from() << "\" \""
2697 << cit->to() << "\" \""
2698 << escapeCommand(cit->command()) << "\" \""
2699 << cit->flags() << "\"\n";
2702 // New/modifed converters
2703 for (Converters::const_iterator cit = theSystemConverters().begin();
2704 cit != theSystemConverters().end(); ++cit)
2705 if (!theConverters().getConverter(cit->from(), cit->to()))
2706 os << "\\converter \"" << cit->from()
2707 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2714 << "# COPIERS SECTION ##########################\n"
2717 // Look for new movers
2718 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2719 Movers::const_iterator const sysend = theSystemMovers().end();
2720 Movers::const_iterator it = theMovers().begin();
2721 Movers::const_iterator end = theMovers().end();
2723 for (; it != end; ++it) {
2724 Movers::const_iterator const sysit =
2725 find_if(sysbegin, sysend, SameMover(*it));
2726 if (sysit == sysend) {
2727 string const & fmt = it->first;
2728 string const & command =
2729 it->second.command();
2731 os << "\\copier " << fmt
2732 << " \"" << escapeCommand(command) << "\"\n";
2738 // We don't actually delete SpecialisedMover(s) from the
2739 // map, just clear their 'command', so there's no need
2740 // to test for anything else.
2747 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2749 // Why the switch you might ask. It is a trick to ensure that all
2750 // the elements in the LyXRCTags enum is handled. As you can see
2751 // there are no breaks at all. So it is just a huge fall-through.
2752 // The nice thing is that we will get a warning from the compiler
2753 // if we forget an element.
2754 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2756 case LyXRC::RC_LAST:
2757 case LyXRC::RC_ACCEPT_COMPOUND:
2758 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2759 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2761 case LyXRC::RC_ALT_LANG:
2762 case LyXRC::RC_PLAINTEXT_LINELEN:
2763 case LyXRC::RC_AUTOCORRECTION_MATH:
2764 case LyXRC::RC_AUTOREGIONDELETE:
2765 case LyXRC::RC_AUTORESET_OPTIONS:
2766 case LyXRC::RC_AUTOSAVE:
2767 case LyXRC::RC_AUTO_NUMBER:
2768 case LyXRC::RC_BACKUPDIR_PATH:
2769 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2770 case LyXRC::RC_BIBTEX_COMMAND:
2771 case LyXRC::RC_BINDFILE:
2772 case LyXRC::RC_CHECKLASTFILES:
2773 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2774 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2775 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2776 case LyXRC::RC_COMPLETION_INLINE_MATH:
2777 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2778 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2779 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2780 case LyXRC::RC_COMPLETION_POPUP_MATH:
2781 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2782 case LyXRC::RC_COMPLETION_MINLENGTH:
2783 case LyXRC::RC_USELASTFILEPOS:
2784 case LyXRC::RC_LOADSESSION:
2785 case LyXRC::RC_CHKTEX_COMMAND:
2786 case LyXRC::RC_CONVERTER:
2787 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2788 case LyXRC::RC_COPIER:
2789 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2790 case LyXRC::RC_CT_MARKUP_COPIED:
2791 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2792 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2793 case LyXRC::RC_GUI_LANGUAGE:
2794 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2795 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2796 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2797 case LyXRC::RC_DEFFILE:
2798 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2799 case LyXRC::RC_DISPLAY_GRAPHICS:
2800 case LyXRC::RC_DOCUMENTPATH:
2801 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2802 FileName path(lyxrc_new.document_path);
2803 if (path.exists() && path.isDirectory())
2804 package().document_dir() = FileName(lyxrc.document_path);
2807 case LyXRC::RC_EDITOR_ALTERNATIVES:
2808 case LyXRC::RC_ESC_CHARS:
2809 case LyXRC::RC_EXAMPLEPATH:
2810 case LyXRC::RC_FILEFORMAT:
2811 case LyXRC::RC_GROUP_LAYOUTS:
2812 case LyXRC::RC_HUNSPELLDIR_PATH:
2813 case LyXRC::RC_ICON_SET:
2814 case LyXRC::RC_INDEX_ALTERNATIVES:
2815 case LyXRC::RC_INDEX_COMMAND:
2816 case LyXRC::RC_JBIBTEX_COMMAND:
2817 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2818 case LyXRC::RC_JINDEX_COMMAND:
2819 case LyXRC::RC_NOMENCL_COMMAND:
2820 case LyXRC::RC_PYGMENTIZE_COMMAND:
2821 case LyXRC::RC_INPUT:
2822 case LyXRC::RC_KBMAP:
2823 case LyXRC::RC_KBMAP_PRIMARY:
2824 case LyXRC::RC_KBMAP_SECONDARY:
2825 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2826 case LyXRC::RC_LANGUAGE_AUTO_END:
2827 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2828 case LyXRC::RC_LANGUAGE_COMMAND_END:
2829 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2830 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2831 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2832 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2833 case LyXRC::RC_LYXRCFORMAT:
2834 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2835 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2836 case LyXRC::RC_MACRO_EDIT_STYLE:
2837 case LyXRC::RC_MAKE_BACKUP:
2838 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2839 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2840 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2841 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2842 case LyXRC::RC_NUMLASTFILES:
2843 case LyXRC::RC_PARAGRAPH_MARKERS:
2844 case LyXRC::RC_PATH_PREFIX:
2845 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2846 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2847 // Resets python path
2848 support::os::python(true);
2851 case LyXRC::RC_PREVIEW:
2852 if (lyxrc_orig.preview != lyxrc_new.preview) {
2853 // Update all previews of all documents.
2854 /* FIXME: this can be very expensive. It would be cheaper
2855 * to kill all existing previews and update visible
2857 theBufferList().updatePreviews();
2860 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2861 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2862 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2863 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2864 case LyXRC::RC_PRINTPAPERFLAG:
2865 case LyXRC::RC_SAVE_COMPRESSED:
2866 case LyXRC::RC_SAVE_ORIGIN:
2867 case LyXRC::RC_SCREEN_DPI:
2869 case LyXRC::RC_SCREEN_FONT_ROMAN:
2870 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2871 case LyXRC::RC_SCREEN_FONT_SANS:
2872 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2873 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2874 case LyXRC::RC_SCREEN_FONT_SIZES:
2875 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2876 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2877 case LyXRC::RC_SCREEN_ZOOM:
2878 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2879 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2880 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2881 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2882 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2883 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2884 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2885 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2886 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2887 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2890 case LyXRC::RC_GEOMETRY_SESSION:
2891 case LyXRC::RC_SERVERPIPE:
2892 case LyXRC::RC_SET_COLOR:
2893 case LyXRC::RC_SHOW_BANNER:
2894 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2895 case LyXRC::RC_SPELLCHECKER:
2896 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2899 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2900 case LyXRC::RC_SPELLCHECK_NOTES:
2901 case LyXRC::RC_SPLITINDEX_COMMAND:
2902 case LyXRC::RC_TEMPDIRPATH:
2903 case LyXRC::RC_TEMPLATEPATH:
2904 case LyXRC::RC_TEX_ALLOWS_SPACES:
2905 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2906 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2907 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2910 case LyXRC::RC_TEXINPUTS_PREFIX:
2911 case LyXRC::RC_THESAURUSDIRPATH:
2912 case LyXRC::RC_UIFILE:
2913 case LyXRC::RC_USER_EMAIL:
2914 case LyXRC::RC_USER_INITIALS:
2915 case LyXRC::RC_USER_NAME:
2916 case LyXRC::RC_USE_CONVERTER_CACHE:
2917 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2918 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2919 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2920 case LyXRC::RC_USE_SYSTEM_COLORS:
2921 case LyXRC::RC_USE_TOOLTIP:
2922 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2923 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2924 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2925 case LyXRC::RC_SINGLE_INSTANCE:
2926 case LyXRC::RC_SORT_LAYOUTS:
2927 case LyXRC::RC_FULL_SCREEN_LIMIT:
2928 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2929 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2930 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2931 case LyXRC::RC_FULL_SCREEN_TABBAR:
2932 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2933 case LyXRC::RC_FULL_SCREEN_WIDTH:
2934 case LyXRC::RC_VISUAL_CURSOR:
2935 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2936 case LyXRC::RC_VIEWER:
2937 case LyXRC::RC_VIEWER_ALTERNATIVES:
2938 case LyXRC::RC_FORWARD_SEARCH_DVI:
2939 case LyXRC::RC_FORWARD_SEARCH_PDF:
2940 case LyXRC::RC_EXPORT_OVERWRITE:
2941 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2942 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2943 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2944 case LyXRC::RC_CURSOR_WIDTH:
2950 set<string> LyXRC::getRCs()
2953 for (int i = 0; i != lyxrcCount; ++i)
2954 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2960 string const LyXRC::getDescription(LyXRCTags tag)
2965 case RC_ACCEPT_COMPOUND:
2966 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2970 str = _("Specify an alternate language. The default is to use the language of the document.");
2973 case RC_PLAINTEXT_LINELEN:
2974 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.");
2977 case RC_AUTOREGIONDELETE:
2978 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2981 case RC_AUTORESET_OPTIONS:
2982 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2986 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2989 case RC_AUTO_NUMBER:
2992 case RC_BACKUPDIR_PATH:
2993 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.");
2996 case RC_BIBTEX_COMMAND:
2997 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3000 case RC_JBIBTEX_COMMAND:
3001 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3005 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3008 case RC_CHECKLASTFILES:
3009 str = _("Select to check whether the lastfiles still exist.");
3012 case RC_CHKTEX_COMMAND:
3013 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3019 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3020 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3023 case RC_CONVERTER_NEEDAUTH:
3024 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3030 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3031 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.");
3034 case RC_CURSOR_WIDTH:
3035 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3038 case RC_SCROLL_BELOW_DOCUMENT:
3039 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");
3042 case RC_MAC_DONTSWAP_CTRL_META:
3043 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3046 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3047 str = _("Use the Mac OS X conventions for cursor movement");
3050 case RC_SHOW_MACRO_LABEL:
3051 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3055 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3058 case RC_DEFAULT_OTF_VIEW_FORMAT:
3059 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3062 case RC_DEFAULT_VIEW_FORMAT:
3063 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3066 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3067 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3070 case RC_DISPLAY_GRAPHICS:
3071 str = _("Select how LyX will display any graphics.");
3074 case RC_DOCUMENTPATH:
3075 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3079 str = _("Specify additional chars that can be part of a word.");
3082 case RC_EXAMPLEPATH:
3083 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3089 case RC_INDEX_COMMAND:
3090 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\".");
3093 case RC_JINDEX_COMMAND:
3094 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3097 case RC_NOMENCL_COMMAND:
3098 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3101 case RC_PYGMENTIZE_COMMAND:
3102 str = _("The command to run the python pygments syntax highlighter.");
3109 case RC_KBMAP_PRIMARY:
3110 case RC_KBMAP_SECONDARY:
3111 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.");
3114 case RC_LANGUAGE_AUTO_BEGIN:
3115 str = _("Select if a language switching command is needed at the beginning of the document.");
3118 case RC_LANGUAGE_AUTO_END:
3119 str = _("Select if a language switching command is needed at the end of the document.");
3122 case RC_LANGUAGE_COMMAND_BEGIN:
3123 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.");
3126 case RC_LANGUAGE_COMMAND_END:
3127 str = _("The LaTeX command for changing back to the language of the document.");
3130 case RC_LANGUAGE_COMMAND_LOCAL:
3131 str = _("The LaTeX command for local changing of the language.");
3134 case RC_LANGUAGE_GLOBAL_OPTIONS:
3135 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3138 case RC_LANGUAGE_CUSTOM_PACKAGE:
3139 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3142 case RC_LANGUAGE_PACKAGE_SELECTION:
3143 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3146 case RC_USELASTFILEPOS:
3147 str = _("De-select if you do not want LyX to scroll to saved position.");
3150 case RC_LOADSESSION:
3151 str = _("De-select to prevent loading files opened from the last LyX session.");
3154 case RC_MAKE_BACKUP:
3155 str = _("De-select if you don't want LyX to create backup files.");
3158 case RC_MARK_FOREIGN_LANGUAGE:
3159 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3162 case RC_RESPECT_OS_KBD_LANGUAGE:
3163 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3166 case RC_MOUSE_WHEEL_SPEED:
3167 str = _("The scrolling speed of the mouse wheel.");
3170 case RC_COMPLETION_POPUP_DELAY:
3171 str = _("The completion popup delay.");
3174 case RC_COMPLETION_POPUP_MATH:
3175 str = _("Select to display the completion popup in math mode.");
3178 case RC_COMPLETION_POPUP_TEXT:
3179 str = _("Select to display the completion popup in text mode.");
3182 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3183 str = _("Show the completion popup without delay after non-unique completion attempt.");
3186 case RC_COMPLETION_POPUP_TEXT:
3187 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3190 case RC_COMPLETION_POPUP_DELAY:
3191 str = _("The inline completion delay.");
3194 case RC_COMPLETION_INLINE_MATH:
3195 str = _("Select to display the inline completion in math mode.");
3198 case RC_COMPLETION_INLINE_TEXT:
3199 str = _("Select to display the inline completion in text mode.");
3202 case RC_COMPLETION_INLINE_DOTS:
3203 str = _("Use \"...\" to shorten long completions.");
3206 case RC_AUTOCORRECTION_MATH:
3207 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3210 case RC_NUMLASTFILES:
3211 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3215 case RC_PATH_PREFIX:
3216 str = _("Specify those directories which should be "
3217 "prepended to the PATH environment variable.\n"
3218 "Use the OS native format.");
3222 str = _("Shows a typeset preview of things such as math");
3225 case RC_PREVIEW_HASHED_LABELS:
3226 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3229 case RC_PREVIEW_SCALE_FACTOR:
3230 str = _("Scale the preview size to suit.");
3233 case RC_PRINTLANDSCAPEFLAG:
3234 str = _("The option to print out in landscape.");
3237 case RC_PRINTPAPERDIMENSIONFLAG:
3238 str = _("Option to specify the dimensions of the print paper.");
3241 case RC_PRINTPAPERFLAG:
3242 str = _("The option to specify paper type.");
3245 case RC_VISUAL_CURSOR:
3246 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3249 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3250 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).");
3254 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3257 case RC_SCREEN_FONT_ROMAN:
3258 case RC_SCREEN_FONT_SANS:
3259 case RC_SCREEN_FONT_TYPEWRITER:
3260 str = _("The screen fonts used to display the text while editing.");
3263 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3264 case RC_SCREEN_FONT_SANS_FOUNDRY:
3265 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3268 case RC_SCREEN_FONT_SCALABLE:
3269 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.");
3272 case RC_SCREEN_FONT_SIZES:
3273 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3276 case RC_SCREEN_ZOOM:
3277 //xgettext:no-c-format
3278 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3281 case RC_GEOMETRY_SESSION:
3282 str = _("Allow session manager to save and restore windows geometry.");
3286 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3292 case RC_SHOW_BANNER:
3293 str = _("De-select if you don't want the startup banner.");
3296 case RC_TEMPDIRPATH:
3297 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3300 case RC_THESAURUSDIRPATH:
3301 str = _("This is the place where the files of the thesaurus library reside.");
3304 case RC_TEMPLATEPATH:
3305 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3308 case RC_TEX_ALLOWS_SPACES:
3311 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3314 case RC_TEXINPUTS_PREFIX:
3315 str = _("Specify those directories which should be "
3316 "prepended to the TEXINPUTS environment variable.\n"
3317 "A '.' represents the current document directory. "
3318 "Use the OS native format.");
3322 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3331 case RC_USE_USE_SYSTEM_COLORS:
3332 str = _("Enable use the system colors for some things like main window background and selection.");
3335 case RC_USE_TOOLTIP:
3336 str = _("Enable the automatic appearance of tool tips in the work area.");
3339 case RC_VIEWDVI_PAPEROPTION:
3340 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3355 // The global instance
3358 // The global copy of the system lyxrc entries (everything except preferences)