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 = 33; // sanda: add \citation_search_view
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 { "\\citation_search_view", LyXRC::RC_CITATION_SEARCH_VIEW },
82 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
83 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
84 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
85 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
86 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
87 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
88 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
89 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
90 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
91 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
92 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
93 { "\\converter", LyXRC::RC_CONVERTER },
94 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
95 { "\\copier", LyXRC::RC_COPIER },
96 { "\\ct_additions_underlined", LyXRC::RC_CT_ADDITIONS_UNDERLINED },
97 { "\\ct_markup_copied", LyXRC::RC_CT_MARKUP_COPIED },
98 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
99 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
100 { "\\def_file", LyXRC::RC_DEFFILE },
101 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_SEP },
102 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
103 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
104 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
105 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
106 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
107 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
108 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
109 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
110 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
111 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
112 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
113 { "\\format", LyXRC::RC_FILEFORMAT },
114 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
115 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
116 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
117 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
118 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
119 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
120 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
121 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
122 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
123 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
124 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
125 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
126 { "\\icon_set", LyXRC::RC_ICON_SET },
127 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
128 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
129 { "\\input", LyXRC::RC_INPUT },
130 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
131 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
132 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
133 { "\\kbmap", LyXRC::RC_KBMAP },
134 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
135 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
136 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
137 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
138 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
139 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
140 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
141 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
142 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
143 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
144 { "\\load_session", LyXRC::RC_LOADSESSION },
145 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
146 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
147 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
148 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
149 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
150 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
151 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
152 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
153 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
154 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
155 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
156 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
157 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
158 { "\\preview", LyXRC::RC_PREVIEW },
159 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
160 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
161 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
162 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
163 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
164 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
165 { "\\respect_os_kbd_language", LyXRC::RC_RESPECT_OS_KBD_LANGUAGE },
166 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
167 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
168 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
169 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
170 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
171 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
172 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
173 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
174 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
175 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
176 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
177 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
178 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
179 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
180 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
181 { "\\set_color", LyXRC::RC_SET_COLOR },
182 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
183 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
184 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
185 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
186 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
187 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
188 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
189 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
190 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
191 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
192 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
193 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
194 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
195 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
196 { "\\ui_file", LyXRC::RC_UIFILE },
197 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
198 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
199 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
200 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
201 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
202 // compatibility with versions older than 1.4.0 only
203 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
204 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
205 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
206 { "\\user_email", LyXRC::RC_USER_EMAIL },
207 { "\\user_initials", LyXRC::RC_USER_INITIALS },
208 { "\\user_name", LyXRC::RC_USER_NAME },
209 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
210 // compatibility with versions older than 1.4.0 only
211 { "\\viewer", LyXRC::RC_VIEWER},
212 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
213 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
214 { "format", LyXRC::RC_LYXRCFORMAT }
217 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
220 void oldFontFormat(string & family, string & foundry)
222 if (family.empty() || family[0] != '-')
224 foundry = token(family, '-', 1);
225 family = token(family, '-', 2);
233 bool LyXRC::read(FileName const & filename, bool check_format)
235 Lexer lexrc(lyxrcTags);
236 lexrc.setFile(filename);
237 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
238 ReturnValues retval = read(lexrc, check_format);
239 if (!check_format || retval != FormatMismatch)
240 return retval == ReadOK;
242 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
243 TempFile tmp("convert_lyxrc");
244 FileName const tempfile = tmp.name();
245 bool const success = prefs2prefs(filename, tempfile, false);
247 LYXERR0 ("Unable to convert " << filename.absFileName() <<
248 " to format " << LYXRC_FILEFORMAT);
251 // Keep this in the else branch, such that lexrc2 goes out
252 // of scope and releases the lock on tempfile before we
253 // attempt to remove it. This matters on Windows.
254 Lexer lexrc2(lyxrcTags);
255 lexrc2.setFile(tempfile);
256 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
257 retval = read(lexrc2, check_format);
258 if (retval == FormatMismatch)
259 LYXERR0("Conversion failed for " << filename.absFileName());
261 return retval == ReadOK;
265 // don't need to worry about conversion, because this is always
266 // from an internal source
267 bool LyXRC::read(istream & is)
269 Lexer lexrc(lyxrcTags);
271 LYXERR(Debug::LYXRC, "Reading istream...");
272 return read(lexrc, false) == ReadOK;
276 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
278 if (lyxerr.debugging(Debug::PARSER))
279 lexrc.printTable(lyxerr);
284 // format prior to 2.0 and introduction of format tag
285 unsigned int rc_format = 0;
287 while (lexrc.isOK()) {
288 // By using two switches we take advantage of the compiler
289 // telling us if we have missed a LyXRCTags element in
290 // the second switch.
291 // Note that this also shows a problem with Lexer since it
292 // helps us avoid taking advantage of the strictness of the
295 int le = lexrc.lex();
297 case Lexer::LEX_UNDEF:
298 lexrc.printError("Unknown tag `$$Token'");
300 case Lexer::LEX_FEOF:
305 switch (static_cast<LyXRCTags>(le)) {
308 rc_format = lexrc.getInteger();
310 case RC_INPUT: // Include file
313 libFileSearch(string(),
315 if (!read(tmp, check_format)) {
317 "Error reading included file: " + tmp.absFileName());
323 bind_file = os::internal_path(lexrc.getString());
328 def_file = os::internal_path(lexrc.getString());
333 ui_file = os::internal_path(lexrc.getString());
336 case RC_AUTORESET_OPTIONS:
337 lexrc >> auto_reset_options;
340 case RC_DISPLAY_GRAPHICS:
342 display_graphics = lexrc.getString() == "true";
345 case RC_TEX_EXPECTS_WINDOWS_PATHS:
346 lexrc >> windows_style_tex_paths;
349 case RC_TEX_ALLOWS_SPACES:
350 lexrc >> tex_allows_spaces;
353 case RC_TEXINPUTS_PREFIX:
354 lexrc >> texinputs_prefix;
361 case RC_KBMAP_PRIMARY:
363 string const kmap(os::internal_path(lexrc.getString()));
364 if (!libFileSearch("kbd", kmap, "kmap").empty()
366 primary_kbmap = kmap;
368 lexrc.printError("LyX: Keymap `$$Token' not found");
373 case RC_KBMAP_SECONDARY:
375 string const kmap(os::internal_path(lexrc.getString()));
376 if (!libFileSearch("kbd", kmap, "kmap").empty()
378 secondary_kbmap = kmap;
380 lexrc.printError("LyX: Keymap `$$Token' not found");
385 case RC_PRINTLANDSCAPEFLAG:
386 lexrc >> print_landscape_flag;
389 case RC_PRINTPAPERDIMENSIONFLAG:
390 lexrc >> print_paper_dimension_flag;
393 case RC_PRINTPAPERFLAG:
394 lexrc >> print_paper_flag;
397 case RC_PYGMENTIZE_COMMAND:
398 if (lexrc.next(true)) {
399 pygmentize_command = lexrc.getString();
403 case RC_VIEWDVI_PAPEROPTION:
405 view_dvi_paper_option = lexrc.getString();
407 view_dvi_paper_option.erase();
410 case RC_CHKTEX_COMMAND:
411 if (lexrc.next(true)) {
412 chktex_command = lexrc.getString();
416 case RC_BIBTEX_ALTERNATIVES:
417 if (lexrc.next(true)) {
418 bibtex_alternatives.insert(lexrc.getString());
422 case RC_BIBTEX_COMMAND:
423 if (lexrc.next(true)) {
424 bibtex_command = lexrc.getString();
428 case RC_JBIBTEX_COMMAND:
429 if (lexrc.next(true)) {
430 jbibtex_command = lexrc.getString();
434 case RC_JBIBTEX_ALTERNATIVES:
435 if (lexrc.next(true)) {
436 jbibtex_alternatives.insert(lexrc.getString());
440 case RC_INDEX_ALTERNATIVES:
441 if (lexrc.next(true)) {
442 index_alternatives.insert(lexrc.getString());
446 case RC_INDEX_COMMAND:
447 if (lexrc.next(true)) {
448 index_command = lexrc.getString();
452 case RC_JINDEX_COMMAND:
453 if (lexrc.next(true)) {
454 jindex_command = lexrc.getString();
458 case RC_SPLITINDEX_COMMAND:
459 if (lexrc.next(true)) {
460 splitindex_command = lexrc.getString();
464 case RC_NOMENCL_COMMAND:
465 if (lexrc.next(true)) {
466 nomencl_command = lexrc.getString();
475 lexrc >> defaultZoom;
476 if (defaultZoom < 10)
480 case RC_GEOMETRY_SESSION:
481 lexrc >> allow_geometry_session;
484 case RC_SCREEN_FONT_SIZES:
485 lexrc >> font_sizes[TINY_SIZE];
486 lexrc >> font_sizes[SCRIPT_SIZE];
487 lexrc >> font_sizes[FOOTNOTE_SIZE];
488 lexrc >> font_sizes[SMALL_SIZE];
489 lexrc >> font_sizes[NORMAL_SIZE];
490 lexrc >> font_sizes[LARGE_SIZE];
491 lexrc >> font_sizes[LARGER_SIZE];
492 lexrc >> font_sizes[LARGEST_SIZE];
493 lexrc >> font_sizes[HUGE_SIZE];
494 lexrc >> font_sizes[HUGER_SIZE];
497 case RC_SCREEN_FONT_SCALABLE:
498 lexrc >> use_scalable_fonts;
505 case RC_DOCUMENTPATH:
507 document_path = os::internal_path(lexrc.getString());
512 example_path = os::internal_path(lexrc.getString());
515 case RC_TEMPLATEPATH:
517 template_path = os::internal_path(lexrc.getString());
522 tempdir_path = os::internal_path(lexrc.getString());
525 case RC_THESAURUSDIRPATH:
527 thesaurusdir_path = os::internal_path(lexrc.getString());
530 case RC_HUNSPELLDIR_PATH:
532 hunspelldir_path = os::internal_path(lexrc.getString());
535 case RC_USELASTFILEPOS:
536 lexrc >> use_lastfilepos;
540 lexrc >> load_session;
543 case RC_MOUSE_WHEEL_SPEED:
544 lexrc >> mouse_wheel_speed;
547 case RC_COMPLETION_INLINE_DELAY:
548 lexrc >> completion_inline_delay;
551 case RC_COMPLETION_INLINE_MATH:
552 lexrc >> completion_inline_math;
555 case RC_COMPLETION_INLINE_TEXT:
556 lexrc >> completion_inline_text;
559 case RC_COMPLETION_INLINE_DOTS:
560 lexrc >> completion_inline_dots;
563 case RC_AUTOCORRECTION_MATH:
564 lexrc >> autocorrection_math;
567 case RC_COMPLETION_POPUP_DELAY:
568 lexrc >> completion_popup_delay;
571 case RC_COMPLETION_POPUP_MATH:
572 lexrc >> completion_popup_math;
575 case RC_COMPLETION_POPUP_TEXT:
576 lexrc >> completion_popup_text;
579 case RC_COMPLETION_CURSOR_TEXT:
580 lexrc >> completion_cursor_text;
583 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
584 lexrc >> completion_popup_after_complete;
587 case RC_COMPLETION_MINLENGTH:
588 lexrc >> completion_minlength;
591 case RC_NUMLASTFILES:
592 lexrc >> num_lastfiles;
595 case RC_CHECKLASTFILES:
596 lexrc >> check_lastfiles;
603 case RC_USE_SYSTEM_THEME_ICONS:
604 lexrc >> use_system_theme_icons;
607 case RC_SCREEN_FONT_ROMAN:
609 roman_font_name = lexrc.getString();
610 oldFontFormat(roman_font_name,
615 case RC_SCREEN_FONT_SANS:
617 sans_font_name = lexrc.getString();
618 oldFontFormat(sans_font_name, sans_font_foundry);
622 case RC_SCREEN_FONT_TYPEWRITER:
624 typewriter_font_name = lexrc.getString();
625 oldFontFormat(typewriter_font_name,
626 typewriter_font_foundry);
630 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
631 lexrc >> roman_font_foundry;
634 case RC_SCREEN_FONT_SANS_FOUNDRY:
635 lexrc >> sans_font_foundry;
638 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
639 lexrc >> typewriter_font_foundry;
644 lexrc.printError("Missing color tag.");
647 string const lyx_name = lexrc.getString();
650 lexrc.printError("Missing color name for color: `$$Token'");
653 string const x11_name = lexrc.getString();
655 ColorCode const col =
656 lcolor.getFromLyXName(lyx_name);
657 if (col == Color_none ||
658 col == Color_inherit ||
662 if (!lcolor.setColor(col, x11_name))
663 LYXERR0("Bad lyxrc set_color for " << lyx_name);
664 LYXERR(Debug::LYXRC, "Set " << lyx_name << "(" << col << ") to " << x11_name);
668 case RC_AUTOREGIONDELETE:
669 // Auto region delete defaults to true
670 lexrc >> auto_region_delete;
675 string userdir = package().user_support().absFileName();
676 if (userdir.back() == '/')
678 lyxpipes = subst(os::internal_path(lexrc.getString()), "$$UserDir",
683 case RC_CITATION_SEARCH_VIEW:
684 lexrc >> citation_search_view;
687 case RC_CT_ADDITIONS_UNDERLINED:
688 lexrc >> ct_additions_underlined;
691 case RC_CT_MARKUP_COPIED:
692 lexrc >> ct_markup_copied;
695 case RC_CURSOR_FOLLOWS_SCROLLBAR:
696 lexrc >> cursor_follows_scrollbar;
699 case RC_CURSOR_WIDTH:
700 lexrc >> cursor_width;
703 case RC_SCROLL_BELOW_DOCUMENT:
704 lexrc >> scroll_below_document;
707 case RC_PARAGRAPH_MARKERS:
708 lexrc >> paragraph_markers;
711 case RC_MAC_DONTSWAP_CTRL_META:
712 lexrc >> mac_dontswap_ctrl_meta;
715 case RC_MAC_LIKE_CURSOR_MOVEMENT:
716 lexrc >> mac_like_cursor_movement;
719 case RC_MACRO_EDIT_STYLE:
721 switch (lexrc.getInteger()) {
722 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
723 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
724 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
729 case RC_DIALOGS_ICONIFY_WITH_MAIN:
730 lexrc >> dialogs_iconify_with_main;
733 case RC_PLAINTEXT_LINELEN:
734 lexrc >> plaintext_linelen;
736 // Spellchecker settings:
737 case RC_ACCEPT_COMPOUND:
738 lexrc >> spellchecker_accept_compound;
740 case RC_USE_NATIVE_FILEDIALOG:
741 lexrc >> use_native_filedialog;
743 case RC_USE_SYSTEM_COLORS:
744 lexrc >> use_system_colors;
747 lexrc >> use_tooltip;
749 case RC_SPELLCHECKER:
750 lexrc >> spellchecker;
753 lexrc >> spellchecker_alt_lang;
756 lexrc >> spellchecker_esc_chars;
758 case RC_SPELLCHECK_CONTINUOUSLY:
759 lexrc >> spellcheck_continuously;
761 case RC_SPELLCHECK_NOTES:
762 lexrc >> spellcheck_notes;
765 lexrc >> make_backup;
767 case RC_SAVE_COMPRESSED:
768 lexrc >> save_compressed;
771 lexrc >> save_origin;
773 case RC_BACKUPDIR_PATH:
775 backupdir_path = os::internal_path(lexrc.getString());
777 case RC_DEFAULT_DECIMAL_SEP:
778 lexrc >> default_decimal_sep;
780 case RC_DEFAULT_LENGTH_UNIT:
782 default_length_unit = (Length::UNIT) lexrc.getInteger();
784 case RC_LANGUAGE_CUSTOM_PACKAGE:
785 lexrc >> language_custom_package;
787 case RC_LANGUAGE_AUTO_BEGIN:
788 lexrc >> language_auto_begin;
790 case RC_LANGUAGE_AUTO_END:
791 lexrc >> language_auto_end;
793 case RC_LANGUAGE_GLOBAL_OPTIONS:
794 lexrc >> language_global_options;
796 case RC_LANGUAGE_PACKAGE_SELECTION:
798 switch (lexrc.getInteger()) {
800 language_package_selection = LP_AUTO;
803 language_package_selection = LP_BABEL;
806 language_package_selection = LP_CUSTOM;
809 language_package_selection = LP_NONE;
814 case RC_LANGUAGE_COMMAND_BEGIN:
815 lexrc >> language_command_begin;
817 case RC_LANGUAGE_COMMAND_END:
818 lexrc >> language_command_end;
820 case RC_LANGUAGE_COMMAND_LOCAL:
821 lexrc >> language_command_local;
823 case RC_RESPECT_OS_KBD_LANGUAGE:
824 lexrc >> respect_os_kbd_language;
826 case RC_VISUAL_CURSOR:
827 lexrc >> visual_cursor;
829 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
830 lexrc >> close_buffer_with_last_view;
833 lexrc >> auto_number;
835 case RC_MARK_FOREIGN_LANGUAGE:
836 lexrc >> mark_foreign_language;
842 fmt = lexrc.getString();
843 if (lexrc.next(true))
844 command = lexrc.getString();
845 setMover(fmt, command);
850 string from, to, command, flags;
852 from = lexrc.getString();
854 to = lexrc.getString();
855 if (lexrc.next(true))
856 command = lexrc.getString();
858 flags = lexrc.getString();
860 theConverters().erase(from, to);
862 theConverters().add(from, to, command, flags);
865 // compatibility with versions older than 1.4.0 only
867 string format, command;
868 lexrc >> format >> command;
869 theFormats().setViewer(format, command);
872 case RC_FILEFORMAT: {
874 string format, extensions, shortcut;
875 docstring prettyname;
876 if (!(lexrc >> format >> extensions))
878 if (ok && lexrc.next(true))
879 prettyname = lexrc.getDocString();
883 if(!(lexrc >> shortcut))
885 string viewer, editor;
886 if (ok && lexrc.next(true))
887 viewer = lexrc.getString();
890 if (ok && lexrc.next(true))
891 editor = lexrc.getString();
895 if (!(lexrc >> flags >> mime))
897 int flgs = Format::none;
898 while (!flags.empty()) {
900 flags = split(flags, flag, ',');
901 if (flag == "document")
902 flgs |= Format::document;
903 else if (flag == "vector")
904 flgs |= Format::vector;
905 else if (flag == "zipped=native")
906 flgs |= Format::zipped_native;
907 else if (flag == "menu=export")
908 flgs |= Format::export_menu;
909 else if (flag == "menu=none")
910 flgs |= Format::no_menu;
912 LYXERR0("Ignoring unknown flag `"
913 << flag << "' for format `"
917 LYXERR0("Syntax error in format " << format);
918 else if (prettyname.empty()) {
919 if (theConverters().formatIsUsed(format))
920 LYXERR0("Can't delete format " << format);
922 theFormats().erase(format);
924 theFormats().add(format, extensions, prettyname,
925 shortcut, viewer, editor, mime, flgs);
929 case RC_VIEWER_ALTERNATIVES: {
930 string format, command;
931 if ((lexrc >> format) && lexrc.next(true)) {
932 command = lexrc.getString();
933 viewer_alternatives[format].insert(command);
937 case RC_EDITOR_ALTERNATIVES: {
938 string format, command;
939 if ((lexrc >> format) && lexrc.next(true)) {
940 command = lexrc.getString();
941 editor_alternatives[format].insert(command);
946 case RC_DEFAULT_OTF_VIEW_FORMAT:
947 lexrc >> default_otf_view_format;
950 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
951 lexrc >> default_platex_view_format;
954 case RC_DEFAULT_VIEW_FORMAT:
955 lexrc >> default_view_format;
958 case RC_GUI_LANGUAGE:
959 lexrc >> gui_language;
963 lexrc >> show_banner;
968 string const tmp = lexrc.getString();
969 if (tmp == "true" || tmp == "on")
970 preview = PREVIEW_ON;
971 else if (tmp == "no_math")
972 preview = PREVIEW_NO_MATH;
974 preview = PREVIEW_OFF;
975 if (tmp != "false" && tmp != "off")
976 LYXERR0("Unrecognized preview status \""
982 case RC_PREVIEW_HASHED_LABELS:
983 lexrc >> preview_hashed_labels;
986 case RC_PREVIEW_SCALE_FACTOR:
987 lexrc >> preview_scale_factor;
996 case RC_USER_INITIALS:
997 lexrc >> user_initials;
1000 case RC_PATH_PREFIX:
1001 lexrc >> path_prefix;
1004 case RC_USE_CONVERTER_CACHE:
1005 lexrc >> use_converter_cache;
1007 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1008 lexrc >> use_converter_needauth_forbidden;
1010 case RC_USE_CONVERTER_NEEDAUTH:
1011 lexrc >> use_converter_needauth;
1013 case RC_CONVERTER_CACHE_MAXAGE:
1014 lexrc >> converter_cache_maxage;
1017 case RC_SORT_LAYOUTS:
1018 lexrc >> sort_layouts;
1020 case RC_GROUP_LAYOUTS:
1021 lexrc >> group_layouts;
1023 case RC_FULL_SCREEN_LIMIT:
1024 lexrc >> full_screen_limit;
1026 case RC_FULL_SCREEN_TOOLBARS:
1027 lexrc >> full_screen_toolbars;
1029 case RC_FULL_SCREEN_SCROLLBAR:
1030 lexrc >> full_screen_scrollbar;
1032 case RC_FULL_SCREEN_STATUSBAR:
1033 lexrc >> full_screen_statusbar;
1035 case RC_FULL_SCREEN_TABBAR:
1036 lexrc >> full_screen_tabbar;
1038 case RC_FULL_SCREEN_MENUBAR:
1039 lexrc >> full_screen_menubar;
1041 case RC_FULL_SCREEN_WIDTH:
1042 lexrc >> full_screen_width;
1044 case RC_OPEN_BUFFERS_IN_TABS:
1045 lexrc >> open_buffers_in_tabs;
1047 case RC_SINGLE_CLOSE_TAB_BUTTON:
1048 lexrc >> single_close_tab_button;
1050 case RC_SINGLE_INSTANCE:
1051 lexrc >> single_instance;
1052 if (run_mode == PREFERRED)
1053 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1055 case RC_FORWARD_SEARCH_DVI:
1056 if (lexrc.next(true))
1057 forward_search_dvi = lexrc.getString();
1059 case RC_FORWARD_SEARCH_PDF:
1060 if (lexrc.next(true))
1061 forward_search_pdf = lexrc.getString();
1063 case RC_EXPORT_OVERWRITE:
1065 string const tmp = lexrc.getString();
1066 if (tmp == "all" || tmp == "true")
1067 export_overwrite = ALL_FILES;
1068 else if (tmp == "main")
1069 export_overwrite = MAIN_FILE;
1071 export_overwrite = NO_FILES;
1072 if (tmp != "ask" && tmp != "false")
1073 LYXERR0("Unrecognized export_overwrite status \""
1078 case RC_SCROLL_WHEEL_ZOOM:
1080 string const tmp = lexrc.getString();
1082 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1083 else if (tmp == "shift")
1084 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1085 else if (tmp == "alt")
1086 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1088 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1089 if (tmp != "off" && tmp != "false")
1090 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1096 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1097 lexrc >> mouse_middlebutton_paste;
1101 break; // this is just a dummy
1104 // This is triggered the first time through the loop unless
1105 // we hit a format tag.
1106 if (check_format && rc_format != LYXRC_FILEFORMAT)
1107 return FormatMismatch;
1110 /// Update converters data-structures
1111 theConverters().update(theFormats());
1112 theConverters().buildGraph();
1113 theBufferList().invalidateConverterCache();
1119 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1121 ofstream ofs(filename.toFilesystemEncoding().c_str());
1123 write(ofs, ignore_system_lyxrc);
1127 void LyXRC::print() const
1129 if (lyxerr.debugging())
1130 write(lyxerr, false);
1138 typedef pair<string, SpecialisedMover> Data;
1140 SameMover(Data const & comparison)
1141 : comparison_(comparison) {}
1143 bool operator()(Data const & data) const
1145 return data.first == comparison_.first &&
1146 data.second.command() == comparison_.second.command();
1156 // Escape \ and " so that LyXLex can read the string later
1157 string escapeCommand(string const & str) {
1158 return subst(subst(str , "\\", "\\\\"),
1165 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1167 LyXRCTags tag = RC_LAST;
1169 if (!name.empty()) {
1170 for (int i = 0; i != lyxrcCount; ++i)
1171 if ("\\" + name == lyxrcTags[i].tag)
1172 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1176 os << "# LyX " << lyx_version
1177 << " generated this file. If you want to make your own\n"
1178 << "# modifications you should do them from inside LyX and save.\n\n"
1179 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1181 // Why the switch you might ask. It is a trick to ensure that all
1182 // the elements in the LyXRCTags enum are handled. As you can see
1183 // there are no breaks at all. So it is just a huge fall-through.
1184 // The nice thing is that we will get a warning from the compiler
1185 // if we forget an element.
1189 // input/include files are not done here
1190 case RC_LYXRCFORMAT:
1192 if (ignore_system_lyxrc ||
1193 bind_file != system_lyxrc.bind_file) {
1194 string const path = os::external_path(bind_file);
1195 os << "\\bind_file \"" << path << "\"\n";
1201 if (ignore_system_lyxrc ||
1202 def_file != system_lyxrc.def_file) {
1203 string const path = os::external_path(def_file);
1204 os << "\\def_file \"" << path << "\"\n";
1213 << "# MISC SECTION ######################################\n"
1215 // bind files are not done here.
1217 case RC_PATH_PREFIX:
1218 if (ignore_system_lyxrc ||
1219 path_prefix != system_lyxrc.path_prefix) {
1220 os << "\\path_prefix \"" << path_prefix << "\"\n";
1226 if (ignore_system_lyxrc ||
1227 ui_file != system_lyxrc.ui_file) {
1228 string const path = os::external_path(ui_file);
1229 os << "\\ui_file \"" << path << "\"\n";
1234 case RC_AUTOREGIONDELETE:
1235 if (ignore_system_lyxrc ||
1236 auto_region_delete != system_lyxrc.auto_region_delete) {
1237 os << "# Set to false to inhibit automatic replacement of\n"
1238 << "# the current selection.\n"
1239 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1245 case RC_AUTORESET_OPTIONS:
1246 if (ignore_system_lyxrc ||
1247 auto_reset_options != system_lyxrc.auto_reset_options) {
1248 os << "# Set to false to inhibit automatic reset of\n"
1249 << "# the class options to defaults on class change.\n"
1250 << "\\auto_reset_options "
1251 << convert<string>(auto_reset_options)
1258 if (ignore_system_lyxrc ||
1259 autosave != system_lyxrc.autosave) {
1260 os << "# The time interval between auto-saves in seconds.\n"
1261 << "\\autosave " << autosave << '\n';
1266 case RC_DISPLAY_GRAPHICS:
1267 if (ignore_system_lyxrc ||
1268 display_graphics != system_lyxrc.display_graphics) {
1269 os << "# Display graphics within LyX\n"
1271 << "\\display_graphics "
1272 << (display_graphics ? "true" : "false")
1278 case RC_SORT_LAYOUTS:
1279 if (ignore_system_lyxrc ||
1280 sort_layouts != system_lyxrc.sort_layouts) {
1281 os << "# Sort layouts alphabetically.\n"
1282 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1287 case RC_GROUP_LAYOUTS:
1288 if (ignore_system_lyxrc ||
1289 group_layouts != system_lyxrc.group_layouts) {
1290 os << "# Group layouts by their category.\n"
1291 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1296 case RC_VIEWDVI_PAPEROPTION:
1297 if (ignore_system_lyxrc ||
1298 view_dvi_paper_option
1299 != system_lyxrc.view_dvi_paper_option) {
1300 os << "# Options used to specify paper size to the\n"
1301 << "# view_dvi_command (e.g. -paper)\n"
1302 << "\\view_dvi_paper_option \""
1303 << view_dvi_paper_option << "\"\n";
1308 case RC_CHKTEX_COMMAND:
1309 if (ignore_system_lyxrc ||
1310 chktex_command != system_lyxrc.chktex_command) {
1311 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1316 case RC_BIBTEX_ALTERNATIVES: {
1317 CommandSet::const_iterator it = bibtex_alternatives.begin();
1318 CommandSet::const_iterator end = bibtex_alternatives.end();
1319 for ( ; it != end; ++it) {
1320 if (ignore_system_lyxrc
1321 || !system_lyxrc.bibtex_alternatives.count(*it))
1322 os << "\\bibtex_alternatives \""
1329 case RC_BIBTEX_COMMAND:
1330 if (ignore_system_lyxrc ||
1331 bibtex_command != system_lyxrc.bibtex_command) {
1332 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1337 case RC_JBIBTEX_COMMAND:
1338 if (ignore_system_lyxrc ||
1339 jbibtex_command != system_lyxrc.jbibtex_command) {
1340 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1345 case RC_JBIBTEX_ALTERNATIVES: {
1346 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1347 CommandSet::const_iterator end = jbibtex_alternatives.end();
1348 for ( ; it != end; ++it) {
1349 if (ignore_system_lyxrc
1350 || !system_lyxrc.jbibtex_alternatives.count(*it))
1351 os << "\\jbibtex_alternatives \""
1358 case RC_INDEX_ALTERNATIVES: {
1359 CommandSet::const_iterator it = index_alternatives.begin();
1360 CommandSet::const_iterator end = index_alternatives.end();
1361 for ( ; it != end; ++it) {
1362 if (ignore_system_lyxrc
1363 || !system_lyxrc.index_alternatives.count(*it))
1364 os << "\\index_alternatives \""
1371 case RC_INDEX_COMMAND:
1372 if (ignore_system_lyxrc ||
1373 index_command != system_lyxrc.index_command) {
1374 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1379 case RC_JINDEX_COMMAND:
1380 if (ignore_system_lyxrc ||
1381 jindex_command != system_lyxrc.jindex_command) {
1382 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1387 case RC_SPLITINDEX_COMMAND:
1388 if (ignore_system_lyxrc ||
1389 splitindex_command != system_lyxrc.splitindex_command) {
1390 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1395 case RC_NOMENCL_COMMAND:
1396 if (ignore_system_lyxrc ||
1397 nomencl_command != system_lyxrc.nomencl_command) {
1398 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1403 case RC_PYGMENTIZE_COMMAND:
1404 if (ignore_system_lyxrc ||
1405 pygmentize_command != system_lyxrc.pygmentize_command) {
1406 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1411 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1412 // Don't write this setting to the preferences file,
1413 // but allow temporary changes (bug 7557).
1414 if (ignore_system_lyxrc) {
1415 os << "\\tex_expects_windows_paths "
1416 << convert<string>(windows_style_tex_paths) << '\n';
1421 case RC_TEX_ALLOWS_SPACES:
1422 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1423 os << "\\tex_allows_spaces "
1424 << convert<string>(tex_allows_spaces) << '\n';
1430 if (ignore_system_lyxrc ||
1431 use_kbmap != system_lyxrc.use_kbmap) {
1432 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1437 case RC_KBMAP_PRIMARY:
1438 if (ignore_system_lyxrc ||
1439 primary_kbmap != system_lyxrc.primary_kbmap) {
1440 string const path = os::external_path(primary_kbmap);
1441 os << "\\kbmap_primary \"" << path << "\"\n";
1446 case RC_KBMAP_SECONDARY:
1447 if (ignore_system_lyxrc ||
1448 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1449 string const path = os::external_path(secondary_kbmap);
1450 os << "\\kbmap_secondary \"" << path << "\"\n";
1456 if (ignore_system_lyxrc ||
1457 lyxpipes != system_lyxrc.lyxpipes) {
1458 string const path = os::external_path(lyxpipes);
1459 os << "\\serverpipe \"" << path << "\"\n";
1465 os << "\\user_name \"" << user_name << "\"\n";
1470 os << "\\user_email \"" << user_email << "\"\n";
1474 case RC_USER_INITIALS:
1475 os << "\\user_initials \"" << user_initials << "\"\n";
1479 case RC_SHOW_BANNER:
1480 if (ignore_system_lyxrc ||
1481 show_banner != system_lyxrc.show_banner) {
1482 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1488 if (ignore_system_lyxrc ||
1489 preview != system_lyxrc.preview) {
1495 case PREVIEW_NO_MATH:
1502 os << "\\preview " << status << '\n';
1507 case RC_PREVIEW_HASHED_LABELS:
1508 if (ignore_system_lyxrc ||
1509 preview_hashed_labels !=
1510 system_lyxrc.preview_hashed_labels) {
1511 os << "\\preview_hashed_labels "
1512 << convert<string>(preview_hashed_labels) << '\n';
1517 case RC_PREVIEW_SCALE_FACTOR:
1518 if (ignore_system_lyxrc ||
1519 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1520 os << "\\preview_scale_factor "
1521 << preview_scale_factor << '\n';
1526 case RC_USE_CONVERTER_CACHE:
1527 if (ignore_system_lyxrc ||
1528 use_converter_cache != system_lyxrc.use_converter_cache) {
1529 os << "\\use_converter_cache "
1530 << convert<string>(use_converter_cache) << '\n';
1535 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1536 if (ignore_system_lyxrc ||
1537 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1538 os << "\\use_converter_needauth_forbidden "
1539 << convert<string>(use_converter_needauth_forbidden) << '\n';
1544 case RC_USE_CONVERTER_NEEDAUTH:
1545 if (ignore_system_lyxrc ||
1546 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1547 os << "\\use_converter_needauth "
1548 << convert<string>(use_converter_needauth) << '\n';
1553 case RC_CONVERTER_CACHE_MAXAGE:
1554 if (ignore_system_lyxrc ||
1555 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1556 os << "\\converter_cache_maxage "
1557 << converter_cache_maxage << '\n';
1563 << "# SCREEN & FONTS SECTION ############################\n"
1567 if (ignore_system_lyxrc ||
1568 icon_set != system_lyxrc.icon_set) {
1569 os << "\\icon_set \"" << icon_set
1575 case RC_USE_SYSTEM_THEME_ICONS:
1576 if (ignore_system_lyxrc ||
1577 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1578 os << "\\use_system_theme_icons "
1579 << convert<string>(use_system_theme_icons)
1586 if (ignore_system_lyxrc ||
1587 dpi != system_lyxrc.dpi) {
1588 os << "\\screen_dpi " << dpi << '\n';
1593 case RC_SCREEN_ZOOM:
1594 if (ignore_system_lyxrc ||
1595 defaultZoom != system_lyxrc.defaultZoom) {
1596 os << "\\screen_zoom " << defaultZoom << '\n';
1601 case RC_GEOMETRY_SESSION:
1602 if (ignore_system_lyxrc ||
1603 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1604 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1610 case RC_CITATION_SEARCH_VIEW:
1611 if (ignore_system_lyxrc ||
1612 citation_search_view != system_lyxrc.citation_search_view) {
1613 os << "\\citaton_search_view "
1614 << citation_search_view << '\n';
1619 case RC_CT_ADDITIONS_UNDERLINED:
1620 if (ignore_system_lyxrc ||
1621 ct_additions_underlined
1622 != system_lyxrc.ct_additions_underlined) {
1623 os << "\\ct_additions_underlined "
1624 << convert<string>(ct_additions_underlined) << '\n';
1629 case RC_CT_MARKUP_COPIED:
1630 if (ignore_system_lyxrc ||
1632 != system_lyxrc.ct_markup_copied) {
1633 os << "\\ct_markup_copied "
1634 << convert<string>(ct_markup_copied) << '\n';
1639 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1640 if (ignore_system_lyxrc ||
1641 cursor_follows_scrollbar
1642 != system_lyxrc.cursor_follows_scrollbar) {
1643 os << "\\cursor_follows_scrollbar "
1644 << convert<string>(cursor_follows_scrollbar) << '\n';
1649 case RC_CURSOR_WIDTH:
1650 if (ignore_system_lyxrc ||
1652 != system_lyxrc.cursor_width) {
1653 os << "\\cursor_width "
1654 << cursor_width << '\n';
1659 case RC_SCROLL_BELOW_DOCUMENT:
1660 if (ignore_system_lyxrc ||
1661 scroll_below_document
1662 != system_lyxrc.scroll_below_document) {
1663 os << "\\scroll_below_document "
1664 << convert<string>(scroll_below_document) << '\n';
1669 case RC_PARAGRAPH_MARKERS:
1670 if (ignore_system_lyxrc ||
1672 != system_lyxrc.paragraph_markers) {
1673 os << "\\paragraph_markers "
1674 << convert<string>(paragraph_markers) << '\n';
1679 case RC_MAC_DONTSWAP_CTRL_META:
1680 if (ignore_system_lyxrc ||
1681 mac_dontswap_ctrl_meta
1682 != system_lyxrc.mac_dontswap_ctrl_meta) {
1683 os << "\\mac_dontswap_ctrl_meta "
1684 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1689 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1690 if (ignore_system_lyxrc ||
1691 mac_like_cursor_movement
1692 != system_lyxrc.mac_like_cursor_movement) {
1693 os << "\\mac_like_cursor_movement "
1694 << convert<string>(mac_like_cursor_movement) << '\n';
1699 case RC_MACRO_EDIT_STYLE:
1700 if (ignore_system_lyxrc ||
1702 != system_lyxrc.macro_edit_style) {
1703 os << "\\macro_edit_style ";
1704 switch (macro_edit_style) {
1705 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1706 case MACRO_EDIT_INLINE: os << "1\n"; break;
1707 case MACRO_EDIT_LIST: os << "2\n"; break;
1713 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1714 if (ignore_system_lyxrc ||
1715 dialogs_iconify_with_main
1716 != system_lyxrc.dialogs_iconify_with_main) {
1717 os << "\\dialogs_iconify_with_main "
1718 << convert<string>(dialogs_iconify_with_main) << '\n';
1723 case RC_SCREEN_FONT_ROMAN:
1724 if (ignore_system_lyxrc ||
1725 roman_font_name != system_lyxrc.roman_font_name) {
1726 os << "\\screen_font_roman \"" << roman_font_name
1732 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1733 if (ignore_system_lyxrc ||
1734 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1735 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1741 case RC_SCREEN_FONT_SANS:
1742 if (ignore_system_lyxrc ||
1743 sans_font_name != system_lyxrc.sans_font_name) {
1744 os << "\\screen_font_sans \"" << sans_font_name
1750 case RC_SCREEN_FONT_SANS_FOUNDRY:
1751 if (ignore_system_lyxrc ||
1752 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1753 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1759 case RC_SCREEN_FONT_TYPEWRITER:
1760 if (ignore_system_lyxrc ||
1761 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1762 os << "\\screen_font_typewriter \""
1763 << typewriter_font_name << "\"\n";
1768 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1769 if (ignore_system_lyxrc ||
1770 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1771 os << "\\screen_font_typewriter_foundry \""
1772 << typewriter_font_foundry << "\"\n";
1777 case RC_SCREEN_FONT_SCALABLE:
1778 if (ignore_system_lyxrc ||
1779 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1780 os << "\\screen_font_scalable "
1781 << convert<string>(use_scalable_fonts)
1787 case RC_SCREEN_FONT_SIZES:
1788 if (ignore_system_lyxrc ||
1789 font_sizes[TINY_SIZE]
1790 != system_lyxrc.font_sizes[TINY_SIZE] ||
1791 font_sizes[SCRIPT_SIZE]
1792 != system_lyxrc.font_sizes[SCRIPT_SIZE] ||
1793 font_sizes[FOOTNOTE_SIZE]
1794 != system_lyxrc.font_sizes[FOOTNOTE_SIZE] ||
1795 font_sizes[SMALL_SIZE]
1796 != system_lyxrc.font_sizes[SMALL_SIZE] ||
1797 font_sizes[NORMAL_SIZE]
1798 != system_lyxrc.font_sizes[NORMAL_SIZE] ||
1799 font_sizes[LARGE_SIZE]
1800 != system_lyxrc.font_sizes[LARGE_SIZE] ||
1801 font_sizes[LARGER_SIZE]
1802 != system_lyxrc.font_sizes[LARGER_SIZE] ||
1803 font_sizes[LARGEST_SIZE]
1804 != system_lyxrc.font_sizes[LARGEST_SIZE] ||
1805 font_sizes[HUGE_SIZE]
1806 != system_lyxrc.font_sizes[HUGE_SIZE] ||
1807 font_sizes[HUGER_SIZE]
1808 != system_lyxrc.font_sizes[HUGER_SIZE]) {
1809 streamsize old_prec = os.precision();
1810 os.setf(ios::fixed);
1812 os << "\\screen_font_sizes"
1813 << ' ' << font_sizes[TINY_SIZE]
1814 << ' ' << font_sizes[SCRIPT_SIZE]
1815 << ' ' << font_sizes[FOOTNOTE_SIZE]
1816 << ' ' << font_sizes[SMALL_SIZE]
1817 << ' ' << font_sizes[NORMAL_SIZE]
1818 << ' ' << font_sizes[LARGE_SIZE]
1819 << ' ' << font_sizes[LARGER_SIZE]
1820 << ' ' << font_sizes[LARGEST_SIZE]
1821 << ' ' << font_sizes[HUGE_SIZE]
1822 << ' ' << font_sizes[HUGER_SIZE]
1824 os.precision(old_prec);
1825 os.unsetf(ios::fixed);
1830 case RC_FULL_SCREEN_LIMIT:
1831 if (ignore_system_lyxrc ||
1832 full_screen_limit != system_lyxrc.full_screen_limit) {
1833 os << "\\fullscreen_limit "
1834 << convert<string>(full_screen_limit)
1840 case RC_FULL_SCREEN_TOOLBARS:
1841 if (ignore_system_lyxrc ||
1842 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1843 os << "\\fullscreen_toolbars "
1844 << convert<string>(full_screen_toolbars)
1850 case RC_FULL_SCREEN_SCROLLBAR:
1851 if (ignore_system_lyxrc ||
1852 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1853 os << "\\fullscreen_scrollbar "
1854 << convert<string>(full_screen_scrollbar)
1860 case RC_FULL_SCREEN_STATUSBAR:
1861 if (ignore_system_lyxrc ||
1862 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1863 os << "\\fullscreen_statusbar "
1864 << convert<string>(full_screen_statusbar)
1870 case RC_FULL_SCREEN_TABBAR:
1871 if (ignore_system_lyxrc ||
1872 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1873 os << "\\fullscreen_tabbar "
1874 << convert<string>(full_screen_tabbar)
1880 case RC_FULL_SCREEN_MENUBAR:
1881 if (ignore_system_lyxrc ||
1882 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1883 os << "\\fullscreen_menubar "
1884 << convert<string>(full_screen_menubar)
1890 case RC_FULL_SCREEN_WIDTH:
1891 if (ignore_system_lyxrc ||
1892 full_screen_width != system_lyxrc.full_screen_width) {
1893 os << "\\fullscreen_width "
1894 << convert<string>(full_screen_width)
1900 case RC_OPEN_BUFFERS_IN_TABS:
1901 if (ignore_system_lyxrc ||
1902 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1903 os << "\\open_buffers_in_tabs "
1904 << convert<string>(open_buffers_in_tabs)
1910 case RC_SINGLE_CLOSE_TAB_BUTTON:
1911 if (ignore_system_lyxrc ||
1912 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1913 os << "\\single_close_tab_button "
1914 << convert<string>(single_close_tab_button)
1920 case RC_SINGLE_INSTANCE:
1921 if (ignore_system_lyxrc ||
1922 single_instance != system_lyxrc.single_instance) {
1923 os << "\\single_instance "
1924 << convert<string>(single_instance)
1930 case RC_FORWARD_SEARCH_DVI:
1931 if (ignore_system_lyxrc ||
1932 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1933 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1938 case RC_FORWARD_SEARCH_PDF:
1939 if (ignore_system_lyxrc ||
1940 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1941 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1947 << "# COLOR SECTION ###################################\n"
1952 for (int i = 0; i < Color_ignore; ++i) {
1953 ColorCode lc = static_cast<ColorCode>(i);
1954 string const col = lcolor.getX11HexName(lc);
1955 if (ignore_system_lyxrc
1956 || col != system_lcolor.getX11HexName(lc)) {
1957 os << "\\set_color \""
1958 << lcolor.getLyXName(lc) << "\" \""
1966 << "# PRINTER SECTION ###################################\n"
1970 case RC_PRINTLANDSCAPEFLAG:
1971 if (ignore_system_lyxrc ||
1972 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1973 os << "\\print_landscape_flag \"" << print_landscape_flag
1979 case RC_PRINTPAPERFLAG:
1980 if (ignore_system_lyxrc ||
1981 print_paper_flag != system_lyxrc.print_paper_flag) {
1982 os << "\\print_paper_flag \"" << print_paper_flag
1988 case RC_PRINTPAPERDIMENSIONFLAG:
1989 if (ignore_system_lyxrc ||
1990 print_paper_dimension_flag
1991 != system_lyxrc.print_paper_dimension_flag) {
1992 os << "\\print_paper_dimension_flag \""
1993 << print_paper_dimension_flag << "\"\n";
1999 << "# TEX SECTION #######################################\n"
2003 case RC_TEXINPUTS_PREFIX:
2004 if (ignore_system_lyxrc ||
2005 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2006 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2012 << "# FILE SECTION ######################################\n"
2015 case RC_DOCUMENTPATH:
2016 if (ignore_system_lyxrc ||
2017 document_path != system_lyxrc.document_path) {
2018 string const path = os::external_path(document_path);
2019 os << "\\document_path \"" << path << "\"\n";
2024 case RC_USELASTFILEPOS:
2025 if (ignore_system_lyxrc ||
2026 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2027 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2033 case RC_LOADSESSION:
2034 if (ignore_system_lyxrc ||
2035 load_session != system_lyxrc.load_session) {
2036 os << "\\load_session " << convert<string>(load_session)
2042 case RC_MOUSE_WHEEL_SPEED:
2043 if (ignore_system_lyxrc ||
2044 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2045 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2050 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2051 if (ignore_system_lyxrc ||
2052 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2053 os << "\\mouse_middlebutton_paste "
2054 << convert<string>(mouse_middlebutton_paste) << '\n';
2059 case RC_COMPLETION_INLINE_DELAY:
2060 if (ignore_system_lyxrc ||
2061 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2062 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2067 case RC_COMPLETION_INLINE_MATH:
2068 if (ignore_system_lyxrc ||
2069 completion_inline_math != system_lyxrc.completion_inline_math) {
2070 os << "\\completion_inline_math "
2071 << convert<string>(completion_inline_math) << '\n';
2076 case RC_COMPLETION_INLINE_TEXT:
2077 if (ignore_system_lyxrc ||
2078 completion_inline_text != system_lyxrc.completion_inline_text) {
2079 os << "\\completion_inline_text "
2080 << convert<string>(completion_inline_text) << '\n';
2085 case RC_COMPLETION_INLINE_DOTS:
2086 if (ignore_system_lyxrc ||
2087 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2088 os << "\\completion_inline_dots "
2089 << convert<string>(completion_inline_dots) << '\n';
2094 case RC_AUTOCORRECTION_MATH:
2095 if (ignore_system_lyxrc ||
2096 autocorrection_math != system_lyxrc.autocorrection_math) {
2097 os << "\\autocorrection_math "
2098 << convert<string>(autocorrection_math) << '\n';
2103 case RC_COMPLETION_POPUP_DELAY:
2104 if (ignore_system_lyxrc ||
2105 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2106 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2111 case RC_COMPLETION_POPUP_MATH:
2112 if (ignore_system_lyxrc ||
2113 completion_popup_math != system_lyxrc.completion_popup_math) {
2114 os << "\\completion_popup_math "
2115 << convert<string>(completion_popup_math) << '\n';
2120 case RC_COMPLETION_POPUP_TEXT:
2121 if (ignore_system_lyxrc ||
2122 completion_popup_text != system_lyxrc.completion_popup_text) {
2123 os << "\\completion_popup_text "
2124 << convert<string>(completion_popup_text) << '\n';
2129 case RC_COMPLETION_CURSOR_TEXT:
2130 if (ignore_system_lyxrc ||
2131 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2132 os << "\\completion_cursor_text "
2133 << convert<string>(completion_cursor_text) << '\n';
2138 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2139 if (ignore_system_lyxrc ||
2140 completion_popup_after_complete
2141 != system_lyxrc.completion_popup_after_complete) {
2142 os << "\\completion_popup_after_complete "
2143 << convert<string>(completion_popup_after_complete) << '\n';
2148 case RC_COMPLETION_MINLENGTH:
2149 if (ignore_system_lyxrc ||
2150 completion_minlength != system_lyxrc.completion_minlength) {
2151 os << "\\completion_minlength " << convert<string>(completion_minlength)
2157 case RC_NUMLASTFILES:
2158 if (ignore_system_lyxrc ||
2159 num_lastfiles != system_lyxrc.num_lastfiles) {
2160 os << "\\num_lastfiles " << num_lastfiles << '\n';
2165 case RC_CHECKLASTFILES:
2166 if (ignore_system_lyxrc ||
2167 check_lastfiles != system_lyxrc.check_lastfiles) {
2168 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2174 case RC_EXAMPLEPATH:
2175 if (ignore_system_lyxrc ||
2176 example_path != system_lyxrc.example_path) {
2177 string const path = os::external_path(example_path);
2178 os << "\\example_path \"" << path << "\"\n";
2183 case RC_TEMPLATEPATH:
2184 if (ignore_system_lyxrc ||
2185 template_path != system_lyxrc.template_path) {
2186 string const path = os::external_path(template_path);
2187 os << "\\template_path \"" << path << "\"\n";
2192 case RC_TEMPDIRPATH:
2193 if (ignore_system_lyxrc ||
2194 tempdir_path != system_lyxrc.tempdir_path) {
2195 string const path = os::external_path(tempdir_path);
2196 os << "\\tempdir_path \"" << path << "\"\n";
2201 case RC_THESAURUSDIRPATH:
2202 if (ignore_system_lyxrc ||
2203 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2204 string const path = os::external_path(thesaurusdir_path);
2205 os << "\\thesaurusdir_path \"" << path << "\"\n";
2210 case RC_HUNSPELLDIR_PATH:
2211 if (ignore_system_lyxrc ||
2212 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2213 string const path = os::external_path(hunspelldir_path);
2214 os << "\\hunspelldir_path \"" << path << "\"\n";
2219 case RC_PLAINTEXT_LINELEN:
2220 if (ignore_system_lyxrc ||
2221 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2222 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2227 case RC_MAKE_BACKUP:
2228 if (ignore_system_lyxrc ||
2229 make_backup != system_lyxrc.make_backup) {
2230 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2235 case RC_SAVE_COMPRESSED:
2236 if (ignore_system_lyxrc ||
2237 save_compressed != system_lyxrc.save_compressed) {
2238 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2243 case RC_SAVE_ORIGIN:
2244 if (ignore_system_lyxrc ||
2245 save_origin != system_lyxrc.save_origin) {
2246 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2251 case RC_BACKUPDIR_PATH:
2252 if (ignore_system_lyxrc ||
2253 backupdir_path != system_lyxrc.backupdir_path) {
2254 string const path = os::external_path(backupdir_path);
2255 os << "\\backupdir_path \"" << path << "\"\n";
2261 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2265 << "# SPELLCHECKER SECTION ##############################\n"
2269 case RC_ACCEPT_COMPOUND:
2270 if (ignore_system_lyxrc ||
2271 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2272 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2279 if (ignore_system_lyxrc ||
2280 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2281 os << "\\alternate_language \"" << spellchecker_alt_lang
2288 if (ignore_system_lyxrc ||
2289 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2290 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2295 case RC_USE_NATIVE_FILEDIALOG:
2296 if (ignore_system_lyxrc ||
2297 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2298 os << "\\use_native_filedialog "
2299 << convert<string>(use_native_filedialog)
2305 case RC_USE_SYSTEM_COLORS:
2306 if (ignore_system_lyxrc ||
2307 use_system_colors != system_lyxrc.use_system_colors) {
2308 os << "\\use_system_colors "
2309 << convert<string>(use_system_colors)
2315 case RC_USE_TOOLTIP:
2316 if (ignore_system_lyxrc ||
2317 use_tooltip != system_lyxrc.use_tooltip) {
2318 os << "\\use_tooltip "
2319 << convert<string>(use_tooltip)
2327 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2331 case RC_DEFAULT_DECIMAL_SEP:
2332 if (ignore_system_lyxrc ||
2333 default_decimal_sep != system_lyxrc.default_decimal_sep) {
2334 os << "\\default_decimal_point \"" << default_decimal_sep << "\"" << '\n';
2339 case RC_DEFAULT_LENGTH_UNIT:
2340 if (ignore_system_lyxrc ||
2341 default_length_unit != system_lyxrc.default_length_unit) {
2342 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2347 case RC_SPELLCHECKER:
2348 if (ignore_system_lyxrc ||
2349 spellchecker != system_lyxrc.spellchecker) {
2350 os << "\\spellchecker " << spellchecker << '\n';
2355 case RC_SPELLCHECK_CONTINUOUSLY:
2356 if (ignore_system_lyxrc ||
2357 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2358 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2364 case RC_SPELLCHECK_NOTES:
2365 if (ignore_system_lyxrc ||
2366 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2367 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2373 case RC_VISUAL_CURSOR:
2374 if (ignore_system_lyxrc ||
2375 visual_cursor != system_lyxrc.visual_cursor) {
2376 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2381 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2382 if (ignore_system_lyxrc ||
2383 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2384 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2385 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2390 case RC_LANGUAGE_CUSTOM_PACKAGE:
2391 if (ignore_system_lyxrc ||
2392 language_custom_package != system_lyxrc.language_custom_package) {
2393 os << "\\language_custom_package \"" << language_custom_package
2399 case RC_LANGUAGE_GLOBAL_OPTIONS:
2400 if (ignore_system_lyxrc ||
2401 language_global_options
2402 != system_lyxrc.language_global_options) {
2403 os << "\\language_global_options \""
2404 << convert<string>(language_global_options)
2410 case RC_LANGUAGE_PACKAGE_SELECTION:
2411 if (ignore_system_lyxrc ||
2412 language_package_selection != system_lyxrc.language_package_selection) {
2413 os << "\\language_package_selection ";
2414 switch (language_package_selection) {
2432 case RC_LANGUAGE_COMMAND_BEGIN:
2433 if (ignore_system_lyxrc ||
2434 language_command_begin
2435 != system_lyxrc.language_command_begin) {
2436 os << "\\language_command_begin \""
2437 << language_command_begin
2443 case RC_LANGUAGE_COMMAND_END:
2444 if (ignore_system_lyxrc ||
2445 language_command_end
2446 != system_lyxrc.language_command_end) {
2447 os << "\\language_command_end \"" << language_command_end
2453 case RC_LANGUAGE_COMMAND_LOCAL:
2454 if (ignore_system_lyxrc ||
2455 language_command_local
2456 != system_lyxrc.language_command_local) {
2457 os << "\\language_command_local \""
2458 << language_command_local
2464 case RC_LANGUAGE_AUTO_BEGIN:
2465 if (ignore_system_lyxrc ||
2466 language_auto_begin != system_lyxrc.language_auto_begin) {
2467 os << "\\language_auto_begin "
2468 << convert<string>(language_auto_begin) << '\n';
2473 case RC_LANGUAGE_AUTO_END:
2474 if (ignore_system_lyxrc ||
2475 language_auto_end != system_lyxrc.language_auto_end) {
2476 os << "\\language_auto_end "
2477 << convert<string>(language_auto_end) << '\n';
2482 case RC_MARK_FOREIGN_LANGUAGE:
2483 if (ignore_system_lyxrc ||
2484 mark_foreign_language
2485 != system_lyxrc.mark_foreign_language) {
2486 os << "\\mark_foreign_language " <<
2487 convert<string>(mark_foreign_language) << '\n';
2490 case RC_RESPECT_OS_KBD_LANGUAGE:
2491 if (ignore_system_lyxrc ||
2492 respect_os_kbd_language
2493 != system_lyxrc.respect_os_kbd_language) {
2494 os << "\\respect_os_kbd_language " <<
2495 convert<string>(respect_os_kbd_language) << '\n';
2502 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2506 case RC_AUTO_NUMBER:
2507 if (ignore_system_lyxrc ||
2508 auto_number != system_lyxrc.auto_number) {
2509 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2514 case RC_GUI_LANGUAGE:
2515 if (ignore_system_lyxrc ||
2516 gui_language != system_lyxrc.gui_language) {
2517 os << "\\gui_language " << gui_language << '\n';
2522 case RC_EXPORT_OVERWRITE:
2523 if (ignore_system_lyxrc ||
2524 export_overwrite != system_lyxrc.export_overwrite) {
2526 switch (export_overwrite) {
2537 os << "\\export_overwrite " << status << '\n';
2542 case RC_SCROLL_WHEEL_ZOOM:
2543 if (ignore_system_lyxrc ||
2544 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2546 switch (scroll_wheel_zoom) {
2547 case SCROLL_WHEEL_ZOOM_OFF:
2550 case SCROLL_WHEEL_ZOOM_CTRL:
2553 case SCROLL_WHEEL_ZOOM_SHIFT:
2556 case SCROLL_WHEEL_ZOOM_ALT:
2560 os << "\\scroll_wheel_zoom " << status << '\n';
2566 << "# FORMATS SECTION ##########################\n"
2571 // New/modified formats
2572 for (Formats::const_iterator cit = theFormats().begin();
2573 cit != theFormats().end(); ++cit) {
2574 Format const * format =
2575 theSystemFormats().getFormat(cit->name());
2577 format->extensions() != cit->extensions() ||
2578 format->prettyname() != cit->prettyname() ||
2579 format->shortcut() != cit->shortcut() ||
2580 format->viewer() != cit->viewer() ||
2581 format->editor() != cit->editor() ||
2582 format->documentFormat() != cit->documentFormat() ||
2583 format->vectorFormat() != cit->vectorFormat() ||
2584 format->inExportMenu() != cit->inExportMenu() ||
2585 format->noMenu() != cit->noMenu() ||
2586 format->mime() != cit->mime()) {
2587 os << "\\format \"" << cit->name() << "\" \""
2588 << cit->extensions() << "\" \""
2589 << to_utf8(cit->prettyname()) << "\" \""
2590 << cit->shortcut() << "\" \""
2591 << escapeCommand(cit->viewer()) << "\" \""
2592 << escapeCommand(cit->editor()) << "\" \"";
2593 vector<string> flags;
2594 if (cit->documentFormat())
2595 flags.push_back("document");
2596 if (cit->vectorFormat())
2597 flags.push_back("vector");
2598 if (cit->zippedNative())
2599 flags.push_back("zipped=native");
2600 if (cit->inExportMenu())
2601 flags.push_back("menu=export");
2603 os << getStringFromVector(flags);
2604 os << "\" \"" << cit->mime() << "\"\n";
2608 // Look for deleted formats
2609 for (Formats::const_iterator cit = theSystemFormats().begin();
2610 cit != theSystemFormats().end(); ++cit)
2611 if (!theFormats().getFormat(cit->name()))
2612 os << "\\format \"" << cit->name()
2613 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2617 case RC_VIEWER_ALTERNATIVES: {
2618 Alternatives::const_iterator it = viewer_alternatives.begin();
2619 Alternatives::const_iterator const en = viewer_alternatives.end();
2620 Alternatives::const_iterator const sysend =
2621 system_lyxrc.viewer_alternatives.end();
2622 for (; it != en; ++it) {
2623 string const & fmt = it->first;
2624 CommandSet const & cmd = it->second;
2625 CommandSet::const_iterator sit = cmd.begin();
2626 CommandSet::const_iterator const sen = cmd.end();
2627 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2628 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2629 system_lyxrc.viewer_alternatives.find(fmt);
2630 for (; sit != sen; ++sit) {
2631 string const & cmd = *sit;
2632 if (ignore_system_lyxrc
2633 || sysfmt == sysend // format not found
2634 || sysfmt->second.count(cmd) == 0 // this command not found
2636 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2643 case RC_EDITOR_ALTERNATIVES: {
2644 Alternatives::const_iterator it = editor_alternatives.begin();
2645 Alternatives::const_iterator const en = editor_alternatives.end();
2646 Alternatives::const_iterator const sysend =
2647 system_lyxrc.editor_alternatives.end();
2648 for (; it != en; ++it) {
2649 string const & fmt = it->first;
2650 CommandSet const & cmd = it->second;
2651 CommandSet::const_iterator sit = cmd.begin();
2652 CommandSet::const_iterator const sen = cmd.end();
2653 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2654 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2655 system_lyxrc.editor_alternatives.find(fmt);
2656 for (; sit != sen; ++sit) {
2657 string const & cmd = *sit;
2658 if (ignore_system_lyxrc
2659 || sysfmt == sysend // format not found
2660 || sysfmt->second.count(cmd) == 0 // this command not found
2662 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2669 case RC_DEFAULT_OTF_VIEW_FORMAT:
2670 if ((ignore_system_lyxrc ||
2671 default_otf_view_format != system_lyxrc.default_otf_view_format)
2672 && !default_otf_view_format.empty()) {
2673 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2678 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2679 if ((ignore_system_lyxrc ||
2680 default_platex_view_format != system_lyxrc.default_platex_view_format)
2681 && !default_platex_view_format.empty()) {
2682 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2687 case RC_DEFAULT_VIEW_FORMAT:
2688 if (ignore_system_lyxrc ||
2689 default_view_format != system_lyxrc.default_view_format) {
2690 os << "\\default_view_format " << default_view_format << '\n';
2701 << "# CONVERTERS SECTION ##########################\n"
2706 // Look for new converters
2707 for (Converters::const_iterator cit = theConverters().begin();
2708 cit != theConverters().end(); ++cit) {
2709 Converter const * converter =
2710 theSystemConverters().getConverter(cit->from(),
2713 converter->command() != cit->command() ||
2714 converter->flags() != cit->flags())
2715 os << "\\converter \"" << cit->from() << "\" \""
2716 << cit->to() << "\" \""
2717 << escapeCommand(cit->command()) << "\" \""
2718 << cit->flags() << "\"\n";
2721 // New/modifed converters
2722 for (Converters::const_iterator cit = theSystemConverters().begin();
2723 cit != theSystemConverters().end(); ++cit)
2724 if (!theConverters().getConverter(cit->from(), cit->to()))
2725 os << "\\converter \"" << cit->from()
2726 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2733 << "# COPIERS SECTION ##########################\n"
2736 // Look for new movers
2737 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2738 Movers::const_iterator const sysend = theSystemMovers().end();
2739 Movers::const_iterator it = theMovers().begin();
2740 Movers::const_iterator end = theMovers().end();
2742 for (; it != end; ++it) {
2743 Movers::const_iterator const sysit =
2744 find_if(sysbegin, sysend, SameMover(*it));
2745 if (sysit == sysend) {
2746 string const & fmt = it->first;
2747 string const & command =
2748 it->second.command();
2750 os << "\\copier " << fmt
2751 << " \"" << escapeCommand(command) << "\"\n";
2757 // We don't actually delete SpecialisedMover(s) from the
2758 // map, just clear their 'command', so there's no need
2759 // to test for anything else.
2766 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2768 // Why the switch you might ask. It is a trick to ensure that all
2769 // the elements in the LyXRCTags enum is handled. As you can see
2770 // there are no breaks at all. So it is just a huge fall-through.
2771 // The nice thing is that we will get a warning from the compiler
2772 // if we forget an element.
2773 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2775 case LyXRC::RC_LAST:
2776 case LyXRC::RC_ACCEPT_COMPOUND:
2777 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2778 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2780 case LyXRC::RC_ALT_LANG:
2781 case LyXRC::RC_PLAINTEXT_LINELEN:
2782 case LyXRC::RC_AUTOCORRECTION_MATH:
2783 case LyXRC::RC_AUTOREGIONDELETE:
2784 case LyXRC::RC_AUTORESET_OPTIONS:
2785 case LyXRC::RC_AUTOSAVE:
2786 case LyXRC::RC_AUTO_NUMBER:
2787 case LyXRC::RC_BACKUPDIR_PATH:
2788 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2789 case LyXRC::RC_BIBTEX_COMMAND:
2790 case LyXRC::RC_BINDFILE:
2791 case LyXRC::RC_CITATION_SEARCH_VIEW:
2792 case LyXRC::RC_CHECKLASTFILES:
2793 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2794 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2795 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2796 case LyXRC::RC_COMPLETION_INLINE_MATH:
2797 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2798 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2799 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2800 case LyXRC::RC_COMPLETION_POPUP_MATH:
2801 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2802 case LyXRC::RC_COMPLETION_MINLENGTH:
2803 case LyXRC::RC_USELASTFILEPOS:
2804 case LyXRC::RC_LOADSESSION:
2805 case LyXRC::RC_CHKTEX_COMMAND:
2806 case LyXRC::RC_CONVERTER:
2807 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2808 case LyXRC::RC_COPIER:
2809 case LyXRC::RC_CT_ADDITIONS_UNDERLINED:
2810 case LyXRC::RC_CT_MARKUP_COPIED:
2811 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2812 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2813 case LyXRC::RC_GUI_LANGUAGE:
2814 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2815 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2816 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2817 case LyXRC::RC_DEFFILE:
2818 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2819 case LyXRC::RC_DISPLAY_GRAPHICS:
2820 case LyXRC::RC_DOCUMENTPATH:
2821 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2822 FileName path(lyxrc_new.document_path);
2823 if (path.exists() && path.isDirectory())
2824 package().document_dir() = FileName(lyxrc.document_path);
2827 case LyXRC::RC_EDITOR_ALTERNATIVES:
2828 case LyXRC::RC_ESC_CHARS:
2829 case LyXRC::RC_EXAMPLEPATH:
2830 case LyXRC::RC_FILEFORMAT:
2831 case LyXRC::RC_GROUP_LAYOUTS:
2832 case LyXRC::RC_HUNSPELLDIR_PATH:
2833 case LyXRC::RC_ICON_SET:
2834 case LyXRC::RC_INDEX_ALTERNATIVES:
2835 case LyXRC::RC_INDEX_COMMAND:
2836 case LyXRC::RC_JBIBTEX_COMMAND:
2837 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2838 case LyXRC::RC_JINDEX_COMMAND:
2839 case LyXRC::RC_NOMENCL_COMMAND:
2840 case LyXRC::RC_PYGMENTIZE_COMMAND:
2841 case LyXRC::RC_INPUT:
2842 case LyXRC::RC_KBMAP:
2843 case LyXRC::RC_KBMAP_PRIMARY:
2844 case LyXRC::RC_KBMAP_SECONDARY:
2845 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2846 case LyXRC::RC_LANGUAGE_AUTO_END:
2847 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2848 case LyXRC::RC_LANGUAGE_COMMAND_END:
2849 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2850 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2851 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2852 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2853 case LyXRC::RC_LYXRCFORMAT:
2854 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2855 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2856 case LyXRC::RC_MACRO_EDIT_STYLE:
2857 case LyXRC::RC_MAKE_BACKUP:
2858 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2859 case LyXRC::RC_RESPECT_OS_KBD_LANGUAGE:
2860 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2861 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2862 case LyXRC::RC_NUMLASTFILES:
2863 case LyXRC::RC_PARAGRAPH_MARKERS:
2864 case LyXRC::RC_PATH_PREFIX:
2865 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2866 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
2867 // Resets python path
2868 support::os::python(true);
2871 case LyXRC::RC_PREVIEW:
2872 if (lyxrc_orig.preview != lyxrc_new.preview) {
2873 // Update all previews of all documents.
2874 /* FIXME: this can be very expensive. It would be cheaper
2875 * to kill all existing previews and update visible
2877 theBufferList().updatePreviews();
2880 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2881 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2882 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2883 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2884 case LyXRC::RC_PRINTPAPERFLAG:
2885 case LyXRC::RC_SAVE_COMPRESSED:
2886 case LyXRC::RC_SAVE_ORIGIN:
2887 case LyXRC::RC_SCREEN_DPI:
2889 case LyXRC::RC_SCREEN_FONT_ROMAN:
2890 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2891 case LyXRC::RC_SCREEN_FONT_SANS:
2892 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2893 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2894 case LyXRC::RC_SCREEN_FONT_SIZES:
2895 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2896 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2897 case LyXRC::RC_SCREEN_ZOOM:
2898 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
2899 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
2900 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
2901 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
2902 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
2903 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
2904 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
2905 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
2906 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
2907 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
2910 case LyXRC::RC_GEOMETRY_SESSION:
2911 case LyXRC::RC_SERVERPIPE:
2912 case LyXRC::RC_SET_COLOR:
2913 case LyXRC::RC_SHOW_BANNER:
2914 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2915 case LyXRC::RC_SPELLCHECKER:
2916 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2919 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2920 case LyXRC::RC_SPELLCHECK_NOTES:
2921 case LyXRC::RC_SPLITINDEX_COMMAND:
2922 case LyXRC::RC_TEMPDIRPATH:
2923 case LyXRC::RC_TEMPLATEPATH:
2924 case LyXRC::RC_TEX_ALLOWS_SPACES:
2925 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2926 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2927 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2930 case LyXRC::RC_TEXINPUTS_PREFIX:
2931 case LyXRC::RC_THESAURUSDIRPATH:
2932 case LyXRC::RC_UIFILE:
2933 case LyXRC::RC_USER_EMAIL:
2934 case LyXRC::RC_USER_INITIALS:
2935 case LyXRC::RC_USER_NAME:
2936 case LyXRC::RC_USE_CONVERTER_CACHE:
2937 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2938 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2939 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
2940 case LyXRC::RC_USE_SYSTEM_COLORS:
2941 case LyXRC::RC_USE_TOOLTIP:
2942 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2943 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2944 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2945 case LyXRC::RC_SINGLE_INSTANCE:
2946 case LyXRC::RC_SORT_LAYOUTS:
2947 case LyXRC::RC_FULL_SCREEN_LIMIT:
2948 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2949 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2950 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2951 case LyXRC::RC_FULL_SCREEN_TABBAR:
2952 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2953 case LyXRC::RC_FULL_SCREEN_WIDTH:
2954 case LyXRC::RC_VISUAL_CURSOR:
2955 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2956 case LyXRC::RC_VIEWER:
2957 case LyXRC::RC_VIEWER_ALTERNATIVES:
2958 case LyXRC::RC_FORWARD_SEARCH_DVI:
2959 case LyXRC::RC_FORWARD_SEARCH_PDF:
2960 case LyXRC::RC_EXPORT_OVERWRITE:
2961 case LyXRC::RC_DEFAULT_DECIMAL_SEP:
2962 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2963 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2964 case LyXRC::RC_CURSOR_WIDTH:
2970 set<string> LyXRC::getRCs()
2973 for (int i = 0; i != lyxrcCount; ++i)
2974 res.insert(ltrim(lyxrcTags[i].tag, "\\"));
2980 string const LyXRC::getDescription(LyXRCTags tag)
2985 case RC_ACCEPT_COMPOUND:
2986 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2990 str = _("Specify an alternate language. The default is to use the language of the document.");
2993 case RC_PLAINTEXT_LINELEN:
2994 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.");
2997 case RC_AUTOREGIONDELETE:
2998 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3001 case RC_AUTORESET_OPTIONS:
3002 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3006 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3009 case RC_AUTO_NUMBER:
3012 case RC_BACKUPDIR_PATH:
3013 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.");
3016 case RC_BIBTEX_COMMAND:
3017 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3020 case RC_JBIBTEX_COMMAND:
3021 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3025 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3028 case RC_CHECKLASTFILES:
3029 str = _("Select to check whether the lastfiles still exist.");
3032 case RC_CHKTEX_COMMAND:
3033 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3039 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3040 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3043 case RC_CONVERTER_NEEDAUTH:
3044 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3050 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3051 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.");
3054 case RC_CURSOR_WIDTH:
3055 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3058 case RC_SCROLL_BELOW_DOCUMENT:
3059 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");
3062 case RC_MAC_DONTSWAP_CTRL_META:
3063 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3066 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3067 str = _("Use the Mac OS X conventions for cursor movement");
3070 case RC_SHOW_MACRO_LABEL:
3071 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3075 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3078 case RC_DEFAULT_OTF_VIEW_FORMAT:
3079 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3082 case RC_DEFAULT_VIEW_FORMAT:
3083 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3086 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3087 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3090 case RC_DISPLAY_GRAPHICS:
3091 str = _("Select how LyX will display any graphics.");
3094 case RC_DOCUMENTPATH:
3095 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3099 str = _("Specify additional chars that can be part of a word.");
3102 case RC_EXAMPLEPATH:
3103 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3109 case RC_INDEX_COMMAND:
3110 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\".");
3113 case RC_JINDEX_COMMAND:
3114 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3117 case RC_NOMENCL_COMMAND:
3118 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3121 case RC_PYGMENTIZE_COMMAND:
3122 str = _("The command to run the python pygments syntax highlighter.");
3129 case RC_KBMAP_PRIMARY:
3130 case RC_KBMAP_SECONDARY:
3131 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.");
3134 case RC_LANGUAGE_AUTO_BEGIN:
3135 str = _("Select if a language switching command is needed at the beginning of the document.");
3138 case RC_LANGUAGE_AUTO_END:
3139 str = _("Select if a language switching command is needed at the end of the document.");
3142 case RC_LANGUAGE_COMMAND_BEGIN:
3143 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.");
3146 case RC_LANGUAGE_COMMAND_END:
3147 str = _("The LaTeX command for changing back to the language of the document.");
3150 case RC_LANGUAGE_COMMAND_LOCAL:
3151 str = _("The LaTeX command for local changing of the language.");
3154 case RC_LANGUAGE_GLOBAL_OPTIONS:
3155 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3158 case RC_LANGUAGE_CUSTOM_PACKAGE:
3159 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3162 case RC_LANGUAGE_PACKAGE_SELECTION:
3163 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3166 case RC_USELASTFILEPOS:
3167 str = _("De-select if you do not want LyX to scroll to saved position.");
3170 case RC_LOADSESSION:
3171 str = _("De-select to prevent loading files opened from the last LyX session.");
3174 case RC_MAKE_BACKUP:
3175 str = _("De-select if you don't want LyX to create backup files.");
3178 case RC_MARK_FOREIGN_LANGUAGE:
3179 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3182 case RC_RESPECT_OS_KBD_LANGUAGE:
3183 str = _("Select to use the current keyboard language, as set from the operating system, as default input language.");
3186 case RC_MOUSE_WHEEL_SPEED:
3187 str = _("The scrolling speed of the mouse wheel.");
3190 case RC_COMPLETION_POPUP_DELAY:
3191 str = _("The completion popup delay.");
3194 case RC_COMPLETION_POPUP_MATH:
3195 str = _("Select to display the completion popup in math mode.");
3198 case RC_COMPLETION_POPUP_TEXT:
3199 str = _("Select to display the completion popup in text mode.");
3202 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3203 str = _("Show the completion popup without delay after non-unique completion attempt.");
3206 case RC_COMPLETION_POPUP_TEXT:
3207 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3210 case RC_COMPLETION_POPUP_DELAY:
3211 str = _("The inline completion delay.");
3214 case RC_COMPLETION_INLINE_MATH:
3215 str = _("Select to display the inline completion in math mode.");
3218 case RC_COMPLETION_INLINE_TEXT:
3219 str = _("Select to display the inline completion in text mode.");
3222 case RC_COMPLETION_INLINE_DOTS:
3223 str = _("Use \"...\" to shorten long completions.");
3226 case RC_AUTOCORRECTION_MATH:
3227 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3230 case RC_NUMLASTFILES:
3231 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3235 case RC_PATH_PREFIX:
3236 str = _("Specify those directories which should be "
3237 "prepended to the PATH environment variable.\n"
3238 "Use the OS native format.");
3242 str = _("Shows a typeset preview of things such as math");
3245 case RC_PREVIEW_HASHED_LABELS:
3246 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3249 case RC_PREVIEW_SCALE_FACTOR:
3250 str = _("Scale the preview size to suit.");
3253 case RC_PRINTLANDSCAPEFLAG:
3254 str = _("The option to print out in landscape.");
3257 case RC_PRINTPAPERDIMENSIONFLAG:
3258 str = _("Option to specify the dimensions of the print paper.");
3261 case RC_PRINTPAPERFLAG:
3262 str = _("The option to specify paper type.");
3265 case RC_VISUAL_CURSOR:
3266 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3269 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3270 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).");
3274 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3277 case RC_SCREEN_FONT_ROMAN:
3278 case RC_SCREEN_FONT_SANS:
3279 case RC_SCREEN_FONT_TYPEWRITER:
3280 str = _("The screen fonts used to display the text while editing.");
3283 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3284 case RC_SCREEN_FONT_SANS_FOUNDRY:
3285 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3288 case RC_SCREEN_FONT_SCALABLE:
3289 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.");
3292 case RC_SCREEN_FONT_SIZES:
3293 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3296 case RC_SCREEN_ZOOM:
3297 //xgettext:no-c-format
3298 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3301 case RC_GEOMETRY_SESSION:
3302 str = _("Allow session manager to save and restore windows geometry.");
3306 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3312 case RC_SHOW_BANNER:
3313 str = _("De-select if you don't want the startup banner.");
3316 case RC_TEMPDIRPATH:
3317 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3320 case RC_THESAURUSDIRPATH:
3321 str = _("This is the place where the files of the thesaurus library reside.");
3324 case RC_TEMPLATEPATH:
3325 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3328 case RC_TEX_ALLOWS_SPACES:
3331 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3334 case RC_TEXINPUTS_PREFIX:
3335 str = _("Specify those directories which should be "
3336 "prepended to the TEXINPUTS environment variable.\n"
3337 "A '.' represents the current document directory. "
3338 "Use the OS native format.");
3342 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3351 case RC_USE_USE_SYSTEM_COLORS:
3352 str = _("Enable use the system colors for some things like main window background and selection.");
3355 case RC_USE_TOOLTIP:
3356 str = _("Enable the automatic appearance of tool tips in the work area.");
3359 case RC_VIEWDVI_PAPEROPTION:
3360 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3375 // The global instance
3378 // The global copy of the system lyxrc entries (everything except preferences)