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());
640 document_path = expandPath(document_path);
646 example_path = os::internal_path(lexrc.getString());
647 example_path = expandPath(example_path);
651 case RC_TEMPLATEPATH:
653 template_path = os::internal_path(lexrc.getString());
654 template_path = expandPath(template_path);
660 tempdir_path = os::internal_path(lexrc.getString());
661 tempdir_path = expandPath(tempdir_path);
665 case RC_THESAURUSDIRPATH:
667 thesaurusdir_path = os::internal_path(lexrc.getString());
668 thesaurusdir_path = expandPath(thesaurusdir_path);
672 case RC_HUNSPELLDIR_PATH:
674 hunspelldir_path = os::internal_path(lexrc.getString());
675 hunspelldir_path = expandPath(hunspelldir_path);
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());
819 lyxpipes = expandPath(lyxpipes);
823 case RC_CURSOR_FOLLOWS_SCROLLBAR:
824 lexrc >> cursor_follows_scrollbar;
827 case RC_CURSOR_WIDTH:
828 lexrc >> cursor_width;
831 case RC_SCROLL_BELOW_DOCUMENT:
832 lexrc >> scroll_below_document;
835 case RC_PARAGRAPH_MARKERS:
836 lexrc >> paragraph_markers;
839 case RC_MAC_DONTSWAP_CTRL_META:
840 lexrc >> mac_dontswap_ctrl_meta;
843 case RC_MAC_LIKE_CURSOR_MOVEMENT:
844 lexrc >> mac_like_cursor_movement;
847 case RC_MACRO_EDIT_STYLE:
849 switch (lexrc.getInteger()) {
850 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
851 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
852 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
857 case RC_DIALOGS_ICONIFY_WITH_MAIN:
858 lexrc >> dialogs_iconify_with_main;
861 case RC_PLAINTEXT_LINELEN:
862 lexrc >> plaintext_linelen;
864 // Spellchecker settings:
865 case RC_ACCEPT_COMPOUND:
866 lexrc >> spellchecker_accept_compound;
868 case RC_USE_SYSTEM_COLORS:
869 lexrc >> use_system_colors;
872 lexrc >> use_tooltip;
874 case RC_USE_PIXMAP_CACHE:
875 lexrc >> use_pixmap_cache;
880 case RC_SPELLCHECKER:
881 lexrc >> spellchecker;
884 lexrc >> spellchecker_alt_lang;
887 lexrc >> spellchecker_esc_chars;
889 case RC_SPELLCHECK_CONTINUOUSLY:
890 lexrc >> spellcheck_continuously;
892 case RC_SPELLCHECK_NOTES:
893 lexrc >> spellcheck_notes;
896 lexrc >> make_backup;
898 case RC_SAVE_COMPRESSED:
899 lexrc >> save_compressed;
902 lexrc >> save_origin;
904 case RC_BACKUPDIR_PATH:
906 backupdir_path = os::internal_path(lexrc.getString());
907 backupdir_path = expandPath(backupdir_path);
910 case RC_DEFAULT_DECIMAL_POINT:
911 lexrc >> default_decimal_point;
913 case RC_DEFAULT_LENGTH_UNIT:
915 default_length_unit = (Length::UNIT) lexrc.getInteger();
917 case RC_DATE_INSERT_FORMAT:
918 lexrc >> date_insert_format;
920 case RC_LANGUAGE_CUSTOM_PACKAGE:
921 lexrc >> language_custom_package;
923 case RC_LANGUAGE_AUTO_BEGIN:
924 lexrc >> language_auto_begin;
926 case RC_LANGUAGE_AUTO_END:
927 lexrc >> language_auto_end;
929 case RC_LANGUAGE_GLOBAL_OPTIONS:
930 lexrc >> language_global_options;
932 case RC_LANGUAGE_PACKAGE_SELECTION:
934 switch (lexrc.getInteger()) {
936 language_package_selection = LP_AUTO;
939 language_package_selection = LP_BABEL;
942 language_package_selection = LP_CUSTOM;
945 language_package_selection = LP_NONE;
950 case RC_LANGUAGE_COMMAND_BEGIN:
951 lexrc >> language_command_begin;
953 case RC_LANGUAGE_COMMAND_END:
954 lexrc >> language_command_end;
956 case RC_LANGUAGE_COMMAND_LOCAL:
957 lexrc >> language_command_local;
959 case RC_VISUAL_CURSOR:
960 lexrc >> visual_cursor;
962 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
963 lexrc >> close_buffer_with_last_view;
966 lexrc >> auto_number;
968 case RC_MARK_FOREIGN_LANGUAGE:
969 lexrc >> mark_foreign_language;
975 fmt = lexrc.getString();
976 if (lexrc.next(true))
977 command = lexrc.getString();
978 setMover(fmt, command);
983 string from, to, command, flags;
985 from = lexrc.getString();
987 to = lexrc.getString();
988 if (lexrc.next(true))
989 command = lexrc.getString();
991 flags = lexrc.getString();
993 theConverters().erase(from, to);
995 theConverters().add(from, to, command, flags);
998 // compatibility with versions older than 1.4.0 only
1000 string format, command;
1001 lexrc >> format >> command;
1002 formats.setViewer(format, command);
1005 case RC_FILEFORMAT: {
1007 string format, extensions, prettyname, shortcut;
1008 if (!(lexrc >> format >> extensions))
1010 if (ok && lexrc.next(true))
1011 prettyname = lexrc.getString();
1015 if(!(lexrc >> shortcut))
1017 string viewer, editor;
1018 if (ok && lexrc.next(true))
1019 viewer = lexrc.getString();
1022 if (ok && lexrc.next(true))
1023 editor = lexrc.getString();
1027 if (!(lexrc >> flags >> mime))
1029 int flgs = Format::none;
1030 while (!flags.empty()) {
1032 flags = split(flags, flag, ',');
1033 if (flag == "document")
1034 flgs |= Format::document;
1035 else if (flag == "vector")
1036 flgs |= Format::vector;
1037 else if (flag == "zipped=native")
1038 flgs |= Format::zipped_native;
1039 else if (flag == "menu=export")
1040 flgs |= Format::export_menu;
1042 LYXERR0("Ignoring unknown flag `"
1043 << flag << "' for format `"
1047 LYXERR0("Syntax error in format " << format);
1048 else if (prettyname.empty()) {
1049 if (theConverters().formatIsUsed(format))
1050 LYXERR0("Can't delete format " << format);
1052 formats.erase(format);
1054 formats.add(format, extensions, prettyname,
1055 shortcut, viewer, editor, mime, flgs);
1059 case RC_VIEWER_ALTERNATIVES: {
1060 string format, command;
1061 if ((lexrc >> format) && lexrc.next(true)) {
1062 command = lexrc.getString();
1063 viewer_alternatives[format].insert(command);
1067 case RC_EDITOR_ALTERNATIVES: {
1068 string format, command;
1069 if ((lexrc >> format) && lexrc.next(true)) {
1070 command = lexrc.getString();
1071 editor_alternatives[format].insert(command);
1076 case RC_DEFAULT_OTF_VIEW_FORMAT:
1077 lexrc >> default_otf_view_format;
1080 case RC_DEFAULT_VIEW_FORMAT:
1081 lexrc >> default_view_format;
1084 case RC_GUI_LANGUAGE:
1085 lexrc >> gui_language;
1088 case RC_SHOW_BANNER:
1089 lexrc >> show_banner;
1094 string const tmp = lexrc.getString();
1095 if (tmp == "true" || tmp == "on")
1096 preview = PREVIEW_ON;
1097 else if (tmp == "no_math")
1098 preview = PREVIEW_NO_MATH;
1100 preview = PREVIEW_OFF;
1101 if (tmp != "false" && tmp != "off")
1102 LYXERR0("Unrecognized preview status \""
1108 case RC_PREVIEW_HASHED_LABELS:
1109 lexrc >> preview_hashed_labels;
1112 case RC_PREVIEW_SCALE_FACTOR:
1113 lexrc >> preview_scale_factor;
1120 lexrc >> user_email;
1123 case RC_PATH_PREFIX:
1124 lexrc >> path_prefix;
1127 case RC_USE_CONVERTER_CACHE:
1128 lexrc >> use_converter_cache;
1130 case RC_CONVERTER_CACHE_MAXAGE:
1131 lexrc >> converter_cache_maxage;
1134 case RC_SORT_LAYOUTS:
1135 lexrc >> sort_layouts;
1137 case RC_GROUP_LAYOUTS:
1138 lexrc >> group_layouts;
1140 case RC_FULL_SCREEN_LIMIT:
1141 lexrc >> full_screen_limit;
1143 case RC_FULL_SCREEN_TOOLBARS:
1144 lexrc >> full_screen_toolbars;
1146 case RC_FULL_SCREEN_SCROLLBAR:
1147 lexrc >> full_screen_scrollbar;
1149 case RC_FULL_SCREEN_STATUSBAR:
1150 lexrc >> full_screen_statusbar;
1152 case RC_FULL_SCREEN_TABBAR:
1153 lexrc >> full_screen_tabbar;
1155 case RC_FULL_SCREEN_MENUBAR:
1156 lexrc >> full_screen_menubar;
1158 case RC_FULL_SCREEN_WIDTH:
1159 lexrc >> full_screen_width;
1161 case RC_OPEN_BUFFERS_IN_TABS:
1162 lexrc >> open_buffers_in_tabs;
1164 case RC_SINGLE_CLOSE_TAB_BUTTON:
1165 lexrc >> single_close_tab_button;
1167 case RC_SINGLE_INSTANCE:
1168 lexrc >> single_instance;
1169 if (run_mode == PREFERRED)
1170 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1172 case RC_FORWARD_SEARCH_DVI:
1173 if (lexrc.next(true))
1174 forward_search_dvi = lexrc.getString();
1176 case RC_FORWARD_SEARCH_PDF:
1177 if (lexrc.next(true))
1178 forward_search_pdf = lexrc.getString();
1180 case RC_EXPORT_OVERWRITE:
1182 string const tmp = lexrc.getString();
1183 if (tmp == "all" || tmp == "true")
1184 export_overwrite = ALL_FILES;
1185 else if (tmp == "main")
1186 export_overwrite = MAIN_FILE;
1188 export_overwrite = NO_FILES;
1189 if (tmp != "ask" && tmp != "false")
1190 LYXERR0("Unrecognized export_overwrite status \""
1195 case RC_SCROLL_WHEEL_ZOOM:
1197 string const tmp = lexrc.getString();
1199 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1200 else if (tmp == "shift")
1201 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1202 else if (tmp == "alt")
1203 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1205 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1206 if (tmp != "off" && tmp != "false")
1207 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1213 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1214 lexrc >> mouse_middlebutton_paste;
1218 break; // this is just a dummy
1221 // This is triggered the first time through the loop unless
1222 // we hit a format tag.
1223 if (check_format && format != LYXRC_FILEFORMAT)
1224 return FormatMismatch;
1227 /// Update converters data-structures
1228 theConverters().update(formats);
1229 theConverters().buildGraph();
1230 theBufferList().invalidateConverterCache();
1236 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1238 ofstream ofs(filename.toFilesystemEncoding().c_str());
1240 write(ofs, ignore_system_lyxrc);
1244 void LyXRC::print() const
1246 if (lyxerr.debugging())
1247 write(lyxerr, false);
1255 typedef pair<string, SpecialisedMover> Data;
1257 SameMover(Data const & comparison)
1258 : comparison_(comparison) {}
1260 bool operator()(Data const & data) const
1262 return data.first == comparison_.first &&
1263 data.second.command() == comparison_.second.command();
1273 // Escape \ and " so that LyXLex can read the string later
1274 string escapeCommand(string const & str) {
1275 return subst(subst(str , "\\", "\\\\"),
1282 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1284 LyXRCTags tag = RC_LAST;
1286 if (!name.empty()) {
1287 for (int i = 0; i != lyxrcCount; ++i)
1288 if ("\\" + name == lyxrcTags[i].tag)
1289 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1293 os << "# LyX " << lyx_version
1294 << " generated this file. If you want to make your own\n"
1295 << "# modifications you should do them from inside LyX and save.\n\n"
1296 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1298 // Why the switch you might ask. It is a trick to ensure that all
1299 // the elements in the LyXRCTags enum are handled. As you can see
1300 // there are no breaks at all. So it is just a huge fall-through.
1301 // The nice thing is that we will get a warning from the compiler
1302 // if we forget an element.
1306 // input/include files are not done here
1307 case RC_LYXRCFORMAT:
1309 if (ignore_system_lyxrc ||
1310 bind_file != system_lyxrc.bind_file) {
1311 string const path = os::external_path(bind_file);
1312 os << "\\bind_file \"" << path << "\"\n";
1318 if (ignore_system_lyxrc ||
1319 def_file != system_lyxrc.def_file) {
1320 string const path = os::external_path(def_file);
1321 os << "\\def_file \"" << path << "\"\n";
1330 << "# MISC SECTION ######################################\n"
1332 // bind files are not done here.
1334 case RC_PATH_PREFIX:
1335 if (ignore_system_lyxrc ||
1336 path_prefix != system_lyxrc.path_prefix) {
1337 os << "\\path_prefix \"" << path_prefix << "\"\n";
1342 if (ignore_system_lyxrc ||
1343 ui_file != system_lyxrc.ui_file) {
1344 string const path = os::external_path(ui_file);
1345 os << "\\ui_file \"" << path << "\"\n";
1349 case RC_AUTOREGIONDELETE:
1350 if (ignore_system_lyxrc ||
1351 auto_region_delete != system_lyxrc.auto_region_delete) {
1352 os << "# Set to false to inhibit automatic replacement of\n"
1353 << "# the current selection.\n"
1354 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1359 case RC_AUTORESET_OPTIONS:
1360 if (ignore_system_lyxrc ||
1361 auto_reset_options != system_lyxrc.auto_reset_options) {
1362 os << "# Set to false to inhibit automatic reset of\n"
1363 << "# the class options to defaults on class change.\n"
1364 << "\\auto_reset_options "
1365 << convert<string>(auto_reset_options)
1371 if (ignore_system_lyxrc ||
1372 autosave != system_lyxrc.autosave) {
1373 os << "# The time interval between auto-saves in seconds.\n"
1374 << "\\autosave " << autosave << '\n';
1378 case RC_DISPLAY_GRAPHICS:
1379 if (ignore_system_lyxrc ||
1380 display_graphics != system_lyxrc.display_graphics) {
1381 os << "# Display graphics within LyX\n"
1383 << "\\display_graphics "
1384 << (display_graphics ? "true" : "false")
1389 case RC_SORT_LAYOUTS:
1390 if (ignore_system_lyxrc ||
1391 sort_layouts != system_lyxrc.sort_layouts) {
1392 os << "# Sort layouts alphabetically.\n"
1393 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1397 case RC_GROUP_LAYOUTS:
1398 if (ignore_system_lyxrc ||
1399 group_layouts != system_lyxrc.group_layouts) {
1400 os << "# Group layouts by their category.\n"
1401 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1405 case RC_VIEWDVI_PAPEROPTION:
1406 if (ignore_system_lyxrc ||
1407 view_dvi_paper_option
1408 != system_lyxrc.view_dvi_paper_option) {
1409 os << "# Options used to specify paper size to the\n"
1410 << "# view_dvi_command (e.g. -paper)\n"
1411 << "\\view_dvi_paper_option \""
1412 << view_dvi_paper_option << "\"\n";
1416 case RC_CHKTEX_COMMAND:
1417 if (ignore_system_lyxrc ||
1418 chktex_command != system_lyxrc.chktex_command) {
1419 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1423 case RC_BIBTEX_ALTERNATIVES: {
1424 CommandSet::const_iterator it = bibtex_alternatives.begin();
1425 CommandSet::const_iterator end = bibtex_alternatives.end();
1426 for ( ; it != end; ++it) {
1427 if (ignore_system_lyxrc
1428 || !system_lyxrc.bibtex_alternatives.count(*it))
1429 os << "\\bibtex_alternatives \""
1435 case RC_BIBTEX_COMMAND:
1436 if (ignore_system_lyxrc ||
1437 bibtex_command != system_lyxrc.bibtex_command) {
1438 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1442 case RC_JBIBTEX_COMMAND:
1443 if (ignore_system_lyxrc ||
1444 jbibtex_command != system_lyxrc.jbibtex_command) {
1445 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1449 case RC_INDEX_ALTERNATIVES: {
1450 CommandSet::const_iterator it = index_alternatives.begin();
1451 CommandSet::const_iterator end = index_alternatives.end();
1452 for ( ; it != end; ++it) {
1453 if (ignore_system_lyxrc
1454 || !system_lyxrc.index_alternatives.count(*it))
1455 os << "\\index_alternatives \""
1461 case RC_INDEX_COMMAND:
1462 if (ignore_system_lyxrc ||
1463 index_command != system_lyxrc.index_command) {
1464 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1468 case RC_JINDEX_COMMAND:
1469 if (ignore_system_lyxrc ||
1470 jindex_command != system_lyxrc.jindex_command) {
1471 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1475 case RC_SPLITINDEX_COMMAND:
1476 if (ignore_system_lyxrc ||
1477 splitindex_command != system_lyxrc.splitindex_command) {
1478 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1482 case RC_NOMENCL_COMMAND:
1483 if (ignore_system_lyxrc ||
1484 nomencl_command != system_lyxrc.nomencl_command) {
1485 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1489 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1490 // Don't write this setting to the preferences file,
1491 // but allow temporary changes (bug 7557).
1492 if (ignore_system_lyxrc) {
1493 os << "\\tex_expects_windows_paths "
1494 << convert<string>(windows_style_tex_paths) << '\n';
1498 case RC_TEX_ALLOWS_SPACES:
1499 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1500 os << "\\tex_allows_spaces "
1501 << convert<string>(tex_allows_spaces) << '\n';
1506 if (ignore_system_lyxrc ||
1507 use_kbmap != system_lyxrc.use_kbmap) {
1508 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1512 case RC_KBMAP_PRIMARY:
1513 if (ignore_system_lyxrc ||
1514 primary_kbmap != system_lyxrc.primary_kbmap) {
1515 string const path = os::external_path(primary_kbmap);
1516 os << "\\kbmap_primary \"" << path << "\"\n";
1520 case RC_KBMAP_SECONDARY:
1521 if (ignore_system_lyxrc ||
1522 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1523 string const path = os::external_path(secondary_kbmap);
1524 os << "\\kbmap_secondary \"" << path << "\"\n";
1529 if (ignore_system_lyxrc ||
1530 lyxpipes != system_lyxrc.lyxpipes) {
1531 string const path = os::external_path(lyxpipes);
1532 os << "\\serverpipe \"" << path << "\"\n";
1536 case RC_DATE_INSERT_FORMAT:
1537 if (ignore_system_lyxrc ||
1538 date_insert_format != system_lyxrc.date_insert_format) {
1539 os << "\\date_insert_format \"" << date_insert_format
1546 os << "\\user_name \"" << user_name << "\"\n";
1551 os << "\\user_email \"" << user_email << "\"\n";
1555 case RC_SHOW_BANNER:
1556 if (ignore_system_lyxrc ||
1557 show_banner != system_lyxrc.show_banner) {
1558 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1564 if (ignore_system_lyxrc ||
1565 preview != system_lyxrc.preview) {
1571 case PREVIEW_NO_MATH:
1578 os << "\\preview " << status << '\n';
1583 case RC_PREVIEW_HASHED_LABELS:
1584 if (ignore_system_lyxrc ||
1585 preview_hashed_labels !=
1586 system_lyxrc.preview_hashed_labels) {
1587 os << "\\preview_hashed_labels "
1588 << convert<string>(preview_hashed_labels) << '\n';
1593 case RC_PREVIEW_SCALE_FACTOR:
1594 if (ignore_system_lyxrc ||
1595 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1596 os << "\\preview_scale_factor "
1597 << preview_scale_factor << '\n';
1602 case RC_USE_CONVERTER_CACHE:
1603 if (ignore_system_lyxrc ||
1604 use_converter_cache != system_lyxrc.use_converter_cache) {
1605 os << "\\use_converter_cache "
1606 << convert<string>(use_converter_cache) << '\n';
1611 case RC_CONVERTER_CACHE_MAXAGE:
1612 if (ignore_system_lyxrc ||
1613 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1614 os << "\\converter_cache_maxage "
1615 << converter_cache_maxage << '\n';
1621 << "# SCREEN & FONTS SECTION ############################\n"
1625 if (ignore_system_lyxrc ||
1626 icon_set != system_lyxrc.icon_set) {
1627 os << "\\icon_set \"" << icon_set
1633 case RC_USE_SYSTEM_THEME_ICONS:
1634 if (ignore_system_lyxrc ||
1635 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1636 os << "\\use_system_theme_icons "
1637 << convert<string>(use_system_theme_icons)
1644 if (ignore_system_lyxrc ||
1645 dpi != system_lyxrc.dpi) {
1646 os << "\\screen_dpi " << dpi << '\n';
1650 case RC_SCREEN_ZOOM:
1651 if (ignore_system_lyxrc ||
1652 zoom != system_lyxrc.zoom) {
1653 os << "\\screen_zoom " << zoom << '\n';
1657 case RC_GEOMETRY_SESSION:
1658 if (ignore_system_lyxrc ||
1659 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1660 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1665 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1666 if (ignore_system_lyxrc ||
1667 cursor_follows_scrollbar
1668 != system_lyxrc.cursor_follows_scrollbar) {
1669 os << "\\cursor_follows_scrollbar "
1670 << convert<string>(cursor_follows_scrollbar) << '\n';
1674 case RC_CURSOR_WIDTH:
1675 if (ignore_system_lyxrc ||
1677 != system_lyxrc.cursor_width) {
1678 os << "\\cursor_width "
1679 << cursor_width << '\n';
1683 case RC_SCROLL_BELOW_DOCUMENT:
1684 if (ignore_system_lyxrc ||
1685 scroll_below_document
1686 != system_lyxrc.scroll_below_document) {
1687 os << "\\scroll_below_document "
1688 << convert<string>(scroll_below_document) << '\n';
1692 case RC_PARAGRAPH_MARKERS:
1693 if (ignore_system_lyxrc ||
1695 != system_lyxrc.paragraph_markers) {
1696 os << "\\paragraph_markers "
1697 << convert<string>(paragraph_markers) << '\n';
1701 case RC_MAC_DONTSWAP_CTRL_META:
1702 if (ignore_system_lyxrc ||
1703 mac_dontswap_ctrl_meta
1704 != system_lyxrc.mac_dontswap_ctrl_meta) {
1705 os << "\\mac_dontswap_ctrl_meta "
1706 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1710 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1711 if (ignore_system_lyxrc ||
1712 mac_like_cursor_movement
1713 != system_lyxrc.mac_like_cursor_movement) {
1714 os << "\\mac_like_cursor_movement "
1715 << convert<string>(mac_like_cursor_movement) << '\n';
1719 case RC_MACRO_EDIT_STYLE:
1720 if (ignore_system_lyxrc ||
1722 != system_lyxrc.macro_edit_style) {
1723 os << "\\macro_edit_style ";
1724 switch (macro_edit_style) {
1725 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1726 case MACRO_EDIT_INLINE: os << "1\n"; break;
1727 case MACRO_EDIT_LIST: os << "2\n"; break;
1732 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1733 if (ignore_system_lyxrc ||
1734 dialogs_iconify_with_main
1735 != system_lyxrc.dialogs_iconify_with_main) {
1736 os << "\\dialogs_iconify_with_main "
1737 << convert<string>(dialogs_iconify_with_main) << '\n';
1741 case RC_SCREEN_FONT_ROMAN:
1742 if (ignore_system_lyxrc ||
1743 roman_font_name != system_lyxrc.roman_font_name) {
1744 os << "\\screen_font_roman \"" << roman_font_name
1749 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1750 if (ignore_system_lyxrc ||
1751 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1752 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1757 case RC_SCREEN_FONT_SANS:
1758 if (ignore_system_lyxrc ||
1759 sans_font_name != system_lyxrc.sans_font_name) {
1760 os << "\\screen_font_sans \"" << sans_font_name
1765 case RC_SCREEN_FONT_SANS_FOUNDRY:
1766 if (ignore_system_lyxrc ||
1767 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1768 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1773 case RC_SCREEN_FONT_TYPEWRITER:
1774 if (ignore_system_lyxrc ||
1775 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1776 os << "\\screen_font_typewriter \""
1777 << typewriter_font_name << "\"\n";
1781 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1782 if (ignore_system_lyxrc ||
1783 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1784 os << "\\screen_font_typewriter_foundry \""
1785 << typewriter_font_foundry << "\"\n";
1790 case RC_SCREEN_FONT_SCALABLE:
1791 if (ignore_system_lyxrc ||
1792 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1793 os << "\\screen_font_scalable "
1794 << convert<string>(use_scalable_fonts)
1799 case RC_SCREEN_FONT_SIZES:
1800 if (ignore_system_lyxrc ||
1801 font_sizes[FONT_SIZE_TINY]
1802 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1803 font_sizes[FONT_SIZE_SCRIPT]
1804 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1805 font_sizes[FONT_SIZE_FOOTNOTE]
1806 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1807 font_sizes[FONT_SIZE_SMALL]
1808 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1809 font_sizes[FONT_SIZE_NORMAL]
1810 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1811 font_sizes[FONT_SIZE_LARGE]
1812 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1813 font_sizes[FONT_SIZE_LARGER]
1814 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1815 font_sizes[FONT_SIZE_LARGEST]
1816 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1817 font_sizes[FONT_SIZE_HUGE]
1818 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1819 font_sizes[FONT_SIZE_HUGER]
1820 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1821 streamsize old_prec = os.precision();
1822 os.setf(ios::fixed);
1824 os << "\\screen_font_sizes"
1825 << ' ' << font_sizes[FONT_SIZE_TINY]
1826 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1827 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1828 << ' ' << font_sizes[FONT_SIZE_SMALL]
1829 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1830 << ' ' << font_sizes[FONT_SIZE_LARGE]
1831 << ' ' << font_sizes[FONT_SIZE_LARGER]
1832 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1833 << ' ' << font_sizes[FONT_SIZE_HUGE]
1834 << ' ' << font_sizes[FONT_SIZE_HUGER]
1836 os.precision(old_prec);
1837 os.unsetf(ios::fixed);
1841 case RC_FULL_SCREEN_LIMIT:
1842 if (ignore_system_lyxrc ||
1843 full_screen_limit != system_lyxrc.full_screen_limit) {
1844 os << "\\fullscreen_limit "
1845 << convert<string>(full_screen_limit)
1850 case RC_FULL_SCREEN_TOOLBARS:
1851 if (ignore_system_lyxrc ||
1852 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1853 os << "\\fullscreen_toolbars "
1854 << convert<string>(full_screen_toolbars)
1859 case RC_FULL_SCREEN_SCROLLBAR:
1860 if (ignore_system_lyxrc ||
1861 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1862 os << "\\fullscreen_scrollbar "
1863 << convert<string>(full_screen_scrollbar)
1868 case RC_FULL_SCREEN_STATUSBAR:
1869 if (ignore_system_lyxrc ||
1870 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1871 os << "\\fullscreen_statusbar "
1872 << convert<string>(full_screen_statusbar)
1877 case RC_FULL_SCREEN_TABBAR:
1878 if (ignore_system_lyxrc ||
1879 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1880 os << "\\fullscreen_tabbar "
1881 << convert<string>(full_screen_tabbar)
1886 case RC_FULL_SCREEN_MENUBAR:
1887 if (ignore_system_lyxrc ||
1888 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1889 os << "\\fullscreen_menubar "
1890 << convert<string>(full_screen_menubar)
1895 case RC_FULL_SCREEN_WIDTH:
1896 if (ignore_system_lyxrc ||
1897 full_screen_width != system_lyxrc.full_screen_width) {
1898 os << "\\fullscreen_width "
1899 << convert<string>(full_screen_width)
1904 case RC_OPEN_BUFFERS_IN_TABS:
1905 if (ignore_system_lyxrc ||
1906 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1907 os << "\\open_buffers_in_tabs "
1908 << convert<string>(open_buffers_in_tabs)
1913 case RC_SINGLE_CLOSE_TAB_BUTTON:
1914 if (ignore_system_lyxrc ||
1915 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1916 os << "\\single_close_tab_button "
1917 << convert<string>(single_close_tab_button)
1922 case RC_SINGLE_INSTANCE:
1923 if (ignore_system_lyxrc ||
1924 single_instance != system_lyxrc.single_instance) {
1925 os << "\\single_instance "
1926 << convert<string>(single_instance)
1931 case RC_FORWARD_SEARCH_DVI:
1932 if (ignore_system_lyxrc ||
1933 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1934 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1938 case RC_FORWARD_SEARCH_PDF:
1939 if (ignore_system_lyxrc ||
1940 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1941 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1947 << "# COLOR SECTION ###################################\n"
1951 for (int i = 0; i < Color_ignore; ++i) {
1952 ColorCode lc = static_cast<ColorCode>(i);
1953 string const col = lcolor.getX11Name(lc);
1954 if (ignore_system_lyxrc
1955 || col != system_lcolor.getX11Name(lc)) {
1956 os << "\\set_color \""
1957 << lcolor.getLyXName(lc) << "\" \""
1965 << "# PRINTER SECTION ###################################\n"
1968 case RC_PRINTLANDSCAPEFLAG:
1969 if (ignore_system_lyxrc ||
1970 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1971 os << "\\print_landscape_flag \"" << print_landscape_flag
1977 case RC_PRINTPAPERFLAG:
1978 if (ignore_system_lyxrc ||
1979 print_paper_flag != system_lyxrc.print_paper_flag) {
1980 os << "\\print_paper_flag \"" << print_paper_flag
1986 case RC_PRINTPAPERDIMENSIONFLAG:
1987 if (ignore_system_lyxrc ||
1988 print_paper_dimension_flag
1989 != system_lyxrc.print_paper_dimension_flag) {
1990 os << "\\print_paper_dimension_flag \""
1991 << print_paper_dimension_flag << "\"\n";
1997 << "# TEX SECTION #######################################\n"
2000 case RC_TEXINPUTS_PREFIX:
2001 if (ignore_system_lyxrc ||
2002 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2003 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2008 case RC_FONT_ENCODING:
2009 if (ignore_system_lyxrc ||
2010 fontenc != system_lyxrc.fontenc) {
2011 os << "\\font_encoding \"" << fontenc << "\"\n";
2017 << "# FILE SECTION ######################################\n"
2020 case RC_DOCUMENTPATH:
2021 if (ignore_system_lyxrc ||
2022 document_path != system_lyxrc.document_path) {
2023 string const path = os::external_path(document_path);
2024 os << "\\document_path \"" << path << "\"\n";
2028 case RC_USELASTFILEPOS:
2029 if (ignore_system_lyxrc ||
2030 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2031 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2036 case RC_LOADSESSION:
2037 if (ignore_system_lyxrc ||
2038 load_session != system_lyxrc.load_session) {
2039 os << "\\load_session " << convert<string>(load_session)
2044 case RC_MOUSE_WHEEL_SPEED:
2045 if (ignore_system_lyxrc ||
2046 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2047 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2051 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2052 if (ignore_system_lyxrc ||
2053 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2054 os << "\\mouse_middlebutton_paste "
2055 << convert<string>(mouse_middlebutton_paste) << '\n';
2059 case RC_COMPLETION_INLINE_DELAY:
2060 if (ignore_system_lyxrc ||
2061 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2062 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2066 case RC_COMPLETION_INLINE_MATH:
2067 if (ignore_system_lyxrc ||
2068 completion_inline_math != system_lyxrc.completion_inline_math) {
2069 os << "\\completion_inline_math "
2070 << convert<string>(completion_inline_math) << '\n';
2074 case RC_COMPLETION_INLINE_TEXT:
2075 if (ignore_system_lyxrc ||
2076 completion_inline_text != system_lyxrc.completion_inline_text) {
2077 os << "\\completion_inline_text "
2078 << convert<string>(completion_inline_text) << '\n';
2082 case RC_COMPLETION_INLINE_DOTS:
2083 if (ignore_system_lyxrc ||
2084 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2085 os << "\\completion_inline_dots "
2086 << convert<string>(completion_inline_dots) << '\n';
2090 case RC_AUTOCORRECTION_MATH:
2091 if (ignore_system_lyxrc ||
2092 autocorrection_math != system_lyxrc.autocorrection_math) {
2093 os << "\\autocorrection_math "
2094 << convert<string>(autocorrection_math) << '\n';
2098 case RC_COMPLETION_POPUP_DELAY:
2099 if (ignore_system_lyxrc ||
2100 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2101 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2105 case RC_COMPLETION_POPUP_MATH:
2106 if (ignore_system_lyxrc ||
2107 completion_popup_math != system_lyxrc.completion_popup_math) {
2108 os << "\\completion_popup_math "
2109 << convert<string>(completion_popup_math) << '\n';
2113 case RC_COMPLETION_POPUP_TEXT:
2114 if (ignore_system_lyxrc ||
2115 completion_popup_text != system_lyxrc.completion_popup_text) {
2116 os << "\\completion_popup_text "
2117 << convert<string>(completion_popup_text) << '\n';
2121 case RC_COMPLETION_CURSOR_TEXT:
2122 if (ignore_system_lyxrc ||
2123 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2124 os << "\\completion_cursor_text "
2125 << convert<string>(completion_cursor_text) << '\n';
2129 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2130 if (ignore_system_lyxrc ||
2131 completion_popup_after_complete
2132 != system_lyxrc.completion_popup_after_complete) {
2133 os << "\\completion_popup_after_complete "
2134 << convert<string>(completion_popup_after_complete) << '\n';
2138 case RC_COMPLETION_MINLENGTH:
2139 if (ignore_system_lyxrc ||
2140 completion_minlength != system_lyxrc.completion_minlength) {
2141 os << "\\completion_minlength " << convert<string>(completion_minlength)
2147 case RC_NUMLASTFILES:
2148 if (ignore_system_lyxrc ||
2149 num_lastfiles != system_lyxrc.num_lastfiles) {
2150 os << "\\num_lastfiles " << num_lastfiles << '\n';
2154 case RC_CHECKLASTFILES:
2155 if (ignore_system_lyxrc ||
2156 check_lastfiles != system_lyxrc.check_lastfiles) {
2157 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2162 case RC_EXAMPLEPATH:
2163 if (ignore_system_lyxrc ||
2164 example_path != system_lyxrc.example_path) {
2165 string const path = os::external_path(example_path);
2166 os << "\\example_path \"" << path << "\"\n";
2170 case RC_TEMPLATEPATH:
2171 if (ignore_system_lyxrc ||
2172 template_path != system_lyxrc.template_path) {
2173 string const path = os::external_path(template_path);
2174 os << "\\template_path \"" << path << "\"\n";
2178 case RC_TEMPDIRPATH:
2179 if (ignore_system_lyxrc ||
2180 tempdir_path != system_lyxrc.tempdir_path) {
2181 string const path = os::external_path(tempdir_path);
2182 os << "\\tempdir_path \"" << path << "\"\n";
2186 case RC_THESAURUSDIRPATH:
2187 if (ignore_system_lyxrc ||
2188 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2189 string const path = os::external_path(thesaurusdir_path);
2190 os << "\\thesaurusdir_path \"" << path << "\"\n";
2194 case RC_HUNSPELLDIR_PATH:
2195 if (ignore_system_lyxrc ||
2196 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2197 string const path = os::external_path(hunspelldir_path);
2198 os << "\\hunspelldir_path \"" << path << "\"\n";
2202 case RC_PLAINTEXT_LINELEN:
2203 if (ignore_system_lyxrc ||
2204 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2205 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2209 case RC_MAKE_BACKUP:
2210 if (ignore_system_lyxrc ||
2211 make_backup != system_lyxrc.make_backup) {
2212 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2216 case RC_SAVE_COMPRESSED:
2217 if (ignore_system_lyxrc ||
2218 save_compressed != system_lyxrc.save_compressed) {
2219 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2223 case RC_SAVE_ORIGIN:
2224 if (ignore_system_lyxrc ||
2225 save_origin != system_lyxrc.save_origin) {
2226 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2230 case RC_BACKUPDIR_PATH:
2231 if (ignore_system_lyxrc ||
2232 backupdir_path != system_lyxrc.backupdir_path) {
2233 string const path = os::external_path(backupdir_path);
2234 os << "\\backupdir_path \"" << path << "\"\n";
2240 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2244 << "# SPELLCHECKER SECTION ##############################\n"
2247 case RC_ACCEPT_COMPOUND:
2248 if (ignore_system_lyxrc ||
2249 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2250 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2256 if (ignore_system_lyxrc ||
2257 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2258 os << "\\alternate_language \"" << spellchecker_alt_lang
2264 if (ignore_system_lyxrc ||
2265 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2266 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2270 case RC_USE_SYSTEM_COLORS:
2271 if (ignore_system_lyxrc ||
2272 use_system_colors != system_lyxrc.use_system_colors) {
2273 os << "\\use_system_colors "
2274 << convert<string>(use_system_colors)
2279 case RC_USE_TOOLTIP:
2280 if (ignore_system_lyxrc ||
2281 use_tooltip != system_lyxrc.use_tooltip) {
2282 os << "\\use_tooltip "
2283 << convert<string>(use_tooltip)
2288 case RC_USE_PIXMAP_CACHE:
2289 if (ignore_system_lyxrc ||
2290 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2291 os << "\\use_pixmap_cache "
2292 << convert<string>(use_pixmap_cache)
2298 if (ignore_system_lyxrc ||
2299 use_qimage != system_lyxrc.use_qimage) {
2300 os << "\\use_qimage "
2301 << convert<string>(use_qimage)
2308 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2311 case RC_DEFAULT_DECIMAL_POINT:
2312 if (ignore_system_lyxrc ||
2313 default_decimal_point != system_lyxrc.default_decimal_point) {
2314 os << "\\default_decimal_point " << default_decimal_point << '\n';
2319 case RC_DEFAULT_LENGTH_UNIT:
2320 if (ignore_system_lyxrc ||
2321 default_length_unit != system_lyxrc.default_length_unit) {
2322 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2327 case RC_SPELLCHECKER:
2328 if (ignore_system_lyxrc ||
2329 spellchecker != system_lyxrc.spellchecker) {
2330 os << "\\spellchecker " << spellchecker << '\n';
2335 case RC_SPELLCHECK_CONTINUOUSLY:
2336 if (ignore_system_lyxrc ||
2337 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2338 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2344 case RC_SPELLCHECK_NOTES:
2345 if (ignore_system_lyxrc ||
2346 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2347 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2353 case RC_VISUAL_CURSOR:
2354 if (ignore_system_lyxrc ||
2355 visual_cursor != system_lyxrc.visual_cursor) {
2356 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2360 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2361 if (ignore_system_lyxrc ||
2362 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2363 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2364 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2368 case RC_LANGUAGE_CUSTOM_PACKAGE:
2369 if (ignore_system_lyxrc ||
2370 language_custom_package != system_lyxrc.language_custom_package) {
2371 os << "\\language_custom_package \"" << language_custom_package
2376 case RC_LANGUAGE_GLOBAL_OPTIONS:
2377 if (ignore_system_lyxrc ||
2378 language_global_options
2379 != system_lyxrc.language_global_options) {
2380 os << "\\language_global_options \""
2381 << convert<string>(language_global_options)
2386 case RC_LANGUAGE_PACKAGE_SELECTION:
2387 if (ignore_system_lyxrc ||
2388 language_package_selection != system_lyxrc.language_package_selection) {
2389 os << "\\language_package_selection ";
2390 switch (language_package_selection) {
2407 case RC_LANGUAGE_COMMAND_BEGIN:
2408 if (ignore_system_lyxrc ||
2409 language_command_begin
2410 != system_lyxrc.language_command_begin) {
2411 os << "\\language_command_begin \""
2412 << language_command_begin
2417 case RC_LANGUAGE_COMMAND_END:
2418 if (ignore_system_lyxrc ||
2419 language_command_end
2420 != system_lyxrc.language_command_end) {
2421 os << "\\language_command_end \"" << language_command_end
2426 case RC_LANGUAGE_COMMAND_LOCAL:
2427 if (ignore_system_lyxrc ||
2428 language_command_local
2429 != system_lyxrc.language_command_local) {
2430 os << "\\language_command_local \""
2431 << language_command_local
2436 case RC_LANGUAGE_AUTO_BEGIN:
2437 if (ignore_system_lyxrc ||
2438 language_auto_begin != system_lyxrc.language_auto_begin) {
2439 os << "\\language_auto_begin "
2440 << convert<string>(language_auto_begin) << '\n';
2444 case RC_LANGUAGE_AUTO_END:
2445 if (ignore_system_lyxrc ||
2446 language_auto_end != system_lyxrc.language_auto_end) {
2447 os << "\\language_auto_end "
2448 << convert<string>(language_auto_end) << '\n';
2452 case RC_MARK_FOREIGN_LANGUAGE:
2453 if (ignore_system_lyxrc ||
2454 mark_foreign_language
2455 != system_lyxrc.mark_foreign_language) {
2456 os << "\\mark_foreign_language " <<
2457 convert<string>(mark_foreign_language) << '\n';
2463 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2466 case RC_AUTO_NUMBER:
2467 if (ignore_system_lyxrc ||
2468 auto_number != system_lyxrc.auto_number) {
2469 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2473 case RC_GUI_LANGUAGE:
2474 if (ignore_system_lyxrc ||
2475 gui_language != system_lyxrc.gui_language) {
2476 os << "\\gui_language " << gui_language << '\n';
2480 case RC_EXPORT_OVERWRITE:
2481 if (ignore_system_lyxrc ||
2482 export_overwrite != system_lyxrc.export_overwrite) {
2484 switch (export_overwrite) {
2495 os << "\\export_overwrite " << status << '\n';
2500 case RC_SCROLL_WHEEL_ZOOM:
2501 if (ignore_system_lyxrc ||
2502 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2504 switch (scroll_wheel_zoom) {
2505 case SCROLL_WHEEL_ZOOM_OFF:
2508 case SCROLL_WHEEL_ZOOM_CTRL:
2511 case SCROLL_WHEEL_ZOOM_SHIFT:
2514 case SCROLL_WHEEL_ZOOM_ALT:
2518 os << "\\scroll_wheel_zoom " << status << '\n';
2524 << "# FORMATS SECTION ##########################\n"
2528 // New/modified formats
2529 for (Formats::const_iterator cit = formats.begin();
2530 cit != formats.end(); ++cit) {
2531 Format const * format =
2532 system_formats.getFormat(cit->name());
2534 format->extensions() != cit->extensions() ||
2535 format->prettyname() != cit->prettyname() ||
2536 format->shortcut() != cit->shortcut() ||
2537 format->viewer() != cit->viewer() ||
2538 format->editor() != cit->editor() ||
2539 format->documentFormat() != cit->documentFormat() ||
2540 format->vectorFormat() != cit->vectorFormat() ||
2541 format->inExportMenu() != cit->inExportMenu() ||
2542 format->mime() != cit->mime()) {
2543 os << "\\format \"" << cit->name() << "\" \""
2544 << cit->extensions() << "\" \""
2545 << cit->prettyname() << "\" \""
2546 << cit->shortcut() << "\" \""
2547 << escapeCommand(cit->viewer()) << "\" \""
2548 << escapeCommand(cit->editor()) << "\" \"";
2549 vector<string> flags;
2550 if (cit->documentFormat())
2551 flags.push_back("document");
2552 if (cit->vectorFormat())
2553 flags.push_back("vector");
2554 if (cit->zippedNative())
2555 flags.push_back("zipped=native");
2556 if (cit->inExportMenu())
2557 flags.push_back("menu=export");
2559 os << getStringFromVector(flags);
2560 os << "\" \"" << cit->mime() << "\"\n";
2564 // Look for deleted formats
2565 for (Formats::const_iterator cit = system_formats.begin();
2566 cit != system_formats.end(); ++cit)
2567 if (!formats.getFormat(cit->name()))
2568 os << "\\format \"" << cit->name()
2569 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2572 case RC_VIEWER_ALTERNATIVES: {
2573 Alternatives::const_iterator it = viewer_alternatives.begin();
2574 Alternatives::const_iterator const en = viewer_alternatives.end();
2575 Alternatives::const_iterator const sysend =
2576 system_lyxrc.viewer_alternatives.end();
2577 for (; it != en; ++it) {
2578 string const & fmt = it->first;
2579 CommandSet const & cmd = it->second;
2580 CommandSet::const_iterator sit = cmd.begin();
2581 CommandSet::const_iterator const sen = cmd.end();
2582 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2583 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2584 system_lyxrc.viewer_alternatives.find(fmt);
2585 for (; sit != sen; ++sit) {
2586 string const & cmd = *sit;
2587 if (ignore_system_lyxrc
2588 || sysfmt == sysend // format not found
2589 || sysfmt->second.count(cmd) == 0 // this command not found
2591 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2597 case RC_EDITOR_ALTERNATIVES: {
2598 Alternatives::const_iterator it = editor_alternatives.begin();
2599 Alternatives::const_iterator const en = editor_alternatives.end();
2600 Alternatives::const_iterator const sysend =
2601 system_lyxrc.editor_alternatives.end();
2602 for (; it != en; ++it) {
2603 string const & fmt = it->first;
2604 CommandSet const & cmd = it->second;
2605 CommandSet::const_iterator sit = cmd.begin();
2606 CommandSet::const_iterator const sen = cmd.end();
2607 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2608 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2609 system_lyxrc.editor_alternatives.find(fmt);
2610 for (; sit != sen; ++sit) {
2611 string const & cmd = *sit;
2612 if (ignore_system_lyxrc
2613 || sysfmt == sysend // format not found
2614 || sysfmt->second.count(cmd) == 0 // this command not found
2616 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2622 case RC_DEFAULT_OTF_VIEW_FORMAT:
2623 if ((ignore_system_lyxrc ||
2624 default_otf_view_format != system_lyxrc.default_otf_view_format)
2625 && !default_otf_view_format.empty()) {
2626 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2630 case RC_DEFAULT_VIEW_FORMAT:
2631 if (ignore_system_lyxrc ||
2632 default_view_format != system_lyxrc.default_view_format) {
2633 os << "\\default_view_format " << default_view_format << '\n';
2643 << "# CONVERTERS SECTION ##########################\n"
2647 // Look for new converters
2648 for (Converters::const_iterator cit = theConverters().begin();
2649 cit != theConverters().end(); ++cit) {
2650 Converter const * converter =
2651 theSystemConverters().getConverter(cit->from(),
2654 converter->command() != cit->command() ||
2655 converter->flags() != cit->flags())
2656 os << "\\converter \"" << cit->from() << "\" \""
2657 << cit->to() << "\" \""
2658 << escapeCommand(cit->command()) << "\" \""
2659 << cit->flags() << "\"\n";
2662 // New/modifed converters
2663 for (Converters::const_iterator cit = theSystemConverters().begin();
2664 cit != theSystemConverters().end(); ++cit)
2665 if (!theConverters().getConverter(cit->from(), cit->to()))
2666 os << "\\converter \"" << cit->from()
2667 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2674 << "# COPIERS SECTION ##########################\n"
2677 // Look for new movers
2678 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2679 Movers::const_iterator const sysend = theSystemMovers().end();
2680 Movers::const_iterator it = theMovers().begin();
2681 Movers::const_iterator end = theMovers().end();
2683 for (; it != end; ++it) {
2684 Movers::const_iterator const sysit =
2685 find_if(sysbegin, sysend, SameMover(*it));
2686 if (sysit == sysend) {
2687 string const & fmt = it->first;
2688 string const & command =
2689 it->second.command();
2691 os << "\\copier " << fmt
2692 << " \"" << escapeCommand(command) << "\"\n";
2698 // We don't actually delete SpecialisedMover(s) from the
2699 // map, just clear their 'command', so there's no need
2700 // to test for anything else.
2707 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2709 // Why the switch you might ask. It is a trick to ensure that all
2710 // the elements in the LyXRCTags enum is handled. As you can see
2711 // there are no breaks at all. So it is just a huge fall-through.
2712 // The nice thing is that we will get a warning from the compiler
2713 // if we forget an element.
2714 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2716 case LyXRC::RC_LAST:
2717 case LyXRC::RC_ACCEPT_COMPOUND:
2718 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2719 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2721 case LyXRC::RC_ALT_LANG:
2722 case LyXRC::RC_PLAINTEXT_LINELEN:
2723 case LyXRC::RC_AUTOCORRECTION_MATH:
2724 case LyXRC::RC_AUTOREGIONDELETE:
2725 case LyXRC::RC_AUTORESET_OPTIONS:
2726 case LyXRC::RC_AUTOSAVE:
2727 case LyXRC::RC_AUTO_NUMBER:
2728 case LyXRC::RC_BACKUPDIR_PATH:
2729 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2730 case LyXRC::RC_BIBTEX_COMMAND:
2731 case LyXRC::RC_BINDFILE:
2732 case LyXRC::RC_CHECKLASTFILES:
2733 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2734 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2735 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2736 case LyXRC::RC_COMPLETION_INLINE_MATH:
2737 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2738 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2739 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2740 case LyXRC::RC_COMPLETION_POPUP_MATH:
2741 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2742 case LyXRC::RC_COMPLETION_MINLENGTH:
2743 case LyXRC::RC_USELASTFILEPOS:
2744 case LyXRC::RC_LOADSESSION:
2745 case LyXRC::RC_CHKTEX_COMMAND:
2746 case LyXRC::RC_CONVERTER:
2747 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2748 case LyXRC::RC_COPIER:
2749 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2750 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2751 case LyXRC::RC_DATE_INSERT_FORMAT:
2752 case LyXRC::RC_GUI_LANGUAGE:
2753 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2754 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2755 case LyXRC::RC_DEFFILE:
2756 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2757 case LyXRC::RC_DISPLAY_GRAPHICS:
2758 case LyXRC::RC_DOCUMENTPATH:
2759 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2760 FileName path(lyxrc_new.document_path);
2761 if (path.exists() && path.isDirectory())
2762 package().document_dir() = FileName(lyxrc.document_path);
2765 case LyXRC::RC_EDITOR_ALTERNATIVES:
2766 case LyXRC::RC_ESC_CHARS:
2767 case LyXRC::RC_EXAMPLEPATH:
2768 case LyXRC::RC_FONT_ENCODING:
2769 case LyXRC::RC_FILEFORMAT:
2770 case LyXRC::RC_GROUP_LAYOUTS:
2771 case LyXRC::RC_HUNSPELLDIR_PATH:
2772 case LyXRC::RC_ICON_SET:
2773 case LyXRC::RC_INDEX_ALTERNATIVES:
2774 case LyXRC::RC_INDEX_COMMAND:
2775 case LyXRC::RC_JBIBTEX_COMMAND:
2776 case LyXRC::RC_JINDEX_COMMAND:
2777 case LyXRC::RC_NOMENCL_COMMAND:
2778 case LyXRC::RC_INPUT:
2779 case LyXRC::RC_KBMAP:
2780 case LyXRC::RC_KBMAP_PRIMARY:
2781 case LyXRC::RC_KBMAP_SECONDARY:
2782 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2783 case LyXRC::RC_LANGUAGE_AUTO_END:
2784 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2785 case LyXRC::RC_LANGUAGE_COMMAND_END:
2786 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2787 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2788 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2789 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2790 case LyXRC::RC_LYXRCFORMAT:
2791 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2792 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2793 case LyXRC::RC_MACRO_EDIT_STYLE:
2794 case LyXRC::RC_MAKE_BACKUP:
2795 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2796 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2797 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2798 case LyXRC::RC_NUMLASTFILES:
2799 case LyXRC::RC_PARAGRAPH_MARKERS:
2800 case LyXRC::RC_PATH_PREFIX:
2801 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2802 prependEnvPath("PATH", lyxrc_new.path_prefix);
2803 // Resets python path
2804 support::os::python(true);
2807 case LyXRC::RC_PREVIEW:
2808 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2809 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2810 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2811 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2812 case LyXRC::RC_PRINTPAPERFLAG:
2813 case LyXRC::RC_SAVE_COMPRESSED:
2814 case LyXRC::RC_SAVE_ORIGIN:
2815 case LyXRC::RC_SCREEN_DPI:
2816 case LyXRC::RC_SCREEN_FONT_ROMAN:
2817 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2818 case LyXRC::RC_SCREEN_FONT_SANS:
2819 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2820 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2821 case LyXRC::RC_SCREEN_FONT_SIZES:
2822 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2823 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2824 case LyXRC::RC_GEOMETRY_SESSION:
2825 case LyXRC::RC_SCREEN_ZOOM:
2826 case LyXRC::RC_SERVERPIPE:
2827 case LyXRC::RC_SET_COLOR:
2828 case LyXRC::RC_SHOW_BANNER:
2829 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2830 case LyXRC::RC_SPELLCHECKER:
2831 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2834 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2835 case LyXRC::RC_SPELLCHECK_NOTES:
2836 case LyXRC::RC_SPLITINDEX_COMMAND:
2837 case LyXRC::RC_TEMPDIRPATH:
2838 case LyXRC::RC_TEMPLATEPATH:
2839 case LyXRC::RC_TEX_ALLOWS_SPACES:
2840 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2841 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2842 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2845 case LyXRC::RC_TEXINPUTS_PREFIX:
2846 case LyXRC::RC_THESAURUSDIRPATH:
2847 case LyXRC::RC_UIFILE:
2848 case LyXRC::RC_USER_EMAIL:
2849 case LyXRC::RC_USER_NAME:
2850 case LyXRC::RC_USE_CONVERTER_CACHE:
2851 case LyXRC::RC_USE_SYSTEM_COLORS:
2852 case LyXRC::RC_USE_TOOLTIP:
2853 case LyXRC::RC_USE_PIXMAP_CACHE:
2854 case LyXRC::RC_USE_QIMAGE:
2855 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2856 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2857 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2858 case LyXRC::RC_SINGLE_INSTANCE:
2859 case LyXRC::RC_SORT_LAYOUTS:
2860 case LyXRC::RC_FULL_SCREEN_LIMIT:
2861 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2862 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2863 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2864 case LyXRC::RC_FULL_SCREEN_TABBAR:
2865 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2866 case LyXRC::RC_FULL_SCREEN_WIDTH:
2867 case LyXRC::RC_VISUAL_CURSOR:
2868 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2869 case LyXRC::RC_VIEWER:
2870 case LyXRC::RC_VIEWER_ALTERNATIVES:
2871 case LyXRC::RC_FORWARD_SEARCH_DVI:
2872 case LyXRC::RC_FORWARD_SEARCH_PDF:
2873 case LyXRC::RC_EXPORT_OVERWRITE:
2874 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2875 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2876 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2877 case LyXRC::RC_CURSOR_WIDTH:
2884 string const LyXRC::getDescription(LyXRCTags tag)
2889 case RC_ACCEPT_COMPOUND:
2890 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2894 str = _("Specify an alternate language. The default is to use the language of the document.");
2897 case RC_PLAINTEXT_LINELEN:
2898 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.");
2901 case RC_AUTOREGIONDELETE:
2902 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2905 case RC_AUTORESET_OPTIONS:
2906 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2910 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2913 case RC_AUTO_NUMBER:
2916 case RC_BACKUPDIR_PATH:
2917 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.");
2920 case RC_BIBTEX_COMMAND:
2921 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2924 case RC_JBIBTEX_COMMAND:
2925 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2929 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2932 case RC_CHECKLASTFILES:
2933 str = _("Select to check whether the lastfiles still exist.");
2936 case RC_CHKTEX_COMMAND:
2937 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2946 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2947 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.");
2950 case RC_CURSOR_WIDTH:
2951 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
2954 case RC_SCROLL_BELOW_DOCUMENT:
2955 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");
2958 case RC_MAC_DONTSWAP_CTRL_META:
2959 str = _("Make Apple key act as Meta and Control key as Ctrl.");
2962 case RC_MAC_LIKE_CURSOR_MOVEMENT:
2963 str = _("Use the Mac OS X conventions for cursor movement");
2966 case RC_SHOW_MACRO_LABEL:
2967 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2970 case RC_DATE_INSERT_FORMAT:
2971 //xgettext:no-c-format
2972 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2976 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2979 case RC_DEFAULT_OTF_VIEW_FORMAT:
2980 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
2983 case RC_DEFAULT_VIEW_FORMAT:
2984 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2987 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2988 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2991 case RC_DISPLAY_GRAPHICS:
2992 str = _("Select how LyX will display any graphics.");
2995 case RC_DOCUMENTPATH:
2996 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3000 str = _("Specify additional chars that can be part of a word.");
3003 case RC_EXAMPLEPATH:
3004 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3007 case RC_FONT_ENCODING:
3008 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3014 case RC_INDEX_COMMAND:
3015 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\".");
3018 case RC_JINDEX_COMMAND:
3019 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3022 case RC_NOMENCL_COMMAND:
3023 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3030 case RC_KBMAP_PRIMARY:
3031 case RC_KBMAP_SECONDARY:
3032 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.");
3035 case RC_LANGUAGE_AUTO_BEGIN:
3036 str = _("Select if a language switching command is needed at the beginning of the document.");
3039 case RC_LANGUAGE_AUTO_END:
3040 str = _("Select if a language switching command is needed at the end of the document.");
3043 case RC_LANGUAGE_COMMAND_BEGIN:
3044 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.");
3047 case RC_LANGUAGE_COMMAND_END:
3048 str = _("The LaTeX command for changing back to the language of the document.");
3051 case RC_LANGUAGE_COMMAND_LOCAL:
3052 str = _("The LaTeX command for local changing of the language.");
3055 case RC_LANGUAGE_GLOBAL_OPTIONS:
3056 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3059 case RC_LANGUAGE_CUSTOM_PACKAGE:
3060 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3063 case RC_LANGUAGE_PACKAGE_SELECTION:
3064 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3067 case RC_USELASTFILEPOS:
3068 str = _("De-select if you do not want LyX to scroll to saved position.");
3071 case RC_LOADSESSION:
3072 str = _("De-select to prevent loading files opened from the last LyX session.");
3075 case RC_MAKE_BACKUP:
3076 str = _("De-select if you don't want LyX to create backup files.");
3079 case RC_MARK_FOREIGN_LANGUAGE:
3080 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3083 case RC_MOUSE_WHEEL_SPEED:
3084 str = _("The scrolling speed of the mouse wheel.");
3087 case RC_COMPLETION_POPUP_DELAY:
3088 str = _("The completion popup delay.");
3091 case RC_COMPLETION_POPUP_MATH:
3092 str = _("Select to display the completion popup in math mode.");
3095 case RC_COMPLETION_POPUP_TEXT:
3096 str = _("Select to display the completion popup in text mode.");
3099 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3100 str = _("Show the completion popup without delay after non-unique completion attempt.");
3103 case RC_COMPLETION_POPUP_TEXT:
3104 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3107 case RC_COMPLETION_POPUP_DELAY:
3108 str = _("The inline completion delay.");
3111 case RC_COMPLETION_INLINE_MATH:
3112 str = _("Select to display the inline completion in math mode.");
3115 case RC_COMPLETION_INLINE_TEXT:
3116 str = _("Select to display the inline completion in text mode.");
3119 case RC_COMPLETION_INLINE_DOTS:
3120 str = _("Use \"...\" to shorten long completions.");
3123 case RC_AUTOCORRECTION_MATH:
3124 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3127 case RC_NUMLASTFILES:
3128 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3132 case RC_PATH_PREFIX:
3133 str = _("Specify those directories which should be "
3134 "prepended to the PATH environment variable.\n"
3135 "Use the OS native format.");
3139 str = _("Shows a typeset preview of things such as math");
3142 case RC_PREVIEW_HASHED_LABELS:
3143 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3146 case RC_PREVIEW_SCALE_FACTOR:
3147 str = _("Scale the preview size to suit.");
3150 case RC_PRINTLANDSCAPEFLAG:
3151 str = _("The option to print out in landscape.");
3154 case RC_PRINTPAPERDIMENSIONFLAG:
3155 str = _("Option to specify the dimensions of the print paper.");
3158 case RC_PRINTPAPERFLAG:
3159 str = _("The option to specify paper type.");
3162 case RC_VISUAL_CURSOR:
3163 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3166 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3167 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).");
3171 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3174 case RC_SCREEN_FONT_ROMAN:
3175 case RC_SCREEN_FONT_SANS:
3176 case RC_SCREEN_FONT_TYPEWRITER:
3177 str = _("The screen fonts used to display the text while editing.");
3180 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3181 case RC_SCREEN_FONT_SANS_FOUNDRY:
3182 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3185 case RC_SCREEN_FONT_SCALABLE:
3186 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.");
3189 case RC_SCREEN_FONT_SIZES:
3190 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3193 case RC_SCREEN_ZOOM:
3194 //xgettext:no-c-format
3195 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3198 case RC_GEOMETRY_SESSION:
3199 str = _("Allow session manager to save and restore windows geometry.");
3203 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3209 case RC_SHOW_BANNER:
3210 str = _("De-select if you don't want the startup banner.");
3213 case RC_TEMPDIRPATH:
3214 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3217 case RC_THESAURUSDIRPATH:
3218 str = _("This is the place where the files of the thesaurus library reside.");
3221 case RC_TEMPLATEPATH:
3222 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3225 case RC_TEX_ALLOWS_SPACES:
3228 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3231 case RC_TEXINPUTS_PREFIX:
3232 str = _("Specify those directories which should be "
3233 "prepended to the TEXINPUTS environment variable.\n"
3234 "A '.' represents the current document directory. "
3235 "Use the OS native format.");
3239 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3248 case RC_USE_USE_SYSTEM_COLORS:
3249 str = _("Enable use the system colors for some things like main window background and selection.");
3252 case RC_USE_TOOLTIP:
3253 str = _("Enable the automatic appearance of tool tips in the work area.");
3256 case RC_USE_PIXMAP_CACHE:
3257 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3260 case RC_VIEWDVI_PAPEROPTION:
3261 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3276 // The global instance
3279 // The global copy of the system lyxrc entries (everything except preferences)