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 = 30; // lasgouttes: add \respect_os_kbd_language
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 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
96 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
97 { "\\def_file", LyXRC::RC_DEFFILE },
98 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
99 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
100 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
101 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
102 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
103 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
104 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
105 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
106 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
107 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
108 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
109 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
110 { "\\format", LyXRC::RC_FILEFORMAT },
111 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
112 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
113 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
114 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
115 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
116 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
117 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
118 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
119 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
120 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
121 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
122 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
123 { "\\icon_set", LyXRC::RC_ICON_SET },
124 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
125 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
126 { "\\input", LyXRC::RC_INPUT },
127 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
128 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
129 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
130 { "\\kbmap", LyXRC::RC_KBMAP },
131 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
132 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
133 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
134 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
135 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
136 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
137 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
138 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
139 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
140 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
141 { "\\load_session", LyXRC::RC_LOADSESSION },
142 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
143 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
144 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
145 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
146 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
147 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
148 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
149 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
150 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
151 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
152 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
153 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
154 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
155 { "\\preview", LyXRC::RC_PREVIEW },
156 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
157 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
160 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
161 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
162 { "\\respect_os_kbd_language", LyXRC::RC_RESPECT_OS_KBD_LANGUAGE },
163 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
164 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
165 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
166 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
167 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
168 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
169 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
170 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
171 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
172 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
173 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
174 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
175 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
176 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
177 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
178 { "\\set_color", LyXRC::RC_SET_COLOR },
179 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
180 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
181 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
182 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
183 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
184 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
185 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
186 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
187 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
188 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
189 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
190 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
191 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
192 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
193 { "\\ui_file", LyXRC::RC_UIFILE },
194 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
195 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
196 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
197 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
198 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
201 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
202 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
203 { "\\user_email", LyXRC::RC_USER_EMAIL },
204 { "\\user_initials", LyXRC::RC_USER_INITIALS },
205 { "\\user_name", LyXRC::RC_USER_NAME },
206 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
207 // compatibility with versions older than 1.4.0 only
208 { "\\viewer", LyXRC::RC_VIEWER},
209 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
210 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
211 { "format", LyXRC::RC_LYXRCFORMAT }
214 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
217 void oldFontFormat(string & family, string & foundry)
219 if (family.empty() || family[0] != '-')
221 foundry = token(family, '-', 1);
222 family = token(family, '-', 2);
230 bool LyXRC::read(FileName const & filename, bool check_format)
232 Lexer lexrc(lyxrcTags);
233 lexrc.setFile(filename);
234 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
235 ReturnValues retval = read(lexrc, check_format);
236 if (!check_format || retval != FormatMismatch)
237 return retval == ReadOK;
239 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
240 TempFile tmp("convert_lyxrc");
241 FileName const tempfile = tmp.name();
242 bool const success = prefs2prefs(filename, tempfile, false);
244 LYXERR0 ("Unable to convert " << filename.absFileName() <<
245 " to format " << LYXRC_FILEFORMAT);
248 // Keep this in the else branch, such that lexrc2 goes out
249 // of scope and releases the lock on tempfile before we
250 // attempt to remove it. This matters on Windows.
251 Lexer lexrc2(lyxrcTags);
252 lexrc2.setFile(tempfile);
253 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
254 retval = read(lexrc2, check_format);
255 if (retval == FormatMismatch)
256 LYXERR0("Conversion failed for " << filename.absFileName());
258 return retval == ReadOK;
262 // don't need to worry about conversion, because this is always
263 // from an internal source
264 bool LyXRC::read(istream & is)
266 Lexer lexrc(lyxrcTags);
268 LYXERR(Debug::LYXRC, "Reading istream...");
269 return read(lexrc, false) == ReadOK;
273 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
275 if (lyxerr.debugging(Debug::PARSER))
276 lexrc.printTable(lyxerr);
281 // format prior to 2.0 and introduction of format tag
282 unsigned int rc_format = 0;
284 while (lexrc.isOK()) {
285 // By using two switches we take advantage of the compiler
286 // telling us if we have missed a LyXRCTags element in
287 // the second switch.
288 // Note that this also shows a problem with Lexer since it
289 // helps us avoid taking advantage of the strictness of the
292 int le = lexrc.lex();
294 case Lexer::LEX_UNDEF:
295 lexrc.printError("Unknown tag `$$Token'");
297 case Lexer::LEX_FEOF:
302 switch (static_cast<LyXRCTags>(le)) {
305 rc_format = lexrc.getInteger();
307 case RC_INPUT: // Include file
310 libFileSearch(string(),
312 if (!read(tmp, check_format)) {
314 "Error reading included file: " + tmp.absFileName());
320 bind_file = os::internal_path(lexrc.getString());
325 def_file = os::internal_path(lexrc.getString());
330 ui_file = os::internal_path(lexrc.getString());
333 case RC_AUTORESET_OPTIONS:
334 lexrc >> auto_reset_options;
337 case RC_DISPLAY_GRAPHICS:
339 display_graphics = lexrc.getString() == "true";
342 case RC_TEX_EXPECTS_WINDOWS_PATHS:
343 lexrc >> windows_style_tex_paths;
346 case RC_TEX_ALLOWS_SPACES:
347 lexrc >> tex_allows_spaces;
350 case RC_TEXINPUTS_PREFIX:
351 lexrc >> texinputs_prefix;
358 case RC_KBMAP_PRIMARY:
360 string const kmap(os::internal_path(lexrc.getString()));
361 if (!libFileSearch("kbd", kmap, "kmap").empty()
363 primary_kbmap = kmap;
365 lexrc.printError("LyX: Keymap `$$Token' not found");
370 case RC_KBMAP_SECONDARY:
372 string const kmap(os::internal_path(lexrc.getString()));
373 if (!libFileSearch("kbd", kmap, "kmap").empty()
375 secondary_kbmap = kmap;
377 lexrc.printError("LyX: Keymap `$$Token' not found");
382 case RC_PRINTLANDSCAPEFLAG:
383 lexrc >> print_landscape_flag;
386 case RC_PRINTPAPERDIMENSIONFLAG:
387 lexrc >> print_paper_dimension_flag;
390 case RC_PRINTPAPERFLAG:
391 lexrc >> print_paper_flag;
394 case RC_PYGMENTIZE_COMMAND:
395 if (lexrc.next(true)) {
396 pygmentize_command = lexrc.getString();
400 case RC_VIEWDVI_PAPEROPTION:
402 view_dvi_paper_option = lexrc.getString();
404 view_dvi_paper_option.erase();
407 case RC_CHKTEX_COMMAND:
408 if (lexrc.next(true)) {
409 chktex_command = lexrc.getString();
413 case RC_BIBTEX_ALTERNATIVES:
414 if (lexrc.next(true)) {
415 bibtex_alternatives.insert(lexrc.getString());
419 case RC_BIBTEX_COMMAND:
420 if (lexrc.next(true)) {
421 bibtex_command = lexrc.getString();
425 case RC_JBIBTEX_COMMAND:
426 if (lexrc.next(true)) {
427 jbibtex_command = lexrc.getString();
431 case RC_JBIBTEX_ALTERNATIVES:
432 if (lexrc.next(true)) {
433 jbibtex_alternatives.insert(lexrc.getString());
437 case RC_INDEX_ALTERNATIVES:
438 if (lexrc.next(true)) {
439 index_alternatives.insert(lexrc.getString());
443 case RC_INDEX_COMMAND:
444 if (lexrc.next(true)) {
445 index_command = lexrc.getString();
449 case RC_JINDEX_COMMAND:
450 if (lexrc.next(true)) {
451 jindex_command = lexrc.getString();
455 case RC_SPLITINDEX_COMMAND:
456 if (lexrc.next(true)) {
457 splitindex_command = lexrc.getString();
461 case RC_NOMENCL_COMMAND:
462 if (lexrc.next(true)) {
463 nomencl_command = lexrc.getString();
472 lexrc >> defaultZoom;
473 if (defaultZoom < 10)
477 case RC_GEOMETRY_SESSION:
478 lexrc >> allow_geometry_session;
481 case RC_SCREEN_FONT_SIZES:
482 lexrc >> font_sizes[TINY_SIZE];
483 lexrc >> font_sizes[SCRIPT_SIZE];
484 lexrc >> font_sizes[FOOTNOTE_SIZE];
485 lexrc >> font_sizes[SMALL_SIZE];
486 lexrc >> font_sizes[NORMAL_SIZE];
487 lexrc >> font_sizes[LARGE_SIZE];
488 lexrc >> font_sizes[LARGER_SIZE];
489 lexrc >> font_sizes[LARGEST_SIZE];
490 lexrc >> font_sizes[HUGE_SIZE];
491 lexrc >> font_sizes[HUGER_SIZE];
494 case RC_SCREEN_FONT_SCALABLE:
495 lexrc >> use_scalable_fonts;
502 case RC_DOCUMENTPATH:
504 document_path = os::internal_path(lexrc.getString());
509 example_path = os::internal_path(lexrc.getString());
512 case RC_TEMPLATEPATH:
514 template_path = os::internal_path(lexrc.getString());
519 tempdir_path = os::internal_path(lexrc.getString());
522 case RC_THESAURUSDIRPATH:
524 thesaurusdir_path = os::internal_path(lexrc.getString());
527 case RC_HUNSPELLDIR_PATH:
529 hunspelldir_path = os::internal_path(lexrc.getString());
532 case RC_USELASTFILEPOS:
533 lexrc >> use_lastfilepos;
537 lexrc >> load_session;
540 case RC_MOUSE_WHEEL_SPEED:
541 lexrc >> mouse_wheel_speed;
544 case RC_COMPLETION_INLINE_DELAY:
545 lexrc >> completion_inline_delay;
548 case RC_COMPLETION_INLINE_MATH:
549 lexrc >> completion_inline_math;
552 case RC_COMPLETION_INLINE_TEXT:
553 lexrc >> completion_inline_text;
556 case RC_COMPLETION_INLINE_DOTS:
557 lexrc >> completion_inline_dots;
560 case RC_AUTOCORRECTION_MATH:
561 lexrc >> autocorrection_math;
564 case RC_COMPLETION_POPUP_DELAY:
565 lexrc >> completion_popup_delay;
568 case RC_COMPLETION_POPUP_MATH:
569 lexrc >> completion_popup_math;
572 case RC_COMPLETION_POPUP_TEXT:
573 lexrc >> completion_popup_text;
576 case RC_COMPLETION_CURSOR_TEXT:
577 lexrc >> completion_cursor_text;
580 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
581 lexrc >> completion_popup_after_complete;
584 case RC_COMPLETION_MINLENGTH:
585 lexrc >> completion_minlength;
588 case RC_NUMLASTFILES:
589 lexrc >> num_lastfiles;
592 case RC_CHECKLASTFILES:
593 lexrc >> check_lastfiles;
600 case RC_USE_SYSTEM_THEME_ICONS:
601 lexrc >> use_system_theme_icons;
604 case RC_SCREEN_FONT_ROMAN:
606 roman_font_name = lexrc.getString();
607 oldFontFormat(roman_font_name,
612 case RC_SCREEN_FONT_SANS:
614 sans_font_name = lexrc.getString();
615 oldFontFormat(sans_font_name, sans_font_foundry);
619 case RC_SCREEN_FONT_TYPEWRITER:
621 typewriter_font_name = lexrc.getString();
622 oldFontFormat(typewriter_font_name,
623 typewriter_font_foundry);
627 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
628 lexrc >> roman_font_foundry;
631 case RC_SCREEN_FONT_SANS_FOUNDRY:
632 lexrc >> sans_font_foundry;
635 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
636 lexrc >> typewriter_font_foundry;
641 lexrc.printError("Missing color tag.");
644 string lyx_name = lexrc.getString();
647 lexrc.printError("Missing color name for color: `$$Token'");
650 string x11_name = lexrc.getString();
652 ColorCode const col =
653 lcolor.getFromLyXName(lyx_name);
654 if (col == Color_none ||
655 col == Color_inherit ||
659 if (!lcolor.setColor(col, x11_name))
660 LYXERR0("Bad lyxrc set_color for " << lyx_name);
664 case RC_AUTOREGIONDELETE:
665 // Auto region delete defaults to true
666 lexrc >> auto_region_delete;
671 lyxpipes = os::internal_path(lexrc.getString());
674 case RC_CURSOR_FOLLOWS_SCROLLBAR:
675 lexrc >> cursor_follows_scrollbar;
678 case RC_CURSOR_WIDTH:
679 lexrc >> cursor_width;
682 case RC_SCROLL_BELOW_DOCUMENT:
683 lexrc >> scroll_below_document;
686 case RC_PARAGRAPH_MARKERS:
687 lexrc >> paragraph_markers;
690 case RC_MAC_DONTSWAP_CTRL_META:
691 lexrc >> mac_dontswap_ctrl_meta;
694 case RC_MAC_LIKE_CURSOR_MOVEMENT:
695 lexrc >> mac_like_cursor_movement;
698 case RC_MACRO_EDIT_STYLE:
700 switch (lexrc.getInteger()) {
701 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
702 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
703 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
708 case RC_DIALOGS_ICONIFY_WITH_MAIN:
709 lexrc >> dialogs_iconify_with_main;
712 case RC_PLAINTEXT_LINELEN:
713 lexrc >> plaintext_linelen;
715 // Spellchecker settings:
716 case RC_ACCEPT_COMPOUND:
717 lexrc >> spellchecker_accept_compound;
719 case RC_USE_NATIVE_FILEDIALOG:
720 lexrc >> use_native_filedialog;
722 case RC_USE_SYSTEM_COLORS:
723 lexrc >> use_system_colors;
726 lexrc >> use_tooltip;
728 case RC_SPELLCHECKER:
729 lexrc >> spellchecker;
732 lexrc >> spellchecker_alt_lang;
735 lexrc >> spellchecker_esc_chars;
737 case RC_SPELLCHECK_CONTINUOUSLY:
738 lexrc >> spellcheck_continuously;
740 case RC_SPELLCHECK_NOTES:
741 lexrc >> spellcheck_notes;
744 lexrc >> make_backup;
746 case RC_SAVE_COMPRESSED:
747 lexrc >> save_compressed;
750 lexrc >> save_origin;
752 case RC_BACKUPDIR_PATH:
754 backupdir_path = os::internal_path(lexrc.getString());
756 case RC_DEFAULT_DECIMAL_SEP:
757 lexrc >> default_decimal_sep;
759 case RC_DEFAULT_LENGTH_UNIT:
761 default_length_unit = (Length::UNIT) lexrc.getInteger();
763 case RC_LANGUAGE_CUSTOM_PACKAGE:
764 lexrc >> language_custom_package;
766 case RC_LANGUAGE_AUTO_BEGIN:
767 lexrc >> language_auto_begin;
769 case RC_LANGUAGE_AUTO_END:
770 lexrc >> language_auto_end;
772 case RC_LANGUAGE_GLOBAL_OPTIONS:
773 lexrc >> language_global_options;
775 case RC_LANGUAGE_PACKAGE_SELECTION:
777 switch (lexrc.getInteger()) {
779 language_package_selection = LP_AUTO;
782 language_package_selection = LP_BABEL;
785 language_package_selection = LP_CUSTOM;
788 language_package_selection = LP_NONE;
793 case RC_LANGUAGE_COMMAND_BEGIN:
794 lexrc >> language_command_begin;
796 case RC_LANGUAGE_COMMAND_END:
797 lexrc >> language_command_end;
799 case RC_LANGUAGE_COMMAND_LOCAL:
800 lexrc >> language_command_local;
802 case RC_RESPECT_OS_KBD_LANGUAGE:
803 lexrc >> respect_os_kbd_language;
805 case RC_VISUAL_CURSOR:
806 lexrc >> visual_cursor;
808 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
809 lexrc >> close_buffer_with_last_view;
812 lexrc >> auto_number;
814 case RC_MARK_FOREIGN_LANGUAGE:
815 lexrc >> mark_foreign_language;
821 fmt = lexrc.getString();
822 if (lexrc.next(true))
823 command = lexrc.getString();
824 setMover(fmt, command);
829 string from, to, command, flags;
831 from = lexrc.getString();
833 to = lexrc.getString();
834 if (lexrc.next(true))
835 command = lexrc.getString();
837 flags = lexrc.getString();
839 theConverters().erase(from, to);
841 theConverters().add(from, to, command, flags);
844 // compatibility with versions older than 1.4.0 only
846 string format, command;
847 lexrc >> format >> command;
848 theFormats().setViewer(format, command);
851 case RC_FILEFORMAT: {
853 string format, extensions, shortcut;
854 docstring prettyname;
855 if (!(lexrc >> format >> extensions))
857 if (ok && lexrc.next(true))
858 prettyname = lexrc.getDocString();
862 if(!(lexrc >> shortcut))
864 string viewer, editor;
865 if (ok && lexrc.next(true))
866 viewer = lexrc.getString();
869 if (ok && lexrc.next(true))
870 editor = lexrc.getString();
874 if (!(lexrc >> flags >> mime))
876 int flgs = Format::none;
877 while (!flags.empty()) {
879 flags = split(flags, flag, ',');
880 if (flag == "document")
881 flgs |= Format::document;
882 else if (flag == "vector")
883 flgs |= Format::vector;
884 else if (flag == "zipped=native")
885 flgs |= Format::zipped_native;
886 else if (flag == "menu=export")
887 flgs |= Format::export_menu;
888 else if (flag == "menu=none")
889 flgs |= Format::no_menu;
891 LYXERR0("Ignoring unknown flag `"
892 << flag << "' for format `"
896 LYXERR0("Syntax error in format " << format);
897 else if (prettyname.empty()) {
898 if (theConverters().formatIsUsed(format))
899 LYXERR0("Can't delete format " << format);
901 theFormats().erase(format);
903 theFormats().add(format, extensions, prettyname,
904 shortcut, viewer, editor, mime, flgs);
908 case RC_VIEWER_ALTERNATIVES: {
909 string format, command;
910 if ((lexrc >> format) && lexrc.next(true)) {
911 command = lexrc.getString();
912 viewer_alternatives[format].insert(command);
916 case RC_EDITOR_ALTERNATIVES: {
917 string format, command;
918 if ((lexrc >> format) && lexrc.next(true)) {
919 command = lexrc.getString();
920 editor_alternatives[format].insert(command);
925 case RC_DEFAULT_OTF_VIEW_FORMAT:
926 lexrc >> default_otf_view_format;
929 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
930 lexrc >> default_platex_view_format;
933 case RC_DEFAULT_VIEW_FORMAT:
934 lexrc >> default_view_format;
937 case RC_GUI_LANGUAGE:
938 lexrc >> gui_language;
942 lexrc >> show_banner;
947 string const tmp = lexrc.getString();
948 if (tmp == "true" || tmp == "on")
949 preview = PREVIEW_ON;
950 else if (tmp == "no_math")
951 preview = PREVIEW_NO_MATH;
953 preview = PREVIEW_OFF;
954 if (tmp != "false" && tmp != "off")
955 LYXERR0("Unrecognized preview status \""
961 case RC_PREVIEW_HASHED_LABELS:
962 lexrc >> preview_hashed_labels;
965 case RC_PREVIEW_SCALE_FACTOR:
966 lexrc >> preview_scale_factor;
975 case RC_USER_INITIALS:
976 lexrc >> user_initials;
980 lexrc >> path_prefix;
983 case RC_USE_CONVERTER_CACHE:
984 lexrc >> use_converter_cache;
986 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
987 lexrc >> use_converter_needauth_forbidden;
989 case RC_USE_CONVERTER_NEEDAUTH:
990 lexrc >> use_converter_needauth;
992 case RC_CONVERTER_CACHE_MAXAGE:
993 lexrc >> converter_cache_maxage;
996 case RC_SORT_LAYOUTS:
997 lexrc >> sort_layouts;
999 case RC_GROUP_LAYOUTS:
1000 lexrc >> group_layouts;
1002 case RC_FULL_SCREEN_LIMIT:
1003 lexrc >> full_screen_limit;
1005 case RC_FULL_SCREEN_TOOLBARS:
1006 lexrc >> full_screen_toolbars;
1008 case RC_FULL_SCREEN_SCROLLBAR:
1009 lexrc >> full_screen_scrollbar;
1011 case RC_FULL_SCREEN_STATUSBAR:
1012 lexrc >> full_screen_statusbar;
1014 case RC_FULL_SCREEN_TABBAR:
1015 lexrc >> full_screen_tabbar;
1017 case RC_FULL_SCREEN_MENUBAR:
1018 lexrc >> full_screen_menubar;
1020 case RC_FULL_SCREEN_WIDTH:
1021 lexrc >> full_screen_width;
1023 case RC_OPEN_BUFFERS_IN_TABS:
1024 lexrc >> open_buffers_in_tabs;
1026 case RC_SINGLE_CLOSE_TAB_BUTTON:
1027 lexrc >> single_close_tab_button;
1029 case RC_SINGLE_INSTANCE:
1030 lexrc >> single_instance;
1031 if (run_mode == PREFERRED)
1032 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1034 case RC_FORWARD_SEARCH_DVI:
1035 if (lexrc.next(true))
1036 forward_search_dvi = lexrc.getString();
1038 case RC_FORWARD_SEARCH_PDF:
1039 if (lexrc.next(true))
1040 forward_search_pdf = lexrc.getString();
1042 case RC_EXPORT_OVERWRITE:
1044 string const tmp = lexrc.getString();
1045 if (tmp == "all" || tmp == "true")
1046 export_overwrite = ALL_FILES;
1047 else if (tmp == "main")
1048 export_overwrite = MAIN_FILE;
1050 export_overwrite = NO_FILES;
1051 if (tmp != "ask" && tmp != "false")
1052 LYXERR0("Unrecognized export_overwrite status \""
1057 case RC_SCROLL_WHEEL_ZOOM:
1059 string const tmp = lexrc.getString();
1061 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1062 else if (tmp == "shift")
1063 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1064 else if (tmp == "alt")
1065 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1067 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1068 if (tmp != "off" && tmp != "false")
1069 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1075 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1076 lexrc >> mouse_middlebutton_paste;
1080 break; // this is just a dummy
1083 // This is triggered the first time through the loop unless
1084 // we hit a format tag.
1085 if (check_format && rc_format != LYXRC_FILEFORMAT)
1086 return FormatMismatch;
1089 /// Update converters data-structures
1090 theConverters().update(theFormats());
1091 theConverters().buildGraph();
1092 theBufferList().invalidateConverterCache();
1098 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1100 ofstream ofs(filename.toFilesystemEncoding().c_str());
1102 write(ofs, ignore_system_lyxrc);
1106 void LyXRC::print() const
1108 if (lyxerr.debugging())
1109 write(lyxerr, false);
1117 typedef pair<string, SpecialisedMover> Data;
1119 SameMover(Data const & comparison)
1120 : comparison_(comparison) {}
1122 bool operator()(Data const & data) const
1124 return data.first == comparison_.first &&
1125 data.second.command() == comparison_.second.command();
1135 // Escape \ and " so that LyXLex can read the string later
1136 string escapeCommand(string const & str) {
1137 return subst(subst(str , "\\", "\\\\"),
1144 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1146 LyXRCTags tag = RC_LAST;
1148 if (!name.empty()) {
1149 for (int i = 0; i != lyxrcCount; ++i)
1150 if ("\\" + name == lyxrcTags[i].tag)
1151 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1155 os << "# LyX " << lyx_version
1156 << " generated this file. If you want to make your own\n"
1157 << "# modifications you should do them from inside LyX and save.\n\n"
1158 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1160 // Why the switch you might ask. It is a trick to ensure that all
1161 // the elements in the LyXRCTags enum are handled. As you can see
1162 // there are no breaks at all. So it is just a huge fall-through.
1163 // The nice thing is that we will get a warning from the compiler
1164 // if we forget an element.
1168 // input/include files are not done here
1169 case RC_LYXRCFORMAT:
1171 if (ignore_system_lyxrc ||
1172 bind_file != system_lyxrc.bind_file) {
1173 string const path = os::external_path(bind_file);
1174 os << "\\bind_file \"" << path << "\"\n";
1180 if (ignore_system_lyxrc ||
1181 def_file != system_lyxrc.def_file) {
1182 string const path = os::external_path(def_file);
1183 os << "\\def_file \"" << path << "\"\n";
1192 << "# MISC SECTION ######################################\n"
1194 // bind files are not done here.
1196 case RC_PATH_PREFIX:
1197 if (ignore_system_lyxrc ||
1198 path_prefix != system_lyxrc.path_prefix) {
1199 os << "\\path_prefix \"" << path_prefix << "\"\n";
1205 if (ignore_system_lyxrc ||
1206 ui_file != system_lyxrc.ui_file) {
1207 string const path = os::external_path(ui_file);
1208 os << "\\ui_file \"" << path << "\"\n";
1213 case RC_AUTOREGIONDELETE:
1214 if (ignore_system_lyxrc ||
1215 auto_region_delete != system_lyxrc.auto_region_delete) {
1216 os << "# Set to false to inhibit automatic replacement of\n"
1217 << "# the current selection.\n"
1218 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1224 case RC_AUTORESET_OPTIONS:
1225 if (ignore_system_lyxrc ||
1226 auto_reset_options != system_lyxrc.auto_reset_options) {
1227 os << "# Set to false to inhibit automatic reset of\n"
1228 << "# the class options to defaults on class change.\n"
1229 << "\\auto_reset_options "
1230 << convert<string>(auto_reset_options)
1237 if (ignore_system_lyxrc ||
1238 autosave != system_lyxrc.autosave) {
1239 os << "# The time interval between auto-saves in seconds.\n"
1240 << "\\autosave " << autosave << '\n';
1245 case RC_DISPLAY_GRAPHICS:
1246 if (ignore_system_lyxrc ||
1247 display_graphics != system_lyxrc.display_graphics) {
1248 os << "# Display graphics within LyX\n"
1250 << "\\display_graphics "
1251 << (display_graphics ? "true" : "false")
1257 case RC_SORT_LAYOUTS:
1258 if (ignore_system_lyxrc ||
1259 sort_layouts != system_lyxrc.sort_layouts) {
1260 os << "# Sort layouts alphabetically.\n"
1261 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1266 case RC_GROUP_LAYOUTS:
1267 if (ignore_system_lyxrc ||
1268 group_layouts != system_lyxrc.group_layouts) {
1269 os << "# Group layouts by their category.\n"
1270 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1275 case RC_VIEWDVI_PAPEROPTION:
1276 if (ignore_system_lyxrc ||
1277 view_dvi_paper_option
1278 != system_lyxrc.view_dvi_paper_option) {
1279 os << "# Options used to specify paper size to the\n"
1280 << "# view_dvi_command (e.g. -paper)\n"
1281 << "\\view_dvi_paper_option \""
1282 << view_dvi_paper_option << "\"\n";
1287 case RC_CHKTEX_COMMAND:
1288 if (ignore_system_lyxrc ||
1289 chktex_command != system_lyxrc.chktex_command) {
1290 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1295 case RC_BIBTEX_ALTERNATIVES: {
1296 CommandSet::const_iterator it = bibtex_alternatives.begin();
1297 CommandSet::const_iterator end = bibtex_alternatives.end();
1298 for ( ; it != end; ++it) {
1299 if (ignore_system_lyxrc
1300 || !system_lyxrc.bibtex_alternatives.count(*it))
1301 os << "\\bibtex_alternatives \""
1308 case RC_BIBTEX_COMMAND:
1309 if (ignore_system_lyxrc ||
1310 bibtex_command != system_lyxrc.bibtex_command) {
1311 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1316 case RC_JBIBTEX_COMMAND:
1317 if (ignore_system_lyxrc ||
1318 jbibtex_command != system_lyxrc.jbibtex_command) {
1319 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1324 case RC_JBIBTEX_ALTERNATIVES: {
1325 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1326 CommandSet::const_iterator end = jbibtex_alternatives.end();
1327 for ( ; it != end; ++it) {
1328 if (ignore_system_lyxrc
1329 || !system_lyxrc.jbibtex_alternatives.count(*it))
1330 os << "\\jbibtex_alternatives \""
1337 case RC_INDEX_ALTERNATIVES: {
1338 CommandSet::const_iterator it = index_alternatives.begin();
1339 CommandSet::const_iterator end = index_alternatives.end();
1340 for ( ; it != end; ++it) {
1341 if (ignore_system_lyxrc
1342 || !system_lyxrc.index_alternatives.count(*it))
1343 os << "\\index_alternatives \""
1350 case RC_INDEX_COMMAND:
1351 if (ignore_system_lyxrc ||
1352 index_command != system_lyxrc.index_command) {
1353 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1358 case RC_JINDEX_COMMAND:
1359 if (ignore_system_lyxrc ||
1360 jindex_command != system_lyxrc.jindex_command) {
1361 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1366 case RC_SPLITINDEX_COMMAND:
1367 if (ignore_system_lyxrc ||
1368 splitindex_command != system_lyxrc.splitindex_command) {
1369 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1374 case RC_NOMENCL_COMMAND:
1375 if (ignore_system_lyxrc ||
1376 nomencl_command != system_lyxrc.nomencl_command) {
1377 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1382 case RC_PYGMENTIZE_COMMAND:
1383 if (ignore_system_lyxrc ||
1384 pygmentize_command != system_lyxrc.pygmentize_command) {
1385 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1390 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1391 // Don't write this setting to the preferences file,
1392 // but allow temporary changes (bug 7557).
1393 if (ignore_system_lyxrc) {
1394 os << "\\tex_expects_windows_paths "
1395 << convert<string>(windows_style_tex_paths) << '\n';
1400 case RC_TEX_ALLOWS_SPACES:
1401 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1402 os << "\\tex_allows_spaces "
1403 << convert<string>(tex_allows_spaces) << '\n';
1409 if (ignore_system_lyxrc ||
1410 use_kbmap != system_lyxrc.use_kbmap) {
1411 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1416 case RC_KBMAP_PRIMARY:
1417 if (ignore_system_lyxrc ||
1418 primary_kbmap != system_lyxrc.primary_kbmap) {
1419 string const path = os::external_path(primary_kbmap);
1420 os << "\\kbmap_primary \"" << path << "\"\n";
1425 case RC_KBMAP_SECONDARY:
1426 if (ignore_system_lyxrc ||
1427 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1428 string const path = os::external_path(secondary_kbmap);
1429 os << "\\kbmap_secondary \"" << path << "\"\n";
1435 if (ignore_system_lyxrc ||
1436 lyxpipes != system_lyxrc.lyxpipes) {
1437 string const path = os::external_path(lyxpipes);
1438 os << "\\serverpipe \"" << path << "\"\n";
1444 os << "\\user_name \"" << user_name << "\"\n";
1449 os << "\\user_email \"" << user_email << "\"\n";
1453 case RC_USER_INITIALS:
1454 os << "\\user_initials \"" << user_initials << "\"\n";
1458 case RC_SHOW_BANNER:
1459 if (ignore_system_lyxrc ||
1460 show_banner != system_lyxrc.show_banner) {
1461 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1467 if (ignore_system_lyxrc ||
1468 preview != system_lyxrc.preview) {
1474 case PREVIEW_NO_MATH:
1481 os << "\\preview " << status << '\n';
1486 case RC_PREVIEW_HASHED_LABELS:
1487 if (ignore_system_lyxrc ||
1488 preview_hashed_labels !=
1489 system_lyxrc.preview_hashed_labels) {
1490 os << "\\preview_hashed_labels "
1491 << convert<string>(preview_hashed_labels) << '\n';
1496 case RC_PREVIEW_SCALE_FACTOR:
1497 if (ignore_system_lyxrc ||
1498 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1499 os << "\\preview_scale_factor "
1500 << preview_scale_factor << '\n';
1505 case RC_USE_CONVERTER_CACHE:
1506 if (ignore_system_lyxrc ||
1507 use_converter_cache != system_lyxrc.use_converter_cache) {
1508 os << "\\use_converter_cache "
1509 << convert<string>(use_converter_cache) << '\n';
1514 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1515 if (ignore_system_lyxrc ||
1516 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1517 os << "\\use_converter_needauth_forbidden "
1518 << convert<string>(use_converter_needauth_forbidden) << '\n';
1523 case RC_USE_CONVERTER_NEEDAUTH:
1524 if (ignore_system_lyxrc ||
1525 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1526 os << "\\use_converter_needauth "
1527 << convert<string>(use_converter_needauth) << '\n';
1532 case RC_CONVERTER_CACHE_MAXAGE:
1533 if (ignore_system_lyxrc ||
1534 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1535 os << "\\converter_cache_maxage "
1536 << converter_cache_maxage << '\n';
1542 << "# SCREEN & FONTS SECTION ############################\n"
1546 if (ignore_system_lyxrc ||
1547 icon_set != system_lyxrc.icon_set) {
1548 os << "\\icon_set \"" << icon_set
1554 case RC_USE_SYSTEM_THEME_ICONS:
1555 if (ignore_system_lyxrc ||
1556 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1557 os << "\\use_system_theme_icons "
1558 << convert<string>(use_system_theme_icons)
1565 if (ignore_system_lyxrc ||
1566 dpi != system_lyxrc.dpi) {
1567 os << "\\screen_dpi " << dpi << '\n';
1572 case RC_SCREEN_ZOOM:
1573 if (ignore_system_lyxrc ||
1574 defaultZoom != system_lyxrc.defaultZoom) {
1575 os << "\\screen_zoom " << defaultZoom << '\n';
1580 case RC_GEOMETRY_SESSION:
1581 if (ignore_system_lyxrc ||
1582 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1583 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1589 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1590 if (ignore_system_lyxrc ||
1591 cursor_follows_scrollbar
1592 != system_lyxrc.cursor_follows_scrollbar) {
1593 os << "\\cursor_follows_scrollbar "
1594 << convert<string>(cursor_follows_scrollbar) << '\n';
1599 case RC_CURSOR_WIDTH:
1600 if (ignore_system_lyxrc ||
1602 != system_lyxrc.cursor_width) {
1603 os << "\\cursor_width "
1604 << cursor_width << '\n';
1609 case RC_SCROLL_BELOW_DOCUMENT:
1610 if (ignore_system_lyxrc ||
1611 scroll_below_document
1612 != system_lyxrc.scroll_below_document) {
1613 os << "\\scroll_below_document "
1614 << convert<string>(scroll_below_document) << '\n';
1619 case RC_PARAGRAPH_MARKERS:
1620 if (ignore_system_lyxrc ||
1622 != system_lyxrc.paragraph_markers) {
1623 os << "\\paragraph_markers "
1624 << convert<string>(paragraph_markers) << '\n';
1629 case RC_MAC_DONTSWAP_CTRL_META:
1630 if (ignore_system_lyxrc ||
1631 mac_dontswap_ctrl_meta
1632 != system_lyxrc.mac_dontswap_ctrl_meta) {
1633 os << "\\mac_dontswap_ctrl_meta "
1634 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1639 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1640 if (ignore_system_lyxrc ||
1641 mac_like_cursor_movement
1642 != system_lyxrc.mac_like_cursor_movement) {
1643 os << "\\mac_like_cursor_movement "
1644 << convert<string>(mac_like_cursor_movement) << '\n';
1649 case RC_MACRO_EDIT_STYLE:
1650 if (ignore_system_lyxrc ||
1652 != system_lyxrc.macro_edit_style) {
1653 os << "\\macro_edit_style ";
1654 switch (macro_edit_style) {
1655 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1656 case MACRO_EDIT_INLINE: os << "1\n"; break;
1657 case MACRO_EDIT_LIST: os << "2\n"; break;
1663 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1664 if (ignore_system_lyxrc ||
1665 dialogs_iconify_with_main
1666 != system_lyxrc.dialogs_iconify_with_main) {
1667 os << "\\dialogs_iconify_with_main "
1668 << convert<string>(dialogs_iconify_with_main) << '\n';
1673 case RC_SCREEN_FONT_ROMAN:
1674 if (ignore_system_lyxrc ||
1675 roman_font_name != system_lyxrc.roman_font_name) {
1676 os << "\\screen_font_roman \"" << roman_font_name
1682 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1683 if (ignore_system_lyxrc ||
1684 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1685 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1691 case RC_SCREEN_FONT_SANS:
1692 if (ignore_system_lyxrc ||
1693 sans_font_name != system_lyxrc.sans_font_name) {
1694 os << "\\screen_font_sans \"" << sans_font_name
1700 case RC_SCREEN_FONT_SANS_FOUNDRY:
1701 if (ignore_system_lyxrc ||
1702 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1703 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1709 case RC_SCREEN_FONT_TYPEWRITER:
1710 if (ignore_system_lyxrc ||
1711 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1712 os << "\\screen_font_typewriter \""
1713 << typewriter_font_name << "\"\n";
1718 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1719 if (ignore_system_lyxrc ||
1720 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1721 os << "\\screen_font_typewriter_foundry \""
1722 << typewriter_font_foundry << "\"\n";
1727 case RC_SCREEN_FONT_SCALABLE:
1728 if (ignore_system_lyxrc ||
1729 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1730 os << "\\screen_font_scalable "
1731 << convert<string>(use_scalable_fonts)
1737 case RC_SCREEN_FONT_SIZES:
1738 if (ignore_system_lyxrc ||
1739 font_sizes[TINY_SIZE]
1740 != system_lyxrc.font_sizes[TINY_SIZE] ||
1741 font_sizes[SCRIPT_SIZE]
1742 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1743 font_sizes[FOOTNOTE_SIZE]
1744 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1745 font_sizes[SMALL_SIZE]
1746 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1747 font_sizes[NORMAL_SIZE]
1748 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1749 font_sizes[LARGE_SIZE]
1750 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1751 font_sizes[LARGER_SIZE]
1752 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1753 font_sizes[LARGEST_SIZE]
1754 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1755 font_sizes[HUGE_SIZE]
1756 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1757 font_sizes[HUGER_SIZE]
1758 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1759 streamsize old_prec = os.precision();
1760 os.setf(ios::fixed);
1762 os << "\\screen_font_sizes"
1763 << ' ' << font_sizes[TINY_SIZE]
1764 << ' ' << font_sizes[SCRIPT_SIZE]
1765 << ' ' << font_sizes[FOOTNOTE_SIZE]
1766 << ' ' << font_sizes[SMALL_SIZE]
1767 << ' ' << font_sizes[NORMAL_SIZE]
1768 << ' ' << font_sizes[LARGE_SIZE]
1769 << ' ' << font_sizes[LARGER_SIZE]
1770 << ' ' << font_sizes[LARGEST_SIZE]
1771 << ' ' << font_sizes[HUGE_SIZE]
1772 << ' ' << font_sizes[HUGER_SIZE]
1774 os.precision(old_prec);
1775 os.unsetf(ios::fixed);
1780 case RC_FULL_SCREEN_LIMIT:
1781 if (ignore_system_lyxrc ||
1782 full_screen_limit != system_lyxrc.full_screen_limit) {
1783 os << "\\fullscreen_limit "
1784 << convert<string>(full_screen_limit)
1790 case RC_FULL_SCREEN_TOOLBARS:
1791 if (ignore_system_lyxrc ||
1792 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1793 os << "\\fullscreen_toolbars "
1794 << convert<string>(full_screen_toolbars)
1800 case RC_FULL_SCREEN_SCROLLBAR:
1801 if (ignore_system_lyxrc ||
1802 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1803 os << "\\fullscreen_scrollbar "
1804 << convert<string>(full_screen_scrollbar)
1810 case RC_FULL_SCREEN_STATUSBAR:
1811 if (ignore_system_lyxrc ||
1812 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1813 os << "\\fullscreen_statusbar "
1814 << convert<string>(full_screen_statusbar)
1820 case RC_FULL_SCREEN_TABBAR:
1821 if (ignore_system_lyxrc ||
1822 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1823 os << "\\fullscreen_tabbar "
1824 << convert<string>(full_screen_tabbar)
1830 case RC_FULL_SCREEN_MENUBAR:
1831 if (ignore_system_lyxrc ||
1832 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1833 os << "\\fullscreen_menubar "
1834 << convert<string>(full_screen_menubar)
1840 case RC_FULL_SCREEN_WIDTH:
1841 if (ignore_system_lyxrc ||
1842 full_screen_width != system_lyxrc.full_screen_width) {
1843 os << "\\fullscreen_width "
1844 << convert<string>(full_screen_width)
1850 case RC_OPEN_BUFFERS_IN_TABS:
1851 if (ignore_system_lyxrc ||
1852 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1853 os << "\\open_buffers_in_tabs "
1854 << convert<string>(open_buffers_in_tabs)
1860 case RC_SINGLE_CLOSE_TAB_BUTTON:
1861 if (ignore_system_lyxrc ||
1862 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1863 os << "\\single_close_tab_button "
1864 << convert<string>(single_close_tab_button)
1870 case RC_SINGLE_INSTANCE:
1871 if (ignore_system_lyxrc ||
1872 single_instance != system_lyxrc.single_instance) {
1873 os << "\\single_instance "
1874 << convert<string>(single_instance)
1880 case RC_FORWARD_SEARCH_DVI:
1881 if (ignore_system_lyxrc ||
1882 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1883 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1888 case RC_FORWARD_SEARCH_PDF:
1889 if (ignore_system_lyxrc ||
1890 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1891 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1897 << "# COLOR SECTION ###################################\n"
1902 for (int i = 0; i < Color_ignore; ++i) {
1903 ColorCode lc = static_cast<ColorCode>(i);
1904 string const col = lcolor.getX11Name(lc);
1905 if (ignore_system_lyxrc
1906 || col != system_lcolor.getX11Name(lc)) {
1907 os << "\\set_color \""
1908 << lcolor.getLyXName(lc) << "\" \""
1916 << "# PRINTER SECTION ###################################\n"
1920 case RC_PRINTLANDSCAPEFLAG:
1921 if (ignore_system_lyxrc ||
1922 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1923 os << "\\print_landscape_flag \"" << print_landscape_flag
1929 case RC_PRINTPAPERFLAG:
1930 if (ignore_system_lyxrc ||
1931 print_paper_flag != system_lyxrc.print_paper_flag) {
1932 os << "\\print_paper_flag \"" << print_paper_flag
1938 case RC_PRINTPAPERDIMENSIONFLAG:
1939 if (ignore_system_lyxrc ||
1940 print_paper_dimension_flag
1941 != system_lyxrc.print_paper_dimension_flag) {
1942 os << "\\print_paper_dimension_flag \""
1943 << print_paper_dimension_flag << "\"\n";
1949 << "# TEX SECTION #######################################\n"
1953 case RC_TEXINPUTS_PREFIX:
1954 if (ignore_system_lyxrc ||
1955 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1956 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1962 << "# FILE SECTION ######################################\n"
1965 case RC_DOCUMENTPATH:
1966 if (ignore_system_lyxrc ||
1967 document_path != system_lyxrc.document_path) {
1968 string const path = os::external_path(document_path);
1969 os << "\\document_path \"" << path << "\"\n";
1974 case RC_USELASTFILEPOS:
1975 if (ignore_system_lyxrc ||
1976 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1977 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1983 case RC_LOADSESSION:
1984 if (ignore_system_lyxrc ||
1985 load_session != system_lyxrc.load_session) {
1986 os << "\\load_session " << convert<string>(load_session)
1992 case RC_MOUSE_WHEEL_SPEED:
1993 if (ignore_system_lyxrc ||
1994 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1995 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2000 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2001 if (ignore_system_lyxrc ||
2002 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2003 os << "\\mouse_middlebutton_paste "
2004 << convert<string>(mouse_middlebutton_paste) << '\n';
2009 case RC_COMPLETION_INLINE_DELAY:
2010 if (ignore_system_lyxrc ||
2011 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2012 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2017 case RC_COMPLETION_INLINE_MATH:
2018 if (ignore_system_lyxrc ||
2019 completion_inline_math != system_lyxrc.completion_inline_math) {
2020 os << "\\completion_inline_math "
2021 << convert<string>(completion_inline_math) << '\n';
2026 case RC_COMPLETION_INLINE_TEXT:
2027 if (ignore_system_lyxrc ||
2028 completion_inline_text != system_lyxrc.completion_inline_text) {
2029 os << "\\completion_inline_text "
2030 << convert<string>(completion_inline_text) << '\n';
2035 case RC_COMPLETION_INLINE_DOTS:
2036 if (ignore_system_lyxrc ||
2037 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2038 os << "\\completion_inline_dots "
2039 << convert<string>(completion_inline_dots) << '\n';
2044 case RC_AUTOCORRECTION_MATH:
2045 if (ignore_system_lyxrc ||
2046 autocorrection_math != system_lyxrc.autocorrection_math) {
2047 os << "\\autocorrection_math "
2048 << convert<string>(autocorrection_math) << '\n';
2053 case RC_COMPLETION_POPUP_DELAY:
2054 if (ignore_system_lyxrc ||
2055 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2056 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2061 case RC_COMPLETION_POPUP_MATH:
2062 if (ignore_system_lyxrc ||
2063 completion_popup_math != system_lyxrc.completion_popup_math) {
2064 os << "\\completion_popup_math "
2065 << convert<string>(completion_popup_math) << '\n';
2070 case RC_COMPLETION_POPUP_TEXT:
2071 if (ignore_system_lyxrc ||
2072 completion_popup_text != system_lyxrc.completion_popup_text) {
2073 os << "\\completion_popup_text "
2074 << convert<string>(completion_popup_text) << '\n';
2079 case RC_COMPLETION_CURSOR_TEXT:
2080 if (ignore_system_lyxrc ||
2081 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2082 os << "\\completion_cursor_text "
2083 << convert<string>(completion_cursor_text) << '\n';
2088 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2089 if (ignore_system_lyxrc ||
2090 completion_popup_after_complete
2091 != system_lyxrc.completion_popup_after_complete) {
2092 os << "\\completion_popup_after_complete "
2093 << convert<string>(completion_popup_after_complete) << '\n';
2098 case RC_COMPLETION_MINLENGTH:
2099 if (ignore_system_lyxrc ||
2100 completion_minlength != system_lyxrc.completion_minlength) {
2101 os << "\\completion_minlength " << convert<string>(completion_minlength)
2107 case RC_NUMLASTFILES:
2108 if (ignore_system_lyxrc ||
2109 num_lastfiles != system_lyxrc.num_lastfiles) {
2110 os << "\\num_lastfiles " << num_lastfiles << '\n';
2115 case RC_CHECKLASTFILES:
2116 if (ignore_system_lyxrc ||
2117 check_lastfiles != system_lyxrc.check_lastfiles) {
2118 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2124 case RC_EXAMPLEPATH:
2125 if (ignore_system_lyxrc ||
2126 example_path != system_lyxrc.example_path) {
2127 string const path = os::external_path(example_path);
2128 os << "\\example_path \"" << path << "\"\n";
2133 case RC_TEMPLATEPATH:
2134 if (ignore_system_lyxrc ||
2135 template_path != system_lyxrc.template_path) {
2136 string const path = os::external_path(template_path);
2137 os << "\\template_path \"" << path << "\"\n";
2142 case RC_TEMPDIRPATH:
2143 if (ignore_system_lyxrc ||
2144 tempdir_path != system_lyxrc.tempdir_path) {
2145 string const path = os::external_path(tempdir_path);
2146 os << "\\tempdir_path \"" << path << "\"\n";
2151 case RC_THESAURUSDIRPATH:
2152 if (ignore_system_lyxrc ||
2153 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2154 string const path = os::external_path(thesaurusdir_path);
2155 os << "\\thesaurusdir_path \"" << path << "\"\n";
2160 case RC_HUNSPELLDIR_PATH:
2161 if (ignore_system_lyxrc ||
2162 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2163 string const path = os::external_path(hunspelldir_path);
2164 os << "\\hunspelldir_path \"" << path << "\"\n";
2169 case RC_PLAINTEXT_LINELEN:
2170 if (ignore_system_lyxrc ||
2171 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2172 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2177 case RC_MAKE_BACKUP:
2178 if (ignore_system_lyxrc ||
2179 make_backup != system_lyxrc.make_backup) {
2180 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2185 case RC_SAVE_COMPRESSED:
2186 if (ignore_system_lyxrc ||
2187 save_compressed != system_lyxrc.save_compressed) {
2188 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2193 case RC_SAVE_ORIGIN:
2194 if (ignore_system_lyxrc ||
2195 save_origin != system_lyxrc.save_origin) {
2196 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2201 case RC_BACKUPDIR_PATH:
2202 if (ignore_system_lyxrc ||
2203 backupdir_path != system_lyxrc.backupdir_path) {
2204 string const path = os::external_path(backupdir_path);
2205 os << "\\backupdir_path \"" << path << "\"\n";
2211 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2215 << "# SPELLCHECKER SECTION ##############################\n"
2219 case RC_ACCEPT_COMPOUND:
2220 if (ignore_system_lyxrc ||
2221 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2222 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2229 if (ignore_system_lyxrc ||
2230 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2231 os << "\\alternate_language \"" << spellchecker_alt_lang
2238 if (ignore_system_lyxrc ||
2239 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2240 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2245 case RC_USE_NATIVE_FILEDIALOG:
2246 if (ignore_system_lyxrc ||
2247 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2248 os << "\\use_native_filedialog "
2249 << convert<string>(use_native_filedialog)
2255 case RC_USE_SYSTEM_COLORS:
2256 if (ignore_system_lyxrc ||
2257 use_system_colors != system_lyxrc.use_system_colors) {
2258 os << "\\use_system_colors "
2259 << convert<string>(use_system_colors)
2265 case RC_USE_TOOLTIP:
2266 if (ignore_system_lyxrc ||
2267 use_tooltip != system_lyxrc.use_tooltip) {
2268 os << "\\use_tooltip "
2269 << convert<string>(use_tooltip)
2277 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2281 case RC_DEFAULT_DECIMAL_SEP:
2282 if (ignore_system_lyxrc ||
2283 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2284 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2289 case RC_DEFAULT_LENGTH_UNIT:
2290 if (ignore_system_lyxrc ||
2291 default_length_unit != system_lyxrc.default_length_unit) {
2292 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2297 case RC_SPELLCHECKER:
2298 if (ignore_system_lyxrc ||
2299 spellchecker != system_lyxrc.spellchecker) {
2300 os << "\\spellchecker " << spellchecker << '\n';
2305 case RC_SPELLCHECK_CONTINUOUSLY:
2306 if (ignore_system_lyxrc ||
2307 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2308 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2314 case RC_SPELLCHECK_NOTES:
2315 if (ignore_system_lyxrc ||
2316 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2317 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2323 case RC_VISUAL_CURSOR:
2324 if (ignore_system_lyxrc ||
2325 visual_cursor != system_lyxrc.visual_cursor) {
2326 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2331 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2332 if (ignore_system_lyxrc ||
2333 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2334 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2335 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2340 case RC_LANGUAGE_CUSTOM_PACKAGE:
2341 if (ignore_system_lyxrc ||
2342 language_custom_package != system_lyxrc.language_custom_package) {
2343 os << "\\language_custom_package \"" << language_custom_package
2349 case RC_LANGUAGE_GLOBAL_OPTIONS:
2350 if (ignore_system_lyxrc ||
2351 language_global_options
2352 != system_lyxrc.language_global_options) {
2353 os << "\\language_global_options \""
2354 << convert<string>(language_global_options)
2360 case RC_LANGUAGE_PACKAGE_SELECTION:
2361 if (ignore_system_lyxrc ||
2362 language_package_selection != system_lyxrc.language_package_selection) {
2363 os << "\\language_package_selection ";
2364 switch (language_package_selection) {
2382 case RC_LANGUAGE_COMMAND_BEGIN:
2383 if (ignore_system_lyxrc ||
2384 language_command_begin
2385 != system_lyxrc.language_command_begin) {
2386 os << "\\language_command_begin \""
2387 << language_command_begin
2393 case RC_LANGUAGE_COMMAND_END:
2394 if (ignore_system_lyxrc ||
2395 language_command_end
2396 != system_lyxrc.language_command_end) {
2397 os << "\\language_command_end \"" << language_command_end
2403 case RC_LANGUAGE_COMMAND_LOCAL:
2404 if (ignore_system_lyxrc ||
2405 language_command_local
2406 != system_lyxrc.language_command_local) {
2407 os << "\\language_command_local \""
2408 << language_command_local
2414 case RC_LANGUAGE_AUTO_BEGIN:
2415 if (ignore_system_lyxrc ||
2416 language_auto_begin != system_lyxrc.language_auto_begin) {
2417 os << "\\language_auto_begin "
2418 << convert<string>(language_auto_begin) << '\n';
2423 case RC_LANGUAGE_AUTO_END:
2424 if (ignore_system_lyxrc ||
2425 language_auto_end != system_lyxrc.language_auto_end) {
2426 os << "\\language_auto_end "
2427 << convert<string>(language_auto_end) << '\n';
2432 case RC_MARK_FOREIGN_LANGUAGE:
2433 if (ignore_system_lyxrc ||
2434 mark_foreign_language
2435 != system_lyxrc.mark_foreign_language) {
2436 os << "\\mark_foreign_language " <<
2437 convert<string>(mark_foreign_language) << '\n';
2440 case RC_RESPECT_OS_KBD_LANGUAGE:
2441 if (ignore_system_lyxrc ||
2442 respect_os_kbd_language
2443 != system_lyxrc.respect_os_kbd_language) {
2444 os << "\\respect_os_kbd_language " <<
2445 convert<string>(respect_os_kbd_language) << '\n';
2452 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2456 case RC_AUTO_NUMBER:
2457 if (ignore_system_lyxrc ||
2458 auto_number != system_lyxrc.auto_number) {
2459 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2464 case RC_GUI_LANGUAGE:
2465 if (ignore_system_lyxrc ||
2466 gui_language != system_lyxrc.gui_language) {
2467 os << "\\gui_language " << gui_language << '\n';
2472 case RC_EXPORT_OVERWRITE:
2473 if (ignore_system_lyxrc ||
2474 export_overwrite != system_lyxrc.export_overwrite) {
2476 switch (export_overwrite) {
2487 os << "\\export_overwrite " << status << '\n';
2492 case RC_SCROLL_WHEEL_ZOOM:
2493 if (ignore_system_lyxrc ||
2494 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2496 switch (scroll_wheel_zoom) {
2497 case SCROLL_WHEEL_ZOOM_OFF:
2500 case SCROLL_WHEEL_ZOOM_CTRL:
2503 case SCROLL_WHEEL_ZOOM_SHIFT:
2506 case SCROLL_WHEEL_ZOOM_ALT:
2510 os << "\\scroll_wheel_zoom " << status << '\n';
2516 << "# FORMATS SECTION ##########################\n"
2521 // New/modified formats
2522 for (Formats::const_iterator cit = theFormats().begin();
2523 cit != theFormats().end(); ++cit) {
2524 Format const * format =
2525 theSystemFormats().getFormat(cit->name());
2527 format->extensions() != cit->extensions() ||
2528 format->prettyname() != cit->prettyname() ||
2529 format->shortcut() != cit->shortcut() ||
2530 format->viewer() != cit->viewer() ||
2531 format->editor() != cit->editor() ||
2532 format->documentFormat() != cit->documentFormat() ||
2533 format->vectorFormat() != cit->vectorFormat() ||
2534 format->inExportMenu() != cit->inExportMenu() ||
2535 format->noMenu() != cit->noMenu() ||
2536 format->mime() != cit->mime()) {
2537 os << "\\format \"" << cit->name() << "\" \""
2538 << cit->extensions() << "\" \""
2539 << to_utf8(cit->prettyname()) << "\" \""
2540 << cit->shortcut() << "\" \""
2541 << escapeCommand(cit->viewer()) << "\" \""
2542 << escapeCommand(cit->editor()) << "\" \"";
2543 vector<string> flags;
2544 if (cit->documentFormat())
2545 flags.push_back("document");
2546 if (cit->vectorFormat())
2547 flags.push_back("vector");
2548 if (cit->zippedNative())
2549 flags.push_back("zipped=native");
2550 if (cit->inExportMenu())
2551 flags.push_back("menu=export");
2553 os << getStringFromVector(flags);
2554 os << "\" \"" << cit->mime() << "\"\n";
2558 // Look for deleted formats
2559 for (Formats::const_iterator cit = theSystemFormats().begin();
2560 cit != theSystemFormats().end(); ++cit)
2561 if (!theFormats().getFormat(cit->name()))
2562 os << "\\format \"" << cit->name()
2563 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2567 case RC_VIEWER_ALTERNATIVES: {
2568 Alternatives::const_iterator it = viewer_alternatives.begin();
2569 Alternatives::const_iterator const en = viewer_alternatives.end();
2570 Alternatives::const_iterator const sysend =
2571 system_lyxrc.viewer_alternatives.end();
2572 for (; it != en; ++it) {
2573 string const & fmt = it->first;
2574 CommandSet const & cmd = it->second;
2575 CommandSet::const_iterator sit = cmd.begin();
2576 CommandSet::const_iterator const sen = cmd.end();
2577 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2578 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2579 system_lyxrc.viewer_alternatives.find(fmt);
2580 for (; sit != sen; ++sit) {
2581 string const & cmd = *sit;
2582 if (ignore_system_lyxrc
2583 || sysfmt == sysend // format not found
2584 || sysfmt->second.count(cmd) == 0 // this command not found
2586 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2593 case RC_EDITOR_ALTERNATIVES: {
2594 Alternatives::const_iterator it = editor_alternatives.begin();
2595 Alternatives::const_iterator const en = editor_alternatives.end();
2596 Alternatives::const_iterator const sysend =
2597 system_lyxrc.editor_alternatives.end();
2598 for (; it != en; ++it) {
2599 string const & fmt = it->first;
2600 CommandSet const & cmd = it->second;
2601 CommandSet::const_iterator sit = cmd.begin();
2602 CommandSet::const_iterator const sen = cmd.end();
2603 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2604 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2605 system_lyxrc.editor_alternatives.find(fmt);
2606 for (; sit != sen; ++sit) {
2607 string const & cmd = *sit;
2608 if (ignore_system_lyxrc
2609 || sysfmt == sysend // format not found
2610 || sysfmt->second.count(cmd) == 0 // this command not found
2612 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2619 case RC_DEFAULT_OTF_VIEW_FORMAT:
2620 if ((ignore_system_lyxrc ||
2621 default_otf_view_format != system_lyxrc.default_otf_view_format)
2622 && !default_otf_view_format.empty()) {
2623 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2628 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2629 if ((ignore_system_lyxrc ||
2630 default_platex_view_format != system_lyxrc.default_platex_view_format)
2631 && !default_platex_view_format.empty()) {
2632 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2637 case RC_DEFAULT_VIEW_FORMAT:
2638 if (ignore_system_lyxrc ||
2639 default_view_format != system_lyxrc.default_view_format) {
2640 os << "\\default_view_format " << default_view_format << '\n';
2651 << "# CONVERTERS SECTION ##########################\n"
2656 // Look for new converters
2657 for (Converters::const_iterator cit = theConverters().begin();
2658 cit != theConverters().end(); ++cit) {
2659 Converter const * converter =
2660 theSystemConverters().getConverter(cit->from(),
2663 converter->command() != cit->command() ||
2664 converter->flags() != cit->flags())
2665 os << "\\converter \"" << cit->from() << "\" \""
2666 << cit->to() << "\" \""
2667 << escapeCommand(cit->command()) << "\" \""
2668 << cit->flags() << "\"\n";
2671 // New/modifed converters
2672 for (Converters::const_iterator cit = theSystemConverters().begin();
2673 cit != theSystemConverters().end(); ++cit)
2674 if (!theConverters().getConverter(cit->from(), cit->to()))
2675 os << "\\converter \"" << cit->from()
2676 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2683 << "# COPIERS SECTION ##########################\n"
2686 // Look for new movers
2687 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2688 Movers::const_iterator const sysend = theSystemMovers().end();
2689 Movers::const_iterator it = theMovers().begin();
2690 Movers::const_iterator end = theMovers().end();
2692 for (; it != end; ++it) {
2693 Movers::const_iterator const sysit =
2694 find_if(sysbegin, sysend, SameMover(*it));
2695 if (sysit == sysend) {
2696 string const & fmt = it->first;
2697 string const & command =
2698 it->second.command();
2700 os << "\\copier " << fmt
2701 << " \"" << escapeCommand(command) << "\"\n";
2707 // We don't actually delete SpecialisedMover(s) from the
2708 // map, just clear their 'command', so there's no need
2709 // to test for anything else.
2716 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2718 // Why the switch you might ask. It is a trick to ensure that all
2719 // the elements in the LyXRCTags enum is handled. As you can see
2720 // there are no breaks at all. So it is just a huge fall-through.
2721 // The nice thing is that we will get a warning from the compiler
2722 // if we forget an element.
2723 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2725 case LyXRC::RC_LAST:
2726 case LyXRC::RC_ACCEPT_COMPOUND:
2727 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2728 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2730 case LyXRC::RC_ALT_LANG:
2731 case LyXRC::RC_PLAINTEXT_LINELEN:
2732 case LyXRC::RC_AUTOCORRECTION_MATH:
2733 case LyXRC::RC_AUTOREGIONDELETE:
2734 case LyXRC::RC_AUTORESET_OPTIONS:
2735 case LyXRC::RC_AUTOSAVE:
2736 case LyXRC::RC_AUTO_NUMBER:
2737 case LyXRC::RC_BACKUPDIR_PATH:
2738 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2739 case LyXRC::RC_BIBTEX_COMMAND:
2740 case LyXRC::RC_BINDFILE:
2741 case LyXRC::RC_CHECKLASTFILES:
2742 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2743 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2744 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2745 case LyXRC::RC_COMPLETION_INLINE_MATH:
2746 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2747 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2748 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2749 case LyXRC::RC_COMPLETION_POPUP_MATH:
2750 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2751 case LyXRC::RC_COMPLETION_MINLENGTH:
2752 case LyXRC::RC_USELASTFILEPOS:
2753 case LyXRC::RC_LOADSESSION:
2754 case LyXRC::RC_CHKTEX_COMMAND:
2755 case LyXRC::RC_CONVERTER:
2756 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2757 case LyXRC::RC_COPIER:
2758 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2759 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2760 case LyXRC::RC_GUI_LANGUAGE:
2761 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2762 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2763 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2764 case LyXRC::RC_DEFFILE:
2765 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2766 case LyXRC::RC_DISPLAY_GRAPHICS:
2767 case LyXRC::RC_DOCUMENTPATH:
2768 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2769 FileName path(lyxrc_new.document_path);
2770 if (path.exists() && path.isDirectory())
2771 package().document_dir() = FileName(lyxrc.document_path);
2774 case LyXRC::RC_EDITOR_ALTERNATIVES:
2775 case LyXRC::RC_ESC_CHARS:
2776 case LyXRC::RC_EXAMPLEPATH:
2777 case LyXRC::RC_FILEFORMAT:
2778 case LyXRC::RC_GROUP_LAYOUTS:
2779 case LyXRC::RC_HUNSPELLDIR_PATH:
2780 case LyXRC::RC_ICON_SET:
2781 case LyXRC::RC_INDEX_ALTERNATIVES:
2782 case LyXRC::RC_INDEX_COMMAND:
2783 case LyXRC::RC_JBIBTEX_COMMAND:
2784 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2785 case LyXRC::RC_JINDEX_COMMAND:
2786 case LyXRC::RC_NOMENCL_COMMAND:
2787 case LyXRC::RC_PYGMENTIZE_COMMAND:
2788 case LyXRC::RC_INPUT:
2789 case LyXRC::RC_KBMAP:
2790 case LyXRC::RC_KBMAP_PRIMARY:
2791 case LyXRC::RC_KBMAP_SECONDARY:
2792 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2793 case LyXRC::RC_LANGUAGE_AUTO_END:
2794 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2795 case LyXRC::RC_LANGUAGE_COMMAND_END:
2796 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2797 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2798 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2799 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2800 case LyXRC::RC_LYXRCFORMAT:
2801 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2802 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2803 case LyXRC::RC_MACRO_EDIT_STYLE:
2804 case LyXRC::RC_MAKE_BACKUP:
2805 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2806 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2807 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2808 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2809 case LyXRC::RC_NUMLASTFILES:
2810 case LyXRC::RC_PARAGRAPH_MARKERS:
2811 case LyXRC::RC_PATH_PREFIX:
2812 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2813 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2814 // Resets python path
2815 support::os::python(true);
2818 case LyXRC::RC_PREVIEW:
2819 if (lyxrc_orig.preview != lyxrc_new.preview) {
2820 // Update all previews of all documents.
2821 /* FIXME: this can be very expensive. It would be cheaper
2822 * to kill all existing previews and update visible
2824 theBufferList().updatePreviews();
2827 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2828 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2829 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2830 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2831 case LyXRC::RC_PRINTPAPERFLAG:
2832 case LyXRC::RC_SAVE_COMPRESSED:
2833 case LyXRC::RC_SAVE_ORIGIN:
2834 case LyXRC::RC_SCREEN_DPI:
2836 case LyXRC::RC_SCREEN_FONT_ROMAN:
2837 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2838 case LyXRC::RC_SCREEN_FONT_SANS:
2839 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2840 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2841 case LyXRC::RC_SCREEN_FONT_SIZES:
2842 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2843 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2844 case LyXRC::RC_SCREEN_ZOOM:
2845 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2846 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2847 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2848 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2849 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2850 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2851 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2852 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2853 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2854 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2857 case LyXRC::RC_GEOMETRY_SESSION:
2858 case LyXRC::RC_SERVERPIPE:
2859 case LyXRC::RC_SET_COLOR:
2860 case LyXRC::RC_SHOW_BANNER:
2861 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2862 case LyXRC::RC_SPELLCHECKER:
2863 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2866 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2867 case LyXRC::RC_SPELLCHECK_NOTES:
2868 case LyXRC::RC_SPLITINDEX_COMMAND:
2869 case LyXRC::RC_TEMPDIRPATH:
2870 case LyXRC::RC_TEMPLATEPATH:
2871 case LyXRC::RC_TEX_ALLOWS_SPACES:
2872 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2873 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2874 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2877 case LyXRC::RC_TEXINPUTS_PREFIX:
2878 case LyXRC::RC_THESAURUSDIRPATH:
2879 case LyXRC::RC_UIFILE:
2880 case LyXRC::RC_USER_EMAIL:
2881 case LyXRC::RC_USER_INITIALS:
2882 case LyXRC::RC_USER_NAME:
2883 case LyXRC::RC_USE_CONVERTER_CACHE:
2884 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2885 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2886 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2887 case LyXRC::RC_USE_SYSTEM_COLORS:
2888 case LyXRC::RC_USE_TOOLTIP:
2889 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2890 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2891 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2892 case LyXRC::RC_SINGLE_INSTANCE:
2893 case LyXRC::RC_SORT_LAYOUTS:
2894 case LyXRC::RC_FULL_SCREEN_LIMIT:
2895 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2896 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2897 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2898 case LyXRC::RC_FULL_SCREEN_TABBAR:
2899 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2900 case LyXRC::RC_FULL_SCREEN_WIDTH:
2901 case LyXRC::RC_VISUAL_CURSOR:
2902 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2903 case LyXRC::RC_VIEWER:
2904 case LyXRC::RC_VIEWER_ALTERNATIVES:
2905 case LyXRC::RC_FORWARD_SEARCH_DVI:
2906 case LyXRC::RC_FORWARD_SEARCH_PDF:
2907 case LyXRC::RC_EXPORT_OVERWRITE:
2908 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2909 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2910 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2911 case LyXRC::RC_CURSOR_WIDTH:
2917 set<string> LyXRC::getRCs()
2920 for (int i = 0; i != lyxrcCount; ++i)
2921 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2927 string const LyXRC::getDescription(LyXRCTags tag)
2932 case RC_ACCEPT_COMPOUND:
2933 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2937 str = _("Specify an alternate language. The default is to use the language of the document.");
2940 case RC_PLAINTEXT_LINELEN:
2941 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.");
2944 case RC_AUTOREGIONDELETE:
2945 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2948 case RC_AUTORESET_OPTIONS:
2949 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2953 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2956 case RC_AUTO_NUMBER:
2959 case RC_BACKUPDIR_PATH:
2960 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.");
2963 case RC_BIBTEX_COMMAND:
2964 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2967 case RC_JBIBTEX_COMMAND:
2968 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2972 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2975 case RC_CHECKLASTFILES:
2976 str = _("Select to check whether the lastfiles still exist.");
2979 case RC_CHKTEX_COMMAND:
2980 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2986 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
2987 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
2990 case RC_CONVERTER_NEEDAUTH:
2991 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
2997 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2998 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.");
3001 case RC_CURSOR_WIDTH:
3002 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3005 case RC_SCROLL_BELOW_DOCUMENT:
3006 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");
3009 case RC_MAC_DONTSWAP_CTRL_META:
3010 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3013 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3014 str = _("Use the Mac OS X conventions for cursor movement");
3017 case RC_SHOW_MACRO_LABEL:
3018 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3022 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3025 case RC_DEFAULT_OTF_VIEW_FORMAT:
3026 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3029 case RC_DEFAULT_VIEW_FORMAT:
3030 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3033 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3034 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3037 case RC_DISPLAY_GRAPHICS:
3038 str = _("Select how LyX will display any graphics.");
3041 case RC_DOCUMENTPATH:
3042 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3046 str = _("Specify additional chars that can be part of a word.");
3049 case RC_EXAMPLEPATH:
3050 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3056 case RC_INDEX_COMMAND:
3057 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\".");
3060 case RC_JINDEX_COMMAND:
3061 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3064 case RC_NOMENCL_COMMAND:
3065 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3068 case RC_PYGMENTIZE_COMMAND:
3069 str = _("The command to run the python pygments syntax highlighter.");
3076 case RC_KBMAP_PRIMARY:
3077 case RC_KBMAP_SECONDARY:
3078 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.");
3081 case RC_LANGUAGE_AUTO_BEGIN:
3082 str = _("Select if a language switching command is needed at the beginning of the document.");
3085 case RC_LANGUAGE_AUTO_END:
3086 str = _("Select if a language switching command is needed at the end of the document.");
3089 case RC_LANGUAGE_COMMAND_BEGIN:
3090 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.");
3093 case RC_LANGUAGE_COMMAND_END:
3094 str = _("The LaTeX command for changing back to the language of the document.");
3097 case RC_LANGUAGE_COMMAND_LOCAL:
3098 str = _("The LaTeX command for local changing of the language.");
3101 case RC_LANGUAGE_GLOBAL_OPTIONS:
3102 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3105 case RC_LANGUAGE_CUSTOM_PACKAGE:
3106 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3109 case RC_LANGUAGE_PACKAGE_SELECTION:
3110 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3113 case RC_USELASTFILEPOS:
3114 str = _("De-select if you do not want LyX to scroll to saved position.");
3117 case RC_LOADSESSION:
3118 str = _("De-select to prevent loading files opened from the last LyX session.");
3121 case RC_MAKE_BACKUP:
3122 str = _("De-select if you don't want LyX to create backup files.");
3125 case RC_MARK_FOREIGN_LANGUAGE:
3126 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3129 case RC_RESPECT_OS_KBD_LANGUAGE:
3130 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3133 case RC_MOUSE_WHEEL_SPEED:
3134 str = _("The scrolling speed of the mouse wheel.");
3137 case RC_COMPLETION_POPUP_DELAY:
3138 str = _("The completion popup delay.");
3141 case RC_COMPLETION_POPUP_MATH:
3142 str = _("Select to display the completion popup in math mode.");
3145 case RC_COMPLETION_POPUP_TEXT:
3146 str = _("Select to display the completion popup in text mode.");
3149 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3150 str = _("Show the completion popup without delay after non-unique completion attempt.");
3153 case RC_COMPLETION_POPUP_TEXT:
3154 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3157 case RC_COMPLETION_POPUP_DELAY:
3158 str = _("The inline completion delay.");
3161 case RC_COMPLETION_INLINE_MATH:
3162 str = _("Select to display the inline completion in math mode.");
3165 case RC_COMPLETION_INLINE_TEXT:
3166 str = _("Select to display the inline completion in text mode.");
3169 case RC_COMPLETION_INLINE_DOTS:
3170 str = _("Use \"...\" to shorten long completions.");
3173 case RC_AUTOCORRECTION_MATH:
3174 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3177 case RC_NUMLASTFILES:
3178 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3182 case RC_PATH_PREFIX:
3183 str = _("Specify those directories which should be "
3184 "prepended to the PATH environment variable.\n"
3185 "Use the OS native format.");
3189 str = _("Shows a typeset preview of things such as math");
3192 case RC_PREVIEW_HASHED_LABELS:
3193 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3196 case RC_PREVIEW_SCALE_FACTOR:
3197 str = _("Scale the preview size to suit.");
3200 case RC_PRINTLANDSCAPEFLAG:
3201 str = _("The option to print out in landscape.");
3204 case RC_PRINTPAPERDIMENSIONFLAG:
3205 str = _("Option to specify the dimensions of the print paper.");
3208 case RC_PRINTPAPERFLAG:
3209 str = _("The option to specify paper type.");
3212 case RC_VISUAL_CURSOR:
3213 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3216 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3217 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).");
3221 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3224 case RC_SCREEN_FONT_ROMAN:
3225 case RC_SCREEN_FONT_SANS:
3226 case RC_SCREEN_FONT_TYPEWRITER:
3227 str = _("The screen fonts used to display the text while editing.");
3230 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3231 case RC_SCREEN_FONT_SANS_FOUNDRY:
3232 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3235 case RC_SCREEN_FONT_SCALABLE:
3236 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.");
3239 case RC_SCREEN_FONT_SIZES:
3240 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3243 case RC_SCREEN_ZOOM:
3244 //xgettext:no-c-format
3245 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3248 case RC_GEOMETRY_SESSION:
3249 str = _("Allow session manager to save and restore windows geometry.");
3253 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3259 case RC_SHOW_BANNER:
3260 str = _("De-select if you don't want the startup banner.");
3263 case RC_TEMPDIRPATH:
3264 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3267 case RC_THESAURUSDIRPATH:
3268 str = _("This is the place where the files of the thesaurus library reside.");
3271 case RC_TEMPLATEPATH:
3272 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3275 case RC_TEX_ALLOWS_SPACES:
3278 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3281 case RC_TEXINPUTS_PREFIX:
3282 str = _("Specify those directories which should be "
3283 "prepended to the TEXINPUTS environment variable.\n"
3284 "A '.' represents the current document directory. "
3285 "Use the OS native format.");
3289 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3298 case RC_USE_USE_SYSTEM_COLORS:
3299 str = _("Enable use the system colors for some things like main window background and selection.");
3302 case RC_USE_TOOLTIP:
3303 str = _("Enable the automatic appearance of tool tips in the work area.");
3306 case RC_VIEWDVI_PAPEROPTION:
3307 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3322 // The global instance
3325 // The global copy of the system lyxrc entries (everything except preferences)