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;
887 else if (flag == "menu=none")
888 flgs |= Format::no_menu;
890 LYXERR0("Ignoring unknown flag `"
891 << flag << "' for format `"
895 LYXERR0("Syntax error in format " << format);
896 else if (prettyname.empty()) {
897 if (theConverters().formatIsUsed(format))
898 LYXERR0("Can't delete format " << format);
900 theFormats().erase(format);
902 theFormats().add(format, extensions, prettyname,
903 shortcut, viewer, editor, mime, flgs);
907 case RC_VIEWER_ALTERNATIVES: {
908 string format, command;
909 if ((lexrc >> format) && lexrc.next(true)) {
910 command = lexrc.getString();
911 viewer_alternatives[format].insert(command);
915 case RC_EDITOR_ALTERNATIVES: {
916 string format, command;
917 if ((lexrc >> format) && lexrc.next(true)) {
918 command = lexrc.getString();
919 editor_alternatives[format].insert(command);
924 case RC_DEFAULT_OTF_VIEW_FORMAT:
925 lexrc >> default_otf_view_format;
928 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
929 lexrc >> default_platex_view_format;
932 case RC_DEFAULT_VIEW_FORMAT:
933 lexrc >> default_view_format;
936 case RC_GUI_LANGUAGE:
937 lexrc >> gui_language;
941 lexrc >> show_banner;
946 string const tmp = lexrc.getString();
947 if (tmp == "true" || tmp == "on")
948 preview = PREVIEW_ON;
949 else if (tmp == "no_math")
950 preview = PREVIEW_NO_MATH;
952 preview = PREVIEW_OFF;
953 if (tmp != "false" && tmp != "off")
954 LYXERR0("Unrecognized preview status \""
960 case RC_PREVIEW_HASHED_LABELS:
961 lexrc >> preview_hashed_labels;
964 case RC_PREVIEW_SCALE_FACTOR:
965 lexrc >> preview_scale_factor;
976 lexrc >> path_prefix;
979 case RC_USE_CONVERTER_CACHE:
980 lexrc >> use_converter_cache;
982 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
983 lexrc >> use_converter_needauth_forbidden;
985 case RC_USE_CONVERTER_NEEDAUTH:
986 lexrc >> use_converter_needauth;
988 case RC_CONVERTER_CACHE_MAXAGE:
989 lexrc >> converter_cache_maxage;
992 case RC_SORT_LAYOUTS:
993 lexrc >> sort_layouts;
995 case RC_GROUP_LAYOUTS:
996 lexrc >> group_layouts;
998 case RC_FULL_SCREEN_LIMIT:
999 lexrc >> full_screen_limit;
1001 case RC_FULL_SCREEN_TOOLBARS:
1002 lexrc >> full_screen_toolbars;
1004 case RC_FULL_SCREEN_SCROLLBAR:
1005 lexrc >> full_screen_scrollbar;
1007 case RC_FULL_SCREEN_STATUSBAR:
1008 lexrc >> full_screen_statusbar;
1010 case RC_FULL_SCREEN_TABBAR:
1011 lexrc >> full_screen_tabbar;
1013 case RC_FULL_SCREEN_MENUBAR:
1014 lexrc >> full_screen_menubar;
1016 case RC_FULL_SCREEN_WIDTH:
1017 lexrc >> full_screen_width;
1019 case RC_OPEN_BUFFERS_IN_TABS:
1020 lexrc >> open_buffers_in_tabs;
1022 case RC_SINGLE_CLOSE_TAB_BUTTON:
1023 lexrc >> single_close_tab_button;
1025 case RC_SINGLE_INSTANCE:
1026 lexrc >> single_instance;
1027 if (run_mode == PREFERRED)
1028 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1030 case RC_FORWARD_SEARCH_DVI:
1031 if (lexrc.next(true))
1032 forward_search_dvi = lexrc.getString();
1034 case RC_FORWARD_SEARCH_PDF:
1035 if (lexrc.next(true))
1036 forward_search_pdf = lexrc.getString();
1038 case RC_EXPORT_OVERWRITE:
1040 string const tmp = lexrc.getString();
1041 if (tmp == "all" || tmp == "true")
1042 export_overwrite = ALL_FILES;
1043 else if (tmp == "main")
1044 export_overwrite = MAIN_FILE;
1046 export_overwrite = NO_FILES;
1047 if (tmp != "ask" && tmp != "false")
1048 LYXERR0("Unrecognized export_overwrite status \""
1053 case RC_SCROLL_WHEEL_ZOOM:
1055 string const tmp = lexrc.getString();
1057 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1058 else if (tmp == "shift")
1059 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1060 else if (tmp == "alt")
1061 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1063 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1064 if (tmp != "off" && tmp != "false")
1065 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1071 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1072 lexrc >> mouse_middlebutton_paste;
1076 break; // this is just a dummy
1079 // This is triggered the first time through the loop unless
1080 // we hit a format tag.
1081 if (check_format && rc_format != LYXRC_FILEFORMAT)
1082 return FormatMismatch;
1085 /// Update converters data-structures
1086 theConverters().update(theFormats());
1087 theConverters().buildGraph();
1088 theBufferList().invalidateConverterCache();
1094 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1096 ofstream ofs(filename.toFilesystemEncoding().c_str());
1098 write(ofs, ignore_system_lyxrc);
1102 void LyXRC::print() const
1104 if (lyxerr.debugging())
1105 write(lyxerr, false);
1113 typedef pair<string, SpecialisedMover> Data;
1115 SameMover(Data const & comparison)
1116 : comparison_(comparison) {}
1118 bool operator()(Data const & data) const
1120 return data.first == comparison_.first &&
1121 data.second.command() == comparison_.second.command();
1131 // Escape \ and " so that LyXLex can read the string later
1132 string escapeCommand(string const & str) {
1133 return subst(subst(str , "\\", "\\\\"),
1140 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1142 LyXRCTags tag = RC_LAST;
1144 if (!name.empty()) {
1145 for (int i = 0; i != lyxrcCount; ++i)
1146 if ("\\" + name == lyxrcTags[i].tag)
1147 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1151 os << "# LyX " << lyx_version
1152 << " generated this file. If you want to make your own\n"
1153 << "# modifications you should do them from inside LyX and save.\n\n"
1154 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1156 // Why the switch you might ask. It is a trick to ensure that all
1157 // the elements in the LyXRCTags enum are handled. As you can see
1158 // there are no breaks at all. So it is just a huge fall-through.
1159 // The nice thing is that we will get a warning from the compiler
1160 // if we forget an element.
1164 // input/include files are not done here
1165 case RC_LYXRCFORMAT:
1167 if (ignore_system_lyxrc ||
1168 bind_file != system_lyxrc.bind_file) {
1169 string const path = os::external_path(bind_file);
1170 os << "\\bind_file \"" << path << "\"\n";
1176 if (ignore_system_lyxrc ||
1177 def_file != system_lyxrc.def_file) {
1178 string const path = os::external_path(def_file);
1179 os << "\\def_file \"" << path << "\"\n";
1188 << "# MISC SECTION ######################################\n"
1190 // bind files are not done here.
1192 case RC_PATH_PREFIX:
1193 if (ignore_system_lyxrc ||
1194 path_prefix != system_lyxrc.path_prefix) {
1195 os << "\\path_prefix \"" << path_prefix << "\"\n";
1201 if (ignore_system_lyxrc ||
1202 ui_file != system_lyxrc.ui_file) {
1203 string const path = os::external_path(ui_file);
1204 os << "\\ui_file \"" << path << "\"\n";
1209 case RC_AUTOREGIONDELETE:
1210 if (ignore_system_lyxrc ||
1211 auto_region_delete != system_lyxrc.auto_region_delete) {
1212 os << "# Set to false to inhibit automatic replacement of\n"
1213 << "# the current selection.\n"
1214 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1220 case RC_AUTORESET_OPTIONS:
1221 if (ignore_system_lyxrc ||
1222 auto_reset_options != system_lyxrc.auto_reset_options) {
1223 os << "# Set to false to inhibit automatic reset of\n"
1224 << "# the class options to defaults on class change.\n"
1225 << "\\auto_reset_options "
1226 << convert<string>(auto_reset_options)
1233 if (ignore_system_lyxrc ||
1234 autosave != system_lyxrc.autosave) {
1235 os << "# The time interval between auto-saves in seconds.\n"
1236 << "\\autosave " << autosave << '\n';
1241 case RC_DISPLAY_GRAPHICS:
1242 if (ignore_system_lyxrc ||
1243 display_graphics != system_lyxrc.display_graphics) {
1244 os << "# Display graphics within LyX\n"
1246 << "\\display_graphics "
1247 << (display_graphics ? "true" : "false")
1253 case RC_SORT_LAYOUTS:
1254 if (ignore_system_lyxrc ||
1255 sort_layouts != system_lyxrc.sort_layouts) {
1256 os << "# Sort layouts alphabetically.\n"
1257 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1262 case RC_GROUP_LAYOUTS:
1263 if (ignore_system_lyxrc ||
1264 group_layouts != system_lyxrc.group_layouts) {
1265 os << "# Group layouts by their category.\n"
1266 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1271 case RC_VIEWDVI_PAPEROPTION:
1272 if (ignore_system_lyxrc ||
1273 view_dvi_paper_option
1274 != system_lyxrc.view_dvi_paper_option) {
1275 os << "# Options used to specify paper size to the\n"
1276 << "# view_dvi_command (e.g. -paper)\n"
1277 << "\\view_dvi_paper_option \""
1278 << view_dvi_paper_option << "\"\n";
1283 case RC_CHKTEX_COMMAND:
1284 if (ignore_system_lyxrc ||
1285 chktex_command != system_lyxrc.chktex_command) {
1286 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1291 case RC_BIBTEX_ALTERNATIVES: {
1292 CommandSet::const_iterator it = bibtex_alternatives.begin();
1293 CommandSet::const_iterator end = bibtex_alternatives.end();
1294 for ( ; it != end; ++it) {
1295 if (ignore_system_lyxrc
1296 || !system_lyxrc.bibtex_alternatives.count(*it))
1297 os << "\\bibtex_alternatives \""
1304 case RC_BIBTEX_COMMAND:
1305 if (ignore_system_lyxrc ||
1306 bibtex_command != system_lyxrc.bibtex_command) {
1307 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1312 case RC_JBIBTEX_COMMAND:
1313 if (ignore_system_lyxrc ||
1314 jbibtex_command != system_lyxrc.jbibtex_command) {
1315 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1320 case RC_JBIBTEX_ALTERNATIVES: {
1321 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1322 CommandSet::const_iterator end = jbibtex_alternatives.end();
1323 for ( ; it != end; ++it) {
1324 if (ignore_system_lyxrc
1325 || !system_lyxrc.jbibtex_alternatives.count(*it))
1326 os << "\\jbibtex_alternatives \""
1333 case RC_INDEX_ALTERNATIVES: {
1334 CommandSet::const_iterator it = index_alternatives.begin();
1335 CommandSet::const_iterator end = index_alternatives.end();
1336 for ( ; it != end; ++it) {
1337 if (ignore_system_lyxrc
1338 || !system_lyxrc.index_alternatives.count(*it))
1339 os << "\\index_alternatives \""
1346 case RC_INDEX_COMMAND:
1347 if (ignore_system_lyxrc ||
1348 index_command != system_lyxrc.index_command) {
1349 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1354 case RC_JINDEX_COMMAND:
1355 if (ignore_system_lyxrc ||
1356 jindex_command != system_lyxrc.jindex_command) {
1357 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1362 case RC_SPLITINDEX_COMMAND:
1363 if (ignore_system_lyxrc ||
1364 splitindex_command != system_lyxrc.splitindex_command) {
1365 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1370 case RC_NOMENCL_COMMAND:
1371 if (ignore_system_lyxrc ||
1372 nomencl_command != system_lyxrc.nomencl_command) {
1373 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1378 case RC_PYGMENTIZE_COMMAND:
1379 if (ignore_system_lyxrc ||
1380 pygmentize_command != system_lyxrc.pygmentize_command) {
1381 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1386 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1387 // Don't write this setting to the preferences file,
1388 // but allow temporary changes (bug 7557).
1389 if (ignore_system_lyxrc) {
1390 os << "\\tex_expects_windows_paths "
1391 << convert<string>(windows_style_tex_paths) << '\n';
1396 case RC_TEX_ALLOWS_SPACES:
1397 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1398 os << "\\tex_allows_spaces "
1399 << convert<string>(tex_allows_spaces) << '\n';
1405 if (ignore_system_lyxrc ||
1406 use_kbmap != system_lyxrc.use_kbmap) {
1407 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1412 case RC_KBMAP_PRIMARY:
1413 if (ignore_system_lyxrc ||
1414 primary_kbmap != system_lyxrc.primary_kbmap) {
1415 string const path = os::external_path(primary_kbmap);
1416 os << "\\kbmap_primary \"" << path << "\"\n";
1421 case RC_KBMAP_SECONDARY:
1422 if (ignore_system_lyxrc ||
1423 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1424 string const path = os::external_path(secondary_kbmap);
1425 os << "\\kbmap_secondary \"" << path << "\"\n";
1431 if (ignore_system_lyxrc ||
1432 lyxpipes != system_lyxrc.lyxpipes) {
1433 string const path = os::external_path(lyxpipes);
1434 os << "\\serverpipe \"" << path << "\"\n";
1440 os << "\\user_name \"" << user_name << "\"\n";
1445 os << "\\user_email \"" << user_email << "\"\n";
1449 case RC_SHOW_BANNER:
1450 if (ignore_system_lyxrc ||
1451 show_banner != system_lyxrc.show_banner) {
1452 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1458 if (ignore_system_lyxrc ||
1459 preview != system_lyxrc.preview) {
1465 case PREVIEW_NO_MATH:
1472 os << "\\preview " << status << '\n';
1477 case RC_PREVIEW_HASHED_LABELS:
1478 if (ignore_system_lyxrc ||
1479 preview_hashed_labels !=
1480 system_lyxrc.preview_hashed_labels) {
1481 os << "\\preview_hashed_labels "
1482 << convert<string>(preview_hashed_labels) << '\n';
1487 case RC_PREVIEW_SCALE_FACTOR:
1488 if (ignore_system_lyxrc ||
1489 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1490 os << "\\preview_scale_factor "
1491 << preview_scale_factor << '\n';
1496 case RC_USE_CONVERTER_CACHE:
1497 if (ignore_system_lyxrc ||
1498 use_converter_cache != system_lyxrc.use_converter_cache) {
1499 os << "\\use_converter_cache "
1500 << convert<string>(use_converter_cache) << '\n';
1505 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1506 if (ignore_system_lyxrc ||
1507 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1508 os << "\\use_converter_needauth_forbidden "
1509 << convert<string>(use_converter_needauth_forbidden) << '\n';
1514 case RC_USE_CONVERTER_NEEDAUTH:
1515 if (ignore_system_lyxrc ||
1516 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1517 os << "\\use_converter_needauth "
1518 << convert<string>(use_converter_needauth) << '\n';
1523 case RC_CONVERTER_CACHE_MAXAGE:
1524 if (ignore_system_lyxrc ||
1525 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1526 os << "\\converter_cache_maxage "
1527 << converter_cache_maxage << '\n';
1533 << "# SCREEN & FONTS SECTION ############################\n"
1537 if (ignore_system_lyxrc ||
1538 icon_set != system_lyxrc.icon_set) {
1539 os << "\\icon_set \"" << icon_set
1545 case RC_USE_SYSTEM_THEME_ICONS:
1546 if (ignore_system_lyxrc ||
1547 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1548 os << "\\use_system_theme_icons "
1549 << convert<string>(use_system_theme_icons)
1556 if (ignore_system_lyxrc ||
1557 dpi != system_lyxrc.dpi) {
1558 os << "\\screen_dpi " << dpi << '\n';
1563 case RC_SCREEN_ZOOM:
1564 if (ignore_system_lyxrc ||
1565 defaultZoom != system_lyxrc.defaultZoom) {
1566 os << "\\screen_zoom " << defaultZoom << '\n';
1571 case RC_GEOMETRY_SESSION:
1572 if (ignore_system_lyxrc ||
1573 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1574 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1580 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1581 if (ignore_system_lyxrc ||
1582 cursor_follows_scrollbar
1583 != system_lyxrc.cursor_follows_scrollbar) {
1584 os << "\\cursor_follows_scrollbar "
1585 << convert<string>(cursor_follows_scrollbar) << '\n';
1590 case RC_CURSOR_WIDTH:
1591 if (ignore_system_lyxrc ||
1593 != system_lyxrc.cursor_width) {
1594 os << "\\cursor_width "
1595 << cursor_width << '\n';
1600 case RC_SCROLL_BELOW_DOCUMENT:
1601 if (ignore_system_lyxrc ||
1602 scroll_below_document
1603 != system_lyxrc.scroll_below_document) {
1604 os << "\\scroll_below_document "
1605 << convert<string>(scroll_below_document) << '\n';
1610 case RC_PARAGRAPH_MARKERS:
1611 if (ignore_system_lyxrc ||
1613 != system_lyxrc.paragraph_markers) {
1614 os << "\\paragraph_markers "
1615 << convert<string>(paragraph_markers) << '\n';
1620 case RC_MAC_DONTSWAP_CTRL_META:
1621 if (ignore_system_lyxrc ||
1622 mac_dontswap_ctrl_meta
1623 != system_lyxrc.mac_dontswap_ctrl_meta) {
1624 os << "\\mac_dontswap_ctrl_meta "
1625 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1630 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1631 if (ignore_system_lyxrc ||
1632 mac_like_cursor_movement
1633 != system_lyxrc.mac_like_cursor_movement) {
1634 os << "\\mac_like_cursor_movement "
1635 << convert<string>(mac_like_cursor_movement) << '\n';
1640 case RC_MACRO_EDIT_STYLE:
1641 if (ignore_system_lyxrc ||
1643 != system_lyxrc.macro_edit_style) {
1644 os << "\\macro_edit_style ";
1645 switch (macro_edit_style) {
1646 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1647 case MACRO_EDIT_INLINE: os << "1\n"; break;
1648 case MACRO_EDIT_LIST: os << "2\n"; break;
1654 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1655 if (ignore_system_lyxrc ||
1656 dialogs_iconify_with_main
1657 != system_lyxrc.dialogs_iconify_with_main) {
1658 os << "\\dialogs_iconify_with_main "
1659 << convert<string>(dialogs_iconify_with_main) << '\n';
1664 case RC_SCREEN_FONT_ROMAN:
1665 if (ignore_system_lyxrc ||
1666 roman_font_name != system_lyxrc.roman_font_name) {
1667 os << "\\screen_font_roman \"" << roman_font_name
1673 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1674 if (ignore_system_lyxrc ||
1675 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1676 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1682 case RC_SCREEN_FONT_SANS:
1683 if (ignore_system_lyxrc ||
1684 sans_font_name != system_lyxrc.sans_font_name) {
1685 os << "\\screen_font_sans \"" << sans_font_name
1691 case RC_SCREEN_FONT_SANS_FOUNDRY:
1692 if (ignore_system_lyxrc ||
1693 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1694 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1700 case RC_SCREEN_FONT_TYPEWRITER:
1701 if (ignore_system_lyxrc ||
1702 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1703 os << "\\screen_font_typewriter \""
1704 << typewriter_font_name << "\"\n";
1709 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1710 if (ignore_system_lyxrc ||
1711 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1712 os << "\\screen_font_typewriter_foundry \""
1713 << typewriter_font_foundry << "\"\n";
1718 case RC_SCREEN_FONT_SCALABLE:
1719 if (ignore_system_lyxrc ||
1720 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1721 os << "\\screen_font_scalable "
1722 << convert<string>(use_scalable_fonts)
1728 case RC_SCREEN_FONT_SIZES:
1729 if (ignore_system_lyxrc ||
1730 font_sizes[TINY_SIZE]
1731 != system_lyxrc.font_sizes[TINY_SIZE] ||
1732 font_sizes[SCRIPT_SIZE]
1733 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1734 font_sizes[FOOTNOTE_SIZE]
1735 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1736 font_sizes[SMALL_SIZE]
1737 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1738 font_sizes[NORMAL_SIZE]
1739 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1740 font_sizes[LARGE_SIZE]
1741 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1742 font_sizes[LARGER_SIZE]
1743 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1744 font_sizes[LARGEST_SIZE]
1745 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1746 font_sizes[HUGE_SIZE]
1747 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1748 font_sizes[HUGER_SIZE]
1749 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1750 streamsize old_prec = os.precision();
1751 os.setf(ios::fixed);
1753 os << "\\screen_font_sizes"
1754 << ' ' << font_sizes[TINY_SIZE]
1755 << ' ' << font_sizes[SCRIPT_SIZE]
1756 << ' ' << font_sizes[FOOTNOTE_SIZE]
1757 << ' ' << font_sizes[SMALL_SIZE]
1758 << ' ' << font_sizes[NORMAL_SIZE]
1759 << ' ' << font_sizes[LARGE_SIZE]
1760 << ' ' << font_sizes[LARGER_SIZE]
1761 << ' ' << font_sizes[LARGEST_SIZE]
1762 << ' ' << font_sizes[HUGE_SIZE]
1763 << ' ' << font_sizes[HUGER_SIZE]
1765 os.precision(old_prec);
1766 os.unsetf(ios::fixed);
1771 case RC_FULL_SCREEN_LIMIT:
1772 if (ignore_system_lyxrc ||
1773 full_screen_limit != system_lyxrc.full_screen_limit) {
1774 os << "\\fullscreen_limit "
1775 << convert<string>(full_screen_limit)
1781 case RC_FULL_SCREEN_TOOLBARS:
1782 if (ignore_system_lyxrc ||
1783 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1784 os << "\\fullscreen_toolbars "
1785 << convert<string>(full_screen_toolbars)
1791 case RC_FULL_SCREEN_SCROLLBAR:
1792 if (ignore_system_lyxrc ||
1793 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1794 os << "\\fullscreen_scrollbar "
1795 << convert<string>(full_screen_scrollbar)
1801 case RC_FULL_SCREEN_STATUSBAR:
1802 if (ignore_system_lyxrc ||
1803 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1804 os << "\\fullscreen_statusbar "
1805 << convert<string>(full_screen_statusbar)
1811 case RC_FULL_SCREEN_TABBAR:
1812 if (ignore_system_lyxrc ||
1813 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1814 os << "\\fullscreen_tabbar "
1815 << convert<string>(full_screen_tabbar)
1821 case RC_FULL_SCREEN_MENUBAR:
1822 if (ignore_system_lyxrc ||
1823 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1824 os << "\\fullscreen_menubar "
1825 << convert<string>(full_screen_menubar)
1831 case RC_FULL_SCREEN_WIDTH:
1832 if (ignore_system_lyxrc ||
1833 full_screen_width != system_lyxrc.full_screen_width) {
1834 os << "\\fullscreen_width "
1835 << convert<string>(full_screen_width)
1841 case RC_OPEN_BUFFERS_IN_TABS:
1842 if (ignore_system_lyxrc ||
1843 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1844 os << "\\open_buffers_in_tabs "
1845 << convert<string>(open_buffers_in_tabs)
1851 case RC_SINGLE_CLOSE_TAB_BUTTON:
1852 if (ignore_system_lyxrc ||
1853 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1854 os << "\\single_close_tab_button "
1855 << convert<string>(single_close_tab_button)
1861 case RC_SINGLE_INSTANCE:
1862 if (ignore_system_lyxrc ||
1863 single_instance != system_lyxrc.single_instance) {
1864 os << "\\single_instance "
1865 << convert<string>(single_instance)
1871 case RC_FORWARD_SEARCH_DVI:
1872 if (ignore_system_lyxrc ||
1873 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1874 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1879 case RC_FORWARD_SEARCH_PDF:
1880 if (ignore_system_lyxrc ||
1881 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1882 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1888 << "# COLOR SECTION ###################################\n"
1893 for (int i = 0; i < Color_ignore; ++i) {
1894 ColorCode lc = static_cast<ColorCode>(i);
1895 string const col = lcolor.getX11Name(lc);
1896 if (ignore_system_lyxrc
1897 || col != system_lcolor.getX11Name(lc)) {
1898 os << "\\set_color \""
1899 << lcolor.getLyXName(lc) << "\" \""
1907 << "# PRINTER SECTION ###################################\n"
1911 case RC_PRINTLANDSCAPEFLAG:
1912 if (ignore_system_lyxrc ||
1913 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1914 os << "\\print_landscape_flag \"" << print_landscape_flag
1920 case RC_PRINTPAPERFLAG:
1921 if (ignore_system_lyxrc ||
1922 print_paper_flag != system_lyxrc.print_paper_flag) {
1923 os << "\\print_paper_flag \"" << print_paper_flag
1929 case RC_PRINTPAPERDIMENSIONFLAG:
1930 if (ignore_system_lyxrc ||
1931 print_paper_dimension_flag
1932 != system_lyxrc.print_paper_dimension_flag) {
1933 os << "\\print_paper_dimension_flag \""
1934 << print_paper_dimension_flag << "\"\n";
1940 << "# TEX SECTION #######################################\n"
1944 case RC_TEXINPUTS_PREFIX:
1945 if (ignore_system_lyxrc ||
1946 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1947 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1953 << "# FILE SECTION ######################################\n"
1956 case RC_DOCUMENTPATH:
1957 if (ignore_system_lyxrc ||
1958 document_path != system_lyxrc.document_path) {
1959 string const path = os::external_path(document_path);
1960 os << "\\document_path \"" << path << "\"\n";
1965 case RC_USELASTFILEPOS:
1966 if (ignore_system_lyxrc ||
1967 use_lastfilepos != system_lyxrc.use_lastfilepos) {
1968 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
1974 case RC_LOADSESSION:
1975 if (ignore_system_lyxrc ||
1976 load_session != system_lyxrc.load_session) {
1977 os << "\\load_session " << convert<string>(load_session)
1983 case RC_MOUSE_WHEEL_SPEED:
1984 if (ignore_system_lyxrc ||
1985 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
1986 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
1991 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1992 if (ignore_system_lyxrc ||
1993 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
1994 os << "\\mouse_middlebutton_paste "
1995 << convert<string>(mouse_middlebutton_paste) << '\n';
2000 case RC_COMPLETION_INLINE_DELAY:
2001 if (ignore_system_lyxrc ||
2002 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2003 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2008 case RC_COMPLETION_INLINE_MATH:
2009 if (ignore_system_lyxrc ||
2010 completion_inline_math != system_lyxrc.completion_inline_math) {
2011 os << "\\completion_inline_math "
2012 << convert<string>(completion_inline_math) << '\n';
2017 case RC_COMPLETION_INLINE_TEXT:
2018 if (ignore_system_lyxrc ||
2019 completion_inline_text != system_lyxrc.completion_inline_text) {
2020 os << "\\completion_inline_text "
2021 << convert<string>(completion_inline_text) << '\n';
2026 case RC_COMPLETION_INLINE_DOTS:
2027 if (ignore_system_lyxrc ||
2028 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2029 os << "\\completion_inline_dots "
2030 << convert<string>(completion_inline_dots) << '\n';
2035 case RC_AUTOCORRECTION_MATH:
2036 if (ignore_system_lyxrc ||
2037 autocorrection_math != system_lyxrc.autocorrection_math) {
2038 os << "\\autocorrection_math "
2039 << convert<string>(autocorrection_math) << '\n';
2044 case RC_COMPLETION_POPUP_DELAY:
2045 if (ignore_system_lyxrc ||
2046 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2047 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2052 case RC_COMPLETION_POPUP_MATH:
2053 if (ignore_system_lyxrc ||
2054 completion_popup_math != system_lyxrc.completion_popup_math) {
2055 os << "\\completion_popup_math "
2056 << convert<string>(completion_popup_math) << '\n';
2061 case RC_COMPLETION_POPUP_TEXT:
2062 if (ignore_system_lyxrc ||
2063 completion_popup_text != system_lyxrc.completion_popup_text) {
2064 os << "\\completion_popup_text "
2065 << convert<string>(completion_popup_text) << '\n';
2070 case RC_COMPLETION_CURSOR_TEXT:
2071 if (ignore_system_lyxrc ||
2072 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2073 os << "\\completion_cursor_text "
2074 << convert<string>(completion_cursor_text) << '\n';
2079 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2080 if (ignore_system_lyxrc ||
2081 completion_popup_after_complete
2082 != system_lyxrc.completion_popup_after_complete) {
2083 os << "\\completion_popup_after_complete "
2084 << convert<string>(completion_popup_after_complete) << '\n';
2089 case RC_COMPLETION_MINLENGTH:
2090 if (ignore_system_lyxrc ||
2091 completion_minlength != system_lyxrc.completion_minlength) {
2092 os << "\\completion_minlength " << convert<string>(completion_minlength)
2098 case RC_NUMLASTFILES:
2099 if (ignore_system_lyxrc ||
2100 num_lastfiles != system_lyxrc.num_lastfiles) {
2101 os << "\\num_lastfiles " << num_lastfiles << '\n';
2106 case RC_CHECKLASTFILES:
2107 if (ignore_system_lyxrc ||
2108 check_lastfiles != system_lyxrc.check_lastfiles) {
2109 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2115 case RC_EXAMPLEPATH:
2116 if (ignore_system_lyxrc ||
2117 example_path != system_lyxrc.example_path) {
2118 string const path = os::external_path(example_path);
2119 os << "\\example_path \"" << path << "\"\n";
2124 case RC_TEMPLATEPATH:
2125 if (ignore_system_lyxrc ||
2126 template_path != system_lyxrc.template_path) {
2127 string const path = os::external_path(template_path);
2128 os << "\\template_path \"" << path << "\"\n";
2133 case RC_TEMPDIRPATH:
2134 if (ignore_system_lyxrc ||
2135 tempdir_path != system_lyxrc.tempdir_path) {
2136 string const path = os::external_path(tempdir_path);
2137 os << "\\tempdir_path \"" << path << "\"\n";
2142 case RC_THESAURUSDIRPATH:
2143 if (ignore_system_lyxrc ||
2144 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2145 string const path = os::external_path(thesaurusdir_path);
2146 os << "\\thesaurusdir_path \"" << path << "\"\n";
2151 case RC_HUNSPELLDIR_PATH:
2152 if (ignore_system_lyxrc ||
2153 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2154 string const path = os::external_path(hunspelldir_path);
2155 os << "\\hunspelldir_path \"" << path << "\"\n";
2160 case RC_PLAINTEXT_LINELEN:
2161 if (ignore_system_lyxrc ||
2162 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2163 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2168 case RC_MAKE_BACKUP:
2169 if (ignore_system_lyxrc ||
2170 make_backup != system_lyxrc.make_backup) {
2171 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2176 case RC_SAVE_COMPRESSED:
2177 if (ignore_system_lyxrc ||
2178 save_compressed != system_lyxrc.save_compressed) {
2179 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2184 case RC_SAVE_ORIGIN:
2185 if (ignore_system_lyxrc ||
2186 save_origin != system_lyxrc.save_origin) {
2187 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2192 case RC_BACKUPDIR_PATH:
2193 if (ignore_system_lyxrc ||
2194 backupdir_path != system_lyxrc.backupdir_path) {
2195 string const path = os::external_path(backupdir_path);
2196 os << "\\backupdir_path \"" << path << "\"\n";
2202 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2206 << "# SPELLCHECKER SECTION ##############################\n"
2210 case RC_ACCEPT_COMPOUND:
2211 if (ignore_system_lyxrc ||
2212 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2213 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2220 if (ignore_system_lyxrc ||
2221 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2222 os << "\\alternate_language \"" << spellchecker_alt_lang
2229 if (ignore_system_lyxrc ||
2230 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2231 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2236 case RC_USE_NATIVE_FILEDIALOG:
2237 if (ignore_system_lyxrc ||
2238 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2239 os << "\\use_native_filedialog "
2240 << convert<string>(use_native_filedialog)
2246 case RC_USE_SYSTEM_COLORS:
2247 if (ignore_system_lyxrc ||
2248 use_system_colors != system_lyxrc.use_system_colors) {
2249 os << "\\use_system_colors "
2250 << convert<string>(use_system_colors)
2256 case RC_USE_TOOLTIP:
2257 if (ignore_system_lyxrc ||
2258 use_tooltip != system_lyxrc.use_tooltip) {
2259 os << "\\use_tooltip "
2260 << convert<string>(use_tooltip)
2268 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2272 case RC_DEFAULT_DECIMAL_SEP:
2273 if (ignore_system_lyxrc ||
2274 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2275 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2280 case RC_DEFAULT_LENGTH_UNIT:
2281 if (ignore_system_lyxrc ||
2282 default_length_unit != system_lyxrc.default_length_unit) {
2283 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2288 case RC_SPELLCHECKER:
2289 if (ignore_system_lyxrc ||
2290 spellchecker != system_lyxrc.spellchecker) {
2291 os << "\\spellchecker " << spellchecker << '\n';
2296 case RC_SPELLCHECK_CONTINUOUSLY:
2297 if (ignore_system_lyxrc ||
2298 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2299 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2305 case RC_SPELLCHECK_NOTES:
2306 if (ignore_system_lyxrc ||
2307 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2308 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2314 case RC_VISUAL_CURSOR:
2315 if (ignore_system_lyxrc ||
2316 visual_cursor != system_lyxrc.visual_cursor) {
2317 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2322 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2323 if (ignore_system_lyxrc ||
2324 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2325 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2326 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2331 case RC_LANGUAGE_CUSTOM_PACKAGE:
2332 if (ignore_system_lyxrc ||
2333 language_custom_package != system_lyxrc.language_custom_package) {
2334 os << "\\language_custom_package \"" << language_custom_package
2340 case RC_LANGUAGE_GLOBAL_OPTIONS:
2341 if (ignore_system_lyxrc ||
2342 language_global_options
2343 != system_lyxrc.language_global_options) {
2344 os << "\\language_global_options \""
2345 << convert<string>(language_global_options)
2351 case RC_LANGUAGE_PACKAGE_SELECTION:
2352 if (ignore_system_lyxrc ||
2353 language_package_selection != system_lyxrc.language_package_selection) {
2354 os << "\\language_package_selection ";
2355 switch (language_package_selection) {
2373 case RC_LANGUAGE_COMMAND_BEGIN:
2374 if (ignore_system_lyxrc ||
2375 language_command_begin
2376 != system_lyxrc.language_command_begin) {
2377 os << "\\language_command_begin \""
2378 << language_command_begin
2384 case RC_LANGUAGE_COMMAND_END:
2385 if (ignore_system_lyxrc ||
2386 language_command_end
2387 != system_lyxrc.language_command_end) {
2388 os << "\\language_command_end \"" << language_command_end
2394 case RC_LANGUAGE_COMMAND_LOCAL:
2395 if (ignore_system_lyxrc ||
2396 language_command_local
2397 != system_lyxrc.language_command_local) {
2398 os << "\\language_command_local \""
2399 << language_command_local
2405 case RC_LANGUAGE_AUTO_BEGIN:
2406 if (ignore_system_lyxrc ||
2407 language_auto_begin != system_lyxrc.language_auto_begin) {
2408 os << "\\language_auto_begin "
2409 << convert<string>(language_auto_begin) << '\n';
2414 case RC_LANGUAGE_AUTO_END:
2415 if (ignore_system_lyxrc ||
2416 language_auto_end != system_lyxrc.language_auto_end) {
2417 os << "\\language_auto_end "
2418 << convert<string>(language_auto_end) << '\n';
2423 case RC_MARK_FOREIGN_LANGUAGE:
2424 if (ignore_system_lyxrc ||
2425 mark_foreign_language
2426 != system_lyxrc.mark_foreign_language) {
2427 os << "\\mark_foreign_language " <<
2428 convert<string>(mark_foreign_language) << '\n';
2431 case RC_RESPECT_OS_KBD_LANGUAGE:
2432 if (ignore_system_lyxrc ||
2433 respect_os_kbd_language
2434 != system_lyxrc.respect_os_kbd_language) {
2435 os << "\\respect_os_kbd_language " <<
2436 convert<string>(respect_os_kbd_language) << '\n';
2443 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2447 case RC_AUTO_NUMBER:
2448 if (ignore_system_lyxrc ||
2449 auto_number != system_lyxrc.auto_number) {
2450 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2455 case RC_GUI_LANGUAGE:
2456 if (ignore_system_lyxrc ||
2457 gui_language != system_lyxrc.gui_language) {
2458 os << "\\gui_language " << gui_language << '\n';
2463 case RC_EXPORT_OVERWRITE:
2464 if (ignore_system_lyxrc ||
2465 export_overwrite != system_lyxrc.export_overwrite) {
2467 switch (export_overwrite) {
2478 os << "\\export_overwrite " << status << '\n';
2483 case RC_SCROLL_WHEEL_ZOOM:
2484 if (ignore_system_lyxrc ||
2485 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2487 switch (scroll_wheel_zoom) {
2488 case SCROLL_WHEEL_ZOOM_OFF:
2491 case SCROLL_WHEEL_ZOOM_CTRL:
2494 case SCROLL_WHEEL_ZOOM_SHIFT:
2497 case SCROLL_WHEEL_ZOOM_ALT:
2501 os << "\\scroll_wheel_zoom " << status << '\n';
2507 << "# FORMATS SECTION ##########################\n"
2512 // New/modified formats
2513 for (Formats::const_iterator cit = theFormats().begin();
2514 cit != theFormats().end(); ++cit) {
2515 Format const * format =
2516 theSystemFormats().getFormat(cit->name());
2518 format->extensions() != cit->extensions() ||
2519 format->prettyname() != cit->prettyname() ||
2520 format->shortcut() != cit->shortcut() ||
2521 format->viewer() != cit->viewer() ||
2522 format->editor() != cit->editor() ||
2523 format->documentFormat() != cit->documentFormat() ||
2524 format->vectorFormat() != cit->vectorFormat() ||
2525 format->inExportMenu() != cit->inExportMenu() ||
2526 format->noMenu() != cit->noMenu() ||
2527 format->mime() != cit->mime()) {
2528 os << "\\format \"" << cit->name() << "\" \""
2529 << cit->extensions() << "\" \""
2530 << to_utf8(cit->prettyname()) << "\" \""
2531 << cit->shortcut() << "\" \""
2532 << escapeCommand(cit->viewer()) << "\" \""
2533 << escapeCommand(cit->editor()) << "\" \"";
2534 vector<string> flags;
2535 if (cit->documentFormat())
2536 flags.push_back("document");
2537 if (cit->vectorFormat())
2538 flags.push_back("vector");
2539 if (cit->zippedNative())
2540 flags.push_back("zipped=native");
2541 if (cit->inExportMenu())
2542 flags.push_back("menu=export");
2544 os << getStringFromVector(flags);
2545 os << "\" \"" << cit->mime() << "\"\n";
2549 // Look for deleted formats
2550 for (Formats::const_iterator cit = theSystemFormats().begin();
2551 cit != theSystemFormats().end(); ++cit)
2552 if (!theFormats().getFormat(cit->name()))
2553 os << "\\format \"" << cit->name()
2554 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2558 case RC_VIEWER_ALTERNATIVES: {
2559 Alternatives::const_iterator it = viewer_alternatives.begin();
2560 Alternatives::const_iterator const en = viewer_alternatives.end();
2561 Alternatives::const_iterator const sysend =
2562 system_lyxrc.viewer_alternatives.end();
2563 for (; it != en; ++it) {
2564 string const & fmt = it->first;
2565 CommandSet const & cmd = it->second;
2566 CommandSet::const_iterator sit = cmd.begin();
2567 CommandSet::const_iterator const sen = cmd.end();
2568 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2569 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2570 system_lyxrc.viewer_alternatives.find(fmt);
2571 for (; sit != sen; ++sit) {
2572 string const & cmd = *sit;
2573 if (ignore_system_lyxrc
2574 || sysfmt == sysend // format not found
2575 || sysfmt->second.count(cmd) == 0 // this command not found
2577 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2584 case RC_EDITOR_ALTERNATIVES: {
2585 Alternatives::const_iterator it = editor_alternatives.begin();
2586 Alternatives::const_iterator const en = editor_alternatives.end();
2587 Alternatives::const_iterator const sysend =
2588 system_lyxrc.editor_alternatives.end();
2589 for (; it != en; ++it) {
2590 string const & fmt = it->first;
2591 CommandSet const & cmd = it->second;
2592 CommandSet::const_iterator sit = cmd.begin();
2593 CommandSet::const_iterator const sen = cmd.end();
2594 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2595 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2596 system_lyxrc.editor_alternatives.find(fmt);
2597 for (; sit != sen; ++sit) {
2598 string const & cmd = *sit;
2599 if (ignore_system_lyxrc
2600 || sysfmt == sysend // format not found
2601 || sysfmt->second.count(cmd) == 0 // this command not found
2603 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2610 case RC_DEFAULT_OTF_VIEW_FORMAT:
2611 if ((ignore_system_lyxrc ||
2612 default_otf_view_format != system_lyxrc.default_otf_view_format)
2613 && !default_otf_view_format.empty()) {
2614 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2619 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2620 if ((ignore_system_lyxrc ||
2621 default_platex_view_format != system_lyxrc.default_platex_view_format)
2622 && !default_platex_view_format.empty()) {
2623 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2628 case RC_DEFAULT_VIEW_FORMAT:
2629 if (ignore_system_lyxrc ||
2630 default_view_format != system_lyxrc.default_view_format) {
2631 os << "\\default_view_format " << default_view_format << '\n';
2642 << "# CONVERTERS SECTION ##########################\n"
2647 // Look for new converters
2648 for (Converters::const_iterator cit = theConverters().begin();
2649 cit != theConverters().end(); ++cit) {
2650 Converter const * converter =
2651 theSystemConverters().getConverter(cit->from(),
2654 converter->command() != cit->command() ||
2655 converter->flags() != cit->flags())
2656 os << "\\converter \"" << cit->from() << "\" \""
2657 << cit->to() << "\" \""
2658 << escapeCommand(cit->command()) << "\" \""
2659 << cit->flags() << "\"\n";
2662 // New/modifed converters
2663 for (Converters::const_iterator cit = theSystemConverters().begin();
2664 cit != theSystemConverters().end(); ++cit)
2665 if (!theConverters().getConverter(cit->from(), cit->to()))
2666 os << "\\converter \"" << cit->from()
2667 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2674 << "# COPIERS SECTION ##########################\n"
2677 // Look for new movers
2678 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2679 Movers::const_iterator const sysend = theSystemMovers().end();
2680 Movers::const_iterator it = theMovers().begin();
2681 Movers::const_iterator end = theMovers().end();
2683 for (; it != end; ++it) {
2684 Movers::const_iterator const sysit =
2685 find_if(sysbegin, sysend, SameMover(*it));
2686 if (sysit == sysend) {
2687 string const & fmt = it->first;
2688 string const & command =
2689 it->second.command();
2691 os << "\\copier " << fmt
2692 << " \"" << escapeCommand(command) << "\"\n";
2698 // We don't actually delete SpecialisedMover(s) from the
2699 // map, just clear their 'command', so there's no need
2700 // to test for anything else.
2707 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2709 // Why the switch you might ask. It is a trick to ensure that all
2710 // the elements in the LyXRCTags enum is handled. As you can see
2711 // there are no breaks at all. So it is just a huge fall-through.
2712 // The nice thing is that we will get a warning from the compiler
2713 // if we forget an element.
2714 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2716 case LyXRC::RC_LAST:
2717 case LyXRC::RC_ACCEPT_COMPOUND:
2718 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2719 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2721 case LyXRC::RC_ALT_LANG:
2722 case LyXRC::RC_PLAINTEXT_LINELEN:
2723 case LyXRC::RC_AUTOCORRECTION_MATH:
2724 case LyXRC::RC_AUTOREGIONDELETE:
2725 case LyXRC::RC_AUTORESET_OPTIONS:
2726 case LyXRC::RC_AUTOSAVE:
2727 case LyXRC::RC_AUTO_NUMBER:
2728 case LyXRC::RC_BACKUPDIR_PATH:
2729 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2730 case LyXRC::RC_BIBTEX_COMMAND:
2731 case LyXRC::RC_BINDFILE:
2732 case LyXRC::RC_CHECKLASTFILES:
2733 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2734 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2735 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2736 case LyXRC::RC_COMPLETION_INLINE_MATH:
2737 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2738 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2739 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2740 case LyXRC::RC_COMPLETION_POPUP_MATH:
2741 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2742 case LyXRC::RC_COMPLETION_MINLENGTH:
2743 case LyXRC::RC_USELASTFILEPOS:
2744 case LyXRC::RC_LOADSESSION:
2745 case LyXRC::RC_CHKTEX_COMMAND:
2746 case LyXRC::RC_CONVERTER:
2747 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2748 case LyXRC::RC_COPIER:
2749 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2750 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2751 case LyXRC::RC_GUI_LANGUAGE:
2752 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2753 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2754 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2755 case LyXRC::RC_DEFFILE:
2756 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2757 case LyXRC::RC_DISPLAY_GRAPHICS:
2758 case LyXRC::RC_DOCUMENTPATH:
2759 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2760 FileName path(lyxrc_new.document_path);
2761 if (path.exists() && path.isDirectory())
2762 package().document_dir() = FileName(lyxrc.document_path);
2765 case LyXRC::RC_EDITOR_ALTERNATIVES:
2766 case LyXRC::RC_ESC_CHARS:
2767 case LyXRC::RC_EXAMPLEPATH:
2768 case LyXRC::RC_FILEFORMAT:
2769 case LyXRC::RC_GROUP_LAYOUTS:
2770 case LyXRC::RC_HUNSPELLDIR_PATH:
2771 case LyXRC::RC_ICON_SET:
2772 case LyXRC::RC_INDEX_ALTERNATIVES:
2773 case LyXRC::RC_INDEX_COMMAND:
2774 case LyXRC::RC_JBIBTEX_COMMAND:
2775 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2776 case LyXRC::RC_JINDEX_COMMAND:
2777 case LyXRC::RC_NOMENCL_COMMAND:
2778 case LyXRC::RC_PYGMENTIZE_COMMAND:
2779 case LyXRC::RC_INPUT:
2780 case LyXRC::RC_KBMAP:
2781 case LyXRC::RC_KBMAP_PRIMARY:
2782 case LyXRC::RC_KBMAP_SECONDARY:
2783 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2784 case LyXRC::RC_LANGUAGE_AUTO_END:
2785 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2786 case LyXRC::RC_LANGUAGE_COMMAND_END:
2787 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2788 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2789 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2790 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2791 case LyXRC::RC_LYXRCFORMAT:
2792 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2793 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2794 case LyXRC::RC_MACRO_EDIT_STYLE:
2795 case LyXRC::RC_MAKE_BACKUP:
2796 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2797 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2798 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2799 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2800 case LyXRC::RC_NUMLASTFILES:
2801 case LyXRC::RC_PARAGRAPH_MARKERS:
2802 case LyXRC::RC_PATH_PREFIX:
2803 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2804 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2805 // Resets python path
2806 support::os::python(true);
2809 case LyXRC::RC_PREVIEW:
2810 if (lyxrc_orig.preview != lyxrc_new.preview) {
2811 // Update all previews of all documents.
2812 /* FIXME: this can be very expensive. It would be cheaper
2813 * to kill all existing previews and update visible
2815 theBufferList().updatePreviews();
2818 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2819 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2820 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2821 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2822 case LyXRC::RC_PRINTPAPERFLAG:
2823 case LyXRC::RC_SAVE_COMPRESSED:
2824 case LyXRC::RC_SAVE_ORIGIN:
2825 case LyXRC::RC_SCREEN_DPI:
2827 case LyXRC::RC_SCREEN_FONT_ROMAN:
2828 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2829 case LyXRC::RC_SCREEN_FONT_SANS:
2830 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2831 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2832 case LyXRC::RC_SCREEN_FONT_SIZES:
2833 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2834 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2835 case LyXRC::RC_SCREEN_ZOOM:
2836 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2837 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2838 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2839 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2840 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2841 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2842 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2843 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2844 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2845 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2848 case LyXRC::RC_GEOMETRY_SESSION:
2849 case LyXRC::RC_SERVERPIPE:
2850 case LyXRC::RC_SET_COLOR:
2851 case LyXRC::RC_SHOW_BANNER:
2852 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2853 case LyXRC::RC_SPELLCHECKER:
2854 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2857 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2858 case LyXRC::RC_SPELLCHECK_NOTES:
2859 case LyXRC::RC_SPLITINDEX_COMMAND:
2860 case LyXRC::RC_TEMPDIRPATH:
2861 case LyXRC::RC_TEMPLATEPATH:
2862 case LyXRC::RC_TEX_ALLOWS_SPACES:
2863 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2864 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2865 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2868 case LyXRC::RC_TEXINPUTS_PREFIX:
2869 case LyXRC::RC_THESAURUSDIRPATH:
2870 case LyXRC::RC_UIFILE:
2871 case LyXRC::RC_USER_EMAIL:
2872 case LyXRC::RC_USER_NAME:
2873 case LyXRC::RC_USE_CONVERTER_CACHE:
2874 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2875 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2876 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2877 case LyXRC::RC_USE_SYSTEM_COLORS:
2878 case LyXRC::RC_USE_TOOLTIP:
2879 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2880 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2881 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2882 case LyXRC::RC_SINGLE_INSTANCE:
2883 case LyXRC::RC_SORT_LAYOUTS:
2884 case LyXRC::RC_FULL_SCREEN_LIMIT:
2885 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2886 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2887 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2888 case LyXRC::RC_FULL_SCREEN_TABBAR:
2889 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2890 case LyXRC::RC_FULL_SCREEN_WIDTH:
2891 case LyXRC::RC_VISUAL_CURSOR:
2892 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2893 case LyXRC::RC_VIEWER:
2894 case LyXRC::RC_VIEWER_ALTERNATIVES:
2895 case LyXRC::RC_FORWARD_SEARCH_DVI:
2896 case LyXRC::RC_FORWARD_SEARCH_PDF:
2897 case LyXRC::RC_EXPORT_OVERWRITE:
2898 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2899 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2900 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2901 case LyXRC::RC_CURSOR_WIDTH:
2907 set<string> LyXRC::getRCs()
2910 for (int i = 0; i != lyxrcCount; ++i)
2911 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2917 string const LyXRC::getDescription(LyXRCTags tag)
2922 case RC_ACCEPT_COMPOUND:
2923 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2927 str = _("Specify an alternate language. The default is to use the language of the document.");
2930 case RC_PLAINTEXT_LINELEN:
2931 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.");
2934 case RC_AUTOREGIONDELETE:
2935 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2938 case RC_AUTORESET_OPTIONS:
2939 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2943 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2946 case RC_AUTO_NUMBER:
2949 case RC_BACKUPDIR_PATH:
2950 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.");
2953 case RC_BIBTEX_COMMAND:
2954 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2957 case RC_JBIBTEX_COMMAND:
2958 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2962 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2965 case RC_CHECKLASTFILES:
2966 str = _("Select to check whether the lastfiles still exist.");
2969 case RC_CHKTEX_COMMAND:
2970 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2976 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
2977 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
2980 case RC_CONVERTER_NEEDAUTH:
2981 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
2987 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2988 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.");
2991 case RC_CURSOR_WIDTH:
2992 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2995 case RC_SCROLL_BELOW_DOCUMENT:
2996 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");
2999 case RC_MAC_DONTSWAP_CTRL_META:
3000 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3003 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3004 str = _("Use the Mac OS X conventions for cursor movement");
3007 case RC_SHOW_MACRO_LABEL:
3008 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3012 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3015 case RC_DEFAULT_OTF_VIEW_FORMAT:
3016 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3019 case RC_DEFAULT_VIEW_FORMAT:
3020 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3023 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3024 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3027 case RC_DISPLAY_GRAPHICS:
3028 str = _("Select how LyX will display any graphics.");
3031 case RC_DOCUMENTPATH:
3032 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3036 str = _("Specify additional chars that can be part of a word.");
3039 case RC_EXAMPLEPATH:
3040 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3046 case RC_INDEX_COMMAND:
3047 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\".");
3050 case RC_JINDEX_COMMAND:
3051 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3054 case RC_NOMENCL_COMMAND:
3055 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3058 case RC_PYGMENTIZE_COMMAND:
3059 str = _("The command to run the python pygments syntax highlighter.");
3066 case RC_KBMAP_PRIMARY:
3067 case RC_KBMAP_SECONDARY:
3068 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.");
3071 case RC_LANGUAGE_AUTO_BEGIN:
3072 str = _("Select if a language switching command is needed at the beginning of the document.");
3075 case RC_LANGUAGE_AUTO_END:
3076 str = _("Select if a language switching command is needed at the end of the document.");
3079 case RC_LANGUAGE_COMMAND_BEGIN:
3080 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.");
3083 case RC_LANGUAGE_COMMAND_END:
3084 str = _("The LaTeX command for changing back to the language of the document.");
3087 case RC_LANGUAGE_COMMAND_LOCAL:
3088 str = _("The LaTeX command for local changing of the language.");
3091 case RC_LANGUAGE_GLOBAL_OPTIONS:
3092 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3095 case RC_LANGUAGE_CUSTOM_PACKAGE:
3096 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3099 case RC_LANGUAGE_PACKAGE_SELECTION:
3100 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3103 case RC_USELASTFILEPOS:
3104 str = _("De-select if you do not want LyX to scroll to saved position.");
3107 case RC_LOADSESSION:
3108 str = _("De-select to prevent loading files opened from the last LyX session.");
3111 case RC_MAKE_BACKUP:
3112 str = _("De-select if you don't want LyX to create backup files.");
3115 case RC_MARK_FOREIGN_LANGUAGE:
3116 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3119 case RC_RESPECT_OS_KBD_LANGUAGE:
3120 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3123 case RC_MOUSE_WHEEL_SPEED:
3124 str = _("The scrolling speed of the mouse wheel.");
3127 case RC_COMPLETION_POPUP_DELAY:
3128 str = _("The completion popup delay.");
3131 case RC_COMPLETION_POPUP_MATH:
3132 str = _("Select to display the completion popup in math mode.");
3135 case RC_COMPLETION_POPUP_TEXT:
3136 str = _("Select to display the completion popup in text mode.");
3139 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3140 str = _("Show the completion popup without delay after non-unique completion attempt.");
3143 case RC_COMPLETION_POPUP_TEXT:
3144 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3147 case RC_COMPLETION_POPUP_DELAY:
3148 str = _("The inline completion delay.");
3151 case RC_COMPLETION_INLINE_MATH:
3152 str = _("Select to display the inline completion in math mode.");
3155 case RC_COMPLETION_INLINE_TEXT:
3156 str = _("Select to display the inline completion in text mode.");
3159 case RC_COMPLETION_INLINE_DOTS:
3160 str = _("Use \"...\" to shorten long completions.");
3163 case RC_AUTOCORRECTION_MATH:
3164 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3167 case RC_NUMLASTFILES:
3168 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3172 case RC_PATH_PREFIX:
3173 str = _("Specify those directories which should be "
3174 "prepended to the PATH environment variable.\n"
3175 "Use the OS native format.");
3179 str = _("Shows a typeset preview of things such as math");
3182 case RC_PREVIEW_HASHED_LABELS:
3183 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3186 case RC_PREVIEW_SCALE_FACTOR:
3187 str = _("Scale the preview size to suit.");
3190 case RC_PRINTLANDSCAPEFLAG:
3191 str = _("The option to print out in landscape.");
3194 case RC_PRINTPAPERDIMENSIONFLAG:
3195 str = _("Option to specify the dimensions of the print paper.");
3198 case RC_PRINTPAPERFLAG:
3199 str = _("The option to specify paper type.");
3202 case RC_VISUAL_CURSOR:
3203 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3206 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3207 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).");
3211 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3214 case RC_SCREEN_FONT_ROMAN:
3215 case RC_SCREEN_FONT_SANS:
3216 case RC_SCREEN_FONT_TYPEWRITER:
3217 str = _("The screen fonts used to display the text while editing.");
3220 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3221 case RC_SCREEN_FONT_SANS_FOUNDRY:
3222 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3225 case RC_SCREEN_FONT_SCALABLE:
3226 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.");
3229 case RC_SCREEN_FONT_SIZES:
3230 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3233 case RC_SCREEN_ZOOM:
3234 //xgettext:no-c-format
3235 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3238 case RC_GEOMETRY_SESSION:
3239 str = _("Allow session manager to save and restore windows geometry.");
3243 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3249 case RC_SHOW_BANNER:
3250 str = _("De-select if you don't want the startup banner.");
3253 case RC_TEMPDIRPATH:
3254 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3257 case RC_THESAURUSDIRPATH:
3258 str = _("This is the place where the files of the thesaurus library reside.");
3261 case RC_TEMPLATEPATH:
3262 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3265 case RC_TEX_ALLOWS_SPACES:
3268 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3271 case RC_TEXINPUTS_PREFIX:
3272 str = _("Specify those directories which should be "
3273 "prepended to the TEXINPUTS environment variable.\n"
3274 "A '.' represents the current document directory. "
3275 "Use the OS native format.");
3279 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3288 case RC_USE_USE_SYSTEM_COLORS:
3289 str = _("Enable use the system colors for some things like main window background and selection.");
3292 case RC_USE_TOOLTIP:
3293 str = _("Enable the automatic appearance of tool tips in the work area.");
3296 case RC_VIEWDVI_PAPEROPTION:
3297 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3312 // The global instance
3315 // The global copy of the system lyxrc entries (everything except preferences)