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 = 19; // rgh: remove print support
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_command", LyXRC::RC_JBIBTEX_COMMAND },
128 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
129 { "\\kbmap", LyXRC::RC_KBMAP },
130 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
131 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
132 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
133 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
134 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
135 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
136 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
137 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
138 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
139 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
140 { "\\load_session", LyXRC::RC_LOADSESSION },
141 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
142 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
143 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
144 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
145 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
146 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
147 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
148 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
149 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
150 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
151 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
152 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
153 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
154 { "\\preview", LyXRC::RC_PREVIEW },
155 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
156 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
157 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
158 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
159 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
160 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
161 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
162 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
163 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
164 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
165 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
166 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
167 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
168 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
169 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
170 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
171 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
172 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
173 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
174 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
175 { "\\set_color", LyXRC::RC_SET_COLOR },
176 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
177 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
178 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
179 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
180 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
181 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
182 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
183 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
184 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
185 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
186 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
187 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
188 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
189 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
190 { "\\ui_file", LyXRC::RC_UIFILE },
191 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
192 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
193 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
194 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
195 // compatibility with versions older than 1.4.0 only
196 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
197 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
198 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
199 { "\\user_email", LyXRC::RC_USER_EMAIL },
200 { "\\user_name", LyXRC::RC_USER_NAME },
201 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
202 // compatibility with versions older than 1.4.0 only
203 { "\\viewer", LyXRC::RC_VIEWER},
204 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
205 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
206 { "format", LyXRC::RC_LYXRCFORMAT }
209 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
220 void LyXRC::setDefaults()
223 use_system_theme_icons = false;
225 def_file = "default";
227 // The current document directory
228 texinputs_prefix = ".";
229 print_landscape_flag = "-t landscape";
230 print_paper_flag = "-t";
231 print_paper_dimension_flag = "-T";
232 document_path.erase();
233 view_dvi_paper_option.erase();
234 default_view_format = "pdf2";
235 default_otf_view_format = "pdf4";
236 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
237 bibtex_command = "bibtex";
239 index_command = "makeindex -c -q";
240 nomencl_command = "makeindex -s nomencl.ist";
242 // Because a screen is typically wider than a piece of paper:
244 allow_geometry_session = true;
245 // Default LaTeX font size:
246 font_sizes[FONT_SIZE_TINY] = "5.0";
247 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
248 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
249 font_sizes[FONT_SIZE_SMALL] = "9.0";
250 font_sizes[FONT_SIZE_NORMAL] = "10.0";
251 font_sizes[FONT_SIZE_LARGE] = "12.0";
252 font_sizes[FONT_SIZE_LARGER] = "14.4";
253 font_sizes[FONT_SIZE_LARGEST] = "17.26";
254 font_sizes[FONT_SIZE_HUGE] = "20.74";
255 font_sizes[FONT_SIZE_HUGER] = "24.88";
256 use_scalable_fonts = true;
257 roman_font_name = "";
259 typewriter_font_name = "";
261 auto_region_delete = true;
262 auto_reset_options = false;
263 plaintext_linelen = 65;
264 mouse_wheel_speed = 1.0;
266 check_lastfiles = true;
267 use_lastfilepos = true;
268 load_session = false;
270 save_compressed = false;
272 backupdir_path.erase();
273 display_graphics = true;
274 // Spellchecker settings:
275 // FIXME: this check should test the target platform (darwin)
276 #if defined(USE_MACOSX_PACKAGING)
277 spellchecker = "native";
278 #elif defined(USE_ASPELL)
279 spellchecker = "aspell";
280 #elif defined(USE_HUNSPELL)
281 spellchecker = "hunspell";
283 spellchecker = "aspell";
285 spellchecker_accept_compound = false;
286 spellcheck_continuously = false;
287 completion_minlength = 6;
288 spellcheck_notes = true;
290 visual_cursor = false;
292 mark_foreign_language = true;
293 language_auto_begin = true;
294 language_auto_end = true;
295 language_global_options = true;
296 language_package_selection = LP_AUTO;
297 language_custom_package = "\\usepackage{babel}";
298 language_command_begin = "\\selectlanguage{$$lang}";
299 language_command_local = "\\foreignlanguage{$$lang}{";
300 sort_layouts = false;
301 group_layouts = true;
302 gui_language = "auto";
304 windows_style_tex_paths = false;
305 tex_allows_spaces = false;
306 date_insert_format = "%x";
307 cursor_follows_scrollbar = false;
308 scroll_below_document = false;
309 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
310 paragraph_markers = false;
311 mac_dontswap_ctrl_meta = false;
312 mac_like_cursor_movement = false;
313 macro_edit_style = MACRO_EDIT_INLINE_BOX;
314 dialogs_iconify_with_main = false;
315 preview = PREVIEW_OFF;
316 preview_hashed_labels = false;
317 preview_scale_factor = 1.0;
318 use_converter_cache = true;
319 use_system_colors = false;
321 use_pixmap_cache = false;
323 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
324 user_name = to_utf8(support::user_name());
325 user_email = to_utf8(support::user_email());
326 open_buffers_in_tabs = true;
327 single_close_tab_button = false;
328 single_instance = true;
329 forward_search_dvi = string();
330 forward_search_pdf = string();
331 export_overwrite = NO_FILES;
333 // Fullscreen settings
334 full_screen_limit = false;
335 full_screen_toolbars = true;
336 full_screen_tabbar = true;
337 full_screen_menubar = true;
338 full_screen_statusbar = true;
339 full_screen_scrollbar = true;
340 full_screen_width = 700;
342 completion_cursor_text = true;
343 completion_popup_math = true;
344 completion_popup_text = false;
345 completion_popup_delay = 2.0;
346 completion_popup_after_complete = true;
347 autocorrection_math = false;
348 completion_inline_math = true;
349 completion_inline_text = false;
350 completion_inline_dots = -1;
351 completion_inline_delay = 0.2;
352 default_decimal_point = ".";
353 default_length_unit = Length::CM;
355 close_buffer_with_last_view = "yes";
356 mouse_middlebutton_paste = true;
362 void oldFontFormat(string & family, string & foundry)
364 if (family.empty() || family[0] != '-')
366 foundry = token(family, '-', 1);
367 family = token(family, '-', 2);
375 bool LyXRC::read(FileName const & filename, bool check_format)
377 Lexer lexrc(lyxrcTags);
378 lexrc.setFile(filename);
379 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
380 ReturnValues retval = read(lexrc, check_format);
381 if (!check_format || retval != FormatMismatch)
382 return retval == ReadOK;
384 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
385 TempFile tmp("convert_lyxrc");
386 FileName const tempfile = tmp.name();
387 bool const success = prefs2prefs(filename, tempfile, false);
389 LYXERR0 ("Unable to convert " << filename.absFileName() <<
390 " to format " << LYXRC_FILEFORMAT);
393 // Keep this in the else branch, such that lexrc2 goes out
394 // of scope and releases the lock on tempfile before we
395 // attempt to remove it. This matters on Windows.
396 Lexer lexrc2(lyxrcTags);
397 lexrc2.setFile(tempfile);
398 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
399 retval = read(lexrc2, check_format);
401 return retval == ReadOK;
405 // don't need to worry about conversion, because this is always
406 // from an internal source
407 bool LyXRC::read(istream & is)
409 Lexer lexrc(lyxrcTags);
411 LYXERR(Debug::LYXRC, "Reading istream...");
412 return read(lexrc, false) == ReadOK;
416 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
418 if (lyxerr.debugging(Debug::PARSER))
419 lexrc.printTable(lyxerr);
424 // format prior to 2.0 and introduction of format tag
425 unsigned int format = 0;
427 while (lexrc.isOK()) {
428 // By using two switches we take advantage of the compiler
429 // telling us if we have missed a LyXRCTags element in
430 // the second switch.
431 // Note that this also shows a problem with Lexer since it
432 // helps us avoid taking advantage of the strictness of the
435 int le = lexrc.lex();
437 case Lexer::LEX_UNDEF:
438 lexrc.printError("Unknown tag `$$Token'");
440 case Lexer::LEX_FEOF:
445 switch (static_cast<LyXRCTags>(le)) {
448 format = lexrc.getInteger();
450 case RC_INPUT: // Include file
453 libFileSearch(string(),
455 if (read(tmp, check_format)) {
457 "Error reading included file: " + tmp.absFileName());
463 bind_file = os::internal_path(lexrc.getString());
468 def_file = os::internal_path(lexrc.getString());
473 ui_file = os::internal_path(lexrc.getString());
476 case RC_AUTORESET_OPTIONS:
477 lexrc >> auto_reset_options;
480 case RC_DISPLAY_GRAPHICS:
482 display_graphics = lexrc.getString() == "true";
485 case RC_TEX_EXPECTS_WINDOWS_PATHS:
486 lexrc >> windows_style_tex_paths;
489 case RC_TEX_ALLOWS_SPACES:
490 lexrc >> tex_allows_spaces;
493 case RC_TEXINPUTS_PREFIX:
494 lexrc >> texinputs_prefix;
501 case RC_KBMAP_PRIMARY:
503 string const kmap(os::internal_path(lexrc.getString()));
504 if (!libFileSearch("kbd", kmap, "kmap").empty()
506 primary_kbmap = kmap;
508 lexrc.printError("LyX: Keymap `$$Token' not found");
513 case RC_KBMAP_SECONDARY:
515 string const kmap(os::internal_path(lexrc.getString()));
516 if (!libFileSearch("kbd", kmap, "kmap").empty()
518 secondary_kbmap = kmap;
520 lexrc.printError("LyX: Keymap `$$Token' not found");
525 case RC_FONT_ENCODING:
529 case RC_PRINTLANDSCAPEFLAG:
530 lexrc >> print_landscape_flag;
533 case RC_PRINTPAPERDIMENSIONFLAG:
534 lexrc >> print_paper_dimension_flag;
537 case RC_PRINTPAPERFLAG:
538 lexrc >> print_paper_flag;
541 case RC_VIEWDVI_PAPEROPTION:
543 view_dvi_paper_option = lexrc.getString();
545 view_dvi_paper_option.erase();
548 case RC_CHKTEX_COMMAND:
549 if (lexrc.next(true)) {
550 chktex_command = lexrc.getString();
554 case RC_BIBTEX_ALTERNATIVES:
555 if (lexrc.next(true)) {
556 bibtex_alternatives.insert(lexrc.getString());
560 case RC_BIBTEX_COMMAND:
561 if (lexrc.next(true)) {
562 bibtex_command = lexrc.getString();
566 case RC_JBIBTEX_COMMAND:
567 if (lexrc.next(true)) {
568 jbibtex_command = lexrc.getString();
572 case RC_INDEX_ALTERNATIVES:
573 if (lexrc.next(true)) {
574 index_alternatives.insert(lexrc.getString());
578 case RC_INDEX_COMMAND:
579 if (lexrc.next(true)) {
580 index_command = lexrc.getString();
584 case RC_JINDEX_COMMAND:
585 if (lexrc.next(true)) {
586 jindex_command = lexrc.getString();
590 case RC_SPLITINDEX_COMMAND:
591 if (lexrc.next(true)) {
592 splitindex_command = lexrc.getString();
596 case RC_NOMENCL_COMMAND:
597 if (lexrc.next(true)) {
598 nomencl_command = lexrc.getString();
612 case RC_GEOMETRY_SESSION:
613 lexrc >> allow_geometry_session;
616 case RC_SCREEN_FONT_SIZES:
617 lexrc >> font_sizes[FONT_SIZE_TINY];
618 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
619 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
620 lexrc >> font_sizes[FONT_SIZE_SMALL];
621 lexrc >> font_sizes[FONT_SIZE_NORMAL];
622 lexrc >> font_sizes[FONT_SIZE_LARGE];
623 lexrc >> font_sizes[FONT_SIZE_LARGER];
624 lexrc >> font_sizes[FONT_SIZE_LARGEST];
625 lexrc >> font_sizes[FONT_SIZE_HUGE];
626 lexrc >> font_sizes[FONT_SIZE_HUGER];
629 case RC_SCREEN_FONT_SCALABLE:
630 lexrc >> use_scalable_fonts;
637 case RC_DOCUMENTPATH:
639 document_path = os::internal_path(lexrc.getString());
644 example_path = os::internal_path(lexrc.getString());
647 case RC_TEMPLATEPATH:
649 template_path = os::internal_path(lexrc.getString());
654 tempdir_path = os::internal_path(lexrc.getString());
657 case RC_THESAURUSDIRPATH:
659 thesaurusdir_path = os::internal_path(lexrc.getString());
662 case RC_HUNSPELLDIR_PATH:
664 hunspelldir_path = os::internal_path(lexrc.getString());
667 case RC_USELASTFILEPOS:
668 lexrc >> use_lastfilepos;
672 lexrc >> load_session;
675 case RC_MOUSE_WHEEL_SPEED:
676 lexrc >> mouse_wheel_speed;
679 case RC_COMPLETION_INLINE_DELAY:
680 lexrc >> completion_inline_delay;
683 case RC_COMPLETION_INLINE_MATH:
684 lexrc >> completion_inline_math;
687 case RC_COMPLETION_INLINE_TEXT:
688 lexrc >> completion_inline_text;
691 case RC_COMPLETION_INLINE_DOTS:
692 lexrc >> completion_inline_dots;
695 case RC_AUTOCORRECTION_MATH:
696 lexrc >> autocorrection_math;
699 case RC_COMPLETION_POPUP_DELAY:
700 lexrc >> completion_popup_delay;
703 case RC_COMPLETION_POPUP_MATH:
704 lexrc >> completion_popup_math;
707 case RC_COMPLETION_POPUP_TEXT:
708 lexrc >> completion_popup_text;
711 case RC_COMPLETION_CURSOR_TEXT:
712 lexrc >> completion_cursor_text;
715 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
716 lexrc >> completion_popup_after_complete;
719 case RC_COMPLETION_MINLENGTH:
720 lexrc >> completion_minlength;
723 case RC_NUMLASTFILES:
724 lexrc >> num_lastfiles;
727 case RC_CHECKLASTFILES:
728 lexrc >> check_lastfiles;
735 case RC_USE_SYSTEM_THEME_ICONS:
736 lexrc >> use_system_theme_icons;
739 case RC_SCREEN_FONT_ROMAN:
741 roman_font_name = lexrc.getString();
742 oldFontFormat(roman_font_name,
747 case RC_SCREEN_FONT_SANS:
749 sans_font_name = lexrc.getString();
750 oldFontFormat(sans_font_name, sans_font_foundry);
754 case RC_SCREEN_FONT_TYPEWRITER:
756 typewriter_font_name = lexrc.getString();
757 oldFontFormat(typewriter_font_name,
758 typewriter_font_foundry);
762 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
763 lexrc >> roman_font_foundry;
766 case RC_SCREEN_FONT_SANS_FOUNDRY:
767 lexrc >> sans_font_foundry;
770 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
771 lexrc >> typewriter_font_foundry;
776 lexrc.printError("Missing color tag.");
779 string lyx_name = lexrc.getString();
782 lexrc.printError("Missing color name for color: `$$Token'");
785 string x11_name = lexrc.getString();
787 ColorCode const col =
788 lcolor.getFromLyXName(lyx_name);
789 if (col == Color_none ||
790 col == Color_inherit ||
794 if (!lcolor.setColor(col, x11_name))
795 LYXERR0("Bad lyxrc set_color for " << lyx_name);
799 case RC_AUTOREGIONDELETE:
800 // Auto region delete defaults to true
801 lexrc >> auto_region_delete;
806 lyxpipes = os::internal_path(lexrc.getString());
809 case RC_CURSOR_FOLLOWS_SCROLLBAR:
810 lexrc >> cursor_follows_scrollbar;
813 case RC_CURSOR_WIDTH:
814 lexrc >> cursor_width;
817 case RC_SCROLL_BELOW_DOCUMENT:
818 lexrc >> scroll_below_document;
821 case RC_PARAGRAPH_MARKERS:
822 lexrc >> paragraph_markers;
825 case RC_MAC_DONTSWAP_CTRL_META:
826 lexrc >> mac_dontswap_ctrl_meta;
829 case RC_MAC_LIKE_CURSOR_MOVEMENT:
830 lexrc >> mac_like_cursor_movement;
833 case RC_MACRO_EDIT_STYLE:
835 switch (lexrc.getInteger()) {
836 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
837 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
838 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
843 case RC_DIALOGS_ICONIFY_WITH_MAIN:
844 lexrc >> dialogs_iconify_with_main;
847 case RC_PLAINTEXT_LINELEN:
848 lexrc >> plaintext_linelen;
850 // Spellchecker settings:
851 case RC_ACCEPT_COMPOUND:
852 lexrc >> spellchecker_accept_compound;
854 case RC_USE_SYSTEM_COLORS:
855 lexrc >> use_system_colors;
858 lexrc >> use_tooltip;
860 case RC_USE_PIXMAP_CACHE:
861 lexrc >> use_pixmap_cache;
866 case RC_SPELLCHECKER:
867 lexrc >> spellchecker;
870 lexrc >> spellchecker_alt_lang;
873 lexrc >> spellchecker_esc_chars;
875 case RC_SPELLCHECK_CONTINUOUSLY:
876 lexrc >> spellcheck_continuously;
878 case RC_SPELLCHECK_NOTES:
879 lexrc >> spellcheck_notes;
882 lexrc >> make_backup;
884 case RC_SAVE_COMPRESSED:
885 lexrc >> save_compressed;
888 lexrc >> save_origin;
890 case RC_BACKUPDIR_PATH:
892 backupdir_path = os::internal_path(lexrc.getString());
894 case RC_DEFAULT_DECIMAL_POINT:
895 lexrc >> default_decimal_point;
897 case RC_DEFAULT_LENGTH_UNIT:
899 default_length_unit = (Length::UNIT) lexrc.getInteger();
901 case RC_DATE_INSERT_FORMAT:
902 lexrc >> date_insert_format;
904 case RC_LANGUAGE_CUSTOM_PACKAGE:
905 lexrc >> language_custom_package;
907 case RC_LANGUAGE_AUTO_BEGIN:
908 lexrc >> language_auto_begin;
910 case RC_LANGUAGE_AUTO_END:
911 lexrc >> language_auto_end;
913 case RC_LANGUAGE_GLOBAL_OPTIONS:
914 lexrc >> language_global_options;
916 case RC_LANGUAGE_PACKAGE_SELECTION:
918 switch (lexrc.getInteger()) {
920 language_package_selection = LP_AUTO;
923 language_package_selection = LP_BABEL;
926 language_package_selection = LP_CUSTOM;
929 language_package_selection = LP_NONE;
934 case RC_LANGUAGE_COMMAND_BEGIN:
935 lexrc >> language_command_begin;
937 case RC_LANGUAGE_COMMAND_END:
938 lexrc >> language_command_end;
940 case RC_LANGUAGE_COMMAND_LOCAL:
941 lexrc >> language_command_local;
943 case RC_VISUAL_CURSOR:
944 lexrc >> visual_cursor;
946 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
947 lexrc >> close_buffer_with_last_view;
950 lexrc >> auto_number;
952 case RC_MARK_FOREIGN_LANGUAGE:
953 lexrc >> mark_foreign_language;
959 fmt = lexrc.getString();
960 if (lexrc.next(true))
961 command = lexrc.getString();
962 setMover(fmt, command);
967 string from, to, command, flags;
969 from = lexrc.getString();
971 to = lexrc.getString();
972 if (lexrc.next(true))
973 command = lexrc.getString();
975 flags = lexrc.getString();
977 theConverters().erase(from, to);
979 theConverters().add(from, to, command, flags);
982 // compatibility with versions older than 1.4.0 only
984 string format, command;
985 lexrc >> format >> command;
986 formats.setViewer(format, command);
989 case RC_FILEFORMAT: {
991 string format, extensions, shortcut;
992 docstring prettyname;
993 if (!(lexrc >> format >> extensions))
995 if (ok && lexrc.next(true))
996 prettyname = lexrc.getDocString();
1000 if(!(lexrc >> shortcut))
1002 string viewer, editor;
1003 if (ok && lexrc.next(true))
1004 viewer = lexrc.getString();
1007 if (ok && lexrc.next(true))
1008 editor = lexrc.getString();
1012 if (!(lexrc >> flags >> mime))
1014 int flgs = Format::none;
1015 while (!flags.empty()) {
1017 flags = split(flags, flag, ',');
1018 if (flag == "document")
1019 flgs |= Format::document;
1020 else if (flag == "vector")
1021 flgs |= Format::vector;
1022 else if (flag == "zipped=native")
1023 flgs |= Format::zipped_native;
1024 else if (flag == "menu=export")
1025 flgs |= Format::export_menu;
1027 LYXERR0("Ignoring unknown flag `"
1028 << flag << "' for format `"
1032 LYXERR0("Syntax error in format " << format);
1033 else if (prettyname.empty()) {
1034 if (theConverters().formatIsUsed(format))
1035 LYXERR0("Can't delete format " << format);
1037 formats.erase(format);
1039 formats.add(format, extensions, prettyname,
1040 shortcut, viewer, editor, mime, flgs);
1044 case RC_VIEWER_ALTERNATIVES: {
1045 string format, command;
1046 if ((lexrc >> format) && lexrc.next(true)) {
1047 command = lexrc.getString();
1048 viewer_alternatives[format].insert(command);
1052 case RC_EDITOR_ALTERNATIVES: {
1053 string format, command;
1054 if ((lexrc >> format) && lexrc.next(true)) {
1055 command = lexrc.getString();
1056 editor_alternatives[format].insert(command);
1061 case RC_DEFAULT_OTF_VIEW_FORMAT:
1062 lexrc >> default_otf_view_format;
1065 case RC_DEFAULT_VIEW_FORMAT:
1066 lexrc >> default_view_format;
1069 case RC_GUI_LANGUAGE:
1070 lexrc >> gui_language;
1073 case RC_SHOW_BANNER:
1074 lexrc >> show_banner;
1079 string const tmp = lexrc.getString();
1080 if (tmp == "true" || tmp == "on")
1081 preview = PREVIEW_ON;
1082 else if (tmp == "no_math")
1083 preview = PREVIEW_NO_MATH;
1085 preview = PREVIEW_OFF;
1086 if (tmp != "false" && tmp != "off")
1087 LYXERR0("Unrecognized preview status \""
1093 case RC_PREVIEW_HASHED_LABELS:
1094 lexrc >> preview_hashed_labels;
1097 case RC_PREVIEW_SCALE_FACTOR:
1098 lexrc >> preview_scale_factor;
1105 lexrc >> user_email;
1108 case RC_PATH_PREFIX:
1109 lexrc >> path_prefix;
1112 case RC_USE_CONVERTER_CACHE:
1113 lexrc >> use_converter_cache;
1115 case RC_CONVERTER_CACHE_MAXAGE:
1116 lexrc >> converter_cache_maxage;
1119 case RC_SORT_LAYOUTS:
1120 lexrc >> sort_layouts;
1122 case RC_GROUP_LAYOUTS:
1123 lexrc >> group_layouts;
1125 case RC_FULL_SCREEN_LIMIT:
1126 lexrc >> full_screen_limit;
1128 case RC_FULL_SCREEN_TOOLBARS:
1129 lexrc >> full_screen_toolbars;
1131 case RC_FULL_SCREEN_SCROLLBAR:
1132 lexrc >> full_screen_scrollbar;
1134 case RC_FULL_SCREEN_STATUSBAR:
1135 lexrc >> full_screen_statusbar;
1137 case RC_FULL_SCREEN_TABBAR:
1138 lexrc >> full_screen_tabbar;
1140 case RC_FULL_SCREEN_MENUBAR:
1141 lexrc >> full_screen_menubar;
1143 case RC_FULL_SCREEN_WIDTH:
1144 lexrc >> full_screen_width;
1146 case RC_OPEN_BUFFERS_IN_TABS:
1147 lexrc >> open_buffers_in_tabs;
1149 case RC_SINGLE_CLOSE_TAB_BUTTON:
1150 lexrc >> single_close_tab_button;
1152 case RC_SINGLE_INSTANCE:
1153 lexrc >> single_instance;
1154 if (run_mode == PREFERRED)
1155 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1157 case RC_FORWARD_SEARCH_DVI:
1158 if (lexrc.next(true))
1159 forward_search_dvi = lexrc.getString();
1161 case RC_FORWARD_SEARCH_PDF:
1162 if (lexrc.next(true))
1163 forward_search_pdf = lexrc.getString();
1165 case RC_EXPORT_OVERWRITE:
1167 string const tmp = lexrc.getString();
1168 if (tmp == "all" || tmp == "true")
1169 export_overwrite = ALL_FILES;
1170 else if (tmp == "main")
1171 export_overwrite = MAIN_FILE;
1173 export_overwrite = NO_FILES;
1174 if (tmp != "ask" && tmp != "false")
1175 LYXERR0("Unrecognized export_overwrite status \""
1180 case RC_SCROLL_WHEEL_ZOOM:
1182 string const tmp = lexrc.getString();
1184 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1185 else if (tmp == "shift")
1186 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1187 else if (tmp == "alt")
1188 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1190 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1191 if (tmp != "off" && tmp != "false")
1192 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1198 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1199 lexrc >> mouse_middlebutton_paste;
1203 break; // this is just a dummy
1206 // This is triggered the first time through the loop unless
1207 // we hit a format tag.
1208 if (check_format && format != LYXRC_FILEFORMAT)
1209 return FormatMismatch;
1212 /// Update converters data-structures
1213 theConverters().update(formats);
1214 theConverters().buildGraph();
1215 theBufferList().invalidateConverterCache();
1221 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1223 ofstream ofs(filename.toFilesystemEncoding().c_str());
1225 write(ofs, ignore_system_lyxrc);
1229 void LyXRC::print() const
1231 if (lyxerr.debugging())
1232 write(lyxerr, false);
1240 typedef pair<string, SpecialisedMover> Data;
1242 SameMover(Data const & comparison)
1243 : comparison_(comparison) {}
1245 bool operator()(Data const & data) const
1247 return data.first == comparison_.first &&
1248 data.second.command() == comparison_.second.command();
1258 // Escape \ and " so that LyXLex can read the string later
1259 string escapeCommand(string const & str) {
1260 return subst(subst(str , "\\", "\\\\"),
1267 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1269 LyXRCTags tag = RC_LAST;
1271 if (!name.empty()) {
1272 for (int i = 0; i != lyxrcCount; ++i)
1273 if ("\\" + name == lyxrcTags[i].tag)
1274 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1278 os << "# LyX " << lyx_version
1279 << " generated this file. If you want to make your own\n"
1280 << "# modifications you should do them from inside LyX and save.\n\n"
1281 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1283 // Why the switch you might ask. It is a trick to ensure that all
1284 // the elements in the LyXRCTags enum are handled. As you can see
1285 // there are no breaks at all. So it is just a huge fall-through.
1286 // The nice thing is that we will get a warning from the compiler
1287 // if we forget an element.
1291 // input/include files are not done here
1292 case RC_LYXRCFORMAT:
1294 if (ignore_system_lyxrc ||
1295 bind_file != system_lyxrc.bind_file) {
1296 string const path = os::external_path(bind_file);
1297 os << "\\bind_file \"" << path << "\"\n";
1303 if (ignore_system_lyxrc ||
1304 def_file != system_lyxrc.def_file) {
1305 string const path = os::external_path(def_file);
1306 os << "\\def_file \"" << path << "\"\n";
1315 << "# MISC SECTION ######################################\n"
1317 // bind files are not done here.
1319 case RC_PATH_PREFIX:
1320 if (ignore_system_lyxrc ||
1321 path_prefix != system_lyxrc.path_prefix) {
1322 os << "\\path_prefix \"" << path_prefix << "\"\n";
1327 if (ignore_system_lyxrc ||
1328 ui_file != system_lyxrc.ui_file) {
1329 string const path = os::external_path(ui_file);
1330 os << "\\ui_file \"" << path << "\"\n";
1334 case RC_AUTOREGIONDELETE:
1335 if (ignore_system_lyxrc ||
1336 auto_region_delete != system_lyxrc.auto_region_delete) {
1337 os << "# Set to false to inhibit automatic replacement of\n"
1338 << "# the current selection.\n"
1339 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1344 case RC_AUTORESET_OPTIONS:
1345 if (ignore_system_lyxrc ||
1346 auto_reset_options != system_lyxrc.auto_reset_options) {
1347 os << "# Set to false to inhibit automatic reset of\n"
1348 << "# the class options to defaults on class change.\n"
1349 << "\\auto_reset_options "
1350 << convert<string>(auto_reset_options)
1356 if (ignore_system_lyxrc ||
1357 autosave != system_lyxrc.autosave) {
1358 os << "# The time interval between auto-saves in seconds.\n"
1359 << "\\autosave " << autosave << '\n';
1363 case RC_DISPLAY_GRAPHICS:
1364 if (ignore_system_lyxrc ||
1365 display_graphics != system_lyxrc.display_graphics) {
1366 os << "# Display graphics within LyX\n"
1368 << "\\display_graphics "
1369 << (display_graphics ? "true" : "false")
1374 case RC_SORT_LAYOUTS:
1375 if (ignore_system_lyxrc ||
1376 sort_layouts != system_lyxrc.sort_layouts) {
1377 os << "# Sort layouts alphabetically.\n"
1378 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1382 case RC_GROUP_LAYOUTS:
1383 if (ignore_system_lyxrc ||
1384 group_layouts != system_lyxrc.group_layouts) {
1385 os << "# Group layouts by their category.\n"
1386 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1390 case RC_VIEWDVI_PAPEROPTION:
1391 if (ignore_system_lyxrc ||
1392 view_dvi_paper_option
1393 != system_lyxrc.view_dvi_paper_option) {
1394 os << "# Options used to specify paper size to the\n"
1395 << "# view_dvi_command (e.g. -paper)\n"
1396 << "\\view_dvi_paper_option \""
1397 << view_dvi_paper_option << "\"\n";
1401 case RC_CHKTEX_COMMAND:
1402 if (ignore_system_lyxrc ||
1403 chktex_command != system_lyxrc.chktex_command) {
1404 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1408 case RC_BIBTEX_ALTERNATIVES: {
1409 CommandSet::const_iterator it = bibtex_alternatives.begin();
1410 CommandSet::const_iterator end = bibtex_alternatives.end();
1411 for ( ; it != end; ++it) {
1412 if (ignore_system_lyxrc
1413 || !system_lyxrc.bibtex_alternatives.count(*it))
1414 os << "\\bibtex_alternatives \""
1420 case RC_BIBTEX_COMMAND:
1421 if (ignore_system_lyxrc ||
1422 bibtex_command != system_lyxrc.bibtex_command) {
1423 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1427 case RC_JBIBTEX_COMMAND:
1428 if (ignore_system_lyxrc ||
1429 jbibtex_command != system_lyxrc.jbibtex_command) {
1430 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1434 case RC_INDEX_ALTERNATIVES: {
1435 CommandSet::const_iterator it = index_alternatives.begin();
1436 CommandSet::const_iterator end = index_alternatives.end();
1437 for ( ; it != end; ++it) {
1438 if (ignore_system_lyxrc
1439 || !system_lyxrc.index_alternatives.count(*it))
1440 os << "\\index_alternatives \""
1446 case RC_INDEX_COMMAND:
1447 if (ignore_system_lyxrc ||
1448 index_command != system_lyxrc.index_command) {
1449 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1453 case RC_JINDEX_COMMAND:
1454 if (ignore_system_lyxrc ||
1455 jindex_command != system_lyxrc.jindex_command) {
1456 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1460 case RC_SPLITINDEX_COMMAND:
1461 if (ignore_system_lyxrc ||
1462 splitindex_command != system_lyxrc.splitindex_command) {
1463 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1467 case RC_NOMENCL_COMMAND:
1468 if (ignore_system_lyxrc ||
1469 nomencl_command != system_lyxrc.nomencl_command) {
1470 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1474 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1475 // Don't write this setting to the preferences file,
1476 // but allow temporary changes (bug 7557).
1477 if (ignore_system_lyxrc) {
1478 os << "\\tex_expects_windows_paths "
1479 << convert<string>(windows_style_tex_paths) << '\n';
1483 case RC_TEX_ALLOWS_SPACES:
1484 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1485 os << "\\tex_allows_spaces "
1486 << convert<string>(tex_allows_spaces) << '\n';
1491 if (ignore_system_lyxrc ||
1492 use_kbmap != system_lyxrc.use_kbmap) {
1493 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1497 case RC_KBMAP_PRIMARY:
1498 if (ignore_system_lyxrc ||
1499 primary_kbmap != system_lyxrc.primary_kbmap) {
1500 string const path = os::external_path(primary_kbmap);
1501 os << "\\kbmap_primary \"" << path << "\"\n";
1505 case RC_KBMAP_SECONDARY:
1506 if (ignore_system_lyxrc ||
1507 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1508 string const path = os::external_path(secondary_kbmap);
1509 os << "\\kbmap_secondary \"" << path << "\"\n";
1514 if (ignore_system_lyxrc ||
1515 lyxpipes != system_lyxrc.lyxpipes) {
1516 string const path = os::external_path(lyxpipes);
1517 os << "\\serverpipe \"" << path << "\"\n";
1521 case RC_DATE_INSERT_FORMAT:
1522 if (ignore_system_lyxrc ||
1523 date_insert_format != system_lyxrc.date_insert_format) {
1524 os << "\\date_insert_format \"" << date_insert_format
1531 os << "\\user_name \"" << user_name << "\"\n";
1536 os << "\\user_email \"" << user_email << "\"\n";
1540 case RC_SHOW_BANNER:
1541 if (ignore_system_lyxrc ||
1542 show_banner != system_lyxrc.show_banner) {
1543 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1549 if (ignore_system_lyxrc ||
1550 preview != system_lyxrc.preview) {
1556 case PREVIEW_NO_MATH:
1563 os << "\\preview " << status << '\n';
1568 case RC_PREVIEW_HASHED_LABELS:
1569 if (ignore_system_lyxrc ||
1570 preview_hashed_labels !=
1571 system_lyxrc.preview_hashed_labels) {
1572 os << "\\preview_hashed_labels "
1573 << convert<string>(preview_hashed_labels) << '\n';
1578 case RC_PREVIEW_SCALE_FACTOR:
1579 if (ignore_system_lyxrc ||
1580 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1581 os << "\\preview_scale_factor "
1582 << preview_scale_factor << '\n';
1587 case RC_USE_CONVERTER_CACHE:
1588 if (ignore_system_lyxrc ||
1589 use_converter_cache != system_lyxrc.use_converter_cache) {
1590 os << "\\use_converter_cache "
1591 << convert<string>(use_converter_cache) << '\n';
1596 case RC_CONVERTER_CACHE_MAXAGE:
1597 if (ignore_system_lyxrc ||
1598 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1599 os << "\\converter_cache_maxage "
1600 << converter_cache_maxage << '\n';
1606 << "# SCREEN & FONTS SECTION ############################\n"
1610 if (ignore_system_lyxrc ||
1611 icon_set != system_lyxrc.icon_set) {
1612 os << "\\icon_set \"" << icon_set
1618 case RC_USE_SYSTEM_THEME_ICONS:
1619 if (ignore_system_lyxrc ||
1620 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1621 os << "\\use_system_theme_icons "
1622 << convert<string>(use_system_theme_icons)
1629 if (ignore_system_lyxrc ||
1630 dpi != system_lyxrc.dpi) {
1631 os << "\\screen_dpi " << dpi << '\n';
1635 case RC_SCREEN_ZOOM:
1636 if (ignore_system_lyxrc ||
1637 zoom != system_lyxrc.zoom) {
1638 os << "\\screen_zoom " << zoom << '\n';
1642 case RC_GEOMETRY_SESSION:
1643 if (ignore_system_lyxrc ||
1644 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1645 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1650 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1651 if (ignore_system_lyxrc ||
1652 cursor_follows_scrollbar
1653 != system_lyxrc.cursor_follows_scrollbar) {
1654 os << "\\cursor_follows_scrollbar "
1655 << convert<string>(cursor_follows_scrollbar) << '\n';
1659 case RC_CURSOR_WIDTH:
1660 if (ignore_system_lyxrc ||
1662 != system_lyxrc.cursor_width) {
1663 os << "\\cursor_width "
1664 << cursor_width << '\n';
1668 case RC_SCROLL_BELOW_DOCUMENT:
1669 if (ignore_system_lyxrc ||
1670 scroll_below_document
1671 != system_lyxrc.scroll_below_document) {
1672 os << "\\scroll_below_document "
1673 << convert<string>(scroll_below_document) << '\n';
1677 case RC_PARAGRAPH_MARKERS:
1678 if (ignore_system_lyxrc ||
1680 != system_lyxrc.paragraph_markers) {
1681 os << "\\paragraph_markers "
1682 << convert<string>(paragraph_markers) << '\n';
1686 case RC_MAC_DONTSWAP_CTRL_META:
1687 if (ignore_system_lyxrc ||
1688 mac_dontswap_ctrl_meta
1689 != system_lyxrc.mac_dontswap_ctrl_meta) {
1690 os << "\\mac_dontswap_ctrl_meta "
1691 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1695 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1696 if (ignore_system_lyxrc ||
1697 mac_like_cursor_movement
1698 != system_lyxrc.mac_like_cursor_movement) {
1699 os << "\\mac_like_cursor_movement "
1700 << convert<string>(mac_like_cursor_movement) << '\n';
1704 case RC_MACRO_EDIT_STYLE:
1705 if (ignore_system_lyxrc ||
1707 != system_lyxrc.macro_edit_style) {
1708 os << "\\macro_edit_style ";
1709 switch (macro_edit_style) {
1710 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1711 case MACRO_EDIT_INLINE: os << "1\n"; break;
1712 case MACRO_EDIT_LIST: os << "2\n"; break;
1717 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1718 if (ignore_system_lyxrc ||
1719 dialogs_iconify_with_main
1720 != system_lyxrc.dialogs_iconify_with_main) {
1721 os << "\\dialogs_iconify_with_main "
1722 << convert<string>(dialogs_iconify_with_main) << '\n';
1726 case RC_SCREEN_FONT_ROMAN:
1727 if (ignore_system_lyxrc ||
1728 roman_font_name != system_lyxrc.roman_font_name) {
1729 os << "\\screen_font_roman \"" << roman_font_name
1734 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1735 if (ignore_system_lyxrc ||
1736 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1737 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1742 case RC_SCREEN_FONT_SANS:
1743 if (ignore_system_lyxrc ||
1744 sans_font_name != system_lyxrc.sans_font_name) {
1745 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
1758 case RC_SCREEN_FONT_TYPEWRITER:
1759 if (ignore_system_lyxrc ||
1760 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1761 os << "\\screen_font_typewriter \""
1762 << typewriter_font_name << "\"\n";
1766 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1767 if (ignore_system_lyxrc ||
1768 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1769 os << "\\screen_font_typewriter_foundry \""
1770 << typewriter_font_foundry << "\"\n";
1775 case RC_SCREEN_FONT_SCALABLE:
1776 if (ignore_system_lyxrc ||
1777 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1778 os << "\\screen_font_scalable "
1779 << convert<string>(use_scalable_fonts)
1784 case RC_SCREEN_FONT_SIZES:
1785 if (ignore_system_lyxrc ||
1786 font_sizes[FONT_SIZE_TINY]
1787 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1788 font_sizes[FONT_SIZE_SCRIPT]
1789 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1790 font_sizes[FONT_SIZE_FOOTNOTE]
1791 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1792 font_sizes[FONT_SIZE_SMALL]
1793 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1794 font_sizes[FONT_SIZE_NORMAL]
1795 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1796 font_sizes[FONT_SIZE_LARGE]
1797 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1798 font_sizes[FONT_SIZE_LARGER]
1799 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1800 font_sizes[FONT_SIZE_LARGEST]
1801 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1802 font_sizes[FONT_SIZE_HUGE]
1803 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1804 font_sizes[FONT_SIZE_HUGER]
1805 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1806 streamsize old_prec = os.precision();
1807 os.setf(ios::fixed);
1809 os << "\\screen_font_sizes"
1810 << ' ' << font_sizes[FONT_SIZE_TINY]
1811 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1812 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1813 << ' ' << font_sizes[FONT_SIZE_SMALL]
1814 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1815 << ' ' << font_sizes[FONT_SIZE_LARGE]
1816 << ' ' << font_sizes[FONT_SIZE_LARGER]
1817 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1818 << ' ' << font_sizes[FONT_SIZE_HUGE]
1819 << ' ' << font_sizes[FONT_SIZE_HUGER]
1821 os.precision(old_prec);
1822 os.unsetf(ios::fixed);
1826 case RC_FULL_SCREEN_LIMIT:
1827 if (ignore_system_lyxrc ||
1828 full_screen_limit != system_lyxrc.full_screen_limit) {
1829 os << "\\fullscreen_limit "
1830 << convert<string>(full_screen_limit)
1835 case RC_FULL_SCREEN_TOOLBARS:
1836 if (ignore_system_lyxrc ||
1837 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1838 os << "\\fullscreen_toolbars "
1839 << convert<string>(full_screen_toolbars)
1844 case RC_FULL_SCREEN_SCROLLBAR:
1845 if (ignore_system_lyxrc ||
1846 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1847 os << "\\fullscreen_scrollbar "
1848 << convert<string>(full_screen_scrollbar)
1853 case RC_FULL_SCREEN_STATUSBAR:
1854 if (ignore_system_lyxrc ||
1855 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1856 os << "\\fullscreen_statusbar "
1857 << convert<string>(full_screen_statusbar)
1862 case RC_FULL_SCREEN_TABBAR:
1863 if (ignore_system_lyxrc ||
1864 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1865 os << "\\fullscreen_tabbar "
1866 << convert<string>(full_screen_tabbar)
1871 case RC_FULL_SCREEN_MENUBAR:
1872 if (ignore_system_lyxrc ||
1873 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1874 os << "\\fullscreen_menubar "
1875 << convert<string>(full_screen_menubar)
1880 case RC_FULL_SCREEN_WIDTH:
1881 if (ignore_system_lyxrc ||
1882 full_screen_width != system_lyxrc.full_screen_width) {
1883 os << "\\fullscreen_width "
1884 << convert<string>(full_screen_width)
1889 case RC_OPEN_BUFFERS_IN_TABS:
1890 if (ignore_system_lyxrc ||
1891 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1892 os << "\\open_buffers_in_tabs "
1893 << convert<string>(open_buffers_in_tabs)
1898 case RC_SINGLE_CLOSE_TAB_BUTTON:
1899 if (ignore_system_lyxrc ||
1900 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1901 os << "\\single_close_tab_button "
1902 << convert<string>(single_close_tab_button)
1907 case RC_SINGLE_INSTANCE:
1908 if (ignore_system_lyxrc ||
1909 single_instance != system_lyxrc.single_instance) {
1910 os << "\\single_instance "
1911 << convert<string>(single_instance)
1916 case RC_FORWARD_SEARCH_DVI:
1917 if (ignore_system_lyxrc ||
1918 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1919 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1923 case RC_FORWARD_SEARCH_PDF:
1924 if (ignore_system_lyxrc ||
1925 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1926 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1932 << "# COLOR SECTION ###################################\n"
1936 for (int i = 0; i < Color_ignore; ++i) {
1937 ColorCode lc = static_cast<ColorCode>(i);
1938 string const col = lcolor.getX11Name(lc);
1939 if (ignore_system_lyxrc
1940 || col != system_lcolor.getX11Name(lc)) {
1941 os << "\\set_color \""
1942 << lcolor.getLyXName(lc) << "\" \""
1950 << "# PRINTER SECTION ###################################\n"
1953 case RC_PRINTLANDSCAPEFLAG:
1954 if (ignore_system_lyxrc ||
1955 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1956 os << "\\print_landscape_flag \"" << print_landscape_flag
1962 case RC_PRINTPAPERFLAG:
1963 if (ignore_system_lyxrc ||
1964 print_paper_flag != system_lyxrc.print_paper_flag) {
1965 os << "\\print_paper_flag \"" << print_paper_flag
1971 case RC_PRINTPAPERDIMENSIONFLAG:
1972 if (ignore_system_lyxrc ||
1973 print_paper_dimension_flag
1974 != system_lyxrc.print_paper_dimension_flag) {
1975 os << "\\print_paper_dimension_flag \""
1976 << print_paper_dimension_flag << "\"\n";
1982 << "# TEX SECTION #######################################\n"
1985 case RC_TEXINPUTS_PREFIX:
1986 if (ignore_system_lyxrc ||
1987 texinputs_prefix != system_lyxrc.texinputs_prefix) {
1988 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
1993 case RC_FONT_ENCODING:
1994 if (ignore_system_lyxrc ||
1995 fontenc != system_lyxrc.fontenc) {
1996 os << "\\font_encoding \"" << fontenc << "\"\n";
2002 << "# FILE SECTION ######################################\n"
2005 case RC_DOCUMENTPATH:
2006 if (ignore_system_lyxrc ||
2007 document_path != system_lyxrc.document_path) {
2008 string const path = os::external_path(document_path);
2009 os << "\\document_path \"" << path << "\"\n";
2013 case RC_USELASTFILEPOS:
2014 if (ignore_system_lyxrc ||
2015 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2016 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2021 case RC_LOADSESSION:
2022 if (ignore_system_lyxrc ||
2023 load_session != system_lyxrc.load_session) {
2024 os << "\\load_session " << convert<string>(load_session)
2029 case RC_MOUSE_WHEEL_SPEED:
2030 if (ignore_system_lyxrc ||
2031 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2032 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2036 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2037 if (ignore_system_lyxrc ||
2038 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2039 os << "\\mouse_middlebutton_paste "
2040 << convert<string>(mouse_middlebutton_paste) << '\n';
2044 case RC_COMPLETION_INLINE_DELAY:
2045 if (ignore_system_lyxrc ||
2046 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2047 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2051 case RC_COMPLETION_INLINE_MATH:
2052 if (ignore_system_lyxrc ||
2053 completion_inline_math != system_lyxrc.completion_inline_math) {
2054 os << "\\completion_inline_math "
2055 << convert<string>(completion_inline_math) << '\n';
2059 case RC_COMPLETION_INLINE_TEXT:
2060 if (ignore_system_lyxrc ||
2061 completion_inline_text != system_lyxrc.completion_inline_text) {
2062 os << "\\completion_inline_text "
2063 << convert<string>(completion_inline_text) << '\n';
2067 case RC_COMPLETION_INLINE_DOTS:
2068 if (ignore_system_lyxrc ||
2069 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2070 os << "\\completion_inline_dots "
2071 << convert<string>(completion_inline_dots) << '\n';
2075 case RC_AUTOCORRECTION_MATH:
2076 if (ignore_system_lyxrc ||
2077 autocorrection_math != system_lyxrc.autocorrection_math) {
2078 os << "\\autocorrection_math "
2079 << convert<string>(autocorrection_math) << '\n';
2083 case RC_COMPLETION_POPUP_DELAY:
2084 if (ignore_system_lyxrc ||
2085 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2086 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2090 case RC_COMPLETION_POPUP_MATH:
2091 if (ignore_system_lyxrc ||
2092 completion_popup_math != system_lyxrc.completion_popup_math) {
2093 os << "\\completion_popup_math "
2094 << convert<string>(completion_popup_math) << '\n';
2098 case RC_COMPLETION_POPUP_TEXT:
2099 if (ignore_system_lyxrc ||
2100 completion_popup_text != system_lyxrc.completion_popup_text) {
2101 os << "\\completion_popup_text "
2102 << convert<string>(completion_popup_text) << '\n';
2106 case RC_COMPLETION_CURSOR_TEXT:
2107 if (ignore_system_lyxrc ||
2108 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2109 os << "\\completion_cursor_text "
2110 << convert<string>(completion_cursor_text) << '\n';
2114 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2115 if (ignore_system_lyxrc ||
2116 completion_popup_after_complete
2117 != system_lyxrc.completion_popup_after_complete) {
2118 os << "\\completion_popup_after_complete "
2119 << convert<string>(completion_popup_after_complete) << '\n';
2123 case RC_COMPLETION_MINLENGTH:
2124 if (ignore_system_lyxrc ||
2125 completion_minlength != system_lyxrc.completion_minlength) {
2126 os << "\\completion_minlength " << convert<string>(completion_minlength)
2132 case RC_NUMLASTFILES:
2133 if (ignore_system_lyxrc ||
2134 num_lastfiles != system_lyxrc.num_lastfiles) {
2135 os << "\\num_lastfiles " << num_lastfiles << '\n';
2139 case RC_CHECKLASTFILES:
2140 if (ignore_system_lyxrc ||
2141 check_lastfiles != system_lyxrc.check_lastfiles) {
2142 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2147 case RC_EXAMPLEPATH:
2148 if (ignore_system_lyxrc ||
2149 example_path != system_lyxrc.example_path) {
2150 string const path = os::external_path(example_path);
2151 os << "\\example_path \"" << path << "\"\n";
2155 case RC_TEMPLATEPATH:
2156 if (ignore_system_lyxrc ||
2157 template_path != system_lyxrc.template_path) {
2158 string const path = os::external_path(template_path);
2159 os << "\\template_path \"" << path << "\"\n";
2163 case RC_TEMPDIRPATH:
2164 if (ignore_system_lyxrc ||
2165 tempdir_path != system_lyxrc.tempdir_path) {
2166 string const path = os::external_path(tempdir_path);
2167 os << "\\tempdir_path \"" << path << "\"\n";
2171 case RC_THESAURUSDIRPATH:
2172 if (ignore_system_lyxrc ||
2173 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2174 string const path = os::external_path(thesaurusdir_path);
2175 os << "\\thesaurusdir_path \"" << path << "\"\n";
2179 case RC_HUNSPELLDIR_PATH:
2180 if (ignore_system_lyxrc ||
2181 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2182 string const path = os::external_path(hunspelldir_path);
2183 os << "\\hunspelldir_path \"" << path << "\"\n";
2187 case RC_PLAINTEXT_LINELEN:
2188 if (ignore_system_lyxrc ||
2189 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2190 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2194 case RC_MAKE_BACKUP:
2195 if (ignore_system_lyxrc ||
2196 make_backup != system_lyxrc.make_backup) {
2197 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2201 case RC_SAVE_COMPRESSED:
2202 if (ignore_system_lyxrc ||
2203 save_compressed != system_lyxrc.save_compressed) {
2204 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2208 case RC_SAVE_ORIGIN:
2209 if (ignore_system_lyxrc ||
2210 save_origin != system_lyxrc.save_origin) {
2211 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2215 case RC_BACKUPDIR_PATH:
2216 if (ignore_system_lyxrc ||
2217 backupdir_path != system_lyxrc.backupdir_path) {
2218 string const path = os::external_path(backupdir_path);
2219 os << "\\backupdir_path \"" << path << "\"\n";
2225 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2229 << "# SPELLCHECKER SECTION ##############################\n"
2232 case RC_ACCEPT_COMPOUND:
2233 if (ignore_system_lyxrc ||
2234 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2235 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2241 if (ignore_system_lyxrc ||
2242 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2243 os << "\\alternate_language \"" << spellchecker_alt_lang
2249 if (ignore_system_lyxrc ||
2250 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2251 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2255 case RC_USE_SYSTEM_COLORS:
2256 if (ignore_system_lyxrc ||
2257 use_system_colors != system_lyxrc.use_system_colors) {
2258 os << "\\use_system_colors "
2259 << convert<string>(use_system_colors)
2264 case RC_USE_TOOLTIP:
2265 if (ignore_system_lyxrc ||
2266 use_tooltip != system_lyxrc.use_tooltip) {
2267 os << "\\use_tooltip "
2268 << convert<string>(use_tooltip)
2273 case RC_USE_PIXMAP_CACHE:
2274 if (ignore_system_lyxrc ||
2275 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2276 os << "\\use_pixmap_cache "
2277 << convert<string>(use_pixmap_cache)
2283 if (ignore_system_lyxrc ||
2284 use_qimage != system_lyxrc.use_qimage) {
2285 os << "\\use_qimage "
2286 << convert<string>(use_qimage)
2293 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2296 case RC_DEFAULT_DECIMAL_POINT:
2297 if (ignore_system_lyxrc ||
2298 default_decimal_point != system_lyxrc.default_decimal_point) {
2299 os << "\\default_decimal_point " << default_decimal_point << '\n';
2304 case RC_DEFAULT_LENGTH_UNIT:
2305 if (ignore_system_lyxrc ||
2306 default_length_unit != system_lyxrc.default_length_unit) {
2307 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2312 case RC_SPELLCHECKER:
2313 if (ignore_system_lyxrc ||
2314 spellchecker != system_lyxrc.spellchecker) {
2315 os << "\\spellchecker " << spellchecker << '\n';
2320 case RC_SPELLCHECK_CONTINUOUSLY:
2321 if (ignore_system_lyxrc ||
2322 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2323 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2329 case RC_SPELLCHECK_NOTES:
2330 if (ignore_system_lyxrc ||
2331 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2332 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2338 case RC_VISUAL_CURSOR:
2339 if (ignore_system_lyxrc ||
2340 visual_cursor != system_lyxrc.visual_cursor) {
2341 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2345 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2346 if (ignore_system_lyxrc ||
2347 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2348 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2349 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2353 case RC_LANGUAGE_CUSTOM_PACKAGE:
2354 if (ignore_system_lyxrc ||
2355 language_custom_package != system_lyxrc.language_custom_package) {
2356 os << "\\language_custom_package \"" << language_custom_package
2361 case RC_LANGUAGE_GLOBAL_OPTIONS:
2362 if (ignore_system_lyxrc ||
2363 language_global_options
2364 != system_lyxrc.language_global_options) {
2365 os << "\\language_global_options \""
2366 << convert<string>(language_global_options)
2371 case RC_LANGUAGE_PACKAGE_SELECTION:
2372 if (ignore_system_lyxrc ||
2373 language_package_selection != system_lyxrc.language_package_selection) {
2374 os << "\\language_package_selection ";
2375 switch (language_package_selection) {
2392 case RC_LANGUAGE_COMMAND_BEGIN:
2393 if (ignore_system_lyxrc ||
2394 language_command_begin
2395 != system_lyxrc.language_command_begin) {
2396 os << "\\language_command_begin \""
2397 << language_command_begin
2402 case RC_LANGUAGE_COMMAND_END:
2403 if (ignore_system_lyxrc ||
2404 language_command_end
2405 != system_lyxrc.language_command_end) {
2406 os << "\\language_command_end \"" << language_command_end
2411 case RC_LANGUAGE_COMMAND_LOCAL:
2412 if (ignore_system_lyxrc ||
2413 language_command_local
2414 != system_lyxrc.language_command_local) {
2415 os << "\\language_command_local \""
2416 << language_command_local
2421 case RC_LANGUAGE_AUTO_BEGIN:
2422 if (ignore_system_lyxrc ||
2423 language_auto_begin != system_lyxrc.language_auto_begin) {
2424 os << "\\language_auto_begin "
2425 << convert<string>(language_auto_begin) << '\n';
2429 case RC_LANGUAGE_AUTO_END:
2430 if (ignore_system_lyxrc ||
2431 language_auto_end != system_lyxrc.language_auto_end) {
2432 os << "\\language_auto_end "
2433 << convert<string>(language_auto_end) << '\n';
2437 case RC_MARK_FOREIGN_LANGUAGE:
2438 if (ignore_system_lyxrc ||
2439 mark_foreign_language
2440 != system_lyxrc.mark_foreign_language) {
2441 os << "\\mark_foreign_language " <<
2442 convert<string>(mark_foreign_language) << '\n';
2448 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2451 case RC_AUTO_NUMBER:
2452 if (ignore_system_lyxrc ||
2453 auto_number != system_lyxrc.auto_number) {
2454 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2458 case RC_GUI_LANGUAGE:
2459 if (ignore_system_lyxrc ||
2460 gui_language != system_lyxrc.gui_language) {
2461 os << "\\gui_language " << gui_language << '\n';
2465 case RC_EXPORT_OVERWRITE:
2466 if (ignore_system_lyxrc ||
2467 export_overwrite != system_lyxrc.export_overwrite) {
2469 switch (export_overwrite) {
2480 os << "\\export_overwrite " << status << '\n';
2485 case RC_SCROLL_WHEEL_ZOOM:
2486 if (ignore_system_lyxrc ||
2487 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2489 switch (scroll_wheel_zoom) {
2490 case SCROLL_WHEEL_ZOOM_OFF:
2493 case SCROLL_WHEEL_ZOOM_CTRL:
2496 case SCROLL_WHEEL_ZOOM_SHIFT:
2499 case SCROLL_WHEEL_ZOOM_ALT:
2503 os << "\\scroll_wheel_zoom " << status << '\n';
2509 << "# FORMATS SECTION ##########################\n"
2513 // New/modified formats
2514 for (Formats::const_iterator cit = formats.begin();
2515 cit != formats.end(); ++cit) {
2516 Format const * format =
2517 system_formats.getFormat(cit->name());
2519 format->extensions() != cit->extensions() ||
2520 format->prettyname() != cit->prettyname() ||
2521 format->shortcut() != cit->shortcut() ||
2522 format->viewer() != cit->viewer() ||
2523 format->editor() != cit->editor() ||
2524 format->documentFormat() != cit->documentFormat() ||
2525 format->vectorFormat() != cit->vectorFormat() ||
2526 format->inExportMenu() != cit->inExportMenu() ||
2527 format->mime() != cit->mime()) {
2528 os << "\\format \"" << cit->name() << "\" \""
2529 << cit->extensions() << "\" \""
2530 << to_utf8(cit->prettyname()) << "\" \""
2531 << cit->shortcut() << "\" \""
2532 << escapeCommand(cit->viewer()) << "\" \""
2533 << escapeCommand(cit->editor()) << "\" \"";
2534 vector<string> flags;
2535 if (cit->documentFormat())
2536 flags.push_back("document");
2537 if (cit->vectorFormat())
2538 flags.push_back("vector");
2539 if (cit->zippedNative())
2540 flags.push_back("zipped=native");
2541 if (cit->inExportMenu())
2542 flags.push_back("menu=export");
2544 os << getStringFromVector(flags);
2545 os << "\" \"" << cit->mime() << "\"\n";
2549 // Look for deleted formats
2550 for (Formats::const_iterator cit = system_formats.begin();
2551 cit != system_formats.end(); ++cit)
2552 if (!formats.getFormat(cit->name()))
2553 os << "\\format \"" << cit->name()
2554 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2557 case RC_VIEWER_ALTERNATIVES: {
2558 Alternatives::const_iterator it = viewer_alternatives.begin();
2559 Alternatives::const_iterator const en = viewer_alternatives.end();
2560 Alternatives::const_iterator const sysend =
2561 system_lyxrc.viewer_alternatives.end();
2562 for (; it != en; ++it) {
2563 string const & fmt = it->first;
2564 CommandSet const & cmd = it->second;
2565 CommandSet::const_iterator sit = cmd.begin();
2566 CommandSet::const_iterator const sen = cmd.end();
2567 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2568 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2569 system_lyxrc.viewer_alternatives.find(fmt);
2570 for (; sit != sen; ++sit) {
2571 string const & cmd = *sit;
2572 if (ignore_system_lyxrc
2573 || sysfmt == sysend // format not found
2574 || sysfmt->second.count(cmd) == 0 // this command not found
2576 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2582 case RC_EDITOR_ALTERNATIVES: {
2583 Alternatives::const_iterator it = editor_alternatives.begin();
2584 Alternatives::const_iterator const en = editor_alternatives.end();
2585 Alternatives::const_iterator const sysend =
2586 system_lyxrc.editor_alternatives.end();
2587 for (; it != en; ++it) {
2588 string const & fmt = it->first;
2589 CommandSet const & cmd = it->second;
2590 CommandSet::const_iterator sit = cmd.begin();
2591 CommandSet::const_iterator const sen = cmd.end();
2592 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2593 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2594 system_lyxrc.editor_alternatives.find(fmt);
2595 for (; sit != sen; ++sit) {
2596 string const & cmd = *sit;
2597 if (ignore_system_lyxrc
2598 || sysfmt == sysend // format not found
2599 || sysfmt->second.count(cmd) == 0 // this command not found
2601 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2607 case RC_DEFAULT_OTF_VIEW_FORMAT:
2608 if ((ignore_system_lyxrc ||
2609 default_otf_view_format != system_lyxrc.default_otf_view_format)
2610 && !default_otf_view_format.empty()) {
2611 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2615 case RC_DEFAULT_VIEW_FORMAT:
2616 if (ignore_system_lyxrc ||
2617 default_view_format != system_lyxrc.default_view_format) {
2618 os << "\\default_view_format " << default_view_format << '\n';
2628 << "# CONVERTERS SECTION ##########################\n"
2632 // Look for new converters
2633 for (Converters::const_iterator cit = theConverters().begin();
2634 cit != theConverters().end(); ++cit) {
2635 Converter const * converter =
2636 theSystemConverters().getConverter(cit->from(),
2639 converter->command() != cit->command() ||
2640 converter->flags() != cit->flags())
2641 os << "\\converter \"" << cit->from() << "\" \""
2642 << cit->to() << "\" \""
2643 << escapeCommand(cit->command()) << "\" \""
2644 << cit->flags() << "\"\n";
2647 // New/modifed converters
2648 for (Converters::const_iterator cit = theSystemConverters().begin();
2649 cit != theSystemConverters().end(); ++cit)
2650 if (!theConverters().getConverter(cit->from(), cit->to()))
2651 os << "\\converter \"" << cit->from()
2652 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2659 << "# COPIERS SECTION ##########################\n"
2662 // Look for new movers
2663 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2664 Movers::const_iterator const sysend = theSystemMovers().end();
2665 Movers::const_iterator it = theMovers().begin();
2666 Movers::const_iterator end = theMovers().end();
2668 for (; it != end; ++it) {
2669 Movers::const_iterator const sysit =
2670 find_if(sysbegin, sysend, SameMover(*it));
2671 if (sysit == sysend) {
2672 string const & fmt = it->first;
2673 string const & command =
2674 it->second.command();
2676 os << "\\copier " << fmt
2677 << " \"" << escapeCommand(command) << "\"\n";
2683 // We don't actually delete SpecialisedMover(s) from the
2684 // map, just clear their 'command', so there's no need
2685 // to test for anything else.
2692 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2694 // Why the switch you might ask. It is a trick to ensure that all
2695 // the elements in the LyXRCTags enum is handled. As you can see
2696 // there are no breaks at all. So it is just a huge fall-through.
2697 // The nice thing is that we will get a warning from the compiler
2698 // if we forget an element.
2699 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2701 case LyXRC::RC_LAST:
2702 case LyXRC::RC_ACCEPT_COMPOUND:
2703 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2704 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2706 case LyXRC::RC_ALT_LANG:
2707 case LyXRC::RC_PLAINTEXT_LINELEN:
2708 case LyXRC::RC_AUTOCORRECTION_MATH:
2709 case LyXRC::RC_AUTOREGIONDELETE:
2710 case LyXRC::RC_AUTORESET_OPTIONS:
2711 case LyXRC::RC_AUTOSAVE:
2712 case LyXRC::RC_AUTO_NUMBER:
2713 case LyXRC::RC_BACKUPDIR_PATH:
2714 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2715 case LyXRC::RC_BIBTEX_COMMAND:
2716 case LyXRC::RC_BINDFILE:
2717 case LyXRC::RC_CHECKLASTFILES:
2718 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2719 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2720 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2721 case LyXRC::RC_COMPLETION_INLINE_MATH:
2722 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2723 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2724 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2725 case LyXRC::RC_COMPLETION_POPUP_MATH:
2726 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2727 case LyXRC::RC_COMPLETION_MINLENGTH:
2728 case LyXRC::RC_USELASTFILEPOS:
2729 case LyXRC::RC_LOADSESSION:
2730 case LyXRC::RC_CHKTEX_COMMAND:
2731 case LyXRC::RC_CONVERTER:
2732 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2733 case LyXRC::RC_COPIER:
2734 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2735 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2736 case LyXRC::RC_DATE_INSERT_FORMAT:
2737 case LyXRC::RC_GUI_LANGUAGE:
2738 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2739 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2740 case LyXRC::RC_DEFFILE:
2741 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2742 case LyXRC::RC_DISPLAY_GRAPHICS:
2743 case LyXRC::RC_DOCUMENTPATH:
2744 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2745 FileName path(lyxrc_new.document_path);
2746 if (path.exists() && path.isDirectory())
2747 package().document_dir() = FileName(lyxrc.document_path);
2750 case LyXRC::RC_EDITOR_ALTERNATIVES:
2751 case LyXRC::RC_ESC_CHARS:
2752 case LyXRC::RC_EXAMPLEPATH:
2753 case LyXRC::RC_FONT_ENCODING:
2754 case LyXRC::RC_FILEFORMAT:
2755 case LyXRC::RC_GROUP_LAYOUTS:
2756 case LyXRC::RC_HUNSPELLDIR_PATH:
2757 case LyXRC::RC_ICON_SET:
2758 case LyXRC::RC_INDEX_ALTERNATIVES:
2759 case LyXRC::RC_INDEX_COMMAND:
2760 case LyXRC::RC_JBIBTEX_COMMAND:
2761 case LyXRC::RC_JINDEX_COMMAND:
2762 case LyXRC::RC_NOMENCL_COMMAND:
2763 case LyXRC::RC_INPUT:
2764 case LyXRC::RC_KBMAP:
2765 case LyXRC::RC_KBMAP_PRIMARY:
2766 case LyXRC::RC_KBMAP_SECONDARY:
2767 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2768 case LyXRC::RC_LANGUAGE_AUTO_END:
2769 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2770 case LyXRC::RC_LANGUAGE_COMMAND_END:
2771 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2772 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2773 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2774 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2775 case LyXRC::RC_LYXRCFORMAT:
2776 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2777 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2778 case LyXRC::RC_MACRO_EDIT_STYLE:
2779 case LyXRC::RC_MAKE_BACKUP:
2780 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2781 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2782 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2783 case LyXRC::RC_NUMLASTFILES:
2784 case LyXRC::RC_PARAGRAPH_MARKERS:
2785 case LyXRC::RC_PATH_PREFIX:
2786 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2787 prependEnvPath("PATH", lyxrc_new.path_prefix);
2788 // Resets python path
2789 support::os::python(true);
2792 case LyXRC::RC_PREVIEW:
2793 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2794 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2795 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2796 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2797 case LyXRC::RC_PRINTPAPERFLAG:
2798 case LyXRC::RC_SAVE_COMPRESSED:
2799 case LyXRC::RC_SAVE_ORIGIN:
2800 case LyXRC::RC_SCREEN_DPI:
2801 case LyXRC::RC_SCREEN_FONT_ROMAN:
2802 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2803 case LyXRC::RC_SCREEN_FONT_SANS:
2804 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2805 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2806 case LyXRC::RC_SCREEN_FONT_SIZES:
2807 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2808 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2809 case LyXRC::RC_GEOMETRY_SESSION:
2810 case LyXRC::RC_SCREEN_ZOOM:
2811 case LyXRC::RC_SERVERPIPE:
2812 case LyXRC::RC_SET_COLOR:
2813 case LyXRC::RC_SHOW_BANNER:
2814 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2815 case LyXRC::RC_SPELLCHECKER:
2816 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2819 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2820 case LyXRC::RC_SPELLCHECK_NOTES:
2821 case LyXRC::RC_SPLITINDEX_COMMAND:
2822 case LyXRC::RC_TEMPDIRPATH:
2823 case LyXRC::RC_TEMPLATEPATH:
2824 case LyXRC::RC_TEX_ALLOWS_SPACES:
2825 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2826 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2827 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2830 case LyXRC::RC_TEXINPUTS_PREFIX:
2831 case LyXRC::RC_THESAURUSDIRPATH:
2832 case LyXRC::RC_UIFILE:
2833 case LyXRC::RC_USER_EMAIL:
2834 case LyXRC::RC_USER_NAME:
2835 case LyXRC::RC_USE_CONVERTER_CACHE:
2836 case LyXRC::RC_USE_SYSTEM_COLORS:
2837 case LyXRC::RC_USE_TOOLTIP:
2838 case LyXRC::RC_USE_PIXMAP_CACHE:
2839 case LyXRC::RC_USE_QIMAGE:
2840 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2841 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2842 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2843 case LyXRC::RC_SINGLE_INSTANCE:
2844 case LyXRC::RC_SORT_LAYOUTS:
2845 case LyXRC::RC_FULL_SCREEN_LIMIT:
2846 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2847 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2848 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2849 case LyXRC::RC_FULL_SCREEN_TABBAR:
2850 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2851 case LyXRC::RC_FULL_SCREEN_WIDTH:
2852 case LyXRC::RC_VISUAL_CURSOR:
2853 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2854 case LyXRC::RC_VIEWER:
2855 case LyXRC::RC_VIEWER_ALTERNATIVES:
2856 case LyXRC::RC_FORWARD_SEARCH_DVI:
2857 case LyXRC::RC_FORWARD_SEARCH_PDF:
2858 case LyXRC::RC_EXPORT_OVERWRITE:
2859 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2860 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2861 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2862 case LyXRC::RC_CURSOR_WIDTH:
2869 string const LyXRC::getDescription(LyXRCTags tag)
2874 case RC_ACCEPT_COMPOUND:
2875 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2879 str = _("Specify an alternate language. The default is to use the language of the document.");
2882 case RC_PLAINTEXT_LINELEN:
2883 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.");
2886 case RC_AUTOREGIONDELETE:
2887 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2890 case RC_AUTORESET_OPTIONS:
2891 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2895 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2898 case RC_AUTO_NUMBER:
2901 case RC_BACKUPDIR_PATH:
2902 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.");
2905 case RC_BIBTEX_COMMAND:
2906 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2909 case RC_JBIBTEX_COMMAND:
2910 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2914 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2917 case RC_CHECKLASTFILES:
2918 str = _("Select to check whether the lastfiles still exist.");
2921 case RC_CHKTEX_COMMAND:
2922 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2931 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2932 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.");
2935 case RC_CURSOR_WIDTH:
2936 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2939 case RC_SCROLL_BELOW_DOCUMENT:
2940 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");
2943 case RC_MAC_DONTSWAP_CTRL_META:
2944 str = _("Make Apple key act as Meta and Control key as Ctrl.");
2947 case RC_MAC_LIKE_CURSOR_MOVEMENT:
2948 str = _("Use the Mac OS X conventions for cursor movement");
2951 case RC_SHOW_MACRO_LABEL:
2952 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2955 case RC_DATE_INSERT_FORMAT:
2956 //xgettext:no-c-format
2957 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2961 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2964 case RC_DEFAULT_OTF_VIEW_FORMAT:
2965 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
2968 case RC_DEFAULT_VIEW_FORMAT:
2969 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2972 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2973 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2976 case RC_DISPLAY_GRAPHICS:
2977 str = _("Select how LyX will display any graphics.");
2980 case RC_DOCUMENTPATH:
2981 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2985 str = _("Specify additional chars that can be part of a word.");
2988 case RC_EXAMPLEPATH:
2989 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2992 case RC_FONT_ENCODING:
2993 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2999 case RC_INDEX_COMMAND:
3000 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\".");
3003 case RC_JINDEX_COMMAND:
3004 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3007 case RC_NOMENCL_COMMAND:
3008 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3015 case RC_KBMAP_PRIMARY:
3016 case RC_KBMAP_SECONDARY:
3017 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.");
3020 case RC_LANGUAGE_AUTO_BEGIN:
3021 str = _("Select if a language switching command is needed at the beginning of the document.");
3024 case RC_LANGUAGE_AUTO_END:
3025 str = _("Select if a language switching command is needed at the end of the document.");
3028 case RC_LANGUAGE_COMMAND_BEGIN:
3029 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.");
3032 case RC_LANGUAGE_COMMAND_END:
3033 str = _("The LaTeX command for changing back to the language of the document.");
3036 case RC_LANGUAGE_COMMAND_LOCAL:
3037 str = _("The LaTeX command for local changing of the language.");
3040 case RC_LANGUAGE_GLOBAL_OPTIONS:
3041 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3044 case RC_LANGUAGE_CUSTOM_PACKAGE:
3045 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3048 case RC_LANGUAGE_PACKAGE_SELECTION:
3049 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3052 case RC_USELASTFILEPOS:
3053 str = _("De-select if you do not want LyX to scroll to saved position.");
3056 case RC_LOADSESSION:
3057 str = _("De-select to prevent loading files opened from the last LyX session.");
3060 case RC_MAKE_BACKUP:
3061 str = _("De-select if you don't want LyX to create backup files.");
3064 case RC_MARK_FOREIGN_LANGUAGE:
3065 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3068 case RC_MOUSE_WHEEL_SPEED:
3069 str = _("The scrolling speed of the mouse wheel.");
3072 case RC_COMPLETION_POPUP_DELAY:
3073 str = _("The completion popup delay.");
3076 case RC_COMPLETION_POPUP_MATH:
3077 str = _("Select to display the completion popup in math mode.");
3080 case RC_COMPLETION_POPUP_TEXT:
3081 str = _("Select to display the completion popup in text mode.");
3084 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3085 str = _("Show the completion popup without delay after non-unique completion attempt.");
3088 case RC_COMPLETION_POPUP_TEXT:
3089 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3092 case RC_COMPLETION_POPUP_DELAY:
3093 str = _("The inline completion delay.");
3096 case RC_COMPLETION_INLINE_MATH:
3097 str = _("Select to display the inline completion in math mode.");
3100 case RC_COMPLETION_INLINE_TEXT:
3101 str = _("Select to display the inline completion in text mode.");
3104 case RC_COMPLETION_INLINE_DOTS:
3105 str = _("Use \"...\" to shorten long completions.");
3108 case RC_AUTOCORRECTION_MATH:
3109 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3112 case RC_NUMLASTFILES:
3113 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3117 case RC_PATH_PREFIX:
3118 str = _("Specify those directories which should be "
3119 "prepended to the PATH environment variable.\n"
3120 "Use the OS native format.");
3124 str = _("Shows a typeset preview of things such as math");
3127 case RC_PREVIEW_HASHED_LABELS:
3128 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3131 case RC_PREVIEW_SCALE_FACTOR:
3132 str = _("Scale the preview size to suit.");
3135 case RC_PRINTLANDSCAPEFLAG:
3136 str = _("The option to print out in landscape.");
3139 case RC_PRINTPAPERDIMENSIONFLAG:
3140 str = _("Option to specify the dimensions of the print paper.");
3143 case RC_PRINTPAPERFLAG:
3144 str = _("The option to specify paper type.");
3147 case RC_VISUAL_CURSOR:
3148 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3151 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3152 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).");
3156 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3159 case RC_SCREEN_FONT_ROMAN:
3160 case RC_SCREEN_FONT_SANS:
3161 case RC_SCREEN_FONT_TYPEWRITER:
3162 str = _("The screen fonts used to display the text while editing.");
3165 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3166 case RC_SCREEN_FONT_SANS_FOUNDRY:
3167 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3170 case RC_SCREEN_FONT_SCALABLE:
3171 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.");
3174 case RC_SCREEN_FONT_SIZES:
3175 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3178 case RC_SCREEN_ZOOM:
3179 //xgettext:no-c-format
3180 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3183 case RC_GEOMETRY_SESSION:
3184 str = _("Allow session manager to save and restore windows geometry.");
3188 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3194 case RC_SHOW_BANNER:
3195 str = _("De-select if you don't want the startup banner.");
3198 case RC_TEMPDIRPATH:
3199 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3202 case RC_THESAURUSDIRPATH:
3203 str = _("This is the place where the files of the thesaurus library reside.");
3206 case RC_TEMPLATEPATH:
3207 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3210 case RC_TEX_ALLOWS_SPACES:
3213 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3216 case RC_TEXINPUTS_PREFIX:
3217 str = _("Specify those directories which should be "
3218 "prepended to the TEXINPUTS environment variable.\n"
3219 "A '.' represents the current document directory. "
3220 "Use the OS native format.");
3224 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3233 case RC_USE_USE_SYSTEM_COLORS:
3234 str = _("Enable use the system colors for some things like main window background and selection.");
3237 case RC_USE_TOOLTIP:
3238 str = _("Enable the automatic appearance of tool tips in the work area.");
3241 case RC_USE_PIXMAP_CACHE:
3242 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3245 case RC_VIEWDVI_PAPEROPTION:
3246 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3261 // The global instance
3264 // The global copy of the system lyxrc entries (everything except preferences)