3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
21 #include "BufferList.h"
23 #include "Converter.h"
24 #include "FontEnums.h"
27 #include "FuncRequest.h"
32 #include "SpellChecker.h"
35 #include "graphics/GraphicsTypes.h"
37 #include "support/convert.h"
38 #include "support/debug.h"
39 #include "support/environment.h"
40 #include "support/FileName.h"
41 #include "support/filetools.h"
42 #include "support/gettext.h"
43 #include "support/lstrings.h"
44 #include "support/os.h"
45 #include "support/Package.h"
46 #include "support/TempFile.h"
47 #include "support/userinfo.h"
54 using namespace lyx::support;
58 namespace os = support::os;
62 // The format should also be updated in configure.py, and conversion code
63 // should be added to prefs2prefs_prefs.py.
64 static unsigned int const LYXRC_FILEFORMAT = 32; // spitz: add \ct_markup_copied
65 // when adding something to this array keep it sorted!
66 LexerKeyword lyxrcTags[] = {
67 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
68 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
69 { "\\alternate_language", LyXRC::RC_ALT_LANG },
70 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
71 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
72 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
73 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
74 { "\\autosave", LyXRC::RC_AUTOSAVE },
75 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
76 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
77 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
78 { "\\bind_file", LyXRC::RC_BINDFILE },
79 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
80 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
81 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
82 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
83 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
84 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
85 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
86 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
87 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
88 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
89 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
90 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
91 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
92 { "\\converter", LyXRC::RC_CONVERTER },
93 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
94 { "\\copier", LyXRC::RC_COPIER },
95 { "\\ct_additions_underlined", LyXRC::RC_CT_ADDITIONS_UNDERLINED },
96 { "\\ct_markup_copied", LyXRC::RC_CT_MARKUP_COPIED },
97 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
98 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
99 { "\\def_file", LyXRC::RC_DEFFILE },
100 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
101 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
102 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
103 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
104 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
105 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
106 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
107 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
108 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
109 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
110 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
111 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
112 { "\\format", LyXRC::RC_FILEFORMAT },
113 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
114 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
115 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
116 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
117 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
118 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
119 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
120 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
121 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
122 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
123 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
124 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
125 { "\\icon_set", LyXRC::RC_ICON_SET },
126 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
127 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
128 { "\\input", LyXRC::RC_INPUT },
129 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
130 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
131 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
132 { "\\kbmap", LyXRC::RC_KBMAP },
133 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
134 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
135 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
136 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
137 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
138 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
139 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
140 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
141 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
142 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
143 { "\\load_session", LyXRC::RC_LOADSESSION },
144 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
145 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
146 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
147 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
148 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
149 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
150 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
151 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
152 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
153 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
154 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
155 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
156 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
157 { "\\preview", LyXRC::RC_PREVIEW },
158 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
159 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
160 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
161 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
162 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
163 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
164 { "\\respect_os_kbd_language", LyXRC::RC_RESPECT_OS_KBD_LANGUAGE },
165 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
166 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
167 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
168 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
169 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
170 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
171 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
172 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
173 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
174 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
175 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
176 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
177 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
178 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
179 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
180 { "\\set_color", LyXRC::RC_SET_COLOR },
181 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
182 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
183 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
184 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
185 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
186 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
187 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
188 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
189 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
190 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
191 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
192 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
193 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
194 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
195 { "\\ui_file", LyXRC::RC_UIFILE },
196 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
197 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
198 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
199 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
200 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
201 // compatibility with versions older than 1.4.0 only
202 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
203 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
204 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
205 { "\\user_email", LyXRC::RC_USER_EMAIL },
206 { "\\user_initials", LyXRC::RC_USER_INITIALS },
207 { "\\user_name", LyXRC::RC_USER_NAME },
208 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
209 // compatibility with versions older than 1.4.0 only
210 { "\\viewer", LyXRC::RC_VIEWER},
211 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
212 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
213 { "format", LyXRC::RC_LYXRCFORMAT }
216 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
219 void oldFontFormat(string & family, string & foundry)
221 if (family.empty() || family[0] != '-')
223 foundry = token(family, '-', 1);
224 family = token(family, '-', 2);
232 bool LyXRC::read(FileName const & filename, bool check_format)
234 Lexer lexrc(lyxrcTags);
235 lexrc.setFile(filename);
236 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
237 ReturnValues retval = read(lexrc, check_format);
238 if (!check_format || retval != FormatMismatch)
239 return retval == ReadOK;
241 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
242 TempFile tmp("convert_lyxrc");
243 FileName const tempfile = tmp.name();
244 bool const success = prefs2prefs(filename, tempfile, false);
246 LYXERR0 ("Unable to convert " << filename.absFileName() <<
247 " to format " << LYXRC_FILEFORMAT);
250 // Keep this in the else branch, such that lexrc2 goes out
251 // of scope and releases the lock on tempfile before we
252 // attempt to remove it. This matters on Windows.
253 Lexer lexrc2(lyxrcTags);
254 lexrc2.setFile(tempfile);
255 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
256 retval = read(lexrc2, check_format);
257 if (retval == FormatMismatch)
258 LYXERR0("Conversion failed for " << filename.absFileName());
260 return retval == ReadOK;
264 // don't need to worry about conversion, because this is always
265 // from an internal source
266 bool LyXRC::read(istream & is)
268 Lexer lexrc(lyxrcTags);
270 LYXERR(Debug::LYXRC, "Reading istream...");
271 return read(lexrc, false) == ReadOK;
275 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
277 if (lyxerr.debugging(Debug::PARSER))
278 lexrc.printTable(lyxerr);
283 // format prior to 2.0 and introduction of format tag
284 unsigned int rc_format = 0;
286 while (lexrc.isOK()) {
287 // By using two switches we take advantage of the compiler
288 // telling us if we have missed a LyXRCTags element in
289 // the second switch.
290 // Note that this also shows a problem with Lexer since it
291 // helps us avoid taking advantage of the strictness of the
294 int le = lexrc.lex();
296 case Lexer::LEX_UNDEF:
297 lexrc.printError("Unknown tag `$$Token'");
299 case Lexer::LEX_FEOF:
304 switch (static_cast<LyXRCTags>(le)) {
307 rc_format = lexrc.getInteger();
309 case RC_INPUT: // Include file
312 libFileSearch(string(),
314 if (!read(tmp, check_format)) {
316 "Error reading included file: " + tmp.absFileName());
322 bind_file = os::internal_path(lexrc.getString());
327 def_file = os::internal_path(lexrc.getString());
332 ui_file = os::internal_path(lexrc.getString());
335 case RC_AUTORESET_OPTIONS:
336 lexrc >> auto_reset_options;
339 case RC_DISPLAY_GRAPHICS:
341 display_graphics = lexrc.getString() == "true";
344 case RC_TEX_EXPECTS_WINDOWS_PATHS:
345 lexrc >> windows_style_tex_paths;
348 case RC_TEX_ALLOWS_SPACES:
349 lexrc >> tex_allows_spaces;
352 case RC_TEXINPUTS_PREFIX:
353 lexrc >> texinputs_prefix;
360 case RC_KBMAP_PRIMARY:
362 string const kmap(os::internal_path(lexrc.getString()));
363 if (!libFileSearch("kbd", kmap, "kmap").empty()
365 primary_kbmap = kmap;
367 lexrc.printError("LyX: Keymap `$$Token' not found");
372 case RC_KBMAP_SECONDARY:
374 string const kmap(os::internal_path(lexrc.getString()));
375 if (!libFileSearch("kbd", kmap, "kmap").empty()
377 secondary_kbmap = kmap;
379 lexrc.printError("LyX: Keymap `$$Token' not found");
384 case RC_PRINTLANDSCAPEFLAG:
385 lexrc >> print_landscape_flag;
388 case RC_PRINTPAPERDIMENSIONFLAG:
389 lexrc >> print_paper_dimension_flag;
392 case RC_PRINTPAPERFLAG:
393 lexrc >> print_paper_flag;
396 case RC_PYGMENTIZE_COMMAND:
397 if (lexrc.next(true)) {
398 pygmentize_command = lexrc.getString();
402 case RC_VIEWDVI_PAPEROPTION:
404 view_dvi_paper_option = lexrc.getString();
406 view_dvi_paper_option.erase();
409 case RC_CHKTEX_COMMAND:
410 if (lexrc.next(true)) {
411 chktex_command = lexrc.getString();
415 case RC_BIBTEX_ALTERNATIVES:
416 if (lexrc.next(true)) {
417 bibtex_alternatives.insert(lexrc.getString());
421 case RC_BIBTEX_COMMAND:
422 if (lexrc.next(true)) {
423 bibtex_command = lexrc.getString();
427 case RC_JBIBTEX_COMMAND:
428 if (lexrc.next(true)) {
429 jbibtex_command = lexrc.getString();
433 case RC_JBIBTEX_ALTERNATIVES:
434 if (lexrc.next(true)) {
435 jbibtex_alternatives.insert(lexrc.getString());
439 case RC_INDEX_ALTERNATIVES:
440 if (lexrc.next(true)) {
441 index_alternatives.insert(lexrc.getString());
445 case RC_INDEX_COMMAND:
446 if (lexrc.next(true)) {
447 index_command = lexrc.getString();
451 case RC_JINDEX_COMMAND:
452 if (lexrc.next(true)) {
453 jindex_command = lexrc.getString();
457 case RC_SPLITINDEX_COMMAND:
458 if (lexrc.next(true)) {
459 splitindex_command = lexrc.getString();
463 case RC_NOMENCL_COMMAND:
464 if (lexrc.next(true)) {
465 nomencl_command = lexrc.getString();
474 lexrc >> defaultZoom;
475 if (defaultZoom < 10)
479 case RC_GEOMETRY_SESSION:
480 lexrc >> allow_geometry_session;
483 case RC_SCREEN_FONT_SIZES:
484 lexrc >> font_sizes[TINY_SIZE];
485 lexrc >> font_sizes[SCRIPT_SIZE];
486 lexrc >> font_sizes[FOOTNOTE_SIZE];
487 lexrc >> font_sizes[SMALL_SIZE];
488 lexrc >> font_sizes[NORMAL_SIZE];
489 lexrc >> font_sizes[LARGE_SIZE];
490 lexrc >> font_sizes[LARGER_SIZE];
491 lexrc >> font_sizes[LARGEST_SIZE];
492 lexrc >> font_sizes[HUGE_SIZE];
493 lexrc >> font_sizes[HUGER_SIZE];
496 case RC_SCREEN_FONT_SCALABLE:
497 lexrc >> use_scalable_fonts;
504 case RC_DOCUMENTPATH:
506 document_path = os::internal_path(lexrc.getString());
511 example_path = os::internal_path(lexrc.getString());
514 case RC_TEMPLATEPATH:
516 template_path = os::internal_path(lexrc.getString());
521 tempdir_path = os::internal_path(lexrc.getString());
524 case RC_THESAURUSDIRPATH:
526 thesaurusdir_path = os::internal_path(lexrc.getString());
529 case RC_HUNSPELLDIR_PATH:
531 hunspelldir_path = os::internal_path(lexrc.getString());
534 case RC_USELASTFILEPOS:
535 lexrc >> use_lastfilepos;
539 lexrc >> load_session;
542 case RC_MOUSE_WHEEL_SPEED:
543 lexrc >> mouse_wheel_speed;
546 case RC_COMPLETION_INLINE_DELAY:
547 lexrc >> completion_inline_delay;
550 case RC_COMPLETION_INLINE_MATH:
551 lexrc >> completion_inline_math;
554 case RC_COMPLETION_INLINE_TEXT:
555 lexrc >> completion_inline_text;
558 case RC_COMPLETION_INLINE_DOTS:
559 lexrc >> completion_inline_dots;
562 case RC_AUTOCORRECTION_MATH:
563 lexrc >> autocorrection_math;
566 case RC_COMPLETION_POPUP_DELAY:
567 lexrc >> completion_popup_delay;
570 case RC_COMPLETION_POPUP_MATH:
571 lexrc >> completion_popup_math;
574 case RC_COMPLETION_POPUP_TEXT:
575 lexrc >> completion_popup_text;
578 case RC_COMPLETION_CURSOR_TEXT:
579 lexrc >> completion_cursor_text;
582 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
583 lexrc >> completion_popup_after_complete;
586 case RC_COMPLETION_MINLENGTH:
587 lexrc >> completion_minlength;
590 case RC_NUMLASTFILES:
591 lexrc >> num_lastfiles;
594 case RC_CHECKLASTFILES:
595 lexrc >> check_lastfiles;
602 case RC_USE_SYSTEM_THEME_ICONS:
603 lexrc >> use_system_theme_icons;
606 case RC_SCREEN_FONT_ROMAN:
608 roman_font_name = lexrc.getString();
609 oldFontFormat(roman_font_name,
614 case RC_SCREEN_FONT_SANS:
616 sans_font_name = lexrc.getString();
617 oldFontFormat(sans_font_name, sans_font_foundry);
621 case RC_SCREEN_FONT_TYPEWRITER:
623 typewriter_font_name = lexrc.getString();
624 oldFontFormat(typewriter_font_name,
625 typewriter_font_foundry);
629 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
630 lexrc >> roman_font_foundry;
633 case RC_SCREEN_FONT_SANS_FOUNDRY:
634 lexrc >> sans_font_foundry;
637 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
638 lexrc >> typewriter_font_foundry;
643 lexrc.printError("Missing color tag.");
646 string lyx_name = lexrc.getString();
649 lexrc.printError("Missing color name for color: `$$Token'");
652 string x11_name = lexrc.getString();
654 ColorCode const col =
655 lcolor.getFromLyXName(lyx_name);
656 if (col == Color_none ||
657 col == Color_inherit ||
661 if (!lcolor.setColor(col, x11_name))
662 LYXERR0("Bad lyxrc set_color for " << lyx_name);
666 case RC_AUTOREGIONDELETE:
667 // Auto region delete defaults to true
668 lexrc >> auto_region_delete;
673 lyxpipes = os::internal_path(lexrc.getString());
676 case RC_CT_ADDITIONS_UNDERLINED:
677 lexrc >> ct_additions_underlined;
680 case RC_CT_MARKUP_COPIED:
681 lexrc >> ct_markup_copied;
684 case RC_CURSOR_FOLLOWS_SCROLLBAR:
685 lexrc >> cursor_follows_scrollbar;
688 case RC_CURSOR_WIDTH:
689 lexrc >> cursor_width;
692 case RC_SCROLL_BELOW_DOCUMENT:
693 lexrc >> scroll_below_document;
696 case RC_PARAGRAPH_MARKERS:
697 lexrc >> paragraph_markers;
700 case RC_MAC_DONTSWAP_CTRL_META:
701 lexrc >> mac_dontswap_ctrl_meta;
704 case RC_MAC_LIKE_CURSOR_MOVEMENT:
705 lexrc >> mac_like_cursor_movement;
708 case RC_MACRO_EDIT_STYLE:
710 switch (lexrc.getInteger()) {
711 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
712 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
713 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
718 case RC_DIALOGS_ICONIFY_WITH_MAIN:
719 lexrc >> dialogs_iconify_with_main;
722 case RC_PLAINTEXT_LINELEN:
723 lexrc >> plaintext_linelen;
725 // Spellchecker settings:
726 case RC_ACCEPT_COMPOUND:
727 lexrc >> spellchecker_accept_compound;
729 case RC_USE_NATIVE_FILEDIALOG:
730 lexrc >> use_native_filedialog;
732 case RC_USE_SYSTEM_COLORS:
733 lexrc >> use_system_colors;
736 lexrc >> use_tooltip;
738 case RC_SPELLCHECKER:
739 lexrc >> spellchecker;
742 lexrc >> spellchecker_alt_lang;
745 lexrc >> spellchecker_esc_chars;
747 case RC_SPELLCHECK_CONTINUOUSLY:
748 lexrc >> spellcheck_continuously;
750 case RC_SPELLCHECK_NOTES:
751 lexrc >> spellcheck_notes;
754 lexrc >> make_backup;
756 case RC_SAVE_COMPRESSED:
757 lexrc >> save_compressed;
760 lexrc >> save_origin;
762 case RC_BACKUPDIR_PATH:
764 backupdir_path = os::internal_path(lexrc.getString());
766 case RC_DEFAULT_DECIMAL_SEP:
767 lexrc >> default_decimal_sep;
769 case RC_DEFAULT_LENGTH_UNIT:
771 default_length_unit = (Length::UNIT) lexrc.getInteger();
773 case RC_LANGUAGE_CUSTOM_PACKAGE:
774 lexrc >> language_custom_package;
776 case RC_LANGUAGE_AUTO_BEGIN:
777 lexrc >> language_auto_begin;
779 case RC_LANGUAGE_AUTO_END:
780 lexrc >> language_auto_end;
782 case RC_LANGUAGE_GLOBAL_OPTIONS:
783 lexrc >> language_global_options;
785 case RC_LANGUAGE_PACKAGE_SELECTION:
787 switch (lexrc.getInteger()) {
789 language_package_selection = LP_AUTO;
792 language_package_selection = LP_BABEL;
795 language_package_selection = LP_CUSTOM;
798 language_package_selection = LP_NONE;
803 case RC_LANGUAGE_COMMAND_BEGIN:
804 lexrc >> language_command_begin;
806 case RC_LANGUAGE_COMMAND_END:
807 lexrc >> language_command_end;
809 case RC_LANGUAGE_COMMAND_LOCAL:
810 lexrc >> language_command_local;
812 case RC_RESPECT_OS_KBD_LANGUAGE:
813 lexrc >> respect_os_kbd_language;
815 case RC_VISUAL_CURSOR:
816 lexrc >> visual_cursor;
818 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
819 lexrc >> close_buffer_with_last_view;
822 lexrc >> auto_number;
824 case RC_MARK_FOREIGN_LANGUAGE:
825 lexrc >> mark_foreign_language;
831 fmt = lexrc.getString();
832 if (lexrc.next(true))
833 command = lexrc.getString();
834 setMover(fmt, command);
839 string from, to, command, flags;
841 from = lexrc.getString();
843 to = lexrc.getString();
844 if (lexrc.next(true))
845 command = lexrc.getString();
847 flags = lexrc.getString();
849 theConverters().erase(from, to);
851 theConverters().add(from, to, command, flags);
854 // compatibility with versions older than 1.4.0 only
856 string format, command;
857 lexrc >> format >> command;
858 theFormats().setViewer(format, command);
861 case RC_FILEFORMAT: {
863 string format, extensions, shortcut;
864 docstring prettyname;
865 if (!(lexrc >> format >> extensions))
867 if (ok && lexrc.next(true))
868 prettyname = lexrc.getDocString();
872 if(!(lexrc >> shortcut))
874 string viewer, editor;
875 if (ok && lexrc.next(true))
876 viewer = lexrc.getString();
879 if (ok && lexrc.next(true))
880 editor = lexrc.getString();
884 if (!(lexrc >> flags >> mime))
886 int flgs = Format::none;
887 while (!flags.empty()) {
889 flags = split(flags, flag, ',');
890 if (flag == "document")
891 flgs |= Format::document;
892 else if (flag == "vector")
893 flgs |= Format::vector;
894 else if (flag == "zipped=native")
895 flgs |= Format::zipped_native;
896 else if (flag == "menu=export")
897 flgs |= Format::export_menu;
898 else if (flag == "menu=none")
899 flgs |= Format::no_menu;
901 LYXERR0("Ignoring unknown flag `"
902 << flag << "' for format `"
906 LYXERR0("Syntax error in format " << format);
907 else if (prettyname.empty()) {
908 if (theConverters().formatIsUsed(format))
909 LYXERR0("Can't delete format " << format);
911 theFormats().erase(format);
913 theFormats().add(format, extensions, prettyname,
914 shortcut, viewer, editor, mime, flgs);
918 case RC_VIEWER_ALTERNATIVES: {
919 string format, command;
920 if ((lexrc >> format) && lexrc.next(true)) {
921 command = lexrc.getString();
922 viewer_alternatives[format].insert(command);
926 case RC_EDITOR_ALTERNATIVES: {
927 string format, command;
928 if ((lexrc >> format) && lexrc.next(true)) {
929 command = lexrc.getString();
930 editor_alternatives[format].insert(command);
935 case RC_DEFAULT_OTF_VIEW_FORMAT:
936 lexrc >> default_otf_view_format;
939 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
940 lexrc >> default_platex_view_format;
943 case RC_DEFAULT_VIEW_FORMAT:
944 lexrc >> default_view_format;
947 case RC_GUI_LANGUAGE:
948 lexrc >> gui_language;
952 lexrc >> show_banner;
957 string const tmp = lexrc.getString();
958 if (tmp == "true" || tmp == "on")
959 preview = PREVIEW_ON;
960 else if (tmp == "no_math")
961 preview = PREVIEW_NO_MATH;
963 preview = PREVIEW_OFF;
964 if (tmp != "false" && tmp != "off")
965 LYXERR0("Unrecognized preview status \""
971 case RC_PREVIEW_HASHED_LABELS:
972 lexrc >> preview_hashed_labels;
975 case RC_PREVIEW_SCALE_FACTOR:
976 lexrc >> preview_scale_factor;
985 case RC_USER_INITIALS:
986 lexrc >> user_initials;
990 lexrc >> path_prefix;
993 case RC_USE_CONVERTER_CACHE:
994 lexrc >> use_converter_cache;
996 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
997 lexrc >> use_converter_needauth_forbidden;
999 case RC_USE_CONVERTER_NEEDAUTH:
1000 lexrc >> use_converter_needauth;
1002 case RC_CONVERTER_CACHE_MAXAGE:
1003 lexrc >> converter_cache_maxage;
1006 case RC_SORT_LAYOUTS:
1007 lexrc >> sort_layouts;
1009 case RC_GROUP_LAYOUTS:
1010 lexrc >> group_layouts;
1012 case RC_FULL_SCREEN_LIMIT:
1013 lexrc >> full_screen_limit;
1015 case RC_FULL_SCREEN_TOOLBARS:
1016 lexrc >> full_screen_toolbars;
1018 case RC_FULL_SCREEN_SCROLLBAR:
1019 lexrc >> full_screen_scrollbar;
1021 case RC_FULL_SCREEN_STATUSBAR:
1022 lexrc >> full_screen_statusbar;
1024 case RC_FULL_SCREEN_TABBAR:
1025 lexrc >> full_screen_tabbar;
1027 case RC_FULL_SCREEN_MENUBAR:
1028 lexrc >> full_screen_menubar;
1030 case RC_FULL_SCREEN_WIDTH:
1031 lexrc >> full_screen_width;
1033 case RC_OPEN_BUFFERS_IN_TABS:
1034 lexrc >> open_buffers_in_tabs;
1036 case RC_SINGLE_CLOSE_TAB_BUTTON:
1037 lexrc >> single_close_tab_button;
1039 case RC_SINGLE_INSTANCE:
1040 lexrc >> single_instance;
1041 if (run_mode == PREFERRED)
1042 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1044 case RC_FORWARD_SEARCH_DVI:
1045 if (lexrc.next(true))
1046 forward_search_dvi = lexrc.getString();
1048 case RC_FORWARD_SEARCH_PDF:
1049 if (lexrc.next(true))
1050 forward_search_pdf = lexrc.getString();
1052 case RC_EXPORT_OVERWRITE:
1054 string const tmp = lexrc.getString();
1055 if (tmp == "all" || tmp == "true")
1056 export_overwrite = ALL_FILES;
1057 else if (tmp == "main")
1058 export_overwrite = MAIN_FILE;
1060 export_overwrite = NO_FILES;
1061 if (tmp != "ask" && tmp != "false")
1062 LYXERR0("Unrecognized export_overwrite status \""
1067 case RC_SCROLL_WHEEL_ZOOM:
1069 string const tmp = lexrc.getString();
1071 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1072 else if (tmp == "shift")
1073 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1074 else if (tmp == "alt")
1075 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1077 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1078 if (tmp != "off" && tmp != "false")
1079 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1085 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1086 lexrc >> mouse_middlebutton_paste;
1090 break; // this is just a dummy
1093 // This is triggered the first time through the loop unless
1094 // we hit a format tag.
1095 if (check_format && rc_format != LYXRC_FILEFORMAT)
1096 return FormatMismatch;
1099 /// Update converters data-structures
1100 theConverters().update(theFormats());
1101 theConverters().buildGraph();
1102 theBufferList().invalidateConverterCache();
1108 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1110 ofstream ofs(filename.toFilesystemEncoding().c_str());
1112 write(ofs, ignore_system_lyxrc);
1116 void LyXRC::print() const
1118 if (lyxerr.debugging())
1119 write(lyxerr, false);
1127 typedef pair<string, SpecialisedMover> Data;
1129 SameMover(Data const & comparison)
1130 : comparison_(comparison) {}
1132 bool operator()(Data const & data) const
1134 return data.first == comparison_.first &&
1135 data.second.command() == comparison_.second.command();
1145 // Escape \ and " so that LyXLex can read the string later
1146 string escapeCommand(string const & str) {
1147 return subst(subst(str , "\\", "\\\\"),
1154 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1156 LyXRCTags tag = RC_LAST;
1158 if (!name.empty()) {
1159 for (int i = 0; i != lyxrcCount; ++i)
1160 if ("\\" + name == lyxrcTags[i].tag)
1161 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1165 os << "# LyX " << lyx_version
1166 << " generated this file. If you want to make your own\n"
1167 << "# modifications you should do them from inside LyX and save.\n\n"
1168 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1170 // Why the switch you might ask. It is a trick to ensure that all
1171 // the elements in the LyXRCTags enum are handled. As you can see
1172 // there are no breaks at all. So it is just a huge fall-through.
1173 // The nice thing is that we will get a warning from the compiler
1174 // if we forget an element.
1178 // input/include files are not done here
1179 case RC_LYXRCFORMAT:
1181 if (ignore_system_lyxrc ||
1182 bind_file != system_lyxrc.bind_file) {
1183 string const path = os::external_path(bind_file);
1184 os << "\\bind_file \"" << path << "\"\n";
1190 if (ignore_system_lyxrc ||
1191 def_file != system_lyxrc.def_file) {
1192 string const path = os::external_path(def_file);
1193 os << "\\def_file \"" << path << "\"\n";
1202 << "# MISC SECTION ######################################\n"
1204 // bind files are not done here.
1206 case RC_PATH_PREFIX:
1207 if (ignore_system_lyxrc ||
1208 path_prefix != system_lyxrc.path_prefix) {
1209 os << "\\path_prefix \"" << path_prefix << "\"\n";
1215 if (ignore_system_lyxrc ||
1216 ui_file != system_lyxrc.ui_file) {
1217 string const path = os::external_path(ui_file);
1218 os << "\\ui_file \"" << path << "\"\n";
1223 case RC_AUTOREGIONDELETE:
1224 if (ignore_system_lyxrc ||
1225 auto_region_delete != system_lyxrc.auto_region_delete) {
1226 os << "# Set to false to inhibit automatic replacement of\n"
1227 << "# the current selection.\n"
1228 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1234 case RC_AUTORESET_OPTIONS:
1235 if (ignore_system_lyxrc ||
1236 auto_reset_options != system_lyxrc.auto_reset_options) {
1237 os << "# Set to false to inhibit automatic reset of\n"
1238 << "# the class options to defaults on class change.\n"
1239 << "\\auto_reset_options "
1240 << convert<string>(auto_reset_options)
1247 if (ignore_system_lyxrc ||
1248 autosave != system_lyxrc.autosave) {
1249 os << "# The time interval between auto-saves in seconds.\n"
1250 << "\\autosave " << autosave << '\n';
1255 case RC_DISPLAY_GRAPHICS:
1256 if (ignore_system_lyxrc ||
1257 display_graphics != system_lyxrc.display_graphics) {
1258 os << "# Display graphics within LyX\n"
1260 << "\\display_graphics "
1261 << (display_graphics ? "true" : "false")
1267 case RC_SORT_LAYOUTS:
1268 if (ignore_system_lyxrc ||
1269 sort_layouts != system_lyxrc.sort_layouts) {
1270 os << "# Sort layouts alphabetically.\n"
1271 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1276 case RC_GROUP_LAYOUTS:
1277 if (ignore_system_lyxrc ||
1278 group_layouts != system_lyxrc.group_layouts) {
1279 os << "# Group layouts by their category.\n"
1280 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1285 case RC_VIEWDVI_PAPEROPTION:
1286 if (ignore_system_lyxrc ||
1287 view_dvi_paper_option
1288 != system_lyxrc.view_dvi_paper_option) {
1289 os << "# Options used to specify paper size to the\n"
1290 << "# view_dvi_command (e.g. -paper)\n"
1291 << "\\view_dvi_paper_option \""
1292 << view_dvi_paper_option << "\"\n";
1297 case RC_CHKTEX_COMMAND:
1298 if (ignore_system_lyxrc ||
1299 chktex_command != system_lyxrc.chktex_command) {
1300 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1305 case RC_BIBTEX_ALTERNATIVES: {
1306 CommandSet::const_iterator it = bibtex_alternatives.begin();
1307 CommandSet::const_iterator end = bibtex_alternatives.end();
1308 for ( ; it != end; ++it) {
1309 if (ignore_system_lyxrc
1310 || !system_lyxrc.bibtex_alternatives.count(*it))
1311 os << "\\bibtex_alternatives \""
1318 case RC_BIBTEX_COMMAND:
1319 if (ignore_system_lyxrc ||
1320 bibtex_command != system_lyxrc.bibtex_command) {
1321 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1326 case RC_JBIBTEX_COMMAND:
1327 if (ignore_system_lyxrc ||
1328 jbibtex_command != system_lyxrc.jbibtex_command) {
1329 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1334 case RC_JBIBTEX_ALTERNATIVES: {
1335 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1336 CommandSet::const_iterator end = jbibtex_alternatives.end();
1337 for ( ; it != end; ++it) {
1338 if (ignore_system_lyxrc
1339 || !system_lyxrc.jbibtex_alternatives.count(*it))
1340 os << "\\jbibtex_alternatives \""
1347 case RC_INDEX_ALTERNATIVES: {
1348 CommandSet::const_iterator it = index_alternatives.begin();
1349 CommandSet::const_iterator end = index_alternatives.end();
1350 for ( ; it != end; ++it) {
1351 if (ignore_system_lyxrc
1352 || !system_lyxrc.index_alternatives.count(*it))
1353 os << "\\index_alternatives \""
1360 case RC_INDEX_COMMAND:
1361 if (ignore_system_lyxrc ||
1362 index_command != system_lyxrc.index_command) {
1363 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1368 case RC_JINDEX_COMMAND:
1369 if (ignore_system_lyxrc ||
1370 jindex_command != system_lyxrc.jindex_command) {
1371 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1376 case RC_SPLITINDEX_COMMAND:
1377 if (ignore_system_lyxrc ||
1378 splitindex_command != system_lyxrc.splitindex_command) {
1379 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1384 case RC_NOMENCL_COMMAND:
1385 if (ignore_system_lyxrc ||
1386 nomencl_command != system_lyxrc.nomencl_command) {
1387 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1392 case RC_PYGMENTIZE_COMMAND:
1393 if (ignore_system_lyxrc ||
1394 pygmentize_command != system_lyxrc.pygmentize_command) {
1395 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1400 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1401 // Don't write this setting to the preferences file,
1402 // but allow temporary changes (bug 7557).
1403 if (ignore_system_lyxrc) {
1404 os << "\\tex_expects_windows_paths "
1405 << convert<string>(windows_style_tex_paths) << '\n';
1410 case RC_TEX_ALLOWS_SPACES:
1411 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1412 os << "\\tex_allows_spaces "
1413 << convert<string>(tex_allows_spaces) << '\n';
1419 if (ignore_system_lyxrc ||
1420 use_kbmap != system_lyxrc.use_kbmap) {
1421 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1426 case RC_KBMAP_PRIMARY:
1427 if (ignore_system_lyxrc ||
1428 primary_kbmap != system_lyxrc.primary_kbmap) {
1429 string const path = os::external_path(primary_kbmap);
1430 os << "\\kbmap_primary \"" << path << "\"\n";
1435 case RC_KBMAP_SECONDARY:
1436 if (ignore_system_lyxrc ||
1437 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1438 string const path = os::external_path(secondary_kbmap);
1439 os << "\\kbmap_secondary \"" << path << "\"\n";
1445 if (ignore_system_lyxrc ||
1446 lyxpipes != system_lyxrc.lyxpipes) {
1447 string const path = os::external_path(lyxpipes);
1448 os << "\\serverpipe \"" << path << "\"\n";
1454 os << "\\user_name \"" << user_name << "\"\n";
1459 os << "\\user_email \"" << user_email << "\"\n";
1463 case RC_USER_INITIALS:
1464 os << "\\user_initials \"" << user_initials << "\"\n";
1468 case RC_SHOW_BANNER:
1469 if (ignore_system_lyxrc ||
1470 show_banner != system_lyxrc.show_banner) {
1471 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1477 if (ignore_system_lyxrc ||
1478 preview != system_lyxrc.preview) {
1484 case PREVIEW_NO_MATH:
1491 os << "\\preview " << status << '\n';
1496 case RC_PREVIEW_HASHED_LABELS:
1497 if (ignore_system_lyxrc ||
1498 preview_hashed_labels !=
1499 system_lyxrc.preview_hashed_labels) {
1500 os << "\\preview_hashed_labels "
1501 << convert<string>(preview_hashed_labels) << '\n';
1506 case RC_PREVIEW_SCALE_FACTOR:
1507 if (ignore_system_lyxrc ||
1508 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1509 os << "\\preview_scale_factor "
1510 << preview_scale_factor << '\n';
1515 case RC_USE_CONVERTER_CACHE:
1516 if (ignore_system_lyxrc ||
1517 use_converter_cache != system_lyxrc.use_converter_cache) {
1518 os << "\\use_converter_cache "
1519 << convert<string>(use_converter_cache) << '\n';
1524 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1525 if (ignore_system_lyxrc ||
1526 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1527 os << "\\use_converter_needauth_forbidden "
1528 << convert<string>(use_converter_needauth_forbidden) << '\n';
1533 case RC_USE_CONVERTER_NEEDAUTH:
1534 if (ignore_system_lyxrc ||
1535 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1536 os << "\\use_converter_needauth "
1537 << convert<string>(use_converter_needauth) << '\n';
1542 case RC_CONVERTER_CACHE_MAXAGE:
1543 if (ignore_system_lyxrc ||
1544 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1545 os << "\\converter_cache_maxage "
1546 << converter_cache_maxage << '\n';
1552 << "# SCREEN & FONTS SECTION ############################\n"
1556 if (ignore_system_lyxrc ||
1557 icon_set != system_lyxrc.icon_set) {
1558 os << "\\icon_set \"" << icon_set
1564 case RC_USE_SYSTEM_THEME_ICONS:
1565 if (ignore_system_lyxrc ||
1566 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1567 os << "\\use_system_theme_icons "
1568 << convert<string>(use_system_theme_icons)
1575 if (ignore_system_lyxrc ||
1576 dpi != system_lyxrc.dpi) {
1577 os << "\\screen_dpi " << dpi << '\n';
1582 case RC_SCREEN_ZOOM:
1583 if (ignore_system_lyxrc ||
1584 defaultZoom != system_lyxrc.defaultZoom) {
1585 os << "\\screen_zoom " << defaultZoom << '\n';
1590 case RC_GEOMETRY_SESSION:
1591 if (ignore_system_lyxrc ||
1592 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1593 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1599 case RC_CT_ADDITIONS_UNDERLINED:
1600 if (ignore_system_lyxrc ||
1601 ct_additions_underlined
1602 != system_lyxrc.ct_additions_underlined) {
1603 os << "\\ct_additions_underlined "
1604 << convert<string>(ct_additions_underlined) << '\n';
1609 case RC_CT_MARKUP_COPIED:
1610 if (ignore_system_lyxrc ||
1612 != system_lyxrc.ct_markup_copied) {
1613 os << "\\ct_markup_copied "
1614 << convert<string>(ct_markup_copied) << '\n';
1619 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1620 if (ignore_system_lyxrc ||
1621 cursor_follows_scrollbar
1622 != system_lyxrc.cursor_follows_scrollbar) {
1623 os << "\\cursor_follows_scrollbar "
1624 << convert<string>(cursor_follows_scrollbar) << '\n';
1629 case RC_CURSOR_WIDTH:
1630 if (ignore_system_lyxrc ||
1632 != system_lyxrc.cursor_width) {
1633 os << "\\cursor_width "
1634 << cursor_width << '\n';
1639 case RC_SCROLL_BELOW_DOCUMENT:
1640 if (ignore_system_lyxrc ||
1641 scroll_below_document
1642 != system_lyxrc.scroll_below_document) {
1643 os << "\\scroll_below_document "
1644 << convert<string>(scroll_below_document) << '\n';
1649 case RC_PARAGRAPH_MARKERS:
1650 if (ignore_system_lyxrc ||
1652 != system_lyxrc.paragraph_markers) {
1653 os << "\\paragraph_markers "
1654 << convert<string>(paragraph_markers) << '\n';
1659 case RC_MAC_DONTSWAP_CTRL_META:
1660 if (ignore_system_lyxrc ||
1661 mac_dontswap_ctrl_meta
1662 != system_lyxrc.mac_dontswap_ctrl_meta) {
1663 os << "\\mac_dontswap_ctrl_meta "
1664 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1669 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1670 if (ignore_system_lyxrc ||
1671 mac_like_cursor_movement
1672 != system_lyxrc.mac_like_cursor_movement) {
1673 os << "\\mac_like_cursor_movement "
1674 << convert<string>(mac_like_cursor_movement) << '\n';
1679 case RC_MACRO_EDIT_STYLE:
1680 if (ignore_system_lyxrc ||
1682 != system_lyxrc.macro_edit_style) {
1683 os << "\\macro_edit_style ";
1684 switch (macro_edit_style) {
1685 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1686 case MACRO_EDIT_INLINE: os << "1\n"; break;
1687 case MACRO_EDIT_LIST: os << "2\n"; break;
1693 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1694 if (ignore_system_lyxrc ||
1695 dialogs_iconify_with_main
1696 != system_lyxrc.dialogs_iconify_with_main) {
1697 os << "\\dialogs_iconify_with_main "
1698 << convert<string>(dialogs_iconify_with_main) << '\n';
1703 case RC_SCREEN_FONT_ROMAN:
1704 if (ignore_system_lyxrc ||
1705 roman_font_name != system_lyxrc.roman_font_name) {
1706 os << "\\screen_font_roman \"" << roman_font_name
1712 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1713 if (ignore_system_lyxrc ||
1714 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1715 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1721 case RC_SCREEN_FONT_SANS:
1722 if (ignore_system_lyxrc ||
1723 sans_font_name != system_lyxrc.sans_font_name) {
1724 os << "\\screen_font_sans \"" << sans_font_name
1730 case RC_SCREEN_FONT_SANS_FOUNDRY:
1731 if (ignore_system_lyxrc ||
1732 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1733 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1739 case RC_SCREEN_FONT_TYPEWRITER:
1740 if (ignore_system_lyxrc ||
1741 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1742 os << "\\screen_font_typewriter \""
1743 << typewriter_font_name << "\"\n";
1748 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1749 if (ignore_system_lyxrc ||
1750 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1751 os << "\\screen_font_typewriter_foundry \""
1752 << typewriter_font_foundry << "\"\n";
1757 case RC_SCREEN_FONT_SCALABLE:
1758 if (ignore_system_lyxrc ||
1759 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1760 os << "\\screen_font_scalable "
1761 << convert<string>(use_scalable_fonts)
1767 case RC_SCREEN_FONT_SIZES:
1768 if (ignore_system_lyxrc ||
1769 font_sizes[TINY_SIZE]
1770 != system_lyxrc.font_sizes[TINY_SIZE] ||
1771 font_sizes[SCRIPT_SIZE]
1772 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1773 font_sizes[FOOTNOTE_SIZE]
1774 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1775 font_sizes[SMALL_SIZE]
1776 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1777 font_sizes[NORMAL_SIZE]
1778 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1779 font_sizes[LARGE_SIZE]
1780 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1781 font_sizes[LARGER_SIZE]
1782 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1783 font_sizes[LARGEST_SIZE]
1784 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1785 font_sizes[HUGE_SIZE]
1786 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1787 font_sizes[HUGER_SIZE]
1788 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1789 streamsize old_prec = os.precision();
1790 os.setf(ios::fixed);
1792 os << "\\screen_font_sizes"
1793 << ' ' << font_sizes[TINY_SIZE]
1794 << ' ' << font_sizes[SCRIPT_SIZE]
1795 << ' ' << font_sizes[FOOTNOTE_SIZE]
1796 << ' ' << font_sizes[SMALL_SIZE]
1797 << ' ' << font_sizes[NORMAL_SIZE]
1798 << ' ' << font_sizes[LARGE_SIZE]
1799 << ' ' << font_sizes[LARGER_SIZE]
1800 << ' ' << font_sizes[LARGEST_SIZE]
1801 << ' ' << font_sizes[HUGE_SIZE]
1802 << ' ' << font_sizes[HUGER_SIZE]
1804 os.precision(old_prec);
1805 os.unsetf(ios::fixed);
1810 case RC_FULL_SCREEN_LIMIT:
1811 if (ignore_system_lyxrc ||
1812 full_screen_limit != system_lyxrc.full_screen_limit) {
1813 os << "\\fullscreen_limit "
1814 << convert<string>(full_screen_limit)
1820 case RC_FULL_SCREEN_TOOLBARS:
1821 if (ignore_system_lyxrc ||
1822 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1823 os << "\\fullscreen_toolbars "
1824 << convert<string>(full_screen_toolbars)
1830 case RC_FULL_SCREEN_SCROLLBAR:
1831 if (ignore_system_lyxrc ||
1832 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1833 os << "\\fullscreen_scrollbar "
1834 << convert<string>(full_screen_scrollbar)
1840 case RC_FULL_SCREEN_STATUSBAR:
1841 if (ignore_system_lyxrc ||
1842 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1843 os << "\\fullscreen_statusbar "
1844 << convert<string>(full_screen_statusbar)
1850 case RC_FULL_SCREEN_TABBAR:
1851 if (ignore_system_lyxrc ||
1852 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1853 os << "\\fullscreen_tabbar "
1854 << convert<string>(full_screen_tabbar)
1860 case RC_FULL_SCREEN_MENUBAR:
1861 if (ignore_system_lyxrc ||
1862 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1863 os << "\\fullscreen_menubar "
1864 << convert<string>(full_screen_menubar)
1870 case RC_FULL_SCREEN_WIDTH:
1871 if (ignore_system_lyxrc ||
1872 full_screen_width != system_lyxrc.full_screen_width) {
1873 os << "\\fullscreen_width "
1874 << convert<string>(full_screen_width)
1880 case RC_OPEN_BUFFERS_IN_TABS:
1881 if (ignore_system_lyxrc ||
1882 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1883 os << "\\open_buffers_in_tabs "
1884 << convert<string>(open_buffers_in_tabs)
1890 case RC_SINGLE_CLOSE_TAB_BUTTON:
1891 if (ignore_system_lyxrc ||
1892 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1893 os << "\\single_close_tab_button "
1894 << convert<string>(single_close_tab_button)
1900 case RC_SINGLE_INSTANCE:
1901 if (ignore_system_lyxrc ||
1902 single_instance != system_lyxrc.single_instance) {
1903 os << "\\single_instance "
1904 << convert<string>(single_instance)
1910 case RC_FORWARD_SEARCH_DVI:
1911 if (ignore_system_lyxrc ||
1912 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1913 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1918 case RC_FORWARD_SEARCH_PDF:
1919 if (ignore_system_lyxrc ||
1920 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1921 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1927 << "# COLOR SECTION ###################################\n"
1932 for (int i = 0; i < Color_ignore; ++i) {
1933 ColorCode lc = static_cast<ColorCode>(i);
1934 string const col = lcolor.getX11Name(lc);
1935 if (ignore_system_lyxrc
1936 || col != system_lcolor.getX11Name(lc)) {
1937 os << "\\set_color \""
1938 << lcolor.getLyXName(lc) << "\" \""
1946 << "# PRINTER SECTION ###################################\n"
1950 case RC_PRINTLANDSCAPEFLAG:
1951 if (ignore_system_lyxrc ||
1952 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1953 os << "\\print_landscape_flag \"" << print_landscape_flag
1959 case RC_PRINTPAPERFLAG:
1960 if (ignore_system_lyxrc ||
1961 print_paper_flag != system_lyxrc.print_paper_flag) {
1962 os << "\\print_paper_flag \"" << print_paper_flag
1968 case RC_PRINTPAPERDIMENSIONFLAG:
1969 if (ignore_system_lyxrc ||
1970 print_paper_dimension_flag
1971 != system_lyxrc.print_paper_dimension_flag) {
1972 os << "\\print_paper_dimension_flag \""
1973 << print_paper_dimension_flag << "\"\n";
1979 << "# TEX SECTION #######################################\n"
1983 case RC_TEXINPUTS_PREFIX:
1984 if (ignore_system_lyxrc ||
1985 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1986 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1992 << "# FILE SECTION ######################################\n"
1995 case RC_DOCUMENTPATH:
1996 if (ignore_system_lyxrc ||
1997 document_path != system_lyxrc.document_path) {
1998 string const path = os::external_path(document_path);
1999 os << "\\document_path \"" << path << "\"\n";
2004 case RC_USELASTFILEPOS:
2005 if (ignore_system_lyxrc ||
2006 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2007 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2013 case RC_LOADSESSION:
2014 if (ignore_system_lyxrc ||
2015 load_session != system_lyxrc.load_session) {
2016 os << "\\load_session " << convert<string>(load_session)
2022 case RC_MOUSE_WHEEL_SPEED:
2023 if (ignore_system_lyxrc ||
2024 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2025 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2030 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2031 if (ignore_system_lyxrc ||
2032 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2033 os << "\\mouse_middlebutton_paste "
2034 << convert<string>(mouse_middlebutton_paste) << '\n';
2039 case RC_COMPLETION_INLINE_DELAY:
2040 if (ignore_system_lyxrc ||
2041 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2042 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2047 case RC_COMPLETION_INLINE_MATH:
2048 if (ignore_system_lyxrc ||
2049 completion_inline_math != system_lyxrc.completion_inline_math) {
2050 os << "\\completion_inline_math "
2051 << convert<string>(completion_inline_math) << '\n';
2056 case RC_COMPLETION_INLINE_TEXT:
2057 if (ignore_system_lyxrc ||
2058 completion_inline_text != system_lyxrc.completion_inline_text) {
2059 os << "\\completion_inline_text "
2060 << convert<string>(completion_inline_text) << '\n';
2065 case RC_COMPLETION_INLINE_DOTS:
2066 if (ignore_system_lyxrc ||
2067 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2068 os << "\\completion_inline_dots "
2069 << convert<string>(completion_inline_dots) << '\n';
2074 case RC_AUTOCORRECTION_MATH:
2075 if (ignore_system_lyxrc ||
2076 autocorrection_math != system_lyxrc.autocorrection_math) {
2077 os << "\\autocorrection_math "
2078 << convert<string>(autocorrection_math) << '\n';
2083 case RC_COMPLETION_POPUP_DELAY:
2084 if (ignore_system_lyxrc ||
2085 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2086 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2091 case RC_COMPLETION_POPUP_MATH:
2092 if (ignore_system_lyxrc ||
2093 completion_popup_math != system_lyxrc.completion_popup_math) {
2094 os << "\\completion_popup_math "
2095 << convert<string>(completion_popup_math) << '\n';
2100 case RC_COMPLETION_POPUP_TEXT:
2101 if (ignore_system_lyxrc ||
2102 completion_popup_text != system_lyxrc.completion_popup_text) {
2103 os << "\\completion_popup_text "
2104 << convert<string>(completion_popup_text) << '\n';
2109 case RC_COMPLETION_CURSOR_TEXT:
2110 if (ignore_system_lyxrc ||
2111 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2112 os << "\\completion_cursor_text "
2113 << convert<string>(completion_cursor_text) << '\n';
2118 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2119 if (ignore_system_lyxrc ||
2120 completion_popup_after_complete
2121 != system_lyxrc.completion_popup_after_complete) {
2122 os << "\\completion_popup_after_complete "
2123 << convert<string>(completion_popup_after_complete) << '\n';
2128 case RC_COMPLETION_MINLENGTH:
2129 if (ignore_system_lyxrc ||
2130 completion_minlength != system_lyxrc.completion_minlength) {
2131 os << "\\completion_minlength " << convert<string>(completion_minlength)
2137 case RC_NUMLASTFILES:
2138 if (ignore_system_lyxrc ||
2139 num_lastfiles != system_lyxrc.num_lastfiles) {
2140 os << "\\num_lastfiles " << num_lastfiles << '\n';
2145 case RC_CHECKLASTFILES:
2146 if (ignore_system_lyxrc ||
2147 check_lastfiles != system_lyxrc.check_lastfiles) {
2148 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2154 case RC_EXAMPLEPATH:
2155 if (ignore_system_lyxrc ||
2156 example_path != system_lyxrc.example_path) {
2157 string const path = os::external_path(example_path);
2158 os << "\\example_path \"" << path << "\"\n";
2163 case RC_TEMPLATEPATH:
2164 if (ignore_system_lyxrc ||
2165 template_path != system_lyxrc.template_path) {
2166 string const path = os::external_path(template_path);
2167 os << "\\template_path \"" << path << "\"\n";
2172 case RC_TEMPDIRPATH:
2173 if (ignore_system_lyxrc ||
2174 tempdir_path != system_lyxrc.tempdir_path) {
2175 string const path = os::external_path(tempdir_path);
2176 os << "\\tempdir_path \"" << path << "\"\n";
2181 case RC_THESAURUSDIRPATH:
2182 if (ignore_system_lyxrc ||
2183 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2184 string const path = os::external_path(thesaurusdir_path);
2185 os << "\\thesaurusdir_path \"" << path << "\"\n";
2190 case RC_HUNSPELLDIR_PATH:
2191 if (ignore_system_lyxrc ||
2192 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2193 string const path = os::external_path(hunspelldir_path);
2194 os << "\\hunspelldir_path \"" << path << "\"\n";
2199 case RC_PLAINTEXT_LINELEN:
2200 if (ignore_system_lyxrc ||
2201 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2202 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2207 case RC_MAKE_BACKUP:
2208 if (ignore_system_lyxrc ||
2209 make_backup != system_lyxrc.make_backup) {
2210 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2215 case RC_SAVE_COMPRESSED:
2216 if (ignore_system_lyxrc ||
2217 save_compressed != system_lyxrc.save_compressed) {
2218 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2223 case RC_SAVE_ORIGIN:
2224 if (ignore_system_lyxrc ||
2225 save_origin != system_lyxrc.save_origin) {
2226 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2231 case RC_BACKUPDIR_PATH:
2232 if (ignore_system_lyxrc ||
2233 backupdir_path != system_lyxrc.backupdir_path) {
2234 string const path = os::external_path(backupdir_path);
2235 os << "\\backupdir_path \"" << path << "\"\n";
2241 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2245 << "# SPELLCHECKER SECTION ##############################\n"
2249 case RC_ACCEPT_COMPOUND:
2250 if (ignore_system_lyxrc ||
2251 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2252 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2259 if (ignore_system_lyxrc ||
2260 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2261 os << "\\alternate_language \"" << spellchecker_alt_lang
2268 if (ignore_system_lyxrc ||
2269 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2270 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2275 case RC_USE_NATIVE_FILEDIALOG:
2276 if (ignore_system_lyxrc ||
2277 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2278 os << "\\use_native_filedialog "
2279 << convert<string>(use_native_filedialog)
2285 case RC_USE_SYSTEM_COLORS:
2286 if (ignore_system_lyxrc ||
2287 use_system_colors != system_lyxrc.use_system_colors) {
2288 os << "\\use_system_colors "
2289 << convert<string>(use_system_colors)
2295 case RC_USE_TOOLTIP:
2296 if (ignore_system_lyxrc ||
2297 use_tooltip != system_lyxrc.use_tooltip) {
2298 os << "\\use_tooltip "
2299 << convert<string>(use_tooltip)
2307 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2311 case RC_DEFAULT_DECIMAL_SEP:
2312 if (ignore_system_lyxrc ||
2313 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2314 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2319 case RC_DEFAULT_LENGTH_UNIT:
2320 if (ignore_system_lyxrc ||
2321 default_length_unit != system_lyxrc.default_length_unit) {
2322 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2327 case RC_SPELLCHECKER:
2328 if (ignore_system_lyxrc ||
2329 spellchecker != system_lyxrc.spellchecker) {
2330 os << "\\spellchecker " << spellchecker << '\n';
2335 case RC_SPELLCHECK_CONTINUOUSLY:
2336 if (ignore_system_lyxrc ||
2337 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2338 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2344 case RC_SPELLCHECK_NOTES:
2345 if (ignore_system_lyxrc ||
2346 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2347 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2353 case RC_VISUAL_CURSOR:
2354 if (ignore_system_lyxrc ||
2355 visual_cursor != system_lyxrc.visual_cursor) {
2356 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2361 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2362 if (ignore_system_lyxrc ||
2363 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2364 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2365 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2370 case RC_LANGUAGE_CUSTOM_PACKAGE:
2371 if (ignore_system_lyxrc ||
2372 language_custom_package != system_lyxrc.language_custom_package) {
2373 os << "\\language_custom_package \"" << language_custom_package
2379 case RC_LANGUAGE_GLOBAL_OPTIONS:
2380 if (ignore_system_lyxrc ||
2381 language_global_options
2382 != system_lyxrc.language_global_options) {
2383 os << "\\language_global_options \""
2384 << convert<string>(language_global_options)
2390 case RC_LANGUAGE_PACKAGE_SELECTION:
2391 if (ignore_system_lyxrc ||
2392 language_package_selection != system_lyxrc.language_package_selection) {
2393 os << "\\language_package_selection ";
2394 switch (language_package_selection) {
2412 case RC_LANGUAGE_COMMAND_BEGIN:
2413 if (ignore_system_lyxrc ||
2414 language_command_begin
2415 != system_lyxrc.language_command_begin) {
2416 os << "\\language_command_begin \""
2417 << language_command_begin
2423 case RC_LANGUAGE_COMMAND_END:
2424 if (ignore_system_lyxrc ||
2425 language_command_end
2426 != system_lyxrc.language_command_end) {
2427 os << "\\language_command_end \"" << language_command_end
2433 case RC_LANGUAGE_COMMAND_LOCAL:
2434 if (ignore_system_lyxrc ||
2435 language_command_local
2436 != system_lyxrc.language_command_local) {
2437 os << "\\language_command_local \""
2438 << language_command_local
2444 case RC_LANGUAGE_AUTO_BEGIN:
2445 if (ignore_system_lyxrc ||
2446 language_auto_begin != system_lyxrc.language_auto_begin) {
2447 os << "\\language_auto_begin "
2448 << convert<string>(language_auto_begin) << '\n';
2453 case RC_LANGUAGE_AUTO_END:
2454 if (ignore_system_lyxrc ||
2455 language_auto_end != system_lyxrc.language_auto_end) {
2456 os << "\\language_auto_end "
2457 << convert<string>(language_auto_end) << '\n';
2462 case RC_MARK_FOREIGN_LANGUAGE:
2463 if (ignore_system_lyxrc ||
2464 mark_foreign_language
2465 != system_lyxrc.mark_foreign_language) {
2466 os << "\\mark_foreign_language " <<
2467 convert<string>(mark_foreign_language) << '\n';
2470 case RC_RESPECT_OS_KBD_LANGUAGE:
2471 if (ignore_system_lyxrc ||
2472 respect_os_kbd_language
2473 != system_lyxrc.respect_os_kbd_language) {
2474 os << "\\respect_os_kbd_language " <<
2475 convert<string>(respect_os_kbd_language) << '\n';
2482 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2486 case RC_AUTO_NUMBER:
2487 if (ignore_system_lyxrc ||
2488 auto_number != system_lyxrc.auto_number) {
2489 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2494 case RC_GUI_LANGUAGE:
2495 if (ignore_system_lyxrc ||
2496 gui_language != system_lyxrc.gui_language) {
2497 os << "\\gui_language " << gui_language << '\n';
2502 case RC_EXPORT_OVERWRITE:
2503 if (ignore_system_lyxrc ||
2504 export_overwrite != system_lyxrc.export_overwrite) {
2506 switch (export_overwrite) {
2517 os << "\\export_overwrite " << status << '\n';
2522 case RC_SCROLL_WHEEL_ZOOM:
2523 if (ignore_system_lyxrc ||
2524 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2526 switch (scroll_wheel_zoom) {
2527 case SCROLL_WHEEL_ZOOM_OFF:
2530 case SCROLL_WHEEL_ZOOM_CTRL:
2533 case SCROLL_WHEEL_ZOOM_SHIFT:
2536 case SCROLL_WHEEL_ZOOM_ALT:
2540 os << "\\scroll_wheel_zoom " << status << '\n';
2546 << "# FORMATS SECTION ##########################\n"
2551 // New/modified formats
2552 for (Formats::const_iterator cit = theFormats().begin();
2553 cit != theFormats().end(); ++cit) {
2554 Format const * format =
2555 theSystemFormats().getFormat(cit->name());
2557 format->extensions() != cit->extensions() ||
2558 format->prettyname() != cit->prettyname() ||
2559 format->shortcut() != cit->shortcut() ||
2560 format->viewer() != cit->viewer() ||
2561 format->editor() != cit->editor() ||
2562 format->documentFormat() != cit->documentFormat() ||
2563 format->vectorFormat() != cit->vectorFormat() ||
2564 format->inExportMenu() != cit->inExportMenu() ||
2565 format->noMenu() != cit->noMenu() ||
2566 format->mime() != cit->mime()) {
2567 os << "\\format \"" << cit->name() << "\" \""
2568 << cit->extensions() << "\" \""
2569 << to_utf8(cit->prettyname()) << "\" \""
2570 << cit->shortcut() << "\" \""
2571 << escapeCommand(cit->viewer()) << "\" \""
2572 << escapeCommand(cit->editor()) << "\" \"";
2573 vector<string> flags;
2574 if (cit->documentFormat())
2575 flags.push_back("document");
2576 if (cit->vectorFormat())
2577 flags.push_back("vector");
2578 if (cit->zippedNative())
2579 flags.push_back("zipped=native");
2580 if (cit->inExportMenu())
2581 flags.push_back("menu=export");
2583 os << getStringFromVector(flags);
2584 os << "\" \"" << cit->mime() << "\"\n";
2588 // Look for deleted formats
2589 for (Formats::const_iterator cit = theSystemFormats().begin();
2590 cit != theSystemFormats().end(); ++cit)
2591 if (!theFormats().getFormat(cit->name()))
2592 os << "\\format \"" << cit->name()
2593 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2597 case RC_VIEWER_ALTERNATIVES: {
2598 Alternatives::const_iterator it = viewer_alternatives.begin();
2599 Alternatives::const_iterator const en = viewer_alternatives.end();
2600 Alternatives::const_iterator const sysend =
2601 system_lyxrc.viewer_alternatives.end();
2602 for (; it != en; ++it) {
2603 string const & fmt = it->first;
2604 CommandSet const & cmd = it->second;
2605 CommandSet::const_iterator sit = cmd.begin();
2606 CommandSet::const_iterator const sen = cmd.end();
2607 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2608 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2609 system_lyxrc.viewer_alternatives.find(fmt);
2610 for (; sit != sen; ++sit) {
2611 string const & cmd = *sit;
2612 if (ignore_system_lyxrc
2613 || sysfmt == sysend // format not found
2614 || sysfmt->second.count(cmd) == 0 // this command not found
2616 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2623 case RC_EDITOR_ALTERNATIVES: {
2624 Alternatives::const_iterator it = editor_alternatives.begin();
2625 Alternatives::const_iterator const en = editor_alternatives.end();
2626 Alternatives::const_iterator const sysend =
2627 system_lyxrc.editor_alternatives.end();
2628 for (; it != en; ++it) {
2629 string const & fmt = it->first;
2630 CommandSet const & cmd = it->second;
2631 CommandSet::const_iterator sit = cmd.begin();
2632 CommandSet::const_iterator const sen = cmd.end();
2633 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2634 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2635 system_lyxrc.editor_alternatives.find(fmt);
2636 for (; sit != sen; ++sit) {
2637 string const & cmd = *sit;
2638 if (ignore_system_lyxrc
2639 || sysfmt == sysend // format not found
2640 || sysfmt->second.count(cmd) == 0 // this command not found
2642 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2649 case RC_DEFAULT_OTF_VIEW_FORMAT:
2650 if ((ignore_system_lyxrc ||
2651 default_otf_view_format != system_lyxrc.default_otf_view_format)
2652 && !default_otf_view_format.empty()) {
2653 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2658 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2659 if ((ignore_system_lyxrc ||
2660 default_platex_view_format != system_lyxrc.default_platex_view_format)
2661 && !default_platex_view_format.empty()) {
2662 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2667 case RC_DEFAULT_VIEW_FORMAT:
2668 if (ignore_system_lyxrc ||
2669 default_view_format != system_lyxrc.default_view_format) {
2670 os << "\\default_view_format " << default_view_format << '\n';
2681 << "# CONVERTERS SECTION ##########################\n"
2686 // Look for new converters
2687 for (Converters::const_iterator cit = theConverters().begin();
2688 cit != theConverters().end(); ++cit) {
2689 Converter const * converter =
2690 theSystemConverters().getConverter(cit->from(),
2693 converter->command() != cit->command() ||
2694 converter->flags() != cit->flags())
2695 os << "\\converter \"" << cit->from() << "\" \""
2696 << cit->to() << "\" \""
2697 << escapeCommand(cit->command()) << "\" \""
2698 << cit->flags() << "\"\n";
2701 // New/modifed converters
2702 for (Converters::const_iterator cit = theSystemConverters().begin();
2703 cit != theSystemConverters().end(); ++cit)
2704 if (!theConverters().getConverter(cit->from(), cit->to()))
2705 os << "\\converter \"" << cit->from()
2706 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2713 << "# COPIERS SECTION ##########################\n"
2716 // Look for new movers
2717 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2718 Movers::const_iterator const sysend = theSystemMovers().end();
2719 Movers::const_iterator it = theMovers().begin();
2720 Movers::const_iterator end = theMovers().end();
2722 for (; it != end; ++it) {
2723 Movers::const_iterator const sysit =
2724 find_if(sysbegin, sysend, SameMover(*it));
2725 if (sysit == sysend) {
2726 string const & fmt = it->first;
2727 string const & command =
2728 it->second.command();
2730 os << "\\copier " << fmt
2731 << " \"" << escapeCommand(command) << "\"\n";
2737 // We don't actually delete SpecialisedMover(s) from the
2738 // map, just clear their 'command', so there's no need
2739 // to test for anything else.
2746 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2748 // Why the switch you might ask. It is a trick to ensure that all
2749 // the elements in the LyXRCTags enum is handled. As you can see
2750 // there are no breaks at all. So it is just a huge fall-through.
2751 // The nice thing is that we will get a warning from the compiler
2752 // if we forget an element.
2753 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2755 case LyXRC::RC_LAST:
2756 case LyXRC::RC_ACCEPT_COMPOUND:
2757 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2758 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2760 case LyXRC::RC_ALT_LANG:
2761 case LyXRC::RC_PLAINTEXT_LINELEN:
2762 case LyXRC::RC_AUTOCORRECTION_MATH:
2763 case LyXRC::RC_AUTOREGIONDELETE:
2764 case LyXRC::RC_AUTORESET_OPTIONS:
2765 case LyXRC::RC_AUTOSAVE:
2766 case LyXRC::RC_AUTO_NUMBER:
2767 case LyXRC::RC_BACKUPDIR_PATH:
2768 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2769 case LyXRC::RC_BIBTEX_COMMAND:
2770 case LyXRC::RC_BINDFILE:
2771 case LyXRC::RC_CHECKLASTFILES:
2772 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2773 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2774 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2775 case LyXRC::RC_COMPLETION_INLINE_MATH:
2776 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2777 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2778 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2779 case LyXRC::RC_COMPLETION_POPUP_MATH:
2780 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2781 case LyXRC::RC_COMPLETION_MINLENGTH:
2782 case LyXRC::RC_USELASTFILEPOS:
2783 case LyXRC::RC_LOADSESSION:
2784 case LyXRC::RC_CHKTEX_COMMAND:
2785 case LyXRC::RC_CONVERTER:
2786 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2787 case LyXRC::RC_COPIER:
2788 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2789 case LyXRC::RC_CT_MARKUP_COPIED:
2790 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2791 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2792 case LyXRC::RC_GUI_LANGUAGE:
2793 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2794 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2795 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2796 case LyXRC::RC_DEFFILE:
2797 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2798 case LyXRC::RC_DISPLAY_GRAPHICS:
2799 case LyXRC::RC_DOCUMENTPATH:
2800 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2801 FileName path(lyxrc_new.document_path);
2802 if (path.exists() && path.isDirectory())
2803 package().document_dir() = FileName(lyxrc.document_path);
2806 case LyXRC::RC_EDITOR_ALTERNATIVES:
2807 case LyXRC::RC_ESC_CHARS:
2808 case LyXRC::RC_EXAMPLEPATH:
2809 case LyXRC::RC_FILEFORMAT:
2810 case LyXRC::RC_GROUP_LAYOUTS:
2811 case LyXRC::RC_HUNSPELLDIR_PATH:
2812 case LyXRC::RC_ICON_SET:
2813 case LyXRC::RC_INDEX_ALTERNATIVES:
2814 case LyXRC::RC_INDEX_COMMAND:
2815 case LyXRC::RC_JBIBTEX_COMMAND:
2816 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2817 case LyXRC::RC_JINDEX_COMMAND:
2818 case LyXRC::RC_NOMENCL_COMMAND:
2819 case LyXRC::RC_PYGMENTIZE_COMMAND:
2820 case LyXRC::RC_INPUT:
2821 case LyXRC::RC_KBMAP:
2822 case LyXRC::RC_KBMAP_PRIMARY:
2823 case LyXRC::RC_KBMAP_SECONDARY:
2824 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2825 case LyXRC::RC_LANGUAGE_AUTO_END:
2826 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2827 case LyXRC::RC_LANGUAGE_COMMAND_END:
2828 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2829 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2830 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2831 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2832 case LyXRC::RC_LYXRCFORMAT:
2833 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2834 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2835 case LyXRC::RC_MACRO_EDIT_STYLE:
2836 case LyXRC::RC_MAKE_BACKUP:
2837 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2838 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2839 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2840 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2841 case LyXRC::RC_NUMLASTFILES:
2842 case LyXRC::RC_PARAGRAPH_MARKERS:
2843 case LyXRC::RC_PATH_PREFIX:
2844 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2845 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2846 // Resets python path
2847 support::os::python(true);
2850 case LyXRC::RC_PREVIEW:
2851 if (lyxrc_orig.preview != lyxrc_new.preview) {
2852 // Update all previews of all documents.
2853 /* FIXME: this can be very expensive. It would be cheaper
2854 * to kill all existing previews and update visible
2856 theBufferList().updatePreviews();
2859 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2860 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2861 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2862 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2863 case LyXRC::RC_PRINTPAPERFLAG:
2864 case LyXRC::RC_SAVE_COMPRESSED:
2865 case LyXRC::RC_SAVE_ORIGIN:
2866 case LyXRC::RC_SCREEN_DPI:
2868 case LyXRC::RC_SCREEN_FONT_ROMAN:
2869 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2870 case LyXRC::RC_SCREEN_FONT_SANS:
2871 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2872 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2873 case LyXRC::RC_SCREEN_FONT_SIZES:
2874 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2875 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2876 case LyXRC::RC_SCREEN_ZOOM:
2877 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2878 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2879 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2880 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2881 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2882 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2883 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2884 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2885 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2886 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2889 case LyXRC::RC_GEOMETRY_SESSION:
2890 case LyXRC::RC_SERVERPIPE:
2891 case LyXRC::RC_SET_COLOR:
2892 case LyXRC::RC_SHOW_BANNER:
2893 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2894 case LyXRC::RC_SPELLCHECKER:
2895 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2898 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2899 case LyXRC::RC_SPELLCHECK_NOTES:
2900 case LyXRC::RC_SPLITINDEX_COMMAND:
2901 case LyXRC::RC_TEMPDIRPATH:
2902 case LyXRC::RC_TEMPLATEPATH:
2903 case LyXRC::RC_TEX_ALLOWS_SPACES:
2904 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2905 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2906 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2909 case LyXRC::RC_TEXINPUTS_PREFIX:
2910 case LyXRC::RC_THESAURUSDIRPATH:
2911 case LyXRC::RC_UIFILE:
2912 case LyXRC::RC_USER_EMAIL:
2913 case LyXRC::RC_USER_INITIALS:
2914 case LyXRC::RC_USER_NAME:
2915 case LyXRC::RC_USE_CONVERTER_CACHE:
2916 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2917 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2918 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2919 case LyXRC::RC_USE_SYSTEM_COLORS:
2920 case LyXRC::RC_USE_TOOLTIP:
2921 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2922 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2923 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2924 case LyXRC::RC_SINGLE_INSTANCE:
2925 case LyXRC::RC_SORT_LAYOUTS:
2926 case LyXRC::RC_FULL_SCREEN_LIMIT:
2927 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2928 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2929 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2930 case LyXRC::RC_FULL_SCREEN_TABBAR:
2931 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2932 case LyXRC::RC_FULL_SCREEN_WIDTH:
2933 case LyXRC::RC_VISUAL_CURSOR:
2934 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2935 case LyXRC::RC_VIEWER:
2936 case LyXRC::RC_VIEWER_ALTERNATIVES:
2937 case LyXRC::RC_FORWARD_SEARCH_DVI:
2938 case LyXRC::RC_FORWARD_SEARCH_PDF:
2939 case LyXRC::RC_EXPORT_OVERWRITE:
2940 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2941 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2942 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2943 case LyXRC::RC_CURSOR_WIDTH:
2949 set<string> LyXRC::getRCs()
2952 for (int i = 0; i != lyxrcCount; ++i)
2953 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2959 string const LyXRC::getDescription(LyXRCTags tag)
2964 case RC_ACCEPT_COMPOUND:
2965 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2969 str = _("Specify an alternate language. The default is to use the language of the document.");
2972 case RC_PLAINTEXT_LINELEN:
2973 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.");
2976 case RC_AUTOREGIONDELETE:
2977 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2980 case RC_AUTORESET_OPTIONS:
2981 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2985 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2988 case RC_AUTO_NUMBER:
2991 case RC_BACKUPDIR_PATH:
2992 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.");
2995 case RC_BIBTEX_COMMAND:
2996 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2999 case RC_JBIBTEX_COMMAND:
3000 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3004 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3007 case RC_CHECKLASTFILES:
3008 str = _("Select to check whether the lastfiles still exist.");
3011 case RC_CHKTEX_COMMAND:
3012 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3018 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3019 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3022 case RC_CONVERTER_NEEDAUTH:
3023 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3029 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3030 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.");
3033 case RC_CURSOR_WIDTH:
3034 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3037 case RC_SCROLL_BELOW_DOCUMENT:
3038 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");
3041 case RC_MAC_DONTSWAP_CTRL_META:
3042 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3045 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3046 str = _("Use the Mac OS X conventions for cursor movement");
3049 case RC_SHOW_MACRO_LABEL:
3050 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3054 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3057 case RC_DEFAULT_OTF_VIEW_FORMAT:
3058 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3061 case RC_DEFAULT_VIEW_FORMAT:
3062 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3065 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3066 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3069 case RC_DISPLAY_GRAPHICS:
3070 str = _("Select how LyX will display any graphics.");
3073 case RC_DOCUMENTPATH:
3074 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3078 str = _("Specify additional chars that can be part of a word.");
3081 case RC_EXAMPLEPATH:
3082 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3088 case RC_INDEX_COMMAND:
3089 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\".");
3092 case RC_JINDEX_COMMAND:
3093 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3096 case RC_NOMENCL_COMMAND:
3097 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3100 case RC_PYGMENTIZE_COMMAND:
3101 str = _("The command to run the python pygments syntax highlighter.");
3108 case RC_KBMAP_PRIMARY:
3109 case RC_KBMAP_SECONDARY:
3110 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.");
3113 case RC_LANGUAGE_AUTO_BEGIN:
3114 str = _("Select if a language switching command is needed at the beginning of the document.");
3117 case RC_LANGUAGE_AUTO_END:
3118 str = _("Select if a language switching command is needed at the end of the document.");
3121 case RC_LANGUAGE_COMMAND_BEGIN:
3122 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.");
3125 case RC_LANGUAGE_COMMAND_END:
3126 str = _("The LaTeX command for changing back to the language of the document.");
3129 case RC_LANGUAGE_COMMAND_LOCAL:
3130 str = _("The LaTeX command for local changing of the language.");
3133 case RC_LANGUAGE_GLOBAL_OPTIONS:
3134 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3137 case RC_LANGUAGE_CUSTOM_PACKAGE:
3138 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3141 case RC_LANGUAGE_PACKAGE_SELECTION:
3142 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3145 case RC_USELASTFILEPOS:
3146 str = _("De-select if you do not want LyX to scroll to saved position.");
3149 case RC_LOADSESSION:
3150 str = _("De-select to prevent loading files opened from the last LyX session.");
3153 case RC_MAKE_BACKUP:
3154 str = _("De-select if you don't want LyX to create backup files.");
3157 case RC_MARK_FOREIGN_LANGUAGE:
3158 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3161 case RC_RESPECT_OS_KBD_LANGUAGE:
3162 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3165 case RC_MOUSE_WHEEL_SPEED:
3166 str = _("The scrolling speed of the mouse wheel.");
3169 case RC_COMPLETION_POPUP_DELAY:
3170 str = _("The completion popup delay.");
3173 case RC_COMPLETION_POPUP_MATH:
3174 str = _("Select to display the completion popup in math mode.");
3177 case RC_COMPLETION_POPUP_TEXT:
3178 str = _("Select to display the completion popup in text mode.");
3181 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3182 str = _("Show the completion popup without delay after non-unique completion attempt.");
3185 case RC_COMPLETION_POPUP_TEXT:
3186 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3189 case RC_COMPLETION_POPUP_DELAY:
3190 str = _("The inline completion delay.");
3193 case RC_COMPLETION_INLINE_MATH:
3194 str = _("Select to display the inline completion in math mode.");
3197 case RC_COMPLETION_INLINE_TEXT:
3198 str = _("Select to display the inline completion in text mode.");
3201 case RC_COMPLETION_INLINE_DOTS:
3202 str = _("Use \"...\" to shorten long completions.");
3205 case RC_AUTOCORRECTION_MATH:
3206 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3209 case RC_NUMLASTFILES:
3210 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3214 case RC_PATH_PREFIX:
3215 str = _("Specify those directories which should be "
3216 "prepended to the PATH environment variable.\n"
3217 "Use the OS native format.");
3221 str = _("Shows a typeset preview of things such as math");
3224 case RC_PREVIEW_HASHED_LABELS:
3225 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3228 case RC_PREVIEW_SCALE_FACTOR:
3229 str = _("Scale the preview size to suit.");
3232 case RC_PRINTLANDSCAPEFLAG:
3233 str = _("The option to print out in landscape.");
3236 case RC_PRINTPAPERDIMENSIONFLAG:
3237 str = _("Option to specify the dimensions of the print paper.");
3240 case RC_PRINTPAPERFLAG:
3241 str = _("The option to specify paper type.");
3244 case RC_VISUAL_CURSOR:
3245 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3248 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3249 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).");
3253 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3256 case RC_SCREEN_FONT_ROMAN:
3257 case RC_SCREEN_FONT_SANS:
3258 case RC_SCREEN_FONT_TYPEWRITER:
3259 str = _("The screen fonts used to display the text while editing.");
3262 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3263 case RC_SCREEN_FONT_SANS_FOUNDRY:
3264 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3267 case RC_SCREEN_FONT_SCALABLE:
3268 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.");
3271 case RC_SCREEN_FONT_SIZES:
3272 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3275 case RC_SCREEN_ZOOM:
3276 //xgettext:no-c-format
3277 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3280 case RC_GEOMETRY_SESSION:
3281 str = _("Allow session manager to save and restore windows geometry.");
3285 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3291 case RC_SHOW_BANNER:
3292 str = _("De-select if you don't want the startup banner.");
3295 case RC_TEMPDIRPATH:
3296 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3299 case RC_THESAURUSDIRPATH:
3300 str = _("This is the place where the files of the thesaurus library reside.");
3303 case RC_TEMPLATEPATH:
3304 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3307 case RC_TEX_ALLOWS_SPACES:
3310 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3313 case RC_TEXINPUTS_PREFIX:
3314 str = _("Specify those directories which should be "
3315 "prepended to the TEXINPUTS environment variable.\n"
3316 "A '.' represents the current document directory. "
3317 "Use the OS native format.");
3321 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3330 case RC_USE_USE_SYSTEM_COLORS:
3331 str = _("Enable use the system colors for some things like main window background and selection.");
3334 case RC_USE_TOOLTIP:
3335 str = _("Enable the automatic appearance of tool tips in the work area.");
3338 case RC_VIEWDVI_PAPEROPTION:
3339 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3354 // The global instance
3357 // The global copy of the system lyxrc entries (everything except preferences)