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 = 22; // ef: pygmentize_command
64 // when adding something to this array keep it sorted!
65 LexerKeyword lyxrcTags[] = {
66 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
67 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
68 { "\\alternate_language", LyXRC::RC_ALT_LANG },
69 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
70 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
71 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
72 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
73 { "\\autosave", LyXRC::RC_AUTOSAVE },
74 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
75 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
76 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
77 { "\\bind_file", LyXRC::RC_BINDFILE },
78 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
79 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
80 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
81 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
82 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
83 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
84 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
85 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
86 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
87 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
88 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
89 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
90 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
91 { "\\converter", LyXRC::RC_CONVERTER },
92 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
93 { "\\copier", LyXRC::RC_COPIER },
94 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
95 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
96 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
97 { "\\def_file", LyXRC::RC_DEFFILE },
98 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
99 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
100 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
101 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
102 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
103 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
104 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
105 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
106 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
107 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
108 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
109 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
110 { "\\format", LyXRC::RC_FILEFORMAT },
111 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
112 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
113 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
114 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
115 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
116 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
117 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
118 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
119 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
120 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
121 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
122 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
123 { "\\icon_set", LyXRC::RC_ICON_SET },
124 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
125 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
126 { "\\input", LyXRC::RC_INPUT },
127 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
128 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
129 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
130 { "\\kbmap", LyXRC::RC_KBMAP },
131 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
132 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
133 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
134 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
135 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
136 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
137 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
138 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
139 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
140 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
141 { "\\load_session", LyXRC::RC_LOADSESSION },
142 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
143 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
144 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
145 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
146 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
147 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
148 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
149 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
150 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
151 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
152 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
153 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
154 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
155 { "\\preview", LyXRC::RC_PREVIEW },
156 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
157 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
160 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
161 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
162 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
163 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
164 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
165 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
166 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
167 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
168 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
169 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
170 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
171 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
172 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
173 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
174 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
175 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
176 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
177 { "\\set_color", LyXRC::RC_SET_COLOR },
178 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
179 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
180 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
181 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
182 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
183 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
184 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
185 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
186 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
187 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
188 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
189 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
190 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
191 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
192 { "\\ui_file", LyXRC::RC_UIFILE },
193 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
194 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
195 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
196 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
197 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
198 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
201 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
202 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
203 { "\\user_email", LyXRC::RC_USER_EMAIL },
204 { "\\user_name", LyXRC::RC_USER_NAME },
205 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
206 // compatibility with versions older than 1.4.0 only
207 { "\\viewer", LyXRC::RC_VIEWER},
208 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
209 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
210 { "format", LyXRC::RC_LYXRCFORMAT }
213 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
224 void LyXRC::setDefaults()
227 use_system_theme_icons = false;
229 def_file = "default";
231 // The current document directory
232 texinputs_prefix = ".";
233 print_landscape_flag = "-t landscape";
234 print_paper_flag = "-t";
235 print_paper_dimension_flag = "-T";
236 document_path.erase();
237 view_dvi_paper_option.erase();
238 default_view_format = "pdf2";
239 default_otf_view_format = "pdf4";
240 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
241 bibtex_command = "automatic";
243 index_command = "makeindex -c -q";
244 nomencl_command = "makeindex -s nomencl.ist";
245 pygmentize_command = string();
247 // Because a screen is typically wider than a piece of paper:
250 allow_geometry_session = true;
251 // Default LaTeX font size:
252 font_sizes[FONT_SIZE_TINY] = "5.0";
253 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
254 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
255 font_sizes[FONT_SIZE_SMALL] = "9.0";
256 font_sizes[FONT_SIZE_NORMAL] = "10.0";
257 font_sizes[FONT_SIZE_LARGE] = "12.0";
258 font_sizes[FONT_SIZE_LARGER] = "14.4";
259 font_sizes[FONT_SIZE_LARGEST] = "17.26";
260 font_sizes[FONT_SIZE_HUGE] = "20.74";
261 font_sizes[FONT_SIZE_HUGER] = "24.88";
262 use_scalable_fonts = true;
263 roman_font_name = "";
265 typewriter_font_name = "";
267 auto_region_delete = true;
268 auto_reset_options = false;
269 plaintext_linelen = 65;
270 mouse_wheel_speed = 1.0;
272 check_lastfiles = true;
273 use_lastfilepos = true;
274 load_session = false;
276 save_compressed = false;
278 backupdir_path.erase();
279 display_graphics = true;
280 // Spellchecker settings:
281 // FIXME: this check should test the target platform (darwin)
282 #if defined(USE_MACOSX_PACKAGING)
283 spellchecker = "native";
284 #elif defined(USE_ASPELL)
285 spellchecker = "aspell";
286 #elif defined(USE_HUNSPELL)
287 spellchecker = "hunspell";
289 spellchecker = "aspell";
291 spellchecker_accept_compound = false;
292 spellcheck_continuously = false;
293 completion_minlength = 6;
294 spellcheck_notes = true;
296 visual_cursor = false;
298 mark_foreign_language = true;
299 language_auto_begin = true;
300 language_auto_end = true;
301 language_global_options = true;
302 language_package_selection = LP_AUTO;
303 language_custom_package = "\\usepackage{babel}";
304 language_command_begin = "\\selectlanguage{$$lang}";
305 language_command_local = "\\foreignlanguage{$$lang}{";
306 sort_layouts = false;
307 group_layouts = true;
308 gui_language = "auto";
310 windows_style_tex_paths = false;
311 tex_allows_spaces = false;
312 date_insert_format = "%x";
313 cursor_follows_scrollbar = false;
314 scroll_below_document = false;
315 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
316 paragraph_markers = false;
317 mac_dontswap_ctrl_meta = false;
318 mac_like_cursor_movement = false;
319 macro_edit_style = MACRO_EDIT_INLINE_BOX;
320 dialogs_iconify_with_main = false;
321 preview = PREVIEW_OFF;
322 preview_hashed_labels = false;
323 preview_scale_factor = 1.0;
324 use_converter_cache = true;
325 use_converter_needauth_forbidden = true;
326 use_converter_needauth = true;
327 use_system_colors = false;
329 use_pixmap_cache = false;
331 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
332 user_name = to_utf8(support::user_name());
333 user_email = to_utf8(support::user_email());
334 open_buffers_in_tabs = true;
335 single_close_tab_button = false;
336 single_instance = true;
337 forward_search_dvi = string();
338 forward_search_pdf = string();
339 export_overwrite = NO_FILES;
341 // Fullscreen settings
342 full_screen_limit = false;
343 full_screen_toolbars = true;
344 full_screen_tabbar = true;
345 full_screen_menubar = true;
346 full_screen_statusbar = true;
347 full_screen_scrollbar = true;
348 full_screen_width = 700;
350 completion_cursor_text = true;
351 completion_popup_math = true;
352 completion_popup_text = false;
353 completion_popup_delay = 2.0;
354 completion_popup_after_complete = true;
355 autocorrection_math = false;
356 completion_inline_math = true;
357 completion_inline_text = false;
358 completion_inline_dots = -1;
359 completion_inline_delay = 0.2;
360 default_decimal_point = ".";
361 default_length_unit = Length::CM;
363 close_buffer_with_last_view = "yes";
364 mouse_middlebutton_paste = true;
370 void oldFontFormat(string & family, string & foundry)
372 if (family.empty() || family[0] != '-')
374 foundry = token(family, '-', 1);
375 family = token(family, '-', 2);
383 bool LyXRC::read(FileName const & filename, bool check_format)
385 Lexer lexrc(lyxrcTags);
386 lexrc.setFile(filename);
387 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
388 ReturnValues retval = read(lexrc, check_format);
389 if (!check_format || retval != FormatMismatch)
390 return retval == ReadOK;
392 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
393 TempFile tmp("convert_lyxrc");
394 FileName const tempfile = tmp.name();
395 bool const success = prefs2prefs(filename, tempfile, false);
397 LYXERR0 ("Unable to convert " << filename.absFileName() <<
398 " to format " << LYXRC_FILEFORMAT);
401 // Keep this in the else branch, such that lexrc2 goes out
402 // of scope and releases the lock on tempfile before we
403 // attempt to remove it. This matters on Windows.
404 Lexer lexrc2(lyxrcTags);
405 lexrc2.setFile(tempfile);
406 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
407 retval = read(lexrc2, check_format);
409 return retval == ReadOK;
413 // don't need to worry about conversion, because this is always
414 // from an internal source
415 bool LyXRC::read(istream & is)
417 Lexer lexrc(lyxrcTags);
419 LYXERR(Debug::LYXRC, "Reading istream...");
420 return read(lexrc, false) == ReadOK;
424 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
426 if (lyxerr.debugging(Debug::PARSER))
427 lexrc.printTable(lyxerr);
432 // format prior to 2.0 and introduction of format tag
433 unsigned int format = 0;
435 while (lexrc.isOK()) {
436 // By using two switches we take advantage of the compiler
437 // telling us if we have missed a LyXRCTags element in
438 // the second switch.
439 // Note that this also shows a problem with Lexer since it
440 // helps us avoid taking advantage of the strictness of the
443 int le = lexrc.lex();
445 case Lexer::LEX_UNDEF:
446 lexrc.printError("Unknown tag `$$Token'");
448 case Lexer::LEX_FEOF:
453 switch (static_cast<LyXRCTags>(le)) {
456 format = lexrc.getInteger();
458 case RC_INPUT: // Include file
461 libFileSearch(string(),
463 if (!read(tmp, check_format)) {
465 "Error reading included file: " + tmp.absFileName());
471 bind_file = os::internal_path(lexrc.getString());
476 def_file = os::internal_path(lexrc.getString());
481 ui_file = os::internal_path(lexrc.getString());
484 case RC_AUTORESET_OPTIONS:
485 lexrc >> auto_reset_options;
488 case RC_DISPLAY_GRAPHICS:
490 display_graphics = lexrc.getString() == "true";
493 case RC_TEX_EXPECTS_WINDOWS_PATHS:
494 lexrc >> windows_style_tex_paths;
497 case RC_TEX_ALLOWS_SPACES:
498 lexrc >> tex_allows_spaces;
501 case RC_TEXINPUTS_PREFIX:
502 lexrc >> texinputs_prefix;
509 case RC_KBMAP_PRIMARY:
511 string const kmap(os::internal_path(lexrc.getString()));
512 if (!libFileSearch("kbd", kmap, "kmap").empty()
514 primary_kbmap = kmap;
516 lexrc.printError("LyX: Keymap `$$Token' not found");
521 case RC_KBMAP_SECONDARY:
523 string const kmap(os::internal_path(lexrc.getString()));
524 if (!libFileSearch("kbd", kmap, "kmap").empty()
526 secondary_kbmap = kmap;
528 lexrc.printError("LyX: Keymap `$$Token' not found");
533 case RC_FONT_ENCODING:
537 case RC_PRINTLANDSCAPEFLAG:
538 lexrc >> print_landscape_flag;
541 case RC_PRINTPAPERDIMENSIONFLAG:
542 lexrc >> print_paper_dimension_flag;
545 case RC_PRINTPAPERFLAG:
546 lexrc >> print_paper_flag;
549 case RC_PYGMENTIZE_COMMAND:
550 if (lexrc.next(true)) {
551 pygmentize_command = lexrc.getString();
555 case RC_VIEWDVI_PAPEROPTION:
557 view_dvi_paper_option = lexrc.getString();
559 view_dvi_paper_option.erase();
562 case RC_CHKTEX_COMMAND:
563 if (lexrc.next(true)) {
564 chktex_command = lexrc.getString();
568 case RC_BIBTEX_ALTERNATIVES:
569 if (lexrc.next(true)) {
570 bibtex_alternatives.insert(lexrc.getString());
574 case RC_BIBTEX_COMMAND:
575 if (lexrc.next(true)) {
576 bibtex_command = lexrc.getString();
580 case RC_JBIBTEX_COMMAND:
581 if (lexrc.next(true)) {
582 jbibtex_command = lexrc.getString();
586 case RC_JBIBTEX_ALTERNATIVES:
587 if (lexrc.next(true)) {
588 jbibtex_alternatives.insert(lexrc.getString());
592 case RC_INDEX_ALTERNATIVES:
593 if (lexrc.next(true)) {
594 index_alternatives.insert(lexrc.getString());
598 case RC_INDEX_COMMAND:
599 if (lexrc.next(true)) {
600 index_command = lexrc.getString();
604 case RC_JINDEX_COMMAND:
605 if (lexrc.next(true)) {
606 jindex_command = lexrc.getString();
610 case RC_SPLITINDEX_COMMAND:
611 if (lexrc.next(true)) {
612 splitindex_command = lexrc.getString();
616 case RC_NOMENCL_COMMAND:
617 if (lexrc.next(true)) {
618 nomencl_command = lexrc.getString();
632 case RC_GEOMETRY_SESSION:
633 lexrc >> allow_geometry_session;
636 case RC_SCREEN_FONT_SIZES:
637 lexrc >> font_sizes[FONT_SIZE_TINY];
638 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
639 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
640 lexrc >> font_sizes[FONT_SIZE_SMALL];
641 lexrc >> font_sizes[FONT_SIZE_NORMAL];
642 lexrc >> font_sizes[FONT_SIZE_LARGE];
643 lexrc >> font_sizes[FONT_SIZE_LARGER];
644 lexrc >> font_sizes[FONT_SIZE_LARGEST];
645 lexrc >> font_sizes[FONT_SIZE_HUGE];
646 lexrc >> font_sizes[FONT_SIZE_HUGER];
649 case RC_SCREEN_FONT_SCALABLE:
650 lexrc >> use_scalable_fonts;
657 case RC_DOCUMENTPATH:
659 document_path = os::internal_path(lexrc.getString());
664 example_path = os::internal_path(lexrc.getString());
667 case RC_TEMPLATEPATH:
669 template_path = os::internal_path(lexrc.getString());
674 tempdir_path = os::internal_path(lexrc.getString());
677 case RC_THESAURUSDIRPATH:
679 thesaurusdir_path = os::internal_path(lexrc.getString());
682 case RC_HUNSPELLDIR_PATH:
684 hunspelldir_path = os::internal_path(lexrc.getString());
687 case RC_USELASTFILEPOS:
688 lexrc >> use_lastfilepos;
692 lexrc >> load_session;
695 case RC_MOUSE_WHEEL_SPEED:
696 lexrc >> mouse_wheel_speed;
699 case RC_COMPLETION_INLINE_DELAY:
700 lexrc >> completion_inline_delay;
703 case RC_COMPLETION_INLINE_MATH:
704 lexrc >> completion_inline_math;
707 case RC_COMPLETION_INLINE_TEXT:
708 lexrc >> completion_inline_text;
711 case RC_COMPLETION_INLINE_DOTS:
712 lexrc >> completion_inline_dots;
715 case RC_AUTOCORRECTION_MATH:
716 lexrc >> autocorrection_math;
719 case RC_COMPLETION_POPUP_DELAY:
720 lexrc >> completion_popup_delay;
723 case RC_COMPLETION_POPUP_MATH:
724 lexrc >> completion_popup_math;
727 case RC_COMPLETION_POPUP_TEXT:
728 lexrc >> completion_popup_text;
731 case RC_COMPLETION_CURSOR_TEXT:
732 lexrc >> completion_cursor_text;
735 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
736 lexrc >> completion_popup_after_complete;
739 case RC_COMPLETION_MINLENGTH:
740 lexrc >> completion_minlength;
743 case RC_NUMLASTFILES:
744 lexrc >> num_lastfiles;
747 case RC_CHECKLASTFILES:
748 lexrc >> check_lastfiles;
755 case RC_USE_SYSTEM_THEME_ICONS:
756 lexrc >> use_system_theme_icons;
759 case RC_SCREEN_FONT_ROMAN:
761 roman_font_name = lexrc.getString();
762 oldFontFormat(roman_font_name,
767 case RC_SCREEN_FONT_SANS:
769 sans_font_name = lexrc.getString();
770 oldFontFormat(sans_font_name, sans_font_foundry);
774 case RC_SCREEN_FONT_TYPEWRITER:
776 typewriter_font_name = lexrc.getString();
777 oldFontFormat(typewriter_font_name,
778 typewriter_font_foundry);
782 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
783 lexrc >> roman_font_foundry;
786 case RC_SCREEN_FONT_SANS_FOUNDRY:
787 lexrc >> sans_font_foundry;
790 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
791 lexrc >> typewriter_font_foundry;
796 lexrc.printError("Missing color tag.");
799 string lyx_name = lexrc.getString();
802 lexrc.printError("Missing color name for color: `$$Token'");
805 string x11_name = lexrc.getString();
807 ColorCode const col =
808 lcolor.getFromLyXName(lyx_name);
809 if (col == Color_none ||
810 col == Color_inherit ||
814 if (!lcolor.setColor(col, x11_name))
815 LYXERR0("Bad lyxrc set_color for " << lyx_name);
819 case RC_AUTOREGIONDELETE:
820 // Auto region delete defaults to true
821 lexrc >> auto_region_delete;
826 lyxpipes = os::internal_path(lexrc.getString());
829 case RC_CURSOR_FOLLOWS_SCROLLBAR:
830 lexrc >> cursor_follows_scrollbar;
833 case RC_CURSOR_WIDTH:
834 lexrc >> cursor_width;
837 case RC_SCROLL_BELOW_DOCUMENT:
838 lexrc >> scroll_below_document;
841 case RC_PARAGRAPH_MARKERS:
842 lexrc >> paragraph_markers;
845 case RC_MAC_DONTSWAP_CTRL_META:
846 lexrc >> mac_dontswap_ctrl_meta;
849 case RC_MAC_LIKE_CURSOR_MOVEMENT:
850 lexrc >> mac_like_cursor_movement;
853 case RC_MACRO_EDIT_STYLE:
855 switch (lexrc.getInteger()) {
856 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
857 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
858 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
863 case RC_DIALOGS_ICONIFY_WITH_MAIN:
864 lexrc >> dialogs_iconify_with_main;
867 case RC_PLAINTEXT_LINELEN:
868 lexrc >> plaintext_linelen;
870 // Spellchecker settings:
871 case RC_ACCEPT_COMPOUND:
872 lexrc >> spellchecker_accept_compound;
874 case RC_USE_SYSTEM_COLORS:
875 lexrc >> use_system_colors;
878 lexrc >> use_tooltip;
880 case RC_USE_PIXMAP_CACHE:
881 lexrc >> use_pixmap_cache;
886 case RC_SPELLCHECKER:
887 lexrc >> spellchecker;
890 lexrc >> spellchecker_alt_lang;
893 lexrc >> spellchecker_esc_chars;
895 case RC_SPELLCHECK_CONTINUOUSLY:
896 lexrc >> spellcheck_continuously;
898 case RC_SPELLCHECK_NOTES:
899 lexrc >> spellcheck_notes;
902 lexrc >> make_backup;
904 case RC_SAVE_COMPRESSED:
905 lexrc >> save_compressed;
908 lexrc >> save_origin;
910 case RC_BACKUPDIR_PATH:
912 backupdir_path = os::internal_path(lexrc.getString());
914 case RC_DEFAULT_DECIMAL_POINT:
915 lexrc >> default_decimal_point;
917 case RC_DEFAULT_LENGTH_UNIT:
919 default_length_unit = (Length::UNIT) lexrc.getInteger();
921 case RC_DATE_INSERT_FORMAT:
922 lexrc >> date_insert_format;
924 case RC_LANGUAGE_CUSTOM_PACKAGE:
925 lexrc >> language_custom_package;
927 case RC_LANGUAGE_AUTO_BEGIN:
928 lexrc >> language_auto_begin;
930 case RC_LANGUAGE_AUTO_END:
931 lexrc >> language_auto_end;
933 case RC_LANGUAGE_GLOBAL_OPTIONS:
934 lexrc >> language_global_options;
936 case RC_LANGUAGE_PACKAGE_SELECTION:
938 switch (lexrc.getInteger()) {
940 language_package_selection = LP_AUTO;
943 language_package_selection = LP_BABEL;
946 language_package_selection = LP_CUSTOM;
949 language_package_selection = LP_NONE;
954 case RC_LANGUAGE_COMMAND_BEGIN:
955 lexrc >> language_command_begin;
957 case RC_LANGUAGE_COMMAND_END:
958 lexrc >> language_command_end;
960 case RC_LANGUAGE_COMMAND_LOCAL:
961 lexrc >> language_command_local;
963 case RC_VISUAL_CURSOR:
964 lexrc >> visual_cursor;
966 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
967 lexrc >> close_buffer_with_last_view;
970 lexrc >> auto_number;
972 case RC_MARK_FOREIGN_LANGUAGE:
973 lexrc >> mark_foreign_language;
979 fmt = lexrc.getString();
980 if (lexrc.next(true))
981 command = lexrc.getString();
982 setMover(fmt, command);
987 string from, to, command, flags;
989 from = lexrc.getString();
991 to = lexrc.getString();
992 if (lexrc.next(true))
993 command = lexrc.getString();
995 flags = lexrc.getString();
997 theConverters().erase(from, to);
999 theConverters().add(from, to, command, flags);
1002 // compatibility with versions older than 1.4.0 only
1004 string format, command;
1005 lexrc >> format >> command;
1006 theFormats().setViewer(format, command);
1009 case RC_FILEFORMAT: {
1011 string format, extensions, shortcut;
1012 docstring prettyname;
1013 if (!(lexrc >> format >> extensions))
1015 if (ok && lexrc.next(true))
1016 prettyname = lexrc.getDocString();
1020 if(!(lexrc >> shortcut))
1022 string viewer, editor;
1023 if (ok && lexrc.next(true))
1024 viewer = lexrc.getString();
1027 if (ok && lexrc.next(true))
1028 editor = lexrc.getString();
1032 if (!(lexrc >> flags >> mime))
1034 int flgs = Format::none;
1035 while (!flags.empty()) {
1037 flags = split(flags, flag, ',');
1038 if (flag == "document")
1039 flgs |= Format::document;
1040 else if (flag == "vector")
1041 flgs |= Format::vector;
1042 else if (flag == "zipped=native")
1043 flgs |= Format::zipped_native;
1044 else if (flag == "menu=export")
1045 flgs |= Format::export_menu;
1047 LYXERR0("Ignoring unknown flag `"
1048 << flag << "' for format `"
1052 LYXERR0("Syntax error in format " << format);
1053 else if (prettyname.empty()) {
1054 if (theConverters().formatIsUsed(format))
1055 LYXERR0("Can't delete format " << format);
1057 theFormats().erase(format);
1059 theFormats().add(format, extensions, prettyname,
1060 shortcut, viewer, editor, mime, flgs);
1064 case RC_VIEWER_ALTERNATIVES: {
1065 string format, command;
1066 if ((lexrc >> format) && lexrc.next(true)) {
1067 command = lexrc.getString();
1068 viewer_alternatives[format].insert(command);
1072 case RC_EDITOR_ALTERNATIVES: {
1073 string format, command;
1074 if ((lexrc >> format) && lexrc.next(true)) {
1075 command = lexrc.getString();
1076 editor_alternatives[format].insert(command);
1081 case RC_DEFAULT_OTF_VIEW_FORMAT:
1082 lexrc >> default_otf_view_format;
1085 case RC_DEFAULT_VIEW_FORMAT:
1086 lexrc >> default_view_format;
1089 case RC_GUI_LANGUAGE:
1090 lexrc >> gui_language;
1093 case RC_SHOW_BANNER:
1094 lexrc >> show_banner;
1099 string const tmp = lexrc.getString();
1100 if (tmp == "true" || tmp == "on")
1101 preview = PREVIEW_ON;
1102 else if (tmp == "no_math")
1103 preview = PREVIEW_NO_MATH;
1105 preview = PREVIEW_OFF;
1106 if (tmp != "false" && tmp != "off")
1107 LYXERR0("Unrecognized preview status \""
1113 case RC_PREVIEW_HASHED_LABELS:
1114 lexrc >> preview_hashed_labels;
1117 case RC_PREVIEW_SCALE_FACTOR:
1118 lexrc >> preview_scale_factor;
1125 lexrc >> user_email;
1128 case RC_PATH_PREFIX:
1129 lexrc >> path_prefix;
1132 case RC_USE_CONVERTER_CACHE:
1133 lexrc >> use_converter_cache;
1135 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1136 lexrc >> use_converter_needauth_forbidden;
1138 case RC_USE_CONVERTER_NEEDAUTH:
1139 lexrc >> use_converter_needauth;
1141 case RC_CONVERTER_CACHE_MAXAGE:
1142 lexrc >> converter_cache_maxage;
1145 case RC_SORT_LAYOUTS:
1146 lexrc >> sort_layouts;
1148 case RC_GROUP_LAYOUTS:
1149 lexrc >> group_layouts;
1151 case RC_FULL_SCREEN_LIMIT:
1152 lexrc >> full_screen_limit;
1154 case RC_FULL_SCREEN_TOOLBARS:
1155 lexrc >> full_screen_toolbars;
1157 case RC_FULL_SCREEN_SCROLLBAR:
1158 lexrc >> full_screen_scrollbar;
1160 case RC_FULL_SCREEN_STATUSBAR:
1161 lexrc >> full_screen_statusbar;
1163 case RC_FULL_SCREEN_TABBAR:
1164 lexrc >> full_screen_tabbar;
1166 case RC_FULL_SCREEN_MENUBAR:
1167 lexrc >> full_screen_menubar;
1169 case RC_FULL_SCREEN_WIDTH:
1170 lexrc >> full_screen_width;
1172 case RC_OPEN_BUFFERS_IN_TABS:
1173 lexrc >> open_buffers_in_tabs;
1175 case RC_SINGLE_CLOSE_TAB_BUTTON:
1176 lexrc >> single_close_tab_button;
1178 case RC_SINGLE_INSTANCE:
1179 lexrc >> single_instance;
1180 if (run_mode == PREFERRED)
1181 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1183 case RC_FORWARD_SEARCH_DVI:
1184 if (lexrc.next(true))
1185 forward_search_dvi = lexrc.getString();
1187 case RC_FORWARD_SEARCH_PDF:
1188 if (lexrc.next(true))
1189 forward_search_pdf = lexrc.getString();
1191 case RC_EXPORT_OVERWRITE:
1193 string const tmp = lexrc.getString();
1194 if (tmp == "all" || tmp == "true")
1195 export_overwrite = ALL_FILES;
1196 else if (tmp == "main")
1197 export_overwrite = MAIN_FILE;
1199 export_overwrite = NO_FILES;
1200 if (tmp != "ask" && tmp != "false")
1201 LYXERR0("Unrecognized export_overwrite status \""
1206 case RC_SCROLL_WHEEL_ZOOM:
1208 string const tmp = lexrc.getString();
1210 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1211 else if (tmp == "shift")
1212 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1213 else if (tmp == "alt")
1214 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1216 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1217 if (tmp != "off" && tmp != "false")
1218 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1224 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1225 lexrc >> mouse_middlebutton_paste;
1229 break; // this is just a dummy
1232 // This is triggered the first time through the loop unless
1233 // we hit a format tag.
1234 if (check_format && format != LYXRC_FILEFORMAT)
1235 return FormatMismatch;
1238 /// Update converters data-structures
1239 theConverters().update(theFormats());
1240 theConverters().buildGraph();
1241 theBufferList().invalidateConverterCache();
1247 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1249 ofstream ofs(filename.toFilesystemEncoding().c_str());
1251 write(ofs, ignore_system_lyxrc);
1255 void LyXRC::print() const
1257 if (lyxerr.debugging())
1258 write(lyxerr, false);
1266 typedef pair<string, SpecialisedMover> Data;
1268 SameMover(Data const & comparison)
1269 : comparison_(comparison) {}
1271 bool operator()(Data const & data) const
1273 return data.first == comparison_.first &&
1274 data.second.command() == comparison_.second.command();
1284 // Escape \ and " so that LyXLex can read the string later
1285 string escapeCommand(string const & str) {
1286 return subst(subst(str , "\\", "\\\\"),
1293 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1295 LyXRCTags tag = RC_LAST;
1297 if (!name.empty()) {
1298 for (int i = 0; i != lyxrcCount; ++i)
1299 if ("\\" + name == lyxrcTags[i].tag)
1300 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1304 os << "# LyX " << lyx_version
1305 << " generated this file. If you want to make your own\n"
1306 << "# modifications you should do them from inside LyX and save.\n\n"
1307 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1309 // Why the switch you might ask. It is a trick to ensure that all
1310 // the elements in the LyXRCTags enum are handled. As you can see
1311 // there are no breaks at all. So it is just a huge fall-through.
1312 // The nice thing is that we will get a warning from the compiler
1313 // if we forget an element.
1317 // input/include files are not done here
1318 case RC_LYXRCFORMAT:
1320 if (ignore_system_lyxrc ||
1321 bind_file != system_lyxrc.bind_file) {
1322 string const path = os::external_path(bind_file);
1323 os << "\\bind_file \"" << path << "\"\n";
1329 if (ignore_system_lyxrc ||
1330 def_file != system_lyxrc.def_file) {
1331 string const path = os::external_path(def_file);
1332 os << "\\def_file \"" << path << "\"\n";
1341 << "# MISC SECTION ######################################\n"
1343 // bind files are not done here.
1345 case RC_PATH_PREFIX:
1346 if (ignore_system_lyxrc ||
1347 path_prefix != system_lyxrc.path_prefix) {
1348 os << "\\path_prefix \"" << path_prefix << "\"\n";
1353 if (ignore_system_lyxrc ||
1354 ui_file != system_lyxrc.ui_file) {
1355 string const path = os::external_path(ui_file);
1356 os << "\\ui_file \"" << path << "\"\n";
1360 case RC_AUTOREGIONDELETE:
1361 if (ignore_system_lyxrc ||
1362 auto_region_delete != system_lyxrc.auto_region_delete) {
1363 os << "# Set to false to inhibit automatic replacement of\n"
1364 << "# the current selection.\n"
1365 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1370 case RC_AUTORESET_OPTIONS:
1371 if (ignore_system_lyxrc ||
1372 auto_reset_options != system_lyxrc.auto_reset_options) {
1373 os << "# Set to false to inhibit automatic reset of\n"
1374 << "# the class options to defaults on class change.\n"
1375 << "\\auto_reset_options "
1376 << convert<string>(auto_reset_options)
1382 if (ignore_system_lyxrc ||
1383 autosave != system_lyxrc.autosave) {
1384 os << "# The time interval between auto-saves in seconds.\n"
1385 << "\\autosave " << autosave << '\n';
1389 case RC_DISPLAY_GRAPHICS:
1390 if (ignore_system_lyxrc ||
1391 display_graphics != system_lyxrc.display_graphics) {
1392 os << "# Display graphics within LyX\n"
1394 << "\\display_graphics "
1395 << (display_graphics ? "true" : "false")
1400 case RC_SORT_LAYOUTS:
1401 if (ignore_system_lyxrc ||
1402 sort_layouts != system_lyxrc.sort_layouts) {
1403 os << "# Sort layouts alphabetically.\n"
1404 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1408 case RC_GROUP_LAYOUTS:
1409 if (ignore_system_lyxrc ||
1410 group_layouts != system_lyxrc.group_layouts) {
1411 os << "# Group layouts by their category.\n"
1412 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1416 case RC_VIEWDVI_PAPEROPTION:
1417 if (ignore_system_lyxrc ||
1418 view_dvi_paper_option
1419 != system_lyxrc.view_dvi_paper_option) {
1420 os << "# Options used to specify paper size to the\n"
1421 << "# view_dvi_command (e.g. -paper)\n"
1422 << "\\view_dvi_paper_option \""
1423 << view_dvi_paper_option << "\"\n";
1427 case RC_CHKTEX_COMMAND:
1428 if (ignore_system_lyxrc ||
1429 chktex_command != system_lyxrc.chktex_command) {
1430 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1434 case RC_BIBTEX_ALTERNATIVES: {
1435 CommandSet::const_iterator it = bibtex_alternatives.begin();
1436 CommandSet::const_iterator end = bibtex_alternatives.end();
1437 for ( ; it != end; ++it) {
1438 if (ignore_system_lyxrc
1439 || !system_lyxrc.bibtex_alternatives.count(*it))
1440 os << "\\bibtex_alternatives \""
1446 case RC_BIBTEX_COMMAND:
1447 if (ignore_system_lyxrc ||
1448 bibtex_command != system_lyxrc.bibtex_command) {
1449 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1453 case RC_JBIBTEX_COMMAND:
1454 if (ignore_system_lyxrc ||
1455 jbibtex_command != system_lyxrc.jbibtex_command) {
1456 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1460 case RC_JBIBTEX_ALTERNATIVES: {
1461 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1462 CommandSet::const_iterator end = jbibtex_alternatives.end();
1463 for ( ; it != end; ++it) {
1464 if (ignore_system_lyxrc
1465 || !system_lyxrc.jbibtex_alternatives.count(*it))
1466 os << "\\jbibtex_alternatives \""
1472 case RC_INDEX_ALTERNATIVES: {
1473 CommandSet::const_iterator it = index_alternatives.begin();
1474 CommandSet::const_iterator end = index_alternatives.end();
1475 for ( ; it != end; ++it) {
1476 if (ignore_system_lyxrc
1477 || !system_lyxrc.index_alternatives.count(*it))
1478 os << "\\index_alternatives \""
1484 case RC_INDEX_COMMAND:
1485 if (ignore_system_lyxrc ||
1486 index_command != system_lyxrc.index_command) {
1487 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1491 case RC_JINDEX_COMMAND:
1492 if (ignore_system_lyxrc ||
1493 jindex_command != system_lyxrc.jindex_command) {
1494 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1498 case RC_SPLITINDEX_COMMAND:
1499 if (ignore_system_lyxrc ||
1500 splitindex_command != system_lyxrc.splitindex_command) {
1501 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1505 case RC_NOMENCL_COMMAND:
1506 if (ignore_system_lyxrc ||
1507 nomencl_command != system_lyxrc.nomencl_command) {
1508 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1512 case RC_PYGMENTIZE_COMMAND:
1513 if (ignore_system_lyxrc ||
1514 pygmentize_command != system_lyxrc.pygmentize_command) {
1515 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1519 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1520 // Don't write this setting to the preferences file,
1521 // but allow temporary changes (bug 7557).
1522 if (ignore_system_lyxrc) {
1523 os << "\\tex_expects_windows_paths "
1524 << convert<string>(windows_style_tex_paths) << '\n';
1528 case RC_TEX_ALLOWS_SPACES:
1529 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1530 os << "\\tex_allows_spaces "
1531 << convert<string>(tex_allows_spaces) << '\n';
1536 if (ignore_system_lyxrc ||
1537 use_kbmap != system_lyxrc.use_kbmap) {
1538 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1542 case RC_KBMAP_PRIMARY:
1543 if (ignore_system_lyxrc ||
1544 primary_kbmap != system_lyxrc.primary_kbmap) {
1545 string const path = os::external_path(primary_kbmap);
1546 os << "\\kbmap_primary \"" << path << "\"\n";
1550 case RC_KBMAP_SECONDARY:
1551 if (ignore_system_lyxrc ||
1552 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1553 string const path = os::external_path(secondary_kbmap);
1554 os << "\\kbmap_secondary \"" << path << "\"\n";
1559 if (ignore_system_lyxrc ||
1560 lyxpipes != system_lyxrc.lyxpipes) {
1561 string const path = os::external_path(lyxpipes);
1562 os << "\\serverpipe \"" << path << "\"\n";
1566 case RC_DATE_INSERT_FORMAT:
1567 if (ignore_system_lyxrc ||
1568 date_insert_format != system_lyxrc.date_insert_format) {
1569 os << "\\date_insert_format \"" << date_insert_format
1576 os << "\\user_name \"" << user_name << "\"\n";
1581 os << "\\user_email \"" << user_email << "\"\n";
1585 case RC_SHOW_BANNER:
1586 if (ignore_system_lyxrc ||
1587 show_banner != system_lyxrc.show_banner) {
1588 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1594 if (ignore_system_lyxrc ||
1595 preview != system_lyxrc.preview) {
1601 case PREVIEW_NO_MATH:
1608 os << "\\preview " << status << '\n';
1613 case RC_PREVIEW_HASHED_LABELS:
1614 if (ignore_system_lyxrc ||
1615 preview_hashed_labels !=
1616 system_lyxrc.preview_hashed_labels) {
1617 os << "\\preview_hashed_labels "
1618 << convert<string>(preview_hashed_labels) << '\n';
1623 case RC_PREVIEW_SCALE_FACTOR:
1624 if (ignore_system_lyxrc ||
1625 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1626 os << "\\preview_scale_factor "
1627 << preview_scale_factor << '\n';
1632 case RC_USE_CONVERTER_CACHE:
1633 if (ignore_system_lyxrc ||
1634 use_converter_cache != system_lyxrc.use_converter_cache) {
1635 os << "\\use_converter_cache "
1636 << convert<string>(use_converter_cache) << '\n';
1641 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1642 if (ignore_system_lyxrc ||
1643 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1644 os << "\\use_converter_needauth_forbidden "
1645 << convert<string>(use_converter_needauth_forbidden) << '\n';
1650 case RC_USE_CONVERTER_NEEDAUTH:
1651 if (ignore_system_lyxrc ||
1652 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1653 os << "\\use_converter_needauth "
1654 << convert<string>(use_converter_needauth) << '\n';
1659 case RC_CONVERTER_CACHE_MAXAGE:
1660 if (ignore_system_lyxrc ||
1661 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1662 os << "\\converter_cache_maxage "
1663 << converter_cache_maxage << '\n';
1669 << "# SCREEN & FONTS SECTION ############################\n"
1673 if (ignore_system_lyxrc ||
1674 icon_set != system_lyxrc.icon_set) {
1675 os << "\\icon_set \"" << icon_set
1681 case RC_USE_SYSTEM_THEME_ICONS:
1682 if (ignore_system_lyxrc ||
1683 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1684 os << "\\use_system_theme_icons "
1685 << convert<string>(use_system_theme_icons)
1692 if (ignore_system_lyxrc ||
1693 dpi != system_lyxrc.dpi) {
1694 os << "\\screen_dpi " << dpi << '\n';
1698 case RC_SCREEN_ZOOM:
1699 if (ignore_system_lyxrc ||
1700 zoom != system_lyxrc.zoom) {
1701 os << "\\screen_zoom " << zoom << '\n';
1705 case RC_GEOMETRY_SESSION:
1706 if (ignore_system_lyxrc ||
1707 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1708 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1713 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1714 if (ignore_system_lyxrc ||
1715 cursor_follows_scrollbar
1716 != system_lyxrc.cursor_follows_scrollbar) {
1717 os << "\\cursor_follows_scrollbar "
1718 << convert<string>(cursor_follows_scrollbar) << '\n';
1722 case RC_CURSOR_WIDTH:
1723 if (ignore_system_lyxrc ||
1725 != system_lyxrc.cursor_width) {
1726 os << "\\cursor_width "
1727 << cursor_width << '\n';
1731 case RC_SCROLL_BELOW_DOCUMENT:
1732 if (ignore_system_lyxrc ||
1733 scroll_below_document
1734 != system_lyxrc.scroll_below_document) {
1735 os << "\\scroll_below_document "
1736 << convert<string>(scroll_below_document) << '\n';
1740 case RC_PARAGRAPH_MARKERS:
1741 if (ignore_system_lyxrc ||
1743 != system_lyxrc.paragraph_markers) {
1744 os << "\\paragraph_markers "
1745 << convert<string>(paragraph_markers) << '\n';
1749 case RC_MAC_DONTSWAP_CTRL_META:
1750 if (ignore_system_lyxrc ||
1751 mac_dontswap_ctrl_meta
1752 != system_lyxrc.mac_dontswap_ctrl_meta) {
1753 os << "\\mac_dontswap_ctrl_meta "
1754 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1758 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1759 if (ignore_system_lyxrc ||
1760 mac_like_cursor_movement
1761 != system_lyxrc.mac_like_cursor_movement) {
1762 os << "\\mac_like_cursor_movement "
1763 << convert<string>(mac_like_cursor_movement) << '\n';
1767 case RC_MACRO_EDIT_STYLE:
1768 if (ignore_system_lyxrc ||
1770 != system_lyxrc.macro_edit_style) {
1771 os << "\\macro_edit_style ";
1772 switch (macro_edit_style) {
1773 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1774 case MACRO_EDIT_INLINE: os << "1\n"; break;
1775 case MACRO_EDIT_LIST: os << "2\n"; break;
1780 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1781 if (ignore_system_lyxrc ||
1782 dialogs_iconify_with_main
1783 != system_lyxrc.dialogs_iconify_with_main) {
1784 os << "\\dialogs_iconify_with_main "
1785 << convert<string>(dialogs_iconify_with_main) << '\n';
1789 case RC_SCREEN_FONT_ROMAN:
1790 if (ignore_system_lyxrc ||
1791 roman_font_name != system_lyxrc.roman_font_name) {
1792 os << "\\screen_font_roman \"" << roman_font_name
1797 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1798 if (ignore_system_lyxrc ||
1799 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1800 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1805 case RC_SCREEN_FONT_SANS:
1806 if (ignore_system_lyxrc ||
1807 sans_font_name != system_lyxrc.sans_font_name) {
1808 os << "\\screen_font_sans \"" << sans_font_name
1813 case RC_SCREEN_FONT_SANS_FOUNDRY:
1814 if (ignore_system_lyxrc ||
1815 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1816 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1821 case RC_SCREEN_FONT_TYPEWRITER:
1822 if (ignore_system_lyxrc ||
1823 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1824 os << "\\screen_font_typewriter \""
1825 << typewriter_font_name << "\"\n";
1829 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1830 if (ignore_system_lyxrc ||
1831 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1832 os << "\\screen_font_typewriter_foundry \""
1833 << typewriter_font_foundry << "\"\n";
1838 case RC_SCREEN_FONT_SCALABLE:
1839 if (ignore_system_lyxrc ||
1840 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1841 os << "\\screen_font_scalable "
1842 << convert<string>(use_scalable_fonts)
1847 case RC_SCREEN_FONT_SIZES:
1848 if (ignore_system_lyxrc ||
1849 font_sizes[FONT_SIZE_TINY]
1850 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1851 font_sizes[FONT_SIZE_SCRIPT]
1852 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1853 font_sizes[FONT_SIZE_FOOTNOTE]
1854 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1855 font_sizes[FONT_SIZE_SMALL]
1856 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1857 font_sizes[FONT_SIZE_NORMAL]
1858 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1859 font_sizes[FONT_SIZE_LARGE]
1860 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1861 font_sizes[FONT_SIZE_LARGER]
1862 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1863 font_sizes[FONT_SIZE_LARGEST]
1864 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1865 font_sizes[FONT_SIZE_HUGE]
1866 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1867 font_sizes[FONT_SIZE_HUGER]
1868 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1869 streamsize old_prec = os.precision();
1870 os.setf(ios::fixed);
1872 os << "\\screen_font_sizes"
1873 << ' ' << font_sizes[FONT_SIZE_TINY]
1874 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1875 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1876 << ' ' << font_sizes[FONT_SIZE_SMALL]
1877 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1878 << ' ' << font_sizes[FONT_SIZE_LARGE]
1879 << ' ' << font_sizes[FONT_SIZE_LARGER]
1880 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1881 << ' ' << font_sizes[FONT_SIZE_HUGE]
1882 << ' ' << font_sizes[FONT_SIZE_HUGER]
1884 os.precision(old_prec);
1885 os.unsetf(ios::fixed);
1889 case RC_FULL_SCREEN_LIMIT:
1890 if (ignore_system_lyxrc ||
1891 full_screen_limit != system_lyxrc.full_screen_limit) {
1892 os << "\\fullscreen_limit "
1893 << convert<string>(full_screen_limit)
1898 case RC_FULL_SCREEN_TOOLBARS:
1899 if (ignore_system_lyxrc ||
1900 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1901 os << "\\fullscreen_toolbars "
1902 << convert<string>(full_screen_toolbars)
1907 case RC_FULL_SCREEN_SCROLLBAR:
1908 if (ignore_system_lyxrc ||
1909 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1910 os << "\\fullscreen_scrollbar "
1911 << convert<string>(full_screen_scrollbar)
1916 case RC_FULL_SCREEN_STATUSBAR:
1917 if (ignore_system_lyxrc ||
1918 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1919 os << "\\fullscreen_statusbar "
1920 << convert<string>(full_screen_statusbar)
1925 case RC_FULL_SCREEN_TABBAR:
1926 if (ignore_system_lyxrc ||
1927 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1928 os << "\\fullscreen_tabbar "
1929 << convert<string>(full_screen_tabbar)
1934 case RC_FULL_SCREEN_MENUBAR:
1935 if (ignore_system_lyxrc ||
1936 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1937 os << "\\fullscreen_menubar "
1938 << convert<string>(full_screen_menubar)
1943 case RC_FULL_SCREEN_WIDTH:
1944 if (ignore_system_lyxrc ||
1945 full_screen_width != system_lyxrc.full_screen_width) {
1946 os << "\\fullscreen_width "
1947 << convert<string>(full_screen_width)
1952 case RC_OPEN_BUFFERS_IN_TABS:
1953 if (ignore_system_lyxrc ||
1954 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1955 os << "\\open_buffers_in_tabs "
1956 << convert<string>(open_buffers_in_tabs)
1961 case RC_SINGLE_CLOSE_TAB_BUTTON:
1962 if (ignore_system_lyxrc ||
1963 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1964 os << "\\single_close_tab_button "
1965 << convert<string>(single_close_tab_button)
1970 case RC_SINGLE_INSTANCE:
1971 if (ignore_system_lyxrc ||
1972 single_instance != system_lyxrc.single_instance) {
1973 os << "\\single_instance "
1974 << convert<string>(single_instance)
1979 case RC_FORWARD_SEARCH_DVI:
1980 if (ignore_system_lyxrc ||
1981 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1982 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1986 case RC_FORWARD_SEARCH_PDF:
1987 if (ignore_system_lyxrc ||
1988 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1989 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1995 << "# COLOR SECTION ###################################\n"
1999 for (int i = 0; i < Color_ignore; ++i) {
2000 ColorCode lc = static_cast<ColorCode>(i);
2001 string const col = lcolor.getX11Name(lc);
2002 if (ignore_system_lyxrc
2003 || col != system_lcolor.getX11Name(lc)) {
2004 os << "\\set_color \""
2005 << lcolor.getLyXName(lc) << "\" \""
2013 << "# PRINTER SECTION ###################################\n"
2016 case RC_PRINTLANDSCAPEFLAG:
2017 if (ignore_system_lyxrc ||
2018 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2019 os << "\\print_landscape_flag \"" << print_landscape_flag
2025 case RC_PRINTPAPERFLAG:
2026 if (ignore_system_lyxrc ||
2027 print_paper_flag != system_lyxrc.print_paper_flag) {
2028 os << "\\print_paper_flag \"" << print_paper_flag
2034 case RC_PRINTPAPERDIMENSIONFLAG:
2035 if (ignore_system_lyxrc ||
2036 print_paper_dimension_flag
2037 != system_lyxrc.print_paper_dimension_flag) {
2038 os << "\\print_paper_dimension_flag \""
2039 << print_paper_dimension_flag << "\"\n";
2045 << "# TEX SECTION #######################################\n"
2048 case RC_TEXINPUTS_PREFIX:
2049 if (ignore_system_lyxrc ||
2050 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2051 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2056 case RC_FONT_ENCODING:
2057 if (ignore_system_lyxrc ||
2058 fontenc != system_lyxrc.fontenc) {
2059 os << "\\font_encoding \"" << fontenc << "\"\n";
2065 << "# FILE SECTION ######################################\n"
2068 case RC_DOCUMENTPATH:
2069 if (ignore_system_lyxrc ||
2070 document_path != system_lyxrc.document_path) {
2071 string const path = os::external_path(document_path);
2072 os << "\\document_path \"" << path << "\"\n";
2076 case RC_USELASTFILEPOS:
2077 if (ignore_system_lyxrc ||
2078 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2079 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2084 case RC_LOADSESSION:
2085 if (ignore_system_lyxrc ||
2086 load_session != system_lyxrc.load_session) {
2087 os << "\\load_session " << convert<string>(load_session)
2092 case RC_MOUSE_WHEEL_SPEED:
2093 if (ignore_system_lyxrc ||
2094 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2095 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2099 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2100 if (ignore_system_lyxrc ||
2101 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2102 os << "\\mouse_middlebutton_paste "
2103 << convert<string>(mouse_middlebutton_paste) << '\n';
2107 case RC_COMPLETION_INLINE_DELAY:
2108 if (ignore_system_lyxrc ||
2109 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2110 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2114 case RC_COMPLETION_INLINE_MATH:
2115 if (ignore_system_lyxrc ||
2116 completion_inline_math != system_lyxrc.completion_inline_math) {
2117 os << "\\completion_inline_math "
2118 << convert<string>(completion_inline_math) << '\n';
2122 case RC_COMPLETION_INLINE_TEXT:
2123 if (ignore_system_lyxrc ||
2124 completion_inline_text != system_lyxrc.completion_inline_text) {
2125 os << "\\completion_inline_text "
2126 << convert<string>(completion_inline_text) << '\n';
2130 case RC_COMPLETION_INLINE_DOTS:
2131 if (ignore_system_lyxrc ||
2132 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2133 os << "\\completion_inline_dots "
2134 << convert<string>(completion_inline_dots) << '\n';
2138 case RC_AUTOCORRECTION_MATH:
2139 if (ignore_system_lyxrc ||
2140 autocorrection_math != system_lyxrc.autocorrection_math) {
2141 os << "\\autocorrection_math "
2142 << convert<string>(autocorrection_math) << '\n';
2146 case RC_COMPLETION_POPUP_DELAY:
2147 if (ignore_system_lyxrc ||
2148 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2149 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2153 case RC_COMPLETION_POPUP_MATH:
2154 if (ignore_system_lyxrc ||
2155 completion_popup_math != system_lyxrc.completion_popup_math) {
2156 os << "\\completion_popup_math "
2157 << convert<string>(completion_popup_math) << '\n';
2161 case RC_COMPLETION_POPUP_TEXT:
2162 if (ignore_system_lyxrc ||
2163 completion_popup_text != system_lyxrc.completion_popup_text) {
2164 os << "\\completion_popup_text "
2165 << convert<string>(completion_popup_text) << '\n';
2169 case RC_COMPLETION_CURSOR_TEXT:
2170 if (ignore_system_lyxrc ||
2171 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2172 os << "\\completion_cursor_text "
2173 << convert<string>(completion_cursor_text) << '\n';
2177 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2178 if (ignore_system_lyxrc ||
2179 completion_popup_after_complete
2180 != system_lyxrc.completion_popup_after_complete) {
2181 os << "\\completion_popup_after_complete "
2182 << convert<string>(completion_popup_after_complete) << '\n';
2186 case RC_COMPLETION_MINLENGTH:
2187 if (ignore_system_lyxrc ||
2188 completion_minlength != system_lyxrc.completion_minlength) {
2189 os << "\\completion_minlength " << convert<string>(completion_minlength)
2195 case RC_NUMLASTFILES:
2196 if (ignore_system_lyxrc ||
2197 num_lastfiles != system_lyxrc.num_lastfiles) {
2198 os << "\\num_lastfiles " << num_lastfiles << '\n';
2202 case RC_CHECKLASTFILES:
2203 if (ignore_system_lyxrc ||
2204 check_lastfiles != system_lyxrc.check_lastfiles) {
2205 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2210 case RC_EXAMPLEPATH:
2211 if (ignore_system_lyxrc ||
2212 example_path != system_lyxrc.example_path) {
2213 string const path = os::external_path(example_path);
2214 os << "\\example_path \"" << path << "\"\n";
2218 case RC_TEMPLATEPATH:
2219 if (ignore_system_lyxrc ||
2220 template_path != system_lyxrc.template_path) {
2221 string const path = os::external_path(template_path);
2222 os << "\\template_path \"" << path << "\"\n";
2226 case RC_TEMPDIRPATH:
2227 if (ignore_system_lyxrc ||
2228 tempdir_path != system_lyxrc.tempdir_path) {
2229 string const path = os::external_path(tempdir_path);
2230 os << "\\tempdir_path \"" << path << "\"\n";
2234 case RC_THESAURUSDIRPATH:
2235 if (ignore_system_lyxrc ||
2236 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2237 string const path = os::external_path(thesaurusdir_path);
2238 os << "\\thesaurusdir_path \"" << path << "\"\n";
2242 case RC_HUNSPELLDIR_PATH:
2243 if (ignore_system_lyxrc ||
2244 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2245 string const path = os::external_path(hunspelldir_path);
2246 os << "\\hunspelldir_path \"" << path << "\"\n";
2250 case RC_PLAINTEXT_LINELEN:
2251 if (ignore_system_lyxrc ||
2252 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2253 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2257 case RC_MAKE_BACKUP:
2258 if (ignore_system_lyxrc ||
2259 make_backup != system_lyxrc.make_backup) {
2260 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2264 case RC_SAVE_COMPRESSED:
2265 if (ignore_system_lyxrc ||
2266 save_compressed != system_lyxrc.save_compressed) {
2267 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2271 case RC_SAVE_ORIGIN:
2272 if (ignore_system_lyxrc ||
2273 save_origin != system_lyxrc.save_origin) {
2274 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2278 case RC_BACKUPDIR_PATH:
2279 if (ignore_system_lyxrc ||
2280 backupdir_path != system_lyxrc.backupdir_path) {
2281 string const path = os::external_path(backupdir_path);
2282 os << "\\backupdir_path \"" << path << "\"\n";
2288 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2292 << "# SPELLCHECKER SECTION ##############################\n"
2295 case RC_ACCEPT_COMPOUND:
2296 if (ignore_system_lyxrc ||
2297 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2298 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2304 if (ignore_system_lyxrc ||
2305 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2306 os << "\\alternate_language \"" << spellchecker_alt_lang
2312 if (ignore_system_lyxrc ||
2313 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2314 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2318 case RC_USE_SYSTEM_COLORS:
2319 if (ignore_system_lyxrc ||
2320 use_system_colors != system_lyxrc.use_system_colors) {
2321 os << "\\use_system_colors "
2322 << convert<string>(use_system_colors)
2327 case RC_USE_TOOLTIP:
2328 if (ignore_system_lyxrc ||
2329 use_tooltip != system_lyxrc.use_tooltip) {
2330 os << "\\use_tooltip "
2331 << convert<string>(use_tooltip)
2336 case RC_USE_PIXMAP_CACHE:
2337 if (ignore_system_lyxrc ||
2338 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2339 os << "\\use_pixmap_cache "
2340 << convert<string>(use_pixmap_cache)
2346 if (ignore_system_lyxrc ||
2347 use_qimage != system_lyxrc.use_qimage) {
2348 os << "\\use_qimage "
2349 << convert<string>(use_qimage)
2356 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2359 case RC_DEFAULT_DECIMAL_POINT:
2360 if (ignore_system_lyxrc ||
2361 default_decimal_point != system_lyxrc.default_decimal_point) {
2362 os << "\\default_decimal_point " << default_decimal_point << '\n';
2367 case RC_DEFAULT_LENGTH_UNIT:
2368 if (ignore_system_lyxrc ||
2369 default_length_unit != system_lyxrc.default_length_unit) {
2370 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2375 case RC_SPELLCHECKER:
2376 if (ignore_system_lyxrc ||
2377 spellchecker != system_lyxrc.spellchecker) {
2378 os << "\\spellchecker " << spellchecker << '\n';
2383 case RC_SPELLCHECK_CONTINUOUSLY:
2384 if (ignore_system_lyxrc ||
2385 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2386 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2392 case RC_SPELLCHECK_NOTES:
2393 if (ignore_system_lyxrc ||
2394 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2395 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2401 case RC_VISUAL_CURSOR:
2402 if (ignore_system_lyxrc ||
2403 visual_cursor != system_lyxrc.visual_cursor) {
2404 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2408 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2409 if (ignore_system_lyxrc ||
2410 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2411 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2412 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2416 case RC_LANGUAGE_CUSTOM_PACKAGE:
2417 if (ignore_system_lyxrc ||
2418 language_custom_package != system_lyxrc.language_custom_package) {
2419 os << "\\language_custom_package \"" << language_custom_package
2424 case RC_LANGUAGE_GLOBAL_OPTIONS:
2425 if (ignore_system_lyxrc ||
2426 language_global_options
2427 != system_lyxrc.language_global_options) {
2428 os << "\\language_global_options \""
2429 << convert<string>(language_global_options)
2434 case RC_LANGUAGE_PACKAGE_SELECTION:
2435 if (ignore_system_lyxrc ||
2436 language_package_selection != system_lyxrc.language_package_selection) {
2437 os << "\\language_package_selection ";
2438 switch (language_package_selection) {
2455 case RC_LANGUAGE_COMMAND_BEGIN:
2456 if (ignore_system_lyxrc ||
2457 language_command_begin
2458 != system_lyxrc.language_command_begin) {
2459 os << "\\language_command_begin \""
2460 << language_command_begin
2465 case RC_LANGUAGE_COMMAND_END:
2466 if (ignore_system_lyxrc ||
2467 language_command_end
2468 != system_lyxrc.language_command_end) {
2469 os << "\\language_command_end \"" << language_command_end
2474 case RC_LANGUAGE_COMMAND_LOCAL:
2475 if (ignore_system_lyxrc ||
2476 language_command_local
2477 != system_lyxrc.language_command_local) {
2478 os << "\\language_command_local \""
2479 << language_command_local
2484 case RC_LANGUAGE_AUTO_BEGIN:
2485 if (ignore_system_lyxrc ||
2486 language_auto_begin != system_lyxrc.language_auto_begin) {
2487 os << "\\language_auto_begin "
2488 << convert<string>(language_auto_begin) << '\n';
2492 case RC_LANGUAGE_AUTO_END:
2493 if (ignore_system_lyxrc ||
2494 language_auto_end != system_lyxrc.language_auto_end) {
2495 os << "\\language_auto_end "
2496 << convert<string>(language_auto_end) << '\n';
2500 case RC_MARK_FOREIGN_LANGUAGE:
2501 if (ignore_system_lyxrc ||
2502 mark_foreign_language
2503 != system_lyxrc.mark_foreign_language) {
2504 os << "\\mark_foreign_language " <<
2505 convert<string>(mark_foreign_language) << '\n';
2511 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2514 case RC_AUTO_NUMBER:
2515 if (ignore_system_lyxrc ||
2516 auto_number != system_lyxrc.auto_number) {
2517 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2521 case RC_GUI_LANGUAGE:
2522 if (ignore_system_lyxrc ||
2523 gui_language != system_lyxrc.gui_language) {
2524 os << "\\gui_language " << gui_language << '\n';
2528 case RC_EXPORT_OVERWRITE:
2529 if (ignore_system_lyxrc ||
2530 export_overwrite != system_lyxrc.export_overwrite) {
2532 switch (export_overwrite) {
2543 os << "\\export_overwrite " << status << '\n';
2548 case RC_SCROLL_WHEEL_ZOOM:
2549 if (ignore_system_lyxrc ||
2550 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2552 switch (scroll_wheel_zoom) {
2553 case SCROLL_WHEEL_ZOOM_OFF:
2556 case SCROLL_WHEEL_ZOOM_CTRL:
2559 case SCROLL_WHEEL_ZOOM_SHIFT:
2562 case SCROLL_WHEEL_ZOOM_ALT:
2566 os << "\\scroll_wheel_zoom " << status << '\n';
2572 << "# FORMATS SECTION ##########################\n"
2576 // New/modified formats
2577 for (Formats::const_iterator cit = theFormats().begin();
2578 cit != theFormats().end(); ++cit) {
2579 Format const * format =
2580 theSystemFormats().getFormat(cit->name());
2582 format->extensions() != cit->extensions() ||
2583 format->prettyname() != cit->prettyname() ||
2584 format->shortcut() != cit->shortcut() ||
2585 format->viewer() != cit->viewer() ||
2586 format->editor() != cit->editor() ||
2587 format->documentFormat() != cit->documentFormat() ||
2588 format->vectorFormat() != cit->vectorFormat() ||
2589 format->inExportMenu() != cit->inExportMenu() ||
2590 format->mime() != cit->mime()) {
2591 os << "\\format \"" << cit->name() << "\" \""
2592 << cit->extensions() << "\" \""
2593 << to_utf8(cit->prettyname()) << "\" \""
2594 << cit->shortcut() << "\" \""
2595 << escapeCommand(cit->viewer()) << "\" \""
2596 << escapeCommand(cit->editor()) << "\" \"";
2597 vector<string> flags;
2598 if (cit->documentFormat())
2599 flags.push_back("document");
2600 if (cit->vectorFormat())
2601 flags.push_back("vector");
2602 if (cit->zippedNative())
2603 flags.push_back("zipped=native");
2604 if (cit->inExportMenu())
2605 flags.push_back("menu=export");
2607 os << getStringFromVector(flags);
2608 os << "\" \"" << cit->mime() << "\"\n";
2612 // Look for deleted formats
2613 for (Formats::const_iterator cit = theSystemFormats().begin();
2614 cit != theSystemFormats().end(); ++cit)
2615 if (!theFormats().getFormat(cit->name()))
2616 os << "\\format \"" << cit->name()
2617 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2620 case RC_VIEWER_ALTERNATIVES: {
2621 Alternatives::const_iterator it = viewer_alternatives.begin();
2622 Alternatives::const_iterator const en = viewer_alternatives.end();
2623 Alternatives::const_iterator const sysend =
2624 system_lyxrc.viewer_alternatives.end();
2625 for (; it != en; ++it) {
2626 string const & fmt = it->first;
2627 CommandSet const & cmd = it->second;
2628 CommandSet::const_iterator sit = cmd.begin();
2629 CommandSet::const_iterator const sen = cmd.end();
2630 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2631 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2632 system_lyxrc.viewer_alternatives.find(fmt);
2633 for (; sit != sen; ++sit) {
2634 string const & cmd = *sit;
2635 if (ignore_system_lyxrc
2636 || sysfmt == sysend // format not found
2637 || sysfmt->second.count(cmd) == 0 // this command not found
2639 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2645 case RC_EDITOR_ALTERNATIVES: {
2646 Alternatives::const_iterator it = editor_alternatives.begin();
2647 Alternatives::const_iterator const en = editor_alternatives.end();
2648 Alternatives::const_iterator const sysend =
2649 system_lyxrc.editor_alternatives.end();
2650 for (; it != en; ++it) {
2651 string const & fmt = it->first;
2652 CommandSet const & cmd = it->second;
2653 CommandSet::const_iterator sit = cmd.begin();
2654 CommandSet::const_iterator const sen = cmd.end();
2655 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2656 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2657 system_lyxrc.editor_alternatives.find(fmt);
2658 for (; sit != sen; ++sit) {
2659 string const & cmd = *sit;
2660 if (ignore_system_lyxrc
2661 || sysfmt == sysend // format not found
2662 || sysfmt->second.count(cmd) == 0 // this command not found
2664 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2670 case RC_DEFAULT_OTF_VIEW_FORMAT:
2671 if ((ignore_system_lyxrc ||
2672 default_otf_view_format != system_lyxrc.default_otf_view_format)
2673 && !default_otf_view_format.empty()) {
2674 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2678 case RC_DEFAULT_VIEW_FORMAT:
2679 if (ignore_system_lyxrc ||
2680 default_view_format != system_lyxrc.default_view_format) {
2681 os << "\\default_view_format " << default_view_format << '\n';
2691 << "# CONVERTERS SECTION ##########################\n"
2695 // Look for new converters
2696 for (Converters::const_iterator cit = theConverters().begin();
2697 cit != theConverters().end(); ++cit) {
2698 Converter const * converter =
2699 theSystemConverters().getConverter(cit->from(),
2702 converter->command() != cit->command() ||
2703 converter->flags() != cit->flags())
2704 os << "\\converter \"" << cit->from() << "\" \""
2705 << cit->to() << "\" \""
2706 << escapeCommand(cit->command()) << "\" \""
2707 << cit->flags() << "\"\n";
2710 // New/modifed converters
2711 for (Converters::const_iterator cit = theSystemConverters().begin();
2712 cit != theSystemConverters().end(); ++cit)
2713 if (!theConverters().getConverter(cit->from(), cit->to()))
2714 os << "\\converter \"" << cit->from()
2715 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2722 << "# COPIERS SECTION ##########################\n"
2725 // Look for new movers
2726 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2727 Movers::const_iterator const sysend = theSystemMovers().end();
2728 Movers::const_iterator it = theMovers().begin();
2729 Movers::const_iterator end = theMovers().end();
2731 for (; it != end; ++it) {
2732 Movers::const_iterator const sysit =
2733 find_if(sysbegin, sysend, SameMover(*it));
2734 if (sysit == sysend) {
2735 string const & fmt = it->first;
2736 string const & command =
2737 it->second.command();
2739 os << "\\copier " << fmt
2740 << " \"" << escapeCommand(command) << "\"\n";
2746 // We don't actually delete SpecialisedMover(s) from the
2747 // map, just clear their 'command', so there's no need
2748 // to test for anything else.
2755 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2757 // Why the switch you might ask. It is a trick to ensure that all
2758 // the elements in the LyXRCTags enum is handled. As you can see
2759 // there are no breaks at all. So it is just a huge fall-through.
2760 // The nice thing is that we will get a warning from the compiler
2761 // if we forget an element.
2762 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2764 case LyXRC::RC_LAST:
2765 case LyXRC::RC_ACCEPT_COMPOUND:
2766 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2767 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2769 case LyXRC::RC_ALT_LANG:
2770 case LyXRC::RC_PLAINTEXT_LINELEN:
2771 case LyXRC::RC_AUTOCORRECTION_MATH:
2772 case LyXRC::RC_AUTOREGIONDELETE:
2773 case LyXRC::RC_AUTORESET_OPTIONS:
2774 case LyXRC::RC_AUTOSAVE:
2775 case LyXRC::RC_AUTO_NUMBER:
2776 case LyXRC::RC_BACKUPDIR_PATH:
2777 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2778 case LyXRC::RC_BIBTEX_COMMAND:
2779 case LyXRC::RC_BINDFILE:
2780 case LyXRC::RC_CHECKLASTFILES:
2781 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2782 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2783 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2784 case LyXRC::RC_COMPLETION_INLINE_MATH:
2785 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2786 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2787 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2788 case LyXRC::RC_COMPLETION_POPUP_MATH:
2789 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2790 case LyXRC::RC_COMPLETION_MINLENGTH:
2791 case LyXRC::RC_USELASTFILEPOS:
2792 case LyXRC::RC_LOADSESSION:
2793 case LyXRC::RC_CHKTEX_COMMAND:
2794 case LyXRC::RC_CONVERTER:
2795 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2796 case LyXRC::RC_COPIER:
2797 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2798 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2799 case LyXRC::RC_DATE_INSERT_FORMAT:
2800 case LyXRC::RC_GUI_LANGUAGE:
2801 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2802 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2803 case LyXRC::RC_DEFFILE:
2804 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2805 case LyXRC::RC_DISPLAY_GRAPHICS:
2806 case LyXRC::RC_DOCUMENTPATH:
2807 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2808 FileName path(lyxrc_new.document_path);
2809 if (path.exists() && path.isDirectory())
2810 package().document_dir() = FileName(lyxrc.document_path);
2813 case LyXRC::RC_EDITOR_ALTERNATIVES:
2814 case LyXRC::RC_ESC_CHARS:
2815 case LyXRC::RC_EXAMPLEPATH:
2816 case LyXRC::RC_FONT_ENCODING:
2817 case LyXRC::RC_FILEFORMAT:
2818 case LyXRC::RC_GROUP_LAYOUTS:
2819 case LyXRC::RC_HUNSPELLDIR_PATH:
2820 case LyXRC::RC_ICON_SET:
2821 case LyXRC::RC_INDEX_ALTERNATIVES:
2822 case LyXRC::RC_INDEX_COMMAND:
2823 case LyXRC::RC_JBIBTEX_COMMAND:
2824 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2825 case LyXRC::RC_JINDEX_COMMAND:
2826 case LyXRC::RC_NOMENCL_COMMAND:
2827 case LyXRC::RC_PYGMENTIZE_COMMAND:
2828 case LyXRC::RC_INPUT:
2829 case LyXRC::RC_KBMAP:
2830 case LyXRC::RC_KBMAP_PRIMARY:
2831 case LyXRC::RC_KBMAP_SECONDARY:
2832 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2833 case LyXRC::RC_LANGUAGE_AUTO_END:
2834 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2835 case LyXRC::RC_LANGUAGE_COMMAND_END:
2836 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2837 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2838 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2839 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2840 case LyXRC::RC_LYXRCFORMAT:
2841 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2842 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2843 case LyXRC::RC_MACRO_EDIT_STYLE:
2844 case LyXRC::RC_MAKE_BACKUP:
2845 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2846 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2847 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
2848 case LyXRC::RC_NUMLASTFILES:
2849 case LyXRC::RC_PARAGRAPH_MARKERS:
2850 case LyXRC::RC_PATH_PREFIX:
2851 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2852 prependEnvPath("PATH", lyxrc_new.path_prefix);
2853 // Resets python path
2854 support::os::python(true);
2857 case LyXRC::RC_PREVIEW:
2858 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2859 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2860 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2861 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2862 case LyXRC::RC_PRINTPAPERFLAG:
2863 case LyXRC::RC_SAVE_COMPRESSED:
2864 case LyXRC::RC_SAVE_ORIGIN:
2865 case LyXRC::RC_SCREEN_DPI:
2866 case LyXRC::RC_SCREEN_FONT_ROMAN:
2867 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2868 case LyXRC::RC_SCREEN_FONT_SANS:
2869 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2870 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2871 case LyXRC::RC_SCREEN_FONT_SIZES:
2872 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2873 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2874 case LyXRC::RC_GEOMETRY_SESSION:
2875 case LyXRC::RC_SCREEN_ZOOM:
2876 case LyXRC::RC_SERVERPIPE:
2877 case LyXRC::RC_SET_COLOR:
2878 case LyXRC::RC_SHOW_BANNER:
2879 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2880 case LyXRC::RC_SPELLCHECKER:
2881 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2884 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2885 case LyXRC::RC_SPELLCHECK_NOTES:
2886 case LyXRC::RC_SPLITINDEX_COMMAND:
2887 case LyXRC::RC_TEMPDIRPATH:
2888 case LyXRC::RC_TEMPLATEPATH:
2889 case LyXRC::RC_TEX_ALLOWS_SPACES:
2890 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2891 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2892 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2895 case LyXRC::RC_TEXINPUTS_PREFIX:
2896 case LyXRC::RC_THESAURUSDIRPATH:
2897 case LyXRC::RC_UIFILE:
2898 case LyXRC::RC_USER_EMAIL:
2899 case LyXRC::RC_USER_NAME:
2900 case LyXRC::RC_USE_CONVERTER_CACHE:
2901 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
2902 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
2903 case LyXRC::RC_USE_SYSTEM_COLORS:
2904 case LyXRC::RC_USE_TOOLTIP:
2905 case LyXRC::RC_USE_PIXMAP_CACHE:
2906 case LyXRC::RC_USE_QIMAGE:
2907 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
2908 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2909 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2910 case LyXRC::RC_SINGLE_INSTANCE:
2911 case LyXRC::RC_SORT_LAYOUTS:
2912 case LyXRC::RC_FULL_SCREEN_LIMIT:
2913 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2914 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2915 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
2916 case LyXRC::RC_FULL_SCREEN_TABBAR:
2917 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2918 case LyXRC::RC_FULL_SCREEN_WIDTH:
2919 case LyXRC::RC_VISUAL_CURSOR:
2920 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2921 case LyXRC::RC_VIEWER:
2922 case LyXRC::RC_VIEWER_ALTERNATIVES:
2923 case LyXRC::RC_FORWARD_SEARCH_DVI:
2924 case LyXRC::RC_FORWARD_SEARCH_PDF:
2925 case LyXRC::RC_EXPORT_OVERWRITE:
2926 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2927 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
2928 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2929 case LyXRC::RC_CURSOR_WIDTH:
2936 string const LyXRC::getDescription(LyXRCTags tag)
2941 case RC_ACCEPT_COMPOUND:
2942 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2946 str = _("Specify an alternate language. The default is to use the language of the document.");
2949 case RC_PLAINTEXT_LINELEN:
2950 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.");
2953 case RC_AUTOREGIONDELETE:
2954 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2957 case RC_AUTORESET_OPTIONS:
2958 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2962 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2965 case RC_AUTO_NUMBER:
2968 case RC_BACKUPDIR_PATH:
2969 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.");
2972 case RC_BIBTEX_COMMAND:
2973 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2976 case RC_JBIBTEX_COMMAND:
2977 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2981 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2984 case RC_CHECKLASTFILES:
2985 str = _("Select to check whether the lastfiles still exist.");
2988 case RC_CHKTEX_COMMAND:
2989 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2995 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
2996 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
2999 case RC_CONVERTER_NEEDAUTH:
3000 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3006 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3007 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.");
3010 case RC_CURSOR_WIDTH:
3011 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3014 case RC_SCROLL_BELOW_DOCUMENT:
3015 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");
3018 case RC_MAC_DONTSWAP_CTRL_META:
3019 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3022 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3023 str = _("Use the Mac OS X conventions for cursor movement");
3026 case RC_SHOW_MACRO_LABEL:
3027 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3030 case RC_DATE_INSERT_FORMAT:
3031 //xgettext:no-c-format
3032 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3036 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3039 case RC_DEFAULT_OTF_VIEW_FORMAT:
3040 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3043 case RC_DEFAULT_VIEW_FORMAT:
3044 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3047 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3048 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3051 case RC_DISPLAY_GRAPHICS:
3052 str = _("Select how LyX will display any graphics.");
3055 case RC_DOCUMENTPATH:
3056 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3060 str = _("Specify additional chars that can be part of a word.");
3063 case RC_EXAMPLEPATH:
3064 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3067 case RC_FONT_ENCODING:
3068 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3074 case RC_INDEX_COMMAND:
3075 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\".");
3078 case RC_JINDEX_COMMAND:
3079 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3082 case RC_NOMENCL_COMMAND:
3083 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3086 case RC_PYGMENTIZE_COMMAND:
3087 str = _("The command to run the python pygments syntax highlighter.");
3094 case RC_KBMAP_PRIMARY:
3095 case RC_KBMAP_SECONDARY:
3096 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.");
3099 case RC_LANGUAGE_AUTO_BEGIN:
3100 str = _("Select if a language switching command is needed at the beginning of the document.");
3103 case RC_LANGUAGE_AUTO_END:
3104 str = _("Select if a language switching command is needed at the end of the document.");
3107 case RC_LANGUAGE_COMMAND_BEGIN:
3108 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.");
3111 case RC_LANGUAGE_COMMAND_END:
3112 str = _("The LaTeX command for changing back to the language of the document.");
3115 case RC_LANGUAGE_COMMAND_LOCAL:
3116 str = _("The LaTeX command for local changing of the language.");
3119 case RC_LANGUAGE_GLOBAL_OPTIONS:
3120 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3123 case RC_LANGUAGE_CUSTOM_PACKAGE:
3124 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3127 case RC_LANGUAGE_PACKAGE_SELECTION:
3128 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3131 case RC_USELASTFILEPOS:
3132 str = _("De-select if you do not want LyX to scroll to saved position.");
3135 case RC_LOADSESSION:
3136 str = _("De-select to prevent loading files opened from the last LyX session.");
3139 case RC_MAKE_BACKUP:
3140 str = _("De-select if you don't want LyX to create backup files.");
3143 case RC_MARK_FOREIGN_LANGUAGE:
3144 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3147 case RC_MOUSE_WHEEL_SPEED:
3148 str = _("The scrolling speed of the mouse wheel.");
3151 case RC_COMPLETION_POPUP_DELAY:
3152 str = _("The completion popup delay.");
3155 case RC_COMPLETION_POPUP_MATH:
3156 str = _("Select to display the completion popup in math mode.");
3159 case RC_COMPLETION_POPUP_TEXT:
3160 str = _("Select to display the completion popup in text mode.");
3163 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3164 str = _("Show the completion popup without delay after non-unique completion attempt.");
3167 case RC_COMPLETION_POPUP_TEXT:
3168 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3171 case RC_COMPLETION_POPUP_DELAY:
3172 str = _("The inline completion delay.");
3175 case RC_COMPLETION_INLINE_MATH:
3176 str = _("Select to display the inline completion in math mode.");
3179 case RC_COMPLETION_INLINE_TEXT:
3180 str = _("Select to display the inline completion in text mode.");
3183 case RC_COMPLETION_INLINE_DOTS:
3184 str = _("Use \"...\" to shorten long completions.");
3187 case RC_AUTOCORRECTION_MATH:
3188 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3191 case RC_NUMLASTFILES:
3192 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3196 case RC_PATH_PREFIX:
3197 str = _("Specify those directories which should be "
3198 "prepended to the PATH environment variable.\n"
3199 "Use the OS native format.");
3203 str = _("Shows a typeset preview of things such as math");
3206 case RC_PREVIEW_HASHED_LABELS:
3207 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3210 case RC_PREVIEW_SCALE_FACTOR:
3211 str = _("Scale the preview size to suit.");
3214 case RC_PRINTLANDSCAPEFLAG:
3215 str = _("The option to print out in landscape.");
3218 case RC_PRINTPAPERDIMENSIONFLAG:
3219 str = _("Option to specify the dimensions of the print paper.");
3222 case RC_PRINTPAPERFLAG:
3223 str = _("The option to specify paper type.");
3226 case RC_VISUAL_CURSOR:
3227 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3230 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3231 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).");
3235 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3238 case RC_SCREEN_FONT_ROMAN:
3239 case RC_SCREEN_FONT_SANS:
3240 case RC_SCREEN_FONT_TYPEWRITER:
3241 str = _("The screen fonts used to display the text while editing.");
3244 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3245 case RC_SCREEN_FONT_SANS_FOUNDRY:
3246 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3249 case RC_SCREEN_FONT_SCALABLE:
3250 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.");
3253 case RC_SCREEN_FONT_SIZES:
3254 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3257 case RC_SCREEN_ZOOM:
3258 //xgettext:no-c-format
3259 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3262 case RC_GEOMETRY_SESSION:
3263 str = _("Allow session manager to save and restore windows geometry.");
3267 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3273 case RC_SHOW_BANNER:
3274 str = _("De-select if you don't want the startup banner.");
3277 case RC_TEMPDIRPATH:
3278 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3281 case RC_THESAURUSDIRPATH:
3282 str = _("This is the place where the files of the thesaurus library reside.");
3285 case RC_TEMPLATEPATH:
3286 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3289 case RC_TEX_ALLOWS_SPACES:
3292 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3295 case RC_TEXINPUTS_PREFIX:
3296 str = _("Specify those directories which should be "
3297 "prepended to the TEXINPUTS environment variable.\n"
3298 "A '.' represents the current document directory. "
3299 "Use the OS native format.");
3303 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3312 case RC_USE_USE_SYSTEM_COLORS:
3313 str = _("Enable use the system colors for some things like main window background and selection.");
3316 case RC_USE_TOOLTIP:
3317 str = _("Enable the automatic appearance of tool tips in the work area.");
3320 case RC_USE_PIXMAP_CACHE:
3321 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3324 case RC_VIEWDVI_PAPEROPTION:
3325 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3340 // The global instance
3343 // The global copy of the system lyxrc entries (everything except preferences)