3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
21 #include "BufferList.h"
23 #include "Converter.h"
24 #include "FontEnums.h"
27 #include "FuncRequest.h"
32 #include "SpellChecker.h"
35 #include "graphics/GraphicsTypes.h"
37 #include "support/convert.h"
38 #include "support/debug.h"
39 #include "support/environment.h"
40 #include "support/FileName.h"
41 #include "support/filetools.h"
42 #include "support/gettext.h"
43 #include "support/lstrings.h"
44 #include "support/os.h"
45 #include "support/Package.h"
46 #include "support/TempFile.h"
47 #include "support/userinfo.h"
54 using namespace lyx::support;
58 namespace os = support::os;
62 // The format should also be updated in configure.py, and conversion code
63 // should be added to prefs2prefs_prefs.py.
64 static unsigned int const LYXRC_FILEFORMAT = 24; // spitz: rename collapsible
66 // when adding something to this array keep it sorted!
67 LexerKeyword lyxrcTags[] = {
68 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
69 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
70 { "\\alternate_language", LyXRC::RC_ALT_LANG },
71 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
72 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
73 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
74 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
75 { "\\autosave", LyXRC::RC_AUTOSAVE },
76 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
77 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
78 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
79 { "\\bind_file", LyXRC::RC_BINDFILE },
80 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
81 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
82 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
83 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
84 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
85 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
86 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
87 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
88 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
89 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
90 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
91 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
92 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
93 { "\\converter", LyXRC::RC_CONVERTER },
94 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
95 { "\\copier", LyXRC::RC_COPIER },
96 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
97 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
98 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
99 { "\\def_file", LyXRC::RC_DEFFILE },
100 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
101 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
102 { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
103 { "\\default_platex_view_format", LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT },
104 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
105 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
106 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
107 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
108 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
109 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
110 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
111 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
112 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
113 { "\\format", LyXRC::RC_FILEFORMAT },
114 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
115 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
116 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
117 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
118 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
119 { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
120 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
121 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
122 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
123 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
124 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
125 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
126 { "\\icon_set", LyXRC::RC_ICON_SET },
127 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
128 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
129 { "\\input", LyXRC::RC_INPUT },
130 { "\\jbibtex_alternatives", LyXRC::RC_JBIBTEX_ALTERNATIVES },
131 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
132 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
133 { "\\kbmap", LyXRC::RC_KBMAP },
134 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
135 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
136 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
137 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
138 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
139 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
140 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
141 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
142 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
143 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
144 { "\\load_session", LyXRC::RC_LOADSESSION },
145 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
146 { "\\mac_like_cursor_movement", LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT },
147 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
148 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
149 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
150 { "\\mouse_middlebutton_paste", LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE },
151 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
152 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
153 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
154 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
155 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
156 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
157 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
158 { "\\preview", LyXRC::RC_PREVIEW },
159 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
160 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
161 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
162 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
163 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
164 { "\\pygmentize_command", LyXRC::RC_PYGMENTIZE_COMMAND },
165 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
166 { "\\save_origin", LyXRC::RC_SAVE_ORIGIN },
167 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
168 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
169 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
170 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
171 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
172 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
173 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
174 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
175 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
176 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
177 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
178 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
179 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
180 { "\\set_color", LyXRC::RC_SET_COLOR },
181 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
182 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
183 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
184 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
185 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
186 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
187 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
188 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
189 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
190 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
191 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
192 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
193 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
194 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
195 { "\\ui_file", LyXRC::RC_UIFILE },
196 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
197 { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
198 { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
199 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
200 { "\\use_native_filedialog", LyXRC::RC_USE_NATIVE_FILEDIALOG },
201 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
202 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
203 // compatibility with versions older than 1.4.0 only
204 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
205 { "\\use_system_theme_icons", LyXRC::RC_USE_SYSTEM_THEME_ICONS },
206 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
207 { "\\user_email", LyXRC::RC_USER_EMAIL },
208 { "\\user_name", LyXRC::RC_USER_NAME },
209 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
210 // compatibility with versions older than 1.4.0 only
211 { "\\viewer", LyXRC::RC_VIEWER},
212 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
213 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
214 { "format", LyXRC::RC_LYXRCFORMAT }
217 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
228 void LyXRC::setDefaults()
231 use_system_theme_icons = false;
233 def_file = "default";
235 // The current document directory
236 texinputs_prefix = ".";
237 print_landscape_flag = "-t landscape";
238 print_paper_flag = "-t";
239 print_paper_dimension_flag = "-T";
240 document_path.erase();
241 view_dvi_paper_option.erase();
242 default_view_format = "pdf2";
243 default_otf_view_format = "pdf4";
244 default_platex_view_format = "pdf3";
245 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
246 bibtex_command = "automatic";
248 index_command = "makeindex -c -q";
249 nomencl_command = "makeindex -s nomencl.ist";
250 pygmentize_command = string();
252 // Because a screen is typically wider than a piece of paper:
254 currentZoom = defaultZoom;
255 allow_geometry_session = true;
256 // Default LaTeX font size:
257 font_sizes[FONT_SIZE_TINY] = "5.0";
258 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
259 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
260 font_sizes[FONT_SIZE_SMALL] = "9.0";
261 font_sizes[FONT_SIZE_NORMAL] = "10.0";
262 font_sizes[FONT_SIZE_LARGE] = "12.0";
263 font_sizes[FONT_SIZE_LARGER] = "14.4";
264 font_sizes[FONT_SIZE_LARGEST] = "17.26";
265 font_sizes[FONT_SIZE_HUGE] = "20.74";
266 font_sizes[FONT_SIZE_HUGER] = "24.88";
267 use_scalable_fonts = true;
268 roman_font_name = "";
270 typewriter_font_name = "";
272 auto_region_delete = true;
273 auto_reset_options = false;
274 plaintext_linelen = 65;
275 mouse_wheel_speed = 1.0;
277 check_lastfiles = true;
278 use_lastfilepos = true;
279 use_native_filedialog = true;
280 load_session = false;
282 save_compressed = false;
284 backupdir_path.erase();
285 display_graphics = true;
286 // Spellchecker settings:
287 // FIXME: this check should test the target platform (darwin)
288 #if defined(USE_MACOSX_PACKAGING)
289 spellchecker = "native";
290 #elif defined(USE_ENCHANT)
291 spellchecker = "enchant";
292 #elif defined(USE_ASPELL)
293 spellchecker = "aspell";
294 #elif defined(USE_HUNSPELL)
295 spellchecker = "hunspell";
297 spellchecker = "aspell";
299 spellchecker_accept_compound = false;
300 spellcheck_continuously = false;
301 completion_minlength = 6;
302 spellcheck_notes = true;
304 visual_cursor = false;
306 mark_foreign_language = true;
307 language_auto_begin = true;
308 language_auto_end = true;
309 language_global_options = true;
310 language_package_selection = LP_AUTO;
311 language_custom_package = "\\usepackage{babel}";
312 language_command_begin = "\\selectlanguage{$$lang}";
313 language_command_local = "\\foreignlanguage{$$lang}{";
314 sort_layouts = false;
315 group_layouts = true;
316 gui_language = "auto";
318 windows_style_tex_paths = false;
319 tex_allows_spaces = false;
320 date_insert_format = "%x";
321 cursor_follows_scrollbar = false;
322 scroll_below_document = false;
323 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
324 paragraph_markers = false;
325 mac_dontswap_ctrl_meta = false;
326 mac_like_cursor_movement = false;
327 macro_edit_style = MACRO_EDIT_INLINE_BOX;
328 dialogs_iconify_with_main = false;
329 preview = PREVIEW_OFF;
330 preview_hashed_labels = false;
331 preview_scale_factor = 1.0;
332 use_converter_cache = true;
333 use_converter_needauth_forbidden = true;
334 use_converter_needauth = true;
335 use_system_colors = false;
337 use_pixmap_cache = false;
339 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
340 user_name = to_utf8(support::user_name());
341 user_email = to_utf8(support::user_email());
342 open_buffers_in_tabs = true;
343 single_close_tab_button = false;
344 single_instance = true;
345 forward_search_dvi = string();
346 forward_search_pdf = string();
347 export_overwrite = NO_FILES;
349 // Fullscreen settings
350 full_screen_limit = false;
351 full_screen_toolbars = true;
352 full_screen_tabbar = true;
353 full_screen_menubar = true;
354 full_screen_statusbar = true;
355 full_screen_scrollbar = true;
356 full_screen_width = 700;
358 completion_cursor_text = true;
359 completion_popup_math = true;
360 completion_popup_text = false;
361 completion_popup_delay = 2.0;
362 completion_popup_after_complete = true;
363 autocorrection_math = false;
364 completion_inline_math = true;
365 completion_inline_text = false;
366 completion_inline_dots = -1;
367 completion_inline_delay = 0.2;
368 default_decimal_point = ".";
369 default_length_unit = Length::CM;
371 close_buffer_with_last_view = "yes";
372 mouse_middlebutton_paste = true;
378 void oldFontFormat(string & family, string & foundry)
380 if (family.empty() || family[0] != '-')
382 foundry = token(family, '-', 1);
383 family = token(family, '-', 2);
391 bool LyXRC::read(FileName const & filename, bool check_format)
393 Lexer lexrc(lyxrcTags);
394 lexrc.setFile(filename);
395 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
396 ReturnValues retval = read(lexrc, check_format);
397 if (!check_format || retval != FormatMismatch)
398 return retval == ReadOK;
400 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
401 TempFile tmp("convert_lyxrc");
402 FileName const tempfile = tmp.name();
403 bool const success = prefs2prefs(filename, tempfile, false);
405 LYXERR0 ("Unable to convert " << filename.absFileName() <<
406 " to format " << LYXRC_FILEFORMAT);
409 // Keep this in the else branch, such that lexrc2 goes out
410 // of scope and releases the lock on tempfile before we
411 // attempt to remove it. This matters on Windows.
412 Lexer lexrc2(lyxrcTags);
413 lexrc2.setFile(tempfile);
414 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
415 retval = read(lexrc2, check_format);
416 if (retval == FormatMismatch)
417 LYXERR0("Conversion failed for " << filename.absFileName());
419 return retval == ReadOK;
423 // don't need to worry about conversion, because this is always
424 // from an internal source
425 bool LyXRC::read(istream & is)
427 Lexer lexrc(lyxrcTags);
429 LYXERR(Debug::LYXRC, "Reading istream...");
430 return read(lexrc, false) == ReadOK;
434 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
436 if (lyxerr.debugging(Debug::PARSER))
437 lexrc.printTable(lyxerr);
442 // format prior to 2.0 and introduction of format tag
443 unsigned int format = 0;
445 while (lexrc.isOK()) {
446 // By using two switches we take advantage of the compiler
447 // telling us if we have missed a LyXRCTags element in
448 // the second switch.
449 // Note that this also shows a problem with Lexer since it
450 // helps us avoid taking advantage of the strictness of the
453 int le = lexrc.lex();
455 case Lexer::LEX_UNDEF:
456 lexrc.printError("Unknown tag `$$Token'");
458 case Lexer::LEX_FEOF:
463 switch (static_cast<LyXRCTags>(le)) {
466 format = lexrc.getInteger();
468 case RC_INPUT: // Include file
471 libFileSearch(string(),
473 if (!read(tmp, check_format)) {
475 "Error reading included file: " + tmp.absFileName());
481 bind_file = os::internal_path(lexrc.getString());
486 def_file = os::internal_path(lexrc.getString());
491 ui_file = os::internal_path(lexrc.getString());
494 case RC_AUTORESET_OPTIONS:
495 lexrc >> auto_reset_options;
498 case RC_DISPLAY_GRAPHICS:
500 display_graphics = lexrc.getString() == "true";
503 case RC_TEX_EXPECTS_WINDOWS_PATHS:
504 lexrc >> windows_style_tex_paths;
507 case RC_TEX_ALLOWS_SPACES:
508 lexrc >> tex_allows_spaces;
511 case RC_TEXINPUTS_PREFIX:
512 lexrc >> texinputs_prefix;
519 case RC_KBMAP_PRIMARY:
521 string const kmap(os::internal_path(lexrc.getString()));
522 if (!libFileSearch("kbd", kmap, "kmap").empty()
524 primary_kbmap = kmap;
526 lexrc.printError("LyX: Keymap `$$Token' not found");
531 case RC_KBMAP_SECONDARY:
533 string const kmap(os::internal_path(lexrc.getString()));
534 if (!libFileSearch("kbd", kmap, "kmap").empty()
536 secondary_kbmap = kmap;
538 lexrc.printError("LyX: Keymap `$$Token' not found");
543 case RC_FONT_ENCODING:
547 case RC_PRINTLANDSCAPEFLAG:
548 lexrc >> print_landscape_flag;
551 case RC_PRINTPAPERDIMENSIONFLAG:
552 lexrc >> print_paper_dimension_flag;
555 case RC_PRINTPAPERFLAG:
556 lexrc >> print_paper_flag;
559 case RC_PYGMENTIZE_COMMAND:
560 if (lexrc.next(true)) {
561 pygmentize_command = lexrc.getString();
565 case RC_VIEWDVI_PAPEROPTION:
567 view_dvi_paper_option = lexrc.getString();
569 view_dvi_paper_option.erase();
572 case RC_CHKTEX_COMMAND:
573 if (lexrc.next(true)) {
574 chktex_command = lexrc.getString();
578 case RC_BIBTEX_ALTERNATIVES:
579 if (lexrc.next(true)) {
580 bibtex_alternatives.insert(lexrc.getString());
584 case RC_BIBTEX_COMMAND:
585 if (lexrc.next(true)) {
586 bibtex_command = lexrc.getString();
590 case RC_JBIBTEX_COMMAND:
591 if (lexrc.next(true)) {
592 jbibtex_command = lexrc.getString();
596 case RC_JBIBTEX_ALTERNATIVES:
597 if (lexrc.next(true)) {
598 jbibtex_alternatives.insert(lexrc.getString());
602 case RC_INDEX_ALTERNATIVES:
603 if (lexrc.next(true)) {
604 index_alternatives.insert(lexrc.getString());
608 case RC_INDEX_COMMAND:
609 if (lexrc.next(true)) {
610 index_command = lexrc.getString();
614 case RC_JINDEX_COMMAND:
615 if (lexrc.next(true)) {
616 jindex_command = lexrc.getString();
620 case RC_SPLITINDEX_COMMAND:
621 if (lexrc.next(true)) {
622 splitindex_command = lexrc.getString();
626 case RC_NOMENCL_COMMAND:
627 if (lexrc.next(true)) {
628 nomencl_command = lexrc.getString();
637 lexrc >> defaultZoom;
638 if (defaultZoom < 10)
642 case RC_GEOMETRY_SESSION:
643 lexrc >> allow_geometry_session;
646 case RC_SCREEN_FONT_SIZES:
647 lexrc >> font_sizes[FONT_SIZE_TINY];
648 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
649 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
650 lexrc >> font_sizes[FONT_SIZE_SMALL];
651 lexrc >> font_sizes[FONT_SIZE_NORMAL];
652 lexrc >> font_sizes[FONT_SIZE_LARGE];
653 lexrc >> font_sizes[FONT_SIZE_LARGER];
654 lexrc >> font_sizes[FONT_SIZE_LARGEST];
655 lexrc >> font_sizes[FONT_SIZE_HUGE];
656 lexrc >> font_sizes[FONT_SIZE_HUGER];
659 case RC_SCREEN_FONT_SCALABLE:
660 lexrc >> use_scalable_fonts;
667 case RC_DOCUMENTPATH:
669 document_path = os::internal_path(lexrc.getString());
674 example_path = os::internal_path(lexrc.getString());
677 case RC_TEMPLATEPATH:
679 template_path = os::internal_path(lexrc.getString());
684 tempdir_path = os::internal_path(lexrc.getString());
687 case RC_THESAURUSDIRPATH:
689 thesaurusdir_path = os::internal_path(lexrc.getString());
692 case RC_HUNSPELLDIR_PATH:
694 hunspelldir_path = os::internal_path(lexrc.getString());
697 case RC_USELASTFILEPOS:
698 lexrc >> use_lastfilepos;
702 lexrc >> load_session;
705 case RC_MOUSE_WHEEL_SPEED:
706 lexrc >> mouse_wheel_speed;
709 case RC_COMPLETION_INLINE_DELAY:
710 lexrc >> completion_inline_delay;
713 case RC_COMPLETION_INLINE_MATH:
714 lexrc >> completion_inline_math;
717 case RC_COMPLETION_INLINE_TEXT:
718 lexrc >> completion_inline_text;
721 case RC_COMPLETION_INLINE_DOTS:
722 lexrc >> completion_inline_dots;
725 case RC_AUTOCORRECTION_MATH:
726 lexrc >> autocorrection_math;
729 case RC_COMPLETION_POPUP_DELAY:
730 lexrc >> completion_popup_delay;
733 case RC_COMPLETION_POPUP_MATH:
734 lexrc >> completion_popup_math;
737 case RC_COMPLETION_POPUP_TEXT:
738 lexrc >> completion_popup_text;
741 case RC_COMPLETION_CURSOR_TEXT:
742 lexrc >> completion_cursor_text;
745 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
746 lexrc >> completion_popup_after_complete;
749 case RC_COMPLETION_MINLENGTH:
750 lexrc >> completion_minlength;
753 case RC_NUMLASTFILES:
754 lexrc >> num_lastfiles;
757 case RC_CHECKLASTFILES:
758 lexrc >> check_lastfiles;
765 case RC_USE_SYSTEM_THEME_ICONS:
766 lexrc >> use_system_theme_icons;
769 case RC_SCREEN_FONT_ROMAN:
771 roman_font_name = lexrc.getString();
772 oldFontFormat(roman_font_name,
777 case RC_SCREEN_FONT_SANS:
779 sans_font_name = lexrc.getString();
780 oldFontFormat(sans_font_name, sans_font_foundry);
784 case RC_SCREEN_FONT_TYPEWRITER:
786 typewriter_font_name = lexrc.getString();
787 oldFontFormat(typewriter_font_name,
788 typewriter_font_foundry);
792 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
793 lexrc >> roman_font_foundry;
796 case RC_SCREEN_FONT_SANS_FOUNDRY:
797 lexrc >> sans_font_foundry;
800 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
801 lexrc >> typewriter_font_foundry;
806 lexrc.printError("Missing color tag.");
809 string lyx_name = lexrc.getString();
812 lexrc.printError("Missing color name for color: `$$Token'");
815 string x11_name = lexrc.getString();
817 ColorCode const col =
818 lcolor.getFromLyXName(lyx_name);
819 if (col == Color_none ||
820 col == Color_inherit ||
824 if (!lcolor.setColor(col, x11_name))
825 LYXERR0("Bad lyxrc set_color for " << lyx_name);
829 case RC_AUTOREGIONDELETE:
830 // Auto region delete defaults to true
831 lexrc >> auto_region_delete;
836 lyxpipes = os::internal_path(lexrc.getString());
839 case RC_CURSOR_FOLLOWS_SCROLLBAR:
840 lexrc >> cursor_follows_scrollbar;
843 case RC_CURSOR_WIDTH:
844 lexrc >> cursor_width;
847 case RC_SCROLL_BELOW_DOCUMENT:
848 lexrc >> scroll_below_document;
851 case RC_PARAGRAPH_MARKERS:
852 lexrc >> paragraph_markers;
855 case RC_MAC_DONTSWAP_CTRL_META:
856 lexrc >> mac_dontswap_ctrl_meta;
859 case RC_MAC_LIKE_CURSOR_MOVEMENT:
860 lexrc >> mac_like_cursor_movement;
863 case RC_MACRO_EDIT_STYLE:
865 switch (lexrc.getInteger()) {
866 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
867 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
868 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
873 case RC_DIALOGS_ICONIFY_WITH_MAIN:
874 lexrc >> dialogs_iconify_with_main;
877 case RC_PLAINTEXT_LINELEN:
878 lexrc >> plaintext_linelen;
880 // Spellchecker settings:
881 case RC_ACCEPT_COMPOUND:
882 lexrc >> spellchecker_accept_compound;
884 case RC_USE_NATIVE_FILEDIALOG:
885 lexrc >> use_native_filedialog;
887 case RC_USE_SYSTEM_COLORS:
888 lexrc >> use_system_colors;
891 lexrc >> use_tooltip;
893 case RC_USE_PIXMAP_CACHE:
894 lexrc >> use_pixmap_cache;
899 case RC_SPELLCHECKER:
900 lexrc >> spellchecker;
903 lexrc >> spellchecker_alt_lang;
906 lexrc >> spellchecker_esc_chars;
908 case RC_SPELLCHECK_CONTINUOUSLY:
909 lexrc >> spellcheck_continuously;
911 case RC_SPELLCHECK_NOTES:
912 lexrc >> spellcheck_notes;
915 lexrc >> make_backup;
917 case RC_SAVE_COMPRESSED:
918 lexrc >> save_compressed;
921 lexrc >> save_origin;
923 case RC_BACKUPDIR_PATH:
925 backupdir_path = os::internal_path(lexrc.getString());
927 case RC_DEFAULT_DECIMAL_POINT:
928 lexrc >> default_decimal_point;
930 case RC_DEFAULT_LENGTH_UNIT:
932 default_length_unit = (Length::UNIT) lexrc.getInteger();
934 case RC_DATE_INSERT_FORMAT:
935 lexrc >> date_insert_format;
937 case RC_LANGUAGE_CUSTOM_PACKAGE:
938 lexrc >> language_custom_package;
940 case RC_LANGUAGE_AUTO_BEGIN:
941 lexrc >> language_auto_begin;
943 case RC_LANGUAGE_AUTO_END:
944 lexrc >> language_auto_end;
946 case RC_LANGUAGE_GLOBAL_OPTIONS:
947 lexrc >> language_global_options;
949 case RC_LANGUAGE_PACKAGE_SELECTION:
951 switch (lexrc.getInteger()) {
953 language_package_selection = LP_AUTO;
956 language_package_selection = LP_BABEL;
959 language_package_selection = LP_CUSTOM;
962 language_package_selection = LP_NONE;
967 case RC_LANGUAGE_COMMAND_BEGIN:
968 lexrc >> language_command_begin;
970 case RC_LANGUAGE_COMMAND_END:
971 lexrc >> language_command_end;
973 case RC_LANGUAGE_COMMAND_LOCAL:
974 lexrc >> language_command_local;
976 case RC_VISUAL_CURSOR:
977 lexrc >> visual_cursor;
979 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
980 lexrc >> close_buffer_with_last_view;
983 lexrc >> auto_number;
985 case RC_MARK_FOREIGN_LANGUAGE:
986 lexrc >> mark_foreign_language;
992 fmt = lexrc.getString();
993 if (lexrc.next(true))
994 command = lexrc.getString();
995 setMover(fmt, command);
1000 string from, to, command, flags;
1002 from = lexrc.getString();
1004 to = lexrc.getString();
1005 if (lexrc.next(true))
1006 command = lexrc.getString();
1008 flags = lexrc.getString();
1009 if (command.empty())
1010 theConverters().erase(from, to);
1012 theConverters().add(from, to, command, flags);
1015 // compatibility with versions older than 1.4.0 only
1017 string format, command;
1018 lexrc >> format >> command;
1019 theFormats().setViewer(format, command);
1022 case RC_FILEFORMAT: {
1024 string format, extensions, shortcut;
1025 docstring prettyname;
1026 if (!(lexrc >> format >> extensions))
1028 if (ok && lexrc.next(true))
1029 prettyname = lexrc.getDocString();
1033 if(!(lexrc >> shortcut))
1035 string viewer, editor;
1036 if (ok && lexrc.next(true))
1037 viewer = lexrc.getString();
1040 if (ok && lexrc.next(true))
1041 editor = lexrc.getString();
1045 if (!(lexrc >> flags >> mime))
1047 int flgs = Format::none;
1048 while (!flags.empty()) {
1050 flags = split(flags, flag, ',');
1051 if (flag == "document")
1052 flgs |= Format::document;
1053 else if (flag == "vector")
1054 flgs |= Format::vector;
1055 else if (flag == "zipped=native")
1056 flgs |= Format::zipped_native;
1057 else if (flag == "menu=export")
1058 flgs |= Format::export_menu;
1059 else if (flag == "menu=none")
1060 flgs |= Format::no_menu;
1062 LYXERR0("Ignoring unknown flag `"
1063 << flag << "' for format `"
1067 LYXERR0("Syntax error in format " << format);
1068 else if (prettyname.empty()) {
1069 if (theConverters().formatIsUsed(format))
1070 LYXERR0("Can't delete format " << format);
1072 theFormats().erase(format);
1074 theFormats().add(format, extensions, prettyname,
1075 shortcut, viewer, editor, mime, flgs);
1079 case RC_VIEWER_ALTERNATIVES: {
1080 string format, command;
1081 if ((lexrc >> format) && lexrc.next(true)) {
1082 command = lexrc.getString();
1083 viewer_alternatives[format].insert(command);
1087 case RC_EDITOR_ALTERNATIVES: {
1088 string format, command;
1089 if ((lexrc >> format) && lexrc.next(true)) {
1090 command = lexrc.getString();
1091 editor_alternatives[format].insert(command);
1096 case RC_DEFAULT_OTF_VIEW_FORMAT:
1097 lexrc >> default_otf_view_format;
1100 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
1101 lexrc >> default_platex_view_format;
1104 case RC_DEFAULT_VIEW_FORMAT:
1105 lexrc >> default_view_format;
1108 case RC_GUI_LANGUAGE:
1109 lexrc >> gui_language;
1112 case RC_SHOW_BANNER:
1113 lexrc >> show_banner;
1118 string const tmp = lexrc.getString();
1119 if (tmp == "true" || tmp == "on")
1120 preview = PREVIEW_ON;
1121 else if (tmp == "no_math")
1122 preview = PREVIEW_NO_MATH;
1124 preview = PREVIEW_OFF;
1125 if (tmp != "false" && tmp != "off")
1126 LYXERR0("Unrecognized preview status \""
1132 case RC_PREVIEW_HASHED_LABELS:
1133 lexrc >> preview_hashed_labels;
1136 case RC_PREVIEW_SCALE_FACTOR:
1137 lexrc >> preview_scale_factor;
1144 lexrc >> user_email;
1147 case RC_PATH_PREFIX:
1148 lexrc >> path_prefix;
1151 case RC_USE_CONVERTER_CACHE:
1152 lexrc >> use_converter_cache;
1154 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1155 lexrc >> use_converter_needauth_forbidden;
1157 case RC_USE_CONVERTER_NEEDAUTH:
1158 lexrc >> use_converter_needauth;
1160 case RC_CONVERTER_CACHE_MAXAGE:
1161 lexrc >> converter_cache_maxage;
1164 case RC_SORT_LAYOUTS:
1165 lexrc >> sort_layouts;
1167 case RC_GROUP_LAYOUTS:
1168 lexrc >> group_layouts;
1170 case RC_FULL_SCREEN_LIMIT:
1171 lexrc >> full_screen_limit;
1173 case RC_FULL_SCREEN_TOOLBARS:
1174 lexrc >> full_screen_toolbars;
1176 case RC_FULL_SCREEN_SCROLLBAR:
1177 lexrc >> full_screen_scrollbar;
1179 case RC_FULL_SCREEN_STATUSBAR:
1180 lexrc >> full_screen_statusbar;
1182 case RC_FULL_SCREEN_TABBAR:
1183 lexrc >> full_screen_tabbar;
1185 case RC_FULL_SCREEN_MENUBAR:
1186 lexrc >> full_screen_menubar;
1188 case RC_FULL_SCREEN_WIDTH:
1189 lexrc >> full_screen_width;
1191 case RC_OPEN_BUFFERS_IN_TABS:
1192 lexrc >> open_buffers_in_tabs;
1194 case RC_SINGLE_CLOSE_TAB_BUTTON:
1195 lexrc >> single_close_tab_button;
1197 case RC_SINGLE_INSTANCE:
1198 lexrc >> single_instance;
1199 if (run_mode == PREFERRED)
1200 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1202 case RC_FORWARD_SEARCH_DVI:
1203 if (lexrc.next(true))
1204 forward_search_dvi = lexrc.getString();
1206 case RC_FORWARD_SEARCH_PDF:
1207 if (lexrc.next(true))
1208 forward_search_pdf = lexrc.getString();
1210 case RC_EXPORT_OVERWRITE:
1212 string const tmp = lexrc.getString();
1213 if (tmp == "all" || tmp == "true")
1214 export_overwrite = ALL_FILES;
1215 else if (tmp == "main")
1216 export_overwrite = MAIN_FILE;
1218 export_overwrite = NO_FILES;
1219 if (tmp != "ask" && tmp != "false")
1220 LYXERR0("Unrecognized export_overwrite status \""
1225 case RC_SCROLL_WHEEL_ZOOM:
1227 string const tmp = lexrc.getString();
1229 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1230 else if (tmp == "shift")
1231 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1232 else if (tmp == "alt")
1233 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1235 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1236 if (tmp != "off" && tmp != "false")
1237 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1243 case RC_MOUSE_MIDDLEBUTTON_PASTE:
1244 lexrc >> mouse_middlebutton_paste;
1248 break; // this is just a dummy
1251 // This is triggered the first time through the loop unless
1252 // we hit a format tag.
1253 if (check_format && format != LYXRC_FILEFORMAT)
1254 return FormatMismatch;
1257 /// Update converters data-structures
1258 theConverters().update(theFormats());
1259 theConverters().buildGraph();
1260 theBufferList().invalidateConverterCache();
1266 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1268 ofstream ofs(filename.toFilesystemEncoding().c_str());
1270 write(ofs, ignore_system_lyxrc);
1274 void LyXRC::print() const
1276 if (lyxerr.debugging())
1277 write(lyxerr, false);
1285 typedef pair<string, SpecialisedMover> Data;
1287 SameMover(Data const & comparison)
1288 : comparison_(comparison) {}
1290 bool operator()(Data const & data) const
1292 return data.first == comparison_.first &&
1293 data.second.command() == comparison_.second.command();
1303 // Escape \ and " so that LyXLex can read the string later
1304 string escapeCommand(string const & str) {
1305 return subst(subst(str , "\\", "\\\\"),
1312 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1314 LyXRCTags tag = RC_LAST;
1316 if (!name.empty()) {
1317 for (int i = 0; i != lyxrcCount; ++i)
1318 if ("\\" + name == lyxrcTags[i].tag)
1319 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1323 os << "# LyX " << lyx_version
1324 << " generated this file. If you want to make your own\n"
1325 << "# modifications you should do them from inside LyX and save.\n\n"
1326 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1328 // Why the switch you might ask. It is a trick to ensure that all
1329 // the elements in the LyXRCTags enum are handled. As you can see
1330 // there are no breaks at all. So it is just a huge fall-through.
1331 // The nice thing is that we will get a warning from the compiler
1332 // if we forget an element.
1336 // input/include files are not done here
1337 case RC_LYXRCFORMAT:
1339 if (ignore_system_lyxrc ||
1340 bind_file != system_lyxrc.bind_file) {
1341 string const path = os::external_path(bind_file);
1342 os << "\\bind_file \"" << path << "\"\n";
1348 if (ignore_system_lyxrc ||
1349 def_file != system_lyxrc.def_file) {
1350 string const path = os::external_path(def_file);
1351 os << "\\def_file \"" << path << "\"\n";
1360 << "# MISC SECTION ######################################\n"
1362 // bind files are not done here.
1364 case RC_PATH_PREFIX:
1365 if (ignore_system_lyxrc ||
1366 path_prefix != system_lyxrc.path_prefix) {
1367 os << "\\path_prefix \"" << path_prefix << "\"\n";
1373 if (ignore_system_lyxrc ||
1374 ui_file != system_lyxrc.ui_file) {
1375 string const path = os::external_path(ui_file);
1376 os << "\\ui_file \"" << path << "\"\n";
1381 case RC_AUTOREGIONDELETE:
1382 if (ignore_system_lyxrc ||
1383 auto_region_delete != system_lyxrc.auto_region_delete) {
1384 os << "# Set to false to inhibit automatic replacement of\n"
1385 << "# the current selection.\n"
1386 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1392 case RC_AUTORESET_OPTIONS:
1393 if (ignore_system_lyxrc ||
1394 auto_reset_options != system_lyxrc.auto_reset_options) {
1395 os << "# Set to false to inhibit automatic reset of\n"
1396 << "# the class options to defaults on class change.\n"
1397 << "\\auto_reset_options "
1398 << convert<string>(auto_reset_options)
1405 if (ignore_system_lyxrc ||
1406 autosave != system_lyxrc.autosave) {
1407 os << "# The time interval between auto-saves in seconds.\n"
1408 << "\\autosave " << autosave << '\n';
1413 case RC_DISPLAY_GRAPHICS:
1414 if (ignore_system_lyxrc ||
1415 display_graphics != system_lyxrc.display_graphics) {
1416 os << "# Display graphics within LyX\n"
1418 << "\\display_graphics "
1419 << (display_graphics ? "true" : "false")
1425 case RC_SORT_LAYOUTS:
1426 if (ignore_system_lyxrc ||
1427 sort_layouts != system_lyxrc.sort_layouts) {
1428 os << "# Sort layouts alphabetically.\n"
1429 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1434 case RC_GROUP_LAYOUTS:
1435 if (ignore_system_lyxrc ||
1436 group_layouts != system_lyxrc.group_layouts) {
1437 os << "# Group layouts by their category.\n"
1438 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1443 case RC_VIEWDVI_PAPEROPTION:
1444 if (ignore_system_lyxrc ||
1445 view_dvi_paper_option
1446 != system_lyxrc.view_dvi_paper_option) {
1447 os << "# Options used to specify paper size to the\n"
1448 << "# view_dvi_command (e.g. -paper)\n"
1449 << "\\view_dvi_paper_option \""
1450 << view_dvi_paper_option << "\"\n";
1455 case RC_CHKTEX_COMMAND:
1456 if (ignore_system_lyxrc ||
1457 chktex_command != system_lyxrc.chktex_command) {
1458 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1463 case RC_BIBTEX_ALTERNATIVES: {
1464 CommandSet::const_iterator it = bibtex_alternatives.begin();
1465 CommandSet::const_iterator end = bibtex_alternatives.end();
1466 for ( ; it != end; ++it) {
1467 if (ignore_system_lyxrc
1468 || !system_lyxrc.bibtex_alternatives.count(*it))
1469 os << "\\bibtex_alternatives \""
1476 case RC_BIBTEX_COMMAND:
1477 if (ignore_system_lyxrc ||
1478 bibtex_command != system_lyxrc.bibtex_command) {
1479 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1484 case RC_JBIBTEX_COMMAND:
1485 if (ignore_system_lyxrc ||
1486 jbibtex_command != system_lyxrc.jbibtex_command) {
1487 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1492 case RC_JBIBTEX_ALTERNATIVES: {
1493 CommandSet::const_iterator it = jbibtex_alternatives.begin();
1494 CommandSet::const_iterator end = jbibtex_alternatives.end();
1495 for ( ; it != end; ++it) {
1496 if (ignore_system_lyxrc
1497 || !system_lyxrc.jbibtex_alternatives.count(*it))
1498 os << "\\jbibtex_alternatives \""
1505 case RC_INDEX_ALTERNATIVES: {
1506 CommandSet::const_iterator it = index_alternatives.begin();
1507 CommandSet::const_iterator end = index_alternatives.end();
1508 for ( ; it != end; ++it) {
1509 if (ignore_system_lyxrc
1510 || !system_lyxrc.index_alternatives.count(*it))
1511 os << "\\index_alternatives \""
1518 case RC_INDEX_COMMAND:
1519 if (ignore_system_lyxrc ||
1520 index_command != system_lyxrc.index_command) {
1521 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1526 case RC_JINDEX_COMMAND:
1527 if (ignore_system_lyxrc ||
1528 jindex_command != system_lyxrc.jindex_command) {
1529 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1534 case RC_SPLITINDEX_COMMAND:
1535 if (ignore_system_lyxrc ||
1536 splitindex_command != system_lyxrc.splitindex_command) {
1537 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1542 case RC_NOMENCL_COMMAND:
1543 if (ignore_system_lyxrc ||
1544 nomencl_command != system_lyxrc.nomencl_command) {
1545 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1550 case RC_PYGMENTIZE_COMMAND:
1551 if (ignore_system_lyxrc ||
1552 pygmentize_command != system_lyxrc.pygmentize_command) {
1553 os << "\\pygmentize_command \"" << escapeCommand(pygmentize_command) << "\"\n";
1558 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1559 // Don't write this setting to the preferences file,
1560 // but allow temporary changes (bug 7557).
1561 if (ignore_system_lyxrc) {
1562 os << "\\tex_expects_windows_paths "
1563 << convert<string>(windows_style_tex_paths) << '\n';
1568 case RC_TEX_ALLOWS_SPACES:
1569 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1570 os << "\\tex_allows_spaces "
1571 << convert<string>(tex_allows_spaces) << '\n';
1577 if (ignore_system_lyxrc ||
1578 use_kbmap != system_lyxrc.use_kbmap) {
1579 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1584 case RC_KBMAP_PRIMARY:
1585 if (ignore_system_lyxrc ||
1586 primary_kbmap != system_lyxrc.primary_kbmap) {
1587 string const path = os::external_path(primary_kbmap);
1588 os << "\\kbmap_primary \"" << path << "\"\n";
1593 case RC_KBMAP_SECONDARY:
1594 if (ignore_system_lyxrc ||
1595 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1596 string const path = os::external_path(secondary_kbmap);
1597 os << "\\kbmap_secondary \"" << path << "\"\n";
1603 if (ignore_system_lyxrc ||
1604 lyxpipes != system_lyxrc.lyxpipes) {
1605 string const path = os::external_path(lyxpipes);
1606 os << "\\serverpipe \"" << path << "\"\n";
1611 case RC_DATE_INSERT_FORMAT:
1612 if (ignore_system_lyxrc ||
1613 date_insert_format != system_lyxrc.date_insert_format) {
1614 os << "\\date_insert_format \"" << date_insert_format
1621 os << "\\user_name \"" << user_name << "\"\n";
1626 os << "\\user_email \"" << user_email << "\"\n";
1630 case RC_SHOW_BANNER:
1631 if (ignore_system_lyxrc ||
1632 show_banner != system_lyxrc.show_banner) {
1633 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1639 if (ignore_system_lyxrc ||
1640 preview != system_lyxrc.preview) {
1646 case PREVIEW_NO_MATH:
1653 os << "\\preview " << status << '\n';
1658 case RC_PREVIEW_HASHED_LABELS:
1659 if (ignore_system_lyxrc ||
1660 preview_hashed_labels !=
1661 system_lyxrc.preview_hashed_labels) {
1662 os << "\\preview_hashed_labels "
1663 << convert<string>(preview_hashed_labels) << '\n';
1668 case RC_PREVIEW_SCALE_FACTOR:
1669 if (ignore_system_lyxrc ||
1670 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1671 os << "\\preview_scale_factor "
1672 << preview_scale_factor << '\n';
1677 case RC_USE_CONVERTER_CACHE:
1678 if (ignore_system_lyxrc ||
1679 use_converter_cache != system_lyxrc.use_converter_cache) {
1680 os << "\\use_converter_cache "
1681 << convert<string>(use_converter_cache) << '\n';
1686 case RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
1687 if (ignore_system_lyxrc ||
1688 use_converter_needauth_forbidden != system_lyxrc.use_converter_needauth_forbidden) {
1689 os << "\\use_converter_needauth_forbidden "
1690 << convert<string>(use_converter_needauth_forbidden) << '\n';
1695 case RC_USE_CONVERTER_NEEDAUTH:
1696 if (ignore_system_lyxrc ||
1697 use_converter_needauth != system_lyxrc.use_converter_needauth) {
1698 os << "\\use_converter_needauth "
1699 << convert<string>(use_converter_needauth) << '\n';
1704 case RC_CONVERTER_CACHE_MAXAGE:
1705 if (ignore_system_lyxrc ||
1706 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1707 os << "\\converter_cache_maxage "
1708 << converter_cache_maxage << '\n';
1714 << "# SCREEN & FONTS SECTION ############################\n"
1718 if (ignore_system_lyxrc ||
1719 icon_set != system_lyxrc.icon_set) {
1720 os << "\\icon_set \"" << icon_set
1726 case RC_USE_SYSTEM_THEME_ICONS:
1727 if (ignore_system_lyxrc ||
1728 use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
1729 os << "\\use_system_theme_icons "
1730 << convert<string>(use_system_theme_icons)
1737 if (ignore_system_lyxrc ||
1738 dpi != system_lyxrc.dpi) {
1739 os << "\\screen_dpi " << dpi << '\n';
1744 case RC_SCREEN_ZOOM:
1745 if (ignore_system_lyxrc ||
1746 defaultZoom != system_lyxrc.defaultZoom) {
1747 os << "\\screen_zoom " << defaultZoom << '\n';
1752 case RC_GEOMETRY_SESSION:
1753 if (ignore_system_lyxrc ||
1754 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1755 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1761 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1762 if (ignore_system_lyxrc ||
1763 cursor_follows_scrollbar
1764 != system_lyxrc.cursor_follows_scrollbar) {
1765 os << "\\cursor_follows_scrollbar "
1766 << convert<string>(cursor_follows_scrollbar) << '\n';
1771 case RC_CURSOR_WIDTH:
1772 if (ignore_system_lyxrc ||
1774 != system_lyxrc.cursor_width) {
1775 os << "\\cursor_width "
1776 << cursor_width << '\n';
1781 case RC_SCROLL_BELOW_DOCUMENT:
1782 if (ignore_system_lyxrc ||
1783 scroll_below_document
1784 != system_lyxrc.scroll_below_document) {
1785 os << "\\scroll_below_document "
1786 << convert<string>(scroll_below_document) << '\n';
1791 case RC_PARAGRAPH_MARKERS:
1792 if (ignore_system_lyxrc ||
1794 != system_lyxrc.paragraph_markers) {
1795 os << "\\paragraph_markers "
1796 << convert<string>(paragraph_markers) << '\n';
1801 case RC_MAC_DONTSWAP_CTRL_META:
1802 if (ignore_system_lyxrc ||
1803 mac_dontswap_ctrl_meta
1804 != system_lyxrc.mac_dontswap_ctrl_meta) {
1805 os << "\\mac_dontswap_ctrl_meta "
1806 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1811 case RC_MAC_LIKE_CURSOR_MOVEMENT:
1812 if (ignore_system_lyxrc ||
1813 mac_like_cursor_movement
1814 != system_lyxrc.mac_like_cursor_movement) {
1815 os << "\\mac_like_cursor_movement "
1816 << convert<string>(mac_like_cursor_movement) << '\n';
1821 case RC_MACRO_EDIT_STYLE:
1822 if (ignore_system_lyxrc ||
1824 != system_lyxrc.macro_edit_style) {
1825 os << "\\macro_edit_style ";
1826 switch (macro_edit_style) {
1827 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1828 case MACRO_EDIT_INLINE: os << "1\n"; break;
1829 case MACRO_EDIT_LIST: os << "2\n"; break;
1835 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1836 if (ignore_system_lyxrc ||
1837 dialogs_iconify_with_main
1838 != system_lyxrc.dialogs_iconify_with_main) {
1839 os << "\\dialogs_iconify_with_main "
1840 << convert<string>(dialogs_iconify_with_main) << '\n';
1845 case RC_SCREEN_FONT_ROMAN:
1846 if (ignore_system_lyxrc ||
1847 roman_font_name != system_lyxrc.roman_font_name) {
1848 os << "\\screen_font_roman \"" << roman_font_name
1854 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1855 if (ignore_system_lyxrc ||
1856 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1857 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1863 case RC_SCREEN_FONT_SANS:
1864 if (ignore_system_lyxrc ||
1865 sans_font_name != system_lyxrc.sans_font_name) {
1866 os << "\\screen_font_sans \"" << sans_font_name
1872 case RC_SCREEN_FONT_SANS_FOUNDRY:
1873 if (ignore_system_lyxrc ||
1874 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1875 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1881 case RC_SCREEN_FONT_TYPEWRITER:
1882 if (ignore_system_lyxrc ||
1883 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1884 os << "\\screen_font_typewriter \""
1885 << typewriter_font_name << "\"\n";
1890 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1891 if (ignore_system_lyxrc ||
1892 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1893 os << "\\screen_font_typewriter_foundry \""
1894 << typewriter_font_foundry << "\"\n";
1899 case RC_SCREEN_FONT_SCALABLE:
1900 if (ignore_system_lyxrc ||
1901 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1902 os << "\\screen_font_scalable "
1903 << convert<string>(use_scalable_fonts)
1909 case RC_SCREEN_FONT_SIZES:
1910 if (ignore_system_lyxrc ||
1911 font_sizes[FONT_SIZE_TINY]
1912 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1913 font_sizes[FONT_SIZE_SCRIPT]
1914 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1915 font_sizes[FONT_SIZE_FOOTNOTE]
1916 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1917 font_sizes[FONT_SIZE_SMALL]
1918 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1919 font_sizes[FONT_SIZE_NORMAL]
1920 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1921 font_sizes[FONT_SIZE_LARGE]
1922 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1923 font_sizes[FONT_SIZE_LARGER]
1924 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1925 font_sizes[FONT_SIZE_LARGEST]
1926 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1927 font_sizes[FONT_SIZE_HUGE]
1928 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1929 font_sizes[FONT_SIZE_HUGER]
1930 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1931 streamsize old_prec = os.precision();
1932 os.setf(ios::fixed);
1934 os << "\\screen_font_sizes"
1935 << ' ' << font_sizes[FONT_SIZE_TINY]
1936 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1937 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1938 << ' ' << font_sizes[FONT_SIZE_SMALL]
1939 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1940 << ' ' << font_sizes[FONT_SIZE_LARGE]
1941 << ' ' << font_sizes[FONT_SIZE_LARGER]
1942 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1943 << ' ' << font_sizes[FONT_SIZE_HUGE]
1944 << ' ' << font_sizes[FONT_SIZE_HUGER]
1946 os.precision(old_prec);
1947 os.unsetf(ios::fixed);
1952 case RC_FULL_SCREEN_LIMIT:
1953 if (ignore_system_lyxrc ||
1954 full_screen_limit != system_lyxrc.full_screen_limit) {
1955 os << "\\fullscreen_limit "
1956 << convert<string>(full_screen_limit)
1962 case RC_FULL_SCREEN_TOOLBARS:
1963 if (ignore_system_lyxrc ||
1964 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1965 os << "\\fullscreen_toolbars "
1966 << convert<string>(full_screen_toolbars)
1972 case RC_FULL_SCREEN_SCROLLBAR:
1973 if (ignore_system_lyxrc ||
1974 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1975 os << "\\fullscreen_scrollbar "
1976 << convert<string>(full_screen_scrollbar)
1982 case RC_FULL_SCREEN_STATUSBAR:
1983 if (ignore_system_lyxrc ||
1984 full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
1985 os << "\\fullscreen_statusbar "
1986 << convert<string>(full_screen_statusbar)
1992 case RC_FULL_SCREEN_TABBAR:
1993 if (ignore_system_lyxrc ||
1994 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1995 os << "\\fullscreen_tabbar "
1996 << convert<string>(full_screen_tabbar)
2002 case RC_FULL_SCREEN_MENUBAR:
2003 if (ignore_system_lyxrc ||
2004 full_screen_menubar != system_lyxrc.full_screen_menubar) {
2005 os << "\\fullscreen_menubar "
2006 << convert<string>(full_screen_menubar)
2012 case RC_FULL_SCREEN_WIDTH:
2013 if (ignore_system_lyxrc ||
2014 full_screen_width != system_lyxrc.full_screen_width) {
2015 os << "\\fullscreen_width "
2016 << convert<string>(full_screen_width)
2022 case RC_OPEN_BUFFERS_IN_TABS:
2023 if (ignore_system_lyxrc ||
2024 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2025 os << "\\open_buffers_in_tabs "
2026 << convert<string>(open_buffers_in_tabs)
2032 case RC_SINGLE_CLOSE_TAB_BUTTON:
2033 if (ignore_system_lyxrc ||
2034 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2035 os << "\\single_close_tab_button "
2036 << convert<string>(single_close_tab_button)
2042 case RC_SINGLE_INSTANCE:
2043 if (ignore_system_lyxrc ||
2044 single_instance != system_lyxrc.single_instance) {
2045 os << "\\single_instance "
2046 << convert<string>(single_instance)
2052 case RC_FORWARD_SEARCH_DVI:
2053 if (ignore_system_lyxrc ||
2054 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2055 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2060 case RC_FORWARD_SEARCH_PDF:
2061 if (ignore_system_lyxrc ||
2062 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2063 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2069 << "# COLOR SECTION ###################################\n"
2074 for (int i = 0; i < Color_ignore; ++i) {
2075 ColorCode lc = static_cast<ColorCode>(i);
2076 string const col = lcolor.getX11Name(lc);
2077 if (ignore_system_lyxrc
2078 || col != system_lcolor.getX11Name(lc)) {
2079 os << "\\set_color \""
2080 << lcolor.getLyXName(lc) << "\" \""
2088 << "# PRINTER SECTION ###################################\n"
2092 case RC_PRINTLANDSCAPEFLAG:
2093 if (ignore_system_lyxrc ||
2094 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2095 os << "\\print_landscape_flag \"" << print_landscape_flag
2101 case RC_PRINTPAPERFLAG:
2102 if (ignore_system_lyxrc ||
2103 print_paper_flag != system_lyxrc.print_paper_flag) {
2104 os << "\\print_paper_flag \"" << print_paper_flag
2110 case RC_PRINTPAPERDIMENSIONFLAG:
2111 if (ignore_system_lyxrc ||
2112 print_paper_dimension_flag
2113 != system_lyxrc.print_paper_dimension_flag) {
2114 os << "\\print_paper_dimension_flag \""
2115 << print_paper_dimension_flag << "\"\n";
2121 << "# TEX SECTION #######################################\n"
2125 case RC_TEXINPUTS_PREFIX:
2126 if (ignore_system_lyxrc ||
2127 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2128 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2133 case RC_FONT_ENCODING:
2134 if (ignore_system_lyxrc ||
2135 fontenc != system_lyxrc.fontenc) {
2136 os << "\\font_encoding \"" << fontenc << "\"\n";
2142 << "# FILE SECTION ######################################\n"
2146 case RC_DOCUMENTPATH:
2147 if (ignore_system_lyxrc ||
2148 document_path != system_lyxrc.document_path) {
2149 string const path = os::external_path(document_path);
2150 os << "\\document_path \"" << path << "\"\n";
2155 case RC_USELASTFILEPOS:
2156 if (ignore_system_lyxrc ||
2157 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2158 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2164 case RC_LOADSESSION:
2165 if (ignore_system_lyxrc ||
2166 load_session != system_lyxrc.load_session) {
2167 os << "\\load_session " << convert<string>(load_session)
2173 case RC_MOUSE_WHEEL_SPEED:
2174 if (ignore_system_lyxrc ||
2175 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2176 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2181 case RC_MOUSE_MIDDLEBUTTON_PASTE:
2182 if (ignore_system_lyxrc ||
2183 mouse_middlebutton_paste != system_lyxrc.mouse_middlebutton_paste) {
2184 os << "\\mouse_middlebutton_paste "
2185 << convert<string>(mouse_middlebutton_paste) << '\n';
2190 case RC_COMPLETION_INLINE_DELAY:
2191 if (ignore_system_lyxrc ||
2192 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2193 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2198 case RC_COMPLETION_INLINE_MATH:
2199 if (ignore_system_lyxrc ||
2200 completion_inline_math != system_lyxrc.completion_inline_math) {
2201 os << "\\completion_inline_math "
2202 << convert<string>(completion_inline_math) << '\n';
2207 case RC_COMPLETION_INLINE_TEXT:
2208 if (ignore_system_lyxrc ||
2209 completion_inline_text != system_lyxrc.completion_inline_text) {
2210 os << "\\completion_inline_text "
2211 << convert<string>(completion_inline_text) << '\n';
2216 case RC_COMPLETION_INLINE_DOTS:
2217 if (ignore_system_lyxrc ||
2218 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2219 os << "\\completion_inline_dots "
2220 << convert<string>(completion_inline_dots) << '\n';
2225 case RC_AUTOCORRECTION_MATH:
2226 if (ignore_system_lyxrc ||
2227 autocorrection_math != system_lyxrc.autocorrection_math) {
2228 os << "\\autocorrection_math "
2229 << convert<string>(autocorrection_math) << '\n';
2234 case RC_COMPLETION_POPUP_DELAY:
2235 if (ignore_system_lyxrc ||
2236 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2237 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2242 case RC_COMPLETION_POPUP_MATH:
2243 if (ignore_system_lyxrc ||
2244 completion_popup_math != system_lyxrc.completion_popup_math) {
2245 os << "\\completion_popup_math "
2246 << convert<string>(completion_popup_math) << '\n';
2251 case RC_COMPLETION_POPUP_TEXT:
2252 if (ignore_system_lyxrc ||
2253 completion_popup_text != system_lyxrc.completion_popup_text) {
2254 os << "\\completion_popup_text "
2255 << convert<string>(completion_popup_text) << '\n';
2260 case RC_COMPLETION_CURSOR_TEXT:
2261 if (ignore_system_lyxrc ||
2262 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2263 os << "\\completion_cursor_text "
2264 << convert<string>(completion_cursor_text) << '\n';
2269 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2270 if (ignore_system_lyxrc ||
2271 completion_popup_after_complete
2272 != system_lyxrc.completion_popup_after_complete) {
2273 os << "\\completion_popup_after_complete "
2274 << convert<string>(completion_popup_after_complete) << '\n';
2279 case RC_COMPLETION_MINLENGTH:
2280 if (ignore_system_lyxrc ||
2281 completion_minlength != system_lyxrc.completion_minlength) {
2282 os << "\\completion_minlength " << convert<string>(completion_minlength)
2288 case RC_NUMLASTFILES:
2289 if (ignore_system_lyxrc ||
2290 num_lastfiles != system_lyxrc.num_lastfiles) {
2291 os << "\\num_lastfiles " << num_lastfiles << '\n';
2296 case RC_CHECKLASTFILES:
2297 if (ignore_system_lyxrc ||
2298 check_lastfiles != system_lyxrc.check_lastfiles) {
2299 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2305 case RC_EXAMPLEPATH:
2306 if (ignore_system_lyxrc ||
2307 example_path != system_lyxrc.example_path) {
2308 string const path = os::external_path(example_path);
2309 os << "\\example_path \"" << path << "\"\n";
2314 case RC_TEMPLATEPATH:
2315 if (ignore_system_lyxrc ||
2316 template_path != system_lyxrc.template_path) {
2317 string const path = os::external_path(template_path);
2318 os << "\\template_path \"" << path << "\"\n";
2323 case RC_TEMPDIRPATH:
2324 if (ignore_system_lyxrc ||
2325 tempdir_path != system_lyxrc.tempdir_path) {
2326 string const path = os::external_path(tempdir_path);
2327 os << "\\tempdir_path \"" << path << "\"\n";
2332 case RC_THESAURUSDIRPATH:
2333 if (ignore_system_lyxrc ||
2334 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2335 string const path = os::external_path(thesaurusdir_path);
2336 os << "\\thesaurusdir_path \"" << path << "\"\n";
2341 case RC_HUNSPELLDIR_PATH:
2342 if (ignore_system_lyxrc ||
2343 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2344 string const path = os::external_path(hunspelldir_path);
2345 os << "\\hunspelldir_path \"" << path << "\"\n";
2350 case RC_PLAINTEXT_LINELEN:
2351 if (ignore_system_lyxrc ||
2352 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2353 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2358 case RC_MAKE_BACKUP:
2359 if (ignore_system_lyxrc ||
2360 make_backup != system_lyxrc.make_backup) {
2361 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2366 case RC_SAVE_COMPRESSED:
2367 if (ignore_system_lyxrc ||
2368 save_compressed != system_lyxrc.save_compressed) {
2369 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2374 case RC_SAVE_ORIGIN:
2375 if (ignore_system_lyxrc ||
2376 save_origin != system_lyxrc.save_origin) {
2377 os << "\\save_origin " << convert<string>(save_origin) << '\n';
2382 case RC_BACKUPDIR_PATH:
2383 if (ignore_system_lyxrc ||
2384 backupdir_path != system_lyxrc.backupdir_path) {
2385 string const path = os::external_path(backupdir_path);
2386 os << "\\backupdir_path \"" << path << "\"\n";
2392 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2396 << "# SPELLCHECKER SECTION ##############################\n"
2400 case RC_ACCEPT_COMPOUND:
2401 if (ignore_system_lyxrc ||
2402 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2403 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2410 if (ignore_system_lyxrc ||
2411 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2412 os << "\\alternate_language \"" << spellchecker_alt_lang
2419 if (ignore_system_lyxrc ||
2420 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2421 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2426 case RC_USE_NATIVE_FILEDIALOG:
2427 if (ignore_system_lyxrc ||
2428 use_native_filedialog != system_lyxrc.use_native_filedialog) {
2429 os << "\\use_native_filedialog "
2430 << convert<string>(use_native_filedialog)
2436 case RC_USE_SYSTEM_COLORS:
2437 if (ignore_system_lyxrc ||
2438 use_system_colors != system_lyxrc.use_system_colors) {
2439 os << "\\use_system_colors "
2440 << convert<string>(use_system_colors)
2446 case RC_USE_TOOLTIP:
2447 if (ignore_system_lyxrc ||
2448 use_tooltip != system_lyxrc.use_tooltip) {
2449 os << "\\use_tooltip "
2450 << convert<string>(use_tooltip)
2456 case RC_USE_PIXMAP_CACHE:
2457 if (ignore_system_lyxrc ||
2458 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2459 os << "\\use_pixmap_cache "
2460 << convert<string>(use_pixmap_cache)
2467 if (ignore_system_lyxrc ||
2468 use_qimage != system_lyxrc.use_qimage) {
2469 os << "\\use_qimage "
2470 << convert<string>(use_qimage)
2477 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2481 case RC_DEFAULT_DECIMAL_POINT:
2482 if (ignore_system_lyxrc ||
2483 default_decimal_point != system_lyxrc.default_decimal_point) {
2484 os << "\\default_decimal_point " << default_decimal_point << '\n';
2489 case RC_DEFAULT_LENGTH_UNIT:
2490 if (ignore_system_lyxrc ||
2491 default_length_unit != system_lyxrc.default_length_unit) {
2492 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2497 case RC_SPELLCHECKER:
2498 if (ignore_system_lyxrc ||
2499 spellchecker != system_lyxrc.spellchecker) {
2500 os << "\\spellchecker " << spellchecker << '\n';
2505 case RC_SPELLCHECK_CONTINUOUSLY:
2506 if (ignore_system_lyxrc ||
2507 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2508 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2514 case RC_SPELLCHECK_NOTES:
2515 if (ignore_system_lyxrc ||
2516 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2517 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2523 case RC_VISUAL_CURSOR:
2524 if (ignore_system_lyxrc ||
2525 visual_cursor != system_lyxrc.visual_cursor) {
2526 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2531 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2532 if (ignore_system_lyxrc ||
2533 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2534 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2535 os << "\\close_buffer_with_last_view " << close_buffer_with_last_view << '\n';
2540 case RC_LANGUAGE_CUSTOM_PACKAGE:
2541 if (ignore_system_lyxrc ||
2542 language_custom_package != system_lyxrc.language_custom_package) {
2543 os << "\\language_custom_package \"" << language_custom_package
2549 case RC_LANGUAGE_GLOBAL_OPTIONS:
2550 if (ignore_system_lyxrc ||
2551 language_global_options
2552 != system_lyxrc.language_global_options) {
2553 os << "\\language_global_options \""
2554 << convert<string>(language_global_options)
2560 case RC_LANGUAGE_PACKAGE_SELECTION:
2561 if (ignore_system_lyxrc ||
2562 language_package_selection != system_lyxrc.language_package_selection) {
2563 os << "\\language_package_selection ";
2564 switch (language_package_selection) {
2582 case RC_LANGUAGE_COMMAND_BEGIN:
2583 if (ignore_system_lyxrc ||
2584 language_command_begin
2585 != system_lyxrc.language_command_begin) {
2586 os << "\\language_command_begin \""
2587 << language_command_begin
2593 case RC_LANGUAGE_COMMAND_END:
2594 if (ignore_system_lyxrc ||
2595 language_command_end
2596 != system_lyxrc.language_command_end) {
2597 os << "\\language_command_end \"" << language_command_end
2603 case RC_LANGUAGE_COMMAND_LOCAL:
2604 if (ignore_system_lyxrc ||
2605 language_command_local
2606 != system_lyxrc.language_command_local) {
2607 os << "\\language_command_local \""
2608 << language_command_local
2614 case RC_LANGUAGE_AUTO_BEGIN:
2615 if (ignore_system_lyxrc ||
2616 language_auto_begin != system_lyxrc.language_auto_begin) {
2617 os << "\\language_auto_begin "
2618 << convert<string>(language_auto_begin) << '\n';
2623 case RC_LANGUAGE_AUTO_END:
2624 if (ignore_system_lyxrc ||
2625 language_auto_end != system_lyxrc.language_auto_end) {
2626 os << "\\language_auto_end "
2627 << convert<string>(language_auto_end) << '\n';
2632 case RC_MARK_FOREIGN_LANGUAGE:
2633 if (ignore_system_lyxrc ||
2634 mark_foreign_language
2635 != system_lyxrc.mark_foreign_language) {
2636 os << "\\mark_foreign_language " <<
2637 convert<string>(mark_foreign_language) << '\n';
2643 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2647 case RC_AUTO_NUMBER:
2648 if (ignore_system_lyxrc ||
2649 auto_number != system_lyxrc.auto_number) {
2650 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2655 case RC_GUI_LANGUAGE:
2656 if (ignore_system_lyxrc ||
2657 gui_language != system_lyxrc.gui_language) {
2658 os << "\\gui_language " << gui_language << '\n';
2663 case RC_EXPORT_OVERWRITE:
2664 if (ignore_system_lyxrc ||
2665 export_overwrite != system_lyxrc.export_overwrite) {
2667 switch (export_overwrite) {
2678 os << "\\export_overwrite " << status << '\n';
2683 case RC_SCROLL_WHEEL_ZOOM:
2684 if (ignore_system_lyxrc ||
2685 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2687 switch (scroll_wheel_zoom) {
2688 case SCROLL_WHEEL_ZOOM_OFF:
2691 case SCROLL_WHEEL_ZOOM_CTRL:
2694 case SCROLL_WHEEL_ZOOM_SHIFT:
2697 case SCROLL_WHEEL_ZOOM_ALT:
2701 os << "\\scroll_wheel_zoom " << status << '\n';
2707 << "# FORMATS SECTION ##########################\n"
2712 // New/modified formats
2713 for (Formats::const_iterator cit = theFormats().begin();
2714 cit != theFormats().end(); ++cit) {
2715 Format const * format =
2716 theSystemFormats().getFormat(cit->name());
2718 format->extensions() != cit->extensions() ||
2719 format->prettyname() != cit->prettyname() ||
2720 format->shortcut() != cit->shortcut() ||
2721 format->viewer() != cit->viewer() ||
2722 format->editor() != cit->editor() ||
2723 format->documentFormat() != cit->documentFormat() ||
2724 format->vectorFormat() != cit->vectorFormat() ||
2725 format->inExportMenu() != cit->inExportMenu() ||
2726 format->noMenu() != cit->noMenu() ||
2727 format->mime() != cit->mime()) {
2728 os << "\\format \"" << cit->name() << "\" \""
2729 << cit->extensions() << "\" \""
2730 << to_utf8(cit->prettyname()) << "\" \""
2731 << cit->shortcut() << "\" \""
2732 << escapeCommand(cit->viewer()) << "\" \""
2733 << escapeCommand(cit->editor()) << "\" \"";
2734 vector<string> flags;
2735 if (cit->documentFormat())
2736 flags.push_back("document");
2737 if (cit->vectorFormat())
2738 flags.push_back("vector");
2739 if (cit->zippedNative())
2740 flags.push_back("zipped=native");
2741 if (cit->inExportMenu())
2742 flags.push_back("menu=export");
2744 os << getStringFromVector(flags);
2745 os << "\" \"" << cit->mime() << "\"\n";
2749 // Look for deleted formats
2750 for (Formats::const_iterator cit = theSystemFormats().begin();
2751 cit != theSystemFormats().end(); ++cit)
2752 if (!theFormats().getFormat(cit->name()))
2753 os << "\\format \"" << cit->name()
2754 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2758 case RC_VIEWER_ALTERNATIVES: {
2759 Alternatives::const_iterator it = viewer_alternatives.begin();
2760 Alternatives::const_iterator const en = viewer_alternatives.end();
2761 Alternatives::const_iterator const sysend =
2762 system_lyxrc.viewer_alternatives.end();
2763 for (; it != en; ++it) {
2764 string const & fmt = it->first;
2765 CommandSet const & cmd = it->second;
2766 CommandSet::const_iterator sit = cmd.begin();
2767 CommandSet::const_iterator const sen = cmd.end();
2768 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2769 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2770 system_lyxrc.viewer_alternatives.find(fmt);
2771 for (; sit != sen; ++sit) {
2772 string const & cmd = *sit;
2773 if (ignore_system_lyxrc
2774 || sysfmt == sysend // format not found
2775 || sysfmt->second.count(cmd) == 0 // this command not found
2777 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2784 case RC_EDITOR_ALTERNATIVES: {
2785 Alternatives::const_iterator it = editor_alternatives.begin();
2786 Alternatives::const_iterator const en = editor_alternatives.end();
2787 Alternatives::const_iterator const sysend =
2788 system_lyxrc.editor_alternatives.end();
2789 for (; it != en; ++it) {
2790 string const & fmt = it->first;
2791 CommandSet const & cmd = it->second;
2792 CommandSet::const_iterator sit = cmd.begin();
2793 CommandSet::const_iterator const sen = cmd.end();
2794 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2795 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2796 system_lyxrc.editor_alternatives.find(fmt);
2797 for (; sit != sen; ++sit) {
2798 string const & cmd = *sit;
2799 if (ignore_system_lyxrc
2800 || sysfmt == sysend // format not found
2801 || sysfmt->second.count(cmd) == 0 // this command not found
2803 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2810 case RC_DEFAULT_OTF_VIEW_FORMAT:
2811 if ((ignore_system_lyxrc ||
2812 default_otf_view_format != system_lyxrc.default_otf_view_format)
2813 && !default_otf_view_format.empty()) {
2814 os << "\\default_otf_view_format " << default_otf_view_format << '\n';
2819 case RC_DEFAULT_PLATEX_VIEW_FORMAT:
2820 if ((ignore_system_lyxrc ||
2821 default_platex_view_format != system_lyxrc.default_platex_view_format)
2822 && !default_platex_view_format.empty()) {
2823 os << "\\default_platex_view_format " << default_platex_view_format << '\n';
2828 case RC_DEFAULT_VIEW_FORMAT:
2829 if (ignore_system_lyxrc ||
2830 default_view_format != system_lyxrc.default_view_format) {
2831 os << "\\default_view_format " << default_view_format << '\n';
2842 << "# CONVERTERS SECTION ##########################\n"
2847 // Look for new converters
2848 for (Converters::const_iterator cit = theConverters().begin();
2849 cit != theConverters().end(); ++cit) {
2850 Converter const * converter =
2851 theSystemConverters().getConverter(cit->from(),
2854 converter->command() != cit->command() ||
2855 converter->flags() != cit->flags())
2856 os << "\\converter \"" << cit->from() << "\" \""
2857 << cit->to() << "\" \""
2858 << escapeCommand(cit->command()) << "\" \""
2859 << cit->flags() << "\"\n";
2862 // New/modifed converters
2863 for (Converters::const_iterator cit = theSystemConverters().begin();
2864 cit != theSystemConverters().end(); ++cit)
2865 if (!theConverters().getConverter(cit->from(), cit->to()))
2866 os << "\\converter \"" << cit->from()
2867 << "\" \"" << cit->to() << "\" \"\" \"\"\n";
2874 << "# COPIERS SECTION ##########################\n"
2877 // Look for new movers
2878 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2879 Movers::const_iterator const sysend = theSystemMovers().end();
2880 Movers::const_iterator it = theMovers().begin();
2881 Movers::const_iterator end = theMovers().end();
2883 for (; it != end; ++it) {
2884 Movers::const_iterator const sysit =
2885 find_if(sysbegin, sysend, SameMover(*it));
2886 if (sysit == sysend) {
2887 string const & fmt = it->first;
2888 string const & command =
2889 it->second.command();
2891 os << "\\copier " << fmt
2892 << " \"" << escapeCommand(command) << "\"\n";
2898 // We don't actually delete SpecialisedMover(s) from the
2899 // map, just clear their 'command', so there's no need
2900 // to test for anything else.
2907 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2909 // Why the switch you might ask. It is a trick to ensure that all
2910 // the elements in the LyXRCTags enum is handled. As you can see
2911 // there are no breaks at all. So it is just a huge fall-through.
2912 // The nice thing is that we will get a warning from the compiler
2913 // if we forget an element.
2914 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2916 case LyXRC::RC_LAST:
2917 case LyXRC::RC_ACCEPT_COMPOUND:
2918 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2919 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2921 case LyXRC::RC_ALT_LANG:
2922 case LyXRC::RC_PLAINTEXT_LINELEN:
2923 case LyXRC::RC_AUTOCORRECTION_MATH:
2924 case LyXRC::RC_AUTOREGIONDELETE:
2925 case LyXRC::RC_AUTORESET_OPTIONS:
2926 case LyXRC::RC_AUTOSAVE:
2927 case LyXRC::RC_AUTO_NUMBER:
2928 case LyXRC::RC_BACKUPDIR_PATH:
2929 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2930 case LyXRC::RC_BIBTEX_COMMAND:
2931 case LyXRC::RC_BINDFILE:
2932 case LyXRC::RC_CHECKLASTFILES:
2933 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2934 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2935 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2936 case LyXRC::RC_COMPLETION_INLINE_MATH:
2937 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2938 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2939 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2940 case LyXRC::RC_COMPLETION_POPUP_MATH:
2941 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2942 case LyXRC::RC_COMPLETION_MINLENGTH:
2943 case LyXRC::RC_USELASTFILEPOS:
2944 case LyXRC::RC_LOADSESSION:
2945 case LyXRC::RC_CHKTEX_COMMAND:
2946 case LyXRC::RC_CONVERTER:
2947 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2948 case LyXRC::RC_COPIER:
2949 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2950 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2951 case LyXRC::RC_DATE_INSERT_FORMAT:
2952 case LyXRC::RC_GUI_LANGUAGE:
2953 case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
2954 case LyXRC::RC_DEFAULT_PLATEX_VIEW_FORMAT:
2955 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2956 case LyXRC::RC_DEFFILE:
2957 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2958 case LyXRC::RC_DISPLAY_GRAPHICS:
2959 case LyXRC::RC_DOCUMENTPATH:
2960 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2961 FileName path(lyxrc_new.document_path);
2962 if (path.exists() && path.isDirectory())
2963 package().document_dir() = FileName(lyxrc.document_path);
2966 case LyXRC::RC_EDITOR_ALTERNATIVES:
2967 case LyXRC::RC_ESC_CHARS:
2968 case LyXRC::RC_EXAMPLEPATH:
2969 case LyXRC::RC_FONT_ENCODING:
2970 case LyXRC::RC_FILEFORMAT:
2971 case LyXRC::RC_GROUP_LAYOUTS:
2972 case LyXRC::RC_HUNSPELLDIR_PATH:
2973 case LyXRC::RC_ICON_SET:
2974 case LyXRC::RC_INDEX_ALTERNATIVES:
2975 case LyXRC::RC_INDEX_COMMAND:
2976 case LyXRC::RC_JBIBTEX_COMMAND:
2977 case LyXRC::RC_JBIBTEX_ALTERNATIVES:
2978 case LyXRC::RC_JINDEX_COMMAND:
2979 case LyXRC::RC_NOMENCL_COMMAND:
2980 case LyXRC::RC_PYGMENTIZE_COMMAND:
2981 case LyXRC::RC_INPUT:
2982 case LyXRC::RC_KBMAP:
2983 case LyXRC::RC_KBMAP_PRIMARY:
2984 case LyXRC::RC_KBMAP_SECONDARY:
2985 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2986 case LyXRC::RC_LANGUAGE_AUTO_END:
2987 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2988 case LyXRC::RC_LANGUAGE_COMMAND_END:
2989 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2990 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2991 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2992 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2993 case LyXRC::RC_LYXRCFORMAT:
2994 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2995 case LyXRC::RC_MAC_LIKE_CURSOR_MOVEMENT:
2996 case LyXRC::RC_MACRO_EDIT_STYLE:
2997 case LyXRC::RC_MAKE_BACKUP:
2998 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2999 case LyXRC::RC_MOUSE_WHEEL_SPEED:
3000 case LyXRC::RC_MOUSE_MIDDLEBUTTON_PASTE:
3001 case LyXRC::RC_NUMLASTFILES:
3002 case LyXRC::RC_PARAGRAPH_MARKERS:
3003 case LyXRC::RC_PATH_PREFIX:
3004 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
3005 prependEnvPath("PATH", replaceEnvironmentPath(lyxrc_new.path_prefix));
3006 // Resets python path
3007 support::os::python(true);
3010 case LyXRC::RC_PREVIEW:
3011 if (lyxrc_orig.preview != lyxrc_new.preview) {
3012 // Update all previews of all documents.
3013 /* FIXME: this can be very expensive. It would be cheaper
3014 * to kill all existing previews and update visible
3016 theBufferList().updatePreviews();
3019 case LyXRC::RC_PREVIEW_HASHED_LABELS:
3020 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
3021 case LyXRC::RC_PRINTLANDSCAPEFLAG:
3022 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3023 case LyXRC::RC_PRINTPAPERFLAG:
3024 case LyXRC::RC_SAVE_COMPRESSED:
3025 case LyXRC::RC_SAVE_ORIGIN:
3026 case LyXRC::RC_SCREEN_DPI:
3028 case LyXRC::RC_SCREEN_FONT_ROMAN:
3029 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3030 case LyXRC::RC_SCREEN_FONT_SANS:
3031 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3032 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3033 case LyXRC::RC_SCREEN_FONT_SIZES:
3034 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3035 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3036 case LyXRC::RC_SCREEN_ZOOM:
3037 if (lyxrc_orig.roman_font_name != lyxrc_new.roman_font_name
3038 || lyxrc_orig.sans_font_name != lyxrc_new.sans_font_name
3039 || lyxrc_orig.typewriter_font_name != lyxrc_new.typewriter_font_name
3040 || lyxrc_orig.roman_font_foundry != lyxrc_new.roman_font_foundry
3041 || lyxrc_orig.sans_font_foundry != lyxrc_new.sans_font_foundry
3042 || lyxrc_orig.use_scalable_fonts != lyxrc_new.use_scalable_fonts
3043 || lyxrc_orig.font_sizes != lyxrc_new.font_sizes
3044 || lyxrc_orig.typewriter_font_foundry != lyxrc_new.typewriter_font_foundry
3045 || lyxrc_orig.defaultZoom != lyxrc_new.defaultZoom) {
3046 dispatch(FuncRequest(LFUN_SCREEN_FONT_UPDATE));
3049 case LyXRC::RC_GEOMETRY_SESSION:
3050 case LyXRC::RC_SERVERPIPE:
3051 case LyXRC::RC_SET_COLOR:
3052 case LyXRC::RC_SHOW_BANNER:
3053 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3054 case LyXRC::RC_SPELLCHECKER:
3055 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3058 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3059 case LyXRC::RC_SPELLCHECK_NOTES:
3060 case LyXRC::RC_SPLITINDEX_COMMAND:
3061 case LyXRC::RC_TEMPDIRPATH:
3062 case LyXRC::RC_TEMPLATEPATH:
3063 case LyXRC::RC_TEX_ALLOWS_SPACES:
3064 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3065 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3066 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3069 case LyXRC::RC_TEXINPUTS_PREFIX:
3070 case LyXRC::RC_THESAURUSDIRPATH:
3071 case LyXRC::RC_UIFILE:
3072 case LyXRC::RC_USER_EMAIL:
3073 case LyXRC::RC_USER_NAME:
3074 case LyXRC::RC_USE_CONVERTER_CACHE:
3075 case LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN:
3076 case LyXRC::RC_USE_CONVERTER_NEEDAUTH:
3077 case LyXRC::RC_USE_NATIVE_FILEDIALOG:
3078 case LyXRC::RC_USE_SYSTEM_COLORS:
3079 case LyXRC::RC_USE_TOOLTIP:
3080 case LyXRC::RC_USE_PIXMAP_CACHE:
3081 case LyXRC::RC_USE_QIMAGE:
3082 case LyXRC::RC_USE_SYSTEM_THEME_ICONS:
3083 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3084 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3085 case LyXRC::RC_SINGLE_INSTANCE:
3086 case LyXRC::RC_SORT_LAYOUTS:
3087 case LyXRC::RC_FULL_SCREEN_LIMIT:
3088 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3089 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3090 case LyXRC::RC_FULL_SCREEN_STATUSBAR:
3091 case LyXRC::RC_FULL_SCREEN_TABBAR:
3092 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3093 case LyXRC::RC_FULL_SCREEN_WIDTH:
3094 case LyXRC::RC_VISUAL_CURSOR:
3095 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3096 case LyXRC::RC_VIEWER:
3097 case LyXRC::RC_VIEWER_ALTERNATIVES:
3098 case LyXRC::RC_FORWARD_SEARCH_DVI:
3099 case LyXRC::RC_FORWARD_SEARCH_PDF:
3100 case LyXRC::RC_EXPORT_OVERWRITE:
3101 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3102 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3103 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3104 case LyXRC::RC_CURSOR_WIDTH:
3111 string const LyXRC::getDescription(LyXRCTags tag)
3116 case RC_ACCEPT_COMPOUND:
3117 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3121 str = _("Specify an alternate language. The default is to use the language of the document.");
3124 case RC_PLAINTEXT_LINELEN:
3125 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.");
3128 case RC_AUTOREGIONDELETE:
3129 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3132 case RC_AUTORESET_OPTIONS:
3133 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3137 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3140 case RC_AUTO_NUMBER:
3143 case RC_BACKUPDIR_PATH:
3144 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.");
3147 case RC_BIBTEX_COMMAND:
3148 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3151 case RC_JBIBTEX_COMMAND:
3152 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3156 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3159 case RC_CHECKLASTFILES:
3160 str = _("Select to check whether the lastfiles still exist.");
3163 case RC_CHKTEX_COMMAND:
3164 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3170 case RC_CONVERTER_NEEDAUTH_FORBIDDEN:
3171 str = _("Forbid use of external converters with 'needauth' option to prevent undesired effects.");
3174 case RC_CONVERTER_NEEDAUTH:
3175 str = _("Ask user before calling external converters with 'needauth' option to prevent undesired effects.");
3181 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3182 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.");
3185 case RC_CURSOR_WIDTH:
3186 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3189 case RC_SCROLL_BELOW_DOCUMENT:
3190 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");
3193 case RC_MAC_DONTSWAP_CTRL_META:
3194 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3197 case RC_MAC_LIKE_CURSOR_MOVEMENT:
3198 str = _("Use the Mac OS X conventions for cursor movement");
3201 case RC_SHOW_MACRO_LABEL:
3202 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3205 case RC_DATE_INSERT_FORMAT:
3206 //xgettext:no-c-format
3207 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3211 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3214 case RC_DEFAULT_OTF_VIEW_FORMAT:
3215 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
3218 case RC_DEFAULT_VIEW_FORMAT:
3219 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3222 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3223 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3226 case RC_DISPLAY_GRAPHICS:
3227 str = _("Select how LyX will display any graphics.");
3230 case RC_DOCUMENTPATH:
3231 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3235 str = _("Specify additional chars that can be part of a word.");
3238 case RC_EXAMPLEPATH:
3239 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3242 case RC_FONT_ENCODING:
3243 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3249 case RC_INDEX_COMMAND:
3250 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\".");
3253 case RC_JINDEX_COMMAND:
3254 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3257 case RC_NOMENCL_COMMAND:
3258 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3261 case RC_PYGMENTIZE_COMMAND:
3262 str = _("The command to run the python pygments syntax highlighter.");
3269 case RC_KBMAP_PRIMARY:
3270 case RC_KBMAP_SECONDARY:
3271 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.");
3274 case RC_LANGUAGE_AUTO_BEGIN:
3275 str = _("Select if a language switching command is needed at the beginning of the document.");
3278 case RC_LANGUAGE_AUTO_END:
3279 str = _("Select if a language switching command is needed at the end of the document.");
3282 case RC_LANGUAGE_COMMAND_BEGIN:
3283 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.");
3286 case RC_LANGUAGE_COMMAND_END:
3287 str = _("The LaTeX command for changing back to the language of the document.");
3290 case RC_LANGUAGE_COMMAND_LOCAL:
3291 str = _("The LaTeX command for local changing of the language.");
3294 case RC_LANGUAGE_GLOBAL_OPTIONS:
3295 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3298 case RC_LANGUAGE_CUSTOM_PACKAGE:
3299 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3302 case RC_LANGUAGE_PACKAGE_SELECTION:
3303 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3306 case RC_USELASTFILEPOS:
3307 str = _("De-select if you do not want LyX to scroll to saved position.");
3310 case RC_LOADSESSION:
3311 str = _("De-select to prevent loading files opened from the last LyX session.");
3314 case RC_MAKE_BACKUP:
3315 str = _("De-select if you don't want LyX to create backup files.");
3318 case RC_MARK_FOREIGN_LANGUAGE:
3319 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3322 case RC_MOUSE_WHEEL_SPEED:
3323 str = _("The scrolling speed of the mouse wheel.");
3326 case RC_COMPLETION_POPUP_DELAY:
3327 str = _("The completion popup delay.");
3330 case RC_COMPLETION_POPUP_MATH:
3331 str = _("Select to display the completion popup in math mode.");
3334 case RC_COMPLETION_POPUP_TEXT:
3335 str = _("Select to display the completion popup in text mode.");
3338 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3339 str = _("Show the completion popup without delay after non-unique completion attempt.");
3342 case RC_COMPLETION_POPUP_TEXT:
3343 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3346 case RC_COMPLETION_POPUP_DELAY:
3347 str = _("The inline completion delay.");
3350 case RC_COMPLETION_INLINE_MATH:
3351 str = _("Select to display the inline completion in math mode.");
3354 case RC_COMPLETION_INLINE_TEXT:
3355 str = _("Select to display the inline completion in text mode.");
3358 case RC_COMPLETION_INLINE_DOTS:
3359 str = _("Use \"...\" to shorten long completions.");
3362 case RC_AUTOCORRECTION_MATH:
3363 str = _("Allow TeXMacs shorthand, like => converting to \\Rightarrow.");
3366 case RC_NUMLASTFILES:
3367 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3371 case RC_PATH_PREFIX:
3372 str = _("Specify those directories which should be "
3373 "prepended to the PATH environment variable.\n"
3374 "Use the OS native format.");
3378 str = _("Shows a typeset preview of things such as math");
3381 case RC_PREVIEW_HASHED_LABELS:
3382 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3385 case RC_PREVIEW_SCALE_FACTOR:
3386 str = _("Scale the preview size to suit.");
3389 case RC_PRINTLANDSCAPEFLAG:
3390 str = _("The option to print out in landscape.");
3393 case RC_PRINTPAPERDIMENSIONFLAG:
3394 str = _("Option to specify the dimensions of the print paper.");
3397 case RC_PRINTPAPERFLAG:
3398 str = _("The option to specify paper type.");
3401 case RC_VISUAL_CURSOR:
3402 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3405 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3406 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).");
3410 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3413 case RC_SCREEN_FONT_ROMAN:
3414 case RC_SCREEN_FONT_SANS:
3415 case RC_SCREEN_FONT_TYPEWRITER:
3416 str = _("The screen fonts used to display the text while editing.");
3419 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3420 case RC_SCREEN_FONT_SANS_FOUNDRY:
3421 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3424 case RC_SCREEN_FONT_SCALABLE:
3425 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.");
3428 case RC_SCREEN_FONT_SIZES:
3429 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3432 case RC_SCREEN_ZOOM:
3433 //xgettext:no-c-format
3434 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3437 case RC_GEOMETRY_SESSION:
3438 str = _("Allow session manager to save and restore windows geometry.");
3442 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3448 case RC_SHOW_BANNER:
3449 str = _("De-select if you don't want the startup banner.");
3452 case RC_TEMPDIRPATH:
3453 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3456 case RC_THESAURUSDIRPATH:
3457 str = _("This is the place where the files of the thesaurus library reside.");
3460 case RC_TEMPLATEPATH:
3461 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3464 case RC_TEX_ALLOWS_SPACES:
3467 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3470 case RC_TEXINPUTS_PREFIX:
3471 str = _("Specify those directories which should be "
3472 "prepended to the TEXINPUTS environment variable.\n"
3473 "A '.' represents the current document directory. "
3474 "Use the OS native format.");
3478 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3487 case RC_USE_USE_SYSTEM_COLORS:
3488 str = _("Enable use the system colors for some things like main window background and selection.");
3491 case RC_USE_TOOLTIP:
3492 str = _("Enable the automatic appearance of tool tips in the work area.");
3495 case RC_USE_PIXMAP_CACHE:
3496 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3499 case RC_VIEWDVI_PAPEROPTION:
3500 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3515 // The global instance
3518 // The global copy of the system lyxrc entries (everything except preferences)