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 = 33; // sanda: add \citation_search_view
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 { "\\citation_search", LyXRC::RC_CITATION_SEARCH },
82 { "\\citation_search_pattern", LyXRC::RC_CITATION_SEARCH_PATTERN },
83 { "\\citation_search_view", LyXRC::RC_CITATION_SEARCH_VIEW },
84 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
85 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
86 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
87 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
88 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
89 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
90 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
91 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
92 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
93 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
94 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
95 { "\\converter", LyXRC::RC_CONVERTER },
96 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
97 { "\\copier", LyXRC::RC_COPIER },
98 { "\\ct_additions_underlined", LyXRC::RC_CT_ADDITIONS_UNDERLINED },
99 { "\\ct_markup_copied", LyXRC::RC_CT_MARKUP_COPIED },
100 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
101 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
102 { "\\def_file", LyXRC::RC_DEFFILE },
103 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
104 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
105 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
106 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
107 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
108 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
109 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
110 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
111 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
112 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
113 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
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 while (lexrc.isOK()) {
290 // By using two switches we take advantage of the compiler
291 // telling us if we have missed a LyXRCTags element in
292 // the second switch.
293 // Note that this also shows a problem with Lexer since it
294 // helps us avoid taking advantage of the strictness of the
297 int le = lexrc.lex();
299 case Lexer::LEX_UNDEF:
300 lexrc.printError("Unknown tag `$$Token'");
302 case Lexer::LEX_FEOF:
307 switch (static_cast<LyXRCTags>(le)) {
310 rc_format = lexrc.getInteger();
312 case RC_INPUT: // Include file
315 libFileSearch(string(),
317 if (!read(tmp, check_format)) {
319 "Error reading included file: " + tmp.absFileName());
325 bind_file = os::internal_path(lexrc.getString());
330 def_file = os::internal_path(lexrc.getString());
335 ui_file = os::internal_path(lexrc.getString());
338 case RC_AUTORESET_OPTIONS:
339 lexrc >> auto_reset_options;
342 case RC_DISPLAY_GRAPHICS:
344 display_graphics = lexrc.getString() == "true";
347 case RC_TEX_EXPECTS_WINDOWS_PATHS:
348 lexrc >> windows_style_tex_paths;
351 case RC_TEX_ALLOWS_SPACES:
352 lexrc >> tex_allows_spaces;
355 case RC_TEXINPUTS_PREFIX:
356 lexrc >> texinputs_prefix;
363 case RC_KBMAP_PRIMARY:
365 string const kmap(os::internal_path(lexrc.getString()));
366 if (!libFileSearch("kbd", kmap, "kmap").empty()
368 primary_kbmap = kmap;
370 lexrc.printError("LyX: Keymap `$$Token' not found");
375 case RC_KBMAP_SECONDARY:
377 string const kmap(os::internal_path(lexrc.getString()));
378 if (!libFileSearch("kbd", kmap, "kmap").empty()
380 secondary_kbmap = kmap;
382 lexrc.printError("LyX: Keymap `$$Token' not found");
387 case RC_PRINTLANDSCAPEFLAG:
388 lexrc >> print_landscape_flag;
391 case RC_PRINTPAPERDIMENSIONFLAG:
392 lexrc >> print_paper_dimension_flag;
395 case RC_PRINTPAPERFLAG:
396 lexrc >> print_paper_flag;
399 case RC_PYGMENTIZE_COMMAND:
400 if (lexrc.next(true)) {
401 pygmentize_command = lexrc.getString();
405 case RC_VIEWDVI_PAPEROPTION:
407 view_dvi_paper_option = lexrc.getString();
409 view_dvi_paper_option.erase();
412 case RC_CHKTEX_COMMAND:
413 if (lexrc.next(true)) {
414 chktex_command = lexrc.getString();
418 case RC_BIBTEX_ALTERNATIVES:
419 if (lexrc.next(true)) {
420 bibtex_alternatives.insert(lexrc.getString());
424 case RC_BIBTEX_COMMAND:
425 if (lexrc.next(true)) {
426 bibtex_command = lexrc.getString();
430 case RC_JBIBTEX_COMMAND:
431 if (lexrc.next(true)) {
432 jbibtex_command = lexrc.getString();
436 case RC_JBIBTEX_ALTERNATIVES:
437 if (lexrc.next(true)) {
438 jbibtex_alternatives.insert(lexrc.getString());
442 case RC_INDEX_ALTERNATIVES:
443 if (lexrc.next(true)) {
444 index_alternatives.insert(lexrc.getString());
448 case RC_INDEX_COMMAND:
449 if (lexrc.next(true)) {
450 index_command = lexrc.getString();
454 case RC_JINDEX_COMMAND:
455 if (lexrc.next(true)) {
456 jindex_command = lexrc.getString();
460 case RC_SPLITINDEX_COMMAND:
461 if (lexrc.next(true)) {
462 splitindex_command = lexrc.getString();
466 case RC_NOMENCL_COMMAND:
467 if (lexrc.next(true)) {
468 nomencl_command = lexrc.getString();
477 lexrc >> defaultZoom;
478 if (defaultZoom < 10)
482 case RC_GEOMETRY_SESSION:
483 lexrc >> allow_geometry_session;
486 case RC_SCREEN_FONT_SIZES:
487 lexrc >> font_sizes[TINY_SIZE];
488 lexrc >> font_sizes[SCRIPT_SIZE];
489 lexrc >> font_sizes[FOOTNOTE_SIZE];
490 lexrc >> font_sizes[SMALL_SIZE];
491 lexrc >> font_sizes[NORMAL_SIZE];
492 lexrc >> font_sizes[LARGE_SIZE];
493 lexrc >> font_sizes[LARGER_SIZE];
494 lexrc >> font_sizes[LARGEST_SIZE];
495 lexrc >> font_sizes[HUGE_SIZE];
496 lexrc >> font_sizes[HUGER_SIZE];
499 case RC_SCREEN_FONT_SCALABLE:
500 lexrc >> use_scalable_fonts;
507 case RC_DOCUMENTPATH:
509 document_path = os::internal_path(lexrc.getString());
514 example_path = os::internal_path(lexrc.getString());
517 case RC_TEMPLATEPATH:
519 template_path = os::internal_path(lexrc.getString());
524 tempdir_path = os::internal_path(lexrc.getString());
527 case RC_THESAURUSDIRPATH:
529 thesaurusdir_path = os::internal_path(lexrc.getString());
532 case RC_HUNSPELLDIR_PATH:
534 hunspelldir_path = os::internal_path(lexrc.getString());
537 case RC_USELASTFILEPOS:
538 lexrc >> use_lastfilepos;
542 lexrc >> load_session;
545 case RC_MOUSE_WHEEL_SPEED:
546 lexrc >> mouse_wheel_speed;
549 case RC_COMPLETION_INLINE_DELAY:
550 lexrc >> completion_inline_delay;
553 case RC_COMPLETION_INLINE_MATH:
554 lexrc >> completion_inline_math;
557 case RC_COMPLETION_INLINE_TEXT:
558 lexrc >> completion_inline_text;
561 case RC_COMPLETION_INLINE_DOTS:
562 lexrc >> completion_inline_dots;
565 case RC_AUTOCORRECTION_MATH:
566 lexrc >> autocorrection_math;
569 case RC_COMPLETION_POPUP_DELAY:
570 lexrc >> completion_popup_delay;
573 case RC_COMPLETION_POPUP_MATH:
574 lexrc >> completion_popup_math;
577 case RC_COMPLETION_POPUP_TEXT:
578 lexrc >> completion_popup_text;
581 case RC_COMPLETION_CURSOR_TEXT:
582 lexrc >> completion_cursor_text;
585 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
586 lexrc >> completion_popup_after_complete;
589 case RC_COMPLETION_MINLENGTH:
590 lexrc >> completion_minlength;
593 case RC_NUMLASTFILES:
594 lexrc >> num_lastfiles;
597 case RC_CHECKLASTFILES:
598 lexrc >> check_lastfiles;
605 case RC_USE_SYSTEM_THEME_ICONS:
606 lexrc >> use_system_theme_icons;
609 case RC_SCREEN_FONT_ROMAN:
611 roman_font_name = lexrc.getString();
612 oldFontFormat(roman_font_name,
617 case RC_SCREEN_FONT_SANS:
619 sans_font_name = lexrc.getString();
620 oldFontFormat(sans_font_name, sans_font_foundry);
624 case RC_SCREEN_FONT_TYPEWRITER:
626 typewriter_font_name = lexrc.getString();
627 oldFontFormat(typewriter_font_name,
628 typewriter_font_foundry);
632 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
633 lexrc >> roman_font_foundry;
636 case RC_SCREEN_FONT_SANS_FOUNDRY:
637 lexrc >> sans_font_foundry;
640 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
641 lexrc >> typewriter_font_foundry;
646 lexrc.printError("Missing color tag.");
649 string const lyx_name = lexrc.getString();
652 lexrc.printError("Missing color name for color: `$$Token'");
655 string const x11_name = lexrc.getString();
657 ColorCode const col =
658 lcolor.getFromLyXName(lyx_name);
659 if (col == Color_none ||
660 col == Color_inherit ||
664 if (!lcolor.setColor(col, x11_name))
665 LYXERR0("Bad lyxrc set_color for " << lyx_name);
666 LYXERR(Debug::LYXRC, "Set " << lyx_name << "(" << col << ") to " << x11_name);
670 case RC_AUTOREGIONDELETE:
671 // Auto region delete defaults to true
672 lexrc >> auto_region_delete;
677 string userdir = package().user_support().absFileName();
678 if (userdir.back() == '/')
680 lyxpipes = subst(os::internal_path(lexrc.getString()), "$$UserDir",
685 case RC_CITATION_SEARCH:
686 lexrc >> citation_search;
689 case RC_CITATION_SEARCH_PATTERN:
691 citation_search_pattern = lexrc.getString();
694 case RC_CITATION_SEARCH_VIEW:
696 citation_search_view = lexrc.getString();
699 case RC_CT_ADDITIONS_UNDERLINED:
700 lexrc >> ct_additions_underlined;
703 case RC_CT_MARKUP_COPIED:
704 lexrc >> ct_markup_copied;
707 case RC_CURSOR_FOLLOWS_SCROLLBAR:
708 lexrc >> cursor_follows_scrollbar;
711 case RC_CURSOR_WIDTH:
712 lexrc >> cursor_width;
715 case RC_SCROLL_BELOW_DOCUMENT:
716 lexrc >> scroll_below_document;
719 case RC_PARAGRAPH_MARKERS:
720 lexrc >> paragraph_markers;
723 case RC_MAC_DONTSWAP_CTRL_META:
724 lexrc >> mac_dontswap_ctrl_meta;
727 case RC_MAC_LIKE_CURSOR_MOVEMENT:
728 lexrc >> mac_like_cursor_movement;
731 case RC_MACRO_EDIT_STYLE:
733 switch (lexrc.getInteger()) {
734 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
735 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
736 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
741 case RC_DIALOGS_ICONIFY_WITH_MAIN:
742 lexrc >> dialogs_iconify_with_main;
745 case RC_PLAINTEXT_LINELEN:
746 lexrc >> plaintext_linelen;
748 // Spellchecker settings:
749 case RC_ACCEPT_COMPOUND:
750 lexrc >> spellchecker_accept_compound;
752 case RC_USE_NATIVE_FILEDIALOG:
753 lexrc >> use_native_filedialog;
755 case RC_USE_SYSTEM_COLORS:
756 lexrc >> use_system_colors;
759 lexrc >> use_tooltip;
761 case RC_SPELLCHECKER:
762 lexrc >> spellchecker;
765 lexrc >> spellchecker_alt_lang;
768 lexrc >> spellchecker_esc_chars;
770 case RC_SPELLCHECK_CONTINUOUSLY:
771 lexrc >> spellcheck_continuously;
773 case RC_SPELLCHECK_NOTES:
774 lexrc >> spellcheck_notes;
777 lexrc >> make_backup;
779 case RC_SAVE_COMPRESSED:
780 lexrc >> save_compressed;
783 lexrc >> save_origin;
785 case RC_BACKUPDIR_PATH:
787 backupdir_path = os::internal_path(lexrc.getString());
789 case RC_DEFAULT_DECIMAL_SEP:
790 lexrc >> default_decimal_sep;
792 case RC_DEFAULT_LENGTH_UNIT:
794 default_length_unit = (Length::UNIT) lexrc.getInteger();
796 case RC_LANGUAGE_CUSTOM_PACKAGE:
797 lexrc >> language_custom_package;
799 case RC_LANGUAGE_AUTO_BEGIN:
800 lexrc >> language_auto_begin;
802 case RC_LANGUAGE_AUTO_END:
803 lexrc >> language_auto_end;
805 case RC_LANGUAGE_GLOBAL_OPTIONS:
806 lexrc >> language_global_options;
808 case RC_LANGUAGE_PACKAGE_SELECTION:
810 switch (lexrc.getInteger()) {
812 language_package_selection = LP_AUTO;
815 language_package_selection = LP_BABEL;
818 language_package_selection = LP_CUSTOM;
821 language_package_selection = LP_NONE;
826 case RC_LANGUAGE_COMMAND_BEGIN:
827 lexrc >> language_command_begin;
829 case RC_LANGUAGE_COMMAND_END:
830 lexrc >> language_command_end;
832 case RC_LANGUAGE_COMMAND_LOCAL:
833 lexrc >> language_command_local;
835 case RC_RESPECT_OS_KBD_LANGUAGE:
836 lexrc >> respect_os_kbd_language;
838 case RC_VISUAL_CURSOR:
839 lexrc >> visual_cursor;
841 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
842 lexrc >> close_buffer_with_last_view;
845 lexrc >> auto_number;
847 case RC_MARK_FOREIGN_LANGUAGE:
848 lexrc >> mark_foreign_language;
854 fmt = lexrc.getString();
855 if (lexrc.next(true))
856 command = lexrc.getString();
857 setMover(fmt, command);
862 string from, to, command, flags;
864 from = lexrc.getString();
866 to = lexrc.getString();
867 if (lexrc.next(true))
868 command = lexrc.getString();
870 flags = lexrc.getString();
872 theConverters().erase(from, to);
874 theConverters().add(from, to, command, flags);
877 // compatibility with versions older than 1.4.0 only
879 string format, command;
880 lexrc >> format >> command;
881 theFormats().setViewer(format, command);
884 case RC_FILEFORMAT: {
886 string format, extensions, shortcut;
887 docstring prettyname;
888 if (!(lexrc >> format >> extensions))
890 if (ok && lexrc.next(true))
891 prettyname = lexrc.getDocString();
895 if(!(lexrc >> shortcut))
897 string viewer, editor;
898 if (ok && lexrc.next(true))
899 viewer = lexrc.getString();
902 if (ok && lexrc.next(true))
903 editor = lexrc.getString();
907 if (!(lexrc >> flags >> mime))
909 int flgs = Format::none;
910 while (!flags.empty()) {
912 flags = split(flags, flag, ',');
913 if (flag == "document")
914 flgs |= Format::document;
915 else if (flag == "vector")
916 flgs |= Format::vector;
917 else if (flag == "zipped=native")
918 flgs |= Format::zipped_native;
919 else if (flag == "menu=export")
920 flgs |= Format::export_menu;
921 else if (flag == "menu=none")
922 flgs |= Format::no_menu;
924 LYXERR0("Ignoring unknown flag `"
925 << flag << "' for format `"
929 LYXERR0("Syntax error in format " << format);
930 else if (prettyname.empty()) {
931 if (theConverters().formatIsUsed(format))
932 LYXERR0("Can't delete format " << format);
934 theFormats().erase(format);
936 theFormats().add(format, extensions, prettyname,
937 shortcut, viewer, editor, mime, flgs);
941 case RC_VIEWER_ALTERNATIVES: {
942 string format, command;
943 if ((lexrc >> format) && lexrc.next(true)) {
944 command = lexrc.getString();
945 viewer_alternatives[format].insert(command);
949 case RC_EDITOR_ALTERNATIVES: {
950 string format, command;
951 if ((lexrc >> format) && lexrc.next(true)) {
952 command = lexrc.getString();
953 editor_alternatives[format].insert(command);
958 case RC_DEFAULT_OTF_VIEW_FORMAT:
959 lexrc >> default_otf_view_format;
962 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
963 lexrc >> default_platex_view_format;
966 case RC_DEFAULT_VIEW_FORMAT:
967 lexrc >> default_view_format;
970 case RC_GUI_LANGUAGE:
971 lexrc >> gui_language;
975 lexrc >> show_banner;
980 string const tmp = lexrc.getString();
981 if (tmp == "true" || tmp == "on")
982 preview = PREVIEW_ON;
983 else if (tmp == "no_math")
984 preview = PREVIEW_NO_MATH;
986 preview = PREVIEW_OFF;
987 if (tmp != "false" && tmp != "off")
988 LYXERR0("Unrecognized preview status \""
994 case RC_PREVIEW_HASHED_LABELS:
995 lexrc >> preview_hashed_labels;
998 case RC_PREVIEW_SCALE_FACTOR:
999 lexrc >> preview_scale_factor;
1006 lexrc >> user_email;
1008 case RC_USER_INITIALS:
1009 lexrc >> user_initials;
1012 case RC_PATH_PREFIX:
1013 lexrc >> path_prefix;
1016 case RC_USE_CONVERTER_CACHE:
1017 lexrc >> use_converter_cache;
1019 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1020 lexrc >> use_converter_needauth_forbidden;
1022 case RC_USE_CONVERTER_NEEDAUTH:
1023 lexrc >> use_converter_needauth;
1025 case RC_CONVERTER_CACHE_MAXAGE:
1026 lexrc >> converter_cache_maxage;
1029 case RC_SORT_LAYOUTS:
1030 lexrc >> sort_layouts;
1032 case RC_GROUP_LAYOUTS:
1033 lexrc >> group_layouts;
1035 case RC_FULL_SCREEN_LIMIT:
1036 lexrc >> full_screen_limit;
1038 case RC_FULL_SCREEN_TOOLBARS:
1039 lexrc >> full_screen_toolbars;
1041 case RC_FULL_SCREEN_SCROLLBAR:
1042 lexrc >> full_screen_scrollbar;
1044 case RC_FULL_SCREEN_STATUSBAR:
1045 lexrc >> full_screen_statusbar;
1047 case RC_FULL_SCREEN_TABBAR:
1048 lexrc >> full_screen_tabbar;
1050 case RC_FULL_SCREEN_MENUBAR:
1051 lexrc >> full_screen_menubar;
1053 case RC_FULL_SCREEN_WIDTH:
1054 lexrc >> full_screen_width;
1056 case RC_OPEN_BUFFERS_IN_TABS:
1057 lexrc >> open_buffers_in_tabs;
1059 case RC_SINGLE_CLOSE_TAB_BUTTON:
1060 lexrc >> single_close_tab_button;
1062 case RC_SINGLE_INSTANCE:
1063 lexrc >> single_instance;
1064 if (run_mode == PREFERRED)
1065 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1067 case RC_FORWARD_SEARCH_DVI:
1068 if (lexrc.next(true))
1069 forward_search_dvi = lexrc.getString();
1071 case RC_FORWARD_SEARCH_PDF:
1072 if (lexrc.next(true))
1073 forward_search_pdf = lexrc.getString();
1075 case RC_EXPORT_OVERWRITE:
1077 string const tmp = lexrc.getString();
1078 if (tmp == "all" || tmp == "true")
1079 export_overwrite = ALL_FILES;
1080 else if (tmp == "main")
1081 export_overwrite = MAIN_FILE;
1083 export_overwrite = NO_FILES;
1084 if (tmp != "ask" && tmp != "false")
1085 LYXERR0("Unrecognized export_overwrite status \""
1090 case RC_SCROLL_WHEEL_ZOOM:
1092 string const tmp = lexrc.getString();
1094 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1095 else if (tmp == "shift")
1096 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1097 else if (tmp == "alt")
1098 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1100 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1101 if (tmp != "off" && tmp != "false")
1102 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1108 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1109 lexrc >> mouse_middlebutton_paste;
1113 break; // this is just a dummy
1116 // This is triggered the first time through the loop unless
1117 // we hit a format tag.
1118 if (check_format && rc_format != LYXRC_FILEFORMAT)
1119 return FormatMismatch;
1122 /// Update converters data-structures
1123 theConverters().update(theFormats());
1124 theConverters().buildGraph();
1125 theBufferList().invalidateConverterCache();
1131 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1133 ofstream ofs(filename.toFilesystemEncoding().c_str());
1135 write(ofs, ignore_system_lyxrc);
1139 void LyXRC::print() const
1141 if (lyxerr.debugging())
1142 write(lyxerr, false);
1150 typedef pair<string, SpecialisedMover> Data;
1152 SameMover(Data const & comparison)
1153 : comparison_(comparison) {}
1155 bool operator()(Data const & data) const
1157 return data.first == comparison_.first &&
1158 data.second.command() == comparison_.second.command();
1168 // Escape \ and " so that LyXLex can read the string later
1169 string escapeCommand(string const & str) {
1170 return subst(subst(str , "\\", "\\\\"),
1177 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1179 LyXRCTags tag = RC_LAST;
1181 if (!name.empty()) {
1182 for (int i = 0; i != lyxrcCount; ++i)
1183 if ("\\" + name == lyxrcTags[i].tag)
1184 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1188 os << "# LyX " << lyx_version
1189 << " generated this file. If you want to make your own\n"
1190 << "# modifications you should do them from inside LyX and save.\n\n"
1191 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1193 // Why the switch you might ask. It is a trick to ensure that all
1194 // the elements in the LyXRCTags enum are handled. As you can see
1195 // there are no breaks at all. So it is just a huge fall-through.
1196 // The nice thing is that we will get a warning from the compiler
1197 // if we forget an element.
1201 // input/include files are not done here
1202 case RC_LYXRCFORMAT:
1204 if (ignore_system_lyxrc ||
1205 bind_file != system_lyxrc.bind_file) {
1206 string const path = os::external_path(bind_file);
1207 os << "\\bind_file \"" << path << "\"\n";
1213 if (ignore_system_lyxrc ||
1214 def_file != system_lyxrc.def_file) {
1215 string const path = os::external_path(def_file);
1216 os << "\\def_file \"" << path << "\"\n";
1225 << "# MISC SECTION ######################################\n"
1227 // bind files are not done here.
1229 case RC_PATH_PREFIX:
1230 if (ignore_system_lyxrc ||
1231 path_prefix != system_lyxrc.path_prefix) {
1232 os << "\\path_prefix \"" << path_prefix << "\"\n";
1238 if (ignore_system_lyxrc ||
1239 ui_file != system_lyxrc.ui_file) {
1240 string const path = os::external_path(ui_file);
1241 os << "\\ui_file \"" << path << "\"\n";
1246 case RC_AUTOREGIONDELETE:
1247 if (ignore_system_lyxrc ||
1248 auto_region_delete != system_lyxrc.auto_region_delete) {
1249 os << "# Set to false to inhibit automatic replacement of\n"
1250 << "# the current selection.\n"
1251 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1257 case RC_AUTORESET_OPTIONS:
1258 if (ignore_system_lyxrc ||
1259 auto_reset_options != system_lyxrc.auto_reset_options) {
1260 os << "# Set to false to inhibit automatic reset of\n"
1261 << "# the class options to defaults on class change.\n"
1262 << "\\auto_reset_options "
1263 << convert<string>(auto_reset_options)
1270 if (ignore_system_lyxrc ||
1271 autosave != system_lyxrc.autosave) {
1272 os << "# The time interval between auto-saves in seconds.\n"
1273 << "\\autosave " << autosave << '\n';
1278 case RC_DISPLAY_GRAPHICS:
1279 if (ignore_system_lyxrc ||
1280 display_graphics != system_lyxrc.display_graphics) {
1281 os << "# Display graphics within LyX\n"
1283 << "\\display_graphics "
1284 << (display_graphics ? "true" : "false")
1290 case RC_SORT_LAYOUTS:
1291 if (ignore_system_lyxrc ||
1292 sort_layouts != system_lyxrc.sort_layouts) {
1293 os << "# Sort layouts alphabetically.\n"
1294 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1299 case RC_GROUP_LAYOUTS:
1300 if (ignore_system_lyxrc ||
1301 group_layouts != system_lyxrc.group_layouts) {
1302 os << "# Group layouts by their category.\n"
1303 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1308 case RC_VIEWDVI_PAPEROPTION:
1309 if (ignore_system_lyxrc ||
1310 view_dvi_paper_option
1311 != system_lyxrc.view_dvi_paper_option) {
1312 os << "# Options used to specify paper size to the\n"
1313 << "# view_dvi_command (e.g. -paper)\n"
1314 << "\\view_dvi_paper_option \""
1315 << view_dvi_paper_option << "\"\n";
1320 case RC_CHKTEX_COMMAND:
1321 if (ignore_system_lyxrc ||
1322 chktex_command != system_lyxrc.chktex_command) {
1323 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1328 case RC_BIBTEX_ALTERNATIVES: {
1329 CommandSet::const_iterator it = bibtex_alternatives.begin();
1330 CommandSet::const_iterator end = bibtex_alternatives.end();
1331 for ( ; it != end; ++it) {
1332 if (ignore_system_lyxrc
1333 || !system_lyxrc.bibtex_alternatives.count(*it))
1334 os << "\\bibtex_alternatives \""
1341 case RC_BIBTEX_COMMAND:
1342 if (ignore_system_lyxrc ||
1343 bibtex_command != system_lyxrc.bibtex_command) {
1344 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1349 case RC_JBIBTEX_COMMAND:
1350 if (ignore_system_lyxrc ||
1351 jbibtex_command != system_lyxrc.jbibtex_command) {
1352 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1357 case RC_JBIBTEX_ALTERNATIVES: {
1358 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1359 CommandSet::const_iterator end = jbibtex_alternatives.end();
1360 for ( ; it != end; ++it) {
1361 if (ignore_system_lyxrc
1362 || !system_lyxrc.jbibtex_alternatives.count(*it))
1363 os << "\\jbibtex_alternatives \""
1370 case RC_INDEX_ALTERNATIVES: {
1371 CommandSet::const_iterator it = index_alternatives.begin();
1372 CommandSet::const_iterator end = index_alternatives.end();
1373 for ( ; it != end; ++it) {
1374 if (ignore_system_lyxrc
1375 || !system_lyxrc.index_alternatives.count(*it))
1376 os << "\\index_alternatives \""
1383 case RC_INDEX_COMMAND:
1384 if (ignore_system_lyxrc ||
1385 index_command != system_lyxrc.index_command) {
1386 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1391 case RC_JINDEX_COMMAND:
1392 if (ignore_system_lyxrc ||
1393 jindex_command != system_lyxrc.jindex_command) {
1394 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1399 case RC_SPLITINDEX_COMMAND:
1400 if (ignore_system_lyxrc ||
1401 splitindex_command != system_lyxrc.splitindex_command) {
1402 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1407 case RC_NOMENCL_COMMAND:
1408 if (ignore_system_lyxrc ||
1409 nomencl_command != system_lyxrc.nomencl_command) {
1410 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1415 case RC_PYGMENTIZE_COMMAND:
1416 if (ignore_system_lyxrc ||
1417 pygmentize_command != system_lyxrc.pygmentize_command) {
1418 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1423 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1424 // Don't write this setting to the preferences file,
1425 // but allow temporary changes (bug 7557).
1426 if (ignore_system_lyxrc) {
1427 os << "\\tex_expects_windows_paths "
1428 << convert<string>(windows_style_tex_paths) << '\n';
1433 case RC_TEX_ALLOWS_SPACES:
1434 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1435 os << "\\tex_allows_spaces "
1436 << convert<string>(tex_allows_spaces) << '\n';
1442 if (ignore_system_lyxrc ||
1443 use_kbmap != system_lyxrc.use_kbmap) {
1444 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1449 case RC_KBMAP_PRIMARY:
1450 if (ignore_system_lyxrc ||
1451 primary_kbmap != system_lyxrc.primary_kbmap) {
1452 string const path = os::external_path(primary_kbmap);
1453 os << "\\kbmap_primary \"" << path << "\"\n";
1458 case RC_KBMAP_SECONDARY:
1459 if (ignore_system_lyxrc ||
1460 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1461 string const path = os::external_path(secondary_kbmap);
1462 os << "\\kbmap_secondary \"" << path << "\"\n";
1468 if (ignore_system_lyxrc ||
1469 lyxpipes != system_lyxrc.lyxpipes) {
1470 string const path = os::external_path(lyxpipes);
1471 os << "\\serverpipe \"" << path << "\"\n";
1477 os << "\\user_name \"" << user_name << "\"\n";
1482 os << "\\user_email \"" << user_email << "\"\n";
1486 case RC_USER_INITIALS:
1487 os << "\\user_initials \"" << user_initials << "\"\n";
1491 case RC_SHOW_BANNER:
1492 if (ignore_system_lyxrc ||
1493 show_banner != system_lyxrc.show_banner) {
1494 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1500 if (ignore_system_lyxrc ||
1501 preview != system_lyxrc.preview) {
1507 case PREVIEW_NO_MATH:
1514 os << "\\preview " << status << '\n';
1519 case RC_PREVIEW_HASHED_LABELS:
1520 if (ignore_system_lyxrc ||
1521 preview_hashed_labels !=
1522 system_lyxrc.preview_hashed_labels) {
1523 os << "\\preview_hashed_labels "
1524 << convert<string>(preview_hashed_labels) << '\n';
1529 case RC_PREVIEW_SCALE_FACTOR:
1530 if (ignore_system_lyxrc ||
1531 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1532 os << "\\preview_scale_factor "
1533 << preview_scale_factor << '\n';
1538 case RC_USE_CONVERTER_CACHE:
1539 if (ignore_system_lyxrc ||
1540 use_converter_cache != system_lyxrc.use_converter_cache) {
1541 os << "\\use_converter_cache "
1542 << convert<string>(use_converter_cache) << '\n';
1547 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1548 if (ignore_system_lyxrc ||
1549 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1550 os << "\\use_converter_needauth_forbidden "
1551 << convert<string>(use_converter_needauth_forbidden) << '\n';
1556 case RC_USE_CONVERTER_NEEDAUTH:
1557 if (ignore_system_lyxrc ||
1558 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1559 os << "\\use_converter_needauth "
1560 << convert<string>(use_converter_needauth) << '\n';
1565 case RC_CONVERTER_CACHE_MAXAGE:
1566 if (ignore_system_lyxrc ||
1567 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1568 os << "\\converter_cache_maxage "
1569 << converter_cache_maxage << '\n';
1575 << "# SCREEN & FONTS SECTION ############################\n"
1579 if (ignore_system_lyxrc ||
1580 icon_set != system_lyxrc.icon_set) {
1581 os << "\\icon_set \"" << icon_set
1587 case RC_USE_SYSTEM_THEME_ICONS:
1588 if (ignore_system_lyxrc ||
1589 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1590 os << "\\use_system_theme_icons "
1591 << convert<string>(use_system_theme_icons)
1598 if (ignore_system_lyxrc ||
1599 dpi != system_lyxrc.dpi) {
1600 os << "\\screen_dpi " << dpi << '\n';
1605 case RC_SCREEN_ZOOM:
1606 if (ignore_system_lyxrc ||
1607 defaultZoom != system_lyxrc.defaultZoom) {
1608 os << "\\screen_zoom " << defaultZoom << '\n';
1613 case RC_GEOMETRY_SESSION:
1614 if (ignore_system_lyxrc ||
1615 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1616 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1622 case RC_CITATION_SEARCH:
1623 if (ignore_system_lyxrc ||
1624 citation_search != system_lyxrc.citation_search) {
1625 os << "# Set to true to use script to search\n"
1626 << "# locl disk for citation targets.\n"
1627 << "\\citation_search "
1628 << convert<string>(citation_search)
1634 case RC_CITATION_SEARCH_VIEW:
1635 if (ignore_system_lyxrc ||
1636 citation_search_view != system_lyxrc.citation_search_view) {
1637 os << "\\citation_search_view \""
1638 << citation_search_view << "\"\n";
1643 case RC_CITATION_SEARCH_PATTERN:
1644 if (ignore_system_lyxrc ||
1645 citation_search_pattern != system_lyxrc.citation_search_pattern) {
1646 os << "\\citation_search_pattern \""
1647 << citation_search_pattern << "\"\n";
1652 case RC_CT_ADDITIONS_UNDERLINED:
1653 if (ignore_system_lyxrc ||
1654 ct_additions_underlined
1655 != system_lyxrc.ct_additions_underlined) {
1656 os << "\\ct_additions_underlined "
1657 << convert<string>(ct_additions_underlined) << '\n';
1662 case RC_CT_MARKUP_COPIED:
1663 if (ignore_system_lyxrc ||
1665 != system_lyxrc.ct_markup_copied) {
1666 os << "\\ct_markup_copied "
1667 << convert<string>(ct_markup_copied) << '\n';
1672 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1673 if (ignore_system_lyxrc ||
1674 cursor_follows_scrollbar
1675 != system_lyxrc.cursor_follows_scrollbar) {
1676 os << "\\cursor_follows_scrollbar "
1677 << convert<string>(cursor_follows_scrollbar) << '\n';
1682 case RC_CURSOR_WIDTH:
1683 if (ignore_system_lyxrc ||
1685 != system_lyxrc.cursor_width) {
1686 os << "\\cursor_width "
1687 << cursor_width << '\n';
1692 case RC_SCROLL_BELOW_DOCUMENT:
1693 if (ignore_system_lyxrc ||
1694 scroll_below_document
1695 != system_lyxrc.scroll_below_document) {
1696 os << "\\scroll_below_document "
1697 << convert<string>(scroll_below_document) << '\n';
1702 case RC_PARAGRAPH_MARKERS:
1703 if (ignore_system_lyxrc ||
1705 != system_lyxrc.paragraph_markers) {
1706 os << "\\paragraph_markers "
1707 << convert<string>(paragraph_markers) << '\n';
1712 case RC_MAC_DONTSWAP_CTRL_META:
1713 if (ignore_system_lyxrc ||
1714 mac_dontswap_ctrl_meta
1715 != system_lyxrc.mac_dontswap_ctrl_meta) {
1716 os << "\\mac_dontswap_ctrl_meta "
1717 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1722 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1723 if (ignore_system_lyxrc ||
1724 mac_like_cursor_movement
1725 != system_lyxrc.mac_like_cursor_movement) {
1726 os << "\\mac_like_cursor_movement "
1727 << convert<string>(mac_like_cursor_movement) << '\n';
1732 case RC_MACRO_EDIT_STYLE:
1733 if (ignore_system_lyxrc ||
1735 != system_lyxrc.macro_edit_style) {
1736 os << "\\macro_edit_style ";
1737 switch (macro_edit_style) {
1738 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1739 case MACRO_EDIT_INLINE: os << "1\n"; break;
1740 case MACRO_EDIT_LIST: os << "2\n"; break;
1746 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1747 if (ignore_system_lyxrc ||
1748 dialogs_iconify_with_main
1749 != system_lyxrc.dialogs_iconify_with_main) {
1750 os << "\\dialogs_iconify_with_main "
1751 << convert<string>(dialogs_iconify_with_main) << '\n';
1756 case RC_SCREEN_FONT_ROMAN:
1757 if (ignore_system_lyxrc ||
1758 roman_font_name != system_lyxrc.roman_font_name) {
1759 os << "\\screen_font_roman \"" << roman_font_name
1765 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1766 if (ignore_system_lyxrc ||
1767 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1768 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1774 case RC_SCREEN_FONT_SANS:
1775 if (ignore_system_lyxrc ||
1776 sans_font_name != system_lyxrc.sans_font_name) {
1777 os << "\\screen_font_sans \"" << sans_font_name
1783 case RC_SCREEN_FONT_SANS_FOUNDRY:
1784 if (ignore_system_lyxrc ||
1785 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1786 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1792 case RC_SCREEN_FONT_TYPEWRITER:
1793 if (ignore_system_lyxrc ||
1794 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1795 os << "\\screen_font_typewriter \""
1796 << typewriter_font_name << "\"\n";
1801 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1802 if (ignore_system_lyxrc ||
1803 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1804 os << "\\screen_font_typewriter_foundry \""
1805 << typewriter_font_foundry << "\"\n";
1810 case RC_SCREEN_FONT_SCALABLE:
1811 if (ignore_system_lyxrc ||
1812 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1813 os << "\\screen_font_scalable "
1814 << convert<string>(use_scalable_fonts)
1820 case RC_SCREEN_FONT_SIZES:
1821 if (ignore_system_lyxrc ||
1822 font_sizes[TINY_SIZE]
1823 != system_lyxrc.font_sizes[TINY_SIZE] ||
1824 font_sizes[SCRIPT_SIZE]
1825 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1826 font_sizes[FOOTNOTE_SIZE]
1827 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1828 font_sizes[SMALL_SIZE]
1829 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1830 font_sizes[NORMAL_SIZE]
1831 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1832 font_sizes[LARGE_SIZE]
1833 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1834 font_sizes[LARGER_SIZE]
1835 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1836 font_sizes[LARGEST_SIZE]
1837 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1838 font_sizes[HUGE_SIZE]
1839 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1840 font_sizes[HUGER_SIZE]
1841 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1842 streamsize old_prec = os.precision();
1843 os.setf(ios::fixed);
1845 os << "\\screen_font_sizes"
1846 << ' ' << font_sizes[TINY_SIZE]
1847 << ' ' << font_sizes[SCRIPT_SIZE]
1848 << ' ' << font_sizes[FOOTNOTE_SIZE]
1849 << ' ' << font_sizes[SMALL_SIZE]
1850 << ' ' << font_sizes[NORMAL_SIZE]
1851 << ' ' << font_sizes[LARGE_SIZE]
1852 << ' ' << font_sizes[LARGER_SIZE]
1853 << ' ' << font_sizes[LARGEST_SIZE]
1854 << ' ' << font_sizes[HUGE_SIZE]
1855 << ' ' << font_sizes[HUGER_SIZE]
1857 os.precision(old_prec);
1858 os.unsetf(ios::fixed);
1863 case RC_FULL_SCREEN_LIMIT:
1864 if (ignore_system_lyxrc ||
1865 full_screen_limit != system_lyxrc.full_screen_limit) {
1866 os << "\\fullscreen_limit "
1867 << convert<string>(full_screen_limit)
1873 case RC_FULL_SCREEN_TOOLBARS:
1874 if (ignore_system_lyxrc ||
1875 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1876 os << "\\fullscreen_toolbars "
1877 << convert<string>(full_screen_toolbars)
1883 case RC_FULL_SCREEN_SCROLLBAR:
1884 if (ignore_system_lyxrc ||
1885 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1886 os << "\\fullscreen_scrollbar "
1887 << convert<string>(full_screen_scrollbar)
1893 case RC_FULL_SCREEN_STATUSBAR:
1894 if (ignore_system_lyxrc ||
1895 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1896 os << "\\fullscreen_statusbar "
1897 << convert<string>(full_screen_statusbar)
1903 case RC_FULL_SCREEN_TABBAR:
1904 if (ignore_system_lyxrc ||
1905 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1906 os << "\\fullscreen_tabbar "
1907 << convert<string>(full_screen_tabbar)
1913 case RC_FULL_SCREEN_MENUBAR:
1914 if (ignore_system_lyxrc ||
1915 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1916 os << "\\fullscreen_menubar "
1917 << convert<string>(full_screen_menubar)
1923 case RC_FULL_SCREEN_WIDTH:
1924 if (ignore_system_lyxrc ||
1925 full_screen_width != system_lyxrc.full_screen_width) {
1926 os << "\\fullscreen_width "
1927 << convert<string>(full_screen_width)
1933 case RC_OPEN_BUFFERS_IN_TABS:
1934 if (ignore_system_lyxrc ||
1935 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1936 os << "\\open_buffers_in_tabs "
1937 << convert<string>(open_buffers_in_tabs)
1943 case RC_SINGLE_CLOSE_TAB_BUTTON:
1944 if (ignore_system_lyxrc ||
1945 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1946 os << "\\single_close_tab_button "
1947 << convert<string>(single_close_tab_button)
1953 case RC_SINGLE_INSTANCE:
1954 if (ignore_system_lyxrc ||
1955 single_instance != system_lyxrc.single_instance) {
1956 os << "\\single_instance "
1957 << convert<string>(single_instance)
1963 case RC_FORWARD_SEARCH_DVI:
1964 if (ignore_system_lyxrc ||
1965 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1966 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1971 case RC_FORWARD_SEARCH_PDF:
1972 if (ignore_system_lyxrc ||
1973 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1974 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1980 << "# COLOR SECTION ###################################\n"
1985 for (int i = 0; i < Color_ignore; ++i) {
1986 ColorCode lc = static_cast<ColorCode>(i);
1987 string const col = lcolor.getX11HexName(lc);
1988 if (ignore_system_lyxrc
1989 || col != system_lcolor.getX11HexName(lc)) {
1990 os << "\\set_color \""
1991 << lcolor.getLyXName(lc) << "\" \""
1999 << "# PRINTER SECTION ###################################\n"
2003 case RC_PRINTLANDSCAPEFLAG:
2004 if (ignore_system_lyxrc ||
2005 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2006 os << "\\print_landscape_flag \"" << print_landscape_flag
2012 case RC_PRINTPAPERFLAG:
2013 if (ignore_system_lyxrc ||
2014 print_paper_flag != system_lyxrc.print_paper_flag) {
2015 os << "\\print_paper_flag \"" << print_paper_flag
2021 case RC_PRINTPAPERDIMENSIONFLAG:
2022 if (ignore_system_lyxrc ||
2023 print_paper_dimension_flag
2024 != system_lyxrc.print_paper_dimension_flag) {
2025 os << "\\print_paper_dimension_flag \""
2026 << print_paper_dimension_flag << "\"\n";
2032 << "# TEX SECTION #######################################\n"
2036 case RC_TEXINPUTS_PREFIX:
2037 if (ignore_system_lyxrc ||
2038 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2039 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2045 << "# FILE SECTION ######################################\n"
2048 case RC_DOCUMENTPATH:
2049 if (ignore_system_lyxrc ||
2050 document_path != system_lyxrc.document_path) {
2051 string const path = os::external_path(document_path);
2052 os << "\\document_path \"" << path << "\"\n";
2057 case RC_USELASTFILEPOS:
2058 if (ignore_system_lyxrc ||
2059 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2060 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2066 case RC_LOADSESSION:
2067 if (ignore_system_lyxrc ||
2068 load_session != system_lyxrc.load_session) {
2069 os << "\\load_session " << convert<string>(load_session)
2075 case RC_MOUSE_WHEEL_SPEED:
2076 if (ignore_system_lyxrc ||
2077 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2078 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2083 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2084 if (ignore_system_lyxrc ||
2085 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2086 os << "\\mouse_middlebutton_paste "
2087 << convert<string>(mouse_middlebutton_paste) << '\n';
2092 case RC_COMPLETION_INLINE_DELAY:
2093 if (ignore_system_lyxrc ||
2094 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2095 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2100 case RC_COMPLETION_INLINE_MATH:
2101 if (ignore_system_lyxrc ||
2102 completion_inline_math != system_lyxrc.completion_inline_math) {
2103 os << "\\completion_inline_math "
2104 << convert<string>(completion_inline_math) << '\n';
2109 case RC_COMPLETION_INLINE_TEXT:
2110 if (ignore_system_lyxrc ||
2111 completion_inline_text != system_lyxrc.completion_inline_text) {
2112 os << "\\completion_inline_text "
2113 << convert<string>(completion_inline_text) << '\n';
2118 case RC_COMPLETION_INLINE_DOTS:
2119 if (ignore_system_lyxrc ||
2120 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2121 os << "\\completion_inline_dots "
2122 << convert<string>(completion_inline_dots) << '\n';
2127 case RC_AUTOCORRECTION_MATH:
2128 if (ignore_system_lyxrc ||
2129 autocorrection_math != system_lyxrc.autocorrection_math) {
2130 os << "\\autocorrection_math "
2131 << convert<string>(autocorrection_math) << '\n';
2136 case RC_COMPLETION_POPUP_DELAY:
2137 if (ignore_system_lyxrc ||
2138 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2139 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2144 case RC_COMPLETION_POPUP_MATH:
2145 if (ignore_system_lyxrc ||
2146 completion_popup_math != system_lyxrc.completion_popup_math) {
2147 os << "\\completion_popup_math "
2148 << convert<string>(completion_popup_math) << '\n';
2153 case RC_COMPLETION_POPUP_TEXT:
2154 if (ignore_system_lyxrc ||
2155 completion_popup_text != system_lyxrc.completion_popup_text) {
2156 os << "\\completion_popup_text "
2157 << convert<string>(completion_popup_text) << '\n';
2162 case RC_COMPLETION_CURSOR_TEXT:
2163 if (ignore_system_lyxrc ||
2164 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2165 os << "\\completion_cursor_text "
2166 << convert<string>(completion_cursor_text) << '\n';
2171 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2172 if (ignore_system_lyxrc ||
2173 completion_popup_after_complete
2174 != system_lyxrc.completion_popup_after_complete) {
2175 os << "\\completion_popup_after_complete "
2176 << convert<string>(completion_popup_after_complete) << '\n';
2181 case RC_COMPLETION_MINLENGTH:
2182 if (ignore_system_lyxrc ||
2183 completion_minlength != system_lyxrc.completion_minlength) {
2184 os << "\\completion_minlength " << convert<string>(completion_minlength)
2190 case RC_NUMLASTFILES:
2191 if (ignore_system_lyxrc ||
2192 num_lastfiles != system_lyxrc.num_lastfiles) {
2193 os << "\\num_lastfiles " << num_lastfiles << '\n';
2198 case RC_CHECKLASTFILES:
2199 if (ignore_system_lyxrc ||
2200 check_lastfiles != system_lyxrc.check_lastfiles) {
2201 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2207 case RC_EXAMPLEPATH:
2208 if (ignore_system_lyxrc ||
2209 example_path != system_lyxrc.example_path) {
2210 string const path = os::external_path(example_path);
2211 os << "\\example_path \"" << path << "\"\n";
2216 case RC_TEMPLATEPATH:
2217 if (ignore_system_lyxrc ||
2218 template_path != system_lyxrc.template_path) {
2219 string const path = os::external_path(template_path);
2220 os << "\\template_path \"" << path << "\"\n";
2225 case RC_TEMPDIRPATH:
2226 if (ignore_system_lyxrc ||
2227 tempdir_path != system_lyxrc.tempdir_path) {
2228 string const path = os::external_path(tempdir_path);
2229 os << "\\tempdir_path \"" << path << "\"\n";
2234 case RC_THESAURUSDIRPATH:
2235 if (ignore_system_lyxrc ||
2236 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2237 string const path = os::external_path(thesaurusdir_path);
2238 os << "\\thesaurusdir_path \"" << path << "\"\n";
2243 case RC_HUNSPELLDIR_PATH:
2244 if (ignore_system_lyxrc ||
2245 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2246 string const path = os::external_path(hunspelldir_path);
2247 os << "\\hunspelldir_path \"" << path << "\"\n";
2252 case RC_PLAINTEXT_LINELEN:
2253 if (ignore_system_lyxrc ||
2254 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2255 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2260 case RC_MAKE_BACKUP:
2261 if (ignore_system_lyxrc ||
2262 make_backup != system_lyxrc.make_backup) {
2263 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2268 case RC_SAVE_COMPRESSED:
2269 if (ignore_system_lyxrc ||
2270 save_compressed != system_lyxrc.save_compressed) {
2271 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2276 case RC_SAVE_ORIGIN:
2277 if (ignore_system_lyxrc ||
2278 save_origin != system_lyxrc.save_origin) {
2279 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2284 case RC_BACKUPDIR_PATH:
2285 if (ignore_system_lyxrc ||
2286 backupdir_path != system_lyxrc.backupdir_path) {
2287 string const path = os::external_path(backupdir_path);
2288 os << "\\backupdir_path \"" << path << "\"\n";
2294 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2298 << "# SPELLCHECKER SECTION ##############################\n"
2302 case RC_ACCEPT_COMPOUND:
2303 if (ignore_system_lyxrc ||
2304 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2305 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2312 if (ignore_system_lyxrc ||
2313 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2314 os << "\\alternate_language \"" << spellchecker_alt_lang
2321 if (ignore_system_lyxrc ||
2322 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2323 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2328 case RC_USE_NATIVE_FILEDIALOG:
2329 if (ignore_system_lyxrc ||
2330 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2331 os << "\\use_native_filedialog "
2332 << convert<string>(use_native_filedialog)
2338 case RC_USE_SYSTEM_COLORS:
2339 if (ignore_system_lyxrc ||
2340 use_system_colors != system_lyxrc.use_system_colors) {
2341 os << "\\use_system_colors "
2342 << convert<string>(use_system_colors)
2348 case RC_USE_TOOLTIP:
2349 if (ignore_system_lyxrc ||
2350 use_tooltip != system_lyxrc.use_tooltip) {
2351 os << "\\use_tooltip "
2352 << convert<string>(use_tooltip)
2360 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2364 case RC_DEFAULT_DECIMAL_SEP:
2365 if (ignore_system_lyxrc ||
2366 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2367 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2372 case RC_DEFAULT_LENGTH_UNIT:
2373 if (ignore_system_lyxrc ||
2374 default_length_unit != system_lyxrc.default_length_unit) {
2375 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2380 case RC_SPELLCHECKER:
2381 if (ignore_system_lyxrc ||
2382 spellchecker != system_lyxrc.spellchecker) {
2383 os << "\\spellchecker " << spellchecker << '\n';
2388 case RC_SPELLCHECK_CONTINUOUSLY:
2389 if (ignore_system_lyxrc ||
2390 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2391 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2397 case RC_SPELLCHECK_NOTES:
2398 if (ignore_system_lyxrc ||
2399 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2400 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2406 case RC_VISUAL_CURSOR:
2407 if (ignore_system_lyxrc ||
2408 visual_cursor != system_lyxrc.visual_cursor) {
2409 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2414 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2415 if (ignore_system_lyxrc ||
2416 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2417 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2418 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2423 case RC_LANGUAGE_CUSTOM_PACKAGE:
2424 if (ignore_system_lyxrc ||
2425 language_custom_package != system_lyxrc.language_custom_package) {
2426 os << "\\language_custom_package \"" << language_custom_package
2432 case RC_LANGUAGE_GLOBAL_OPTIONS:
2433 if (ignore_system_lyxrc ||
2434 language_global_options
2435 != system_lyxrc.language_global_options) {
2436 os << "\\language_global_options \""
2437 << convert<string>(language_global_options)
2443 case RC_LANGUAGE_PACKAGE_SELECTION:
2444 if (ignore_system_lyxrc ||
2445 language_package_selection != system_lyxrc.language_package_selection) {
2446 os << "\\language_package_selection ";
2447 switch (language_package_selection) {
2465 case RC_LANGUAGE_COMMAND_BEGIN:
2466 if (ignore_system_lyxrc ||
2467 language_command_begin
2468 != system_lyxrc.language_command_begin) {
2469 os << "\\language_command_begin \""
2470 << language_command_begin
2476 case RC_LANGUAGE_COMMAND_END:
2477 if (ignore_system_lyxrc ||
2478 language_command_end
2479 != system_lyxrc.language_command_end) {
2480 os << "\\language_command_end \"" << language_command_end
2486 case RC_LANGUAGE_COMMAND_LOCAL:
2487 if (ignore_system_lyxrc ||
2488 language_command_local
2489 != system_lyxrc.language_command_local) {
2490 os << "\\language_command_local \""
2491 << language_command_local
2497 case RC_LANGUAGE_AUTO_BEGIN:
2498 if (ignore_system_lyxrc ||
2499 language_auto_begin != system_lyxrc.language_auto_begin) {
2500 os << "\\language_auto_begin "
2501 << convert<string>(language_auto_begin) << '\n';
2506 case RC_LANGUAGE_AUTO_END:
2507 if (ignore_system_lyxrc ||
2508 language_auto_end != system_lyxrc.language_auto_end) {
2509 os << "\\language_auto_end "
2510 << convert<string>(language_auto_end) << '\n';
2515 case RC_MARK_FOREIGN_LANGUAGE:
2516 if (ignore_system_lyxrc ||
2517 mark_foreign_language
2518 != system_lyxrc.mark_foreign_language) {
2519 os << "\\mark_foreign_language " <<
2520 convert<string>(mark_foreign_language) << '\n';
2523 case RC_RESPECT_OS_KBD_LANGUAGE:
2524 if (ignore_system_lyxrc ||
2525 respect_os_kbd_language
2526 != system_lyxrc.respect_os_kbd_language) {
2527 os << "\\respect_os_kbd_language " <<
2528 convert<string>(respect_os_kbd_language) << '\n';
2535 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2539 case RC_AUTO_NUMBER:
2540 if (ignore_system_lyxrc ||
2541 auto_number != system_lyxrc.auto_number) {
2542 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2547 case RC_GUI_LANGUAGE:
2548 if (ignore_system_lyxrc ||
2549 gui_language != system_lyxrc.gui_language) {
2550 os << "\\gui_language " << gui_language << '\n';
2555 case RC_EXPORT_OVERWRITE:
2556 if (ignore_system_lyxrc ||
2557 export_overwrite != system_lyxrc.export_overwrite) {
2559 switch (export_overwrite) {
2570 os << "\\export_overwrite " << status << '\n';
2575 case RC_SCROLL_WHEEL_ZOOM:
2576 if (ignore_system_lyxrc ||
2577 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2579 switch (scroll_wheel_zoom) {
2580 case SCROLL_WHEEL_ZOOM_OFF:
2583 case SCROLL_WHEEL_ZOOM_CTRL:
2586 case SCROLL_WHEEL_ZOOM_SHIFT:
2589 case SCROLL_WHEEL_ZOOM_ALT:
2593 os << "\\scroll_wheel_zoom " << status << '\n';
2599 << "# FORMATS SECTION ##########################\n"
2604 // New/modified formats
2605 for (Formats::const_iterator cit = theFormats().begin();
2606 cit != theFormats().end(); ++cit) {
2607 Format const * format =
2608 theSystemFormats().getFormat(cit->name());
2610 format->extensions() != cit->extensions() ||
2611 format->prettyname() != cit->prettyname() ||
2612 format->shortcut() != cit->shortcut() ||
2613 format->viewer() != cit->viewer() ||
2614 format->editor() != cit->editor() ||
2615 format->documentFormat() != cit->documentFormat() ||
2616 format->vectorFormat() != cit->vectorFormat() ||
2617 format->inExportMenu() != cit->inExportMenu() ||
2618 format->noMenu() != cit->noMenu() ||
2619 format->mime() != cit->mime()) {
2620 os << "\\format \"" << cit->name() << "\" \""
2621 << cit->extensions() << "\" \""
2622 << to_utf8(cit->prettyname()) << "\" \""
2623 << cit->shortcut() << "\" \""
2624 << escapeCommand(cit->viewer()) << "\" \""
2625 << escapeCommand(cit->editor()) << "\" \"";
2626 vector<string> flags;
2627 if (cit->documentFormat())
2628 flags.push_back("document");
2629 if (cit->vectorFormat())
2630 flags.push_back("vector");
2631 if (cit->zippedNative())
2632 flags.push_back("zipped=native");
2633 if (cit->inExportMenu())
2634 flags.push_back("menu=export");
2636 os << getStringFromVector(flags);
2637 os << "\" \"" << cit->mime() << "\"\n";
2641 // Look for deleted formats
2642 for (Formats::const_iterator cit = theSystemFormats().begin();
2643 cit != theSystemFormats().end(); ++cit)
2644 if (!theFormats().getFormat(cit->name()))
2645 os << "\\format \"" << cit->name()
2646 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2650 case RC_VIEWER_ALTERNATIVES: {
2651 Alternatives::const_iterator it = viewer_alternatives.begin();
2652 Alternatives::const_iterator const en = viewer_alternatives.end();
2653 Alternatives::const_iterator const sysend =
2654 system_lyxrc.viewer_alternatives.end();
2655 for (; it != en; ++it) {
2656 string const & fmt = it->first;
2657 CommandSet const & cmd = it->second;
2658 CommandSet::const_iterator sit = cmd.begin();
2659 CommandSet::const_iterator const sen = cmd.end();
2660 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2661 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2662 system_lyxrc.viewer_alternatives.find(fmt);
2663 for (; sit != sen; ++sit) {
2664 string const & cmd = *sit;
2665 if (ignore_system_lyxrc
2666 || sysfmt == sysend // format not found
2667 || sysfmt->second.count(cmd) == 0 // this command not found
2669 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2676 case RC_EDITOR_ALTERNATIVES: {
2677 Alternatives::const_iterator it = editor_alternatives.begin();
2678 Alternatives::const_iterator const en = editor_alternatives.end();
2679 Alternatives::const_iterator const sysend =
2680 system_lyxrc.editor_alternatives.end();
2681 for (; it != en; ++it) {
2682 string const & fmt = it->first;
2683 CommandSet const & cmd = it->second;
2684 CommandSet::const_iterator sit = cmd.begin();
2685 CommandSet::const_iterator const sen = cmd.end();
2686 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2687 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2688 system_lyxrc.editor_alternatives.find(fmt);
2689 for (; sit != sen; ++sit) {
2690 string const & cmd = *sit;
2691 if (ignore_system_lyxrc
2692 || sysfmt == sysend // format not found
2693 || sysfmt->second.count(cmd) == 0 // this command not found
2695 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2702 case RC_DEFAULT_OTF_VIEW_FORMAT:
2703 if ((ignore_system_lyxrc ||
2704 default_otf_view_format != system_lyxrc.default_otf_view_format)
2705 && !default_otf_view_format.empty()) {
2706 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2711 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2712 if ((ignore_system_lyxrc ||
2713 default_platex_view_format != system_lyxrc.default_platex_view_format)
2714 && !default_platex_view_format.empty()) {
2715 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2720 case RC_DEFAULT_VIEW_FORMAT:
2721 if (ignore_system_lyxrc ||
2722 default_view_format != system_lyxrc.default_view_format) {
2723 os << "\\default_view_format " << default_view_format << '\n';
2734 << "# CONVERTERS SECTION ##########################\n"
2739 // Look for new converters
2740 for (Converters::const_iterator cit = theConverters().begin();
2741 cit != theConverters().end(); ++cit) {
2742 Converter const * converter =
2743 theSystemConverters().getConverter(cit->from(),
2746 converter->command() != cit->command() ||
2747 converter->flags() != cit->flags())
2748 os << "\\converter \"" << cit->from() << "\" \""
2749 << cit->to() << "\" \""
2750 << escapeCommand(cit->command()) << "\" \""
2751 << cit->flags() << "\"\n";
2754 // New/modifed converters
2755 for (Converters::const_iterator cit = theSystemConverters().begin();
2756 cit != theSystemConverters().end(); ++cit)
2757 if (!theConverters().getConverter(cit->from(), cit->to()))
2758 os << "\\converter \"" << cit->from()
2759 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2766 << "# COPIERS SECTION ##########################\n"
2769 // Look for new movers
2770 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2771 Movers::const_iterator const sysend = theSystemMovers().end();
2772 Movers::const_iterator it = theMovers().begin();
2773 Movers::const_iterator end = theMovers().end();
2775 for (; it != end; ++it) {
2776 Movers::const_iterator const sysit =
2777 find_if(sysbegin, sysend, SameMover(*it));
2778 if (sysit == sysend) {
2779 string const & fmt = it->first;
2780 string const & command =
2781 it->second.command();
2783 os << "\\copier " << fmt
2784 << " \"" << escapeCommand(command) << "\"\n";
2790 // We don't actually delete SpecialisedMover(s) from the
2791 // map, just clear their 'command', so there's no need
2792 // to test for anything else.
2799 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2801 // Why the switch you might ask. It is a trick to ensure that all
2802 // the elements in the LyXRCTags enum is handled. As you can see
2803 // there are no breaks at all. So it is just a huge fall-through.
2804 // The nice thing is that we will get a warning from the compiler
2805 // if we forget an element.
2806 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2808 case LyXRC::RC_LAST:
2809 case LyXRC::RC_ACCEPT_COMPOUND:
2810 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2811 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2813 case LyXRC::RC_ALT_LANG:
2814 case LyXRC::RC_PLAINTEXT_LINELEN:
2815 case LyXRC::RC_AUTOCORRECTION_MATH:
2816 case LyXRC::RC_AUTOREGIONDELETE:
2817 case LyXRC::RC_AUTORESET_OPTIONS:
2818 case LyXRC::RC_AUTOSAVE:
2819 case LyXRC::RC_AUTO_NUMBER:
2820 case LyXRC::RC_BACKUPDIR_PATH:
2821 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2822 case LyXRC::RC_BIBTEX_COMMAND:
2823 case LyXRC::RC_BINDFILE:
2824 case LyXRC::RC_CITATION_SEARCH:
2825 case LyXRC::RC_CITATION_SEARCH_PATTERN:
2826 case LyXRC::RC_CITATION_SEARCH_VIEW:
2827 case LyXRC::RC_CHECKLASTFILES:
2828 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2829 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2830 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2831 case LyXRC::RC_COMPLETION_INLINE_MATH:
2832 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2833 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2834 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2835 case LyXRC::RC_COMPLETION_POPUP_MATH:
2836 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2837 case LyXRC::RC_COMPLETION_MINLENGTH:
2838 case LyXRC::RC_USELASTFILEPOS:
2839 case LyXRC::RC_LOADSESSION:
2840 case LyXRC::RC_CHKTEX_COMMAND:
2841 case LyXRC::RC_CONVERTER:
2842 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2843 case LyXRC::RC_COPIER:
2844 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2845 case LyXRC::RC_CT_MARKUP_COPIED:
2846 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2847 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2848 case LyXRC::RC_GUI_LANGUAGE:
2849 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2850 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2851 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2852 case LyXRC::RC_DEFFILE:
2853 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2854 case LyXRC::RC_DISPLAY_GRAPHICS:
2855 case LyXRC::RC_DOCUMENTPATH:
2856 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2857 FileName path(lyxrc_new.document_path);
2858 if (path.exists() && path.isDirectory())
2859 package().document_dir() = FileName(lyxrc.document_path);
2862 case LyXRC::RC_EDITOR_ALTERNATIVES:
2863 case LyXRC::RC_ESC_CHARS:
2864 case LyXRC::RC_EXAMPLEPATH:
2865 case LyXRC::RC_FILEFORMAT:
2866 case LyXRC::RC_GROUP_LAYOUTS:
2867 case LyXRC::RC_HUNSPELLDIR_PATH:
2868 case LyXRC::RC_ICON_SET:
2869 case LyXRC::RC_INDEX_ALTERNATIVES:
2870 case LyXRC::RC_INDEX_COMMAND:
2871 case LyXRC::RC_JBIBTEX_COMMAND:
2872 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2873 case LyXRC::RC_JINDEX_COMMAND:
2874 case LyXRC::RC_NOMENCL_COMMAND:
2875 case LyXRC::RC_PYGMENTIZE_COMMAND:
2876 case LyXRC::RC_INPUT:
2877 case LyXRC::RC_KBMAP:
2878 case LyXRC::RC_KBMAP_PRIMARY:
2879 case LyXRC::RC_KBMAP_SECONDARY:
2880 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2881 case LyXRC::RC_LANGUAGE_AUTO_END:
2882 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2883 case LyXRC::RC_LANGUAGE_COMMAND_END:
2884 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2885 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2886 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2887 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2888 case LyXRC::RC_LYXRCFORMAT:
2889 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2890 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2891 case LyXRC::RC_MACRO_EDIT_STYLE:
2892 case LyXRC::RC_MAKE_BACKUP:
2893 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2894 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2895 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2896 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2897 case LyXRC::RC_NUMLASTFILES:
2898 case LyXRC::RC_PARAGRAPH_MARKERS:
2899 case LyXRC::RC_PATH_PREFIX:
2900 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2901 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2902 // Resets python path
2903 support::os::python(true);
2906 case LyXRC::RC_PREVIEW:
2907 if (lyxrc_orig.preview != lyxrc_new.preview) {
2908 // Update all previews of all documents.
2909 /* FIXME: this can be very expensive. It would be cheaper
2910 * to kill all existing previews and update visible
2912 theBufferList().updatePreviews();
2915 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2916 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2917 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2918 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2919 case LyXRC::RC_PRINTPAPERFLAG:
2920 case LyXRC::RC_SAVE_COMPRESSED:
2921 case LyXRC::RC_SAVE_ORIGIN:
2922 case LyXRC::RC_SCREEN_DPI:
2924 case LyXRC::RC_SCREEN_FONT_ROMAN:
2925 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2926 case LyXRC::RC_SCREEN_FONT_SANS:
2927 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2928 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2929 case LyXRC::RC_SCREEN_FONT_SIZES:
2930 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2931 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2932 case LyXRC::RC_SCREEN_ZOOM:
2933 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2934 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2935 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2936 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2937 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2938 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2939 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2940 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2941 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2942 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2945 case LyXRC::RC_GEOMETRY_SESSION:
2946 case LyXRC::RC_SERVERPIPE:
2947 case LyXRC::RC_SET_COLOR:
2948 case LyXRC::RC_SHOW_BANNER:
2949 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2950 case LyXRC::RC_SPELLCHECKER:
2951 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2954 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2955 case LyXRC::RC_SPELLCHECK_NOTES:
2956 case LyXRC::RC_SPLITINDEX_COMMAND:
2957 case LyXRC::RC_TEMPDIRPATH:
2958 case LyXRC::RC_TEMPLATEPATH:
2959 case LyXRC::RC_TEX_ALLOWS_SPACES:
2960 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2961 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2962 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2965 case LyXRC::RC_TEXINPUTS_PREFIX:
2966 case LyXRC::RC_THESAURUSDIRPATH:
2967 case LyXRC::RC_UIFILE:
2968 case LyXRC::RC_USER_EMAIL:
2969 case LyXRC::RC_USER_INITIALS:
2970 case LyXRC::RC_USER_NAME:
2971 case LyXRC::RC_USE_CONVERTER_CACHE:
2972 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2973 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2974 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2975 case LyXRC::RC_USE_SYSTEM_COLORS:
2976 case LyXRC::RC_USE_TOOLTIP:
2977 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2978 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2979 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2980 case LyXRC::RC_SINGLE_INSTANCE:
2981 case LyXRC::RC_SORT_LAYOUTS:
2982 case LyXRC::RC_FULL_SCREEN_LIMIT:
2983 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2984 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2985 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2986 case LyXRC::RC_FULL_SCREEN_TABBAR:
2987 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2988 case LyXRC::RC_FULL_SCREEN_WIDTH:
2989 case LyXRC::RC_VISUAL_CURSOR:
2990 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2991 case LyXRC::RC_VIEWER:
2992 case LyXRC::RC_VIEWER_ALTERNATIVES:
2993 case LyXRC::RC_FORWARD_SEARCH_DVI:
2994 case LyXRC::RC_FORWARD_SEARCH_PDF:
2995 case LyXRC::RC_EXPORT_OVERWRITE:
2996 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2997 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2998 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2999 case LyXRC::RC_CURSOR_WIDTH:
3005 set<string> LyXRC::getRCs()
3008 for (int i = 0; i != lyxrcCount; ++i)
3009 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
3015 string const LyXRC::getDescription(LyXRCTags tag)
3020 case RC_ACCEPT_COMPOUND:
3021 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3025 str = _("Specify an alternate language. The default is to use the language of the document.");
3028 case RC_PLAINTEXT_LINELEN:
3029 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.");
3032 case RC_AUTOREGIONDELETE:
3033 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3036 case RC_AUTORESET_OPTIONS:
3037 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3041 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3044 case RC_AUTO_NUMBER:
3047 case RC_BACKUPDIR_PATH:
3048 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.");
3051 case RC_BIBTEX_COMMAND:
3052 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3055 case RC_JBIBTEX_COMMAND:
3056 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3060 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3063 case RC_CHECKLASTFILES:
3064 str = _("Select to check whether the lastfiles still exist.");
3067 case RC_CHKTEX_COMMAND:
3068 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3074 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3075 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3078 case RC_CONVERTER_NEEDAUTH:
3079 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3085 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3086 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.");
3089 case RC_CURSOR_WIDTH:
3090 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3093 case RC_SCROLL_BELOW_DOCUMENT:
3094 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");
3097 case RC_MAC_DONTSWAP_CTRL_META:
3098 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3101 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3102 str = _("Use the Mac OS X conventions for cursor movement");
3105 case RC_SHOW_MACRO_LABEL:
3106 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3110 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3113 case RC_DEFAULT_OTF_VIEW_FORMAT:
3114 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3117 case RC_DEFAULT_VIEW_FORMAT:
3118 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3121 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3122 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3125 case RC_DISPLAY_GRAPHICS:
3126 str = _("Select how LyX will display any graphics.");
3129 case RC_DOCUMENTPATH:
3130 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3134 str = _("Specify additional chars that can be part of a word.");
3137 case RC_EXAMPLEPATH:
3138 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3144 case RC_INDEX_COMMAND:
3145 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\".");
3148 case RC_JINDEX_COMMAND:
3149 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3152 case RC_NOMENCL_COMMAND:
3153 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3156 case RC_PYGMENTIZE_COMMAND:
3157 str = _("The command to run the python pygments syntax highlighter.");
3164 case RC_KBMAP_PRIMARY:
3165 case RC_KBMAP_SECONDARY:
3166 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.");
3169 case RC_LANGUAGE_AUTO_BEGIN:
3170 str = _("Select if a language switching command is needed at the beginning of the document.");
3173 case RC_LANGUAGE_AUTO_END:
3174 str = _("Select if a language switching command is needed at the end of the document.");
3177 case RC_LANGUAGE_COMMAND_BEGIN:
3178 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.");
3181 case RC_LANGUAGE_COMMAND_END:
3182 str = _("The LaTeX command for changing back to the language of the document.");
3185 case RC_LANGUAGE_COMMAND_LOCAL:
3186 str = _("The LaTeX command for local changing of the language.");
3189 case RC_LANGUAGE_GLOBAL_OPTIONS:
3190 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3193 case RC_LANGUAGE_CUSTOM_PACKAGE:
3194 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3197 case RC_LANGUAGE_PACKAGE_SELECTION:
3198 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3201 case RC_USELASTFILEPOS:
3202 str = _("De-select if you do not want LyX to scroll to saved position.");
3205 case RC_LOADSESSION:
3206 str = _("De-select to prevent loading files opened from the last LyX session.");
3209 case RC_MAKE_BACKUP:
3210 str = _("De-select if you don't want LyX to create backup files.");
3213 case RC_MARK_FOREIGN_LANGUAGE:
3214 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3217 case RC_RESPECT_OS_KBD_LANGUAGE:
3218 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3221 case RC_MOUSE_WHEEL_SPEED:
3222 str = _("The scrolling speed of the mouse wheel.");
3225 case RC_COMPLETION_POPUP_DELAY:
3226 str = _("The completion popup delay.");
3229 case RC_COMPLETION_POPUP_MATH:
3230 str = _("Select to display the completion popup in math mode.");
3233 case RC_COMPLETION_POPUP_TEXT:
3234 str = _("Select to display the completion popup in text mode.");
3237 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3238 str = _("Show the completion popup without delay after non-unique completion attempt.");
3241 case RC_COMPLETION_POPUP_TEXT:
3242 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3245 case RC_COMPLETION_POPUP_DELAY:
3246 str = _("The inline completion delay.");
3249 case RC_COMPLETION_INLINE_MATH:
3250 str = _("Select to display the inline completion in math mode.");
3253 case RC_COMPLETION_INLINE_TEXT:
3254 str = _("Select to display the inline completion in text mode.");
3257 case RC_COMPLETION_INLINE_DOTS:
3258 str = _("Use \"...\" to shorten long completions.");
3261 case RC_AUTOCORRECTION_MATH:
3262 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3265 case RC_NUMLASTFILES:
3266 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3270 case RC_PATH_PREFIX:
3271 str = _("Specify those directories which should be "
3272 "prepended to the PATH environment variable.\n"
3273 "Use the OS native format.");
3277 str = _("Shows a typeset preview of things such as math");
3280 case RC_PREVIEW_HASHED_LABELS:
3281 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3284 case RC_PREVIEW_SCALE_FACTOR:
3285 str = _("Scale the preview size to suit.");
3288 case RC_PRINTLANDSCAPEFLAG:
3289 str = _("The option to print out in landscape.");
3292 case RC_PRINTPAPERDIMENSIONFLAG:
3293 str = _("Option to specify the dimensions of the print paper.");
3296 case RC_PRINTPAPERFLAG:
3297 str = _("The option to specify paper type.");
3300 case RC_VISUAL_CURSOR:
3301 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3304 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3305 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).");
3309 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3312 case RC_SCREEN_FONT_ROMAN:
3313 case RC_SCREEN_FONT_SANS:
3314 case RC_SCREEN_FONT_TYPEWRITER:
3315 str = _("The screen fonts used to display the text while editing.");
3318 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3319 case RC_SCREEN_FONT_SANS_FOUNDRY:
3320 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3323 case RC_SCREEN_FONT_SCALABLE:
3324 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.");
3327 case RC_SCREEN_FONT_SIZES:
3328 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3331 case RC_SCREEN_ZOOM:
3332 //xgettext:no-c-format
3333 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3336 case RC_GEOMETRY_SESSION:
3337 str = _("Allow session manager to save and restore windows geometry.");
3341 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3347 case RC_SHOW_BANNER:
3348 str = _("De-select if you don't want the startup banner.");
3351 case RC_TEMPDIRPATH:
3352 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3355 case RC_THESAURUSDIRPATH:
3356 str = _("This is the place where the files of the thesaurus library reside.");
3359 case RC_TEMPLATEPATH:
3360 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3363 case RC_TEX_ALLOWS_SPACES:
3366 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3369 case RC_TEXINPUTS_PREFIX:
3370 str = _("Specify those directories which should be "
3371 "prepended to the TEXINPUTS environment variable.\n"
3372 "A '.' represents the current document directory. "
3373 "Use the OS native format.");
3377 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3386 case RC_USE_USE_SYSTEM_COLORS:
3387 str = _("Enable use the system colors for some things like main window background and selection.");
3390 case RC_USE_TOOLTIP:
3391 str = _("Enable the automatic appearance of tool tips in the work area.");
3394 case RC_VIEWDVI_PAPEROPTION:
3395 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3410 // The global instance
3413 // The global copy of the system lyxrc entries (everything except preferences)