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_name", LyXRC::RC_USER_NAME },
205 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
206 // compatibility with versions older than 1.4.0 only
207 { "\\viewer", LyXRC::RC_VIEWER},
208 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
209 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
210 { "format", LyXRC::RC_LYXRCFORMAT }
213 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
216 void oldFontFormat(string & family, string & foundry)
218 if (family.empty() || family[0] != '-')
220 foundry = token(family, '-', 1);
221 family = token(family, '-', 2);
229 bool LyXRC::read(FileName const & filename, bool check_format)
231 Lexer lexrc(lyxrcTags);
232 lexrc.setFile(filename);
233 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
234 ReturnValues retval = read(lexrc, check_format);
235 if (!check_format || retval != FormatMismatch)
236 return retval == ReadOK;
238 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
239 TempFile tmp("convert_lyxrc");
240 FileName const tempfile = tmp.name();
241 bool const success = prefs2prefs(filename, tempfile, false);
243 LYXERR0 ("Unable to convert " << filename.absFileName() <<
244 " to format " << LYXRC_FILEFORMAT);
247 // Keep this in the else branch, such that lexrc2 goes out
248 // of scope and releases the lock on tempfile before we
249 // attempt to remove it. This matters on Windows.
250 Lexer lexrc2(lyxrcTags);
251 lexrc2.setFile(tempfile);
252 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
253 retval = read(lexrc2, check_format);
254 if (retval == FormatMismatch)
255 LYXERR0("Conversion failed for " << filename.absFileName());
257 return retval == ReadOK;
261 // don't need to worry about conversion, because this is always
262 // from an internal source
263 bool LyXRC::read(istream & is)
265 Lexer lexrc(lyxrcTags);
267 LYXERR(Debug::LYXRC, "Reading istream...");
268 return read(lexrc, false) == ReadOK;
272 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
274 if (lyxerr.debugging(Debug::PARSER))
275 lexrc.printTable(lyxerr);
280 // format prior to 2.0 and introduction of format tag
281 unsigned int rc_format = 0;
283 while (lexrc.isOK()) {
284 // By using two switches we take advantage of the compiler
285 // telling us if we have missed a LyXRCTags element in
286 // the second switch.
287 // Note that this also shows a problem with Lexer since it
288 // helps us avoid taking advantage of the strictness of the
291 int le = lexrc.lex();
293 case Lexer::LEX_UNDEF:
294 lexrc.printError("Unknown tag `$$Token'");
296 case Lexer::LEX_FEOF:
301 switch (static_cast<LyXRCTags>(le)) {
304 rc_format = lexrc.getInteger();
306 case RC_INPUT: // Include file
309 libFileSearch(string(),
311 if (!read(tmp, check_format)) {
313 "Error reading included file: " + tmp.absFileName());
319 bind_file = os::internal_path(lexrc.getString());
324 def_file = os::internal_path(lexrc.getString());
329 ui_file = os::internal_path(lexrc.getString());
332 case RC_AUTORESET_OPTIONS:
333 lexrc >> auto_reset_options;
336 case RC_DISPLAY_GRAPHICS:
338 display_graphics = lexrc.getString() == "true";
341 case RC_TEX_EXPECTS_WINDOWS_PATHS:
342 lexrc >> windows_style_tex_paths;
345 case RC_TEX_ALLOWS_SPACES:
346 lexrc >> tex_allows_spaces;
349 case RC_TEXINPUTS_PREFIX:
350 lexrc >> texinputs_prefix;
357 case RC_KBMAP_PRIMARY:
359 string const kmap(os::internal_path(lexrc.getString()));
360 if (!libFileSearch("kbd", kmap, "kmap").empty()
362 primary_kbmap = kmap;
364 lexrc.printError("LyX: Keymap `$$Token' not found");
369 case RC_KBMAP_SECONDARY:
371 string const kmap(os::internal_path(lexrc.getString()));
372 if (!libFileSearch("kbd", kmap, "kmap").empty()
374 secondary_kbmap = kmap;
376 lexrc.printError("LyX: Keymap `$$Token' not found");
381 case RC_PRINTLANDSCAPEFLAG:
382 lexrc >> print_landscape_flag;
385 case RC_PRINTPAPERDIMENSIONFLAG:
386 lexrc >> print_paper_dimension_flag;
389 case RC_PRINTPAPERFLAG:
390 lexrc >> print_paper_flag;
393 case RC_PYGMENTIZE_COMMAND:
394 if (lexrc.next(true)) {
395 pygmentize_command = lexrc.getString();
399 case RC_VIEWDVI_PAPEROPTION:
401 view_dvi_paper_option = lexrc.getString();
403 view_dvi_paper_option.erase();
406 case RC_CHKTEX_COMMAND:
407 if (lexrc.next(true)) {
408 chktex_command = lexrc.getString();
412 case RC_BIBTEX_ALTERNATIVES:
413 if (lexrc.next(true)) {
414 bibtex_alternatives.insert(lexrc.getString());
418 case RC_BIBTEX_COMMAND:
419 if (lexrc.next(true)) {
420 bibtex_command = lexrc.getString();
424 case RC_JBIBTEX_COMMAND:
425 if (lexrc.next(true)) {
426 jbibtex_command = lexrc.getString();
430 case RC_JBIBTEX_ALTERNATIVES:
431 if (lexrc.next(true)) {
432 jbibtex_alternatives.insert(lexrc.getString());
436 case RC_INDEX_ALTERNATIVES:
437 if (lexrc.next(true)) {
438 index_alternatives.insert(lexrc.getString());
442 case RC_INDEX_COMMAND:
443 if (lexrc.next(true)) {
444 index_command = lexrc.getString();
448 case RC_JINDEX_COMMAND:
449 if (lexrc.next(true)) {
450 jindex_command = lexrc.getString();
454 case RC_SPLITINDEX_COMMAND:
455 if (lexrc.next(true)) {
456 splitindex_command = lexrc.getString();
460 case RC_NOMENCL_COMMAND:
461 if (lexrc.next(true)) {
462 nomencl_command = lexrc.getString();
471 lexrc >> defaultZoom;
472 if (defaultZoom < 10)
476 case RC_GEOMETRY_SESSION:
477 lexrc >> allow_geometry_session;
480 case RC_SCREEN_FONT_SIZES:
481 lexrc >> font_sizes[TINY_SIZE];
482 lexrc >> font_sizes[SCRIPT_SIZE];
483 lexrc >> font_sizes[FOOTNOTE_SIZE];
484 lexrc >> font_sizes[SMALL_SIZE];
485 lexrc >> font_sizes[NORMAL_SIZE];
486 lexrc >> font_sizes[LARGE_SIZE];
487 lexrc >> font_sizes[LARGER_SIZE];
488 lexrc >> font_sizes[LARGEST_SIZE];
489 lexrc >> font_sizes[HUGE_SIZE];
490 lexrc >> font_sizes[HUGER_SIZE];
493 case RC_SCREEN_FONT_SCALABLE:
494 lexrc >> use_scalable_fonts;
501 case RC_DOCUMENTPATH:
503 document_path = os::internal_path(lexrc.getString());
508 example_path = os::internal_path(lexrc.getString());
511 case RC_TEMPLATEPATH:
513 template_path = os::internal_path(lexrc.getString());
518 tempdir_path = os::internal_path(lexrc.getString());
521 case RC_THESAURUSDIRPATH:
523 thesaurusdir_path = os::internal_path(lexrc.getString());
526 case RC_HUNSPELLDIR_PATH:
528 hunspelldir_path = os::internal_path(lexrc.getString());
531 case RC_USELASTFILEPOS:
532 lexrc >> use_lastfilepos;
536 lexrc >> load_session;
539 case RC_MOUSE_WHEEL_SPEED:
540 lexrc >> mouse_wheel_speed;
543 case RC_COMPLETION_INLINE_DELAY:
544 lexrc >> completion_inline_delay;
547 case RC_COMPLETION_INLINE_MATH:
548 lexrc >> completion_inline_math;
551 case RC_COMPLETION_INLINE_TEXT:
552 lexrc >> completion_inline_text;
555 case RC_COMPLETION_INLINE_DOTS:
556 lexrc >> completion_inline_dots;
559 case RC_AUTOCORRECTION_MATH:
560 lexrc >> autocorrection_math;
563 case RC_COMPLETION_POPUP_DELAY:
564 lexrc >> completion_popup_delay;
567 case RC_COMPLETION_POPUP_MATH:
568 lexrc >> completion_popup_math;
571 case RC_COMPLETION_POPUP_TEXT:
572 lexrc >> completion_popup_text;
575 case RC_COMPLETION_CURSOR_TEXT:
576 lexrc >> completion_cursor_text;
579 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
580 lexrc >> completion_popup_after_complete;
583 case RC_COMPLETION_MINLENGTH:
584 lexrc >> completion_minlength;
587 case RC_NUMLASTFILES:
588 lexrc >> num_lastfiles;
591 case RC_CHECKLASTFILES:
592 lexrc >> check_lastfiles;
599 case RC_USE_SYSTEM_THEME_ICONS:
600 lexrc >> use_system_theme_icons;
603 case RC_SCREEN_FONT_ROMAN:
605 roman_font_name = lexrc.getString();
606 oldFontFormat(roman_font_name,
611 case RC_SCREEN_FONT_SANS:
613 sans_font_name = lexrc.getString();
614 oldFontFormat(sans_font_name, sans_font_foundry);
618 case RC_SCREEN_FONT_TYPEWRITER:
620 typewriter_font_name = lexrc.getString();
621 oldFontFormat(typewriter_font_name,
622 typewriter_font_foundry);
626 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
627 lexrc >> roman_font_foundry;
630 case RC_SCREEN_FONT_SANS_FOUNDRY:
631 lexrc >> sans_font_foundry;
634 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
635 lexrc >> typewriter_font_foundry;
640 lexrc.printError("Missing color tag.");
643 string lyx_name = lexrc.getString();
646 lexrc.printError("Missing color name for color: `$$Token'");
649 string x11_name = lexrc.getString();
651 ColorCode const col =
652 lcolor.getFromLyXName(lyx_name);
653 if (col == Color_none ||
654 col == Color_inherit ||
658 if (!lcolor.setColor(col, x11_name))
659 LYXERR0("Bad lyxrc set_color for " << lyx_name);
663 case RC_AUTOREGIONDELETE:
664 // Auto region delete defaults to true
665 lexrc >> auto_region_delete;
670 lyxpipes = os::internal_path(lexrc.getString());
673 case RC_CURSOR_FOLLOWS_SCROLLBAR:
674 lexrc >> cursor_follows_scrollbar;
677 case RC_CURSOR_WIDTH:
678 lexrc >> cursor_width;
681 case RC_SCROLL_BELOW_DOCUMENT:
682 lexrc >> scroll_below_document;
685 case RC_PARAGRAPH_MARKERS:
686 lexrc >> paragraph_markers;
689 case RC_MAC_DONTSWAP_CTRL_META:
690 lexrc >> mac_dontswap_ctrl_meta;
693 case RC_MAC_LIKE_CURSOR_MOVEMENT:
694 lexrc >> mac_like_cursor_movement;
697 case RC_MACRO_EDIT_STYLE:
699 switch (lexrc.getInteger()) {
700 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
701 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
702 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
707 case RC_DIALOGS_ICONIFY_WITH_MAIN:
708 lexrc >> dialogs_iconify_with_main;
711 case RC_PLAINTEXT_LINELEN:
712 lexrc >> plaintext_linelen;
714 // Spellchecker settings:
715 case RC_ACCEPT_COMPOUND:
716 lexrc >> spellchecker_accept_compound;
718 case RC_USE_NATIVE_FILEDIALOG:
719 lexrc >> use_native_filedialog;
721 case RC_USE_SYSTEM_COLORS:
722 lexrc >> use_system_colors;
725 lexrc >> use_tooltip;
727 case RC_SPELLCHECKER:
728 lexrc >> spellchecker;
731 lexrc >> spellchecker_alt_lang;
734 lexrc >> spellchecker_esc_chars;
736 case RC_SPELLCHECK_CONTINUOUSLY:
737 lexrc >> spellcheck_continuously;
739 case RC_SPELLCHECK_NOTES:
740 lexrc >> spellcheck_notes;
743 lexrc >> make_backup;
745 case RC_SAVE_COMPRESSED:
746 lexrc >> save_compressed;
749 lexrc >> save_origin;
751 case RC_BACKUPDIR_PATH:
753 backupdir_path = os::internal_path(lexrc.getString());
755 case RC_DEFAULT_DECIMAL_SEP:
756 lexrc >> default_decimal_sep;
758 case RC_DEFAULT_LENGTH_UNIT:
760 default_length_unit = (Length::UNIT) lexrc.getInteger();
762 case RC_LANGUAGE_CUSTOM_PACKAGE:
763 lexrc >> language_custom_package;
765 case RC_LANGUAGE_AUTO_BEGIN:
766 lexrc >> language_auto_begin;
768 case RC_LANGUAGE_AUTO_END:
769 lexrc >> language_auto_end;
771 case RC_LANGUAGE_GLOBAL_OPTIONS:
772 lexrc >> language_global_options;
774 case RC_LANGUAGE_PACKAGE_SELECTION:
776 switch (lexrc.getInteger()) {
778 language_package_selection = LP_AUTO;
781 language_package_selection = LP_BABEL;
784 language_package_selection = LP_CUSTOM;
787 language_package_selection = LP_NONE;
792 case RC_LANGUAGE_COMMAND_BEGIN:
793 lexrc >> language_command_begin;
795 case RC_LANGUAGE_COMMAND_END:
796 lexrc >> language_command_end;
798 case RC_LANGUAGE_COMMAND_LOCAL:
799 lexrc >> language_command_local;
801 case RC_RESPECT_OS_KBD_LANGUAGE:
802 lexrc >> respect_os_kbd_language;
804 case RC_VISUAL_CURSOR:
805 lexrc >> visual_cursor;
807 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
808 lexrc >> close_buffer_with_last_view;
811 lexrc >> auto_number;
813 case RC_MARK_FOREIGN_LANGUAGE:
814 lexrc >> mark_foreign_language;
820 fmt = lexrc.getString();
821 if (lexrc.next(true))
822 command = lexrc.getString();
823 setMover(fmt, command);
828 string from, to, command, flags;
830 from = lexrc.getString();
832 to = lexrc.getString();
833 if (lexrc.next(true))
834 command = lexrc.getString();
836 flags = lexrc.getString();
838 theConverters().erase(from, to);
840 theConverters().add(from, to, command, flags);
843 // compatibility with versions older than 1.4.0 only
845 string format, command;
846 lexrc >> format >> command;
847 theFormats().setViewer(format, command);
850 case RC_FILEFORMAT: {
852 string format, extensions, shortcut;
853 docstring prettyname;
854 if (!(lexrc >> format >> extensions))
856 if (ok && lexrc.next(true))
857 prettyname = lexrc.getDocString();
861 if(!(lexrc >> shortcut))
863 string viewer, editor;
864 if (ok && lexrc.next(true))
865 viewer = lexrc.getString();
868 if (ok && lexrc.next(true))
869 editor = lexrc.getString();
873 if (!(lexrc >> flags >> mime))
875 int flgs = Format::none;
876 while (!flags.empty()) {
878 flags = split(flags, flag, ',');
879 if (flag == "document")
880 flgs |= Format::document;
881 else if (flag == "vector")
882 flgs |= Format::vector;
883 else if (flag == "zipped=native")
884 flgs |= Format::zipped_native;
885 else if (flag == "menu=export")
886 flgs |= Format::export_menu;
888 LYXERR0("Ignoring unknown flag `"
889 << flag << "' for format `"
893 LYXERR0("Syntax error in format " << format);
894 else if (prettyname.empty()) {
895 if (theConverters().formatIsUsed(format))
896 LYXERR0("Can't delete format " << format);
898 theFormats().erase(format);
900 theFormats().add(format, extensions, prettyname,
901 shortcut, viewer, editor, mime, flgs);
905 case RC_VIEWER_ALTERNATIVES: {
906 string format, command;
907 if ((lexrc >> format) && lexrc.next(true)) {
908 command = lexrc.getString();
909 viewer_alternatives[format].insert(command);
913 case RC_EDITOR_ALTERNATIVES: {
914 string format, command;
915 if ((lexrc >> format) && lexrc.next(true)) {
916 command = lexrc.getString();
917 editor_alternatives[format].insert(command);
922 case RC_DEFAULT_OTF_VIEW_FORMAT:
923 lexrc >> default_otf_view_format;
926 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
927 lexrc >> default_platex_view_format;
930 case RC_DEFAULT_VIEW_FORMAT:
931 lexrc >> default_view_format;
934 case RC_GUI_LANGUAGE:
935 lexrc >> gui_language;
939 lexrc >> show_banner;
944 string const tmp = lexrc.getString();
945 if (tmp == "true" || tmp == "on")
946 preview = PREVIEW_ON;
947 else if (tmp == "no_math")
948 preview = PREVIEW_NO_MATH;
950 preview = PREVIEW_OFF;
951 if (tmp != "false" && tmp != "off")
952 LYXERR0("Unrecognized preview status \""
958 case RC_PREVIEW_HASHED_LABELS:
959 lexrc >> preview_hashed_labels;
962 case RC_PREVIEW_SCALE_FACTOR:
963 lexrc >> preview_scale_factor;
974 lexrc >> path_prefix;
977 case RC_USE_CONVERTER_CACHE:
978 lexrc >> use_converter_cache;
980 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
981 lexrc >> use_converter_needauth_forbidden;
983 case RC_USE_CONVERTER_NEEDAUTH:
984 lexrc >> use_converter_needauth;
986 case RC_CONVERTER_CACHE_MAXAGE:
987 lexrc >> converter_cache_maxage;
990 case RC_SORT_LAYOUTS:
991 lexrc >> sort_layouts;
993 case RC_GROUP_LAYOUTS:
994 lexrc >> group_layouts;
996 case RC_FULL_SCREEN_LIMIT:
997 lexrc >> full_screen_limit;
999 case RC_FULL_SCREEN_TOOLBARS:
1000 lexrc >> full_screen_toolbars;
1002 case RC_FULL_SCREEN_SCROLLBAR:
1003 lexrc >> full_screen_scrollbar;
1005 case RC_FULL_SCREEN_STATUSBAR:
1006 lexrc >> full_screen_statusbar;
1008 case RC_FULL_SCREEN_TABBAR:
1009 lexrc >> full_screen_tabbar;
1011 case RC_FULL_SCREEN_MENUBAR:
1012 lexrc >> full_screen_menubar;
1014 case RC_FULL_SCREEN_WIDTH:
1015 lexrc >> full_screen_width;
1017 case RC_OPEN_BUFFERS_IN_TABS:
1018 lexrc >> open_buffers_in_tabs;
1020 case RC_SINGLE_CLOSE_TAB_BUTTON:
1021 lexrc >> single_close_tab_button;
1023 case RC_SINGLE_INSTANCE:
1024 lexrc >> single_instance;
1025 if (run_mode == PREFERRED)
1026 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1028 case RC_FORWARD_SEARCH_DVI:
1029 if (lexrc.next(true))
1030 forward_search_dvi = lexrc.getString();
1032 case RC_FORWARD_SEARCH_PDF:
1033 if (lexrc.next(true))
1034 forward_search_pdf = lexrc.getString();
1036 case RC_EXPORT_OVERWRITE:
1038 string const tmp = lexrc.getString();
1039 if (tmp == "all" || tmp == "true")
1040 export_overwrite = ALL_FILES;
1041 else if (tmp == "main")
1042 export_overwrite = MAIN_FILE;
1044 export_overwrite = NO_FILES;
1045 if (tmp != "ask" && tmp != "false")
1046 LYXERR0("Unrecognized export_overwrite status \""
1051 case RC_SCROLL_WHEEL_ZOOM:
1053 string const tmp = lexrc.getString();
1055 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1056 else if (tmp == "shift")
1057 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1058 else if (tmp == "alt")
1059 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1061 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1062 if (tmp != "off" && tmp != "false")
1063 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1069 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1070 lexrc >> mouse_middlebutton_paste;
1074 break; // this is just a dummy
1077 // This is triggered the first time through the loop unless
1078 // we hit a format tag.
1079 if (check_format && rc_format != LYXRC_FILEFORMAT)
1080 return FormatMismatch;
1083 /// Update converters data-structures
1084 theConverters().update(theFormats());
1085 theConverters().buildGraph();
1086 theBufferList().invalidateConverterCache();
1092 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1094 ofstream ofs(filename.toFilesystemEncoding().c_str());
1096 write(ofs, ignore_system_lyxrc);
1100 void LyXRC::print() const
1102 if (lyxerr.debugging())
1103 write(lyxerr, false);
1111 typedef pair<string, SpecialisedMover> Data;
1113 SameMover(Data const & comparison)
1114 : comparison_(comparison) {}
1116 bool operator()(Data const & data) const
1118 return data.first == comparison_.first &&
1119 data.second.command() == comparison_.second.command();
1129 // Escape \ and " so that LyXLex can read the string later
1130 string escapeCommand(string const & str) {
1131 return subst(subst(str , "\\", "\\\\"),
1138 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1140 LyXRCTags tag = RC_LAST;
1142 if (!name.empty()) {
1143 for (int i = 0; i != lyxrcCount; ++i)
1144 if ("\\" + name == lyxrcTags[i].tag)
1145 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1149 os << "# LyX " << lyx_version
1150 << " generated this file. If you want to make your own\n"
1151 << "# modifications you should do them from inside LyX and save.\n\n"
1152 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1154 // Why the switch you might ask. It is a trick to ensure that all
1155 // the elements in the LyXRCTags enum are handled. As you can see
1156 // there are no breaks at all. So it is just a huge fall-through.
1157 // The nice thing is that we will get a warning from the compiler
1158 // if we forget an element.
1162 // input/include files are not done here
1163 case RC_LYXRCFORMAT:
1165 if (ignore_system_lyxrc ||
1166 bind_file != system_lyxrc.bind_file) {
1167 string const path = os::external_path(bind_file);
1168 os << "\\bind_file \"" << path << "\"\n";
1174 if (ignore_system_lyxrc ||
1175 def_file != system_lyxrc.def_file) {
1176 string const path = os::external_path(def_file);
1177 os << "\\def_file \"" << path << "\"\n";
1186 << "# MISC SECTION ######################################\n"
1188 // bind files are not done here.
1190 case RC_PATH_PREFIX:
1191 if (ignore_system_lyxrc ||
1192 path_prefix != system_lyxrc.path_prefix) {
1193 os << "\\path_prefix \"" << path_prefix << "\"\n";
1199 if (ignore_system_lyxrc ||
1200 ui_file != system_lyxrc.ui_file) {
1201 string const path = os::external_path(ui_file);
1202 os << "\\ui_file \"" << path << "\"\n";
1207 case RC_AUTOREGIONDELETE:
1208 if (ignore_system_lyxrc ||
1209 auto_region_delete != system_lyxrc.auto_region_delete) {
1210 os << "# Set to false to inhibit automatic replacement of\n"
1211 << "# the current selection.\n"
1212 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1218 case RC_AUTORESET_OPTIONS:
1219 if (ignore_system_lyxrc ||
1220 auto_reset_options != system_lyxrc.auto_reset_options) {
1221 os << "# Set to false to inhibit automatic reset of\n"
1222 << "# the class options to defaults on class change.\n"
1223 << "\\auto_reset_options "
1224 << convert<string>(auto_reset_options)
1231 if (ignore_system_lyxrc ||
1232 autosave != system_lyxrc.autosave) {
1233 os << "# The time interval between auto-saves in seconds.\n"
1234 << "\\autosave " << autosave << '\n';
1239 case RC_DISPLAY_GRAPHICS:
1240 if (ignore_system_lyxrc ||
1241 display_graphics != system_lyxrc.display_graphics) {
1242 os << "# Display graphics within LyX\n"
1244 << "\\display_graphics "
1245 << (display_graphics ? "true" : "false")
1251 case RC_SORT_LAYOUTS:
1252 if (ignore_system_lyxrc ||
1253 sort_layouts != system_lyxrc.sort_layouts) {
1254 os << "# Sort layouts alphabetically.\n"
1255 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1260 case RC_GROUP_LAYOUTS:
1261 if (ignore_system_lyxrc ||
1262 group_layouts != system_lyxrc.group_layouts) {
1263 os << "# Group layouts by their category.\n"
1264 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1269 case RC_VIEWDVI_PAPEROPTION:
1270 if (ignore_system_lyxrc ||
1271 view_dvi_paper_option
1272 != system_lyxrc.view_dvi_paper_option) {
1273 os << "# Options used to specify paper size to the\n"
1274 << "# view_dvi_command (e.g. -paper)\n"
1275 << "\\view_dvi_paper_option \""
1276 << view_dvi_paper_option << "\"\n";
1281 case RC_CHKTEX_COMMAND:
1282 if (ignore_system_lyxrc ||
1283 chktex_command != system_lyxrc.chktex_command) {
1284 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1289 case RC_BIBTEX_ALTERNATIVES: {
1290 CommandSet::const_iterator it = bibtex_alternatives.begin();
1291 CommandSet::const_iterator end = bibtex_alternatives.end();
1292 for ( ; it != end; ++it) {
1293 if (ignore_system_lyxrc
1294 || !system_lyxrc.bibtex_alternatives.count(*it))
1295 os << "\\bibtex_alternatives \""
1302 case RC_BIBTEX_COMMAND:
1303 if (ignore_system_lyxrc ||
1304 bibtex_command != system_lyxrc.bibtex_command) {
1305 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1310 case RC_JBIBTEX_COMMAND:
1311 if (ignore_system_lyxrc ||
1312 jbibtex_command != system_lyxrc.jbibtex_command) {
1313 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1318 case RC_JBIBTEX_ALTERNATIVES: {
1319 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1320 CommandSet::const_iterator end = jbibtex_alternatives.end();
1321 for ( ; it != end; ++it) {
1322 if (ignore_system_lyxrc
1323 || !system_lyxrc.jbibtex_alternatives.count(*it))
1324 os << "\\jbibtex_alternatives \""
1331 case RC_INDEX_ALTERNATIVES: {
1332 CommandSet::const_iterator it = index_alternatives.begin();
1333 CommandSet::const_iterator end = index_alternatives.end();
1334 for ( ; it != end; ++it) {
1335 if (ignore_system_lyxrc
1336 || !system_lyxrc.index_alternatives.count(*it))
1337 os << "\\index_alternatives \""
1344 case RC_INDEX_COMMAND:
1345 if (ignore_system_lyxrc ||
1346 index_command != system_lyxrc.index_command) {
1347 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1352 case RC_JINDEX_COMMAND:
1353 if (ignore_system_lyxrc ||
1354 jindex_command != system_lyxrc.jindex_command) {
1355 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1360 case RC_SPLITINDEX_COMMAND:
1361 if (ignore_system_lyxrc ||
1362 splitindex_command != system_lyxrc.splitindex_command) {
1363 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1368 case RC_NOMENCL_COMMAND:
1369 if (ignore_system_lyxrc ||
1370 nomencl_command != system_lyxrc.nomencl_command) {
1371 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1376 case RC_PYGMENTIZE_COMMAND:
1377 if (ignore_system_lyxrc ||
1378 pygmentize_command != system_lyxrc.pygmentize_command) {
1379 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1384 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1385 // Don't write this setting to the preferences file,
1386 // but allow temporary changes (bug 7557).
1387 if (ignore_system_lyxrc) {
1388 os << "\\tex_expects_windows_paths "
1389 << convert<string>(windows_style_tex_paths) << '\n';
1394 case RC_TEX_ALLOWS_SPACES:
1395 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1396 os << "\\tex_allows_spaces "
1397 << convert<string>(tex_allows_spaces) << '\n';
1403 if (ignore_system_lyxrc ||
1404 use_kbmap != system_lyxrc.use_kbmap) {
1405 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1410 case RC_KBMAP_PRIMARY:
1411 if (ignore_system_lyxrc ||
1412 primary_kbmap != system_lyxrc.primary_kbmap) {
1413 string const path = os::external_path(primary_kbmap);
1414 os << "\\kbmap_primary \"" << path << "\"\n";
1419 case RC_KBMAP_SECONDARY:
1420 if (ignore_system_lyxrc ||
1421 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1422 string const path = os::external_path(secondary_kbmap);
1423 os << "\\kbmap_secondary \"" << path << "\"\n";
1429 if (ignore_system_lyxrc ||
1430 lyxpipes != system_lyxrc.lyxpipes) {
1431 string const path = os::external_path(lyxpipes);
1432 os << "\\serverpipe \"" << path << "\"\n";
1438 os << "\\user_name \"" << user_name << "\"\n";
1443 os << "\\user_email \"" << user_email << "\"\n";
1447 case RC_SHOW_BANNER:
1448 if (ignore_system_lyxrc ||
1449 show_banner != system_lyxrc.show_banner) {
1450 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1456 if (ignore_system_lyxrc ||
1457 preview != system_lyxrc.preview) {
1463 case PREVIEW_NO_MATH:
1470 os << "\\preview " << status << '\n';
1475 case RC_PREVIEW_HASHED_LABELS:
1476 if (ignore_system_lyxrc ||
1477 preview_hashed_labels !=
1478 system_lyxrc.preview_hashed_labels) {
1479 os << "\\preview_hashed_labels "
1480 << convert<string>(preview_hashed_labels) << '\n';
1485 case RC_PREVIEW_SCALE_FACTOR:
1486 if (ignore_system_lyxrc ||
1487 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1488 os << "\\preview_scale_factor "
1489 << preview_scale_factor << '\n';
1494 case RC_USE_CONVERTER_CACHE:
1495 if (ignore_system_lyxrc ||
1496 use_converter_cache != system_lyxrc.use_converter_cache) {
1497 os << "\\use_converter_cache "
1498 << convert<string>(use_converter_cache) << '\n';
1503 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1504 if (ignore_system_lyxrc ||
1505 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1506 os << "\\use_converter_needauth_forbidden "
1507 << convert<string>(use_converter_needauth_forbidden) << '\n';
1512 case RC_USE_CONVERTER_NEEDAUTH:
1513 if (ignore_system_lyxrc ||
1514 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1515 os << "\\use_converter_needauth "
1516 << convert<string>(use_converter_needauth) << '\n';
1521 case RC_CONVERTER_CACHE_MAXAGE:
1522 if (ignore_system_lyxrc ||
1523 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1524 os << "\\converter_cache_maxage "
1525 << converter_cache_maxage << '\n';
1531 << "# SCREEN & FONTS SECTION ############################\n"
1535 if (ignore_system_lyxrc ||
1536 icon_set != system_lyxrc.icon_set) {
1537 os << "\\icon_set \"" << icon_set
1543 case RC_USE_SYSTEM_THEME_ICONS:
1544 if (ignore_system_lyxrc ||
1545 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1546 os << "\\use_system_theme_icons "
1547 << convert<string>(use_system_theme_icons)
1554 if (ignore_system_lyxrc ||
1555 dpi != system_lyxrc.dpi) {
1556 os << "\\screen_dpi " << dpi << '\n';
1561 case RC_SCREEN_ZOOM:
1562 if (ignore_system_lyxrc ||
1563 defaultZoom != system_lyxrc.defaultZoom) {
1564 os << "\\screen_zoom " << defaultZoom << '\n';
1569 case RC_GEOMETRY_SESSION:
1570 if (ignore_system_lyxrc ||
1571 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1572 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1578 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1579 if (ignore_system_lyxrc ||
1580 cursor_follows_scrollbar
1581 != system_lyxrc.cursor_follows_scrollbar) {
1582 os << "\\cursor_follows_scrollbar "
1583 << convert<string>(cursor_follows_scrollbar) << '\n';
1588 case RC_CURSOR_WIDTH:
1589 if (ignore_system_lyxrc ||
1591 != system_lyxrc.cursor_width) {
1592 os << "\\cursor_width "
1593 << cursor_width << '\n';
1598 case RC_SCROLL_BELOW_DOCUMENT:
1599 if (ignore_system_lyxrc ||
1600 scroll_below_document
1601 != system_lyxrc.scroll_below_document) {
1602 os << "\\scroll_below_document "
1603 << convert<string>(scroll_below_document) << '\n';
1608 case RC_PARAGRAPH_MARKERS:
1609 if (ignore_system_lyxrc ||
1611 != system_lyxrc.paragraph_markers) {
1612 os << "\\paragraph_markers "
1613 << convert<string>(paragraph_markers) << '\n';
1618 case RC_MAC_DONTSWAP_CTRL_META:
1619 if (ignore_system_lyxrc ||
1620 mac_dontswap_ctrl_meta
1621 != system_lyxrc.mac_dontswap_ctrl_meta) {
1622 os << "\\mac_dontswap_ctrl_meta "
1623 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1628 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1629 if (ignore_system_lyxrc ||
1630 mac_like_cursor_movement
1631 != system_lyxrc.mac_like_cursor_movement) {
1632 os << "\\mac_like_cursor_movement "
1633 << convert<string>(mac_like_cursor_movement) << '\n';
1638 case RC_MACRO_EDIT_STYLE:
1639 if (ignore_system_lyxrc ||
1641 != system_lyxrc.macro_edit_style) {
1642 os << "\\macro_edit_style ";
1643 switch (macro_edit_style) {
1644 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1645 case MACRO_EDIT_INLINE: os << "1\n"; break;
1646 case MACRO_EDIT_LIST: os << "2\n"; break;
1652 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1653 if (ignore_system_lyxrc ||
1654 dialogs_iconify_with_main
1655 != system_lyxrc.dialogs_iconify_with_main) {
1656 os << "\\dialogs_iconify_with_main "
1657 << convert<string>(dialogs_iconify_with_main) << '\n';
1662 case RC_SCREEN_FONT_ROMAN:
1663 if (ignore_system_lyxrc ||
1664 roman_font_name != system_lyxrc.roman_font_name) {
1665 os << "\\screen_font_roman \"" << roman_font_name
1671 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1672 if (ignore_system_lyxrc ||
1673 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1674 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1680 case RC_SCREEN_FONT_SANS:
1681 if (ignore_system_lyxrc ||
1682 sans_font_name != system_lyxrc.sans_font_name) {
1683 os << "\\screen_font_sans \"" << sans_font_name
1689 case RC_SCREEN_FONT_SANS_FOUNDRY:
1690 if (ignore_system_lyxrc ||
1691 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1692 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1698 case RC_SCREEN_FONT_TYPEWRITER:
1699 if (ignore_system_lyxrc ||
1700 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1701 os << "\\screen_font_typewriter \""
1702 << typewriter_font_name << "\"\n";
1707 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1708 if (ignore_system_lyxrc ||
1709 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1710 os << "\\screen_font_typewriter_foundry \""
1711 << typewriter_font_foundry << "\"\n";
1716 case RC_SCREEN_FONT_SCALABLE:
1717 if (ignore_system_lyxrc ||
1718 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1719 os << "\\screen_font_scalable "
1720 << convert<string>(use_scalable_fonts)
1726 case RC_SCREEN_FONT_SIZES:
1727 if (ignore_system_lyxrc ||
1728 font_sizes[TINY_SIZE]
1729 != system_lyxrc.font_sizes[TINY_SIZE] ||
1730 font_sizes[SCRIPT_SIZE]
1731 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1732 font_sizes[FOOTNOTE_SIZE]
1733 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1734 font_sizes[SMALL_SIZE]
1735 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1736 font_sizes[NORMAL_SIZE]
1737 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1738 font_sizes[LARGE_SIZE]
1739 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1740 font_sizes[LARGER_SIZE]
1741 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1742 font_sizes[LARGEST_SIZE]
1743 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1744 font_sizes[HUGE_SIZE]
1745 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1746 font_sizes[HUGER_SIZE]
1747 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1748 streamsize old_prec = os.precision();
1749 os.setf(ios::fixed);
1751 os << "\\screen_font_sizes"
1752 << ' ' << font_sizes[TINY_SIZE]
1753 << ' ' << font_sizes[SCRIPT_SIZE]
1754 << ' ' << font_sizes[FOOTNOTE_SIZE]
1755 << ' ' << font_sizes[SMALL_SIZE]
1756 << ' ' << font_sizes[NORMAL_SIZE]
1757 << ' ' << font_sizes[LARGE_SIZE]
1758 << ' ' << font_sizes[LARGER_SIZE]
1759 << ' ' << font_sizes[LARGEST_SIZE]
1760 << ' ' << font_sizes[HUGE_SIZE]
1761 << ' ' << font_sizes[HUGER_SIZE]
1763 os.precision(old_prec);
1764 os.unsetf(ios::fixed);
1769 case RC_FULL_SCREEN_LIMIT:
1770 if (ignore_system_lyxrc ||
1771 full_screen_limit != system_lyxrc.full_screen_limit) {
1772 os << "\\fullscreen_limit "
1773 << convert<string>(full_screen_limit)
1779 case RC_FULL_SCREEN_TOOLBARS:
1780 if (ignore_system_lyxrc ||
1781 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1782 os << "\\fullscreen_toolbars "
1783 << convert<string>(full_screen_toolbars)
1789 case RC_FULL_SCREEN_SCROLLBAR:
1790 if (ignore_system_lyxrc ||
1791 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1792 os << "\\fullscreen_scrollbar "
1793 << convert<string>(full_screen_scrollbar)
1799 case RC_FULL_SCREEN_STATUSBAR:
1800 if (ignore_system_lyxrc ||
1801 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1802 os << "\\fullscreen_statusbar "
1803 << convert<string>(full_screen_statusbar)
1809 case RC_FULL_SCREEN_TABBAR:
1810 if (ignore_system_lyxrc ||
1811 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1812 os << "\\fullscreen_tabbar "
1813 << convert<string>(full_screen_tabbar)
1819 case RC_FULL_SCREEN_MENUBAR:
1820 if (ignore_system_lyxrc ||
1821 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1822 os << "\\fullscreen_menubar "
1823 << convert<string>(full_screen_menubar)
1829 case RC_FULL_SCREEN_WIDTH:
1830 if (ignore_system_lyxrc ||
1831 full_screen_width != system_lyxrc.full_screen_width) {
1832 os << "\\fullscreen_width "
1833 << convert<string>(full_screen_width)
1839 case RC_OPEN_BUFFERS_IN_TABS:
1840 if (ignore_system_lyxrc ||
1841 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1842 os << "\\open_buffers_in_tabs "
1843 << convert<string>(open_buffers_in_tabs)
1849 case RC_SINGLE_CLOSE_TAB_BUTTON:
1850 if (ignore_system_lyxrc ||
1851 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1852 os << "\\single_close_tab_button "
1853 << convert<string>(single_close_tab_button)
1859 case RC_SINGLE_INSTANCE:
1860 if (ignore_system_lyxrc ||
1861 single_instance != system_lyxrc.single_instance) {
1862 os << "\\single_instance "
1863 << convert<string>(single_instance)
1869 case RC_FORWARD_SEARCH_DVI:
1870 if (ignore_system_lyxrc ||
1871 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1872 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1877 case RC_FORWARD_SEARCH_PDF:
1878 if (ignore_system_lyxrc ||
1879 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1880 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1886 << "# COLOR SECTION ###################################\n"
1891 for (int i = 0; i < Color_ignore; ++i) {
1892 ColorCode lc = static_cast<ColorCode>(i);
1893 string const col = lcolor.getX11Name(lc);
1894 if (ignore_system_lyxrc
1895 || col != system_lcolor.getX11Name(lc)) {
1896 os << "\\set_color \""
1897 << lcolor.getLyXName(lc) << "\" \""
1905 << "# PRINTER SECTION ###################################\n"
1909 case RC_PRINTLANDSCAPEFLAG:
1910 if (ignore_system_lyxrc ||
1911 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1912 os << "\\print_landscape_flag \"" << print_landscape_flag
1918 case RC_PRINTPAPERFLAG:
1919 if (ignore_system_lyxrc ||
1920 print_paper_flag != system_lyxrc.print_paper_flag) {
1921 os << "\\print_paper_flag \"" << print_paper_flag
1927 case RC_PRINTPAPERDIMENSIONFLAG:
1928 if (ignore_system_lyxrc ||
1929 print_paper_dimension_flag
1930 != system_lyxrc.print_paper_dimension_flag) {
1931 os << "\\print_paper_dimension_flag \""
1932 << print_paper_dimension_flag << "\"\n";
1938 << "# TEX SECTION #######################################\n"
1942 case RC_TEXINPUTS_PREFIX:
1943 if (ignore_system_lyxrc ||
1944 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1945 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1951 << "# FILE SECTION ######################################\n"
1954 case RC_DOCUMENTPATH:
1955 if (ignore_system_lyxrc ||
1956 document_path != system_lyxrc.document_path) {
1957 string const path = os::external_path(document_path);
1958 os << "\\document_path \"" << path << "\"\n";
1963 case RC_USELASTFILEPOS:
1964 if (ignore_system_lyxrc ||
1965 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1966 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1972 case RC_LOADSESSION:
1973 if (ignore_system_lyxrc ||
1974 load_session != system_lyxrc.load_session) {
1975 os << "\\load_session " << convert<string>(load_session)
1981 case RC_MOUSE_WHEEL_SPEED:
1982 if (ignore_system_lyxrc ||
1983 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1984 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1989 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1990 if (ignore_system_lyxrc ||
1991 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
1992 os << "\\mouse_middlebutton_paste "
1993 << convert<string>(mouse_middlebutton_paste) << '\n';
1998 case RC_COMPLETION_INLINE_DELAY:
1999 if (ignore_system_lyxrc ||
2000 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2001 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2006 case RC_COMPLETION_INLINE_MATH:
2007 if (ignore_system_lyxrc ||
2008 completion_inline_math != system_lyxrc.completion_inline_math) {
2009 os << "\\completion_inline_math "
2010 << convert<string>(completion_inline_math) << '\n';
2015 case RC_COMPLETION_INLINE_TEXT:
2016 if (ignore_system_lyxrc ||
2017 completion_inline_text != system_lyxrc.completion_inline_text) {
2018 os << "\\completion_inline_text "
2019 << convert<string>(completion_inline_text) << '\n';
2024 case RC_COMPLETION_INLINE_DOTS:
2025 if (ignore_system_lyxrc ||
2026 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2027 os << "\\completion_inline_dots "
2028 << convert<string>(completion_inline_dots) << '\n';
2033 case RC_AUTOCORRECTION_MATH:
2034 if (ignore_system_lyxrc ||
2035 autocorrection_math != system_lyxrc.autocorrection_math) {
2036 os << "\\autocorrection_math "
2037 << convert<string>(autocorrection_math) << '\n';
2042 case RC_COMPLETION_POPUP_DELAY:
2043 if (ignore_system_lyxrc ||
2044 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2045 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2050 case RC_COMPLETION_POPUP_MATH:
2051 if (ignore_system_lyxrc ||
2052 completion_popup_math != system_lyxrc.completion_popup_math) {
2053 os << "\\completion_popup_math "
2054 << convert<string>(completion_popup_math) << '\n';
2059 case RC_COMPLETION_POPUP_TEXT:
2060 if (ignore_system_lyxrc ||
2061 completion_popup_text != system_lyxrc.completion_popup_text) {
2062 os << "\\completion_popup_text "
2063 << convert<string>(completion_popup_text) << '\n';
2068 case RC_COMPLETION_CURSOR_TEXT:
2069 if (ignore_system_lyxrc ||
2070 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2071 os << "\\completion_cursor_text "
2072 << convert<string>(completion_cursor_text) << '\n';
2077 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2078 if (ignore_system_lyxrc ||
2079 completion_popup_after_complete
2080 != system_lyxrc.completion_popup_after_complete) {
2081 os << "\\completion_popup_after_complete "
2082 << convert<string>(completion_popup_after_complete) << '\n';
2087 case RC_COMPLETION_MINLENGTH:
2088 if (ignore_system_lyxrc ||
2089 completion_minlength != system_lyxrc.completion_minlength) {
2090 os << "\\completion_minlength " << convert<string>(completion_minlength)
2096 case RC_NUMLASTFILES:
2097 if (ignore_system_lyxrc ||
2098 num_lastfiles != system_lyxrc.num_lastfiles) {
2099 os << "\\num_lastfiles " << num_lastfiles << '\n';
2104 case RC_CHECKLASTFILES:
2105 if (ignore_system_lyxrc ||
2106 check_lastfiles != system_lyxrc.check_lastfiles) {
2107 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2113 case RC_EXAMPLEPATH:
2114 if (ignore_system_lyxrc ||
2115 example_path != system_lyxrc.example_path) {
2116 string const path = os::external_path(example_path);
2117 os << "\\example_path \"" << path << "\"\n";
2122 case RC_TEMPLATEPATH:
2123 if (ignore_system_lyxrc ||
2124 template_path != system_lyxrc.template_path) {
2125 string const path = os::external_path(template_path);
2126 os << "\\template_path \"" << path << "\"\n";
2131 case RC_TEMPDIRPATH:
2132 if (ignore_system_lyxrc ||
2133 tempdir_path != system_lyxrc.tempdir_path) {
2134 string const path = os::external_path(tempdir_path);
2135 os << "\\tempdir_path \"" << path << "\"\n";
2140 case RC_THESAURUSDIRPATH:
2141 if (ignore_system_lyxrc ||
2142 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2143 string const path = os::external_path(thesaurusdir_path);
2144 os << "\\thesaurusdir_path \"" << path << "\"\n";
2149 case RC_HUNSPELLDIR_PATH:
2150 if (ignore_system_lyxrc ||
2151 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2152 string const path = os::external_path(hunspelldir_path);
2153 os << "\\hunspelldir_path \"" << path << "\"\n";
2158 case RC_PLAINTEXT_LINELEN:
2159 if (ignore_system_lyxrc ||
2160 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2161 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2166 case RC_MAKE_BACKUP:
2167 if (ignore_system_lyxrc ||
2168 make_backup != system_lyxrc.make_backup) {
2169 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2174 case RC_SAVE_COMPRESSED:
2175 if (ignore_system_lyxrc ||
2176 save_compressed != system_lyxrc.save_compressed) {
2177 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2182 case RC_SAVE_ORIGIN:
2183 if (ignore_system_lyxrc ||
2184 save_origin != system_lyxrc.save_origin) {
2185 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2190 case RC_BACKUPDIR_PATH:
2191 if (ignore_system_lyxrc ||
2192 backupdir_path != system_lyxrc.backupdir_path) {
2193 string const path = os::external_path(backupdir_path);
2194 os << "\\backupdir_path \"" << path << "\"\n";
2200 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2204 << "# SPELLCHECKER SECTION ##############################\n"
2208 case RC_ACCEPT_COMPOUND:
2209 if (ignore_system_lyxrc ||
2210 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2211 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2218 if (ignore_system_lyxrc ||
2219 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2220 os << "\\alternate_language \"" << spellchecker_alt_lang
2227 if (ignore_system_lyxrc ||
2228 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2229 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2234 case RC_USE_NATIVE_FILEDIALOG:
2235 if (ignore_system_lyxrc ||
2236 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2237 os << "\\use_native_filedialog "
2238 << convert<string>(use_native_filedialog)
2244 case RC_USE_SYSTEM_COLORS:
2245 if (ignore_system_lyxrc ||
2246 use_system_colors != system_lyxrc.use_system_colors) {
2247 os << "\\use_system_colors "
2248 << convert<string>(use_system_colors)
2254 case RC_USE_TOOLTIP:
2255 if (ignore_system_lyxrc ||
2256 use_tooltip != system_lyxrc.use_tooltip) {
2257 os << "\\use_tooltip "
2258 << convert<string>(use_tooltip)
2266 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2270 case RC_DEFAULT_DECIMAL_SEP:
2271 if (ignore_system_lyxrc ||
2272 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2273 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2278 case RC_DEFAULT_LENGTH_UNIT:
2279 if (ignore_system_lyxrc ||
2280 default_length_unit != system_lyxrc.default_length_unit) {
2281 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2286 case RC_SPELLCHECKER:
2287 if (ignore_system_lyxrc ||
2288 spellchecker != system_lyxrc.spellchecker) {
2289 os << "\\spellchecker " << spellchecker << '\n';
2294 case RC_SPELLCHECK_CONTINUOUSLY:
2295 if (ignore_system_lyxrc ||
2296 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2297 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2303 case RC_SPELLCHECK_NOTES:
2304 if (ignore_system_lyxrc ||
2305 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2306 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2312 case RC_VISUAL_CURSOR:
2313 if (ignore_system_lyxrc ||
2314 visual_cursor != system_lyxrc.visual_cursor) {
2315 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2320 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2321 if (ignore_system_lyxrc ||
2322 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2323 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2324 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2329 case RC_LANGUAGE_CUSTOM_PACKAGE:
2330 if (ignore_system_lyxrc ||
2331 language_custom_package != system_lyxrc.language_custom_package) {
2332 os << "\\language_custom_package \"" << language_custom_package
2338 case RC_LANGUAGE_GLOBAL_OPTIONS:
2339 if (ignore_system_lyxrc ||
2340 language_global_options
2341 != system_lyxrc.language_global_options) {
2342 os << "\\language_global_options \""
2343 << convert<string>(language_global_options)
2349 case RC_LANGUAGE_PACKAGE_SELECTION:
2350 if (ignore_system_lyxrc ||
2351 language_package_selection != system_lyxrc.language_package_selection) {
2352 os << "\\language_package_selection ";
2353 switch (language_package_selection) {
2371 case RC_LANGUAGE_COMMAND_BEGIN:
2372 if (ignore_system_lyxrc ||
2373 language_command_begin
2374 != system_lyxrc.language_command_begin) {
2375 os << "\\language_command_begin \""
2376 << language_command_begin
2382 case RC_LANGUAGE_COMMAND_END:
2383 if (ignore_system_lyxrc ||
2384 language_command_end
2385 != system_lyxrc.language_command_end) {
2386 os << "\\language_command_end \"" << language_command_end
2392 case RC_LANGUAGE_COMMAND_LOCAL:
2393 if (ignore_system_lyxrc ||
2394 language_command_local
2395 != system_lyxrc.language_command_local) {
2396 os << "\\language_command_local \""
2397 << language_command_local
2403 case RC_LANGUAGE_AUTO_BEGIN:
2404 if (ignore_system_lyxrc ||
2405 language_auto_begin != system_lyxrc.language_auto_begin) {
2406 os << "\\language_auto_begin "
2407 << convert<string>(language_auto_begin) << '\n';
2412 case RC_LANGUAGE_AUTO_END:
2413 if (ignore_system_lyxrc ||
2414 language_auto_end != system_lyxrc.language_auto_end) {
2415 os << "\\language_auto_end "
2416 << convert<string>(language_auto_end) << '\n';
2421 case RC_MARK_FOREIGN_LANGUAGE:
2422 if (ignore_system_lyxrc ||
2423 mark_foreign_language
2424 != system_lyxrc.mark_foreign_language) {
2425 os << "\\mark_foreign_language " <<
2426 convert<string>(mark_foreign_language) << '\n';
2429 case RC_RESPECT_OS_KBD_LANGUAGE:
2430 if (ignore_system_lyxrc ||
2431 respect_os_kbd_language
2432 != system_lyxrc.respect_os_kbd_language) {
2433 os << "\\respect_os_kbd_language " <<
2434 convert<string>(respect_os_kbd_language) << '\n';
2441 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2445 case RC_AUTO_NUMBER:
2446 if (ignore_system_lyxrc ||
2447 auto_number != system_lyxrc.auto_number) {
2448 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2453 case RC_GUI_LANGUAGE:
2454 if (ignore_system_lyxrc ||
2455 gui_language != system_lyxrc.gui_language) {
2456 os << "\\gui_language " << gui_language << '\n';
2461 case RC_EXPORT_OVERWRITE:
2462 if (ignore_system_lyxrc ||
2463 export_overwrite != system_lyxrc.export_overwrite) {
2465 switch (export_overwrite) {
2476 os << "\\export_overwrite " << status << '\n';
2481 case RC_SCROLL_WHEEL_ZOOM:
2482 if (ignore_system_lyxrc ||
2483 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2485 switch (scroll_wheel_zoom) {
2486 case SCROLL_WHEEL_ZOOM_OFF:
2489 case SCROLL_WHEEL_ZOOM_CTRL:
2492 case SCROLL_WHEEL_ZOOM_SHIFT:
2495 case SCROLL_WHEEL_ZOOM_ALT:
2499 os << "\\scroll_wheel_zoom " << status << '\n';
2505 << "# FORMATS SECTION ##########################\n"
2510 // New/modified formats
2511 for (Formats::const_iterator cit = theFormats().begin();
2512 cit != theFormats().end(); ++cit) {
2513 Format const * format =
2514 theSystemFormats().getFormat(cit->name());
2516 format->extensions() != cit->extensions() ||
2517 format->prettyname() != cit->prettyname() ||
2518 format->shortcut() != cit->shortcut() ||
2519 format->viewer() != cit->viewer() ||
2520 format->editor() != cit->editor() ||
2521 format->documentFormat() != cit->documentFormat() ||
2522 format->vectorFormat() != cit->vectorFormat() ||
2523 format->inExportMenu() != cit->inExportMenu() ||
2524 format->mime() != cit->mime()) {
2525 os << "\\format \"" << cit->name() << "\" \""
2526 << cit->extensions() << "\" \""
2527 << to_utf8(cit->prettyname()) << "\" \""
2528 << cit->shortcut() << "\" \""
2529 << escapeCommand(cit->viewer()) << "\" \""
2530 << escapeCommand(cit->editor()) << "\" \"";
2531 vector<string> flags;
2532 if (cit->documentFormat())
2533 flags.push_back("document");
2534 if (cit->vectorFormat())
2535 flags.push_back("vector");
2536 if (cit->zippedNative())
2537 flags.push_back("zipped=native");
2538 if (cit->inExportMenu())
2539 flags.push_back("menu=export");
2541 os << getStringFromVector(flags);
2542 os << "\" \"" << cit->mime() << "\"\n";
2546 // Look for deleted formats
2547 for (Formats::const_iterator cit = theSystemFormats().begin();
2548 cit != theSystemFormats().end(); ++cit)
2549 if (!theFormats().getFormat(cit->name()))
2550 os << "\\format \"" << cit->name()
2551 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2555 case RC_VIEWER_ALTERNATIVES: {
2556 Alternatives::const_iterator it = viewer_alternatives.begin();
2557 Alternatives::const_iterator const en = viewer_alternatives.end();
2558 Alternatives::const_iterator const sysend =
2559 system_lyxrc.viewer_alternatives.end();
2560 for (; it != en; ++it) {
2561 string const & fmt = it->first;
2562 CommandSet const & cmd = it->second;
2563 CommandSet::const_iterator sit = cmd.begin();
2564 CommandSet::const_iterator const sen = cmd.end();
2565 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2566 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2567 system_lyxrc.viewer_alternatives.find(fmt);
2568 for (; sit != sen; ++sit) {
2569 string const & cmd = *sit;
2570 if (ignore_system_lyxrc
2571 || sysfmt == sysend // format not found
2572 || sysfmt->second.count(cmd) == 0 // this command not found
2574 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2581 case RC_EDITOR_ALTERNATIVES: {
2582 Alternatives::const_iterator it = editor_alternatives.begin();
2583 Alternatives::const_iterator const en = editor_alternatives.end();
2584 Alternatives::const_iterator const sysend =
2585 system_lyxrc.editor_alternatives.end();
2586 for (; it != en; ++it) {
2587 string const & fmt = it->first;
2588 CommandSet const & cmd = it->second;
2589 CommandSet::const_iterator sit = cmd.begin();
2590 CommandSet::const_iterator const sen = cmd.end();
2591 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2592 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2593 system_lyxrc.editor_alternatives.find(fmt);
2594 for (; sit != sen; ++sit) {
2595 string const & cmd = *sit;
2596 if (ignore_system_lyxrc
2597 || sysfmt == sysend // format not found
2598 || sysfmt->second.count(cmd) == 0 // this command not found
2600 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2607 case RC_DEFAULT_OTF_VIEW_FORMAT:
2608 if ((ignore_system_lyxrc ||
2609 default_otf_view_format != system_lyxrc.default_otf_view_format)
2610 && !default_otf_view_format.empty()) {
2611 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2616 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2617 if ((ignore_system_lyxrc ||
2618 default_platex_view_format != system_lyxrc.default_platex_view_format)
2619 && !default_platex_view_format.empty()) {
2620 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2625 case RC_DEFAULT_VIEW_FORMAT:
2626 if (ignore_system_lyxrc ||
2627 default_view_format != system_lyxrc.default_view_format) {
2628 os << "\\default_view_format " << default_view_format << '\n';
2639 << "# CONVERTERS SECTION ##########################\n"
2644 // Look for new converters
2645 for (Converters::const_iterator cit = theConverters().begin();
2646 cit != theConverters().end(); ++cit) {
2647 Converter const * converter =
2648 theSystemConverters().getConverter(cit->from(),
2651 converter->command() != cit->command() ||
2652 converter->flags() != cit->flags())
2653 os << "\\converter \"" << cit->from() << "\" \""
2654 << cit->to() << "\" \""
2655 << escapeCommand(cit->command()) << "\" \""
2656 << cit->flags() << "\"\n";
2659 // New/modifed converters
2660 for (Converters::const_iterator cit = theSystemConverters().begin();
2661 cit != theSystemConverters().end(); ++cit)
2662 if (!theConverters().getConverter(cit->from(), cit->to()))
2663 os << "\\converter \"" << cit->from()
2664 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2671 << "# COPIERS SECTION ##########################\n"
2674 // Look for new movers
2675 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2676 Movers::const_iterator const sysend = theSystemMovers().end();
2677 Movers::const_iterator it = theMovers().begin();
2678 Movers::const_iterator end = theMovers().end();
2680 for (; it != end; ++it) {
2681 Movers::const_iterator const sysit =
2682 find_if(sysbegin, sysend, SameMover(*it));
2683 if (sysit == sysend) {
2684 string const & fmt = it->first;
2685 string const & command =
2686 it->second.command();
2688 os << "\\copier " << fmt
2689 << " \"" << escapeCommand(command) << "\"\n";
2695 // We don't actually delete SpecialisedMover(s) from the
2696 // map, just clear their 'command', so there's no need
2697 // to test for anything else.
2704 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2706 // Why the switch you might ask. It is a trick to ensure that all
2707 // the elements in the LyXRCTags enum is handled. As you can see
2708 // there are no breaks at all. So it is just a huge fall-through.
2709 // The nice thing is that we will get a warning from the compiler
2710 // if we forget an element.
2711 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2713 case LyXRC::RC_LAST:
2714 case LyXRC::RC_ACCEPT_COMPOUND:
2715 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2716 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2718 case LyXRC::RC_ALT_LANG:
2719 case LyXRC::RC_PLAINTEXT_LINELEN:
2720 case LyXRC::RC_AUTOCORRECTION_MATH:
2721 case LyXRC::RC_AUTOREGIONDELETE:
2722 case LyXRC::RC_AUTORESET_OPTIONS:
2723 case LyXRC::RC_AUTOSAVE:
2724 case LyXRC::RC_AUTO_NUMBER:
2725 case LyXRC::RC_BACKUPDIR_PATH:
2726 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2727 case LyXRC::RC_BIBTEX_COMMAND:
2728 case LyXRC::RC_BINDFILE:
2729 case LyXRC::RC_CHECKLASTFILES:
2730 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2731 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2732 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2733 case LyXRC::RC_COMPLETION_INLINE_MATH:
2734 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2735 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2736 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2737 case LyXRC::RC_COMPLETION_POPUP_MATH:
2738 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2739 case LyXRC::RC_COMPLETION_MINLENGTH:
2740 case LyXRC::RC_USELASTFILEPOS:
2741 case LyXRC::RC_LOADSESSION:
2742 case LyXRC::RC_CHKTEX_COMMAND:
2743 case LyXRC::RC_CONVERTER:
2744 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2745 case LyXRC::RC_COPIER:
2746 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2747 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2748 case LyXRC::RC_GUI_LANGUAGE:
2749 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2750 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2751 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2752 case LyXRC::RC_DEFFILE:
2753 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2754 case LyXRC::RC_DISPLAY_GRAPHICS:
2755 case LyXRC::RC_DOCUMENTPATH:
2756 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2757 FileName path(lyxrc_new.document_path);
2758 if (path.exists() && path.isDirectory())
2759 package().document_dir() = FileName(lyxrc.document_path);
2762 case LyXRC::RC_EDITOR_ALTERNATIVES:
2763 case LyXRC::RC_ESC_CHARS:
2764 case LyXRC::RC_EXAMPLEPATH:
2765 case LyXRC::RC_FILEFORMAT:
2766 case LyXRC::RC_GROUP_LAYOUTS:
2767 case LyXRC::RC_HUNSPELLDIR_PATH:
2768 case LyXRC::RC_ICON_SET:
2769 case LyXRC::RC_INDEX_ALTERNATIVES:
2770 case LyXRC::RC_INDEX_COMMAND:
2771 case LyXRC::RC_JBIBTEX_COMMAND:
2772 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2773 case LyXRC::RC_JINDEX_COMMAND:
2774 case LyXRC::RC_NOMENCL_COMMAND:
2775 case LyXRC::RC_PYGMENTIZE_COMMAND:
2776 case LyXRC::RC_INPUT:
2777 case LyXRC::RC_KBMAP:
2778 case LyXRC::RC_KBMAP_PRIMARY:
2779 case LyXRC::RC_KBMAP_SECONDARY:
2780 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2781 case LyXRC::RC_LANGUAGE_AUTO_END:
2782 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2783 case LyXRC::RC_LANGUAGE_COMMAND_END:
2784 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2785 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2786 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2787 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2788 case LyXRC::RC_LYXRCFORMAT:
2789 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2790 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2791 case LyXRC::RC_MACRO_EDIT_STYLE:
2792 case LyXRC::RC_MAKE_BACKUP:
2793 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2794 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2795 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2796 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2797 case LyXRC::RC_NUMLASTFILES:
2798 case LyXRC::RC_PARAGRAPH_MARKERS:
2799 case LyXRC::RC_PATH_PREFIX:
2800 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2801 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2802 // Resets python path
2803 support::os::python(true);
2806 case LyXRC::RC_PREVIEW:
2807 if (lyxrc_orig.preview != lyxrc_new.preview) {
2808 // Update all previews of all documents.
2809 /* FIXME: this can be very expensive. It would be cheaper
2810 * to kill all existing previews and update visible
2812 theBufferList().updatePreviews();
2815 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2816 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2817 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2818 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2819 case LyXRC::RC_PRINTPAPERFLAG:
2820 case LyXRC::RC_SAVE_COMPRESSED:
2821 case LyXRC::RC_SAVE_ORIGIN:
2822 case LyXRC::RC_SCREEN_DPI:
2824 case LyXRC::RC_SCREEN_FONT_ROMAN:
2825 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2826 case LyXRC::RC_SCREEN_FONT_SANS:
2827 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2828 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2829 case LyXRC::RC_SCREEN_FONT_SIZES:
2830 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2831 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2832 case LyXRC::RC_SCREEN_ZOOM:
2833 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2834 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2835 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2836 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2837 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2838 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2839 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2840 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2841 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2842 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2845 case LyXRC::RC_GEOMETRY_SESSION:
2846 case LyXRC::RC_SERVERPIPE:
2847 case LyXRC::RC_SET_COLOR:
2848 case LyXRC::RC_SHOW_BANNER:
2849 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2850 case LyXRC::RC_SPELLCHECKER:
2851 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2854 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2855 case LyXRC::RC_SPELLCHECK_NOTES:
2856 case LyXRC::RC_SPLITINDEX_COMMAND:
2857 case LyXRC::RC_TEMPDIRPATH:
2858 case LyXRC::RC_TEMPLATEPATH:
2859 case LyXRC::RC_TEX_ALLOWS_SPACES:
2860 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2861 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2862 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2865 case LyXRC::RC_TEXINPUTS_PREFIX:
2866 case LyXRC::RC_THESAURUSDIRPATH:
2867 case LyXRC::RC_UIFILE:
2868 case LyXRC::RC_USER_EMAIL:
2869 case LyXRC::RC_USER_NAME:
2870 case LyXRC::RC_USE_CONVERTER_CACHE:
2871 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2872 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2873 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2874 case LyXRC::RC_USE_SYSTEM_COLORS:
2875 case LyXRC::RC_USE_TOOLTIP:
2876 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2877 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2878 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2879 case LyXRC::RC_SINGLE_INSTANCE:
2880 case LyXRC::RC_SORT_LAYOUTS:
2881 case LyXRC::RC_FULL_SCREEN_LIMIT:
2882 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2883 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2884 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2885 case LyXRC::RC_FULL_SCREEN_TABBAR:
2886 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2887 case LyXRC::RC_FULL_SCREEN_WIDTH:
2888 case LyXRC::RC_VISUAL_CURSOR:
2889 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2890 case LyXRC::RC_VIEWER:
2891 case LyXRC::RC_VIEWER_ALTERNATIVES:
2892 case LyXRC::RC_FORWARD_SEARCH_DVI:
2893 case LyXRC::RC_FORWARD_SEARCH_PDF:
2894 case LyXRC::RC_EXPORT_OVERWRITE:
2895 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2896 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2897 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2898 case LyXRC::RC_CURSOR_WIDTH:
2904 set<string> LyXRC::getRCs()
2907 for (int i = 0; i != lyxrcCount; ++i)
2908 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2914 string const LyXRC::getDescription(LyXRCTags tag)
2919 case RC_ACCEPT_COMPOUND:
2920 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2924 str = _("Specify an alternate language. The default is to use the language of the document.");
2927 case RC_PLAINTEXT_LINELEN:
2928 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.");
2931 case RC_AUTOREGIONDELETE:
2932 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2935 case RC_AUTORESET_OPTIONS:
2936 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2940 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2943 case RC_AUTO_NUMBER:
2946 case RC_BACKUPDIR_PATH:
2947 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.");
2950 case RC_BIBTEX_COMMAND:
2951 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2954 case RC_JBIBTEX_COMMAND:
2955 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2959 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2962 case RC_CHECKLASTFILES:
2963 str = _("Select to check whether the lastfiles still exist.");
2966 case RC_CHKTEX_COMMAND:
2967 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2973 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
2974 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
2977 case RC_CONVERTER_NEEDAUTH:
2978 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
2984 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2985 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.");
2988 case RC_CURSOR_WIDTH:
2989 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2992 case RC_SCROLL_BELOW_DOCUMENT:
2993 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");
2996 case RC_MAC_DONTSWAP_CTRL_META:
2997 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3000 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3001 str = _("Use the Mac OS X conventions for cursor movement");
3004 case RC_SHOW_MACRO_LABEL:
3005 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3009 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3012 case RC_DEFAULT_OTF_VIEW_FORMAT:
3013 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3016 case RC_DEFAULT_VIEW_FORMAT:
3017 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3020 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3021 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3024 case RC_DISPLAY_GRAPHICS:
3025 str = _("Select how LyX will display any graphics.");
3028 case RC_DOCUMENTPATH:
3029 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3033 str = _("Specify additional chars that can be part of a word.");
3036 case RC_EXAMPLEPATH:
3037 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3043 case RC_INDEX_COMMAND:
3044 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\".");
3047 case RC_JINDEX_COMMAND:
3048 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3051 case RC_NOMENCL_COMMAND:
3052 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3055 case RC_PYGMENTIZE_COMMAND:
3056 str = _("The command to run the python pygments syntax highlighter.");
3063 case RC_KBMAP_PRIMARY:
3064 case RC_KBMAP_SECONDARY:
3065 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.");
3068 case RC_LANGUAGE_AUTO_BEGIN:
3069 str = _("Select if a language switching command is needed at the beginning of the document.");
3072 case RC_LANGUAGE_AUTO_END:
3073 str = _("Select if a language switching command is needed at the end of the document.");
3076 case RC_LANGUAGE_COMMAND_BEGIN:
3077 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.");
3080 case RC_LANGUAGE_COMMAND_END:
3081 str = _("The LaTeX command for changing back to the language of the document.");
3084 case RC_LANGUAGE_COMMAND_LOCAL:
3085 str = _("The LaTeX command for local changing of the language.");
3088 case RC_LANGUAGE_GLOBAL_OPTIONS:
3089 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3092 case RC_LANGUAGE_CUSTOM_PACKAGE:
3093 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3096 case RC_LANGUAGE_PACKAGE_SELECTION:
3097 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3100 case RC_USELASTFILEPOS:
3101 str = _("De-select if you do not want LyX to scroll to saved position.");
3104 case RC_LOADSESSION:
3105 str = _("De-select to prevent loading files opened from the last LyX session.");
3108 case RC_MAKE_BACKUP:
3109 str = _("De-select if you don't want LyX to create backup files.");
3112 case RC_MARK_FOREIGN_LANGUAGE:
3113 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3116 case RC_RESPECT_OS_KBD_LANGUAGE:
3117 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3120 case RC_MOUSE_WHEEL_SPEED:
3121 str = _("The scrolling speed of the mouse wheel.");
3124 case RC_COMPLETION_POPUP_DELAY:
3125 str = _("The completion popup delay.");
3128 case RC_COMPLETION_POPUP_MATH:
3129 str = _("Select to display the completion popup in math mode.");
3132 case RC_COMPLETION_POPUP_TEXT:
3133 str = _("Select to display the completion popup in text mode.");
3136 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3137 str = _("Show the completion popup without delay after non-unique completion attempt.");
3140 case RC_COMPLETION_POPUP_TEXT:
3141 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3144 case RC_COMPLETION_POPUP_DELAY:
3145 str = _("The inline completion delay.");
3148 case RC_COMPLETION_INLINE_MATH:
3149 str = _("Select to display the inline completion in math mode.");
3152 case RC_COMPLETION_INLINE_TEXT:
3153 str = _("Select to display the inline completion in text mode.");
3156 case RC_COMPLETION_INLINE_DOTS:
3157 str = _("Use \"...\" to shorten long completions.");
3160 case RC_AUTOCORRECTION_MATH:
3161 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3164 case RC_NUMLASTFILES:
3165 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3169 case RC_PATH_PREFIX:
3170 str = _("Specify those directories which should be "
3171 "prepended to the PATH environment variable.\n"
3172 "Use the OS native format.");
3176 str = _("Shows a typeset preview of things such as math");
3179 case RC_PREVIEW_HASHED_LABELS:
3180 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3183 case RC_PREVIEW_SCALE_FACTOR:
3184 str = _("Scale the preview size to suit.");
3187 case RC_PRINTLANDSCAPEFLAG:
3188 str = _("The option to print out in landscape.");
3191 case RC_PRINTPAPERDIMENSIONFLAG:
3192 str = _("Option to specify the dimensions of the print paper.");
3195 case RC_PRINTPAPERFLAG:
3196 str = _("The option to specify paper type.");
3199 case RC_VISUAL_CURSOR:
3200 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3203 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3204 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).");
3208 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3211 case RC_SCREEN_FONT_ROMAN:
3212 case RC_SCREEN_FONT_SANS:
3213 case RC_SCREEN_FONT_TYPEWRITER:
3214 str = _("The screen fonts used to display the text while editing.");
3217 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3218 case RC_SCREEN_FONT_SANS_FOUNDRY:
3219 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3222 case RC_SCREEN_FONT_SCALABLE:
3223 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.");
3226 case RC_SCREEN_FONT_SIZES:
3227 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3230 case RC_SCREEN_ZOOM:
3231 //xgettext:no-c-format
3232 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3235 case RC_GEOMETRY_SESSION:
3236 str = _("Allow session manager to save and restore windows geometry.");
3240 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3246 case RC_SHOW_BANNER:
3247 str = _("De-select if you don't want the startup banner.");
3250 case RC_TEMPDIRPATH:
3251 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3254 case RC_THESAURUSDIRPATH:
3255 str = _("This is the place where the files of the thesaurus library reside.");
3258 case RC_TEMPLATEPATH:
3259 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3262 case RC_TEX_ALLOWS_SPACES:
3265 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3268 case RC_TEXINPUTS_PREFIX:
3269 str = _("Specify those directories which should be "
3270 "prepended to the TEXINPUTS environment variable.\n"
3271 "A '.' represents the current document directory. "
3272 "Use the OS native format.");
3276 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3285 case RC_USE_USE_SYSTEM_COLORS:
3286 str = _("Enable use the system colors for some things like main window background and selection.");
3289 case RC_USE_TOOLTIP:
3290 str = _("Enable the automatic appearance of tool tips in the work area.");
3293 case RC_VIEWDVI_PAPEROPTION:
3294 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3309 // The global instance
3312 // The global copy of the system lyxrc entries (everything except preferences)