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"
31 #include "SpellChecker.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/FileName.h"
38 #include "support/filetools.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/Package.h"
42 #include "support/TempFile.h"
44 #ifdef USE_MACOSX_PACKAGING
45 #include "support/AppleSupport.h"
53 using namespace lyx::support;
57 namespace os = support::os;
61 // The format should also be updated in configure.py, and conversion code
62 // should be added to prefs2prefs_prefs.py.
63 static unsigned int const LYXRC_FILEFORMAT = 36; // rkh: spellcheck_continuously default
64 // when adding something to this array keep it sorted!
65 LexerKeyword lyxrcTags[] = {
66 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
67 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
68 { "\\alternate_language", LyXRC::RC_ALT_LANG },
69 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
70 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
71 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
72 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
73 { "\\autosave", LyXRC::RC_AUTOSAVE },
74 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
75 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
76 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77 { "\\bind_file", LyXRC::RC_BINDFILE },
78 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80 { "\\citation_search", LyXRC::RC_CITATION_SEARCH },
81 { "\\citation_search_pattern", LyXRC::RC_CITATION_SEARCH_PATTERN },
82 { "\\citation_search_view", LyXRC::RC_CITATION_SEARCH_VIEW },
83 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
84 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
85 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
86 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
87 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
88 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
89 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
90 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
91 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
92 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
93 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
94 { "\\converter", LyXRC::RC_CONVERTER },
95 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
96 { "\\copier", LyXRC::RC_COPIER },
97 { "\\ct_additions_underlined", LyXRC::RC_CT_ADDITIONS_UNDERLINED },
98 { "\\ct_markup_copied", LyXRC::RC_CT_MARKUP_COPIED },
99 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
100 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
101 { "\\def_file", LyXRC::RC_DEFFILE },
102 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
103 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
104 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
105 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
106 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
107 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
108 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
109 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
110 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
111 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
112 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
113 { "\\experimental:bookmarks_visibility", LyXRC::RC_BOOKMARKS_VISIBILITY },
114 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
115 { "\\format", LyXRC::RC_FILEFORMAT },
116 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
117 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
118 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
119 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
120 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
121 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
122 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
123 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
124 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
125 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
126 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
127 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
128 { "\\icon_set", LyXRC::RC_ICON_SET },
129 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
130 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
131 { "\\input", LyXRC::RC_INPUT },
132 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
133 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
134 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
135 { "\\kbmap", LyXRC::RC_KBMAP },
136 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
137 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
138 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
139 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
140 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
141 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
142 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
143 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
144 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
145 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
146 { "\\load_session", LyXRC::RC_LOADSESSION },
147 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
148 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
149 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
150 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
151 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
152 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
153 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
154 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
155 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
156 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
157 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
158 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
159 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
160 { "\\preview", LyXRC::RC_PREVIEW },
161 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
162 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
163 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
164 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
165 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
166 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
167 { "\\respect_os_kbd_language", LyXRC::RC_RESPECT_OS_KBD_LANGUAGE },
168 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
169 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
170 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
171 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
172 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
173 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
174 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
175 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
176 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
177 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
178 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
179 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
180 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
181 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
182 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
183 { "\\set_color", LyXRC::RC_SET_COLOR },
184 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
185 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
186 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
187 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
188 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
189 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
190 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
191 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
192 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
193 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
194 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
195 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
196 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
197 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
198 { "\\ui_file", LyXRC::RC_UIFILE },
199 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
200 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
201 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
202 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
203 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
204 // compatibility with versions older than 1.4.0 only
205 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
206 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
207 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
208 { "\\user_email", LyXRC::RC_USER_EMAIL },
209 { "\\user_initials", LyXRC::RC_USER_INITIALS },
210 { "\\user_name", LyXRC::RC_USER_NAME },
211 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
212 // compatibility with versions older than 1.4.0 only
213 { "\\viewer", LyXRC::RC_VIEWER},
214 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
215 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
216 { "format", LyXRC::RC_LYXRCFORMAT }
219 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
222 void oldFontFormat(string & family, string & foundry)
224 if (family.empty() || family[0] != '-')
226 foundry = token(family, '-', 1);
227 family = token(family, '-', 2);
235 bool LyXRC::read(FileName const & filename, bool check_format)
237 Lexer lexrc(lyxrcTags);
238 lexrc.setFile(filename);
239 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
240 ReturnValues retval = read(lexrc, check_format);
241 if (!check_format || retval != FormatMismatch)
242 return retval == ReadOK;
244 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
245 TempFile tmp("convert_lyxrc");
246 FileName const tempfile = tmp.name();
247 bool const success = prefs2prefs(filename, tempfile, false);
249 LYXERR0 ("Unable to convert " << filename.absFileName() <<
250 " to format " << LYXRC_FILEFORMAT);
253 // Keep this in the else branch, such that lexrc2 goes out
254 // of scope and releases the lock on tempfile before we
255 // attempt to remove it. This matters on Windows.
256 Lexer lexrc2(lyxrcTags);
257 lexrc2.setFile(tempfile);
258 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
259 retval = read(lexrc2, check_format);
260 if (retval == FormatMismatch)
261 LYXERR0("Conversion failed for " << filename.absFileName());
263 return retval == ReadOK;
267 // don't need to worry about conversion, because this is always
268 // from an internal source
269 bool LyXRC::read(istream & is)
271 Lexer lexrc(lyxrcTags);
273 LYXERR(Debug::LYXRC, "Reading istream...");
274 return read(lexrc, false) == ReadOK;
278 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
280 if (lyxerr.debugging(Debug::PARSER))
281 lexrc.printTable(lyxerr);
286 // format prior to 2.0 and introduction of format tag
287 unsigned int rc_format = 0;
289 #ifdef USE_MACOSX_PACKAGING
290 open_buffers_in_tabs = appleUserTabbingPreferenceAlways();
293 while (lexrc.isOK()) {
294 // By using two switches we take advantage of the compiler
295 // telling us if we have missed a LyXRCTags element in
296 // the second switch.
297 // Note that this also shows a problem with Lexer since it
298 // helps us avoid taking advantage of the strictness of the
301 int le = lexrc.lex();
303 case Lexer::LEX_UNDEF:
304 lexrc.printError("Unknown tag `$$Token'");
306 case Lexer::LEX_FEOF:
311 switch (static_cast<LyXRCTags>(le)) {
314 rc_format = lexrc.getInteger();
316 case RC_INPUT: // Include file
319 libFileSearch(string(),
321 if (!read(tmp, check_format)) {
323 "Error reading included file: " + tmp.absFileName());
329 bind_file = os::internal_path(lexrc.getString());
334 def_file = os::internal_path(lexrc.getString());
339 ui_file = os::internal_path(lexrc.getString());
342 case RC_AUTORESET_OPTIONS:
343 lexrc >> auto_reset_options;
346 case RC_DISPLAY_GRAPHICS:
348 display_graphics = lexrc.getString() == "true";
351 case RC_TEX_EXPECTS_WINDOWS_PATHS:
352 lexrc >> windows_style_tex_paths;
355 case RC_TEX_ALLOWS_SPACES:
356 lexrc >> tex_allows_spaces;
359 case RC_TEXINPUTS_PREFIX:
360 lexrc >> texinputs_prefix;
367 case RC_KBMAP_PRIMARY:
369 string const kmap(os::internal_path(lexrc.getString()));
370 if (!libFileSearch("kbd", kmap, "kmap").empty()
372 primary_kbmap = kmap;
374 lexrc.printError("LyX: Keymap `$$Token' not found");
379 case RC_KBMAP_SECONDARY:
381 string const kmap(os::internal_path(lexrc.getString()));
382 if (!libFileSearch("kbd", kmap, "kmap").empty()
384 secondary_kbmap = kmap;
386 lexrc.printError("LyX: Keymap `$$Token' not found");
391 case RC_PRINTLANDSCAPEFLAG:
392 lexrc >> print_landscape_flag;
395 case RC_PRINTPAPERDIMENSIONFLAG:
396 lexrc >> print_paper_dimension_flag;
399 case RC_PRINTPAPERFLAG:
400 lexrc >> print_paper_flag;
403 case RC_PYGMENTIZE_COMMAND:
404 if (lexrc.next(true)) {
405 pygmentize_command = lexrc.getString();
409 case RC_VIEWDVI_PAPEROPTION:
411 view_dvi_paper_option = lexrc.getString();
413 view_dvi_paper_option.erase();
416 case RC_CHKTEX_COMMAND:
417 if (lexrc.next(true)) {
418 chktex_command = lexrc.getString();
422 case RC_BIBTEX_ALTERNATIVES:
423 if (lexrc.next(true)) {
424 bibtex_alternatives.insert(lexrc.getString());
428 case RC_BIBTEX_COMMAND:
429 if (lexrc.next(true)) {
430 bibtex_command = lexrc.getString();
434 case RC_JBIBTEX_COMMAND:
435 if (lexrc.next(true)) {
436 jbibtex_command = lexrc.getString();
440 case RC_JBIBTEX_ALTERNATIVES:
441 if (lexrc.next(true)) {
442 jbibtex_alternatives.insert(lexrc.getString());
446 case RC_INDEX_ALTERNATIVES:
447 if (lexrc.next(true)) {
448 index_alternatives.insert(lexrc.getString());
452 case RC_INDEX_COMMAND:
453 if (lexrc.next(true)) {
454 index_command = lexrc.getString();
458 case RC_JINDEX_COMMAND:
459 if (lexrc.next(true)) {
460 jindex_command = lexrc.getString();
464 case RC_SPLITINDEX_COMMAND:
465 if (lexrc.next(true)) {
466 splitindex_command = lexrc.getString();
470 case RC_NOMENCL_COMMAND:
471 if (lexrc.next(true)) {
472 nomencl_command = lexrc.getString();
481 lexrc >> defaultZoom;
482 if (defaultZoom < 10)
486 case RC_GEOMETRY_SESSION:
487 lexrc >> allow_geometry_session;
490 case RC_SCREEN_FONT_SIZES:
491 lexrc >> font_sizes[TINY_SIZE];
492 lexrc >> font_sizes[SCRIPT_SIZE];
493 lexrc >> font_sizes[FOOTNOTE_SIZE];
494 lexrc >> font_sizes[SMALL_SIZE];
495 lexrc >> font_sizes[NORMAL_SIZE];
496 lexrc >> font_sizes[LARGE_SIZE];
497 lexrc >> font_sizes[LARGER_SIZE];
498 lexrc >> font_sizes[LARGEST_SIZE];
499 lexrc >> font_sizes[HUGE_SIZE];
500 lexrc >> font_sizes[HUGER_SIZE];
503 case RC_SCREEN_FONT_SCALABLE:
504 lexrc >> use_scalable_fonts;
511 case RC_DOCUMENTPATH:
513 document_path = os::internal_path(lexrc.getString());
518 example_path = os::internal_path(lexrc.getString());
521 case RC_TEMPLATEPATH:
523 template_path = os::internal_path(lexrc.getString());
528 tempdir_path = os::internal_path(lexrc.getString());
531 case RC_THESAURUSDIRPATH:
533 thesaurusdir_path = os::internal_path(lexrc.getString());
536 case RC_HUNSPELLDIR_PATH:
538 hunspelldir_path = os::internal_path(lexrc.getString());
541 case RC_USELASTFILEPOS:
542 lexrc >> use_lastfilepos;
546 lexrc >> load_session;
549 case RC_MOUSE_WHEEL_SPEED:
550 lexrc >> mouse_wheel_speed;
553 case RC_COMPLETION_INLINE_DELAY:
554 lexrc >> completion_inline_delay;
557 case RC_COMPLETION_INLINE_MATH:
558 lexrc >> completion_inline_math;
561 case RC_COMPLETION_INLINE_TEXT:
562 lexrc >> completion_inline_text;
565 case RC_COMPLETION_INLINE_DOTS:
566 lexrc >> completion_inline_dots;
569 case RC_AUTOCORRECTION_MATH:
570 lexrc >> autocorrection_math;
573 case RC_COMPLETION_POPUP_DELAY:
574 lexrc >> completion_popup_delay;
577 case RC_COMPLETION_POPUP_MATH:
578 lexrc >> completion_popup_math;
581 case RC_COMPLETION_POPUP_TEXT:
582 lexrc >> completion_popup_text;
585 case RC_COMPLETION_CURSOR_TEXT:
586 lexrc >> completion_cursor_text;
589 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
590 lexrc >> completion_popup_after_complete;
593 case RC_COMPLETION_MINLENGTH:
594 lexrc >> completion_minlength;
597 case RC_NUMLASTFILES:
598 lexrc >> num_lastfiles;
601 case RC_CHECKLASTFILES:
602 lexrc >> check_lastfiles;
609 case RC_USE_SYSTEM_THEME_ICONS:
610 lexrc >> use_system_theme_icons;
613 case RC_SCREEN_FONT_ROMAN:
615 roman_font_name = lexrc.getString();
616 oldFontFormat(roman_font_name,
621 case RC_SCREEN_FONT_SANS:
623 sans_font_name = lexrc.getString();
624 oldFontFormat(sans_font_name, sans_font_foundry);
628 case RC_SCREEN_FONT_TYPEWRITER:
630 typewriter_font_name = lexrc.getString();
631 oldFontFormat(typewriter_font_name,
632 typewriter_font_foundry);
636 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
637 lexrc >> roman_font_foundry;
640 case RC_SCREEN_FONT_SANS_FOUNDRY:
641 lexrc >> sans_font_foundry;
644 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
645 lexrc >> typewriter_font_foundry;
650 lexrc.printError("Missing color tag.");
653 string const lyx_name = lexrc.getString();
656 lexrc.printError("Missing color name for color: `$$Token'");
659 string const x11_name = lexrc.getString();
661 string x11_darkname = x11_name;
663 x11_darkname = lexrc.getString();
665 ColorCode const col =
666 lcolor.getFromLyXName(lyx_name);
667 if (col == Color_none ||
668 col == Color_inherit ||
672 if (!lcolor.setColor(col, x11_name, x11_darkname))
673 LYXERR0("Bad lyxrc set_color for " << lyx_name);
674 LYXERR(Debug::LYXRC, "Set " << lyx_name << "(" << col << ") to "
675 << x11_name << " and " << x11_darkname);
679 case RC_AUTOREGIONDELETE:
680 // Auto region delete defaults to true
681 lexrc >> auto_region_delete;
686 string userdir = package().user_support().absFileName();
687 if (userdir.back() == '/')
689 lyxpipes = subst(os::internal_path(lexrc.getString()), "$$UserDir",
694 case RC_CITATION_SEARCH:
695 lexrc >> citation_search;
698 case RC_CITATION_SEARCH_PATTERN:
700 citation_search_pattern = lexrc.getString();
703 case RC_CITATION_SEARCH_VIEW:
705 citation_search_view = lexrc.getString();
708 case RC_CT_ADDITIONS_UNDERLINED:
709 lexrc >> ct_additions_underlined;
712 case RC_CT_MARKUP_COPIED:
713 lexrc >> ct_markup_copied;
716 case RC_CURSOR_FOLLOWS_SCROLLBAR:
717 lexrc >> cursor_follows_scrollbar;
720 case RC_CURSOR_WIDTH:
721 lexrc >> cursor_width;
724 case RC_SCROLL_BELOW_DOCUMENT:
725 lexrc >> scroll_below_document;
728 case RC_PARAGRAPH_MARKERS:
729 lexrc >> paragraph_markers;
732 case RC_MAC_DONTSWAP_CTRL_META:
733 lexrc >> mac_dontswap_ctrl_meta;
736 case RC_MAC_LIKE_CURSOR_MOVEMENT:
737 lexrc >> mac_like_cursor_movement;
740 case RC_MACRO_EDIT_STYLE:
742 switch (lexrc.getInteger()) {
743 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
744 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
745 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
750 case RC_DIALOGS_ICONIFY_WITH_MAIN:
751 lexrc >> dialogs_iconify_with_main;
754 case RC_PLAINTEXT_LINELEN:
755 lexrc >> plaintext_linelen;
757 // Spellchecker settings:
758 case RC_ACCEPT_COMPOUND:
759 lexrc >> spellchecker_accept_compound;
761 case RC_USE_NATIVE_FILEDIALOG:
762 lexrc >> use_native_filedialog;
764 case RC_USE_SYSTEM_COLORS:
765 lexrc >> use_system_colors;
768 lexrc >> use_tooltip;
770 case RC_SPELLCHECKER:
771 lexrc >> spellchecker;
774 lexrc >> spellchecker_alt_lang;
777 lexrc >> spellchecker_esc_chars;
779 case RC_SPELLCHECK_CONTINUOUSLY:
780 lexrc >> spellcheck_continuously;
782 case RC_SPELLCHECK_NOTES:
783 lexrc >> spellcheck_notes;
786 lexrc >> make_backup;
788 case RC_SAVE_COMPRESSED:
789 lexrc >> save_compressed;
792 lexrc >> save_origin;
794 case RC_BACKUPDIR_PATH:
796 backupdir_path = os::internal_path(lexrc.getString());
798 case RC_DEFAULT_DECIMAL_SEP:
799 lexrc >> default_decimal_sep;
801 case RC_DEFAULT_LENGTH_UNIT:
803 default_length_unit = (Length::UNIT) lexrc.getInteger();
805 case RC_LANGUAGE_CUSTOM_PACKAGE:
806 lexrc >> language_custom_package;
808 case RC_LANGUAGE_AUTO_BEGIN:
809 lexrc >> language_auto_begin;
811 case RC_LANGUAGE_AUTO_END:
812 lexrc >> language_auto_end;
814 case RC_LANGUAGE_GLOBAL_OPTIONS:
815 lexrc >> language_global_options;
817 case RC_LANGUAGE_PACKAGE_SELECTION:
819 switch (lexrc.getInteger()) {
821 language_package_selection = LP_AUTO;
824 language_package_selection = LP_BABEL;
827 language_package_selection = LP_CUSTOM;
830 language_package_selection = LP_NONE;
835 case RC_LANGUAGE_COMMAND_BEGIN:
836 lexrc >> language_command_begin;
838 case RC_LANGUAGE_COMMAND_END:
839 lexrc >> language_command_end;
841 case RC_LANGUAGE_COMMAND_LOCAL:
842 lexrc >> language_command_local;
844 case RC_RESPECT_OS_KBD_LANGUAGE:
845 lexrc >> respect_os_kbd_language;
847 case RC_VISUAL_CURSOR:
848 lexrc >> visual_cursor;
850 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
851 lexrc >> close_buffer_with_last_view;
854 lexrc >> auto_number;
856 case RC_MARK_FOREIGN_LANGUAGE:
857 lexrc >> mark_foreign_language;
863 fmt = lexrc.getString();
864 if (lexrc.next(true))
865 command = lexrc.getString();
866 setMover(fmt, command);
871 string from, to, command, flags;
873 from = lexrc.getString();
875 to = lexrc.getString();
876 if (lexrc.next(true))
877 command = lexrc.getString();
879 flags = lexrc.getString();
881 theConverters().erase(from, to);
883 theConverters().add(from, to, command, flags);
886 // compatibility with versions older than 1.4.0 only
888 string format, command;
889 lexrc >> format >> command;
890 theFormats().setViewer(format, command);
893 case RC_FILEFORMAT: {
895 string format, extensions, shortcut;
896 docstring prettyname;
897 if (!(lexrc >> format >> extensions))
899 if (ok && lexrc.next(true))
900 prettyname = lexrc.getDocString();
904 if(!(lexrc >> shortcut))
906 string viewer, editor;
907 if (ok && lexrc.next(true))
908 viewer = lexrc.getString();
911 if (ok && lexrc.next(true))
912 editor = lexrc.getString();
916 if (!(lexrc >> flags >> mime))
918 int flgs = Format::none;
919 while (!flags.empty()) {
921 flags = split(flags, flag, ',');
922 if (flag == "document")
923 flgs |= Format::document;
924 else if (flag == "vector")
925 flgs |= Format::vector;
926 else if (flag == "zipped=native")
927 flgs |= Format::zipped_native;
928 else if (flag == "menu=export")
929 flgs |= Format::export_menu;
930 else if (flag == "menu=none")
931 flgs |= Format::no_menu;
933 LYXERR0("Ignoring unknown flag `"
934 << flag << "' for format `"
938 LYXERR0("Syntax error in format " << format);
939 else if (prettyname.empty()) {
940 if (theConverters().formatIsUsed(format))
941 LYXERR0("Can't delete format " << format);
943 theFormats().erase(format);
945 theFormats().add(format, extensions, prettyname,
946 shortcut, viewer, editor, mime, flgs);
950 case RC_VIEWER_ALTERNATIVES: {
951 string format, command;
952 if ((lexrc >> format) && lexrc.next(true)) {
953 command = lexrc.getString();
954 viewer_alternatives[format].insert(command);
958 case RC_EDITOR_ALTERNATIVES: {
959 string format, command;
960 if ((lexrc >> format) && lexrc.next(true)) {
961 command = lexrc.getString();
962 editor_alternatives[format].insert(command);
967 case RC_DEFAULT_OTF_VIEW_FORMAT:
968 lexrc >> default_otf_view_format;
971 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
972 lexrc >> default_platex_view_format;
975 case RC_DEFAULT_VIEW_FORMAT:
976 lexrc >> default_view_format;
979 case RC_GUI_LANGUAGE:
980 lexrc >> gui_language;
984 lexrc >> show_banner;
989 string const tmp = lexrc.getString();
990 if (tmp == "true" || tmp == "on")
991 preview = PREVIEW_ON;
992 else if (tmp == "no_math")
993 preview = PREVIEW_NO_MATH;
995 preview = PREVIEW_OFF;
996 if (tmp != "false" && tmp != "off")
997 LYXERR0("Unrecognized preview status \""
1003 case RC_PREVIEW_HASHED_LABELS:
1004 lexrc >> preview_hashed_labels;
1007 case RC_PREVIEW_SCALE_FACTOR:
1008 lexrc >> preview_scale_factor;
1015 lexrc >> user_email;
1017 case RC_USER_INITIALS:
1018 lexrc >> user_initials;
1021 case RC_PATH_PREFIX:
1022 lexrc >> path_prefix;
1025 case RC_USE_CONVERTER_CACHE:
1026 lexrc >> use_converter_cache;
1028 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1029 lexrc >> use_converter_needauth_forbidden;
1031 case RC_USE_CONVERTER_NEEDAUTH:
1032 lexrc >> use_converter_needauth;
1034 case RC_CONVERTER_CACHE_MAXAGE:
1035 lexrc >> converter_cache_maxage;
1038 case RC_SORT_LAYOUTS:
1039 lexrc >> sort_layouts;
1041 case RC_GROUP_LAYOUTS:
1042 lexrc >> group_layouts;
1044 case RC_FULL_SCREEN_LIMIT:
1045 lexrc >> full_screen_limit;
1047 case RC_FULL_SCREEN_TOOLBARS:
1048 lexrc >> full_screen_toolbars;
1050 case RC_FULL_SCREEN_SCROLLBAR:
1051 lexrc >> full_screen_scrollbar;
1053 case RC_FULL_SCREEN_STATUSBAR:
1054 lexrc >> full_screen_statusbar;
1056 case RC_FULL_SCREEN_TABBAR:
1057 lexrc >> full_screen_tabbar;
1059 case RC_FULL_SCREEN_MENUBAR:
1060 lexrc >> full_screen_menubar;
1062 case RC_FULL_SCREEN_WIDTH:
1063 lexrc >> full_screen_width;
1065 case RC_OPEN_BUFFERS_IN_TABS:
1066 lexrc >> open_buffers_in_tabs;
1068 case RC_SINGLE_CLOSE_TAB_BUTTON:
1069 lexrc >> single_close_tab_button;
1071 case RC_SINGLE_INSTANCE:
1072 lexrc >> single_instance;
1073 if (run_mode == PREFERRED)
1074 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1076 case RC_FORWARD_SEARCH_DVI:
1077 if (lexrc.next(true))
1078 forward_search_dvi = lexrc.getString();
1080 case RC_FORWARD_SEARCH_PDF:
1081 if (lexrc.next(true))
1082 forward_search_pdf = lexrc.getString();
1084 case RC_EXPORT_OVERWRITE:
1086 string const tmp = lexrc.getString();
1087 if (tmp == "all" || tmp == "true")
1088 export_overwrite = ALL_FILES;
1089 else if (tmp == "main")
1090 export_overwrite = MAIN_FILE;
1092 export_overwrite = NO_FILES;
1093 if (tmp != "ask" && tmp != "false")
1094 LYXERR0("Unrecognized export_overwrite status \""
1099 case RC_SCROLL_WHEEL_ZOOM:
1101 string const tmp = lexrc.getString();
1103 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1104 else if (tmp == "shift")
1105 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1106 else if (tmp == "alt")
1107 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1109 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1110 if (tmp != "off" && tmp != "false")
1111 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1117 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1118 lexrc >> mouse_middlebutton_paste;
1121 case RC_BOOKMARKS_VISIBILITY:
1123 string const tmp = lexrc.getString();
1125 bookmarks_visibility = BMK_NONE;
1126 else if (tmp == "margin")
1127 bookmarks_visibility = BMK_MARGIN;
1128 else if (tmp == "inline")
1129 bookmarks_visibility = BMK_INLINE;
1131 bookmarks_visibility = BMK_NONE;
1132 LYXERR0("Unrecognized bookmark visibility " << tmp <<'"');
1139 break; // this is just a dummy
1142 // This is triggered the first time through the loop unless
1143 // we hit a format tag.
1144 if (check_format && rc_format != LYXRC_FILEFORMAT)
1145 return FormatMismatch;
1148 /// Update converters data-structures
1149 theConverters().update(theFormats());
1150 theConverters().buildGraph();
1151 theBufferList().invalidateConverterCache();
1157 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1159 ofstream ofs(filename.toFilesystemEncoding().c_str());
1161 write(ofs, ignore_system_lyxrc);
1165 void LyXRC::print() const
1167 if (lyxerr.debugging())
1168 write(lyxerr, false);
1176 typedef pair<string, SpecialisedMover> Data;
1178 SameMover(Data const & comparison)
1179 : comparison_(comparison) {}
1181 bool operator()(Data const & data) const
1183 return data.first == comparison_.first &&
1184 data.second.command() == comparison_.second.command();
1194 // Escape \ and " so that LyXLex can read the string later
1195 string escapeCommand(string const & str) {
1196 return subst(subst(str , "\\", "\\\\"),
1203 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1205 LyXRCTags tag = RC_LAST;
1207 if (!name.empty()) {
1208 for (int i = 0; i != lyxrcCount; ++i)
1209 if ("\\" + name == lyxrcTags[i].tag)
1210 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1214 os << "# LyX " << lyx_version
1215 << " generated this file. If you want to make your own\n"
1216 << "# modifications you should do them from inside LyX and save.\n\n"
1217 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1219 // Why the switch you might ask. It is a trick to ensure that all
1220 // the elements in the LyXRCTags enum are handled. As you can see
1221 // there are no breaks at all. So it is just a huge fall-through.
1222 // The nice thing is that we will get a warning from the compiler
1223 // if we forget an element.
1227 // input/include files are not done here
1228 case RC_LYXRCFORMAT:
1230 if (ignore_system_lyxrc ||
1231 bind_file != system_lyxrc.bind_file) {
1232 string const path = os::external_path(bind_file);
1233 os << "\\bind_file \"" << path << "\"\n";
1239 if (ignore_system_lyxrc ||
1240 def_file != system_lyxrc.def_file) {
1241 string const path = os::external_path(def_file);
1242 os << "\\def_file \"" << path << "\"\n";
1251 << "# MISC SECTION ######################################\n"
1253 // bind files are not done here.
1255 case RC_PATH_PREFIX:
1256 if (ignore_system_lyxrc ||
1257 path_prefix != system_lyxrc.path_prefix) {
1258 os << "\\path_prefix \"" << path_prefix << "\"\n";
1264 if (ignore_system_lyxrc ||
1265 ui_file != system_lyxrc.ui_file) {
1266 string const path = os::external_path(ui_file);
1267 os << "\\ui_file \"" << path << "\"\n";
1272 case RC_AUTOREGIONDELETE:
1273 if (ignore_system_lyxrc ||
1274 auto_region_delete != system_lyxrc.auto_region_delete) {
1275 os << "# Set to false to inhibit automatic replacement of\n"
1276 << "# the current selection.\n"
1277 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1283 case RC_AUTORESET_OPTIONS:
1284 if (ignore_system_lyxrc ||
1285 auto_reset_options != system_lyxrc.auto_reset_options) {
1286 os << "# Set to false to inhibit automatic reset of\n"
1287 << "# the class options to defaults on class change.\n"
1288 << "\\auto_reset_options "
1289 << convert<string>(auto_reset_options)
1296 if (ignore_system_lyxrc ||
1297 autosave != system_lyxrc.autosave) {
1298 os << "# The time interval between auto-saves in seconds.\n"
1299 << "\\autosave " << autosave << '\n';
1304 case RC_DISPLAY_GRAPHICS:
1305 if (ignore_system_lyxrc ||
1306 display_graphics != system_lyxrc.display_graphics) {
1307 os << "# Display graphics within LyX\n"
1309 << "\\display_graphics "
1310 << (display_graphics ? "true" : "false")
1316 case RC_SORT_LAYOUTS:
1317 if (ignore_system_lyxrc ||
1318 sort_layouts != system_lyxrc.sort_layouts) {
1319 os << "# Sort layouts alphabetically.\n"
1320 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1325 case RC_GROUP_LAYOUTS:
1326 if (ignore_system_lyxrc ||
1327 group_layouts != system_lyxrc.group_layouts) {
1328 os << "# Group layouts by their category.\n"
1329 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1334 case RC_VIEWDVI_PAPEROPTION:
1335 if (ignore_system_lyxrc ||
1336 view_dvi_paper_option
1337 != system_lyxrc.view_dvi_paper_option) {
1338 os << "# Options used to specify paper size to the\n"
1339 << "# view_dvi_command (e.g. -paper)\n"
1340 << "\\view_dvi_paper_option \""
1341 << view_dvi_paper_option << "\"\n";
1346 case RC_CHKTEX_COMMAND:
1347 if (ignore_system_lyxrc ||
1348 chktex_command != system_lyxrc.chktex_command) {
1349 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1354 case RC_BIBTEX_ALTERNATIVES: {
1355 CommandSet::const_iterator it = bibtex_alternatives.begin();
1356 CommandSet::const_iterator end = bibtex_alternatives.end();
1357 for ( ; it != end; ++it) {
1358 if (ignore_system_lyxrc
1359 || !system_lyxrc.bibtex_alternatives.count(*it))
1360 os << "\\bibtex_alternatives \""
1367 case RC_BIBTEX_COMMAND:
1368 if (ignore_system_lyxrc ||
1369 bibtex_command != system_lyxrc.bibtex_command) {
1370 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1375 case RC_JBIBTEX_COMMAND:
1376 if (ignore_system_lyxrc ||
1377 jbibtex_command != system_lyxrc.jbibtex_command) {
1378 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1383 case RC_JBIBTEX_ALTERNATIVES: {
1384 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1385 CommandSet::const_iterator end = jbibtex_alternatives.end();
1386 for ( ; it != end; ++it) {
1387 if (ignore_system_lyxrc
1388 || !system_lyxrc.jbibtex_alternatives.count(*it))
1389 os << "\\jbibtex_alternatives \""
1396 case RC_INDEX_ALTERNATIVES: {
1397 CommandSet::const_iterator it = index_alternatives.begin();
1398 CommandSet::const_iterator end = index_alternatives.end();
1399 for ( ; it != end; ++it) {
1400 if (ignore_system_lyxrc
1401 || !system_lyxrc.index_alternatives.count(*it))
1402 os << "\\index_alternatives \""
1409 case RC_INDEX_COMMAND:
1410 if (ignore_system_lyxrc ||
1411 index_command != system_lyxrc.index_command) {
1412 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1417 case RC_JINDEX_COMMAND:
1418 if (ignore_system_lyxrc ||
1419 jindex_command != system_lyxrc.jindex_command) {
1420 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1425 case RC_SPLITINDEX_COMMAND:
1426 if (ignore_system_lyxrc ||
1427 splitindex_command != system_lyxrc.splitindex_command) {
1428 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1433 case RC_NOMENCL_COMMAND:
1434 if (ignore_system_lyxrc ||
1435 nomencl_command != system_lyxrc.nomencl_command) {
1436 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1441 case RC_PYGMENTIZE_COMMAND:
1442 if (ignore_system_lyxrc ||
1443 pygmentize_command != system_lyxrc.pygmentize_command) {
1444 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1449 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1450 // Don't write this setting to the preferences file,
1451 // but allow temporary changes (bug 7557).
1452 if (ignore_system_lyxrc) {
1453 os << "\\tex_expects_windows_paths "
1454 << convert<string>(windows_style_tex_paths) << '\n';
1459 case RC_TEX_ALLOWS_SPACES:
1460 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1461 os << "\\tex_allows_spaces "
1462 << convert<string>(tex_allows_spaces) << '\n';
1468 if (ignore_system_lyxrc ||
1469 use_kbmap != system_lyxrc.use_kbmap) {
1470 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1475 case RC_KBMAP_PRIMARY:
1476 if (ignore_system_lyxrc ||
1477 primary_kbmap != system_lyxrc.primary_kbmap) {
1478 string const path = os::external_path(primary_kbmap);
1479 os << "\\kbmap_primary \"" << path << "\"\n";
1484 case RC_KBMAP_SECONDARY:
1485 if (ignore_system_lyxrc ||
1486 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1487 string const path = os::external_path(secondary_kbmap);
1488 os << "\\kbmap_secondary \"" << path << "\"\n";
1494 if (ignore_system_lyxrc ||
1495 lyxpipes != system_lyxrc.lyxpipes) {
1496 string const path = os::external_path(lyxpipes);
1497 os << "\\serverpipe \"" << path << "\"\n";
1503 os << "\\user_name \"" << user_name << "\"\n";
1508 os << "\\user_email \"" << user_email << "\"\n";
1512 case RC_USER_INITIALS:
1513 os << "\\user_initials \"" << user_initials << "\"\n";
1517 case RC_SHOW_BANNER:
1518 if (ignore_system_lyxrc ||
1519 show_banner != system_lyxrc.show_banner) {
1520 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1526 if (ignore_system_lyxrc ||
1527 preview != system_lyxrc.preview) {
1533 case PREVIEW_NO_MATH:
1540 os << "\\preview " << status << '\n';
1545 case RC_PREVIEW_HASHED_LABELS:
1546 if (ignore_system_lyxrc ||
1547 preview_hashed_labels !=
1548 system_lyxrc.preview_hashed_labels) {
1549 os << "\\preview_hashed_labels "
1550 << convert<string>(preview_hashed_labels) << '\n';
1555 case RC_PREVIEW_SCALE_FACTOR:
1556 if (ignore_system_lyxrc ||
1557 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1558 os << "\\preview_scale_factor "
1559 << preview_scale_factor << '\n';
1564 case RC_USE_CONVERTER_CACHE:
1565 if (ignore_system_lyxrc ||
1566 use_converter_cache != system_lyxrc.use_converter_cache) {
1567 os << "\\use_converter_cache "
1568 << convert<string>(use_converter_cache) << '\n';
1573 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1574 if (ignore_system_lyxrc ||
1575 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1576 os << "\\use_converter_needauth_forbidden "
1577 << convert<string>(use_converter_needauth_forbidden) << '\n';
1582 case RC_USE_CONVERTER_NEEDAUTH:
1583 if (ignore_system_lyxrc ||
1584 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1585 os << "\\use_converter_needauth "
1586 << convert<string>(use_converter_needauth) << '\n';
1591 case RC_CONVERTER_CACHE_MAXAGE:
1592 if (ignore_system_lyxrc ||
1593 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1594 os << "\\converter_cache_maxage "
1595 << converter_cache_maxage << '\n';
1601 << "# SCREEN & FONTS SECTION ############################\n"
1605 if (ignore_system_lyxrc ||
1606 icon_set != system_lyxrc.icon_set) {
1607 os << "\\icon_set \"" << icon_set
1613 case RC_USE_SYSTEM_THEME_ICONS:
1614 if (ignore_system_lyxrc ||
1615 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1616 os << "\\use_system_theme_icons "
1617 << convert<string>(use_system_theme_icons)
1624 if (ignore_system_lyxrc ||
1625 dpi != system_lyxrc.dpi) {
1626 os << "\\screen_dpi " << dpi << '\n';
1631 case RC_SCREEN_ZOOM:
1632 if (ignore_system_lyxrc ||
1633 defaultZoom != system_lyxrc.defaultZoom) {
1634 os << "\\screen_zoom " << defaultZoom << '\n';
1639 case RC_GEOMETRY_SESSION:
1640 if (ignore_system_lyxrc ||
1641 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1642 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1648 case RC_CITATION_SEARCH:
1649 if (ignore_system_lyxrc ||
1650 citation_search != system_lyxrc.citation_search) {
1651 os << "# Set to true to use script to search\n"
1652 << "# locl disk for citation targets.\n"
1653 << "\\citation_search "
1654 << convert<string>(citation_search)
1660 case RC_CITATION_SEARCH_VIEW:
1661 if (ignore_system_lyxrc ||
1662 citation_search_view != system_lyxrc.citation_search_view) {
1663 os << "\\citation_search_view \""
1664 << citation_search_view << "\"\n";
1669 case RC_CITATION_SEARCH_PATTERN:
1670 if (ignore_system_lyxrc ||
1671 citation_search_pattern != system_lyxrc.citation_search_pattern) {
1672 os << "\\citation_search_pattern \""
1673 << citation_search_pattern << "\"\n";
1678 case RC_CT_ADDITIONS_UNDERLINED:
1679 if (ignore_system_lyxrc ||
1680 ct_additions_underlined
1681 != system_lyxrc.ct_additions_underlined) {
1682 os << "\\ct_additions_underlined "
1683 << convert<string>(ct_additions_underlined) << '\n';
1688 case RC_CT_MARKUP_COPIED:
1689 if (ignore_system_lyxrc ||
1691 != system_lyxrc.ct_markup_copied) {
1692 os << "\\ct_markup_copied "
1693 << convert<string>(ct_markup_copied) << '\n';
1698 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1699 if (ignore_system_lyxrc ||
1700 cursor_follows_scrollbar
1701 != system_lyxrc.cursor_follows_scrollbar) {
1702 os << "\\cursor_follows_scrollbar "
1703 << convert<string>(cursor_follows_scrollbar) << '\n';
1708 case RC_CURSOR_WIDTH:
1709 if (ignore_system_lyxrc ||
1711 != system_lyxrc.cursor_width) {
1712 os << "\\cursor_width "
1713 << cursor_width << '\n';
1718 case RC_SCROLL_BELOW_DOCUMENT:
1719 if (ignore_system_lyxrc ||
1720 scroll_below_document
1721 != system_lyxrc.scroll_below_document) {
1722 os << "\\scroll_below_document "
1723 << convert<string>(scroll_below_document) << '\n';
1728 case RC_PARAGRAPH_MARKERS:
1729 if (ignore_system_lyxrc ||
1731 != system_lyxrc.paragraph_markers) {
1732 os << "\\paragraph_markers "
1733 << convert<string>(paragraph_markers) << '\n';
1738 case RC_BOOKMARKS_VISIBILITY:
1739 if (ignore_system_lyxrc ||
1740 bookmarks_visibility != system_lyxrc.bookmarks_visibility) {
1742 switch (bookmarks_visibility) {
1753 os << "\\experimental:bookmarks_visibility " << status << '\n';
1758 case RC_MAC_DONTSWAP_CTRL_META:
1759 if (ignore_system_lyxrc ||
1760 mac_dontswap_ctrl_meta
1761 != system_lyxrc.mac_dontswap_ctrl_meta) {
1762 os << "\\mac_dontswap_ctrl_meta "
1763 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1768 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1769 if (ignore_system_lyxrc ||
1770 mac_like_cursor_movement
1771 != system_lyxrc.mac_like_cursor_movement) {
1772 os << "\\mac_like_cursor_movement "
1773 << convert<string>(mac_like_cursor_movement) << '\n';
1778 case RC_MACRO_EDIT_STYLE:
1779 if (ignore_system_lyxrc ||
1781 != system_lyxrc.macro_edit_style) {
1782 os << "\\macro_edit_style ";
1783 switch (macro_edit_style) {
1784 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1785 case MACRO_EDIT_INLINE: os << "1\n"; break;
1786 case MACRO_EDIT_LIST: os << "2\n"; break;
1792 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1793 if (ignore_system_lyxrc ||
1794 dialogs_iconify_with_main
1795 != system_lyxrc.dialogs_iconify_with_main) {
1796 os << "\\dialogs_iconify_with_main "
1797 << convert<string>(dialogs_iconify_with_main) << '\n';
1802 case RC_SCREEN_FONT_ROMAN:
1803 if (ignore_system_lyxrc ||
1804 roman_font_name != system_lyxrc.roman_font_name) {
1805 os << "\\screen_font_roman \"" << roman_font_name
1811 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1812 if (ignore_system_lyxrc ||
1813 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1814 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1820 case RC_SCREEN_FONT_SANS:
1821 if (ignore_system_lyxrc ||
1822 sans_font_name != system_lyxrc.sans_font_name) {
1823 os << "\\screen_font_sans \"" << sans_font_name
1829 case RC_SCREEN_FONT_SANS_FOUNDRY:
1830 if (ignore_system_lyxrc ||
1831 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1832 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1838 case RC_SCREEN_FONT_TYPEWRITER:
1839 if (ignore_system_lyxrc ||
1840 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1841 os << "\\screen_font_typewriter \""
1842 << typewriter_font_name << "\"\n";
1847 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1848 if (ignore_system_lyxrc ||
1849 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1850 os << "\\screen_font_typewriter_foundry \""
1851 << typewriter_font_foundry << "\"\n";
1856 case RC_SCREEN_FONT_SCALABLE:
1857 if (ignore_system_lyxrc ||
1858 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1859 os << "\\screen_font_scalable "
1860 << convert<string>(use_scalable_fonts)
1866 case RC_SCREEN_FONT_SIZES:
1867 if (ignore_system_lyxrc ||
1868 font_sizes[TINY_SIZE]
1869 != system_lyxrc.font_sizes[TINY_SIZE] ||
1870 font_sizes[SCRIPT_SIZE]
1871 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1872 font_sizes[FOOTNOTE_SIZE]
1873 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1874 font_sizes[SMALL_SIZE]
1875 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1876 font_sizes[NORMAL_SIZE]
1877 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1878 font_sizes[LARGE_SIZE]
1879 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1880 font_sizes[LARGER_SIZE]
1881 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1882 font_sizes[LARGEST_SIZE]
1883 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1884 font_sizes[HUGE_SIZE]
1885 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1886 font_sizes[HUGER_SIZE]
1887 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1888 streamsize old_prec = os.precision();
1889 os.setf(ios::fixed);
1891 os << "\\screen_font_sizes"
1892 << ' ' << font_sizes[TINY_SIZE]
1893 << ' ' << font_sizes[SCRIPT_SIZE]
1894 << ' ' << font_sizes[FOOTNOTE_SIZE]
1895 << ' ' << font_sizes[SMALL_SIZE]
1896 << ' ' << font_sizes[NORMAL_SIZE]
1897 << ' ' << font_sizes[LARGE_SIZE]
1898 << ' ' << font_sizes[LARGER_SIZE]
1899 << ' ' << font_sizes[LARGEST_SIZE]
1900 << ' ' << font_sizes[HUGE_SIZE]
1901 << ' ' << font_sizes[HUGER_SIZE]
1903 os.precision(old_prec);
1904 os.unsetf(ios::fixed);
1909 case RC_FULL_SCREEN_LIMIT:
1910 if (ignore_system_lyxrc ||
1911 full_screen_limit != system_lyxrc.full_screen_limit) {
1912 os << "\\fullscreen_limit "
1913 << convert<string>(full_screen_limit)
1919 case RC_FULL_SCREEN_TOOLBARS:
1920 if (ignore_system_lyxrc ||
1921 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1922 os << "\\fullscreen_toolbars "
1923 << convert<string>(full_screen_toolbars)
1929 case RC_FULL_SCREEN_SCROLLBAR:
1930 if (ignore_system_lyxrc ||
1931 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1932 os << "\\fullscreen_scrollbar "
1933 << convert<string>(full_screen_scrollbar)
1939 case RC_FULL_SCREEN_STATUSBAR:
1940 if (ignore_system_lyxrc ||
1941 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1942 os << "\\fullscreen_statusbar "
1943 << convert<string>(full_screen_statusbar)
1949 case RC_FULL_SCREEN_TABBAR:
1950 if (ignore_system_lyxrc ||
1951 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1952 os << "\\fullscreen_tabbar "
1953 << convert<string>(full_screen_tabbar)
1959 case RC_FULL_SCREEN_MENUBAR:
1960 if (ignore_system_lyxrc ||
1961 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1962 os << "\\fullscreen_menubar "
1963 << convert<string>(full_screen_menubar)
1969 case RC_FULL_SCREEN_WIDTH:
1970 if (ignore_system_lyxrc ||
1971 full_screen_width != system_lyxrc.full_screen_width) {
1972 os << "\\fullscreen_width "
1973 << convert<string>(full_screen_width)
1979 case RC_OPEN_BUFFERS_IN_TABS:
1980 if (ignore_system_lyxrc ||
1981 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1982 os << "\\open_buffers_in_tabs "
1983 << convert<string>(open_buffers_in_tabs)
1989 case RC_SINGLE_CLOSE_TAB_BUTTON:
1990 if (ignore_system_lyxrc ||
1991 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1992 os << "\\single_close_tab_button "
1993 << convert<string>(single_close_tab_button)
1999 case RC_SINGLE_INSTANCE:
2000 if (ignore_system_lyxrc ||
2001 single_instance != system_lyxrc.single_instance) {
2002 os << "\\single_instance "
2003 << convert<string>(single_instance)
2009 case RC_FORWARD_SEARCH_DVI:
2010 if (ignore_system_lyxrc ||
2011 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2012 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2017 case RC_FORWARD_SEARCH_PDF:
2018 if (ignore_system_lyxrc ||
2019 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2020 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2026 << "# COLOR SECTION ###################################\n"
2031 for (int i = 0; i < Color_ignore; ++i) {
2032 ColorCode lc = static_cast<ColorCode>(i);
2033 string const col = lcolor.getAllX11HexNames(lc).first;
2034 string const darkcol = lcolor.getAllX11HexNames(lc).second;
2035 if (ignore_system_lyxrc
2036 || col != system_lcolor.getAllX11HexNames(lc).first
2037 || darkcol != system_lcolor.getAllX11HexNames(lc).second) {
2038 os << "\\set_color \""
2039 << lcolor.getLyXName(lc) << "\" \""
2041 << darkcol << "\"\n";
2048 << "# PRINTER SECTION ###################################\n"
2052 case RC_PRINTLANDSCAPEFLAG:
2053 if (ignore_system_lyxrc ||
2054 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2055 os << "\\print_landscape_flag \"" << print_landscape_flag
2061 case RC_PRINTPAPERFLAG:
2062 if (ignore_system_lyxrc ||
2063 print_paper_flag != system_lyxrc.print_paper_flag) {
2064 os << "\\print_paper_flag \"" << print_paper_flag
2070 case RC_PRINTPAPERDIMENSIONFLAG:
2071 if (ignore_system_lyxrc ||
2072 print_paper_dimension_flag
2073 != system_lyxrc.print_paper_dimension_flag) {
2074 os << "\\print_paper_dimension_flag \""
2075 << print_paper_dimension_flag << "\"\n";
2081 << "# TEX SECTION #######################################\n"
2085 case RC_TEXINPUTS_PREFIX:
2086 if (ignore_system_lyxrc ||
2087 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2088 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2094 << "# FILE SECTION ######################################\n"
2097 case RC_DOCUMENTPATH:
2098 if (ignore_system_lyxrc ||
2099 document_path != system_lyxrc.document_path) {
2100 string const path = os::external_path(document_path);
2101 os << "\\document_path \"" << path << "\"\n";
2106 case RC_USELASTFILEPOS:
2107 if (ignore_system_lyxrc ||
2108 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2109 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2115 case RC_LOADSESSION:
2116 if (ignore_system_lyxrc ||
2117 load_session != system_lyxrc.load_session) {
2118 os << "\\load_session " << convert<string>(load_session)
2124 case RC_MOUSE_WHEEL_SPEED:
2125 if (ignore_system_lyxrc ||
2126 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2127 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2132 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2133 if (ignore_system_lyxrc ||
2134 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2135 os << "\\mouse_middlebutton_paste "
2136 << convert<string>(mouse_middlebutton_paste) << '\n';
2141 case RC_COMPLETION_INLINE_DELAY:
2142 if (ignore_system_lyxrc ||
2143 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2144 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2149 case RC_COMPLETION_INLINE_MATH:
2150 if (ignore_system_lyxrc ||
2151 completion_inline_math != system_lyxrc.completion_inline_math) {
2152 os << "\\completion_inline_math "
2153 << convert<string>(completion_inline_math) << '\n';
2158 case RC_COMPLETION_INLINE_TEXT:
2159 if (ignore_system_lyxrc ||
2160 completion_inline_text != system_lyxrc.completion_inline_text) {
2161 os << "\\completion_inline_text "
2162 << convert<string>(completion_inline_text) << '\n';
2167 case RC_COMPLETION_INLINE_DOTS:
2168 if (ignore_system_lyxrc ||
2169 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2170 os << "\\completion_inline_dots "
2171 << convert<string>(completion_inline_dots) << '\n';
2176 case RC_AUTOCORRECTION_MATH:
2177 if (ignore_system_lyxrc ||
2178 autocorrection_math != system_lyxrc.autocorrection_math) {
2179 os << "\\autocorrection_math "
2180 << convert<string>(autocorrection_math) << '\n';
2185 case RC_COMPLETION_POPUP_DELAY:
2186 if (ignore_system_lyxrc ||
2187 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2188 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2193 case RC_COMPLETION_POPUP_MATH:
2194 if (ignore_system_lyxrc ||
2195 completion_popup_math != system_lyxrc.completion_popup_math) {
2196 os << "\\completion_popup_math "
2197 << convert<string>(completion_popup_math) << '\n';
2202 case RC_COMPLETION_POPUP_TEXT:
2203 if (ignore_system_lyxrc ||
2204 completion_popup_text != system_lyxrc.completion_popup_text) {
2205 os << "\\completion_popup_text "
2206 << convert<string>(completion_popup_text) << '\n';
2211 case RC_COMPLETION_CURSOR_TEXT:
2212 if (ignore_system_lyxrc ||
2213 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2214 os << "\\completion_cursor_text "
2215 << convert<string>(completion_cursor_text) << '\n';
2220 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2221 if (ignore_system_lyxrc ||
2222 completion_popup_after_complete
2223 != system_lyxrc.completion_popup_after_complete) {
2224 os << "\\completion_popup_after_complete "
2225 << convert<string>(completion_popup_after_complete) << '\n';
2230 case RC_COMPLETION_MINLENGTH:
2231 if (ignore_system_lyxrc ||
2232 completion_minlength != system_lyxrc.completion_minlength) {
2233 os << "\\completion_minlength " << convert<string>(completion_minlength)
2239 case RC_NUMLASTFILES:
2240 if (ignore_system_lyxrc ||
2241 num_lastfiles != system_lyxrc.num_lastfiles) {
2242 os << "\\num_lastfiles " << num_lastfiles << '\n';
2247 case RC_CHECKLASTFILES:
2248 if (ignore_system_lyxrc ||
2249 check_lastfiles != system_lyxrc.check_lastfiles) {
2250 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2256 case RC_EXAMPLEPATH:
2257 if (ignore_system_lyxrc ||
2258 example_path != system_lyxrc.example_path) {
2259 string const path = os::external_path(example_path);
2260 os << "\\example_path \"" << path << "\"\n";
2265 case RC_TEMPLATEPATH:
2266 if (ignore_system_lyxrc ||
2267 template_path != system_lyxrc.template_path) {
2268 string const path = os::external_path(template_path);
2269 os << "\\template_path \"" << path << "\"\n";
2274 case RC_TEMPDIRPATH:
2275 if (ignore_system_lyxrc ||
2276 tempdir_path != system_lyxrc.tempdir_path) {
2277 string const path = os::external_path(tempdir_path);
2278 os << "\\tempdir_path \"" << path << "\"\n";
2283 case RC_THESAURUSDIRPATH:
2284 if (ignore_system_lyxrc ||
2285 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2286 string const path = os::external_path(thesaurusdir_path);
2287 os << "\\thesaurusdir_path \"" << path << "\"\n";
2292 case RC_HUNSPELLDIR_PATH:
2293 if (ignore_system_lyxrc ||
2294 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2295 string const path = os::external_path(hunspelldir_path);
2296 os << "\\hunspelldir_path \"" << path << "\"\n";
2301 case RC_PLAINTEXT_LINELEN:
2302 if (ignore_system_lyxrc ||
2303 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2304 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2309 case RC_MAKE_BACKUP:
2310 if (ignore_system_lyxrc ||
2311 make_backup != system_lyxrc.make_backup) {
2312 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2317 case RC_SAVE_COMPRESSED:
2318 if (ignore_system_lyxrc ||
2319 save_compressed != system_lyxrc.save_compressed) {
2320 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2325 case RC_SAVE_ORIGIN:
2326 if (ignore_system_lyxrc ||
2327 save_origin != system_lyxrc.save_origin) {
2328 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2333 case RC_BACKUPDIR_PATH:
2334 if (ignore_system_lyxrc ||
2335 backupdir_path != system_lyxrc.backupdir_path) {
2336 string const path = os::external_path(backupdir_path);
2337 os << "\\backupdir_path \"" << path << "\"\n";
2343 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2347 << "# SPELLCHECKER SECTION ##############################\n"
2351 case RC_ACCEPT_COMPOUND:
2352 if (ignore_system_lyxrc ||
2353 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2354 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2361 if (ignore_system_lyxrc ||
2362 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2363 os << "\\alternate_language \"" << spellchecker_alt_lang
2370 if (ignore_system_lyxrc ||
2371 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2372 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2377 case RC_USE_NATIVE_FILEDIALOG:
2378 if (ignore_system_lyxrc ||
2379 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2380 os << "\\use_native_filedialog "
2381 << convert<string>(use_native_filedialog)
2387 case RC_USE_SYSTEM_COLORS:
2388 if (ignore_system_lyxrc ||
2389 use_system_colors != system_lyxrc.use_system_colors) {
2390 os << "\\use_system_colors "
2391 << convert<string>(use_system_colors)
2397 case RC_USE_TOOLTIP:
2398 if (ignore_system_lyxrc ||
2399 use_tooltip != system_lyxrc.use_tooltip) {
2400 os << "\\use_tooltip "
2401 << convert<string>(use_tooltip)
2409 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2413 case RC_DEFAULT_DECIMAL_SEP:
2414 if (ignore_system_lyxrc ||
2415 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2416 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2421 case RC_DEFAULT_LENGTH_UNIT:
2422 if (ignore_system_lyxrc ||
2423 default_length_unit != system_lyxrc.default_length_unit) {
2424 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2429 case RC_SPELLCHECKER:
2430 if (ignore_system_lyxrc ||
2431 spellchecker != system_lyxrc.spellchecker) {
2432 os << "\\spellchecker " << spellchecker << '\n';
2437 case RC_SPELLCHECK_CONTINUOUSLY:
2438 if (ignore_system_lyxrc ||
2439 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2440 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2446 case RC_SPELLCHECK_NOTES:
2447 if (ignore_system_lyxrc ||
2448 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2449 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2455 case RC_VISUAL_CURSOR:
2456 if (ignore_system_lyxrc ||
2457 visual_cursor != system_lyxrc.visual_cursor) {
2458 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2463 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2464 if (ignore_system_lyxrc ||
2465 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2466 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2467 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2472 case RC_LANGUAGE_CUSTOM_PACKAGE:
2473 if (ignore_system_lyxrc ||
2474 language_custom_package != system_lyxrc.language_custom_package) {
2475 os << "\\language_custom_package \"" << language_custom_package
2481 case RC_LANGUAGE_GLOBAL_OPTIONS:
2482 if (ignore_system_lyxrc ||
2483 language_global_options
2484 != system_lyxrc.language_global_options) {
2485 os << "\\language_global_options \""
2486 << convert<string>(language_global_options)
2492 case RC_LANGUAGE_PACKAGE_SELECTION:
2493 if (ignore_system_lyxrc ||
2494 language_package_selection != system_lyxrc.language_package_selection) {
2495 os << "\\language_package_selection ";
2496 switch (language_package_selection) {
2514 case RC_LANGUAGE_COMMAND_BEGIN:
2515 if (ignore_system_lyxrc ||
2516 language_command_begin
2517 != system_lyxrc.language_command_begin) {
2518 os << "\\language_command_begin \""
2519 << language_command_begin
2525 case RC_LANGUAGE_COMMAND_END:
2526 if (ignore_system_lyxrc ||
2527 language_command_end
2528 != system_lyxrc.language_command_end) {
2529 os << "\\language_command_end \"" << language_command_end
2535 case RC_LANGUAGE_COMMAND_LOCAL:
2536 if (ignore_system_lyxrc ||
2537 language_command_local
2538 != system_lyxrc.language_command_local) {
2539 os << "\\language_command_local \""
2540 << language_command_local
2546 case RC_LANGUAGE_AUTO_BEGIN:
2547 if (ignore_system_lyxrc ||
2548 language_auto_begin != system_lyxrc.language_auto_begin) {
2549 os << "\\language_auto_begin "
2550 << convert<string>(language_auto_begin) << '\n';
2555 case RC_LANGUAGE_AUTO_END:
2556 if (ignore_system_lyxrc ||
2557 language_auto_end != system_lyxrc.language_auto_end) {
2558 os << "\\language_auto_end "
2559 << convert<string>(language_auto_end) << '\n';
2564 case RC_MARK_FOREIGN_LANGUAGE:
2565 if (ignore_system_lyxrc ||
2566 mark_foreign_language
2567 != system_lyxrc.mark_foreign_language) {
2568 os << "\\mark_foreign_language " <<
2569 convert<string>(mark_foreign_language) << '\n';
2572 case RC_RESPECT_OS_KBD_LANGUAGE:
2573 if (ignore_system_lyxrc ||
2574 respect_os_kbd_language
2575 != system_lyxrc.respect_os_kbd_language) {
2576 os << "\\respect_os_kbd_language " <<
2577 convert<string>(respect_os_kbd_language) << '\n';
2584 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2588 case RC_AUTO_NUMBER:
2589 if (ignore_system_lyxrc ||
2590 auto_number != system_lyxrc.auto_number) {
2591 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2596 case RC_GUI_LANGUAGE:
2597 if (ignore_system_lyxrc ||
2598 gui_language != system_lyxrc.gui_language) {
2599 os << "\\gui_language " << gui_language << '\n';
2604 case RC_EXPORT_OVERWRITE:
2605 if (ignore_system_lyxrc ||
2606 export_overwrite != system_lyxrc.export_overwrite) {
2608 switch (export_overwrite) {
2619 os << "\\export_overwrite " << status << '\n';
2624 case RC_SCROLL_WHEEL_ZOOM:
2625 if (ignore_system_lyxrc ||
2626 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2628 switch (scroll_wheel_zoom) {
2629 case SCROLL_WHEEL_ZOOM_OFF:
2632 case SCROLL_WHEEL_ZOOM_CTRL:
2635 case SCROLL_WHEEL_ZOOM_SHIFT:
2638 case SCROLL_WHEEL_ZOOM_ALT:
2642 os << "\\scroll_wheel_zoom " << status << '\n';
2648 << "# FORMATS SECTION ##########################\n"
2653 // New/modified formats
2654 for (Formats::const_iterator cit = theFormats().begin();
2655 cit != theFormats().end(); ++cit) {
2656 Format const * format =
2657 theSystemFormats().getFormat(cit->name());
2659 format->extensions() != cit->extensions() ||
2660 format->prettyname() != cit->prettyname() ||
2661 format->shortcut() != cit->shortcut() ||
2662 format->viewer() != cit->viewer() ||
2663 format->editor() != cit->editor() ||
2664 format->documentFormat() != cit->documentFormat() ||
2665 format->vectorFormat() != cit->vectorFormat() ||
2666 format->inExportMenu() != cit->inExportMenu() ||
2667 format->noMenu() != cit->noMenu() ||
2668 format->mime() != cit->mime()) {
2669 os << "\\format \"" << cit->name() << "\" \""
2670 << cit->extensions() << "\" \""
2671 << to_utf8(cit->prettyname()) << "\" \""
2672 << cit->shortcut() << "\" \""
2673 << escapeCommand(cit->viewer()) << "\" \""
2674 << escapeCommand(cit->editor()) << "\" \"";
2675 vector<string> flags;
2676 if (cit->documentFormat())
2677 flags.push_back("document");
2678 if (cit->vectorFormat())
2679 flags.push_back("vector");
2680 if (cit->zippedNative())
2681 flags.push_back("zipped=native");
2682 if (cit->inExportMenu())
2683 flags.push_back("menu=export");
2685 os << getStringFromVector(flags);
2686 os << "\" \"" << cit->mime() << "\"\n";
2690 // Look for deleted formats
2691 for (Formats::const_iterator cit = theSystemFormats().begin();
2692 cit != theSystemFormats().end(); ++cit)
2693 if (!theFormats().getFormat(cit->name()))
2694 os << "\\format \"" << cit->name()
2695 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2699 case RC_VIEWER_ALTERNATIVES: {
2700 Alternatives::const_iterator it = viewer_alternatives.begin();
2701 Alternatives::const_iterator const en = viewer_alternatives.end();
2702 Alternatives::const_iterator const sysend =
2703 system_lyxrc.viewer_alternatives.end();
2704 for (; it != en; ++it) {
2705 string const & fmt = it->first;
2706 CommandSet const & cmd = it->second;
2707 CommandSet::const_iterator sit = cmd.begin();
2708 CommandSet::const_iterator const sen = cmd.end();
2709 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2710 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2711 system_lyxrc.viewer_alternatives.find(fmt);
2712 for (; sit != sen; ++sit) {
2713 string const & cmd = *sit;
2714 if (ignore_system_lyxrc
2715 || sysfmt == sysend // format not found
2716 || sysfmt->second.count(cmd) == 0 // this command not found
2718 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2725 case RC_EDITOR_ALTERNATIVES: {
2726 Alternatives::const_iterator it = editor_alternatives.begin();
2727 Alternatives::const_iterator const en = editor_alternatives.end();
2728 Alternatives::const_iterator const sysend =
2729 system_lyxrc.editor_alternatives.end();
2730 for (; it != en; ++it) {
2731 string const & fmt = it->first;
2732 CommandSet const & cmd = it->second;
2733 CommandSet::const_iterator sit = cmd.begin();
2734 CommandSet::const_iterator const sen = cmd.end();
2735 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2736 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2737 system_lyxrc.editor_alternatives.find(fmt);
2738 for (; sit != sen; ++sit) {
2739 string const & cmd = *sit;
2740 if (ignore_system_lyxrc
2741 || sysfmt == sysend // format not found
2742 || sysfmt->second.count(cmd) == 0 // this command not found
2744 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2751 case RC_DEFAULT_OTF_VIEW_FORMAT:
2752 if ((ignore_system_lyxrc ||
2753 default_otf_view_format != system_lyxrc.default_otf_view_format)
2754 && !default_otf_view_format.empty()) {
2755 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2760 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2761 if ((ignore_system_lyxrc ||
2762 default_platex_view_format != system_lyxrc.default_platex_view_format)
2763 && !default_platex_view_format.empty()) {
2764 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2769 case RC_DEFAULT_VIEW_FORMAT:
2770 if ((ignore_system_lyxrc ||
2771 default_view_format != system_lyxrc.default_view_format)
2772 && !default_view_format.empty()) {
2773 os << "\\default_view_format " << default_view_format << '\n';
2784 << "# CONVERTERS SECTION ##########################\n"
2789 // Look for new converters
2790 for (Converters::const_iterator cit = theConverters().begin();
2791 cit != theConverters().end(); ++cit) {
2792 Converter const * converter =
2793 theSystemConverters().getConverter(cit->from(),
2796 converter->command() != cit->command() ||
2797 converter->flags() != cit->flags())
2798 os << "\\converter \"" << cit->from() << "\" \""
2799 << cit->to() << "\" \""
2800 << escapeCommand(cit->command()) << "\" \""
2801 << cit->flags() << "\"\n";
2804 // New/modifed converters
2805 for (Converters::const_iterator cit = theSystemConverters().begin();
2806 cit != theSystemConverters().end(); ++cit)
2807 if (!theConverters().getConverter(cit->from(), cit->to()))
2808 os << "\\converter \"" << cit->from()
2809 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2816 << "# COPIERS SECTION ##########################\n"
2819 // Look for new movers
2820 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2821 Movers::const_iterator const sysend = theSystemMovers().end();
2822 Movers::const_iterator it = theMovers().begin();
2823 Movers::const_iterator end = theMovers().end();
2825 for (; it != end; ++it) {
2826 Movers::const_iterator const sysit =
2827 find_if(sysbegin, sysend, SameMover(*it));
2828 if (sysit == sysend) {
2829 string const & fmt = it->first;
2830 string const & command =
2831 it->second.command();
2833 os << "\\copier " << fmt
2834 << " \"" << escapeCommand(command) << "\"\n";
2840 // We don't actually delete SpecialisedMover(s) from the
2841 // map, just clear their 'command', so there's no need
2842 // to test for anything else.
2849 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2851 // Why the switch you might ask. It is a trick to ensure that all
2852 // the elements in the LyXRCTags enum is handled. As you can see
2853 // there are no breaks at all. So it is just a huge fall-through.
2854 // The nice thing is that we will get a warning from the compiler
2855 // if we forget an element.
2856 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2858 case LyXRC::RC_LAST:
2859 case LyXRC::RC_ACCEPT_COMPOUND:
2860 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2861 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2863 case LyXRC::RC_ALT_LANG:
2864 case LyXRC::RC_PLAINTEXT_LINELEN:
2865 case LyXRC::RC_AUTOCORRECTION_MATH:
2866 case LyXRC::RC_AUTOREGIONDELETE:
2867 case LyXRC::RC_AUTORESET_OPTIONS:
2868 case LyXRC::RC_AUTOSAVE:
2869 case LyXRC::RC_AUTO_NUMBER:
2870 case LyXRC::RC_BACKUPDIR_PATH:
2871 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2872 case LyXRC::RC_BIBTEX_COMMAND:
2873 case LyXRC::RC_BINDFILE:
2874 case LyXRC::RC_BOOKMARKS_VISIBILITY:
2875 case LyXRC::RC_CITATION_SEARCH:
2876 case LyXRC::RC_CITATION_SEARCH_PATTERN:
2877 case LyXRC::RC_CITATION_SEARCH_VIEW:
2878 case LyXRC::RC_CHECKLASTFILES:
2879 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2880 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2881 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2882 case LyXRC::RC_COMPLETION_INLINE_MATH:
2883 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2884 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2885 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2886 case LyXRC::RC_COMPLETION_POPUP_MATH:
2887 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2888 case LyXRC::RC_COMPLETION_MINLENGTH:
2889 case LyXRC::RC_USELASTFILEPOS:
2890 case LyXRC::RC_LOADSESSION:
2891 case LyXRC::RC_CHKTEX_COMMAND:
2892 case LyXRC::RC_CONVERTER:
2893 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2894 case LyXRC::RC_COPIER:
2895 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2896 case LyXRC::RC_CT_MARKUP_COPIED:
2897 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2898 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2899 case LyXRC::RC_GUI_LANGUAGE:
2900 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2901 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2902 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2903 case LyXRC::RC_DEFFILE:
2904 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2905 case LyXRC::RC_DISPLAY_GRAPHICS:
2906 case LyXRC::RC_DOCUMENTPATH:
2907 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2908 FileName path(lyxrc_new.document_path);
2909 if (path.exists() && path.isDirectory())
2910 package().document_dir() = FileName(lyxrc.document_path);
2913 case LyXRC::RC_EDITOR_ALTERNATIVES:
2914 case LyXRC::RC_ESC_CHARS:
2915 case LyXRC::RC_EXAMPLEPATH:
2916 case LyXRC::RC_FILEFORMAT:
2917 case LyXRC::RC_GROUP_LAYOUTS:
2918 case LyXRC::RC_HUNSPELLDIR_PATH:
2919 case LyXRC::RC_ICON_SET:
2920 case LyXRC::RC_INDEX_ALTERNATIVES:
2921 case LyXRC::RC_INDEX_COMMAND:
2922 case LyXRC::RC_JBIBTEX_COMMAND:
2923 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2924 case LyXRC::RC_JINDEX_COMMAND:
2925 case LyXRC::RC_NOMENCL_COMMAND:
2926 case LyXRC::RC_PYGMENTIZE_COMMAND:
2927 case LyXRC::RC_INPUT:
2928 case LyXRC::RC_KBMAP:
2929 case LyXRC::RC_KBMAP_PRIMARY:
2930 case LyXRC::RC_KBMAP_SECONDARY:
2931 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2932 case LyXRC::RC_LANGUAGE_AUTO_END:
2933 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2934 case LyXRC::RC_LANGUAGE_COMMAND_END:
2935 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2936 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2937 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2938 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2939 case LyXRC::RC_LYXRCFORMAT:
2940 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2941 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2942 case LyXRC::RC_MACRO_EDIT_STYLE:
2943 case LyXRC::RC_MAKE_BACKUP:
2944 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2945 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2946 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2947 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2948 case LyXRC::RC_NUMLASTFILES:
2949 case LyXRC::RC_PARAGRAPH_MARKERS:
2950 case LyXRC::RC_PATH_PREFIX:
2951 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2952 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2953 // Resets python path
2954 support::os::python(true);
2957 case LyXRC::RC_PREVIEW:
2958 if (lyxrc_orig.preview != lyxrc_new.preview) {
2959 // Update all previews of all documents.
2960 /* FIXME: this can be very expensive. It would be cheaper
2961 * to kill all existing previews and update visible
2963 theBufferList().updatePreviews();
2966 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2967 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2968 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2969 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2970 case LyXRC::RC_PRINTPAPERFLAG:
2971 case LyXRC::RC_SAVE_COMPRESSED:
2972 case LyXRC::RC_SAVE_ORIGIN:
2973 case LyXRC::RC_SCREEN_DPI:
2975 case LyXRC::RC_SCREEN_FONT_ROMAN:
2976 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2977 case LyXRC::RC_SCREEN_FONT_SANS:
2978 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2979 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2980 case LyXRC::RC_SCREEN_FONT_SIZES:
2981 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2982 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2983 case LyXRC::RC_SCREEN_ZOOM:
2984 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2985 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2986 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2987 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2988 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2989 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2990 || !std::equal(std::begin(lyxrc_orig.font_sizes), std::end(lyxrc_orig.font_sizes),
2991 std::begin(lyxrc_new.font_sizes))
2992 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2993 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2994 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2997 case LyXRC::RC_GEOMETRY_SESSION:
2998 case LyXRC::RC_SERVERPIPE:
2999 case LyXRC::RC_SET_COLOR:
3000 case LyXRC::RC_SHOW_BANNER:
3001 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3002 case LyXRC::RC_SPELLCHECKER:
3003 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3006 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3007 case LyXRC::RC_SPELLCHECK_NOTES:
3008 case LyXRC::RC_SPLITINDEX_COMMAND:
3009 case LyXRC::RC_TEMPDIRPATH:
3010 case LyXRC::RC_TEMPLATEPATH:
3011 case LyXRC::RC_TEX_ALLOWS_SPACES:
3012 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3013 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3014 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3017 case LyXRC::RC_TEXINPUTS_PREFIX:
3018 case LyXRC::RC_THESAURUSDIRPATH:
3019 case LyXRC::RC_UIFILE:
3020 case LyXRC::RC_USER_EMAIL:
3021 case LyXRC::RC_USER_INITIALS:
3022 case LyXRC::RC_USER_NAME:
3023 case LyXRC::RC_USE_CONVERTER_CACHE:
3024 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3025 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3026 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
3027 case LyXRC::RC_USE_SYSTEM_COLORS:
3028 case LyXRC::RC_USE_TOOLTIP:
3029 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3030 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3031 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3032 case LyXRC::RC_SINGLE_INSTANCE:
3033 case LyXRC::RC_SORT_LAYOUTS:
3034 case LyXRC::RC_FULL_SCREEN_LIMIT:
3035 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3036 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3037 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3038 case LyXRC::RC_FULL_SCREEN_TABBAR:
3039 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3040 case LyXRC::RC_FULL_SCREEN_WIDTH:
3041 case LyXRC::RC_VISUAL_CURSOR:
3042 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3043 case LyXRC::RC_VIEWER:
3044 case LyXRC::RC_VIEWER_ALTERNATIVES:
3045 case LyXRC::RC_FORWARD_SEARCH_DVI:
3046 case LyXRC::RC_FORWARD_SEARCH_PDF:
3047 case LyXRC::RC_EXPORT_OVERWRITE:
3048 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
3049 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3050 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3051 case LyXRC::RC_CURSOR_WIDTH:
3057 set<string> LyXRC::getRCs()
3060 for (int i = 0; i != lyxrcCount; ++i)
3061 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
3067 string const LyXRC::getDescription(LyXRCTags tag)
3072 case RC_ACCEPT_COMPOUND:
3073 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3077 str = _("Specify an alternate language. The default is to use the language of the document.");
3080 case RC_PLAINTEXT_LINELEN:
3081 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.");
3084 case RC_AUTOREGIONDELETE:
3085 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3088 case RC_AUTORESET_OPTIONS:
3089 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3093 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3096 case RC_AUTO_NUMBER:
3099 case RC_BACKUPDIR_PATH:
3100 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.");
3103 case RC_BIBTEX_COMMAND:
3104 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3107 case RC_JBIBTEX_COMMAND:
3108 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3112 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3115 case RC_CHECKLASTFILES:
3116 str = _("Select to check whether the lastfiles still exist.");
3119 case RC_CHKTEX_COMMAND:
3120 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3126 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3127 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3130 case RC_CONVERTER_NEEDAUTH:
3131 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3137 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3138 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.");
3141 case RC_CURSOR_WIDTH:
3142 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3145 case RC_SCROLL_BELOW_DOCUMENT:
3146 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");
3149 case RC_MAC_DONTSWAP_CTRL_META:
3150 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3153 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3154 str = _("Use the Mac OS X conventions for cursor movement");
3157 case RC_SHOW_MACRO_LABEL:
3158 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3162 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3165 case RC_DEFAULT_OTF_VIEW_FORMAT:
3166 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3169 case RC_DEFAULT_VIEW_FORMAT:
3170 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3173 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3174 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3177 case RC_DISPLAY_GRAPHICS:
3178 str = _("Select how LyX will display any graphics.");
3181 case RC_DOCUMENTPATH:
3182 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3186 str = _("Specify additional chars that can be part of a word.");
3189 case RC_EXAMPLEPATH:
3190 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3196 case RC_INDEX_COMMAND:
3197 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\".");
3200 case RC_JINDEX_COMMAND:
3201 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3204 case RC_NOMENCL_COMMAND:
3205 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3208 case RC_PYGMENTIZE_COMMAND:
3209 str = _("The command to run the python pygments syntax highlighter.");
3216 case RC_KBMAP_PRIMARY:
3217 case RC_KBMAP_SECONDARY:
3218 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.");
3221 case RC_LANGUAGE_AUTO_BEGIN:
3222 str = _("Select if a language switching command is needed at the beginning of the document.");
3225 case RC_LANGUAGE_AUTO_END:
3226 str = _("Select if a language switching command is needed at the end of the document.");
3229 case RC_LANGUAGE_COMMAND_BEGIN:
3230 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.");
3233 case RC_LANGUAGE_COMMAND_END:
3234 str = _("The LaTeX command for changing back to the language of the document.");
3237 case RC_LANGUAGE_COMMAND_LOCAL:
3238 str = _("The LaTeX command for local changing of the language.");
3241 case RC_LANGUAGE_GLOBAL_OPTIONS:
3242 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3245 case RC_LANGUAGE_CUSTOM_PACKAGE:
3246 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3249 case RC_LANGUAGE_PACKAGE_SELECTION:
3250 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3253 case RC_USELASTFILEPOS:
3254 str = _("De-select if you do not want LyX to scroll to saved position.");
3257 case RC_LOADSESSION:
3258 str = _("De-select to prevent loading files opened from the last LyX session.");
3261 case RC_MAKE_BACKUP:
3262 str = _("De-select if you don't want LyX to create backup files.");
3265 case RC_MARK_FOREIGN_LANGUAGE:
3266 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3269 case RC_RESPECT_OS_KBD_LANGUAGE:
3270 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3273 case RC_MOUSE_WHEEL_SPEED:
3274 str = _("The scrolling speed of the mouse wheel.");
3277 case RC_COMPLETION_POPUP_DELAY:
3278 str = _("The completion popup delay.");
3281 case RC_COMPLETION_POPUP_MATH:
3282 str = _("Select to display the completion popup in math mode.");
3285 case RC_COMPLETION_POPUP_TEXT:
3286 str = _("Select to display the completion popup in text mode.");
3289 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3290 str = _("Show the completion popup without delay after non-unique completion attempt.");
3293 case RC_COMPLETION_POPUP_TEXT:
3294 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3297 case RC_COMPLETION_POPUP_DELAY:
3298 str = _("The inline completion delay.");
3301 case RC_COMPLETION_INLINE_MATH:
3302 str = _("Select to display the inline completion in math mode.");
3305 case RC_COMPLETION_INLINE_TEXT:
3306 str = _("Select to display the inline completion in text mode.");
3309 case RC_COMPLETION_INLINE_DOTS:
3310 str = _("Use \"...\" to shorten long completions.");
3313 case RC_AUTOCORRECTION_MATH:
3314 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3317 case RC_NUMLASTFILES:
3318 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3322 case RC_PATH_PREFIX:
3323 str = _("Specify those directories which should be "
3324 "prepended to the PATH environment variable.\n"
3325 "Use the OS native format.");
3329 str = _("Shows a typeset preview of things such as math");
3332 case RC_PREVIEW_HASHED_LABELS:
3333 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3336 case RC_PREVIEW_SCALE_FACTOR:
3337 str = _("Scale the preview size to suit.");
3340 case RC_PRINTLANDSCAPEFLAG:
3341 str = _("The option to print out in landscape.");
3344 case RC_PRINTPAPERDIMENSIONFLAG:
3345 str = _("Option to specify the dimensions of the print paper.");
3348 case RC_PRINTPAPERFLAG:
3349 str = _("The option to specify paper type.");
3352 case RC_VISUAL_CURSOR:
3353 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3356 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3357 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).");
3361 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3364 case RC_SCREEN_FONT_ROMAN:
3365 case RC_SCREEN_FONT_SANS:
3366 case RC_SCREEN_FONT_TYPEWRITER:
3367 str = _("The screen fonts used to display the text while editing.");
3370 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3371 case RC_SCREEN_FONT_SANS_FOUNDRY:
3372 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3375 case RC_SCREEN_FONT_SCALABLE:
3376 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.");
3379 case RC_SCREEN_FONT_SIZES:
3380 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3383 case RC_SCREEN_ZOOM:
3384 //xgettext:no-c-format
3385 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3388 case RC_GEOMETRY_SESSION:
3389 str = _("Allow session manager to save and restore windows geometry.");
3393 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3399 case RC_SHOW_BANNER:
3400 str = _("De-select if you don't want the startup banner.");
3403 case RC_TEMPDIRPATH:
3404 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3407 case RC_THESAURUSDIRPATH:
3408 str = _("This is the place where the files of the thesaurus library reside.");
3411 case RC_TEMPLATEPATH:
3412 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3415 case RC_TEX_ALLOWS_SPACES:
3418 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3421 case RC_TEXINPUTS_PREFIX:
3422 str = _("Specify those directories which should be "
3423 "prepended to the TEXINPUTS environment variable.\n"
3424 "A '.' represents the current document directory. "
3425 "Use the OS native format.");
3429 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3438 case RC_USE_USE_SYSTEM_COLORS:
3439 str = _("Enable use the system colors for some things like main window background and selection.");
3442 case RC_USE_TOOLTIP:
3443 str = _("Enable the automatic appearance of tool tips in the work area.");
3446 case RC_VIEWDVI_PAPEROPTION:
3447 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3462 // The global instance
3465 // The global copy of the system lyxrc entries (everything except preferences)