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"
30 #include "SpellChecker.h"
33 #include "graphics/GraphicsTypes.h"
35 #include "support/convert.h"
36 #include "support/debug.h"
37 #include "support/environment.h"
38 #include "support/FileName.h"
39 #include "support/filetools.h"
40 #include "support/gettext.h"
41 #include "support/lstrings.h"
42 #include "support/os.h"
43 #include "support/Package.h"
44 #include "support/TempFile.h"
45 #include "support/userinfo.h"
52 using namespace lyx::support;
56 namespace os = support::os;
60 // The format should also be updated in configure.py, and conversion code
61 // should be added to prefs2prefs_prefs.py.
62 static unsigned int const LYXRC_FILEFORMAT = 21; // spitz: jbibtex_alternatives
64 // when adding something to this array keep it sorted!
65 LexerKeyword lyxrcTags[] = {
66 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
67 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
68 { "\\alternate_language", LyXRC::RC_ALT_LANG },
69 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
70 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
71 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
72 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
73 { "\\autosave", LyXRC::RC_AUTOSAVE },
74 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
75 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
76 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77 { "\\bind_file", LyXRC::RC_BINDFILE },
78 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
81 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
82 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
83 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
84 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
85 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
86 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
87 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
88 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
89 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
90 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
91 { "\\converter", LyXRC::RC_CONVERTER },
92 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
93 { "\\copier", LyXRC::RC_COPIER },
94 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
95 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
96 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
97 { "\\def_file", LyXRC::RC_DEFFILE },
98 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
99 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
100 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
101 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
102 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
103 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
104 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
105 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
106 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
107 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
108 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
109 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
110 { "\\format", LyXRC::RC_FILEFORMAT },
111 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
112 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
113 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
114 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
115 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
116 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
117 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
118 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
119 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
120 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
121 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
122 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
123 { "\\icon_set", LyXRC::RC_ICON_SET },
124 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
125 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
126 { "\\input", LyXRC::RC_INPUT },
127 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
128 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
129 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
130 { "\\kbmap", LyXRC::RC_KBMAP },
131 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
132 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
133 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
134 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
135 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
136 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
137 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
138 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
139 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
140 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
141 { "\\load_session", LyXRC::RC_LOADSESSION },
142 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
143 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
144 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
145 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
146 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
147 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
148 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
149 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
150 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
151 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
152 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
153 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
154 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
155 { "\\preview", LyXRC::RC_PREVIEW },
156 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
157 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
160 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
161 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
162 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
163 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
164 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
165 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
166 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
167 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
168 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
169 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
170 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
171 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
172 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
173 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
174 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
175 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
176 { "\\set_color", LyXRC::RC_SET_COLOR },
177 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
178 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
179 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
180 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
181 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
182 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
183 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
184 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
185 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
186 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
187 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
188 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
189 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
190 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
191 { "\\ui_file", LyXRC::RC_UIFILE },
192 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
193 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
194 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
195 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
196 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
197 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
198 // compatibility with versions older than 1.4.0 only
199 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
200 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
201 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
202 { "\\user_email", LyXRC::RC_USER_EMAIL },
203 { "\\user_name", LyXRC::RC_USER_NAME },
204 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
205 // compatibility with versions older than 1.4.0 only
206 { "\\viewer", LyXRC::RC_VIEWER},
207 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
208 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
209 { "format", LyXRC::RC_LYXRCFORMAT }
212 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
223 void LyXRC::setDefaults()
226 use_system_theme_icons = false;
228 def_file = "default";
230 // The current document directory
231 texinputs_prefix = ".";
232 print_landscape_flag = "-t landscape";
233 print_paper_flag = "-t";
234 print_paper_dimension_flag = "-T";
235 document_path.erase();
236 view_dvi_paper_option.erase();
237 default_view_format = "pdf2";
238 default_otf_view_format = "pdf4";
239 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
240 bibtex_command = "automatic";
242 index_command = "makeindex -c -q";
243 nomencl_command = "makeindex -s nomencl.ist";
245 // Because a screen is typically wider than a piece of paper:
248 allow_geometry_session = true;
249 // Default LaTeX font size:
250 font_sizes[FONT_SIZE_TINY] = "5.0";
251 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
252 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
253 font_sizes[FONT_SIZE_SMALL] = "9.0";
254 font_sizes[FONT_SIZE_NORMAL] = "10.0";
255 font_sizes[FONT_SIZE_LARGE] = "12.0";
256 font_sizes[FONT_SIZE_LARGER] = "14.4";
257 font_sizes[FONT_SIZE_LARGEST] = "17.26";
258 font_sizes[FONT_SIZE_HUGE] = "20.74";
259 font_sizes[FONT_SIZE_HUGER] = "24.88";
260 use_scalable_fonts = true;
261 roman_font_name = "";
263 typewriter_font_name = "";
265 auto_region_delete = true;
266 auto_reset_options = false;
267 plaintext_linelen = 65;
268 mouse_wheel_speed = 1.0;
270 check_lastfiles = true;
271 use_lastfilepos = true;
272 load_session = false;
274 save_compressed = false;
276 backupdir_path.erase();
277 display_graphics = true;
278 // Spellchecker settings:
279 // FIXME: this check should test the target platform (darwin)
280 #if defined(USE_MACOSX_PACKAGING)
281 spellchecker = "native";
282 #elif defined(USE_ASPELL)
283 spellchecker = "aspell";
284 #elif defined(USE_HUNSPELL)
285 spellchecker = "hunspell";
287 spellchecker = "aspell";
289 spellchecker_accept_compound = false;
290 spellcheck_continuously = false;
291 completion_minlength = 6;
292 spellcheck_notes = true;
294 visual_cursor = false;
296 mark_foreign_language = true;
297 language_auto_begin = true;
298 language_auto_end = true;
299 language_global_options = true;
300 language_package_selection = LP_AUTO;
301 language_custom_package = "\\usepackage{babel}";
302 language_command_begin = "\\selectlanguage{$$lang}";
303 language_command_local = "\\foreignlanguage{$$lang}{";
304 sort_layouts = false;
305 group_layouts = true;
306 gui_language = "auto";
308 windows_style_tex_paths = false;
309 tex_allows_spaces = false;
310 date_insert_format = "%x";
311 cursor_follows_scrollbar = false;
312 scroll_below_document = false;
313 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
314 paragraph_markers = false;
315 mac_dontswap_ctrl_meta = false;
316 mac_like_cursor_movement = false;
317 macro_edit_style = MACRO_EDIT_INLINE_BOX;
318 dialogs_iconify_with_main = false;
319 preview = PREVIEW_OFF;
320 preview_hashed_labels = false;
321 preview_scale_factor = 1.0;
322 use_converter_cache = true;
323 use_converter_needauth_forbidden = true;
324 use_converter_needauth = true;
325 use_system_colors = false;
327 use_pixmap_cache = false;
329 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
330 user_name = to_utf8(support::user_name());
331 user_email = to_utf8(support::user_email());
332 open_buffers_in_tabs = true;
333 single_close_tab_button = false;
334 single_instance = true;
335 forward_search_dvi = string();
336 forward_search_pdf = string();
337 export_overwrite = NO_FILES;
339 // Fullscreen settings
340 full_screen_limit = false;
341 full_screen_toolbars = true;
342 full_screen_tabbar = true;
343 full_screen_menubar = true;
344 full_screen_statusbar = true;
345 full_screen_scrollbar = true;
346 full_screen_width = 700;
348 completion_cursor_text = true;
349 completion_popup_math = true;
350 completion_popup_text = false;
351 completion_popup_delay = 2.0;
352 completion_popup_after_complete = true;
353 autocorrection_math = false;
354 completion_inline_math = true;
355 completion_inline_text = false;
356 completion_inline_dots = -1;
357 completion_inline_delay = 0.2;
358 default_decimal_point = ".";
359 default_length_unit = Length::CM;
361 close_buffer_with_last_view = "yes";
362 mouse_middlebutton_paste = true;
368 void oldFontFormat(string & family, string & foundry)
370 if (family.empty() || family[0] != '-')
372 foundry = token(family, '-', 1);
373 family = token(family, '-', 2);
381 bool LyXRC::read(FileName const & filename, bool check_format)
383 Lexer lexrc(lyxrcTags);
384 lexrc.setFile(filename);
385 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
386 ReturnValues retval = read(lexrc, check_format);
387 if (!check_format || retval != FormatMismatch)
388 return retval == ReadOK;
390 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
391 TempFile tmp("convert_lyxrc");
392 FileName const tempfile = tmp.name();
393 bool const success = prefs2prefs(filename, tempfile, false);
395 LYXERR0 ("Unable to convert " << filename.absFileName() <<
396 " to format " << LYXRC_FILEFORMAT);
399 // Keep this in the else branch, such that lexrc2 goes out
400 // of scope and releases the lock on tempfile before we
401 // attempt to remove it. This matters on Windows.
402 Lexer lexrc2(lyxrcTags);
403 lexrc2.setFile(tempfile);
404 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
405 retval = read(lexrc2, check_format);
407 return retval == ReadOK;
411 // don't need to worry about conversion, because this is always
412 // from an internal source
413 bool LyXRC::read(istream & is)
415 Lexer lexrc(lyxrcTags);
417 LYXERR(Debug::LYXRC, "Reading istream...");
418 return read(lexrc, false) == ReadOK;
422 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
424 if (lyxerr.debugging(Debug::PARSER))
425 lexrc.printTable(lyxerr);
430 // format prior to 2.0 and introduction of format tag
431 unsigned int format = 0;
433 while (lexrc.isOK()) {
434 // By using two switches we take advantage of the compiler
435 // telling us if we have missed a LyXRCTags element in
436 // the second switch.
437 // Note that this also shows a problem with Lexer since it
438 // helps us avoid taking advantage of the strictness of the
441 int le = lexrc.lex();
443 case Lexer::LEX_UNDEF:
444 lexrc.printError("Unknown tag `$$Token'");
446 case Lexer::LEX_FEOF:
451 switch (static_cast<LyXRCTags>(le)) {
454 format = lexrc.getInteger();
456 case RC_INPUT: // Include file
459 libFileSearch(string(),
461 if (read(tmp, check_format)) {
463 "Error reading included file: " + tmp.absFileName());
469 bind_file = os::internal_path(lexrc.getString());
474 def_file = os::internal_path(lexrc.getString());
479 ui_file = os::internal_path(lexrc.getString());
482 case RC_AUTORESET_OPTIONS:
483 lexrc >> auto_reset_options;
486 case RC_DISPLAY_GRAPHICS:
488 display_graphics = lexrc.getString() == "true";
491 case RC_TEX_EXPECTS_WINDOWS_PATHS:
492 lexrc >> windows_style_tex_paths;
495 case RC_TEX_ALLOWS_SPACES:
496 lexrc >> tex_allows_spaces;
499 case RC_TEXINPUTS_PREFIX:
500 lexrc >> texinputs_prefix;
507 case RC_KBMAP_PRIMARY:
509 string const kmap(os::internal_path(lexrc.getString()));
510 if (!libFileSearch("kbd", kmap, "kmap").empty()
512 primary_kbmap = kmap;
514 lexrc.printError("LyX: Keymap `$$Token' not found");
519 case RC_KBMAP_SECONDARY:
521 string const kmap(os::internal_path(lexrc.getString()));
522 if (!libFileSearch("kbd", kmap, "kmap").empty()
524 secondary_kbmap = kmap;
526 lexrc.printError("LyX: Keymap `$$Token' not found");
531 case RC_FONT_ENCODING:
535 case RC_PRINTLANDSCAPEFLAG:
536 lexrc >> print_landscape_flag;
539 case RC_PRINTPAPERDIMENSIONFLAG:
540 lexrc >> print_paper_dimension_flag;
543 case RC_PRINTPAPERFLAG:
544 lexrc >> print_paper_flag;
547 case RC_VIEWDVI_PAPEROPTION:
549 view_dvi_paper_option = lexrc.getString();
551 view_dvi_paper_option.erase();
554 case RC_CHKTEX_COMMAND:
555 if (lexrc.next(true)) {
556 chktex_command = lexrc.getString();
560 case RC_BIBTEX_ALTERNATIVES:
561 if (lexrc.next(true)) {
562 bibtex_alternatives.insert(lexrc.getString());
566 case RC_BIBTEX_COMMAND:
567 if (lexrc.next(true)) {
568 bibtex_command = lexrc.getString();
572 case RC_JBIBTEX_COMMAND:
573 if (lexrc.next(true)) {
574 jbibtex_command = lexrc.getString();
578 case RC_JBIBTEX_ALTERNATIVES:
579 if (lexrc.next(true)) {
580 jbibtex_alternatives.insert(lexrc.getString());
584 case RC_INDEX_ALTERNATIVES:
585 if (lexrc.next(true)) {
586 index_alternatives.insert(lexrc.getString());
590 case RC_INDEX_COMMAND:
591 if (lexrc.next(true)) {
592 index_command = lexrc.getString();
596 case RC_JINDEX_COMMAND:
597 if (lexrc.next(true)) {
598 jindex_command = lexrc.getString();
602 case RC_SPLITINDEX_COMMAND:
603 if (lexrc.next(true)) {
604 splitindex_command = lexrc.getString();
608 case RC_NOMENCL_COMMAND:
609 if (lexrc.next(true)) {
610 nomencl_command = lexrc.getString();
624 case RC_GEOMETRY_SESSION:
625 lexrc >> allow_geometry_session;
628 case RC_SCREEN_FONT_SIZES:
629 lexrc >> font_sizes[FONT_SIZE_TINY];
630 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
631 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
632 lexrc >> font_sizes[FONT_SIZE_SMALL];
633 lexrc >> font_sizes[FONT_SIZE_NORMAL];
634 lexrc >> font_sizes[FONT_SIZE_LARGE];
635 lexrc >> font_sizes[FONT_SIZE_LARGER];
636 lexrc >> font_sizes[FONT_SIZE_LARGEST];
637 lexrc >> font_sizes[FONT_SIZE_HUGE];
638 lexrc >> font_sizes[FONT_SIZE_HUGER];
641 case RC_SCREEN_FONT_SCALABLE:
642 lexrc >> use_scalable_fonts;
649 case RC_DOCUMENTPATH:
651 document_path = os::internal_path(lexrc.getString());
656 example_path = os::internal_path(lexrc.getString());
659 case RC_TEMPLATEPATH:
661 template_path = os::internal_path(lexrc.getString());
666 tempdir_path = os::internal_path(lexrc.getString());
669 case RC_THESAURUSDIRPATH:
671 thesaurusdir_path = os::internal_path(lexrc.getString());
674 case RC_HUNSPELLDIR_PATH:
676 hunspelldir_path = os::internal_path(lexrc.getString());
679 case RC_USELASTFILEPOS:
680 lexrc >> use_lastfilepos;
684 lexrc >> load_session;
687 case RC_MOUSE_WHEEL_SPEED:
688 lexrc >> mouse_wheel_speed;
691 case RC_COMPLETION_INLINE_DELAY:
692 lexrc >> completion_inline_delay;
695 case RC_COMPLETION_INLINE_MATH:
696 lexrc >> completion_inline_math;
699 case RC_COMPLETION_INLINE_TEXT:
700 lexrc >> completion_inline_text;
703 case RC_COMPLETION_INLINE_DOTS:
704 lexrc >> completion_inline_dots;
707 case RC_AUTOCORRECTION_MATH:
708 lexrc >> autocorrection_math;
711 case RC_COMPLETION_POPUP_DELAY:
712 lexrc >> completion_popup_delay;
715 case RC_COMPLETION_POPUP_MATH:
716 lexrc >> completion_popup_math;
719 case RC_COMPLETION_POPUP_TEXT:
720 lexrc >> completion_popup_text;
723 case RC_COMPLETION_CURSOR_TEXT:
724 lexrc >> completion_cursor_text;
727 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
728 lexrc >> completion_popup_after_complete;
731 case RC_COMPLETION_MINLENGTH:
732 lexrc >> completion_minlength;
735 case RC_NUMLASTFILES:
736 lexrc >> num_lastfiles;
739 case RC_CHECKLASTFILES:
740 lexrc >> check_lastfiles;
747 case RC_USE_SYSTEM_THEME_ICONS:
748 lexrc >> use_system_theme_icons;
751 case RC_SCREEN_FONT_ROMAN:
753 roman_font_name = lexrc.getString();
754 oldFontFormat(roman_font_name,
759 case RC_SCREEN_FONT_SANS:
761 sans_font_name = lexrc.getString();
762 oldFontFormat(sans_font_name, sans_font_foundry);
766 case RC_SCREEN_FONT_TYPEWRITER:
768 typewriter_font_name = lexrc.getString();
769 oldFontFormat(typewriter_font_name,
770 typewriter_font_foundry);
774 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
775 lexrc >> roman_font_foundry;
778 case RC_SCREEN_FONT_SANS_FOUNDRY:
779 lexrc >> sans_font_foundry;
782 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
783 lexrc >> typewriter_font_foundry;
788 lexrc.printError("Missing color tag.");
791 string lyx_name = lexrc.getString();
794 lexrc.printError("Missing color name for color: `$$Token'");
797 string x11_name = lexrc.getString();
799 ColorCode const col =
800 lcolor.getFromLyXName(lyx_name);
801 if (col == Color_none ||
802 col == Color_inherit ||
806 if (!lcolor.setColor(col, x11_name))
807 LYXERR0("Bad lyxrc set_color for " << lyx_name);
811 case RC_AUTOREGIONDELETE:
812 // Auto region delete defaults to true
813 lexrc >> auto_region_delete;
818 lyxpipes = os::internal_path(lexrc.getString());
821 case RC_CURSOR_FOLLOWS_SCROLLBAR:
822 lexrc >> cursor_follows_scrollbar;
825 case RC_CURSOR_WIDTH:
826 lexrc >> cursor_width;
829 case RC_SCROLL_BELOW_DOCUMENT:
830 lexrc >> scroll_below_document;
833 case RC_PARAGRAPH_MARKERS:
834 lexrc >> paragraph_markers;
837 case RC_MAC_DONTSWAP_CTRL_META:
838 lexrc >> mac_dontswap_ctrl_meta;
841 case RC_MAC_LIKE_CURSOR_MOVEMENT:
842 lexrc >> mac_like_cursor_movement;
845 case RC_MACRO_EDIT_STYLE:
847 switch (lexrc.getInteger()) {
848 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
849 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
850 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
855 case RC_DIALOGS_ICONIFY_WITH_MAIN:
856 lexrc >> dialogs_iconify_with_main;
859 case RC_PLAINTEXT_LINELEN:
860 lexrc >> plaintext_linelen;
862 // Spellchecker settings:
863 case RC_ACCEPT_COMPOUND:
864 lexrc >> spellchecker_accept_compound;
866 case RC_USE_SYSTEM_COLORS:
867 lexrc >> use_system_colors;
870 lexrc >> use_tooltip;
872 case RC_USE_PIXMAP_CACHE:
873 lexrc >> use_pixmap_cache;
878 case RC_SPELLCHECKER:
879 lexrc >> spellchecker;
882 lexrc >> spellchecker_alt_lang;
885 lexrc >> spellchecker_esc_chars;
887 case RC_SPELLCHECK_CONTINUOUSLY:
888 lexrc >> spellcheck_continuously;
890 case RC_SPELLCHECK_NOTES:
891 lexrc >> spellcheck_notes;
894 lexrc >> make_backup;
896 case RC_SAVE_COMPRESSED:
897 lexrc >> save_compressed;
900 lexrc >> save_origin;
902 case RC_BACKUPDIR_PATH:
904 backupdir_path = os::internal_path(lexrc.getString());
906 case RC_DEFAULT_DECIMAL_POINT:
907 lexrc >> default_decimal_point;
909 case RC_DEFAULT_LENGTH_UNIT:
911 default_length_unit = (Length::UNIT) lexrc.getInteger();
913 case RC_DATE_INSERT_FORMAT:
914 lexrc >> date_insert_format;
916 case RC_LANGUAGE_CUSTOM_PACKAGE:
917 lexrc >> language_custom_package;
919 case RC_LANGUAGE_AUTO_BEGIN:
920 lexrc >> language_auto_begin;
922 case RC_LANGUAGE_AUTO_END:
923 lexrc >> language_auto_end;
925 case RC_LANGUAGE_GLOBAL_OPTIONS:
926 lexrc >> language_global_options;
928 case RC_LANGUAGE_PACKAGE_SELECTION:
930 switch (lexrc.getInteger()) {
932 language_package_selection = LP_AUTO;
935 language_package_selection = LP_BABEL;
938 language_package_selection = LP_CUSTOM;
941 language_package_selection = LP_NONE;
946 case RC_LANGUAGE_COMMAND_BEGIN:
947 lexrc >> language_command_begin;
949 case RC_LANGUAGE_COMMAND_END:
950 lexrc >> language_command_end;
952 case RC_LANGUAGE_COMMAND_LOCAL:
953 lexrc >> language_command_local;
955 case RC_VISUAL_CURSOR:
956 lexrc >> visual_cursor;
958 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
959 lexrc >> close_buffer_with_last_view;
962 lexrc >> auto_number;
964 case RC_MARK_FOREIGN_LANGUAGE:
965 lexrc >> mark_foreign_language;
971 fmt = lexrc.getString();
972 if (lexrc.next(true))
973 command = lexrc.getString();
974 setMover(fmt, command);
979 string from, to, command, flags;
981 from = lexrc.getString();
983 to = lexrc.getString();
984 if (lexrc.next(true))
985 command = lexrc.getString();
987 flags = lexrc.getString();
989 theConverters().erase(from, to);
991 theConverters().add(from, to, command, flags);
994 // compatibility with versions older than 1.4.0 only
996 string format, command;
997 lexrc >> format >> command;
998 theFormats().setViewer(format, command);
1001 case RC_FILEFORMAT: {
1003 string format, extensions, shortcut;
1004 docstring prettyname;
1005 if (!(lexrc >> format >> extensions))
1007 if (ok && lexrc.next(true))
1008 prettyname = lexrc.getDocString();
1012 if(!(lexrc >> shortcut))
1014 string viewer, editor;
1015 if (ok && lexrc.next(true))
1016 viewer = lexrc.getString();
1019 if (ok && lexrc.next(true))
1020 editor = lexrc.getString();
1024 if (!(lexrc >> flags >> mime))
1026 int flgs = Format::none;
1027 while (!flags.empty()) {
1029 flags = split(flags, flag, ',');
1030 if (flag == "document")
1031 flgs |= Format::document;
1032 else if (flag == "vector")
1033 flgs |= Format::vector;
1034 else if (flag == "zipped=native")
1035 flgs |= Format::zipped_native;
1036 else if (flag == "menu=export")
1037 flgs |= Format::export_menu;
1039 LYXERR0("Ignoring unknown flag `"
1040 << flag << "' for format `"
1044 LYXERR0("Syntax error in format " << format);
1045 else if (prettyname.empty()) {
1046 if (theConverters().formatIsUsed(format))
1047 LYXERR0("Can't delete format " << format);
1049 theFormats().erase(format);
1051 theFormats().add(format, extensions, prettyname,
1052 shortcut, viewer, editor, mime, flgs);
1056 case RC_VIEWER_ALTERNATIVES: {
1057 string format, command;
1058 if ((lexrc >> format) && lexrc.next(true)) {
1059 command = lexrc.getString();
1060 viewer_alternatives[format].insert(command);
1064 case RC_EDITOR_ALTERNATIVES: {
1065 string format, command;
1066 if ((lexrc >> format) && lexrc.next(true)) {
1067 command = lexrc.getString();
1068 editor_alternatives[format].insert(command);
1073 case RC_DEFAULT_OTF_VIEW_FORMAT:
1074 lexrc >> default_otf_view_format;
1077 case RC_DEFAULT_VIEW_FORMAT:
1078 lexrc >> default_view_format;
1081 case RC_GUI_LANGUAGE:
1082 lexrc >> gui_language;
1085 case RC_SHOW_BANNER:
1086 lexrc >> show_banner;
1091 string const tmp = lexrc.getString();
1092 if (tmp == "true" || tmp == "on")
1093 preview = PREVIEW_ON;
1094 else if (tmp == "no_math")
1095 preview = PREVIEW_NO_MATH;
1097 preview = PREVIEW_OFF;
1098 if (tmp != "false" && tmp != "off")
1099 LYXERR0("Unrecognized preview status \""
1105 case RC_PREVIEW_HASHED_LABELS:
1106 lexrc >> preview_hashed_labels;
1109 case RC_PREVIEW_SCALE_FACTOR:
1110 lexrc >> preview_scale_factor;
1117 lexrc >> user_email;
1120 case RC_PATH_PREFIX:
1121 lexrc >> path_prefix;
1124 case RC_USE_CONVERTER_CACHE:
1125 lexrc >> use_converter_cache;
1127 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1128 lexrc >> use_converter_needauth_forbidden;
1130 case RC_USE_CONVERTER_NEEDAUTH:
1131 lexrc >> use_converter_needauth;
1133 case RC_CONVERTER_CACHE_MAXAGE:
1134 lexrc >> converter_cache_maxage;
1137 case RC_SORT_LAYOUTS:
1138 lexrc >> sort_layouts;
1140 case RC_GROUP_LAYOUTS:
1141 lexrc >> group_layouts;
1143 case RC_FULL_SCREEN_LIMIT:
1144 lexrc >> full_screen_limit;
1146 case RC_FULL_SCREEN_TOOLBARS:
1147 lexrc >> full_screen_toolbars;
1149 case RC_FULL_SCREEN_SCROLLBAR:
1150 lexrc >> full_screen_scrollbar;
1152 case RC_FULL_SCREEN_STATUSBAR:
1153 lexrc >> full_screen_statusbar;
1155 case RC_FULL_SCREEN_TABBAR:
1156 lexrc >> full_screen_tabbar;
1158 case RC_FULL_SCREEN_MENUBAR:
1159 lexrc >> full_screen_menubar;
1161 case RC_FULL_SCREEN_WIDTH:
1162 lexrc >> full_screen_width;
1164 case RC_OPEN_BUFFERS_IN_TABS:
1165 lexrc >> open_buffers_in_tabs;
1167 case RC_SINGLE_CLOSE_TAB_BUTTON:
1168 lexrc >> single_close_tab_button;
1170 case RC_SINGLE_INSTANCE:
1171 lexrc >> single_instance;
1172 if (run_mode == PREFERRED)
1173 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1175 case RC_FORWARD_SEARCH_DVI:
1176 if (lexrc.next(true))
1177 forward_search_dvi = lexrc.getString();
1179 case RC_FORWARD_SEARCH_PDF:
1180 if (lexrc.next(true))
1181 forward_search_pdf = lexrc.getString();
1183 case RC_EXPORT_OVERWRITE:
1185 string const tmp = lexrc.getString();
1186 if (tmp == "all" || tmp == "true")
1187 export_overwrite = ALL_FILES;
1188 else if (tmp == "main")
1189 export_overwrite = MAIN_FILE;
1191 export_overwrite = NO_FILES;
1192 if (tmp != "ask" && tmp != "false")
1193 LYXERR0("Unrecognized export_overwrite status \""
1198 case RC_SCROLL_WHEEL_ZOOM:
1200 string const tmp = lexrc.getString();
1202 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1203 else if (tmp == "shift")
1204 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1205 else if (tmp == "alt")
1206 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1208 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1209 if (tmp != "off" && tmp != "false")
1210 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1216 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1217 lexrc >> mouse_middlebutton_paste;
1221 break; // this is just a dummy
1224 // This is triggered the first time through the loop unless
1225 // we hit a format tag.
1226 if (check_format && format != LYXRC_FILEFORMAT)
1227 return FormatMismatch;
1230 /// Update converters data-structures
1231 theConverters().update(theFormats());
1232 theConverters().buildGraph();
1233 theBufferList().invalidateConverterCache();
1239 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1241 ofstream ofs(filename.toFilesystemEncoding().c_str());
1243 write(ofs, ignore_system_lyxrc);
1247 void LyXRC::print() const
1249 if (lyxerr.debugging())
1250 write(lyxerr, false);
1258 typedef pair<string, SpecialisedMover> Data;
1260 SameMover(Data const & comparison)
1261 : comparison_(comparison) {}
1263 bool operator()(Data const & data) const
1265 return data.first == comparison_.first &&
1266 data.second.command() == comparison_.second.command();
1276 // Escape \ and " so that LyXLex can read the string later
1277 string escapeCommand(string const & str) {
1278 return subst(subst(str , "\\", "\\\\"),
1285 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1287 LyXRCTags tag = RC_LAST;
1289 if (!name.empty()) {
1290 for (int i = 0; i != lyxrcCount; ++i)
1291 if ("\\" + name == lyxrcTags[i].tag)
1292 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1296 os << "# LyX " << lyx_version
1297 << " generated this file. If you want to make your own\n"
1298 << "# modifications you should do them from inside LyX and save.\n\n"
1299 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1301 // Why the switch you might ask. It is a trick to ensure that all
1302 // the elements in the LyXRCTags enum are handled. As you can see
1303 // there are no breaks at all. So it is just a huge fall-through.
1304 // The nice thing is that we will get a warning from the compiler
1305 // if we forget an element.
1309 // input/include files are not done here
1310 case RC_LYXRCFORMAT:
1312 if (ignore_system_lyxrc ||
1313 bind_file != system_lyxrc.bind_file) {
1314 string const path = os::external_path(bind_file);
1315 os << "\\bind_file \"" << path << "\"\n";
1321 if (ignore_system_lyxrc ||
1322 def_file != system_lyxrc.def_file) {
1323 string const path = os::external_path(def_file);
1324 os << "\\def_file \"" << path << "\"\n";
1333 << "# MISC SECTION ######################################\n"
1335 // bind files are not done here.
1337 case RC_PATH_PREFIX:
1338 if (ignore_system_lyxrc ||
1339 path_prefix != system_lyxrc.path_prefix) {
1340 os << "\\path_prefix \"" << path_prefix << "\"\n";
1345 if (ignore_system_lyxrc ||
1346 ui_file != system_lyxrc.ui_file) {
1347 string const path = os::external_path(ui_file);
1348 os << "\\ui_file \"" << path << "\"\n";
1352 case RC_AUTOREGIONDELETE:
1353 if (ignore_system_lyxrc ||
1354 auto_region_delete != system_lyxrc.auto_region_delete) {
1355 os << "# Set to false to inhibit automatic replacement of\n"
1356 << "# the current selection.\n"
1357 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1362 case RC_AUTORESET_OPTIONS:
1363 if (ignore_system_lyxrc ||
1364 auto_reset_options != system_lyxrc.auto_reset_options) {
1365 os << "# Set to false to inhibit automatic reset of\n"
1366 << "# the class options to defaults on class change.\n"
1367 << "\\auto_reset_options "
1368 << convert<string>(auto_reset_options)
1374 if (ignore_system_lyxrc ||
1375 autosave != system_lyxrc.autosave) {
1376 os << "# The time interval between auto-saves in seconds.\n"
1377 << "\\autosave " << autosave << '\n';
1381 case RC_DISPLAY_GRAPHICS:
1382 if (ignore_system_lyxrc ||
1383 display_graphics != system_lyxrc.display_graphics) {
1384 os << "# Display graphics within LyX\n"
1386 << "\\display_graphics "
1387 << (display_graphics ? "true" : "false")
1392 case RC_SORT_LAYOUTS:
1393 if (ignore_system_lyxrc ||
1394 sort_layouts != system_lyxrc.sort_layouts) {
1395 os << "# Sort layouts alphabetically.\n"
1396 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1400 case RC_GROUP_LAYOUTS:
1401 if (ignore_system_lyxrc ||
1402 group_layouts != system_lyxrc.group_layouts) {
1403 os << "# Group layouts by their category.\n"
1404 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1408 case RC_VIEWDVI_PAPEROPTION:
1409 if (ignore_system_lyxrc ||
1410 view_dvi_paper_option
1411 != system_lyxrc.view_dvi_paper_option) {
1412 os << "# Options used to specify paper size to the\n"
1413 << "# view_dvi_command (e.g. -paper)\n"
1414 << "\\view_dvi_paper_option \""
1415 << view_dvi_paper_option << "\"\n";
1419 case RC_CHKTEX_COMMAND:
1420 if (ignore_system_lyxrc ||
1421 chktex_command != system_lyxrc.chktex_command) {
1422 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1426 case RC_BIBTEX_ALTERNATIVES: {
1427 CommandSet::const_iterator it = bibtex_alternatives.begin();
1428 CommandSet::const_iterator end = bibtex_alternatives.end();
1429 for ( ; it != end; ++it) {
1430 if (ignore_system_lyxrc
1431 || !system_lyxrc.bibtex_alternatives.count(*it))
1432 os << "\\bibtex_alternatives \""
1438 case RC_BIBTEX_COMMAND:
1439 if (ignore_system_lyxrc ||
1440 bibtex_command != system_lyxrc.bibtex_command) {
1441 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1445 case RC_JBIBTEX_COMMAND:
1446 if (ignore_system_lyxrc ||
1447 jbibtex_command != system_lyxrc.jbibtex_command) {
1448 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1452 case RC_JBIBTEX_ALTERNATIVES: {
1453 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1454 CommandSet::const_iterator end = jbibtex_alternatives.end();
1455 for ( ; it != end; ++it) {
1456 if (ignore_system_lyxrc
1457 || !system_lyxrc.jbibtex_alternatives.count(*it))
1458 os << "\\jbibtex_alternatives \""
1464 case RC_INDEX_ALTERNATIVES: {
1465 CommandSet::const_iterator it = index_alternatives.begin();
1466 CommandSet::const_iterator end = index_alternatives.end();
1467 for ( ; it != end; ++it) {
1468 if (ignore_system_lyxrc
1469 || !system_lyxrc.index_alternatives.count(*it))
1470 os << "\\index_alternatives \""
1476 case RC_INDEX_COMMAND:
1477 if (ignore_system_lyxrc ||
1478 index_command != system_lyxrc.index_command) {
1479 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1483 case RC_JINDEX_COMMAND:
1484 if (ignore_system_lyxrc ||
1485 jindex_command != system_lyxrc.jindex_command) {
1486 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1490 case RC_SPLITINDEX_COMMAND:
1491 if (ignore_system_lyxrc ||
1492 splitindex_command != system_lyxrc.splitindex_command) {
1493 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1497 case RC_NOMENCL_COMMAND:
1498 if (ignore_system_lyxrc ||
1499 nomencl_command != system_lyxrc.nomencl_command) {
1500 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1504 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1505 // Don't write this setting to the preferences file,
1506 // but allow temporary changes (bug 7557).
1507 if (ignore_system_lyxrc) {
1508 os << "\\tex_expects_windows_paths "
1509 << convert<string>(windows_style_tex_paths) << '\n';
1513 case RC_TEX_ALLOWS_SPACES:
1514 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1515 os << "\\tex_allows_spaces "
1516 << convert<string>(tex_allows_spaces) << '\n';
1521 if (ignore_system_lyxrc ||
1522 use_kbmap != system_lyxrc.use_kbmap) {
1523 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1527 case RC_KBMAP_PRIMARY:
1528 if (ignore_system_lyxrc ||
1529 primary_kbmap != system_lyxrc.primary_kbmap) {
1530 string const path = os::external_path(primary_kbmap);
1531 os << "\\kbmap_primary \"" << path << "\"\n";
1535 case RC_KBMAP_SECONDARY:
1536 if (ignore_system_lyxrc ||
1537 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1538 string const path = os::external_path(secondary_kbmap);
1539 os << "\\kbmap_secondary \"" << path << "\"\n";
1544 if (ignore_system_lyxrc ||
1545 lyxpipes != system_lyxrc.lyxpipes) {
1546 string const path = os::external_path(lyxpipes);
1547 os << "\\serverpipe \"" << path << "\"\n";
1551 case RC_DATE_INSERT_FORMAT:
1552 if (ignore_system_lyxrc ||
1553 date_insert_format != system_lyxrc.date_insert_format) {
1554 os << "\\date_insert_format \"" << date_insert_format
1561 os << "\\user_name \"" << user_name << "\"\n";
1566 os << "\\user_email \"" << user_email << "\"\n";
1570 case RC_SHOW_BANNER:
1571 if (ignore_system_lyxrc ||
1572 show_banner != system_lyxrc.show_banner) {
1573 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1579 if (ignore_system_lyxrc ||
1580 preview != system_lyxrc.preview) {
1586 case PREVIEW_NO_MATH:
1593 os << "\\preview " << status << '\n';
1598 case RC_PREVIEW_HASHED_LABELS:
1599 if (ignore_system_lyxrc ||
1600 preview_hashed_labels !=
1601 system_lyxrc.preview_hashed_labels) {
1602 os << "\\preview_hashed_labels "
1603 << convert<string>(preview_hashed_labels) << '\n';
1608 case RC_PREVIEW_SCALE_FACTOR:
1609 if (ignore_system_lyxrc ||
1610 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1611 os << "\\preview_scale_factor "
1612 << preview_scale_factor << '\n';
1617 case RC_USE_CONVERTER_CACHE:
1618 if (ignore_system_lyxrc ||
1619 use_converter_cache != system_lyxrc.use_converter_cache) {
1620 os << "\\use_converter_cache "
1621 << convert<string>(use_converter_cache) << '\n';
1626 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1627 if (ignore_system_lyxrc ||
1628 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1629 os << "\\use_converter_needauth_forbidden "
1630 << convert<string>(use_converter_needauth_forbidden) << '\n';
1635 case RC_USE_CONVERTER_NEEDAUTH:
1636 if (ignore_system_lyxrc ||
1637 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1638 os << "\\use_converter_needauth "
1639 << convert<string>(use_converter_needauth) << '\n';
1644 case RC_CONVERTER_CACHE_MAXAGE:
1645 if (ignore_system_lyxrc ||
1646 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1647 os << "\\converter_cache_maxage "
1648 << converter_cache_maxage << '\n';
1654 << "# SCREEN & FONTS SECTION ############################\n"
1658 if (ignore_system_lyxrc ||
1659 icon_set != system_lyxrc.icon_set) {
1660 os << "\\icon_set \"" << icon_set
1666 case RC_USE_SYSTEM_THEME_ICONS:
1667 if (ignore_system_lyxrc ||
1668 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1669 os << "\\use_system_theme_icons "
1670 << convert<string>(use_system_theme_icons)
1677 if (ignore_system_lyxrc ||
1678 dpi != system_lyxrc.dpi) {
1679 os << "\\screen_dpi " << dpi << '\n';
1683 case RC_SCREEN_ZOOM:
1684 if (ignore_system_lyxrc ||
1685 zoom != system_lyxrc.zoom) {
1686 os << "\\screen_zoom " << zoom << '\n';
1690 case RC_GEOMETRY_SESSION:
1691 if (ignore_system_lyxrc ||
1692 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1693 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1698 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1699 if (ignore_system_lyxrc ||
1700 cursor_follows_scrollbar
1701 != system_lyxrc.cursor_follows_scrollbar) {
1702 os << "\\cursor_follows_scrollbar "
1703 << convert<string>(cursor_follows_scrollbar) << '\n';
1707 case RC_CURSOR_WIDTH:
1708 if (ignore_system_lyxrc ||
1710 != system_lyxrc.cursor_width) {
1711 os << "\\cursor_width "
1712 << cursor_width << '\n';
1716 case RC_SCROLL_BELOW_DOCUMENT:
1717 if (ignore_system_lyxrc ||
1718 scroll_below_document
1719 != system_lyxrc.scroll_below_document) {
1720 os << "\\scroll_below_document "
1721 << convert<string>(scroll_below_document) << '\n';
1725 case RC_PARAGRAPH_MARKERS:
1726 if (ignore_system_lyxrc ||
1728 != system_lyxrc.paragraph_markers) {
1729 os << "\\paragraph_markers "
1730 << convert<string>(paragraph_markers) << '\n';
1734 case RC_MAC_DONTSWAP_CTRL_META:
1735 if (ignore_system_lyxrc ||
1736 mac_dontswap_ctrl_meta
1737 != system_lyxrc.mac_dontswap_ctrl_meta) {
1738 os << "\\mac_dontswap_ctrl_meta "
1739 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1743 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1744 if (ignore_system_lyxrc ||
1745 mac_like_cursor_movement
1746 != system_lyxrc.mac_like_cursor_movement) {
1747 os << "\\mac_like_cursor_movement "
1748 << convert<string>(mac_like_cursor_movement) << '\n';
1752 case RC_MACRO_EDIT_STYLE:
1753 if (ignore_system_lyxrc ||
1755 != system_lyxrc.macro_edit_style) {
1756 os << "\\macro_edit_style ";
1757 switch (macro_edit_style) {
1758 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1759 case MACRO_EDIT_INLINE: os << "1\n"; break;
1760 case MACRO_EDIT_LIST: os << "2\n"; break;
1765 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1766 if (ignore_system_lyxrc ||
1767 dialogs_iconify_with_main
1768 != system_lyxrc.dialogs_iconify_with_main) {
1769 os << "\\dialogs_iconify_with_main "
1770 << convert<string>(dialogs_iconify_with_main) << '\n';
1774 case RC_SCREEN_FONT_ROMAN:
1775 if (ignore_system_lyxrc ||
1776 roman_font_name != system_lyxrc.roman_font_name) {
1777 os << "\\screen_font_roman \"" << roman_font_name
1782 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1783 if (ignore_system_lyxrc ||
1784 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1785 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1790 case RC_SCREEN_FONT_SANS:
1791 if (ignore_system_lyxrc ||
1792 sans_font_name != system_lyxrc.sans_font_name) {
1793 os << "\\screen_font_sans \"" << sans_font_name
1798 case RC_SCREEN_FONT_SANS_FOUNDRY:
1799 if (ignore_system_lyxrc ||
1800 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1801 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1806 case RC_SCREEN_FONT_TYPEWRITER:
1807 if (ignore_system_lyxrc ||
1808 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1809 os << "\\screen_font_typewriter \""
1810 << typewriter_font_name << "\"\n";
1814 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1815 if (ignore_system_lyxrc ||
1816 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1817 os << "\\screen_font_typewriter_foundry \""
1818 << typewriter_font_foundry << "\"\n";
1823 case RC_SCREEN_FONT_SCALABLE:
1824 if (ignore_system_lyxrc ||
1825 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1826 os << "\\screen_font_scalable "
1827 << convert<string>(use_scalable_fonts)
1832 case RC_SCREEN_FONT_SIZES:
1833 if (ignore_system_lyxrc ||
1834 font_sizes[FONT_SIZE_TINY]
1835 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1836 font_sizes[FONT_SIZE_SCRIPT]
1837 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1838 font_sizes[FONT_SIZE_FOOTNOTE]
1839 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1840 font_sizes[FONT_SIZE_SMALL]
1841 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1842 font_sizes[FONT_SIZE_NORMAL]
1843 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1844 font_sizes[FONT_SIZE_LARGE]
1845 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1846 font_sizes[FONT_SIZE_LARGER]
1847 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1848 font_sizes[FONT_SIZE_LARGEST]
1849 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1850 font_sizes[FONT_SIZE_HUGE]
1851 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1852 font_sizes[FONT_SIZE_HUGER]
1853 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1854 streamsize old_prec = os.precision();
1855 os.setf(ios::fixed);
1857 os << "\\screen_font_sizes"
1858 << ' ' << font_sizes[FONT_SIZE_TINY]
1859 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1860 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1861 << ' ' << font_sizes[FONT_SIZE_SMALL]
1862 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1863 << ' ' << font_sizes[FONT_SIZE_LARGE]
1864 << ' ' << font_sizes[FONT_SIZE_LARGER]
1865 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1866 << ' ' << font_sizes[FONT_SIZE_HUGE]
1867 << ' ' << font_sizes[FONT_SIZE_HUGER]
1869 os.precision(old_prec);
1870 os.unsetf(ios::fixed);
1874 case RC_FULL_SCREEN_LIMIT:
1875 if (ignore_system_lyxrc ||
1876 full_screen_limit != system_lyxrc.full_screen_limit) {
1877 os << "\\fullscreen_limit "
1878 << convert<string>(full_screen_limit)
1883 case RC_FULL_SCREEN_TOOLBARS:
1884 if (ignore_system_lyxrc ||
1885 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1886 os << "\\fullscreen_toolbars "
1887 << convert<string>(full_screen_toolbars)
1892 case RC_FULL_SCREEN_SCROLLBAR:
1893 if (ignore_system_lyxrc ||
1894 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1895 os << "\\fullscreen_scrollbar "
1896 << convert<string>(full_screen_scrollbar)
1901 case RC_FULL_SCREEN_STATUSBAR:
1902 if (ignore_system_lyxrc ||
1903 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1904 os << "\\fullscreen_statusbar "
1905 << convert<string>(full_screen_statusbar)
1910 case RC_FULL_SCREEN_TABBAR:
1911 if (ignore_system_lyxrc ||
1912 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1913 os << "\\fullscreen_tabbar "
1914 << convert<string>(full_screen_tabbar)
1919 case RC_FULL_SCREEN_MENUBAR:
1920 if (ignore_system_lyxrc ||
1921 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1922 os << "\\fullscreen_menubar "
1923 << convert<string>(full_screen_menubar)
1928 case RC_FULL_SCREEN_WIDTH:
1929 if (ignore_system_lyxrc ||
1930 full_screen_width != system_lyxrc.full_screen_width) {
1931 os << "\\fullscreen_width "
1932 << convert<string>(full_screen_width)
1937 case RC_OPEN_BUFFERS_IN_TABS:
1938 if (ignore_system_lyxrc ||
1939 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1940 os << "\\open_buffers_in_tabs "
1941 << convert<string>(open_buffers_in_tabs)
1946 case RC_SINGLE_CLOSE_TAB_BUTTON:
1947 if (ignore_system_lyxrc ||
1948 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1949 os << "\\single_close_tab_button "
1950 << convert<string>(single_close_tab_button)
1955 case RC_SINGLE_INSTANCE:
1956 if (ignore_system_lyxrc ||
1957 single_instance != system_lyxrc.single_instance) {
1958 os << "\\single_instance "
1959 << convert<string>(single_instance)
1964 case RC_FORWARD_SEARCH_DVI:
1965 if (ignore_system_lyxrc ||
1966 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1967 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1971 case RC_FORWARD_SEARCH_PDF:
1972 if (ignore_system_lyxrc ||
1973 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1974 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1980 << "# COLOR SECTION ###################################\n"
1984 for (int i = 0; i < Color_ignore; ++i) {
1985 ColorCode lc = static_cast<ColorCode>(i);
1986 string const col = lcolor.getX11Name(lc);
1987 if (ignore_system_lyxrc
1988 || col != system_lcolor.getX11Name(lc)) {
1989 os << "\\set_color \""
1990 << lcolor.getLyXName(lc) << "\" \""
1998 << "# PRINTER SECTION ###################################\n"
2001 case RC_PRINTLANDSCAPEFLAG:
2002 if (ignore_system_lyxrc ||
2003 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2004 os << "\\print_landscape_flag \"" << print_landscape_flag
2010 case RC_PRINTPAPERFLAG:
2011 if (ignore_system_lyxrc ||
2012 print_paper_flag != system_lyxrc.print_paper_flag) {
2013 os << "\\print_paper_flag \"" << print_paper_flag
2019 case RC_PRINTPAPERDIMENSIONFLAG:
2020 if (ignore_system_lyxrc ||
2021 print_paper_dimension_flag
2022 != system_lyxrc.print_paper_dimension_flag) {
2023 os << "\\print_paper_dimension_flag \""
2024 << print_paper_dimension_flag << "\"\n";
2030 << "# TEX SECTION #######################################\n"
2033 case RC_TEXINPUTS_PREFIX:
2034 if (ignore_system_lyxrc ||
2035 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2036 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2041 case RC_FONT_ENCODING:
2042 if (ignore_system_lyxrc ||
2043 fontenc != system_lyxrc.fontenc) {
2044 os << "\\font_encoding \"" << fontenc << "\"\n";
2050 << "# FILE SECTION ######################################\n"
2053 case RC_DOCUMENTPATH:
2054 if (ignore_system_lyxrc ||
2055 document_path != system_lyxrc.document_path) {
2056 string const path = os::external_path(document_path);
2057 os << "\\document_path \"" << path << "\"\n";
2061 case RC_USELASTFILEPOS:
2062 if (ignore_system_lyxrc ||
2063 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2064 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2069 case RC_LOADSESSION:
2070 if (ignore_system_lyxrc ||
2071 load_session != system_lyxrc.load_session) {
2072 os << "\\load_session " << convert<string>(load_session)
2077 case RC_MOUSE_WHEEL_SPEED:
2078 if (ignore_system_lyxrc ||
2079 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2080 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2084 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2085 if (ignore_system_lyxrc ||
2086 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2087 os << "\\mouse_middlebutton_paste "
2088 << convert<string>(mouse_middlebutton_paste) << '\n';
2092 case RC_COMPLETION_INLINE_DELAY:
2093 if (ignore_system_lyxrc ||
2094 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2095 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2099 case RC_COMPLETION_INLINE_MATH:
2100 if (ignore_system_lyxrc ||
2101 completion_inline_math != system_lyxrc.completion_inline_math) {
2102 os << "\\completion_inline_math "
2103 << convert<string>(completion_inline_math) << '\n';
2107 case RC_COMPLETION_INLINE_TEXT:
2108 if (ignore_system_lyxrc ||
2109 completion_inline_text != system_lyxrc.completion_inline_text) {
2110 os << "\\completion_inline_text "
2111 << convert<string>(completion_inline_text) << '\n';
2115 case RC_COMPLETION_INLINE_DOTS:
2116 if (ignore_system_lyxrc ||
2117 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2118 os << "\\completion_inline_dots "
2119 << convert<string>(completion_inline_dots) << '\n';
2123 case RC_AUTOCORRECTION_MATH:
2124 if (ignore_system_lyxrc ||
2125 autocorrection_math != system_lyxrc.autocorrection_math) {
2126 os << "\\autocorrection_math "
2127 << convert<string>(autocorrection_math) << '\n';
2131 case RC_COMPLETION_POPUP_DELAY:
2132 if (ignore_system_lyxrc ||
2133 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2134 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2138 case RC_COMPLETION_POPUP_MATH:
2139 if (ignore_system_lyxrc ||
2140 completion_popup_math != system_lyxrc.completion_popup_math) {
2141 os << "\\completion_popup_math "
2142 << convert<string>(completion_popup_math) << '\n';
2146 case RC_COMPLETION_POPUP_TEXT:
2147 if (ignore_system_lyxrc ||
2148 completion_popup_text != system_lyxrc.completion_popup_text) {
2149 os << "\\completion_popup_text "
2150 << convert<string>(completion_popup_text) << '\n';
2154 case RC_COMPLETION_CURSOR_TEXT:
2155 if (ignore_system_lyxrc ||
2156 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2157 os << "\\completion_cursor_text "
2158 << convert<string>(completion_cursor_text) << '\n';
2162 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2163 if (ignore_system_lyxrc ||
2164 completion_popup_after_complete
2165 != system_lyxrc.completion_popup_after_complete) {
2166 os << "\\completion_popup_after_complete "
2167 << convert<string>(completion_popup_after_complete) << '\n';
2171 case RC_COMPLETION_MINLENGTH:
2172 if (ignore_system_lyxrc ||
2173 completion_minlength != system_lyxrc.completion_minlength) {
2174 os << "\\completion_minlength " << convert<string>(completion_minlength)
2180 case RC_NUMLASTFILES:
2181 if (ignore_system_lyxrc ||
2182 num_lastfiles != system_lyxrc.num_lastfiles) {
2183 os << "\\num_lastfiles " << num_lastfiles << '\n';
2187 case RC_CHECKLASTFILES:
2188 if (ignore_system_lyxrc ||
2189 check_lastfiles != system_lyxrc.check_lastfiles) {
2190 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2195 case RC_EXAMPLEPATH:
2196 if (ignore_system_lyxrc ||
2197 example_path != system_lyxrc.example_path) {
2198 string const path = os::external_path(example_path);
2199 os << "\\example_path \"" << path << "\"\n";
2203 case RC_TEMPLATEPATH:
2204 if (ignore_system_lyxrc ||
2205 template_path != system_lyxrc.template_path) {
2206 string const path = os::external_path(template_path);
2207 os << "\\template_path \"" << path << "\"\n";
2211 case RC_TEMPDIRPATH:
2212 if (ignore_system_lyxrc ||
2213 tempdir_path != system_lyxrc.tempdir_path) {
2214 string const path = os::external_path(tempdir_path);
2215 os << "\\tempdir_path \"" << path << "\"\n";
2219 case RC_THESAURUSDIRPATH:
2220 if (ignore_system_lyxrc ||
2221 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2222 string const path = os::external_path(thesaurusdir_path);
2223 os << "\\thesaurusdir_path \"" << path << "\"\n";
2227 case RC_HUNSPELLDIR_PATH:
2228 if (ignore_system_lyxrc ||
2229 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2230 string const path = os::external_path(hunspelldir_path);
2231 os << "\\hunspelldir_path \"" << path << "\"\n";
2235 case RC_PLAINTEXT_LINELEN:
2236 if (ignore_system_lyxrc ||
2237 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2238 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2242 case RC_MAKE_BACKUP:
2243 if (ignore_system_lyxrc ||
2244 make_backup != system_lyxrc.make_backup) {
2245 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2249 case RC_SAVE_COMPRESSED:
2250 if (ignore_system_lyxrc ||
2251 save_compressed != system_lyxrc.save_compressed) {
2252 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2256 case RC_SAVE_ORIGIN:
2257 if (ignore_system_lyxrc ||
2258 save_origin != system_lyxrc.save_origin) {
2259 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2263 case RC_BACKUPDIR_PATH:
2264 if (ignore_system_lyxrc ||
2265 backupdir_path != system_lyxrc.backupdir_path) {
2266 string const path = os::external_path(backupdir_path);
2267 os << "\\backupdir_path \"" << path << "\"\n";
2273 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2277 << "# SPELLCHECKER SECTION ##############################\n"
2280 case RC_ACCEPT_COMPOUND:
2281 if (ignore_system_lyxrc ||
2282 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2283 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2289 if (ignore_system_lyxrc ||
2290 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2291 os << "\\alternate_language \"" << spellchecker_alt_lang
2297 if (ignore_system_lyxrc ||
2298 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2299 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2303 case RC_USE_SYSTEM_COLORS:
2304 if (ignore_system_lyxrc ||
2305 use_system_colors != system_lyxrc.use_system_colors) {
2306 os << "\\use_system_colors "
2307 << convert<string>(use_system_colors)
2312 case RC_USE_TOOLTIP:
2313 if (ignore_system_lyxrc ||
2314 use_tooltip != system_lyxrc.use_tooltip) {
2315 os << "\\use_tooltip "
2316 << convert<string>(use_tooltip)
2321 case RC_USE_PIXMAP_CACHE:
2322 if (ignore_system_lyxrc ||
2323 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2324 os << "\\use_pixmap_cache "
2325 << convert<string>(use_pixmap_cache)
2331 if (ignore_system_lyxrc ||
2332 use_qimage != system_lyxrc.use_qimage) {
2333 os << "\\use_qimage "
2334 << convert<string>(use_qimage)
2341 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2344 case RC_DEFAULT_DECIMAL_POINT:
2345 if (ignore_system_lyxrc ||
2346 default_decimal_point != system_lyxrc.default_decimal_point) {
2347 os << "\\default_decimal_point " << default_decimal_point << '\n';
2352 case RC_DEFAULT_LENGTH_UNIT:
2353 if (ignore_system_lyxrc ||
2354 default_length_unit != system_lyxrc.default_length_unit) {
2355 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2360 case RC_SPELLCHECKER:
2361 if (ignore_system_lyxrc ||
2362 spellchecker != system_lyxrc.spellchecker) {
2363 os << "\\spellchecker " << spellchecker << '\n';
2368 case RC_SPELLCHECK_CONTINUOUSLY:
2369 if (ignore_system_lyxrc ||
2370 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2371 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2377 case RC_SPELLCHECK_NOTES:
2378 if (ignore_system_lyxrc ||
2379 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2380 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2386 case RC_VISUAL_CURSOR:
2387 if (ignore_system_lyxrc ||
2388 visual_cursor != system_lyxrc.visual_cursor) {
2389 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2393 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2394 if (ignore_system_lyxrc ||
2395 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2396 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2397 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2401 case RC_LANGUAGE_CUSTOM_PACKAGE:
2402 if (ignore_system_lyxrc ||
2403 language_custom_package != system_lyxrc.language_custom_package) {
2404 os << "\\language_custom_package \"" << language_custom_package
2409 case RC_LANGUAGE_GLOBAL_OPTIONS:
2410 if (ignore_system_lyxrc ||
2411 language_global_options
2412 != system_lyxrc.language_global_options) {
2413 os << "\\language_global_options \""
2414 << convert<string>(language_global_options)
2419 case RC_LANGUAGE_PACKAGE_SELECTION:
2420 if (ignore_system_lyxrc ||
2421 language_package_selection != system_lyxrc.language_package_selection) {
2422 os << "\\language_package_selection ";
2423 switch (language_package_selection) {
2440 case RC_LANGUAGE_COMMAND_BEGIN:
2441 if (ignore_system_lyxrc ||
2442 language_command_begin
2443 != system_lyxrc.language_command_begin) {
2444 os << "\\language_command_begin \""
2445 << language_command_begin
2450 case RC_LANGUAGE_COMMAND_END:
2451 if (ignore_system_lyxrc ||
2452 language_command_end
2453 != system_lyxrc.language_command_end) {
2454 os << "\\language_command_end \"" << language_command_end
2459 case RC_LANGUAGE_COMMAND_LOCAL:
2460 if (ignore_system_lyxrc ||
2461 language_command_local
2462 != system_lyxrc.language_command_local) {
2463 os << "\\language_command_local \""
2464 << language_command_local
2469 case RC_LANGUAGE_AUTO_BEGIN:
2470 if (ignore_system_lyxrc ||
2471 language_auto_begin != system_lyxrc.language_auto_begin) {
2472 os << "\\language_auto_begin "
2473 << convert<string>(language_auto_begin) << '\n';
2477 case RC_LANGUAGE_AUTO_END:
2478 if (ignore_system_lyxrc ||
2479 language_auto_end != system_lyxrc.language_auto_end) {
2480 os << "\\language_auto_end "
2481 << convert<string>(language_auto_end) << '\n';
2485 case RC_MARK_FOREIGN_LANGUAGE:
2486 if (ignore_system_lyxrc ||
2487 mark_foreign_language
2488 != system_lyxrc.mark_foreign_language) {
2489 os << "\\mark_foreign_language " <<
2490 convert<string>(mark_foreign_language) << '\n';
2496 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2499 case RC_AUTO_NUMBER:
2500 if (ignore_system_lyxrc ||
2501 auto_number != system_lyxrc.auto_number) {
2502 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2506 case RC_GUI_LANGUAGE:
2507 if (ignore_system_lyxrc ||
2508 gui_language != system_lyxrc.gui_language) {
2509 os << "\\gui_language " << gui_language << '\n';
2513 case RC_EXPORT_OVERWRITE:
2514 if (ignore_system_lyxrc ||
2515 export_overwrite != system_lyxrc.export_overwrite) {
2517 switch (export_overwrite) {
2528 os << "\\export_overwrite " << status << '\n';
2533 case RC_SCROLL_WHEEL_ZOOM:
2534 if (ignore_system_lyxrc ||
2535 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2537 switch (scroll_wheel_zoom) {
2538 case SCROLL_WHEEL_ZOOM_OFF:
2541 case SCROLL_WHEEL_ZOOM_CTRL:
2544 case SCROLL_WHEEL_ZOOM_SHIFT:
2547 case SCROLL_WHEEL_ZOOM_ALT:
2551 os << "\\scroll_wheel_zoom " << status << '\n';
2557 << "# FORMATS SECTION ##########################\n"
2561 // New/modified formats
2562 for (Formats::const_iterator cit = theFormats().begin();
2563 cit != theFormats().end(); ++cit) {
2564 Format const * format =
2565 theSystemFormats().getFormat(cit->name());
2567 format->extensions() != cit->extensions() ||
2568 format->prettyname() != cit->prettyname() ||
2569 format->shortcut() != cit->shortcut() ||
2570 format->viewer() != cit->viewer() ||
2571 format->editor() != cit->editor() ||
2572 format->documentFormat() != cit->documentFormat() ||
2573 format->vectorFormat() != cit->vectorFormat() ||
2574 format->inExportMenu() != cit->inExportMenu() ||
2575 format->mime() != cit->mime()) {
2576 os << "\\format \"" << cit->name() << "\" \""
2577 << cit->extensions() << "\" \""
2578 << to_utf8(cit->prettyname()) << "\" \""
2579 << cit->shortcut() << "\" \""
2580 << escapeCommand(cit->viewer()) << "\" \""
2581 << escapeCommand(cit->editor()) << "\" \"";
2582 vector<string> flags;
2583 if (cit->documentFormat())
2584 flags.push_back("document");
2585 if (cit->vectorFormat())
2586 flags.push_back("vector");
2587 if (cit->zippedNative())
2588 flags.push_back("zipped=native");
2589 if (cit->inExportMenu())
2590 flags.push_back("menu=export");
2592 os << getStringFromVector(flags);
2593 os << "\" \"" << cit->mime() << "\"\n";
2597 // Look for deleted formats
2598 for (Formats::const_iterator cit = theSystemFormats().begin();
2599 cit != theSystemFormats().end(); ++cit)
2600 if (!theFormats().getFormat(cit->name()))
2601 os << "\\format \"" << cit->name()
2602 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2605 case RC_VIEWER_ALTERNATIVES: {
2606 Alternatives::const_iterator it = viewer_alternatives.begin();
2607 Alternatives::const_iterator const en = viewer_alternatives.end();
2608 Alternatives::const_iterator const sysend =
2609 system_lyxrc.viewer_alternatives.end();
2610 for (; it != en; ++it) {
2611 string const & fmt = it->first;
2612 CommandSet const & cmd = it->second;
2613 CommandSet::const_iterator sit = cmd.begin();
2614 CommandSet::const_iterator const sen = cmd.end();
2615 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2616 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2617 system_lyxrc.viewer_alternatives.find(fmt);
2618 for (; sit != sen; ++sit) {
2619 string const & cmd = *sit;
2620 if (ignore_system_lyxrc
2621 || sysfmt == sysend // format not found
2622 || sysfmt->second.count(cmd) == 0 // this command not found
2624 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2630 case RC_EDITOR_ALTERNATIVES: {
2631 Alternatives::const_iterator it = editor_alternatives.begin();
2632 Alternatives::const_iterator const en = editor_alternatives.end();
2633 Alternatives::const_iterator const sysend =
2634 system_lyxrc.editor_alternatives.end();
2635 for (; it != en; ++it) {
2636 string const & fmt = it->first;
2637 CommandSet const & cmd = it->second;
2638 CommandSet::const_iterator sit = cmd.begin();
2639 CommandSet::const_iterator const sen = cmd.end();
2640 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2641 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2642 system_lyxrc.editor_alternatives.find(fmt);
2643 for (; sit != sen; ++sit) {
2644 string const & cmd = *sit;
2645 if (ignore_system_lyxrc
2646 || sysfmt == sysend // format not found
2647 || sysfmt->second.count(cmd) == 0 // this command not found
2649 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2655 case RC_DEFAULT_OTF_VIEW_FORMAT:
2656 if ((ignore_system_lyxrc ||
2657 default_otf_view_format != system_lyxrc.default_otf_view_format)
2658 && !default_otf_view_format.empty()) {
2659 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2663 case RC_DEFAULT_VIEW_FORMAT:
2664 if (ignore_system_lyxrc ||
2665 default_view_format != system_lyxrc.default_view_format) {
2666 os << "\\default_view_format " << default_view_format << '\n';
2676 << "# CONVERTERS SECTION ##########################\n"
2680 // Look for new converters
2681 for (Converters::const_iterator cit = theConverters().begin();
2682 cit != theConverters().end(); ++cit) {
2683 Converter const * converter =
2684 theSystemConverters().getConverter(cit->from(),
2687 converter->command() != cit->command() ||
2688 converter->flags() != cit->flags())
2689 os << "\\converter \"" << cit->from() << "\" \""
2690 << cit->to() << "\" \""
2691 << escapeCommand(cit->command()) << "\" \""
2692 << cit->flags() << "\"\n";
2695 // New/modifed converters
2696 for (Converters::const_iterator cit = theSystemConverters().begin();
2697 cit != theSystemConverters().end(); ++cit)
2698 if (!theConverters().getConverter(cit->from(), cit->to()))
2699 os << "\\converter \"" << cit->from()
2700 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2707 << "# COPIERS SECTION ##########################\n"
2710 // Look for new movers
2711 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2712 Movers::const_iterator const sysend = theSystemMovers().end();
2713 Movers::const_iterator it = theMovers().begin();
2714 Movers::const_iterator end = theMovers().end();
2716 for (; it != end; ++it) {
2717 Movers::const_iterator const sysit =
2718 find_if(sysbegin, sysend, SameMover(*it));
2719 if (sysit == sysend) {
2720 string const & fmt = it->first;
2721 string const & command =
2722 it->second.command();
2724 os << "\\copier " << fmt
2725 << " \"" << escapeCommand(command) << "\"\n";
2731 // We don't actually delete SpecialisedMover(s) from the
2732 // map, just clear their 'command', so there's no need
2733 // to test for anything else.
2740 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2742 // Why the switch you might ask. It is a trick to ensure that all
2743 // the elements in the LyXRCTags enum is handled. As you can see
2744 // there are no breaks at all. So it is just a huge fall-through.
2745 // The nice thing is that we will get a warning from the compiler
2746 // if we forget an element.
2747 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2749 case LyXRC::RC_LAST:
2750 case LyXRC::RC_ACCEPT_COMPOUND:
2751 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2752 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2754 case LyXRC::RC_ALT_LANG:
2755 case LyXRC::RC_PLAINTEXT_LINELEN:
2756 case LyXRC::RC_AUTOCORRECTION_MATH:
2757 case LyXRC::RC_AUTOREGIONDELETE:
2758 case LyXRC::RC_AUTORESET_OPTIONS:
2759 case LyXRC::RC_AUTOSAVE:
2760 case LyXRC::RC_AUTO_NUMBER:
2761 case LyXRC::RC_BACKUPDIR_PATH:
2762 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2763 case LyXRC::RC_BIBTEX_COMMAND:
2764 case LyXRC::RC_BINDFILE:
2765 case LyXRC::RC_CHECKLASTFILES:
2766 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2767 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2768 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2769 case LyXRC::RC_COMPLETION_INLINE_MATH:
2770 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2771 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2772 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2773 case LyXRC::RC_COMPLETION_POPUP_MATH:
2774 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2775 case LyXRC::RC_COMPLETION_MINLENGTH:
2776 case LyXRC::RC_USELASTFILEPOS:
2777 case LyXRC::RC_LOADSESSION:
2778 case LyXRC::RC_CHKTEX_COMMAND:
2779 case LyXRC::RC_CONVERTER:
2780 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2781 case LyXRC::RC_COPIER:
2782 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2783 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2784 case LyXRC::RC_DATE_INSERT_FORMAT:
2785 case LyXRC::RC_GUI_LANGUAGE:
2786 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2787 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2788 case LyXRC::RC_DEFFILE:
2789 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2790 case LyXRC::RC_DISPLAY_GRAPHICS:
2791 case LyXRC::RC_DOCUMENTPATH:
2792 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2793 FileName path(lyxrc_new.document_path);
2794 if (path.exists() && path.isDirectory())
2795 package().document_dir() = FileName(lyxrc.document_path);
2798 case LyXRC::RC_EDITOR_ALTERNATIVES:
2799 case LyXRC::RC_ESC_CHARS:
2800 case LyXRC::RC_EXAMPLEPATH:
2801 case LyXRC::RC_FONT_ENCODING:
2802 case LyXRC::RC_FILEFORMAT:
2803 case LyXRC::RC_GROUP_LAYOUTS:
2804 case LyXRC::RC_HUNSPELLDIR_PATH:
2805 case LyXRC::RC_ICON_SET:
2806 case LyXRC::RC_INDEX_ALTERNATIVES:
2807 case LyXRC::RC_INDEX_COMMAND:
2808 case LyXRC::RC_JBIBTEX_COMMAND:
2809 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2810 case LyXRC::RC_JINDEX_COMMAND:
2811 case LyXRC::RC_NOMENCL_COMMAND:
2812 case LyXRC::RC_INPUT:
2813 case LyXRC::RC_KBMAP:
2814 case LyXRC::RC_KBMAP_PRIMARY:
2815 case LyXRC::RC_KBMAP_SECONDARY:
2816 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2817 case LyXRC::RC_LANGUAGE_AUTO_END:
2818 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2819 case LyXRC::RC_LANGUAGE_COMMAND_END:
2820 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2821 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2822 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2823 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2824 case LyXRC::RC_LYXRCFORMAT:
2825 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2826 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2827 case LyXRC::RC_MACRO_EDIT_STYLE:
2828 case LyXRC::RC_MAKE_BACKUP:
2829 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2830 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2831 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2832 case LyXRC::RC_NUMLASTFILES:
2833 case LyXRC::RC_PARAGRAPH_MARKERS:
2834 case LyXRC::RC_PATH_PREFIX:
2835 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2836 prependEnvPath("PATH", lyxrc_new.path_prefix);
2837 // Resets python path
2838 support::os::python(true);
2841 case LyXRC::RC_PREVIEW:
2842 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2843 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2844 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2845 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2846 case LyXRC::RC_PRINTPAPERFLAG:
2847 case LyXRC::RC_SAVE_COMPRESSED:
2848 case LyXRC::RC_SAVE_ORIGIN:
2849 case LyXRC::RC_SCREEN_DPI:
2850 case LyXRC::RC_SCREEN_FONT_ROMAN:
2851 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2852 case LyXRC::RC_SCREEN_FONT_SANS:
2853 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2854 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2855 case LyXRC::RC_SCREEN_FONT_SIZES:
2856 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2857 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2858 case LyXRC::RC_GEOMETRY_SESSION:
2859 case LyXRC::RC_SCREEN_ZOOM:
2860 case LyXRC::RC_SERVERPIPE:
2861 case LyXRC::RC_SET_COLOR:
2862 case LyXRC::RC_SHOW_BANNER:
2863 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2864 case LyXRC::RC_SPELLCHECKER:
2865 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2868 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2869 case LyXRC::RC_SPELLCHECK_NOTES:
2870 case LyXRC::RC_SPLITINDEX_COMMAND:
2871 case LyXRC::RC_TEMPDIRPATH:
2872 case LyXRC::RC_TEMPLATEPATH:
2873 case LyXRC::RC_TEX_ALLOWS_SPACES:
2874 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2875 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2876 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2879 case LyXRC::RC_TEXINPUTS_PREFIX:
2880 case LyXRC::RC_THESAURUSDIRPATH:
2881 case LyXRC::RC_UIFILE:
2882 case LyXRC::RC_USER_EMAIL:
2883 case LyXRC::RC_USER_NAME:
2884 case LyXRC::RC_USE_CONVERTER_CACHE:
2885 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2886 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2887 case LyXRC::RC_USE_SYSTEM_COLORS:
2888 case LyXRC::RC_USE_TOOLTIP:
2889 case LyXRC::RC_USE_PIXMAP_CACHE:
2890 case LyXRC::RC_USE_QIMAGE:
2891 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2892 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2893 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2894 case LyXRC::RC_SINGLE_INSTANCE:
2895 case LyXRC::RC_SORT_LAYOUTS:
2896 case LyXRC::RC_FULL_SCREEN_LIMIT:
2897 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2898 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2899 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2900 case LyXRC::RC_FULL_SCREEN_TABBAR:
2901 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2902 case LyXRC::RC_FULL_SCREEN_WIDTH:
2903 case LyXRC::RC_VISUAL_CURSOR:
2904 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2905 case LyXRC::RC_VIEWER:
2906 case LyXRC::RC_VIEWER_ALTERNATIVES:
2907 case LyXRC::RC_FORWARD_SEARCH_DVI:
2908 case LyXRC::RC_FORWARD_SEARCH_PDF:
2909 case LyXRC::RC_EXPORT_OVERWRITE:
2910 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2911 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2912 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2913 case LyXRC::RC_CURSOR_WIDTH:
2920 string const LyXRC::getDescription(LyXRCTags tag)
2925 case RC_ACCEPT_COMPOUND:
2926 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2930 str = _("Specify an alternate language. The default is to use the language of the document.");
2933 case RC_PLAINTEXT_LINELEN:
2934 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.");
2937 case RC_AUTOREGIONDELETE:
2938 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2941 case RC_AUTORESET_OPTIONS:
2942 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2946 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2949 case RC_AUTO_NUMBER:
2952 case RC_BACKUPDIR_PATH:
2953 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.");
2956 case RC_BIBTEX_COMMAND:
2957 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2960 case RC_JBIBTEX_COMMAND:
2961 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2965 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2968 case RC_CHECKLASTFILES:
2969 str = _("Select to check whether the lastfiles still exist.");
2972 case RC_CHKTEX_COMMAND:
2973 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2979 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
2980 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
2983 case RC_CONVERTER_NEEDAUTH:
2984 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
2990 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2991 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.");
2994 case RC_CURSOR_WIDTH:
2995 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2998 case RC_SCROLL_BELOW_DOCUMENT:
2999 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");
3002 case RC_MAC_DONTSWAP_CTRL_META:
3003 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3006 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3007 str = _("Use the Mac OS X conventions for cursor movement");
3010 case RC_SHOW_MACRO_LABEL:
3011 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3014 case RC_DATE_INSERT_FORMAT:
3015 //xgettext:no-c-format
3016 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3020 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3023 case RC_DEFAULT_OTF_VIEW_FORMAT:
3024 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3027 case RC_DEFAULT_VIEW_FORMAT:
3028 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3031 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3032 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3035 case RC_DISPLAY_GRAPHICS:
3036 str = _("Select how LyX will display any graphics.");
3039 case RC_DOCUMENTPATH:
3040 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3044 str = _("Specify additional chars that can be part of a word.");
3047 case RC_EXAMPLEPATH:
3048 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3051 case RC_FONT_ENCODING:
3052 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3058 case RC_INDEX_COMMAND:
3059 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\".");
3062 case RC_JINDEX_COMMAND:
3063 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3066 case RC_NOMENCL_COMMAND:
3067 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3074 case RC_KBMAP_PRIMARY:
3075 case RC_KBMAP_SECONDARY:
3076 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.");
3079 case RC_LANGUAGE_AUTO_BEGIN:
3080 str = _("Select if a language switching command is needed at the beginning of the document.");
3083 case RC_LANGUAGE_AUTO_END:
3084 str = _("Select if a language switching command is needed at the end of the document.");
3087 case RC_LANGUAGE_COMMAND_BEGIN:
3088 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.");
3091 case RC_LANGUAGE_COMMAND_END:
3092 str = _("The LaTeX command for changing back to the language of the document.");
3095 case RC_LANGUAGE_COMMAND_LOCAL:
3096 str = _("The LaTeX command for local changing of the language.");
3099 case RC_LANGUAGE_GLOBAL_OPTIONS:
3100 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3103 case RC_LANGUAGE_CUSTOM_PACKAGE:
3104 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3107 case RC_LANGUAGE_PACKAGE_SELECTION:
3108 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3111 case RC_USELASTFILEPOS:
3112 str = _("De-select if you do not want LyX to scroll to saved position.");
3115 case RC_LOADSESSION:
3116 str = _("De-select to prevent loading files opened from the last LyX session.");
3119 case RC_MAKE_BACKUP:
3120 str = _("De-select if you don't want LyX to create backup files.");
3123 case RC_MARK_FOREIGN_LANGUAGE:
3124 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3127 case RC_MOUSE_WHEEL_SPEED:
3128 str = _("The scrolling speed of the mouse wheel.");
3131 case RC_COMPLETION_POPUP_DELAY:
3132 str = _("The completion popup delay.");
3135 case RC_COMPLETION_POPUP_MATH:
3136 str = _("Select to display the completion popup in math mode.");
3139 case RC_COMPLETION_POPUP_TEXT:
3140 str = _("Select to display the completion popup in text mode.");
3143 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3144 str = _("Show the completion popup without delay after non-unique completion attempt.");
3147 case RC_COMPLETION_POPUP_TEXT:
3148 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3151 case RC_COMPLETION_POPUP_DELAY:
3152 str = _("The inline completion delay.");
3155 case RC_COMPLETION_INLINE_MATH:
3156 str = _("Select to display the inline completion in math mode.");
3159 case RC_COMPLETION_INLINE_TEXT:
3160 str = _("Select to display the inline completion in text mode.");
3163 case RC_COMPLETION_INLINE_DOTS:
3164 str = _("Use \"...\" to shorten long completions.");
3167 case RC_AUTOCORRECTION_MATH:
3168 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3171 case RC_NUMLASTFILES:
3172 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3176 case RC_PATH_PREFIX:
3177 str = _("Specify those directories which should be "
3178 "prepended to the PATH environment variable.\n"
3179 "Use the OS native format.");
3183 str = _("Shows a typeset preview of things such as math");
3186 case RC_PREVIEW_HASHED_LABELS:
3187 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3190 case RC_PREVIEW_SCALE_FACTOR:
3191 str = _("Scale the preview size to suit.");
3194 case RC_PRINTLANDSCAPEFLAG:
3195 str = _("The option to print out in landscape.");
3198 case RC_PRINTPAPERDIMENSIONFLAG:
3199 str = _("Option to specify the dimensions of the print paper.");
3202 case RC_PRINTPAPERFLAG:
3203 str = _("The option to specify paper type.");
3206 case RC_VISUAL_CURSOR:
3207 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3210 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3211 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).");
3215 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3218 case RC_SCREEN_FONT_ROMAN:
3219 case RC_SCREEN_FONT_SANS:
3220 case RC_SCREEN_FONT_TYPEWRITER:
3221 str = _("The screen fonts used to display the text while editing.");
3224 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3225 case RC_SCREEN_FONT_SANS_FOUNDRY:
3226 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3229 case RC_SCREEN_FONT_SCALABLE:
3230 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.");
3233 case RC_SCREEN_FONT_SIZES:
3234 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3237 case RC_SCREEN_ZOOM:
3238 //xgettext:no-c-format
3239 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3242 case RC_GEOMETRY_SESSION:
3243 str = _("Allow session manager to save and restore windows geometry.");
3247 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3253 case RC_SHOW_BANNER:
3254 str = _("De-select if you don't want the startup banner.");
3257 case RC_TEMPDIRPATH:
3258 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3261 case RC_THESAURUSDIRPATH:
3262 str = _("This is the place where the files of the thesaurus library reside.");
3265 case RC_TEMPLATEPATH:
3266 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3269 case RC_TEX_ALLOWS_SPACES:
3272 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3275 case RC_TEXINPUTS_PREFIX:
3276 str = _("Specify those directories which should be "
3277 "prepended to the TEXINPUTS environment variable.\n"
3278 "A '.' represents the current document directory. "
3279 "Use the OS native format.");
3283 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3292 case RC_USE_USE_SYSTEM_COLORS:
3293 str = _("Enable use the system colors for some things like main window background and selection.");
3296 case RC_USE_TOOLTIP:
3297 str = _("Enable the automatic appearance of tool tips in the work area.");
3300 case RC_USE_PIXMAP_CACHE:
3301 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3304 case RC_VIEWDVI_PAPEROPTION:
3305 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3320 // The global instance
3323 // The global copy of the system lyxrc entries (everything except preferences)