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 const lyx_name = lexrc.getString();
649 lexrc.printError("Missing color name for color: `$$Token'");
652 string const 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);
663 LYXERR(Debug::LYXRC, "Set " << lyx_name << "(" << col << ") to " << x11_name);
667 case RC_AUTOREGIONDELETE:
668 // Auto region delete defaults to true
669 lexrc >> auto_region_delete;
674 string userdir = package().user_support().absFileName();
675 if (userdir.back() == '/')
677 lyxpipes = subst(os::internal_path(lexrc.getString()), "$$UserDir",
682 case RC_CT_ADDITIONS_UNDERLINED:
683 lexrc >> ct_additions_underlined;
686 case RC_CT_MARKUP_COPIED:
687 lexrc >> ct_markup_copied;
690 case RC_CURSOR_FOLLOWS_SCROLLBAR:
691 lexrc >> cursor_follows_scrollbar;
694 case RC_CURSOR_WIDTH:
695 lexrc >> cursor_width;
698 case RC_SCROLL_BELOW_DOCUMENT:
699 lexrc >> scroll_below_document;
702 case RC_PARAGRAPH_MARKERS:
703 lexrc >> paragraph_markers;
706 case RC_MAC_DONTSWAP_CTRL_META:
707 lexrc >> mac_dontswap_ctrl_meta;
710 case RC_MAC_LIKE_CURSOR_MOVEMENT:
711 lexrc >> mac_like_cursor_movement;
714 case RC_MACRO_EDIT_STYLE:
716 switch (lexrc.getInteger()) {
717 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
718 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
719 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
724 case RC_DIALOGS_ICONIFY_WITH_MAIN:
725 lexrc >> dialogs_iconify_with_main;
728 case RC_PLAINTEXT_LINELEN:
729 lexrc >> plaintext_linelen;
731 // Spellchecker settings:
732 case RC_ACCEPT_COMPOUND:
733 lexrc >> spellchecker_accept_compound;
735 case RC_USE_NATIVE_FILEDIALOG:
736 lexrc >> use_native_filedialog;
738 case RC_USE_SYSTEM_COLORS:
739 lexrc >> use_system_colors;
742 lexrc >> use_tooltip;
744 case RC_SPELLCHECKER:
745 lexrc >> spellchecker;
748 lexrc >> spellchecker_alt_lang;
751 lexrc >> spellchecker_esc_chars;
753 case RC_SPELLCHECK_CONTINUOUSLY:
754 lexrc >> spellcheck_continuously;
756 case RC_SPELLCHECK_NOTES:
757 lexrc >> spellcheck_notes;
760 lexrc >> make_backup;
762 case RC_SAVE_COMPRESSED:
763 lexrc >> save_compressed;
766 lexrc >> save_origin;
768 case RC_BACKUPDIR_PATH:
770 backupdir_path = os::internal_path(lexrc.getString());
772 case RC_DEFAULT_DECIMAL_SEP:
773 lexrc >> default_decimal_sep;
775 case RC_DEFAULT_LENGTH_UNIT:
777 default_length_unit = (Length::UNIT) lexrc.getInteger();
779 case RC_LANGUAGE_CUSTOM_PACKAGE:
780 lexrc >> language_custom_package;
782 case RC_LANGUAGE_AUTO_BEGIN:
783 lexrc >> language_auto_begin;
785 case RC_LANGUAGE_AUTO_END:
786 lexrc >> language_auto_end;
788 case RC_LANGUAGE_GLOBAL_OPTIONS:
789 lexrc >> language_global_options;
791 case RC_LANGUAGE_PACKAGE_SELECTION:
793 switch (lexrc.getInteger()) {
795 language_package_selection = LP_AUTO;
798 language_package_selection = LP_BABEL;
801 language_package_selection = LP_CUSTOM;
804 language_package_selection = LP_NONE;
809 case RC_LANGUAGE_COMMAND_BEGIN:
810 lexrc >> language_command_begin;
812 case RC_LANGUAGE_COMMAND_END:
813 lexrc >> language_command_end;
815 case RC_LANGUAGE_COMMAND_LOCAL:
816 lexrc >> language_command_local;
818 case RC_RESPECT_OS_KBD_LANGUAGE:
819 lexrc >> respect_os_kbd_language;
821 case RC_VISUAL_CURSOR:
822 lexrc >> visual_cursor;
824 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
825 lexrc >> close_buffer_with_last_view;
828 lexrc >> auto_number;
830 case RC_MARK_FOREIGN_LANGUAGE:
831 lexrc >> mark_foreign_language;
837 fmt = lexrc.getString();
838 if (lexrc.next(true))
839 command = lexrc.getString();
840 setMover(fmt, command);
845 string from, to, command, flags;
847 from = lexrc.getString();
849 to = lexrc.getString();
850 if (lexrc.next(true))
851 command = lexrc.getString();
853 flags = lexrc.getString();
855 theConverters().erase(from, to);
857 theConverters().add(from, to, command, flags);
860 // compatibility with versions older than 1.4.0 only
862 string format, command;
863 lexrc >> format >> command;
864 theFormats().setViewer(format, command);
867 case RC_FILEFORMAT: {
869 string format, extensions, shortcut;
870 docstring prettyname;
871 if (!(lexrc >> format >> extensions))
873 if (ok && lexrc.next(true))
874 prettyname = lexrc.getDocString();
878 if(!(lexrc >> shortcut))
880 string viewer, editor;
881 if (ok && lexrc.next(true))
882 viewer = lexrc.getString();
885 if (ok && lexrc.next(true))
886 editor = lexrc.getString();
890 if (!(lexrc >> flags >> mime))
892 int flgs = Format::none;
893 while (!flags.empty()) {
895 flags = split(flags, flag, ',');
896 if (flag == "document")
897 flgs |= Format::document;
898 else if (flag == "vector")
899 flgs |= Format::vector;
900 else if (flag == "zipped=native")
901 flgs |= Format::zipped_native;
902 else if (flag == "menu=export")
903 flgs |= Format::export_menu;
904 else if (flag == "menu=none")
905 flgs |= Format::no_menu;
907 LYXERR0("Ignoring unknown flag `"
908 << flag << "' for format `"
912 LYXERR0("Syntax error in format " << format);
913 else if (prettyname.empty()) {
914 if (theConverters().formatIsUsed(format))
915 LYXERR0("Can't delete format " << format);
917 theFormats().erase(format);
919 theFormats().add(format, extensions, prettyname,
920 shortcut, viewer, editor, mime, flgs);
924 case RC_VIEWER_ALTERNATIVES: {
925 string format, command;
926 if ((lexrc >> format) && lexrc.next(true)) {
927 command = lexrc.getString();
928 viewer_alternatives[format].insert(command);
932 case RC_EDITOR_ALTERNATIVES: {
933 string format, command;
934 if ((lexrc >> format) && lexrc.next(true)) {
935 command = lexrc.getString();
936 editor_alternatives[format].insert(command);
941 case RC_DEFAULT_OTF_VIEW_FORMAT:
942 lexrc >> default_otf_view_format;
945 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
946 lexrc >> default_platex_view_format;
949 case RC_DEFAULT_VIEW_FORMAT:
950 lexrc >> default_view_format;
953 case RC_GUI_LANGUAGE:
954 lexrc >> gui_language;
958 lexrc >> show_banner;
963 string const tmp = lexrc.getString();
964 if (tmp == "true" || tmp == "on")
965 preview = PREVIEW_ON;
966 else if (tmp == "no_math")
967 preview = PREVIEW_NO_MATH;
969 preview = PREVIEW_OFF;
970 if (tmp != "false" && tmp != "off")
971 LYXERR0("Unrecognized preview status \""
977 case RC_PREVIEW_HASHED_LABELS:
978 lexrc >> preview_hashed_labels;
981 case RC_PREVIEW_SCALE_FACTOR:
982 lexrc >> preview_scale_factor;
991 case RC_USER_INITIALS:
992 lexrc >> user_initials;
996 lexrc >> path_prefix;
999 case RC_USE_CONVERTER_CACHE:
1000 lexrc >> use_converter_cache;
1002 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1003 lexrc >> use_converter_needauth_forbidden;
1005 case RC_USE_CONVERTER_NEEDAUTH:
1006 lexrc >> use_converter_needauth;
1008 case RC_CONVERTER_CACHE_MAXAGE:
1009 lexrc >> converter_cache_maxage;
1012 case RC_SORT_LAYOUTS:
1013 lexrc >> sort_layouts;
1015 case RC_GROUP_LAYOUTS:
1016 lexrc >> group_layouts;
1018 case RC_FULL_SCREEN_LIMIT:
1019 lexrc >> full_screen_limit;
1021 case RC_FULL_SCREEN_TOOLBARS:
1022 lexrc >> full_screen_toolbars;
1024 case RC_FULL_SCREEN_SCROLLBAR:
1025 lexrc >> full_screen_scrollbar;
1027 case RC_FULL_SCREEN_STATUSBAR:
1028 lexrc >> full_screen_statusbar;
1030 case RC_FULL_SCREEN_TABBAR:
1031 lexrc >> full_screen_tabbar;
1033 case RC_FULL_SCREEN_MENUBAR:
1034 lexrc >> full_screen_menubar;
1036 case RC_FULL_SCREEN_WIDTH:
1037 lexrc >> full_screen_width;
1039 case RC_OPEN_BUFFERS_IN_TABS:
1040 lexrc >> open_buffers_in_tabs;
1042 case RC_SINGLE_CLOSE_TAB_BUTTON:
1043 lexrc >> single_close_tab_button;
1045 case RC_SINGLE_INSTANCE:
1046 lexrc >> single_instance;
1047 if (run_mode == PREFERRED)
1048 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1050 case RC_FORWARD_SEARCH_DVI:
1051 if (lexrc.next(true))
1052 forward_search_dvi = lexrc.getString();
1054 case RC_FORWARD_SEARCH_PDF:
1055 if (lexrc.next(true))
1056 forward_search_pdf = lexrc.getString();
1058 case RC_EXPORT_OVERWRITE:
1060 string const tmp = lexrc.getString();
1061 if (tmp == "all" || tmp == "true")
1062 export_overwrite = ALL_FILES;
1063 else if (tmp == "main")
1064 export_overwrite = MAIN_FILE;
1066 export_overwrite = NO_FILES;
1067 if (tmp != "ask" && tmp != "false")
1068 LYXERR0("Unrecognized export_overwrite status \""
1073 case RC_SCROLL_WHEEL_ZOOM:
1075 string const tmp = lexrc.getString();
1077 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1078 else if (tmp == "shift")
1079 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1080 else if (tmp == "alt")
1081 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1083 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1084 if (tmp != "off" && tmp != "false")
1085 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1091 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1092 lexrc >> mouse_middlebutton_paste;
1096 break; // this is just a dummy
1099 // This is triggered the first time through the loop unless
1100 // we hit a format tag.
1101 if (check_format && rc_format != LYXRC_FILEFORMAT)
1102 return FormatMismatch;
1105 /// Update converters data-structures
1106 theConverters().update(theFormats());
1107 theConverters().buildGraph();
1108 theBufferList().invalidateConverterCache();
1114 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1116 ofstream ofs(filename.toFilesystemEncoding().c_str());
1118 write(ofs, ignore_system_lyxrc);
1122 void LyXRC::print() const
1124 if (lyxerr.debugging())
1125 write(lyxerr, false);
1133 typedef pair<string, SpecialisedMover> Data;
1135 SameMover(Data const & comparison)
1136 : comparison_(comparison) {}
1138 bool operator()(Data const & data) const
1140 return data.first == comparison_.first &&
1141 data.second.command() == comparison_.second.command();
1151 // Escape \ and " so that LyXLex can read the string later
1152 string escapeCommand(string const & str) {
1153 return subst(subst(str , "\\", "\\\\"),
1160 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1162 LyXRCTags tag = RC_LAST;
1164 if (!name.empty()) {
1165 for (int i = 0; i != lyxrcCount; ++i)
1166 if ("\\" + name == lyxrcTags[i].tag)
1167 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1171 os << "# LyX " << lyx_version
1172 << " generated this file. If you want to make your own\n"
1173 << "# modifications you should do them from inside LyX and save.\n\n"
1174 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1176 // Why the switch you might ask. It is a trick to ensure that all
1177 // the elements in the LyXRCTags enum are handled. As you can see
1178 // there are no breaks at all. So it is just a huge fall-through.
1179 // The nice thing is that we will get a warning from the compiler
1180 // if we forget an element.
1184 // input/include files are not done here
1185 case RC_LYXRCFORMAT:
1187 if (ignore_system_lyxrc ||
1188 bind_file != system_lyxrc.bind_file) {
1189 string const path = os::external_path(bind_file);
1190 os << "\\bind_file \"" << path << "\"\n";
1196 if (ignore_system_lyxrc ||
1197 def_file != system_lyxrc.def_file) {
1198 string const path = os::external_path(def_file);
1199 os << "\\def_file \"" << path << "\"\n";
1208 << "# MISC SECTION ######################################\n"
1210 // bind files are not done here.
1212 case RC_PATH_PREFIX:
1213 if (ignore_system_lyxrc ||
1214 path_prefix != system_lyxrc.path_prefix) {
1215 os << "\\path_prefix \"" << path_prefix << "\"\n";
1221 if (ignore_system_lyxrc ||
1222 ui_file != system_lyxrc.ui_file) {
1223 string const path = os::external_path(ui_file);
1224 os << "\\ui_file \"" << path << "\"\n";
1229 case RC_AUTOREGIONDELETE:
1230 if (ignore_system_lyxrc ||
1231 auto_region_delete != system_lyxrc.auto_region_delete) {
1232 os << "# Set to false to inhibit automatic replacement of\n"
1233 << "# the current selection.\n"
1234 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1240 case RC_AUTORESET_OPTIONS:
1241 if (ignore_system_lyxrc ||
1242 auto_reset_options != system_lyxrc.auto_reset_options) {
1243 os << "# Set to false to inhibit automatic reset of\n"
1244 << "# the class options to defaults on class change.\n"
1245 << "\\auto_reset_options "
1246 << convert<string>(auto_reset_options)
1253 if (ignore_system_lyxrc ||
1254 autosave != system_lyxrc.autosave) {
1255 os << "# The time interval between auto-saves in seconds.\n"
1256 << "\\autosave " << autosave << '\n';
1261 case RC_DISPLAY_GRAPHICS:
1262 if (ignore_system_lyxrc ||
1263 display_graphics != system_lyxrc.display_graphics) {
1264 os << "# Display graphics within LyX\n"
1266 << "\\display_graphics "
1267 << (display_graphics ? "true" : "false")
1273 case RC_SORT_LAYOUTS:
1274 if (ignore_system_lyxrc ||
1275 sort_layouts != system_lyxrc.sort_layouts) {
1276 os << "# Sort layouts alphabetically.\n"
1277 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1282 case RC_GROUP_LAYOUTS:
1283 if (ignore_system_lyxrc ||
1284 group_layouts != system_lyxrc.group_layouts) {
1285 os << "# Group layouts by their category.\n"
1286 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1291 case RC_VIEWDVI_PAPEROPTION:
1292 if (ignore_system_lyxrc ||
1293 view_dvi_paper_option
1294 != system_lyxrc.view_dvi_paper_option) {
1295 os << "# Options used to specify paper size to the\n"
1296 << "# view_dvi_command (e.g. -paper)\n"
1297 << "\\view_dvi_paper_option \""
1298 << view_dvi_paper_option << "\"\n";
1303 case RC_CHKTEX_COMMAND:
1304 if (ignore_system_lyxrc ||
1305 chktex_command != system_lyxrc.chktex_command) {
1306 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1311 case RC_BIBTEX_ALTERNATIVES: {
1312 CommandSet::const_iterator it = bibtex_alternatives.begin();
1313 CommandSet::const_iterator end = bibtex_alternatives.end();
1314 for ( ; it != end; ++it) {
1315 if (ignore_system_lyxrc
1316 || !system_lyxrc.bibtex_alternatives.count(*it))
1317 os << "\\bibtex_alternatives \""
1324 case RC_BIBTEX_COMMAND:
1325 if (ignore_system_lyxrc ||
1326 bibtex_command != system_lyxrc.bibtex_command) {
1327 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1332 case RC_JBIBTEX_COMMAND:
1333 if (ignore_system_lyxrc ||
1334 jbibtex_command != system_lyxrc.jbibtex_command) {
1335 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1340 case RC_JBIBTEX_ALTERNATIVES: {
1341 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1342 CommandSet::const_iterator end = jbibtex_alternatives.end();
1343 for ( ; it != end; ++it) {
1344 if (ignore_system_lyxrc
1345 || !system_lyxrc.jbibtex_alternatives.count(*it))
1346 os << "\\jbibtex_alternatives \""
1353 case RC_INDEX_ALTERNATIVES: {
1354 CommandSet::const_iterator it = index_alternatives.begin();
1355 CommandSet::const_iterator end = index_alternatives.end();
1356 for ( ; it != end; ++it) {
1357 if (ignore_system_lyxrc
1358 || !system_lyxrc.index_alternatives.count(*it))
1359 os << "\\index_alternatives \""
1366 case RC_INDEX_COMMAND:
1367 if (ignore_system_lyxrc ||
1368 index_command != system_lyxrc.index_command) {
1369 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1374 case RC_JINDEX_COMMAND:
1375 if (ignore_system_lyxrc ||
1376 jindex_command != system_lyxrc.jindex_command) {
1377 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1382 case RC_SPLITINDEX_COMMAND:
1383 if (ignore_system_lyxrc ||
1384 splitindex_command != system_lyxrc.splitindex_command) {
1385 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1390 case RC_NOMENCL_COMMAND:
1391 if (ignore_system_lyxrc ||
1392 nomencl_command != system_lyxrc.nomencl_command) {
1393 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1398 case RC_PYGMENTIZE_COMMAND:
1399 if (ignore_system_lyxrc ||
1400 pygmentize_command != system_lyxrc.pygmentize_command) {
1401 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1406 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1407 // Don't write this setting to the preferences file,
1408 // but allow temporary changes (bug 7557).
1409 if (ignore_system_lyxrc) {
1410 os << "\\tex_expects_windows_paths "
1411 << convert<string>(windows_style_tex_paths) << '\n';
1416 case RC_TEX_ALLOWS_SPACES:
1417 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1418 os << "\\tex_allows_spaces "
1419 << convert<string>(tex_allows_spaces) << '\n';
1425 if (ignore_system_lyxrc ||
1426 use_kbmap != system_lyxrc.use_kbmap) {
1427 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1432 case RC_KBMAP_PRIMARY:
1433 if (ignore_system_lyxrc ||
1434 primary_kbmap != system_lyxrc.primary_kbmap) {
1435 string const path = os::external_path(primary_kbmap);
1436 os << "\\kbmap_primary \"" << path << "\"\n";
1441 case RC_KBMAP_SECONDARY:
1442 if (ignore_system_lyxrc ||
1443 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1444 string const path = os::external_path(secondary_kbmap);
1445 os << "\\kbmap_secondary \"" << path << "\"\n";
1451 if (ignore_system_lyxrc ||
1452 lyxpipes != system_lyxrc.lyxpipes) {
1453 string const path = os::external_path(lyxpipes);
1454 os << "\\serverpipe \"" << path << "\"\n";
1460 os << "\\user_name \"" << user_name << "\"\n";
1465 os << "\\user_email \"" << user_email << "\"\n";
1469 case RC_USER_INITIALS:
1470 os << "\\user_initials \"" << user_initials << "\"\n";
1474 case RC_SHOW_BANNER:
1475 if (ignore_system_lyxrc ||
1476 show_banner != system_lyxrc.show_banner) {
1477 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1483 if (ignore_system_lyxrc ||
1484 preview != system_lyxrc.preview) {
1490 case PREVIEW_NO_MATH:
1497 os << "\\preview " << status << '\n';
1502 case RC_PREVIEW_HASHED_LABELS:
1503 if (ignore_system_lyxrc ||
1504 preview_hashed_labels !=
1505 system_lyxrc.preview_hashed_labels) {
1506 os << "\\preview_hashed_labels "
1507 << convert<string>(preview_hashed_labels) << '\n';
1512 case RC_PREVIEW_SCALE_FACTOR:
1513 if (ignore_system_lyxrc ||
1514 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1515 os << "\\preview_scale_factor "
1516 << preview_scale_factor << '\n';
1521 case RC_USE_CONVERTER_CACHE:
1522 if (ignore_system_lyxrc ||
1523 use_converter_cache != system_lyxrc.use_converter_cache) {
1524 os << "\\use_converter_cache "
1525 << convert<string>(use_converter_cache) << '\n';
1530 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1531 if (ignore_system_lyxrc ||
1532 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1533 os << "\\use_converter_needauth_forbidden "
1534 << convert<string>(use_converter_needauth_forbidden) << '\n';
1539 case RC_USE_CONVERTER_NEEDAUTH:
1540 if (ignore_system_lyxrc ||
1541 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1542 os << "\\use_converter_needauth "
1543 << convert<string>(use_converter_needauth) << '\n';
1548 case RC_CONVERTER_CACHE_MAXAGE:
1549 if (ignore_system_lyxrc ||
1550 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1551 os << "\\converter_cache_maxage "
1552 << converter_cache_maxage << '\n';
1558 << "# SCREEN & FONTS SECTION ############################\n"
1562 if (ignore_system_lyxrc ||
1563 icon_set != system_lyxrc.icon_set) {
1564 os << "\\icon_set \"" << icon_set
1570 case RC_USE_SYSTEM_THEME_ICONS:
1571 if (ignore_system_lyxrc ||
1572 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1573 os << "\\use_system_theme_icons "
1574 << convert<string>(use_system_theme_icons)
1581 if (ignore_system_lyxrc ||
1582 dpi != system_lyxrc.dpi) {
1583 os << "\\screen_dpi " << dpi << '\n';
1588 case RC_SCREEN_ZOOM:
1589 if (ignore_system_lyxrc ||
1590 defaultZoom != system_lyxrc.defaultZoom) {
1591 os << "\\screen_zoom " << defaultZoom << '\n';
1596 case RC_GEOMETRY_SESSION:
1597 if (ignore_system_lyxrc ||
1598 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1599 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1605 case RC_CT_ADDITIONS_UNDERLINED:
1606 if (ignore_system_lyxrc ||
1607 ct_additions_underlined
1608 != system_lyxrc.ct_additions_underlined) {
1609 os << "\\ct_additions_underlined "
1610 << convert<string>(ct_additions_underlined) << '\n';
1615 case RC_CT_MARKUP_COPIED:
1616 if (ignore_system_lyxrc ||
1618 != system_lyxrc.ct_markup_copied) {
1619 os << "\\ct_markup_copied "
1620 << convert<string>(ct_markup_copied) << '\n';
1625 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1626 if (ignore_system_lyxrc ||
1627 cursor_follows_scrollbar
1628 != system_lyxrc.cursor_follows_scrollbar) {
1629 os << "\\cursor_follows_scrollbar "
1630 << convert<string>(cursor_follows_scrollbar) << '\n';
1635 case RC_CURSOR_WIDTH:
1636 if (ignore_system_lyxrc ||
1638 != system_lyxrc.cursor_width) {
1639 os << "\\cursor_width "
1640 << cursor_width << '\n';
1645 case RC_SCROLL_BELOW_DOCUMENT:
1646 if (ignore_system_lyxrc ||
1647 scroll_below_document
1648 != system_lyxrc.scroll_below_document) {
1649 os << "\\scroll_below_document "
1650 << convert<string>(scroll_below_document) << '\n';
1655 case RC_PARAGRAPH_MARKERS:
1656 if (ignore_system_lyxrc ||
1658 != system_lyxrc.paragraph_markers) {
1659 os << "\\paragraph_markers "
1660 << convert<string>(paragraph_markers) << '\n';
1665 case RC_MAC_DONTSWAP_CTRL_META:
1666 if (ignore_system_lyxrc ||
1667 mac_dontswap_ctrl_meta
1668 != system_lyxrc.mac_dontswap_ctrl_meta) {
1669 os << "\\mac_dontswap_ctrl_meta "
1670 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1675 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1676 if (ignore_system_lyxrc ||
1677 mac_like_cursor_movement
1678 != system_lyxrc.mac_like_cursor_movement) {
1679 os << "\\mac_like_cursor_movement "
1680 << convert<string>(mac_like_cursor_movement) << '\n';
1685 case RC_MACRO_EDIT_STYLE:
1686 if (ignore_system_lyxrc ||
1688 != system_lyxrc.macro_edit_style) {
1689 os << "\\macro_edit_style ";
1690 switch (macro_edit_style) {
1691 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1692 case MACRO_EDIT_INLINE: os << "1\n"; break;
1693 case MACRO_EDIT_LIST: os << "2\n"; break;
1699 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1700 if (ignore_system_lyxrc ||
1701 dialogs_iconify_with_main
1702 != system_lyxrc.dialogs_iconify_with_main) {
1703 os << "\\dialogs_iconify_with_main "
1704 << convert<string>(dialogs_iconify_with_main) << '\n';
1709 case RC_SCREEN_FONT_ROMAN:
1710 if (ignore_system_lyxrc ||
1711 roman_font_name != system_lyxrc.roman_font_name) {
1712 os << "\\screen_font_roman \"" << roman_font_name
1718 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1719 if (ignore_system_lyxrc ||
1720 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1721 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1727 case RC_SCREEN_FONT_SANS:
1728 if (ignore_system_lyxrc ||
1729 sans_font_name != system_lyxrc.sans_font_name) {
1730 os << "\\screen_font_sans \"" << sans_font_name
1736 case RC_SCREEN_FONT_SANS_FOUNDRY:
1737 if (ignore_system_lyxrc ||
1738 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1739 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1745 case RC_SCREEN_FONT_TYPEWRITER:
1746 if (ignore_system_lyxrc ||
1747 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1748 os << "\\screen_font_typewriter \""
1749 << typewriter_font_name << "\"\n";
1754 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1755 if (ignore_system_lyxrc ||
1756 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1757 os << "\\screen_font_typewriter_foundry \""
1758 << typewriter_font_foundry << "\"\n";
1763 case RC_SCREEN_FONT_SCALABLE:
1764 if (ignore_system_lyxrc ||
1765 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1766 os << "\\screen_font_scalable "
1767 << convert<string>(use_scalable_fonts)
1773 case RC_SCREEN_FONT_SIZES:
1774 if (ignore_system_lyxrc ||
1775 font_sizes[TINY_SIZE]
1776 != system_lyxrc.font_sizes[TINY_SIZE] ||
1777 font_sizes[SCRIPT_SIZE]
1778 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1779 font_sizes[FOOTNOTE_SIZE]
1780 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1781 font_sizes[SMALL_SIZE]
1782 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1783 font_sizes[NORMAL_SIZE]
1784 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1785 font_sizes[LARGE_SIZE]
1786 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1787 font_sizes[LARGER_SIZE]
1788 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1789 font_sizes[LARGEST_SIZE]
1790 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1791 font_sizes[HUGE_SIZE]
1792 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1793 font_sizes[HUGER_SIZE]
1794 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1795 streamsize old_prec = os.precision();
1796 os.setf(ios::fixed);
1798 os << "\\screen_font_sizes"
1799 << ' ' << font_sizes[TINY_SIZE]
1800 << ' ' << font_sizes[SCRIPT_SIZE]
1801 << ' ' << font_sizes[FOOTNOTE_SIZE]
1802 << ' ' << font_sizes[SMALL_SIZE]
1803 << ' ' << font_sizes[NORMAL_SIZE]
1804 << ' ' << font_sizes[LARGE_SIZE]
1805 << ' ' << font_sizes[LARGER_SIZE]
1806 << ' ' << font_sizes[LARGEST_SIZE]
1807 << ' ' << font_sizes[HUGE_SIZE]
1808 << ' ' << font_sizes[HUGER_SIZE]
1810 os.precision(old_prec);
1811 os.unsetf(ios::fixed);
1816 case RC_FULL_SCREEN_LIMIT:
1817 if (ignore_system_lyxrc ||
1818 full_screen_limit != system_lyxrc.full_screen_limit) {
1819 os << "\\fullscreen_limit "
1820 << convert<string>(full_screen_limit)
1826 case RC_FULL_SCREEN_TOOLBARS:
1827 if (ignore_system_lyxrc ||
1828 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1829 os << "\\fullscreen_toolbars "
1830 << convert<string>(full_screen_toolbars)
1836 case RC_FULL_SCREEN_SCROLLBAR:
1837 if (ignore_system_lyxrc ||
1838 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1839 os << "\\fullscreen_scrollbar "
1840 << convert<string>(full_screen_scrollbar)
1846 case RC_FULL_SCREEN_STATUSBAR:
1847 if (ignore_system_lyxrc ||
1848 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1849 os << "\\fullscreen_statusbar "
1850 << convert<string>(full_screen_statusbar)
1856 case RC_FULL_SCREEN_TABBAR:
1857 if (ignore_system_lyxrc ||
1858 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1859 os << "\\fullscreen_tabbar "
1860 << convert<string>(full_screen_tabbar)
1866 case RC_FULL_SCREEN_MENUBAR:
1867 if (ignore_system_lyxrc ||
1868 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1869 os << "\\fullscreen_menubar "
1870 << convert<string>(full_screen_menubar)
1876 case RC_FULL_SCREEN_WIDTH:
1877 if (ignore_system_lyxrc ||
1878 full_screen_width != system_lyxrc.full_screen_width) {
1879 os << "\\fullscreen_width "
1880 << convert<string>(full_screen_width)
1886 case RC_OPEN_BUFFERS_IN_TABS:
1887 if (ignore_system_lyxrc ||
1888 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1889 os << "\\open_buffers_in_tabs "
1890 << convert<string>(open_buffers_in_tabs)
1896 case RC_SINGLE_CLOSE_TAB_BUTTON:
1897 if (ignore_system_lyxrc ||
1898 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1899 os << "\\single_close_tab_button "
1900 << convert<string>(single_close_tab_button)
1906 case RC_SINGLE_INSTANCE:
1907 if (ignore_system_lyxrc ||
1908 single_instance != system_lyxrc.single_instance) {
1909 os << "\\single_instance "
1910 << convert<string>(single_instance)
1916 case RC_FORWARD_SEARCH_DVI:
1917 if (ignore_system_lyxrc ||
1918 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1919 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1924 case RC_FORWARD_SEARCH_PDF:
1925 if (ignore_system_lyxrc ||
1926 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1927 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1933 << "# COLOR SECTION ###################################\n"
1938 for (int i = 0; i < Color_ignore; ++i) {
1939 ColorCode lc = static_cast<ColorCode>(i);
1940 string const col = lcolor.getX11Name(lc);
1941 if (ignore_system_lyxrc
1942 || col != system_lcolor.getX11Name(lc)) {
1943 os << "\\set_color \""
1944 << lcolor.getLyXName(lc) << "\" \""
1952 << "# PRINTER SECTION ###################################\n"
1956 case RC_PRINTLANDSCAPEFLAG:
1957 if (ignore_system_lyxrc ||
1958 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1959 os << "\\print_landscape_flag \"" << print_landscape_flag
1965 case RC_PRINTPAPERFLAG:
1966 if (ignore_system_lyxrc ||
1967 print_paper_flag != system_lyxrc.print_paper_flag) {
1968 os << "\\print_paper_flag \"" << print_paper_flag
1974 case RC_PRINTPAPERDIMENSIONFLAG:
1975 if (ignore_system_lyxrc ||
1976 print_paper_dimension_flag
1977 != system_lyxrc.print_paper_dimension_flag) {
1978 os << "\\print_paper_dimension_flag \""
1979 << print_paper_dimension_flag << "\"\n";
1985 << "# TEX SECTION #######################################\n"
1989 case RC_TEXINPUTS_PREFIX:
1990 if (ignore_system_lyxrc ||
1991 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1992 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1998 << "# FILE SECTION ######################################\n"
2001 case RC_DOCUMENTPATH:
2002 if (ignore_system_lyxrc ||
2003 document_path != system_lyxrc.document_path) {
2004 string const path = os::external_path(document_path);
2005 os << "\\document_path \"" << path << "\"\n";
2010 case RC_USELASTFILEPOS:
2011 if (ignore_system_lyxrc ||
2012 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2013 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2019 case RC_LOADSESSION:
2020 if (ignore_system_lyxrc ||
2021 load_session != system_lyxrc.load_session) {
2022 os << "\\load_session " << convert<string>(load_session)
2028 case RC_MOUSE_WHEEL_SPEED:
2029 if (ignore_system_lyxrc ||
2030 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2031 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2036 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2037 if (ignore_system_lyxrc ||
2038 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2039 os << "\\mouse_middlebutton_paste "
2040 << convert<string>(mouse_middlebutton_paste) << '\n';
2045 case RC_COMPLETION_INLINE_DELAY:
2046 if (ignore_system_lyxrc ||
2047 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2048 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2053 case RC_COMPLETION_INLINE_MATH:
2054 if (ignore_system_lyxrc ||
2055 completion_inline_math != system_lyxrc.completion_inline_math) {
2056 os << "\\completion_inline_math "
2057 << convert<string>(completion_inline_math) << '\n';
2062 case RC_COMPLETION_INLINE_TEXT:
2063 if (ignore_system_lyxrc ||
2064 completion_inline_text != system_lyxrc.completion_inline_text) {
2065 os << "\\completion_inline_text "
2066 << convert<string>(completion_inline_text) << '\n';
2071 case RC_COMPLETION_INLINE_DOTS:
2072 if (ignore_system_lyxrc ||
2073 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2074 os << "\\completion_inline_dots "
2075 << convert<string>(completion_inline_dots) << '\n';
2080 case RC_AUTOCORRECTION_MATH:
2081 if (ignore_system_lyxrc ||
2082 autocorrection_math != system_lyxrc.autocorrection_math) {
2083 os << "\\autocorrection_math "
2084 << convert<string>(autocorrection_math) << '\n';
2089 case RC_COMPLETION_POPUP_DELAY:
2090 if (ignore_system_lyxrc ||
2091 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2092 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2097 case RC_COMPLETION_POPUP_MATH:
2098 if (ignore_system_lyxrc ||
2099 completion_popup_math != system_lyxrc.completion_popup_math) {
2100 os << "\\completion_popup_math "
2101 << convert<string>(completion_popup_math) << '\n';
2106 case RC_COMPLETION_POPUP_TEXT:
2107 if (ignore_system_lyxrc ||
2108 completion_popup_text != system_lyxrc.completion_popup_text) {
2109 os << "\\completion_popup_text "
2110 << convert<string>(completion_popup_text) << '\n';
2115 case RC_COMPLETION_CURSOR_TEXT:
2116 if (ignore_system_lyxrc ||
2117 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2118 os << "\\completion_cursor_text "
2119 << convert<string>(completion_cursor_text) << '\n';
2124 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2125 if (ignore_system_lyxrc ||
2126 completion_popup_after_complete
2127 != system_lyxrc.completion_popup_after_complete) {
2128 os << "\\completion_popup_after_complete "
2129 << convert<string>(completion_popup_after_complete) << '\n';
2134 case RC_COMPLETION_MINLENGTH:
2135 if (ignore_system_lyxrc ||
2136 completion_minlength != system_lyxrc.completion_minlength) {
2137 os << "\\completion_minlength " << convert<string>(completion_minlength)
2143 case RC_NUMLASTFILES:
2144 if (ignore_system_lyxrc ||
2145 num_lastfiles != system_lyxrc.num_lastfiles) {
2146 os << "\\num_lastfiles " << num_lastfiles << '\n';
2151 case RC_CHECKLASTFILES:
2152 if (ignore_system_lyxrc ||
2153 check_lastfiles != system_lyxrc.check_lastfiles) {
2154 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2160 case RC_EXAMPLEPATH:
2161 if (ignore_system_lyxrc ||
2162 example_path != system_lyxrc.example_path) {
2163 string const path = os::external_path(example_path);
2164 os << "\\example_path \"" << path << "\"\n";
2169 case RC_TEMPLATEPATH:
2170 if (ignore_system_lyxrc ||
2171 template_path != system_lyxrc.template_path) {
2172 string const path = os::external_path(template_path);
2173 os << "\\template_path \"" << path << "\"\n";
2178 case RC_TEMPDIRPATH:
2179 if (ignore_system_lyxrc ||
2180 tempdir_path != system_lyxrc.tempdir_path) {
2181 string const path = os::external_path(tempdir_path);
2182 os << "\\tempdir_path \"" << path << "\"\n";
2187 case RC_THESAURUSDIRPATH:
2188 if (ignore_system_lyxrc ||
2189 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2190 string const path = os::external_path(thesaurusdir_path);
2191 os << "\\thesaurusdir_path \"" << path << "\"\n";
2196 case RC_HUNSPELLDIR_PATH:
2197 if (ignore_system_lyxrc ||
2198 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2199 string const path = os::external_path(hunspelldir_path);
2200 os << "\\hunspelldir_path \"" << path << "\"\n";
2205 case RC_PLAINTEXT_LINELEN:
2206 if (ignore_system_lyxrc ||
2207 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2208 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2213 case RC_MAKE_BACKUP:
2214 if (ignore_system_lyxrc ||
2215 make_backup != system_lyxrc.make_backup) {
2216 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2221 case RC_SAVE_COMPRESSED:
2222 if (ignore_system_lyxrc ||
2223 save_compressed != system_lyxrc.save_compressed) {
2224 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2229 case RC_SAVE_ORIGIN:
2230 if (ignore_system_lyxrc ||
2231 save_origin != system_lyxrc.save_origin) {
2232 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2237 case RC_BACKUPDIR_PATH:
2238 if (ignore_system_lyxrc ||
2239 backupdir_path != system_lyxrc.backupdir_path) {
2240 string const path = os::external_path(backupdir_path);
2241 os << "\\backupdir_path \"" << path << "\"\n";
2247 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2251 << "# SPELLCHECKER SECTION ##############################\n"
2255 case RC_ACCEPT_COMPOUND:
2256 if (ignore_system_lyxrc ||
2257 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2258 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2265 if (ignore_system_lyxrc ||
2266 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2267 os << "\\alternate_language \"" << spellchecker_alt_lang
2274 if (ignore_system_lyxrc ||
2275 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2276 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2281 case RC_USE_NATIVE_FILEDIALOG:
2282 if (ignore_system_lyxrc ||
2283 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2284 os << "\\use_native_filedialog "
2285 << convert<string>(use_native_filedialog)
2291 case RC_USE_SYSTEM_COLORS:
2292 if (ignore_system_lyxrc ||
2293 use_system_colors != system_lyxrc.use_system_colors) {
2294 os << "\\use_system_colors "
2295 << convert<string>(use_system_colors)
2301 case RC_USE_TOOLTIP:
2302 if (ignore_system_lyxrc ||
2303 use_tooltip != system_lyxrc.use_tooltip) {
2304 os << "\\use_tooltip "
2305 << convert<string>(use_tooltip)
2313 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2317 case RC_DEFAULT_DECIMAL_SEP:
2318 if (ignore_system_lyxrc ||
2319 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2320 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2325 case RC_DEFAULT_LENGTH_UNIT:
2326 if (ignore_system_lyxrc ||
2327 default_length_unit != system_lyxrc.default_length_unit) {
2328 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2333 case RC_SPELLCHECKER:
2334 if (ignore_system_lyxrc ||
2335 spellchecker != system_lyxrc.spellchecker) {
2336 os << "\\spellchecker " << spellchecker << '\n';
2341 case RC_SPELLCHECK_CONTINUOUSLY:
2342 if (ignore_system_lyxrc ||
2343 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2344 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2350 case RC_SPELLCHECK_NOTES:
2351 if (ignore_system_lyxrc ||
2352 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2353 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2359 case RC_VISUAL_CURSOR:
2360 if (ignore_system_lyxrc ||
2361 visual_cursor != system_lyxrc.visual_cursor) {
2362 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2367 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2368 if (ignore_system_lyxrc ||
2369 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2370 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2371 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2376 case RC_LANGUAGE_CUSTOM_PACKAGE:
2377 if (ignore_system_lyxrc ||
2378 language_custom_package != system_lyxrc.language_custom_package) {
2379 os << "\\language_custom_package \"" << language_custom_package
2385 case RC_LANGUAGE_GLOBAL_OPTIONS:
2386 if (ignore_system_lyxrc ||
2387 language_global_options
2388 != system_lyxrc.language_global_options) {
2389 os << "\\language_global_options \""
2390 << convert<string>(language_global_options)
2396 case RC_LANGUAGE_PACKAGE_SELECTION:
2397 if (ignore_system_lyxrc ||
2398 language_package_selection != system_lyxrc.language_package_selection) {
2399 os << "\\language_package_selection ";
2400 switch (language_package_selection) {
2418 case RC_LANGUAGE_COMMAND_BEGIN:
2419 if (ignore_system_lyxrc ||
2420 language_command_begin
2421 != system_lyxrc.language_command_begin) {
2422 os << "\\language_command_begin \""
2423 << language_command_begin
2429 case RC_LANGUAGE_COMMAND_END:
2430 if (ignore_system_lyxrc ||
2431 language_command_end
2432 != system_lyxrc.language_command_end) {
2433 os << "\\language_command_end \"" << language_command_end
2439 case RC_LANGUAGE_COMMAND_LOCAL:
2440 if (ignore_system_lyxrc ||
2441 language_command_local
2442 != system_lyxrc.language_command_local) {
2443 os << "\\language_command_local \""
2444 << language_command_local
2450 case RC_LANGUAGE_AUTO_BEGIN:
2451 if (ignore_system_lyxrc ||
2452 language_auto_begin != system_lyxrc.language_auto_begin) {
2453 os << "\\language_auto_begin "
2454 << convert<string>(language_auto_begin) << '\n';
2459 case RC_LANGUAGE_AUTO_END:
2460 if (ignore_system_lyxrc ||
2461 language_auto_end != system_lyxrc.language_auto_end) {
2462 os << "\\language_auto_end "
2463 << convert<string>(language_auto_end) << '\n';
2468 case RC_MARK_FOREIGN_LANGUAGE:
2469 if (ignore_system_lyxrc ||
2470 mark_foreign_language
2471 != system_lyxrc.mark_foreign_language) {
2472 os << "\\mark_foreign_language " <<
2473 convert<string>(mark_foreign_language) << '\n';
2476 case RC_RESPECT_OS_KBD_LANGUAGE:
2477 if (ignore_system_lyxrc ||
2478 respect_os_kbd_language
2479 != system_lyxrc.respect_os_kbd_language) {
2480 os << "\\respect_os_kbd_language " <<
2481 convert<string>(respect_os_kbd_language) << '\n';
2488 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2492 case RC_AUTO_NUMBER:
2493 if (ignore_system_lyxrc ||
2494 auto_number != system_lyxrc.auto_number) {
2495 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2500 case RC_GUI_LANGUAGE:
2501 if (ignore_system_lyxrc ||
2502 gui_language != system_lyxrc.gui_language) {
2503 os << "\\gui_language " << gui_language << '\n';
2508 case RC_EXPORT_OVERWRITE:
2509 if (ignore_system_lyxrc ||
2510 export_overwrite != system_lyxrc.export_overwrite) {
2512 switch (export_overwrite) {
2523 os << "\\export_overwrite " << status << '\n';
2528 case RC_SCROLL_WHEEL_ZOOM:
2529 if (ignore_system_lyxrc ||
2530 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2532 switch (scroll_wheel_zoom) {
2533 case SCROLL_WHEEL_ZOOM_OFF:
2536 case SCROLL_WHEEL_ZOOM_CTRL:
2539 case SCROLL_WHEEL_ZOOM_SHIFT:
2542 case SCROLL_WHEEL_ZOOM_ALT:
2546 os << "\\scroll_wheel_zoom " << status << '\n';
2552 << "# FORMATS SECTION ##########################\n"
2557 // New/modified formats
2558 for (Formats::const_iterator cit = theFormats().begin();
2559 cit != theFormats().end(); ++cit) {
2560 Format const * format =
2561 theSystemFormats().getFormat(cit->name());
2563 format->extensions() != cit->extensions() ||
2564 format->prettyname() != cit->prettyname() ||
2565 format->shortcut() != cit->shortcut() ||
2566 format->viewer() != cit->viewer() ||
2567 format->editor() != cit->editor() ||
2568 format->documentFormat() != cit->documentFormat() ||
2569 format->vectorFormat() != cit->vectorFormat() ||
2570 format->inExportMenu() != cit->inExportMenu() ||
2571 format->noMenu() != cit->noMenu() ||
2572 format->mime() != cit->mime()) {
2573 os << "\\format \"" << cit->name() << "\" \""
2574 << cit->extensions() << "\" \""
2575 << to_utf8(cit->prettyname()) << "\" \""
2576 << cit->shortcut() << "\" \""
2577 << escapeCommand(cit->viewer()) << "\" \""
2578 << escapeCommand(cit->editor()) << "\" \"";
2579 vector<string> flags;
2580 if (cit->documentFormat())
2581 flags.push_back("document");
2582 if (cit->vectorFormat())
2583 flags.push_back("vector");
2584 if (cit->zippedNative())
2585 flags.push_back("zipped=native");
2586 if (cit->inExportMenu())
2587 flags.push_back("menu=export");
2589 os << getStringFromVector(flags);
2590 os << "\" \"" << cit->mime() << "\"\n";
2594 // Look for deleted formats
2595 for (Formats::const_iterator cit = theSystemFormats().begin();
2596 cit != theSystemFormats().end(); ++cit)
2597 if (!theFormats().getFormat(cit->name()))
2598 os << "\\format \"" << cit->name()
2599 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2603 case RC_VIEWER_ALTERNATIVES: {
2604 Alternatives::const_iterator it = viewer_alternatives.begin();
2605 Alternatives::const_iterator const en = viewer_alternatives.end();
2606 Alternatives::const_iterator const sysend =
2607 system_lyxrc.viewer_alternatives.end();
2608 for (; it != en; ++it) {
2609 string const & fmt = it->first;
2610 CommandSet const & cmd = it->second;
2611 CommandSet::const_iterator sit = cmd.begin();
2612 CommandSet::const_iterator const sen = cmd.end();
2613 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2614 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2615 system_lyxrc.viewer_alternatives.find(fmt);
2616 for (; sit != sen; ++sit) {
2617 string const & cmd = *sit;
2618 if (ignore_system_lyxrc
2619 || sysfmt == sysend // format not found
2620 || sysfmt->second.count(cmd) == 0 // this command not found
2622 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2629 case RC_EDITOR_ALTERNATIVES: {
2630 Alternatives::const_iterator it = editor_alternatives.begin();
2631 Alternatives::const_iterator const en = editor_alternatives.end();
2632 Alternatives::const_iterator const sysend =
2633 system_lyxrc.editor_alternatives.end();
2634 for (; it != en; ++it) {
2635 string const & fmt = it->first;
2636 CommandSet const & cmd = it->second;
2637 CommandSet::const_iterator sit = cmd.begin();
2638 CommandSet::const_iterator const sen = cmd.end();
2639 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2640 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2641 system_lyxrc.editor_alternatives.find(fmt);
2642 for (; sit != sen; ++sit) {
2643 string const & cmd = *sit;
2644 if (ignore_system_lyxrc
2645 || sysfmt == sysend // format not found
2646 || sysfmt->second.count(cmd) == 0 // this command not found
2648 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2655 case RC_DEFAULT_OTF_VIEW_FORMAT:
2656 if ((ignore_system_lyxrc ||
2657 default_otf_view_format != system_lyxrc.default_otf_view_format)
2658 && !default_otf_view_format.empty()) {
2659 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2664 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2665 if ((ignore_system_lyxrc ||
2666 default_platex_view_format != system_lyxrc.default_platex_view_format)
2667 && !default_platex_view_format.empty()) {
2668 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2673 case RC_DEFAULT_VIEW_FORMAT:
2674 if (ignore_system_lyxrc ||
2675 default_view_format != system_lyxrc.default_view_format) {
2676 os << "\\default_view_format " << default_view_format << '\n';
2687 << "# CONVERTERS SECTION ##########################\n"
2692 // Look for new converters
2693 for (Converters::const_iterator cit = theConverters().begin();
2694 cit != theConverters().end(); ++cit) {
2695 Converter const * converter =
2696 theSystemConverters().getConverter(cit->from(),
2699 converter->command() != cit->command() ||
2700 converter->flags() != cit->flags())
2701 os << "\\converter \"" << cit->from() << "\" \""
2702 << cit->to() << "\" \""
2703 << escapeCommand(cit->command()) << "\" \""
2704 << cit->flags() << "\"\n";
2707 // New/modifed converters
2708 for (Converters::const_iterator cit = theSystemConverters().begin();
2709 cit != theSystemConverters().end(); ++cit)
2710 if (!theConverters().getConverter(cit->from(), cit->to()))
2711 os << "\\converter \"" << cit->from()
2712 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2719 << "# COPIERS SECTION ##########################\n"
2722 // Look for new movers
2723 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2724 Movers::const_iterator const sysend = theSystemMovers().end();
2725 Movers::const_iterator it = theMovers().begin();
2726 Movers::const_iterator end = theMovers().end();
2728 for (; it != end; ++it) {
2729 Movers::const_iterator const sysit =
2730 find_if(sysbegin, sysend, SameMover(*it));
2731 if (sysit == sysend) {
2732 string const & fmt = it->first;
2733 string const & command =
2734 it->second.command();
2736 os << "\\copier " << fmt
2737 << " \"" << escapeCommand(command) << "\"\n";
2743 // We don't actually delete SpecialisedMover(s) from the
2744 // map, just clear their 'command', so there's no need
2745 // to test for anything else.
2752 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2754 // Why the switch you might ask. It is a trick to ensure that all
2755 // the elements in the LyXRCTags enum is handled. As you can see
2756 // there are no breaks at all. So it is just a huge fall-through.
2757 // The nice thing is that we will get a warning from the compiler
2758 // if we forget an element.
2759 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2761 case LyXRC::RC_LAST:
2762 case LyXRC::RC_ACCEPT_COMPOUND:
2763 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2764 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2766 case LyXRC::RC_ALT_LANG:
2767 case LyXRC::RC_PLAINTEXT_LINELEN:
2768 case LyXRC::RC_AUTOCORRECTION_MATH:
2769 case LyXRC::RC_AUTOREGIONDELETE:
2770 case LyXRC::RC_AUTORESET_OPTIONS:
2771 case LyXRC::RC_AUTOSAVE:
2772 case LyXRC::RC_AUTO_NUMBER:
2773 case LyXRC::RC_BACKUPDIR_PATH:
2774 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2775 case LyXRC::RC_BIBTEX_COMMAND:
2776 case LyXRC::RC_BINDFILE:
2777 case LyXRC::RC_CHECKLASTFILES:
2778 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2779 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2780 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2781 case LyXRC::RC_COMPLETION_INLINE_MATH:
2782 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2783 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2784 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2785 case LyXRC::RC_COMPLETION_POPUP_MATH:
2786 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2787 case LyXRC::RC_COMPLETION_MINLENGTH:
2788 case LyXRC::RC_USELASTFILEPOS:
2789 case LyXRC::RC_LOADSESSION:
2790 case LyXRC::RC_CHKTEX_COMMAND:
2791 case LyXRC::RC_CONVERTER:
2792 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2793 case LyXRC::RC_COPIER:
2794 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2795 case LyXRC::RC_CT_MARKUP_COPIED:
2796 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2797 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2798 case LyXRC::RC_GUI_LANGUAGE:
2799 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2800 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2801 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2802 case LyXRC::RC_DEFFILE:
2803 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2804 case LyXRC::RC_DISPLAY_GRAPHICS:
2805 case LyXRC::RC_DOCUMENTPATH:
2806 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2807 FileName path(lyxrc_new.document_path);
2808 if (path.exists() && path.isDirectory())
2809 package().document_dir() = FileName(lyxrc.document_path);
2812 case LyXRC::RC_EDITOR_ALTERNATIVES:
2813 case LyXRC::RC_ESC_CHARS:
2814 case LyXRC::RC_EXAMPLEPATH:
2815 case LyXRC::RC_FILEFORMAT:
2816 case LyXRC::RC_GROUP_LAYOUTS:
2817 case LyXRC::RC_HUNSPELLDIR_PATH:
2818 case LyXRC::RC_ICON_SET:
2819 case LyXRC::RC_INDEX_ALTERNATIVES:
2820 case LyXRC::RC_INDEX_COMMAND:
2821 case LyXRC::RC_JBIBTEX_COMMAND:
2822 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2823 case LyXRC::RC_JINDEX_COMMAND:
2824 case LyXRC::RC_NOMENCL_COMMAND:
2825 case LyXRC::RC_PYGMENTIZE_COMMAND:
2826 case LyXRC::RC_INPUT:
2827 case LyXRC::RC_KBMAP:
2828 case LyXRC::RC_KBMAP_PRIMARY:
2829 case LyXRC::RC_KBMAP_SECONDARY:
2830 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2831 case LyXRC::RC_LANGUAGE_AUTO_END:
2832 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2833 case LyXRC::RC_LANGUAGE_COMMAND_END:
2834 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2835 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2836 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2837 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2838 case LyXRC::RC_LYXRCFORMAT:
2839 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2840 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2841 case LyXRC::RC_MACRO_EDIT_STYLE:
2842 case LyXRC::RC_MAKE_BACKUP:
2843 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2844 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2845 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2846 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2847 case LyXRC::RC_NUMLASTFILES:
2848 case LyXRC::RC_PARAGRAPH_MARKERS:
2849 case LyXRC::RC_PATH_PREFIX:
2850 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2851 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2852 // Resets python path
2853 support::os::python(true);
2856 case LyXRC::RC_PREVIEW:
2857 if (lyxrc_orig.preview != lyxrc_new.preview) {
2858 // Update all previews of all documents.
2859 /* FIXME: this can be very expensive. It would be cheaper
2860 * to kill all existing previews and update visible
2862 theBufferList().updatePreviews();
2865 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2866 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2867 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2868 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2869 case LyXRC::RC_PRINTPAPERFLAG:
2870 case LyXRC::RC_SAVE_COMPRESSED:
2871 case LyXRC::RC_SAVE_ORIGIN:
2872 case LyXRC::RC_SCREEN_DPI:
2874 case LyXRC::RC_SCREEN_FONT_ROMAN:
2875 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2876 case LyXRC::RC_SCREEN_FONT_SANS:
2877 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2878 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2879 case LyXRC::RC_SCREEN_FONT_SIZES:
2880 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2881 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2882 case LyXRC::RC_SCREEN_ZOOM:
2883 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2884 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2885 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2886 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2887 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2888 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2889 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2890 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2891 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2892 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2895 case LyXRC::RC_GEOMETRY_SESSION:
2896 case LyXRC::RC_SERVERPIPE:
2897 case LyXRC::RC_SET_COLOR:
2898 case LyXRC::RC_SHOW_BANNER:
2899 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2900 case LyXRC::RC_SPELLCHECKER:
2901 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2904 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2905 case LyXRC::RC_SPELLCHECK_NOTES:
2906 case LyXRC::RC_SPLITINDEX_COMMAND:
2907 case LyXRC::RC_TEMPDIRPATH:
2908 case LyXRC::RC_TEMPLATEPATH:
2909 case LyXRC::RC_TEX_ALLOWS_SPACES:
2910 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2911 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2912 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2915 case LyXRC::RC_TEXINPUTS_PREFIX:
2916 case LyXRC::RC_THESAURUSDIRPATH:
2917 case LyXRC::RC_UIFILE:
2918 case LyXRC::RC_USER_EMAIL:
2919 case LyXRC::RC_USER_INITIALS:
2920 case LyXRC::RC_USER_NAME:
2921 case LyXRC::RC_USE_CONVERTER_CACHE:
2922 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2923 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2924 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2925 case LyXRC::RC_USE_SYSTEM_COLORS:
2926 case LyXRC::RC_USE_TOOLTIP:
2927 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2928 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2929 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2930 case LyXRC::RC_SINGLE_INSTANCE:
2931 case LyXRC::RC_SORT_LAYOUTS:
2932 case LyXRC::RC_FULL_SCREEN_LIMIT:
2933 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2934 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2935 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2936 case LyXRC::RC_FULL_SCREEN_TABBAR:
2937 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2938 case LyXRC::RC_FULL_SCREEN_WIDTH:
2939 case LyXRC::RC_VISUAL_CURSOR:
2940 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2941 case LyXRC::RC_VIEWER:
2942 case LyXRC::RC_VIEWER_ALTERNATIVES:
2943 case LyXRC::RC_FORWARD_SEARCH_DVI:
2944 case LyXRC::RC_FORWARD_SEARCH_PDF:
2945 case LyXRC::RC_EXPORT_OVERWRITE:
2946 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2947 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2948 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2949 case LyXRC::RC_CURSOR_WIDTH:
2955 set<string> LyXRC::getRCs()
2958 for (int i = 0; i != lyxrcCount; ++i)
2959 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2965 string const LyXRC::getDescription(LyXRCTags tag)
2970 case RC_ACCEPT_COMPOUND:
2971 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2975 str = _("Specify an alternate language. The default is to use the language of the document.");
2978 case RC_PLAINTEXT_LINELEN:
2979 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.");
2982 case RC_AUTOREGIONDELETE:
2983 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2986 case RC_AUTORESET_OPTIONS:
2987 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2991 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2994 case RC_AUTO_NUMBER:
2997 case RC_BACKUPDIR_PATH:
2998 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.");
3001 case RC_BIBTEX_COMMAND:
3002 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3005 case RC_JBIBTEX_COMMAND:
3006 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3010 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3013 case RC_CHECKLASTFILES:
3014 str = _("Select to check whether the lastfiles still exist.");
3017 case RC_CHKTEX_COMMAND:
3018 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3024 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3025 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3028 case RC_CONVERTER_NEEDAUTH:
3029 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3035 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3036 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.");
3039 case RC_CURSOR_WIDTH:
3040 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3043 case RC_SCROLL_BELOW_DOCUMENT:
3044 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");
3047 case RC_MAC_DONTSWAP_CTRL_META:
3048 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3051 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3052 str = _("Use the Mac OS X conventions for cursor movement");
3055 case RC_SHOW_MACRO_LABEL:
3056 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3060 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3063 case RC_DEFAULT_OTF_VIEW_FORMAT:
3064 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3067 case RC_DEFAULT_VIEW_FORMAT:
3068 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3071 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3072 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3075 case RC_DISPLAY_GRAPHICS:
3076 str = _("Select how LyX will display any graphics.");
3079 case RC_DOCUMENTPATH:
3080 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3084 str = _("Specify additional chars that can be part of a word.");
3087 case RC_EXAMPLEPATH:
3088 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3094 case RC_INDEX_COMMAND:
3095 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\".");
3098 case RC_JINDEX_COMMAND:
3099 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3102 case RC_NOMENCL_COMMAND:
3103 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3106 case RC_PYGMENTIZE_COMMAND:
3107 str = _("The command to run the python pygments syntax highlighter.");
3114 case RC_KBMAP_PRIMARY:
3115 case RC_KBMAP_SECONDARY:
3116 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.");
3119 case RC_LANGUAGE_AUTO_BEGIN:
3120 str = _("Select if a language switching command is needed at the beginning of the document.");
3123 case RC_LANGUAGE_AUTO_END:
3124 str = _("Select if a language switching command is needed at the end of the document.");
3127 case RC_LANGUAGE_COMMAND_BEGIN:
3128 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.");
3131 case RC_LANGUAGE_COMMAND_END:
3132 str = _("The LaTeX command for changing back to the language of the document.");
3135 case RC_LANGUAGE_COMMAND_LOCAL:
3136 str = _("The LaTeX command for local changing of the language.");
3139 case RC_LANGUAGE_GLOBAL_OPTIONS:
3140 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3143 case RC_LANGUAGE_CUSTOM_PACKAGE:
3144 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3147 case RC_LANGUAGE_PACKAGE_SELECTION:
3148 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3151 case RC_USELASTFILEPOS:
3152 str = _("De-select if you do not want LyX to scroll to saved position.");
3155 case RC_LOADSESSION:
3156 str = _("De-select to prevent loading files opened from the last LyX session.");
3159 case RC_MAKE_BACKUP:
3160 str = _("De-select if you don't want LyX to create backup files.");
3163 case RC_MARK_FOREIGN_LANGUAGE:
3164 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3167 case RC_RESPECT_OS_KBD_LANGUAGE:
3168 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3171 case RC_MOUSE_WHEEL_SPEED:
3172 str = _("The scrolling speed of the mouse wheel.");
3175 case RC_COMPLETION_POPUP_DELAY:
3176 str = _("The completion popup delay.");
3179 case RC_COMPLETION_POPUP_MATH:
3180 str = _("Select to display the completion popup in math mode.");
3183 case RC_COMPLETION_POPUP_TEXT:
3184 str = _("Select to display the completion popup in text mode.");
3187 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3188 str = _("Show the completion popup without delay after non-unique completion attempt.");
3191 case RC_COMPLETION_POPUP_TEXT:
3192 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3195 case RC_COMPLETION_POPUP_DELAY:
3196 str = _("The inline completion delay.");
3199 case RC_COMPLETION_INLINE_MATH:
3200 str = _("Select to display the inline completion in math mode.");
3203 case RC_COMPLETION_INLINE_TEXT:
3204 str = _("Select to display the inline completion in text mode.");
3207 case RC_COMPLETION_INLINE_DOTS:
3208 str = _("Use \"...\" to shorten long completions.");
3211 case RC_AUTOCORRECTION_MATH:
3212 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3215 case RC_NUMLASTFILES:
3216 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3220 case RC_PATH_PREFIX:
3221 str = _("Specify those directories which should be "
3222 "prepended to the PATH environment variable.\n"
3223 "Use the OS native format.");
3227 str = _("Shows a typeset preview of things such as math");
3230 case RC_PREVIEW_HASHED_LABELS:
3231 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3234 case RC_PREVIEW_SCALE_FACTOR:
3235 str = _("Scale the preview size to suit.");
3238 case RC_PRINTLANDSCAPEFLAG:
3239 str = _("The option to print out in landscape.");
3242 case RC_PRINTPAPERDIMENSIONFLAG:
3243 str = _("Option to specify the dimensions of the print paper.");
3246 case RC_PRINTPAPERFLAG:
3247 str = _("The option to specify paper type.");
3250 case RC_VISUAL_CURSOR:
3251 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3254 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3255 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).");
3259 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3262 case RC_SCREEN_FONT_ROMAN:
3263 case RC_SCREEN_FONT_SANS:
3264 case RC_SCREEN_FONT_TYPEWRITER:
3265 str = _("The screen fonts used to display the text while editing.");
3268 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3269 case RC_SCREEN_FONT_SANS_FOUNDRY:
3270 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3273 case RC_SCREEN_FONT_SCALABLE:
3274 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.");
3277 case RC_SCREEN_FONT_SIZES:
3278 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3281 case RC_SCREEN_ZOOM:
3282 //xgettext:no-c-format
3283 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3286 case RC_GEOMETRY_SESSION:
3287 str = _("Allow session manager to save and restore windows geometry.");
3291 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3297 case RC_SHOW_BANNER:
3298 str = _("De-select if you don't want the startup banner.");
3301 case RC_TEMPDIRPATH:
3302 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3305 case RC_THESAURUSDIRPATH:
3306 str = _("This is the place where the files of the thesaurus library reside.");
3309 case RC_TEMPLATEPATH:
3310 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3313 case RC_TEX_ALLOWS_SPACES:
3316 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3319 case RC_TEXINPUTS_PREFIX:
3320 str = _("Specify those directories which should be "
3321 "prepended to the TEXINPUTS environment variable.\n"
3322 "A '.' represents the current document directory. "
3323 "Use the OS native format.");
3327 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3336 case RC_USE_USE_SYSTEM_COLORS:
3337 str = _("Enable use the system colors for some things like main window background and selection.");
3340 case RC_USE_TOOLTIP:
3341 str = _("Enable the automatic appearance of tool tips in the work area.");
3344 case RC_VIEWDVI_PAPEROPTION:
3345 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3360 // The global instance
3363 // The global copy of the system lyxrc entries (everything except preferences)