3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
21 #include "BufferList.h"
23 #include "Converter.h"
24 #include "FontEnums.h"
27 #include "FuncRequest.h"
32 #include "SpellChecker.h"
35 #include "graphics/GraphicsTypes.h"
37 #include "support/convert.h"
38 #include "support/debug.h"
39 #include "support/environment.h"
40 #include "support/FileName.h"
41 #include "support/filetools.h"
42 #include "support/gettext.h"
43 #include "support/lstrings.h"
44 #include "support/os.h"
45 #include "support/Package.h"
46 #include "support/TempFile.h"
47 #include "support/userinfo.h"
54 using namespace lyx::support;
58 namespace os = support::os;
62 // The format should also be updated in configure.py, and conversion code
63 // should be added to prefs2prefs_prefs.py.
64 static unsigned int const LYXRC_FILEFORMAT = 32; // spitz: add \ct_markup_copied
65 // when adding something to this array keep it sorted!
66 LexerKeyword lyxrcTags[] = {
67 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
68 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
69 { "\\alternate_language", LyXRC::RC_ALT_LANG },
70 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
71 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
72 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
73 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
74 { "\\autosave", LyXRC::RC_AUTOSAVE },
75 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
76 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
77 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
78 { "\\bind_file", LyXRC::RC_BINDFILE },
79 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
80 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
81 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
82 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
83 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
84 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
85 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
86 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
87 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
88 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
89 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
90 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
91 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
92 { "\\converter", LyXRC::RC_CONVERTER },
93 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
94 { "\\copier", LyXRC::RC_COPIER },
95 { "\\ct_additions_underlined", LyXRC::RC_CT_ADDITIONS_UNDERLINED },
96 { "\\ct_markup_copied", LyXRC::RC_CT_MARKUP_COPIED },
97 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
98 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
99 { "\\def_file", LyXRC::RC_DEFFILE },
100 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
101 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
102 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
103 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
104 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
105 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
106 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
107 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
108 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
109 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
110 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
111 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
112 { "\\format", LyXRC::RC_FILEFORMAT },
113 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
114 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
115 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
116 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
117 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
118 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
119 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
120 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
121 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
122 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
123 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
124 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
125 { "\\icon_set", LyXRC::RC_ICON_SET },
126 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
127 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
128 { "\\input", LyXRC::RC_INPUT },
129 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
130 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
131 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
132 { "\\kbmap", LyXRC::RC_KBMAP },
133 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
134 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
135 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
136 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
137 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
138 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
139 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
140 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
141 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
142 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
143 { "\\load_session", LyXRC::RC_LOADSESSION },
144 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
145 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
146 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
147 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
148 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
149 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
150 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
151 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
152 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
153 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
154 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
155 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
156 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
157 { "\\preview", LyXRC::RC_PREVIEW },
158 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
159 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
160 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
161 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
162 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
163 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
164 { "\\respect_os_kbd_language", LyXRC::RC_RESPECT_OS_KBD_LANGUAGE },
165 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
166 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
167 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
168 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
169 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
170 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
171 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
172 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
173 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
174 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
175 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
176 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
177 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
178 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
179 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
180 { "\\set_color", LyXRC::RC_SET_COLOR },
181 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
182 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
183 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
184 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
185 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
186 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
187 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
188 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
189 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
190 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
191 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
192 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
193 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
194 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
195 { "\\ui_file", LyXRC::RC_UIFILE },
196 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
197 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
198 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
199 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
200 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
201 // compatibility with versions older than 1.4.0 only
202 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
203 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
204 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
205 { "\\user_email", LyXRC::RC_USER_EMAIL },
206 { "\\user_initials", LyXRC::RC_USER_INITIALS },
207 { "\\user_name", LyXRC::RC_USER_NAME },
208 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
209 // compatibility with versions older than 1.4.0 only
210 { "\\viewer", LyXRC::RC_VIEWER},
211 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
212 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
213 { "format", LyXRC::RC_LYXRCFORMAT }
216 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
219 void oldFontFormat(string & family, string & foundry)
221 if (family.empty() || family[0] != '-')
223 foundry = token(family, '-', 1);
224 family = token(family, '-', 2);
232 bool LyXRC::read(FileName const & filename, bool check_format)
234 Lexer lexrc(lyxrcTags);
235 lexrc.setFile(filename);
236 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
237 ReturnValues retval = read(lexrc, check_format);
238 if (!check_format || retval != FormatMismatch)
239 return retval == ReadOK;
241 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
242 TempFile tmp("convert_lyxrc");
243 FileName const tempfile = tmp.name();
244 bool const success = prefs2prefs(filename, tempfile, false);
246 LYXERR0 ("Unable to convert " << filename.absFileName() <<
247 " to format " << LYXRC_FILEFORMAT);
250 // Keep this in the else branch, such that lexrc2 goes out
251 // of scope and releases the lock on tempfile before we
252 // attempt to remove it. This matters on Windows.
253 Lexer lexrc2(lyxrcTags);
254 lexrc2.setFile(tempfile);
255 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
256 retval = read(lexrc2, check_format);
257 if (retval == FormatMismatch)
258 LYXERR0("Conversion failed for " << filename.absFileName());
260 return retval == ReadOK;
264 // don't need to worry about conversion, because this is always
265 // from an internal source
266 bool LyXRC::read(istream & is)
268 Lexer lexrc(lyxrcTags);
270 LYXERR(Debug::LYXRC, "Reading istream...");
271 return read(lexrc, false) == ReadOK;
275 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
277 if (lyxerr.debugging(Debug::PARSER))
278 lexrc.printTable(lyxerr);
283 // format prior to 2.0 and introduction of format tag
284 unsigned int rc_format = 0;
286 while (lexrc.isOK()) {
287 // By using two switches we take advantage of the compiler
288 // telling us if we have missed a LyXRCTags element in
289 // the second switch.
290 // Note that this also shows a problem with Lexer since it
291 // helps us avoid taking advantage of the strictness of the
294 int le = lexrc.lex();
296 case Lexer::LEX_UNDEF:
297 lexrc.printError("Unknown tag `$$Token'");
299 case Lexer::LEX_FEOF:
304 switch (static_cast<LyXRCTags>(le)) {
307 rc_format = lexrc.getInteger();
309 case RC_INPUT: // Include file
312 libFileSearch(string(),
314 if (!read(tmp, check_format)) {
316 "Error reading included file: " + tmp.absFileName());
322 bind_file = os::internal_path(lexrc.getString());
327 def_file = os::internal_path(lexrc.getString());
332 ui_file = os::internal_path(lexrc.getString());
335 case RC_AUTORESET_OPTIONS:
336 lexrc >> auto_reset_options;
339 case RC_DISPLAY_GRAPHICS:
341 display_graphics = lexrc.getString() == "true";
344 case RC_TEX_EXPECTS_WINDOWS_PATHS:
345 lexrc >> windows_style_tex_paths;
348 case RC_TEX_ALLOWS_SPACES:
349 lexrc >> tex_allows_spaces;
352 case RC_TEXINPUTS_PREFIX:
353 lexrc >> texinputs_prefix;
360 case RC_KBMAP_PRIMARY:
362 string const kmap(os::internal_path(lexrc.getString()));
363 if (!libFileSearch("kbd", kmap, "kmap").empty()
365 primary_kbmap = kmap;
367 lexrc.printError("LyX: Keymap `$$Token' not found");
372 case RC_KBMAP_SECONDARY:
374 string const kmap(os::internal_path(lexrc.getString()));
375 if (!libFileSearch("kbd", kmap, "kmap").empty()
377 secondary_kbmap = kmap;
379 lexrc.printError("LyX: Keymap `$$Token' not found");
384 case RC_PRINTLANDSCAPEFLAG:
385 lexrc >> print_landscape_flag;
388 case RC_PRINTPAPERDIMENSIONFLAG:
389 lexrc >> print_paper_dimension_flag;
392 case RC_PRINTPAPERFLAG:
393 lexrc >> print_paper_flag;
396 case RC_PYGMENTIZE_COMMAND:
397 if (lexrc.next(true)) {
398 pygmentize_command = lexrc.getString();
402 case RC_VIEWDVI_PAPEROPTION:
404 view_dvi_paper_option = lexrc.getString();
406 view_dvi_paper_option.erase();
409 case RC_CHKTEX_COMMAND:
410 if (lexrc.next(true)) {
411 chktex_command = lexrc.getString();
415 case RC_BIBTEX_ALTERNATIVES:
416 if (lexrc.next(true)) {
417 bibtex_alternatives.insert(lexrc.getString());
421 case RC_BIBTEX_COMMAND:
422 if (lexrc.next(true)) {
423 bibtex_command = lexrc.getString();
427 case RC_JBIBTEX_COMMAND:
428 if (lexrc.next(true)) {
429 jbibtex_command = lexrc.getString();
433 case RC_JBIBTEX_ALTERNATIVES:
434 if (lexrc.next(true)) {
435 jbibtex_alternatives.insert(lexrc.getString());
439 case RC_INDEX_ALTERNATIVES:
440 if (lexrc.next(true)) {
441 index_alternatives.insert(lexrc.getString());
445 case RC_INDEX_COMMAND:
446 if (lexrc.next(true)) {
447 index_command = lexrc.getString();
451 case RC_JINDEX_COMMAND:
452 if (lexrc.next(true)) {
453 jindex_command = lexrc.getString();
457 case RC_SPLITINDEX_COMMAND:
458 if (lexrc.next(true)) {
459 splitindex_command = lexrc.getString();
463 case RC_NOMENCL_COMMAND:
464 if (lexrc.next(true)) {
465 nomencl_command = lexrc.getString();
474 lexrc >> defaultZoom;
475 if (defaultZoom < 10)
479 case RC_GEOMETRY_SESSION:
480 lexrc >> allow_geometry_session;
483 case RC_SCREEN_FONT_SIZES:
484 lexrc >> font_sizes[TINY_SIZE];
485 lexrc >> font_sizes[SCRIPT_SIZE];
486 lexrc >> font_sizes[FOOTNOTE_SIZE];
487 lexrc >> font_sizes[SMALL_SIZE];
488 lexrc >> font_sizes[NORMAL_SIZE];
489 lexrc >> font_sizes[LARGE_SIZE];
490 lexrc >> font_sizes[LARGER_SIZE];
491 lexrc >> font_sizes[LARGEST_SIZE];
492 lexrc >> font_sizes[HUGE_SIZE];
493 lexrc >> font_sizes[HUGER_SIZE];
496 case RC_SCREEN_FONT_SCALABLE:
497 lexrc >> use_scalable_fonts;
504 case RC_DOCUMENTPATH:
506 document_path = os::internal_path(lexrc.getString());
511 example_path = os::internal_path(lexrc.getString());
514 case RC_TEMPLATEPATH:
516 template_path = os::internal_path(lexrc.getString());
521 tempdir_path = os::internal_path(lexrc.getString());
524 case RC_THESAURUSDIRPATH:
526 thesaurusdir_path = os::internal_path(lexrc.getString());
529 case RC_HUNSPELLDIR_PATH:
531 hunspelldir_path = os::internal_path(lexrc.getString());
534 case RC_USELASTFILEPOS:
535 lexrc >> use_lastfilepos;
539 lexrc >> load_session;
542 case RC_MOUSE_WHEEL_SPEED:
543 lexrc >> mouse_wheel_speed;
546 case RC_COMPLETION_INLINE_DELAY:
547 lexrc >> completion_inline_delay;
550 case RC_COMPLETION_INLINE_MATH:
551 lexrc >> completion_inline_math;
554 case RC_COMPLETION_INLINE_TEXT:
555 lexrc >> completion_inline_text;
558 case RC_COMPLETION_INLINE_DOTS:
559 lexrc >> completion_inline_dots;
562 case RC_AUTOCORRECTION_MATH:
563 lexrc >> autocorrection_math;
566 case RC_COMPLETION_POPUP_DELAY:
567 lexrc >> completion_popup_delay;
570 case RC_COMPLETION_POPUP_MATH:
571 lexrc >> completion_popup_math;
574 case RC_COMPLETION_POPUP_TEXT:
575 lexrc >> completion_popup_text;
578 case RC_COMPLETION_CURSOR_TEXT:
579 lexrc >> completion_cursor_text;
582 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
583 lexrc >> completion_popup_after_complete;
586 case RC_COMPLETION_MINLENGTH:
587 lexrc >> completion_minlength;
590 case RC_NUMLASTFILES:
591 lexrc >> num_lastfiles;
594 case RC_CHECKLASTFILES:
595 lexrc >> check_lastfiles;
602 case RC_USE_SYSTEM_THEME_ICONS:
603 lexrc >> use_system_theme_icons;
606 case RC_SCREEN_FONT_ROMAN:
608 roman_font_name = lexrc.getString();
609 oldFontFormat(roman_font_name,
614 case RC_SCREEN_FONT_SANS:
616 sans_font_name = lexrc.getString();
617 oldFontFormat(sans_font_name, sans_font_foundry);
621 case RC_SCREEN_FONT_TYPEWRITER:
623 typewriter_font_name = lexrc.getString();
624 oldFontFormat(typewriter_font_name,
625 typewriter_font_foundry);
629 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
630 lexrc >> roman_font_foundry;
633 case RC_SCREEN_FONT_SANS_FOUNDRY:
634 lexrc >> sans_font_foundry;
637 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
638 lexrc >> typewriter_font_foundry;
643 lexrc.printError("Missing color tag.");
646 string lyx_name = lexrc.getString();
649 lexrc.printError("Missing color name for color: `$$Token'");
652 string x11_name = lexrc.getString();
654 ColorCode const col =
655 lcolor.getFromLyXName(lyx_name);
656 if (col == Color_none ||
657 col == Color_inherit ||
661 if (!lcolor.setColor(col, x11_name))
662 LYXERR0("Bad lyxrc set_color for " << lyx_name);
666 case RC_AUTOREGIONDELETE:
667 // Auto region delete defaults to true
668 lexrc >> auto_region_delete;
673 string userdir = package().user_support().absFileName();
674 if (userdir.back() == '/')
676 lyxpipes = subst(os::internal_path(lexrc.getString()), "$$UserDir",
681 case RC_CT_ADDITIONS_UNDERLINED:
682 lexrc >> ct_additions_underlined;
685 case RC_CT_MARKUP_COPIED:
686 lexrc >> ct_markup_copied;
689 case RC_CURSOR_FOLLOWS_SCROLLBAR:
690 lexrc >> cursor_follows_scrollbar;
693 case RC_CURSOR_WIDTH:
694 lexrc >> cursor_width;
697 case RC_SCROLL_BELOW_DOCUMENT:
698 lexrc >> scroll_below_document;
701 case RC_PARAGRAPH_MARKERS:
702 lexrc >> paragraph_markers;
705 case RC_MAC_DONTSWAP_CTRL_META:
706 lexrc >> mac_dontswap_ctrl_meta;
709 case RC_MAC_LIKE_CURSOR_MOVEMENT:
710 lexrc >> mac_like_cursor_movement;
713 case RC_MACRO_EDIT_STYLE:
715 switch (lexrc.getInteger()) {
716 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
717 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
718 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
723 case RC_DIALOGS_ICONIFY_WITH_MAIN:
724 lexrc >> dialogs_iconify_with_main;
727 case RC_PLAINTEXT_LINELEN:
728 lexrc >> plaintext_linelen;
730 // Spellchecker settings:
731 case RC_ACCEPT_COMPOUND:
732 lexrc >> spellchecker_accept_compound;
734 case RC_USE_NATIVE_FILEDIALOG:
735 lexrc >> use_native_filedialog;
737 case RC_USE_SYSTEM_COLORS:
738 lexrc >> use_system_colors;
741 lexrc >> use_tooltip;
743 case RC_SPELLCHECKER:
744 lexrc >> spellchecker;
747 lexrc >> spellchecker_alt_lang;
750 lexrc >> spellchecker_esc_chars;
752 case RC_SPELLCHECK_CONTINUOUSLY:
753 lexrc >> spellcheck_continuously;
755 case RC_SPELLCHECK_NOTES:
756 lexrc >> spellcheck_notes;
759 lexrc >> make_backup;
761 case RC_SAVE_COMPRESSED:
762 lexrc >> save_compressed;
765 lexrc >> save_origin;
767 case RC_BACKUPDIR_PATH:
769 backupdir_path = os::internal_path(lexrc.getString());
771 case RC_DEFAULT_DECIMAL_SEP:
772 lexrc >> default_decimal_sep;
774 case RC_DEFAULT_LENGTH_UNIT:
776 default_length_unit = (Length::UNIT) lexrc.getInteger();
778 case RC_LANGUAGE_CUSTOM_PACKAGE:
779 lexrc >> language_custom_package;
781 case RC_LANGUAGE_AUTO_BEGIN:
782 lexrc >> language_auto_begin;
784 case RC_LANGUAGE_AUTO_END:
785 lexrc >> language_auto_end;
787 case RC_LANGUAGE_GLOBAL_OPTIONS:
788 lexrc >> language_global_options;
790 case RC_LANGUAGE_PACKAGE_SELECTION:
792 switch (lexrc.getInteger()) {
794 language_package_selection = LP_AUTO;
797 language_package_selection = LP_BABEL;
800 language_package_selection = LP_CUSTOM;
803 language_package_selection = LP_NONE;
808 case RC_LANGUAGE_COMMAND_BEGIN:
809 lexrc >> language_command_begin;
811 case RC_LANGUAGE_COMMAND_END:
812 lexrc >> language_command_end;
814 case RC_LANGUAGE_COMMAND_LOCAL:
815 lexrc >> language_command_local;
817 case RC_RESPECT_OS_KBD_LANGUAGE:
818 lexrc >> respect_os_kbd_language;
820 case RC_VISUAL_CURSOR:
821 lexrc >> visual_cursor;
823 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
824 lexrc >> close_buffer_with_last_view;
827 lexrc >> auto_number;
829 case RC_MARK_FOREIGN_LANGUAGE:
830 lexrc >> mark_foreign_language;
836 fmt = lexrc.getString();
837 if (lexrc.next(true))
838 command = lexrc.getString();
839 setMover(fmt, command);
844 string from, to, command, flags;
846 from = lexrc.getString();
848 to = lexrc.getString();
849 if (lexrc.next(true))
850 command = lexrc.getString();
852 flags = lexrc.getString();
854 theConverters().erase(from, to);
856 theConverters().add(from, to, command, flags);
859 // compatibility with versions older than 1.4.0 only
861 string format, command;
862 lexrc >> format >> command;
863 theFormats().setViewer(format, command);
866 case RC_FILEFORMAT: {
868 string format, extensions, shortcut;
869 docstring prettyname;
870 if (!(lexrc >> format >> extensions))
872 if (ok && lexrc.next(true))
873 prettyname = lexrc.getDocString();
877 if(!(lexrc >> shortcut))
879 string viewer, editor;
880 if (ok && lexrc.next(true))
881 viewer = lexrc.getString();
884 if (ok && lexrc.next(true))
885 editor = lexrc.getString();
889 if (!(lexrc >> flags >> mime))
891 int flgs = Format::none;
892 while (!flags.empty()) {
894 flags = split(flags, flag, ',');
895 if (flag == "document")
896 flgs |= Format::document;
897 else if (flag == "vector")
898 flgs |= Format::vector;
899 else if (flag == "zipped=native")
900 flgs |= Format::zipped_native;
901 else if (flag == "menu=export")
902 flgs |= Format::export_menu;
903 else if (flag == "menu=none")
904 flgs |= Format::no_menu;
906 LYXERR0("Ignoring unknown flag `"
907 << flag << "' for format `"
911 LYXERR0("Syntax error in format " << format);
912 else if (prettyname.empty()) {
913 if (theConverters().formatIsUsed(format))
914 LYXERR0("Can't delete format " << format);
916 theFormats().erase(format);
918 theFormats().add(format, extensions, prettyname,
919 shortcut, viewer, editor, mime, flgs);
923 case RC_VIEWER_ALTERNATIVES: {
924 string format, command;
925 if ((lexrc >> format) && lexrc.next(true)) {
926 command = lexrc.getString();
927 viewer_alternatives[format].insert(command);
931 case RC_EDITOR_ALTERNATIVES: {
932 string format, command;
933 if ((lexrc >> format) && lexrc.next(true)) {
934 command = lexrc.getString();
935 editor_alternatives[format].insert(command);
940 case RC_DEFAULT_OTF_VIEW_FORMAT:
941 lexrc >> default_otf_view_format;
944 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
945 lexrc >> default_platex_view_format;
948 case RC_DEFAULT_VIEW_FORMAT:
949 lexrc >> default_view_format;
952 case RC_GUI_LANGUAGE:
953 lexrc >> gui_language;
957 lexrc >> show_banner;
962 string const tmp = lexrc.getString();
963 if (tmp == "true" || tmp == "on")
964 preview = PREVIEW_ON;
965 else if (tmp == "no_math")
966 preview = PREVIEW_NO_MATH;
968 preview = PREVIEW_OFF;
969 if (tmp != "false" && tmp != "off")
970 LYXERR0("Unrecognized preview status \""
976 case RC_PREVIEW_HASHED_LABELS:
977 lexrc >> preview_hashed_labels;
980 case RC_PREVIEW_SCALE_FACTOR:
981 lexrc >> preview_scale_factor;
990 case RC_USER_INITIALS:
991 lexrc >> user_initials;
995 lexrc >> path_prefix;
998 case RC_USE_CONVERTER_CACHE:
999 lexrc >> use_converter_cache;
1001 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1002 lexrc >> use_converter_needauth_forbidden;
1004 case RC_USE_CONVERTER_NEEDAUTH:
1005 lexrc >> use_converter_needauth;
1007 case RC_CONVERTER_CACHE_MAXAGE:
1008 lexrc >> converter_cache_maxage;
1011 case RC_SORT_LAYOUTS:
1012 lexrc >> sort_layouts;
1014 case RC_GROUP_LAYOUTS:
1015 lexrc >> group_layouts;
1017 case RC_FULL_SCREEN_LIMIT:
1018 lexrc >> full_screen_limit;
1020 case RC_FULL_SCREEN_TOOLBARS:
1021 lexrc >> full_screen_toolbars;
1023 case RC_FULL_SCREEN_SCROLLBAR:
1024 lexrc >> full_screen_scrollbar;
1026 case RC_FULL_SCREEN_STATUSBAR:
1027 lexrc >> full_screen_statusbar;
1029 case RC_FULL_SCREEN_TABBAR:
1030 lexrc >> full_screen_tabbar;
1032 case RC_FULL_SCREEN_MENUBAR:
1033 lexrc >> full_screen_menubar;
1035 case RC_FULL_SCREEN_WIDTH:
1036 lexrc >> full_screen_width;
1038 case RC_OPEN_BUFFERS_IN_TABS:
1039 lexrc >> open_buffers_in_tabs;
1041 case RC_SINGLE_CLOSE_TAB_BUTTON:
1042 lexrc >> single_close_tab_button;
1044 case RC_SINGLE_INSTANCE:
1045 lexrc >> single_instance;
1046 if (run_mode == PREFERRED)
1047 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1049 case RC_FORWARD_SEARCH_DVI:
1050 if (lexrc.next(true))
1051 forward_search_dvi = lexrc.getString();
1053 case RC_FORWARD_SEARCH_PDF:
1054 if (lexrc.next(true))
1055 forward_search_pdf = lexrc.getString();
1057 case RC_EXPORT_OVERWRITE:
1059 string const tmp = lexrc.getString();
1060 if (tmp == "all" || tmp == "true")
1061 export_overwrite = ALL_FILES;
1062 else if (tmp == "main")
1063 export_overwrite = MAIN_FILE;
1065 export_overwrite = NO_FILES;
1066 if (tmp != "ask" && tmp != "false")
1067 LYXERR0("Unrecognized export_overwrite status \""
1072 case RC_SCROLL_WHEEL_ZOOM:
1074 string const tmp = lexrc.getString();
1076 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1077 else if (tmp == "shift")
1078 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1079 else if (tmp == "alt")
1080 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1082 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1083 if (tmp != "off" && tmp != "false")
1084 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1090 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1091 lexrc >> mouse_middlebutton_paste;
1095 break; // this is just a dummy
1098 // This is triggered the first time through the loop unless
1099 // we hit a format tag.
1100 if (check_format && rc_format != LYXRC_FILEFORMAT)
1101 return FormatMismatch;
1104 /// Update converters data-structures
1105 theConverters().update(theFormats());
1106 theConverters().buildGraph();
1107 theBufferList().invalidateConverterCache();
1113 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1115 ofstream ofs(filename.toFilesystemEncoding().c_str());
1117 write(ofs, ignore_system_lyxrc);
1121 void LyXRC::print() const
1123 if (lyxerr.debugging())
1124 write(lyxerr, false);
1132 typedef pair<string, SpecialisedMover> Data;
1134 SameMover(Data const & comparison)
1135 : comparison_(comparison) {}
1137 bool operator()(Data const & data) const
1139 return data.first == comparison_.first &&
1140 data.second.command() == comparison_.second.command();
1150 // Escape \ and " so that LyXLex can read the string later
1151 string escapeCommand(string const & str) {
1152 return subst(subst(str , "\\", "\\\\"),
1159 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1161 LyXRCTags tag = RC_LAST;
1163 if (!name.empty()) {
1164 for (int i = 0; i != lyxrcCount; ++i)
1165 if ("\\" + name == lyxrcTags[i].tag)
1166 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1170 os << "# LyX " << lyx_version
1171 << " generated this file. If you want to make your own\n"
1172 << "# modifications you should do them from inside LyX and save.\n\n"
1173 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1175 // Why the switch you might ask. It is a trick to ensure that all
1176 // the elements in the LyXRCTags enum are handled. As you can see
1177 // there are no breaks at all. So it is just a huge fall-through.
1178 // The nice thing is that we will get a warning from the compiler
1179 // if we forget an element.
1183 // input/include files are not done here
1184 case RC_LYXRCFORMAT:
1186 if (ignore_system_lyxrc ||
1187 bind_file != system_lyxrc.bind_file) {
1188 string const path = os::external_path(bind_file);
1189 os << "\\bind_file \"" << path << "\"\n";
1195 if (ignore_system_lyxrc ||
1196 def_file != system_lyxrc.def_file) {
1197 string const path = os::external_path(def_file);
1198 os << "\\def_file \"" << path << "\"\n";
1207 << "# MISC SECTION ######################################\n"
1209 // bind files are not done here.
1211 case RC_PATH_PREFIX:
1212 if (ignore_system_lyxrc ||
1213 path_prefix != system_lyxrc.path_prefix) {
1214 os << "\\path_prefix \"" << path_prefix << "\"\n";
1220 if (ignore_system_lyxrc ||
1221 ui_file != system_lyxrc.ui_file) {
1222 string const path = os::external_path(ui_file);
1223 os << "\\ui_file \"" << path << "\"\n";
1228 case RC_AUTOREGIONDELETE:
1229 if (ignore_system_lyxrc ||
1230 auto_region_delete != system_lyxrc.auto_region_delete) {
1231 os << "# Set to false to inhibit automatic replacement of\n"
1232 << "# the current selection.\n"
1233 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1239 case RC_AUTORESET_OPTIONS:
1240 if (ignore_system_lyxrc ||
1241 auto_reset_options != system_lyxrc.auto_reset_options) {
1242 os << "# Set to false to inhibit automatic reset of\n"
1243 << "# the class options to defaults on class change.\n"
1244 << "\\auto_reset_options "
1245 << convert<string>(auto_reset_options)
1252 if (ignore_system_lyxrc ||
1253 autosave != system_lyxrc.autosave) {
1254 os << "# The time interval between auto-saves in seconds.\n"
1255 << "\\autosave " << autosave << '\n';
1260 case RC_DISPLAY_GRAPHICS:
1261 if (ignore_system_lyxrc ||
1262 display_graphics != system_lyxrc.display_graphics) {
1263 os << "# Display graphics within LyX\n"
1265 << "\\display_graphics "
1266 << (display_graphics ? "true" : "false")
1272 case RC_SORT_LAYOUTS:
1273 if (ignore_system_lyxrc ||
1274 sort_layouts != system_lyxrc.sort_layouts) {
1275 os << "# Sort layouts alphabetically.\n"
1276 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1281 case RC_GROUP_LAYOUTS:
1282 if (ignore_system_lyxrc ||
1283 group_layouts != system_lyxrc.group_layouts) {
1284 os << "# Group layouts by their category.\n"
1285 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1290 case RC_VIEWDVI_PAPEROPTION:
1291 if (ignore_system_lyxrc ||
1292 view_dvi_paper_option
1293 != system_lyxrc.view_dvi_paper_option) {
1294 os << "# Options used to specify paper size to the\n"
1295 << "# view_dvi_command (e.g. -paper)\n"
1296 << "\\view_dvi_paper_option \""
1297 << view_dvi_paper_option << "\"\n";
1302 case RC_CHKTEX_COMMAND:
1303 if (ignore_system_lyxrc ||
1304 chktex_command != system_lyxrc.chktex_command) {
1305 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1310 case RC_BIBTEX_ALTERNATIVES: {
1311 CommandSet::const_iterator it = bibtex_alternatives.begin();
1312 CommandSet::const_iterator end = bibtex_alternatives.end();
1313 for ( ; it != end; ++it) {
1314 if (ignore_system_lyxrc
1315 || !system_lyxrc.bibtex_alternatives.count(*it))
1316 os << "\\bibtex_alternatives \""
1323 case RC_BIBTEX_COMMAND:
1324 if (ignore_system_lyxrc ||
1325 bibtex_command != system_lyxrc.bibtex_command) {
1326 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1331 case RC_JBIBTEX_COMMAND:
1332 if (ignore_system_lyxrc ||
1333 jbibtex_command != system_lyxrc.jbibtex_command) {
1334 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1339 case RC_JBIBTEX_ALTERNATIVES: {
1340 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1341 CommandSet::const_iterator end = jbibtex_alternatives.end();
1342 for ( ; it != end; ++it) {
1343 if (ignore_system_lyxrc
1344 || !system_lyxrc.jbibtex_alternatives.count(*it))
1345 os << "\\jbibtex_alternatives \""
1352 case RC_INDEX_ALTERNATIVES: {
1353 CommandSet::const_iterator it = index_alternatives.begin();
1354 CommandSet::const_iterator end = index_alternatives.end();
1355 for ( ; it != end; ++it) {
1356 if (ignore_system_lyxrc
1357 || !system_lyxrc.index_alternatives.count(*it))
1358 os << "\\index_alternatives \""
1365 case RC_INDEX_COMMAND:
1366 if (ignore_system_lyxrc ||
1367 index_command != system_lyxrc.index_command) {
1368 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1373 case RC_JINDEX_COMMAND:
1374 if (ignore_system_lyxrc ||
1375 jindex_command != system_lyxrc.jindex_command) {
1376 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1381 case RC_SPLITINDEX_COMMAND:
1382 if (ignore_system_lyxrc ||
1383 splitindex_command != system_lyxrc.splitindex_command) {
1384 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1389 case RC_NOMENCL_COMMAND:
1390 if (ignore_system_lyxrc ||
1391 nomencl_command != system_lyxrc.nomencl_command) {
1392 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1397 case RC_PYGMENTIZE_COMMAND:
1398 if (ignore_system_lyxrc ||
1399 pygmentize_command != system_lyxrc.pygmentize_command) {
1400 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1405 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1406 // Don't write this setting to the preferences file,
1407 // but allow temporary changes (bug 7557).
1408 if (ignore_system_lyxrc) {
1409 os << "\\tex_expects_windows_paths "
1410 << convert<string>(windows_style_tex_paths) << '\n';
1415 case RC_TEX_ALLOWS_SPACES:
1416 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1417 os << "\\tex_allows_spaces "
1418 << convert<string>(tex_allows_spaces) << '\n';
1424 if (ignore_system_lyxrc ||
1425 use_kbmap != system_lyxrc.use_kbmap) {
1426 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1431 case RC_KBMAP_PRIMARY:
1432 if (ignore_system_lyxrc ||
1433 primary_kbmap != system_lyxrc.primary_kbmap) {
1434 string const path = os::external_path(primary_kbmap);
1435 os << "\\kbmap_primary \"" << path << "\"\n";
1440 case RC_KBMAP_SECONDARY:
1441 if (ignore_system_lyxrc ||
1442 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1443 string const path = os::external_path(secondary_kbmap);
1444 os << "\\kbmap_secondary \"" << path << "\"\n";
1450 if (ignore_system_lyxrc ||
1451 lyxpipes != system_lyxrc.lyxpipes) {
1452 string const path = os::external_path(lyxpipes);
1453 os << "\\serverpipe \"" << path << "\"\n";
1459 os << "\\user_name \"" << user_name << "\"\n";
1464 os << "\\user_email \"" << user_email << "\"\n";
1468 case RC_USER_INITIALS:
1469 os << "\\user_initials \"" << user_initials << "\"\n";
1473 case RC_SHOW_BANNER:
1474 if (ignore_system_lyxrc ||
1475 show_banner != system_lyxrc.show_banner) {
1476 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1482 if (ignore_system_lyxrc ||
1483 preview != system_lyxrc.preview) {
1489 case PREVIEW_NO_MATH:
1496 os << "\\preview " << status << '\n';
1501 case RC_PREVIEW_HASHED_LABELS:
1502 if (ignore_system_lyxrc ||
1503 preview_hashed_labels !=
1504 system_lyxrc.preview_hashed_labels) {
1505 os << "\\preview_hashed_labels "
1506 << convert<string>(preview_hashed_labels) << '\n';
1511 case RC_PREVIEW_SCALE_FACTOR:
1512 if (ignore_system_lyxrc ||
1513 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1514 os << "\\preview_scale_factor "
1515 << preview_scale_factor << '\n';
1520 case RC_USE_CONVERTER_CACHE:
1521 if (ignore_system_lyxrc ||
1522 use_converter_cache != system_lyxrc.use_converter_cache) {
1523 os << "\\use_converter_cache "
1524 << convert<string>(use_converter_cache) << '\n';
1529 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1530 if (ignore_system_lyxrc ||
1531 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1532 os << "\\use_converter_needauth_forbidden "
1533 << convert<string>(use_converter_needauth_forbidden) << '\n';
1538 case RC_USE_CONVERTER_NEEDAUTH:
1539 if (ignore_system_lyxrc ||
1540 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1541 os << "\\use_converter_needauth "
1542 << convert<string>(use_converter_needauth) << '\n';
1547 case RC_CONVERTER_CACHE_MAXAGE:
1548 if (ignore_system_lyxrc ||
1549 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1550 os << "\\converter_cache_maxage "
1551 << converter_cache_maxage << '\n';
1557 << "# SCREEN & FONTS SECTION ############################\n"
1561 if (ignore_system_lyxrc ||
1562 icon_set != system_lyxrc.icon_set) {
1563 os << "\\icon_set \"" << icon_set
1569 case RC_USE_SYSTEM_THEME_ICONS:
1570 if (ignore_system_lyxrc ||
1571 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1572 os << "\\use_system_theme_icons "
1573 << convert<string>(use_system_theme_icons)
1580 if (ignore_system_lyxrc ||
1581 dpi != system_lyxrc.dpi) {
1582 os << "\\screen_dpi " << dpi << '\n';
1587 case RC_SCREEN_ZOOM:
1588 if (ignore_system_lyxrc ||
1589 defaultZoom != system_lyxrc.defaultZoom) {
1590 os << "\\screen_zoom " << defaultZoom << '\n';
1595 case RC_GEOMETRY_SESSION:
1596 if (ignore_system_lyxrc ||
1597 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1598 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1604 case RC_CT_ADDITIONS_UNDERLINED:
1605 if (ignore_system_lyxrc ||
1606 ct_additions_underlined
1607 != system_lyxrc.ct_additions_underlined) {
1608 os << "\\ct_additions_underlined "
1609 << convert<string>(ct_additions_underlined) << '\n';
1614 case RC_CT_MARKUP_COPIED:
1615 if (ignore_system_lyxrc ||
1617 != system_lyxrc.ct_markup_copied) {
1618 os << "\\ct_markup_copied "
1619 << convert<string>(ct_markup_copied) << '\n';
1624 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1625 if (ignore_system_lyxrc ||
1626 cursor_follows_scrollbar
1627 != system_lyxrc.cursor_follows_scrollbar) {
1628 os << "\\cursor_follows_scrollbar "
1629 << convert<string>(cursor_follows_scrollbar) << '\n';
1634 case RC_CURSOR_WIDTH:
1635 if (ignore_system_lyxrc ||
1637 != system_lyxrc.cursor_width) {
1638 os << "\\cursor_width "
1639 << cursor_width << '\n';
1644 case RC_SCROLL_BELOW_DOCUMENT:
1645 if (ignore_system_lyxrc ||
1646 scroll_below_document
1647 != system_lyxrc.scroll_below_document) {
1648 os << "\\scroll_below_document "
1649 << convert<string>(scroll_below_document) << '\n';
1654 case RC_PARAGRAPH_MARKERS:
1655 if (ignore_system_lyxrc ||
1657 != system_lyxrc.paragraph_markers) {
1658 os << "\\paragraph_markers "
1659 << convert<string>(paragraph_markers) << '\n';
1664 case RC_MAC_DONTSWAP_CTRL_META:
1665 if (ignore_system_lyxrc ||
1666 mac_dontswap_ctrl_meta
1667 != system_lyxrc.mac_dontswap_ctrl_meta) {
1668 os << "\\mac_dontswap_ctrl_meta "
1669 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1674 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1675 if (ignore_system_lyxrc ||
1676 mac_like_cursor_movement
1677 != system_lyxrc.mac_like_cursor_movement) {
1678 os << "\\mac_like_cursor_movement "
1679 << convert<string>(mac_like_cursor_movement) << '\n';
1684 case RC_MACRO_EDIT_STYLE:
1685 if (ignore_system_lyxrc ||
1687 != system_lyxrc.macro_edit_style) {
1688 os << "\\macro_edit_style ";
1689 switch (macro_edit_style) {
1690 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1691 case MACRO_EDIT_INLINE: os << "1\n"; break;
1692 case MACRO_EDIT_LIST: os << "2\n"; break;
1698 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1699 if (ignore_system_lyxrc ||
1700 dialogs_iconify_with_main
1701 != system_lyxrc.dialogs_iconify_with_main) {
1702 os << "\\dialogs_iconify_with_main "
1703 << convert<string>(dialogs_iconify_with_main) << '\n';
1708 case RC_SCREEN_FONT_ROMAN:
1709 if (ignore_system_lyxrc ||
1710 roman_font_name != system_lyxrc.roman_font_name) {
1711 os << "\\screen_font_roman \"" << roman_font_name
1717 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1718 if (ignore_system_lyxrc ||
1719 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1720 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1726 case RC_SCREEN_FONT_SANS:
1727 if (ignore_system_lyxrc ||
1728 sans_font_name != system_lyxrc.sans_font_name) {
1729 os << "\\screen_font_sans \"" << sans_font_name
1735 case RC_SCREEN_FONT_SANS_FOUNDRY:
1736 if (ignore_system_lyxrc ||
1737 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1738 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1744 case RC_SCREEN_FONT_TYPEWRITER:
1745 if (ignore_system_lyxrc ||
1746 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1747 os << "\\screen_font_typewriter \""
1748 << typewriter_font_name << "\"\n";
1753 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1754 if (ignore_system_lyxrc ||
1755 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1756 os << "\\screen_font_typewriter_foundry \""
1757 << typewriter_font_foundry << "\"\n";
1762 case RC_SCREEN_FONT_SCALABLE:
1763 if (ignore_system_lyxrc ||
1764 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1765 os << "\\screen_font_scalable "
1766 << convert<string>(use_scalable_fonts)
1772 case RC_SCREEN_FONT_SIZES:
1773 if (ignore_system_lyxrc ||
1774 font_sizes[TINY_SIZE]
1775 != system_lyxrc.font_sizes[TINY_SIZE] ||
1776 font_sizes[SCRIPT_SIZE]
1777 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1778 font_sizes[FOOTNOTE_SIZE]
1779 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1780 font_sizes[SMALL_SIZE]
1781 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1782 font_sizes[NORMAL_SIZE]
1783 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1784 font_sizes[LARGE_SIZE]
1785 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1786 font_sizes[LARGER_SIZE]
1787 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1788 font_sizes[LARGEST_SIZE]
1789 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1790 font_sizes[HUGE_SIZE]
1791 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1792 font_sizes[HUGER_SIZE]
1793 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1794 streamsize old_prec = os.precision();
1795 os.setf(ios::fixed);
1797 os << "\\screen_font_sizes"
1798 << ' ' << font_sizes[TINY_SIZE]
1799 << ' ' << font_sizes[SCRIPT_SIZE]
1800 << ' ' << font_sizes[FOOTNOTE_SIZE]
1801 << ' ' << font_sizes[SMALL_SIZE]
1802 << ' ' << font_sizes[NORMAL_SIZE]
1803 << ' ' << font_sizes[LARGE_SIZE]
1804 << ' ' << font_sizes[LARGER_SIZE]
1805 << ' ' << font_sizes[LARGEST_SIZE]
1806 << ' ' << font_sizes[HUGE_SIZE]
1807 << ' ' << font_sizes[HUGER_SIZE]
1809 os.precision(old_prec);
1810 os.unsetf(ios::fixed);
1815 case RC_FULL_SCREEN_LIMIT:
1816 if (ignore_system_lyxrc ||
1817 full_screen_limit != system_lyxrc.full_screen_limit) {
1818 os << "\\fullscreen_limit "
1819 << convert<string>(full_screen_limit)
1825 case RC_FULL_SCREEN_TOOLBARS:
1826 if (ignore_system_lyxrc ||
1827 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1828 os << "\\fullscreen_toolbars "
1829 << convert<string>(full_screen_toolbars)
1835 case RC_FULL_SCREEN_SCROLLBAR:
1836 if (ignore_system_lyxrc ||
1837 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1838 os << "\\fullscreen_scrollbar "
1839 << convert<string>(full_screen_scrollbar)
1845 case RC_FULL_SCREEN_STATUSBAR:
1846 if (ignore_system_lyxrc ||
1847 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1848 os << "\\fullscreen_statusbar "
1849 << convert<string>(full_screen_statusbar)
1855 case RC_FULL_SCREEN_TABBAR:
1856 if (ignore_system_lyxrc ||
1857 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1858 os << "\\fullscreen_tabbar "
1859 << convert<string>(full_screen_tabbar)
1865 case RC_FULL_SCREEN_MENUBAR:
1866 if (ignore_system_lyxrc ||
1867 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1868 os << "\\fullscreen_menubar "
1869 << convert<string>(full_screen_menubar)
1875 case RC_FULL_SCREEN_WIDTH:
1876 if (ignore_system_lyxrc ||
1877 full_screen_width != system_lyxrc.full_screen_width) {
1878 os << "\\fullscreen_width "
1879 << convert<string>(full_screen_width)
1885 case RC_OPEN_BUFFERS_IN_TABS:
1886 if (ignore_system_lyxrc ||
1887 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1888 os << "\\open_buffers_in_tabs "
1889 << convert<string>(open_buffers_in_tabs)
1895 case RC_SINGLE_CLOSE_TAB_BUTTON:
1896 if (ignore_system_lyxrc ||
1897 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1898 os << "\\single_close_tab_button "
1899 << convert<string>(single_close_tab_button)
1905 case RC_SINGLE_INSTANCE:
1906 if (ignore_system_lyxrc ||
1907 single_instance != system_lyxrc.single_instance) {
1908 os << "\\single_instance "
1909 << convert<string>(single_instance)
1915 case RC_FORWARD_SEARCH_DVI:
1916 if (ignore_system_lyxrc ||
1917 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1918 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1923 case RC_FORWARD_SEARCH_PDF:
1924 if (ignore_system_lyxrc ||
1925 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1926 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1932 << "# COLOR SECTION ###################################\n"
1937 for (int i = 0; i < Color_ignore; ++i) {
1938 ColorCode lc = static_cast<ColorCode>(i);
1939 string const col = lcolor.getX11Name(lc);
1940 if (ignore_system_lyxrc
1941 || col != system_lcolor.getX11Name(lc)) {
1942 os << "\\set_color \""
1943 << lcolor.getLyXName(lc) << "\" \""
1951 << "# PRINTER SECTION ###################################\n"
1955 case RC_PRINTLANDSCAPEFLAG:
1956 if (ignore_system_lyxrc ||
1957 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1958 os << "\\print_landscape_flag \"" << print_landscape_flag
1964 case RC_PRINTPAPERFLAG:
1965 if (ignore_system_lyxrc ||
1966 print_paper_flag != system_lyxrc.print_paper_flag) {
1967 os << "\\print_paper_flag \"" << print_paper_flag
1973 case RC_PRINTPAPERDIMENSIONFLAG:
1974 if (ignore_system_lyxrc ||
1975 print_paper_dimension_flag
1976 != system_lyxrc.print_paper_dimension_flag) {
1977 os << "\\print_paper_dimension_flag \""
1978 << print_paper_dimension_flag << "\"\n";
1984 << "# TEX SECTION #######################################\n"
1988 case RC_TEXINPUTS_PREFIX:
1989 if (ignore_system_lyxrc ||
1990 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1991 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1997 << "# FILE SECTION ######################################\n"
2000 case RC_DOCUMENTPATH:
2001 if (ignore_system_lyxrc ||
2002 document_path != system_lyxrc.document_path) {
2003 string const path = os::external_path(document_path);
2004 os << "\\document_path \"" << path << "\"\n";
2009 case RC_USELASTFILEPOS:
2010 if (ignore_system_lyxrc ||
2011 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2012 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2018 case RC_LOADSESSION:
2019 if (ignore_system_lyxrc ||
2020 load_session != system_lyxrc.load_session) {
2021 os << "\\load_session " << convert<string>(load_session)
2027 case RC_MOUSE_WHEEL_SPEED:
2028 if (ignore_system_lyxrc ||
2029 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2030 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2035 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2036 if (ignore_system_lyxrc ||
2037 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2038 os << "\\mouse_middlebutton_paste "
2039 << convert<string>(mouse_middlebutton_paste) << '\n';
2044 case RC_COMPLETION_INLINE_DELAY:
2045 if (ignore_system_lyxrc ||
2046 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2047 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2052 case RC_COMPLETION_INLINE_MATH:
2053 if (ignore_system_lyxrc ||
2054 completion_inline_math != system_lyxrc.completion_inline_math) {
2055 os << "\\completion_inline_math "
2056 << convert<string>(completion_inline_math) << '\n';
2061 case RC_COMPLETION_INLINE_TEXT:
2062 if (ignore_system_lyxrc ||
2063 completion_inline_text != system_lyxrc.completion_inline_text) {
2064 os << "\\completion_inline_text "
2065 << convert<string>(completion_inline_text) << '\n';
2070 case RC_COMPLETION_INLINE_DOTS:
2071 if (ignore_system_lyxrc ||
2072 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2073 os << "\\completion_inline_dots "
2074 << convert<string>(completion_inline_dots) << '\n';
2079 case RC_AUTOCORRECTION_MATH:
2080 if (ignore_system_lyxrc ||
2081 autocorrection_math != system_lyxrc.autocorrection_math) {
2082 os << "\\autocorrection_math "
2083 << convert<string>(autocorrection_math) << '\n';
2088 case RC_COMPLETION_POPUP_DELAY:
2089 if (ignore_system_lyxrc ||
2090 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2091 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2096 case RC_COMPLETION_POPUP_MATH:
2097 if (ignore_system_lyxrc ||
2098 completion_popup_math != system_lyxrc.completion_popup_math) {
2099 os << "\\completion_popup_math "
2100 << convert<string>(completion_popup_math) << '\n';
2105 case RC_COMPLETION_POPUP_TEXT:
2106 if (ignore_system_lyxrc ||
2107 completion_popup_text != system_lyxrc.completion_popup_text) {
2108 os << "\\completion_popup_text "
2109 << convert<string>(completion_popup_text) << '\n';
2114 case RC_COMPLETION_CURSOR_TEXT:
2115 if (ignore_system_lyxrc ||
2116 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2117 os << "\\completion_cursor_text "
2118 << convert<string>(completion_cursor_text) << '\n';
2123 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2124 if (ignore_system_lyxrc ||
2125 completion_popup_after_complete
2126 != system_lyxrc.completion_popup_after_complete) {
2127 os << "\\completion_popup_after_complete "
2128 << convert<string>(completion_popup_after_complete) << '\n';
2133 case RC_COMPLETION_MINLENGTH:
2134 if (ignore_system_lyxrc ||
2135 completion_minlength != system_lyxrc.completion_minlength) {
2136 os << "\\completion_minlength " << convert<string>(completion_minlength)
2142 case RC_NUMLASTFILES:
2143 if (ignore_system_lyxrc ||
2144 num_lastfiles != system_lyxrc.num_lastfiles) {
2145 os << "\\num_lastfiles " << num_lastfiles << '\n';
2150 case RC_CHECKLASTFILES:
2151 if (ignore_system_lyxrc ||
2152 check_lastfiles != system_lyxrc.check_lastfiles) {
2153 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2159 case RC_EXAMPLEPATH:
2160 if (ignore_system_lyxrc ||
2161 example_path != system_lyxrc.example_path) {
2162 string const path = os::external_path(example_path);
2163 os << "\\example_path \"" << path << "\"\n";
2168 case RC_TEMPLATEPATH:
2169 if (ignore_system_lyxrc ||
2170 template_path != system_lyxrc.template_path) {
2171 string const path = os::external_path(template_path);
2172 os << "\\template_path \"" << path << "\"\n";
2177 case RC_TEMPDIRPATH:
2178 if (ignore_system_lyxrc ||
2179 tempdir_path != system_lyxrc.tempdir_path) {
2180 string const path = os::external_path(tempdir_path);
2181 os << "\\tempdir_path \"" << path << "\"\n";
2186 case RC_THESAURUSDIRPATH:
2187 if (ignore_system_lyxrc ||
2188 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2189 string const path = os::external_path(thesaurusdir_path);
2190 os << "\\thesaurusdir_path \"" << path << "\"\n";
2195 case RC_HUNSPELLDIR_PATH:
2196 if (ignore_system_lyxrc ||
2197 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2198 string const path = os::external_path(hunspelldir_path);
2199 os << "\\hunspelldir_path \"" << path << "\"\n";
2204 case RC_PLAINTEXT_LINELEN:
2205 if (ignore_system_lyxrc ||
2206 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2207 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2212 case RC_MAKE_BACKUP:
2213 if (ignore_system_lyxrc ||
2214 make_backup != system_lyxrc.make_backup) {
2215 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2220 case RC_SAVE_COMPRESSED:
2221 if (ignore_system_lyxrc ||
2222 save_compressed != system_lyxrc.save_compressed) {
2223 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2228 case RC_SAVE_ORIGIN:
2229 if (ignore_system_lyxrc ||
2230 save_origin != system_lyxrc.save_origin) {
2231 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2236 case RC_BACKUPDIR_PATH:
2237 if (ignore_system_lyxrc ||
2238 backupdir_path != system_lyxrc.backupdir_path) {
2239 string const path = os::external_path(backupdir_path);
2240 os << "\\backupdir_path \"" << path << "\"\n";
2246 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2250 << "# SPELLCHECKER SECTION ##############################\n"
2254 case RC_ACCEPT_COMPOUND:
2255 if (ignore_system_lyxrc ||
2256 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2257 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2264 if (ignore_system_lyxrc ||
2265 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2266 os << "\\alternate_language \"" << spellchecker_alt_lang
2273 if (ignore_system_lyxrc ||
2274 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2275 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2280 case RC_USE_NATIVE_FILEDIALOG:
2281 if (ignore_system_lyxrc ||
2282 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2283 os << "\\use_native_filedialog "
2284 << convert<string>(use_native_filedialog)
2290 case RC_USE_SYSTEM_COLORS:
2291 if (ignore_system_lyxrc ||
2292 use_system_colors != system_lyxrc.use_system_colors) {
2293 os << "\\use_system_colors "
2294 << convert<string>(use_system_colors)
2300 case RC_USE_TOOLTIP:
2301 if (ignore_system_lyxrc ||
2302 use_tooltip != system_lyxrc.use_tooltip) {
2303 os << "\\use_tooltip "
2304 << convert<string>(use_tooltip)
2312 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2316 case RC_DEFAULT_DECIMAL_SEP:
2317 if (ignore_system_lyxrc ||
2318 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2319 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2324 case RC_DEFAULT_LENGTH_UNIT:
2325 if (ignore_system_lyxrc ||
2326 default_length_unit != system_lyxrc.default_length_unit) {
2327 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2332 case RC_SPELLCHECKER:
2333 if (ignore_system_lyxrc ||
2334 spellchecker != system_lyxrc.spellchecker) {
2335 os << "\\spellchecker " << spellchecker << '\n';
2340 case RC_SPELLCHECK_CONTINUOUSLY:
2341 if (ignore_system_lyxrc ||
2342 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2343 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2349 case RC_SPELLCHECK_NOTES:
2350 if (ignore_system_lyxrc ||
2351 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2352 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2358 case RC_VISUAL_CURSOR:
2359 if (ignore_system_lyxrc ||
2360 visual_cursor != system_lyxrc.visual_cursor) {
2361 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2366 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2367 if (ignore_system_lyxrc ||
2368 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2369 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2370 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2375 case RC_LANGUAGE_CUSTOM_PACKAGE:
2376 if (ignore_system_lyxrc ||
2377 language_custom_package != system_lyxrc.language_custom_package) {
2378 os << "\\language_custom_package \"" << language_custom_package
2384 case RC_LANGUAGE_GLOBAL_OPTIONS:
2385 if (ignore_system_lyxrc ||
2386 language_global_options
2387 != system_lyxrc.language_global_options) {
2388 os << "\\language_global_options \""
2389 << convert<string>(language_global_options)
2395 case RC_LANGUAGE_PACKAGE_SELECTION:
2396 if (ignore_system_lyxrc ||
2397 language_package_selection != system_lyxrc.language_package_selection) {
2398 os << "\\language_package_selection ";
2399 switch (language_package_selection) {
2417 case RC_LANGUAGE_COMMAND_BEGIN:
2418 if (ignore_system_lyxrc ||
2419 language_command_begin
2420 != system_lyxrc.language_command_begin) {
2421 os << "\\language_command_begin \""
2422 << language_command_begin
2428 case RC_LANGUAGE_COMMAND_END:
2429 if (ignore_system_lyxrc ||
2430 language_command_end
2431 != system_lyxrc.language_command_end) {
2432 os << "\\language_command_end \"" << language_command_end
2438 case RC_LANGUAGE_COMMAND_LOCAL:
2439 if (ignore_system_lyxrc ||
2440 language_command_local
2441 != system_lyxrc.language_command_local) {
2442 os << "\\language_command_local \""
2443 << language_command_local
2449 case RC_LANGUAGE_AUTO_BEGIN:
2450 if (ignore_system_lyxrc ||
2451 language_auto_begin != system_lyxrc.language_auto_begin) {
2452 os << "\\language_auto_begin "
2453 << convert<string>(language_auto_begin) << '\n';
2458 case RC_LANGUAGE_AUTO_END:
2459 if (ignore_system_lyxrc ||
2460 language_auto_end != system_lyxrc.language_auto_end) {
2461 os << "\\language_auto_end "
2462 << convert<string>(language_auto_end) << '\n';
2467 case RC_MARK_FOREIGN_LANGUAGE:
2468 if (ignore_system_lyxrc ||
2469 mark_foreign_language
2470 != system_lyxrc.mark_foreign_language) {
2471 os << "\\mark_foreign_language " <<
2472 convert<string>(mark_foreign_language) << '\n';
2475 case RC_RESPECT_OS_KBD_LANGUAGE:
2476 if (ignore_system_lyxrc ||
2477 respect_os_kbd_language
2478 != system_lyxrc.respect_os_kbd_language) {
2479 os << "\\respect_os_kbd_language " <<
2480 convert<string>(respect_os_kbd_language) << '\n';
2487 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2491 case RC_AUTO_NUMBER:
2492 if (ignore_system_lyxrc ||
2493 auto_number != system_lyxrc.auto_number) {
2494 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2499 case RC_GUI_LANGUAGE:
2500 if (ignore_system_lyxrc ||
2501 gui_language != system_lyxrc.gui_language) {
2502 os << "\\gui_language " << gui_language << '\n';
2507 case RC_EXPORT_OVERWRITE:
2508 if (ignore_system_lyxrc ||
2509 export_overwrite != system_lyxrc.export_overwrite) {
2511 switch (export_overwrite) {
2522 os << "\\export_overwrite " << status << '\n';
2527 case RC_SCROLL_WHEEL_ZOOM:
2528 if (ignore_system_lyxrc ||
2529 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2531 switch (scroll_wheel_zoom) {
2532 case SCROLL_WHEEL_ZOOM_OFF:
2535 case SCROLL_WHEEL_ZOOM_CTRL:
2538 case SCROLL_WHEEL_ZOOM_SHIFT:
2541 case SCROLL_WHEEL_ZOOM_ALT:
2545 os << "\\scroll_wheel_zoom " << status << '\n';
2551 << "# FORMATS SECTION ##########################\n"
2556 // New/modified formats
2557 for (Formats::const_iterator cit = theFormats().begin();
2558 cit != theFormats().end(); ++cit) {
2559 Format const * format =
2560 theSystemFormats().getFormat(cit->name());
2562 format->extensions() != cit->extensions() ||
2563 format->prettyname() != cit->prettyname() ||
2564 format->shortcut() != cit->shortcut() ||
2565 format->viewer() != cit->viewer() ||
2566 format->editor() != cit->editor() ||
2567 format->documentFormat() != cit->documentFormat() ||
2568 format->vectorFormat() != cit->vectorFormat() ||
2569 format->inExportMenu() != cit->inExportMenu() ||
2570 format->noMenu() != cit->noMenu() ||
2571 format->mime() != cit->mime()) {
2572 os << "\\format \"" << cit->name() << "\" \""
2573 << cit->extensions() << "\" \""
2574 << to_utf8(cit->prettyname()) << "\" \""
2575 << cit->shortcut() << "\" \""
2576 << escapeCommand(cit->viewer()) << "\" \""
2577 << escapeCommand(cit->editor()) << "\" \"";
2578 vector<string> flags;
2579 if (cit->documentFormat())
2580 flags.push_back("document");
2581 if (cit->vectorFormat())
2582 flags.push_back("vector");
2583 if (cit->zippedNative())
2584 flags.push_back("zipped=native");
2585 if (cit->inExportMenu())
2586 flags.push_back("menu=export");
2588 os << getStringFromVector(flags);
2589 os << "\" \"" << cit->mime() << "\"\n";
2593 // Look for deleted formats
2594 for (Formats::const_iterator cit = theSystemFormats().begin();
2595 cit != theSystemFormats().end(); ++cit)
2596 if (!theFormats().getFormat(cit->name()))
2597 os << "\\format \"" << cit->name()
2598 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2602 case RC_VIEWER_ALTERNATIVES: {
2603 Alternatives::const_iterator it = viewer_alternatives.begin();
2604 Alternatives::const_iterator const en = viewer_alternatives.end();
2605 Alternatives::const_iterator const sysend =
2606 system_lyxrc.viewer_alternatives.end();
2607 for (; it != en; ++it) {
2608 string const & fmt = it->first;
2609 CommandSet const & cmd = it->second;
2610 CommandSet::const_iterator sit = cmd.begin();
2611 CommandSet::const_iterator const sen = cmd.end();
2612 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2613 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2614 system_lyxrc.viewer_alternatives.find(fmt);
2615 for (; sit != sen; ++sit) {
2616 string const & cmd = *sit;
2617 if (ignore_system_lyxrc
2618 || sysfmt == sysend // format not found
2619 || sysfmt->second.count(cmd) == 0 // this command not found
2621 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2628 case RC_EDITOR_ALTERNATIVES: {
2629 Alternatives::const_iterator it = editor_alternatives.begin();
2630 Alternatives::const_iterator const en = editor_alternatives.end();
2631 Alternatives::const_iterator const sysend =
2632 system_lyxrc.editor_alternatives.end();
2633 for (; it != en; ++it) {
2634 string const & fmt = it->first;
2635 CommandSet const & cmd = it->second;
2636 CommandSet::const_iterator sit = cmd.begin();
2637 CommandSet::const_iterator const sen = cmd.end();
2638 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2639 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2640 system_lyxrc.editor_alternatives.find(fmt);
2641 for (; sit != sen; ++sit) {
2642 string const & cmd = *sit;
2643 if (ignore_system_lyxrc
2644 || sysfmt == sysend // format not found
2645 || sysfmt->second.count(cmd) == 0 // this command not found
2647 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2654 case RC_DEFAULT_OTF_VIEW_FORMAT:
2655 if ((ignore_system_lyxrc ||
2656 default_otf_view_format != system_lyxrc.default_otf_view_format)
2657 && !default_otf_view_format.empty()) {
2658 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2663 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2664 if ((ignore_system_lyxrc ||
2665 default_platex_view_format != system_lyxrc.default_platex_view_format)
2666 && !default_platex_view_format.empty()) {
2667 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2672 case RC_DEFAULT_VIEW_FORMAT:
2673 if (ignore_system_lyxrc ||
2674 default_view_format != system_lyxrc.default_view_format) {
2675 os << "\\default_view_format " << default_view_format << '\n';
2686 << "# CONVERTERS SECTION ##########################\n"
2691 // Look for new converters
2692 for (Converters::const_iterator cit = theConverters().begin();
2693 cit != theConverters().end(); ++cit) {
2694 Converter const * converter =
2695 theSystemConverters().getConverter(cit->from(),
2698 converter->command() != cit->command() ||
2699 converter->flags() != cit->flags())
2700 os << "\\converter \"" << cit->from() << "\" \""
2701 << cit->to() << "\" \""
2702 << escapeCommand(cit->command()) << "\" \""
2703 << cit->flags() << "\"\n";
2706 // New/modifed converters
2707 for (Converters::const_iterator cit = theSystemConverters().begin();
2708 cit != theSystemConverters().end(); ++cit)
2709 if (!theConverters().getConverter(cit->from(), cit->to()))
2710 os << "\\converter \"" << cit->from()
2711 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2718 << "# COPIERS SECTION ##########################\n"
2721 // Look for new movers
2722 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2723 Movers::const_iterator const sysend = theSystemMovers().end();
2724 Movers::const_iterator it = theMovers().begin();
2725 Movers::const_iterator end = theMovers().end();
2727 for (; it != end; ++it) {
2728 Movers::const_iterator const sysit =
2729 find_if(sysbegin, sysend, SameMover(*it));
2730 if (sysit == sysend) {
2731 string const & fmt = it->first;
2732 string const & command =
2733 it->second.command();
2735 os << "\\copier " << fmt
2736 << " \"" << escapeCommand(command) << "\"\n";
2742 // We don't actually delete SpecialisedMover(s) from the
2743 // map, just clear their 'command', so there's no need
2744 // to test for anything else.
2751 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2753 // Why the switch you might ask. It is a trick to ensure that all
2754 // the elements in the LyXRCTags enum is handled. As you can see
2755 // there are no breaks at all. So it is just a huge fall-through.
2756 // The nice thing is that we will get a warning from the compiler
2757 // if we forget an element.
2758 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2760 case LyXRC::RC_LAST:
2761 case LyXRC::RC_ACCEPT_COMPOUND:
2762 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2763 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2765 case LyXRC::RC_ALT_LANG:
2766 case LyXRC::RC_PLAINTEXT_LINELEN:
2767 case LyXRC::RC_AUTOCORRECTION_MATH:
2768 case LyXRC::RC_AUTOREGIONDELETE:
2769 case LyXRC::RC_AUTORESET_OPTIONS:
2770 case LyXRC::RC_AUTOSAVE:
2771 case LyXRC::RC_AUTO_NUMBER:
2772 case LyXRC::RC_BACKUPDIR_PATH:
2773 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2774 case LyXRC::RC_BIBTEX_COMMAND:
2775 case LyXRC::RC_BINDFILE:
2776 case LyXRC::RC_CHECKLASTFILES:
2777 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2778 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2779 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2780 case LyXRC::RC_COMPLETION_INLINE_MATH:
2781 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2782 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2783 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2784 case LyXRC::RC_COMPLETION_POPUP_MATH:
2785 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2786 case LyXRC::RC_COMPLETION_MINLENGTH:
2787 case LyXRC::RC_USELASTFILEPOS:
2788 case LyXRC::RC_LOADSESSION:
2789 case LyXRC::RC_CHKTEX_COMMAND:
2790 case LyXRC::RC_CONVERTER:
2791 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2792 case LyXRC::RC_COPIER:
2793 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2794 case LyXRC::RC_CT_MARKUP_COPIED:
2795 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2796 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2797 case LyXRC::RC_GUI_LANGUAGE:
2798 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2799 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2800 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2801 case LyXRC::RC_DEFFILE:
2802 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2803 case LyXRC::RC_DISPLAY_GRAPHICS:
2804 case LyXRC::RC_DOCUMENTPATH:
2805 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2806 FileName path(lyxrc_new.document_path);
2807 if (path.exists() && path.isDirectory())
2808 package().document_dir() = FileName(lyxrc.document_path);
2811 case LyXRC::RC_EDITOR_ALTERNATIVES:
2812 case LyXRC::RC_ESC_CHARS:
2813 case LyXRC::RC_EXAMPLEPATH:
2814 case LyXRC::RC_FILEFORMAT:
2815 case LyXRC::RC_GROUP_LAYOUTS:
2816 case LyXRC::RC_HUNSPELLDIR_PATH:
2817 case LyXRC::RC_ICON_SET:
2818 case LyXRC::RC_INDEX_ALTERNATIVES:
2819 case LyXRC::RC_INDEX_COMMAND:
2820 case LyXRC::RC_JBIBTEX_COMMAND:
2821 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2822 case LyXRC::RC_JINDEX_COMMAND:
2823 case LyXRC::RC_NOMENCL_COMMAND:
2824 case LyXRC::RC_PYGMENTIZE_COMMAND:
2825 case LyXRC::RC_INPUT:
2826 case LyXRC::RC_KBMAP:
2827 case LyXRC::RC_KBMAP_PRIMARY:
2828 case LyXRC::RC_KBMAP_SECONDARY:
2829 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2830 case LyXRC::RC_LANGUAGE_AUTO_END:
2831 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2832 case LyXRC::RC_LANGUAGE_COMMAND_END:
2833 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2834 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2835 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2836 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2837 case LyXRC::RC_LYXRCFORMAT:
2838 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2839 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2840 case LyXRC::RC_MACRO_EDIT_STYLE:
2841 case LyXRC::RC_MAKE_BACKUP:
2842 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2843 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2844 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2845 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2846 case LyXRC::RC_NUMLASTFILES:
2847 case LyXRC::RC_PARAGRAPH_MARKERS:
2848 case LyXRC::RC_PATH_PREFIX:
2849 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2850 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2851 // Resets python path
2852 support::os::python(true);
2855 case LyXRC::RC_PREVIEW:
2856 if (lyxrc_orig.preview != lyxrc_new.preview) {
2857 // Update all previews of all documents.
2858 /* FIXME: this can be very expensive. It would be cheaper
2859 * to kill all existing previews and update visible
2861 theBufferList().updatePreviews();
2864 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2865 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2866 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2867 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2868 case LyXRC::RC_PRINTPAPERFLAG:
2869 case LyXRC::RC_SAVE_COMPRESSED:
2870 case LyXRC::RC_SAVE_ORIGIN:
2871 case LyXRC::RC_SCREEN_DPI:
2873 case LyXRC::RC_SCREEN_FONT_ROMAN:
2874 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2875 case LyXRC::RC_SCREEN_FONT_SANS:
2876 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2877 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2878 case LyXRC::RC_SCREEN_FONT_SIZES:
2879 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2880 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2881 case LyXRC::RC_SCREEN_ZOOM:
2882 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2883 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2884 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2885 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2886 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2887 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2888 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2889 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2890 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2891 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2894 case LyXRC::RC_GEOMETRY_SESSION:
2895 case LyXRC::RC_SERVERPIPE:
2896 case LyXRC::RC_SET_COLOR:
2897 case LyXRC::RC_SHOW_BANNER:
2898 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2899 case LyXRC::RC_SPELLCHECKER:
2900 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2903 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2904 case LyXRC::RC_SPELLCHECK_NOTES:
2905 case LyXRC::RC_SPLITINDEX_COMMAND:
2906 case LyXRC::RC_TEMPDIRPATH:
2907 case LyXRC::RC_TEMPLATEPATH:
2908 case LyXRC::RC_TEX_ALLOWS_SPACES:
2909 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2910 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2911 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2914 case LyXRC::RC_TEXINPUTS_PREFIX:
2915 case LyXRC::RC_THESAURUSDIRPATH:
2916 case LyXRC::RC_UIFILE:
2917 case LyXRC::RC_USER_EMAIL:
2918 case LyXRC::RC_USER_INITIALS:
2919 case LyXRC::RC_USER_NAME:
2920 case LyXRC::RC_USE_CONVERTER_CACHE:
2921 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2922 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2923 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2924 case LyXRC::RC_USE_SYSTEM_COLORS:
2925 case LyXRC::RC_USE_TOOLTIP:
2926 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2927 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2928 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2929 case LyXRC::RC_SINGLE_INSTANCE:
2930 case LyXRC::RC_SORT_LAYOUTS:
2931 case LyXRC::RC_FULL_SCREEN_LIMIT:
2932 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2933 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2934 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2935 case LyXRC::RC_FULL_SCREEN_TABBAR:
2936 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2937 case LyXRC::RC_FULL_SCREEN_WIDTH:
2938 case LyXRC::RC_VISUAL_CURSOR:
2939 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2940 case LyXRC::RC_VIEWER:
2941 case LyXRC::RC_VIEWER_ALTERNATIVES:
2942 case LyXRC::RC_FORWARD_SEARCH_DVI:
2943 case LyXRC::RC_FORWARD_SEARCH_PDF:
2944 case LyXRC::RC_EXPORT_OVERWRITE:
2945 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2946 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2947 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2948 case LyXRC::RC_CURSOR_WIDTH:
2954 set<string> LyXRC::getRCs()
2957 for (int i = 0; i != lyxrcCount; ++i)
2958 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2964 string const LyXRC::getDescription(LyXRCTags tag)
2969 case RC_ACCEPT_COMPOUND:
2970 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2974 str = _("Specify an alternate language. The default is to use the language of the document.");
2977 case RC_PLAINTEXT_LINELEN:
2978 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.");
2981 case RC_AUTOREGIONDELETE:
2982 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2985 case RC_AUTORESET_OPTIONS:
2986 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2990 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2993 case RC_AUTO_NUMBER:
2996 case RC_BACKUPDIR_PATH:
2997 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.");
3000 case RC_BIBTEX_COMMAND:
3001 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3004 case RC_JBIBTEX_COMMAND:
3005 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3009 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3012 case RC_CHECKLASTFILES:
3013 str = _("Select to check whether the lastfiles still exist.");
3016 case RC_CHKTEX_COMMAND:
3017 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3023 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3024 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3027 case RC_CONVERTER_NEEDAUTH:
3028 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3034 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3035 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.");
3038 case RC_CURSOR_WIDTH:
3039 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3042 case RC_SCROLL_BELOW_DOCUMENT:
3043 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");
3046 case RC_MAC_DONTSWAP_CTRL_META:
3047 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3050 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3051 str = _("Use the Mac OS X conventions for cursor movement");
3054 case RC_SHOW_MACRO_LABEL:
3055 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3059 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3062 case RC_DEFAULT_OTF_VIEW_FORMAT:
3063 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3066 case RC_DEFAULT_VIEW_FORMAT:
3067 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3070 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3071 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3074 case RC_DISPLAY_GRAPHICS:
3075 str = _("Select how LyX will display any graphics.");
3078 case RC_DOCUMENTPATH:
3079 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3083 str = _("Specify additional chars that can be part of a word.");
3086 case RC_EXAMPLEPATH:
3087 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3093 case RC_INDEX_COMMAND:
3094 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\".");
3097 case RC_JINDEX_COMMAND:
3098 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3101 case RC_NOMENCL_COMMAND:
3102 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3105 case RC_PYGMENTIZE_COMMAND:
3106 str = _("The command to run the python pygments syntax highlighter.");
3113 case RC_KBMAP_PRIMARY:
3114 case RC_KBMAP_SECONDARY:
3115 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.");
3118 case RC_LANGUAGE_AUTO_BEGIN:
3119 str = _("Select if a language switching command is needed at the beginning of the document.");
3122 case RC_LANGUAGE_AUTO_END:
3123 str = _("Select if a language switching command is needed at the end of the document.");
3126 case RC_LANGUAGE_COMMAND_BEGIN:
3127 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.");
3130 case RC_LANGUAGE_COMMAND_END:
3131 str = _("The LaTeX command for changing back to the language of the document.");
3134 case RC_LANGUAGE_COMMAND_LOCAL:
3135 str = _("The LaTeX command for local changing of the language.");
3138 case RC_LANGUAGE_GLOBAL_OPTIONS:
3139 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3142 case RC_LANGUAGE_CUSTOM_PACKAGE:
3143 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3146 case RC_LANGUAGE_PACKAGE_SELECTION:
3147 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3150 case RC_USELASTFILEPOS:
3151 str = _("De-select if you do not want LyX to scroll to saved position.");
3154 case RC_LOADSESSION:
3155 str = _("De-select to prevent loading files opened from the last LyX session.");
3158 case RC_MAKE_BACKUP:
3159 str = _("De-select if you don't want LyX to create backup files.");
3162 case RC_MARK_FOREIGN_LANGUAGE:
3163 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3166 case RC_RESPECT_OS_KBD_LANGUAGE:
3167 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3170 case RC_MOUSE_WHEEL_SPEED:
3171 str = _("The scrolling speed of the mouse wheel.");
3174 case RC_COMPLETION_POPUP_DELAY:
3175 str = _("The completion popup delay.");
3178 case RC_COMPLETION_POPUP_MATH:
3179 str = _("Select to display the completion popup in math mode.");
3182 case RC_COMPLETION_POPUP_TEXT:
3183 str = _("Select to display the completion popup in text mode.");
3186 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3187 str = _("Show the completion popup without delay after non-unique completion attempt.");
3190 case RC_COMPLETION_POPUP_TEXT:
3191 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3194 case RC_COMPLETION_POPUP_DELAY:
3195 str = _("The inline completion delay.");
3198 case RC_COMPLETION_INLINE_MATH:
3199 str = _("Select to display the inline completion in math mode.");
3202 case RC_COMPLETION_INLINE_TEXT:
3203 str = _("Select to display the inline completion in text mode.");
3206 case RC_COMPLETION_INLINE_DOTS:
3207 str = _("Use \"...\" to shorten long completions.");
3210 case RC_AUTOCORRECTION_MATH:
3211 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3214 case RC_NUMLASTFILES:
3215 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3219 case RC_PATH_PREFIX:
3220 str = _("Specify those directories which should be "
3221 "prepended to the PATH environment variable.\n"
3222 "Use the OS native format.");
3226 str = _("Shows a typeset preview of things such as math");
3229 case RC_PREVIEW_HASHED_LABELS:
3230 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3233 case RC_PREVIEW_SCALE_FACTOR:
3234 str = _("Scale the preview size to suit.");
3237 case RC_PRINTLANDSCAPEFLAG:
3238 str = _("The option to print out in landscape.");
3241 case RC_PRINTPAPERDIMENSIONFLAG:
3242 str = _("Option to specify the dimensions of the print paper.");
3245 case RC_PRINTPAPERFLAG:
3246 str = _("The option to specify paper type.");
3249 case RC_VISUAL_CURSOR:
3250 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3253 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3254 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).");
3258 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3261 case RC_SCREEN_FONT_ROMAN:
3262 case RC_SCREEN_FONT_SANS:
3263 case RC_SCREEN_FONT_TYPEWRITER:
3264 str = _("The screen fonts used to display the text while editing.");
3267 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3268 case RC_SCREEN_FONT_SANS_FOUNDRY:
3269 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3272 case RC_SCREEN_FONT_SCALABLE:
3273 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.");
3276 case RC_SCREEN_FONT_SIZES:
3277 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3280 case RC_SCREEN_ZOOM:
3281 //xgettext:no-c-format
3282 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3285 case RC_GEOMETRY_SESSION:
3286 str = _("Allow session manager to save and restore windows geometry.");
3290 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3296 case RC_SHOW_BANNER:
3297 str = _("De-select if you don't want the startup banner.");
3300 case RC_TEMPDIRPATH:
3301 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3304 case RC_THESAURUSDIRPATH:
3305 str = _("This is the place where the files of the thesaurus library reside.");
3308 case RC_TEMPLATEPATH:
3309 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3312 case RC_TEX_ALLOWS_SPACES:
3315 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3318 case RC_TEXINPUTS_PREFIX:
3319 str = _("Specify those directories which should be "
3320 "prepended to the TEXINPUTS environment variable.\n"
3321 "A '.' represents the current document directory. "
3322 "Use the OS native format.");
3326 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3335 case RC_USE_USE_SYSTEM_COLORS:
3336 str = _("Enable use the system colors for some things like main window background and selection.");
3339 case RC_USE_TOOLTIP:
3340 str = _("Enable the automatic appearance of tool tips in the work area.");
3343 case RC_VIEWDVI_PAPEROPTION:
3344 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3359 // The global instance
3362 // The global copy of the system lyxrc entries (everything except preferences)