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.
22 #include "Converter.h"
23 #include "FontEnums.h"
29 #include "SpellChecker.h"
32 #include "graphics/GraphicsTypes.h"
34 #include "support/convert.h"
35 #include "support/debug.h"
36 #include "support/environment.h"
37 #include "support/FileName.h"
38 #include "support/filetools.h"
39 #include "support/gettext.h"
40 #include "support/lstrings.h"
41 #include "support/os.h"
42 #include "support/Package.h"
43 #include "support/userinfo.h"
50 using namespace lyx::support;
54 namespace os = support::os;
58 static unsigned int const LYXRC_FILEFORMAT = 10; // tommaso: new prefs option: close_buffer_with_last_view
60 // when adding something to this array keep it sorted!
61 LexerKeyword lyxrcTags[] = {
62 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
63 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
64 { "\\alternate_language", LyXRC::RC_ALT_LANG },
65 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
66 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
67 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
68 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
69 { "\\autosave", LyXRC::RC_AUTOSAVE },
70 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
71 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
72 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
73 { "\\bind_file", LyXRC::RC_BINDFILE },
74 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
75 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
76 { "\\close_buffer_with_last_view", LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW },
77 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
78 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
79 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
80 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
81 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
82 { "\\completion_minlength", LyXRC::RC_COMPLETION_MINLENGTH },
83 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
84 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
85 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
86 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
87 { "\\converter", LyXRC::RC_CONVERTER },
88 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
89 { "\\copier", LyXRC::RC_COPIER },
90 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
91 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
92 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
93 { "\\def_file", LyXRC::RC_DEFFILE },
94 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
95 { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
96 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
97 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
98 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
99 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
100 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
101 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
102 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
103 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
104 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
105 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
106 { "\\format", LyXRC::RC_FILEFORMAT },
107 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
108 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
109 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
110 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
111 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
112 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
113 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
114 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
115 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
116 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
117 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
118 { "\\icon_set", LyXRC::RC_ICON_SET },
119 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
120 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
121 { "\\input", LyXRC::RC_INPUT },
122 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
123 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
124 { "\\kbmap", LyXRC::RC_KBMAP },
125 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
126 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
127 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
128 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
129 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
130 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
131 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
132 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
133 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
134 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
135 { "\\load_session", LyXRC::RC_LOADSESSION },
136 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
137 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
138 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
139 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
140 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
141 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
142 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
143 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
144 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
145 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
146 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
147 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
148 { "\\preview", LyXRC::RC_PREVIEW },
149 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
150 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
151 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
152 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
153 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
154 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
155 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
156 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
157 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
158 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
159 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
160 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
161 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
162 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
163 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
164 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
165 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
166 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
167 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
168 { "\\printer", LyXRC::RC_PRINTER },
169 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
170 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
171 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
172 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
173 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
174 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
175 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
176 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
177 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
178 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
179 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
180 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
181 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
182 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
183 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
184 { "\\set_color", LyXRC::RC_SET_COLOR },
185 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
186 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
187 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
188 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
189 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
190 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
191 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
192 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
193 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
194 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
195 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
196 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
197 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
198 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
199 { "\\ui_file", LyXRC::RC_UIFILE },
200 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
201 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
202 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
203 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
204 // compatibility with versions older than 1.4.0 only
205 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
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()
232 def_file = "default";
234 // The current document directory
235 texinputs_prefix = ".";
236 // Get printer from the environment. If fail, use default "",
237 // assuming that everything is set up correctly.
238 printer = getEnv("PRINTER");
239 print_adapt_output = false;
240 print_command = "dvips";
241 print_evenpage_flag = "-B";
242 print_oddpage_flag = "-A";
243 print_pagerange_flag = "-pp";
244 print_copies_flag = "-c";
245 print_collcopies_flag = "-C";
246 print_reverse_flag = "-r";
247 print_landscape_flag = "-t landscape";
248 print_to_printer = "-P";
249 print_to_file = "-o ";
250 print_file_extension = ".ps";
251 print_paper_flag = "-t";
252 print_paper_dimension_flag = "-T";
253 document_path.erase();
254 view_dvi_paper_option.erase();
255 default_view_format = "pdf2";
256 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
257 bibtex_command = "bibtex";
259 index_command = "makeindex -c -q";
260 nomencl_command = "makeindex -s nomencl.ist";
262 // Because a screen is typically wider than a piece of paper:
264 allow_geometry_session = true;
265 // Default LaTeX font size:
266 font_sizes[FONT_SIZE_TINY] = "5.0";
267 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
268 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
269 font_sizes[FONT_SIZE_SMALL] = "9.0";
270 font_sizes[FONT_SIZE_NORMAL] = "10.0";
271 font_sizes[FONT_SIZE_LARGE] = "12.0";
272 font_sizes[FONT_SIZE_LARGER] = "14.4";
273 font_sizes[FONT_SIZE_LARGEST] = "17.26";
274 font_sizes[FONT_SIZE_HUGE] = "20.74";
275 font_sizes[FONT_SIZE_HUGER] = "24.88";
276 use_scalable_fonts = true;
277 roman_font_name = "";
279 typewriter_font_name = "";
281 auto_region_delete = true;
282 auto_reset_options = false;
283 plaintext_linelen = 65;
284 mouse_wheel_speed = 1.0;
285 num_lastfiles = maxlastfiles;
286 check_lastfiles = true;
287 use_lastfilepos = true;
288 load_session = false;
290 save_compressed = false;
291 backupdir_path.erase();
292 display_graphics = true;
293 // Spellchecker settings:
294 // FIXME: this check should test the target platform (darwin)
295 #if defined(USE_MACOSX_PACKAGING)
296 spellchecker = "native";
297 #elif defined(USE_ASPELL)
298 spellchecker = "aspell";
299 #elif defined(USE_HUNSPELL)
300 spellchecker = "hunspell";
302 spellchecker = "aspell";
304 spellchecker_accept_compound = false;
305 spellcheck_continuously = false;
306 completion_minlength = 6;
307 spellcheck_notes = true;
310 visual_cursor = false;
312 mark_foreign_language = true;
313 language_auto_begin = true;
314 language_auto_end = true;
315 language_global_options = true;
316 language_package_selection = LP_AUTO;
317 language_custom_package = "\\usepackage{babel}";
318 language_command_begin = "\\selectlanguage{$$lang}";
319 language_command_local = "\\foreignlanguage{$$lang}{";
320 sort_layouts = false;
321 group_layouts = true;
322 gui_language = "auto";
324 windows_style_tex_paths = false;
325 tex_allows_spaces = false;
326 date_insert_format = "%x";
327 cursor_follows_scrollbar = false;
328 scroll_below_document = false;
329 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
330 paragraph_markers = false;
331 mac_dontswap_ctrl_meta = false;
332 mac_like_word_movement = false;
333 macro_edit_style = MACRO_EDIT_INLINE_BOX;
334 dialogs_iconify_with_main = false;
335 preview = PREVIEW_OFF;
336 preview_hashed_labels = false;
337 preview_scale_factor = 1.0;
338 use_converter_cache = true;
339 use_system_colors = false;
341 use_pixmap_cache = false;
343 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
344 user_name = to_utf8(support::user_name());
345 user_email = to_utf8(support::user_email());
346 open_buffers_in_tabs = true;
347 single_close_tab_button = false;
348 single_instance = true;
349 forward_search_dvi = string();
350 forward_search_pdf = string();
351 export_overwrite = NO_FILES;
353 // Fullscreen settings
354 full_screen_limit = false;
355 full_screen_toolbars = true;
356 full_screen_tabbar = true;
357 full_screen_menubar = true;
358 full_screen_scrollbar = true;
359 full_screen_width = 700;
361 completion_cursor_text = true;
362 completion_popup_math = true;
363 completion_popup_text = false;
364 completion_popup_delay = 2.0;
365 completion_popup_after_complete = true;
366 autocorrection_math = false;
367 completion_inline_math = true;
368 completion_inline_text = false;
369 completion_inline_dots = -1;
370 completion_inline_delay = 0.2;
371 default_decimal_point = ".";
372 default_length_unit = Length::CM;
374 close_buffer_with_last_view = "yes";
380 void oldFontFormat(string & family, string & foundry)
382 if (family.empty() || family[0] != '-')
384 foundry = token(family, '-', 1);
385 family = token(family, '-', 2);
393 bool LyXRC::read(FileName const & filename, bool check_format)
395 Lexer lexrc(lyxrcTags);
396 lexrc.setFile(filename);
397 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
398 ReturnValues retval = read(lexrc, check_format);
399 if (!check_format || retval != FormatMismatch)
400 return retval == ReadOK;
402 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
403 FileName const tempfile = FileName::tempName("convert_lyxrc");
404 bool const success = prefs2prefs(filename, tempfile, false);
406 LYXERR0 ("Unable to convert " << filename.absFileName() <<
407 " to format " << LYXRC_FILEFORMAT);
410 // Keep this in the else branch, such that lexrc2 goes out
411 // of scope and releases the lock on tempfile before we
412 // attempt to remove it. This matters on Windows.
413 Lexer lexrc2(lyxrcTags);
414 lexrc2.setFile(tempfile);
415 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
416 retval = read(lexrc2, check_format);
418 tempfile.removeFile();
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 // default for current rowpainter capabilities
443 force_paint_single_char = true;
445 // format prior to 2.0 and introduction of format tag
446 unsigned int format = 0;
448 while (lexrc.isOK()) {
449 // By using two switches we take advantage of the compiler
450 // telling us if we have missed a LyXRCTags element in
451 // the second switch.
452 // Note that this also shows a problem with Lexer since it
453 // helps us avoid taking advantage of the strictness of the
456 int le = lexrc.lex();
458 case Lexer::LEX_UNDEF:
459 lexrc.printError("Unknown tag `$$Token'");
461 case Lexer::LEX_FEOF:
466 switch (static_cast<LyXRCTags>(le)) {
469 format = lexrc.getInteger();
471 case RC_INPUT: // Include file
474 libFileSearch(string(),
476 if (read(tmp, check_format)) {
478 "Error reading included file: " + tmp.absFileName());
484 bind_file = os::internal_path(lexrc.getString());
489 def_file = os::internal_path(lexrc.getString());
494 ui_file = os::internal_path(lexrc.getString());
497 case RC_AUTORESET_OPTIONS:
498 lexrc >> auto_reset_options;
501 case RC_DISPLAY_GRAPHICS:
503 display_graphics = lexrc.getString() == "true";
506 case RC_TEX_EXPECTS_WINDOWS_PATHS:
507 lexrc >> windows_style_tex_paths;
510 case RC_TEX_ALLOWS_SPACES:
511 lexrc >> tex_allows_spaces;
514 case RC_TEXINPUTS_PREFIX:
515 lexrc >> texinputs_prefix;
522 case RC_KBMAP_PRIMARY:
524 string const kmap(os::internal_path(lexrc.getString()));
525 if (!libFileSearch("kbd", kmap, "kmap").empty()
527 primary_kbmap = kmap;
529 lexrc.printError("LyX: Keymap `$$Token' not found");
534 case RC_KBMAP_SECONDARY:
536 string const kmap(os::internal_path(lexrc.getString()));
537 if (!libFileSearch("kbd", kmap, "kmap").empty()
539 secondary_kbmap = kmap;
541 lexrc.printError("LyX: Keymap `$$Token' not found");
546 case RC_FONT_ENCODING:
550 case RC_FORCE_PAINT_SINGLE_CHAR:
551 lexrc >> force_paint_single_char;
558 case RC_PRINT_COMMAND:
559 if (lexrc.next(true)) {
560 print_command = lexrc.getString();
564 case RC_PRINTEVENPAGEFLAG:
565 lexrc >> print_evenpage_flag;
568 case RC_PRINTODDPAGEFLAG:
569 lexrc >> print_oddpage_flag;
572 case RC_PRINTPAGERANGEFLAG:
573 lexrc >> print_pagerange_flag;
576 case RC_PRINTCOPIESFLAG:
577 lexrc >> print_copies_flag;
580 case RC_PRINTCOLLCOPIESFLAG:
581 lexrc >> print_collcopies_flag;
584 case RC_PRINTREVERSEFLAG:
585 lexrc >> print_reverse_flag;
588 case RC_PRINTLANDSCAPEFLAG:
589 lexrc >> print_landscape_flag;
592 case RC_PRINTTOPRINTER:
593 lexrc >> print_to_printer;
596 case RC_PRINT_ADAPTOUTPUT:
597 lexrc >> print_adapt_output;
602 print_to_file = os::internal_path(lexrc.getString());
606 case RC_PRINTFILEEXTENSION:
607 lexrc >> print_file_extension;
610 case RC_PRINTEXSTRAOPTIONS:
611 lexrc >> print_extra_options;
614 case RC_PRINTSPOOL_COMMAND:
615 if (lexrc.next(true)) {
616 print_spool_command = lexrc.getString();
620 case RC_PRINTSPOOL_PRINTERPREFIX:
621 lexrc >> print_spool_printerprefix;
624 case RC_PRINTPAPERDIMENSIONFLAG:
625 lexrc >> print_paper_dimension_flag;
628 case RC_PRINTPAPERFLAG:
629 lexrc >> print_paper_flag;
632 case RC_VIEWDVI_PAPEROPTION:
634 view_dvi_paper_option = lexrc.getString();
636 view_dvi_paper_option.erase();
639 case RC_CHKTEX_COMMAND:
640 if (lexrc.next(true)) {
641 chktex_command = lexrc.getString();
645 case RC_BIBTEX_ALTERNATIVES:
646 if (lexrc.next(true)) {
647 bibtex_alternatives.insert(lexrc.getString());
651 case RC_BIBTEX_COMMAND:
652 if (lexrc.next(true)) {
653 bibtex_command = lexrc.getString();
657 case RC_JBIBTEX_COMMAND:
658 if (lexrc.next(true)) {
659 jbibtex_command = lexrc.getString();
663 case RC_INDEX_ALTERNATIVES:
664 if (lexrc.next(true)) {
665 index_alternatives.insert(lexrc.getString());
669 case RC_INDEX_COMMAND:
670 if (lexrc.next(true)) {
671 index_command = lexrc.getString();
675 case RC_JINDEX_COMMAND:
676 if (lexrc.next(true)) {
677 jindex_command = lexrc.getString();
681 case RC_SPLITINDEX_COMMAND:
682 if (lexrc.next(true)) {
683 splitindex_command = lexrc.getString();
687 case RC_NOMENCL_COMMAND:
688 if (lexrc.next(true)) {
689 nomencl_command = lexrc.getString();
701 case RC_GEOMETRY_SESSION:
702 lexrc >> allow_geometry_session;
705 case RC_SCREEN_FONT_SIZES:
706 lexrc >> font_sizes[FONT_SIZE_TINY];
707 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
708 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
709 lexrc >> font_sizes[FONT_SIZE_SMALL];
710 lexrc >> font_sizes[FONT_SIZE_NORMAL];
711 lexrc >> font_sizes[FONT_SIZE_LARGE];
712 lexrc >> font_sizes[FONT_SIZE_LARGER];
713 lexrc >> font_sizes[FONT_SIZE_LARGEST];
714 lexrc >> font_sizes[FONT_SIZE_HUGE];
715 lexrc >> font_sizes[FONT_SIZE_HUGER];
718 case RC_SCREEN_FONT_SCALABLE:
719 lexrc >> use_scalable_fonts;
726 case RC_DOCUMENTPATH:
728 document_path = os::internal_path(lexrc.getString());
729 document_path = expandPath(document_path);
735 example_path = os::internal_path(lexrc.getString());
736 example_path = expandPath(example_path);
740 case RC_TEMPLATEPATH:
742 template_path = os::internal_path(lexrc.getString());
743 template_path = expandPath(template_path);
749 tempdir_path = os::internal_path(lexrc.getString());
750 tempdir_path = expandPath(tempdir_path);
754 case RC_THESAURUSDIRPATH:
756 thesaurusdir_path = os::internal_path(lexrc.getString());
757 thesaurusdir_path = expandPath(thesaurusdir_path);
761 case RC_HUNSPELLDIR_PATH:
763 hunspelldir_path = os::internal_path(lexrc.getString());
764 hunspelldir_path = expandPath(hunspelldir_path);
768 case RC_USELASTFILEPOS:
769 lexrc >> use_lastfilepos;
773 lexrc >> load_session;
776 case RC_MOUSE_WHEEL_SPEED:
777 lexrc >> mouse_wheel_speed;
780 case RC_COMPLETION_INLINE_DELAY:
781 lexrc >> completion_inline_delay;
784 case RC_COMPLETION_INLINE_MATH:
785 lexrc >> completion_inline_math;
788 case RC_COMPLETION_INLINE_TEXT:
789 lexrc >> completion_inline_text;
792 case RC_COMPLETION_INLINE_DOTS:
793 lexrc >> completion_inline_dots;
796 case RC_AUTOCORRECTION_MATH:
797 lexrc >> autocorrection_math;
800 case RC_COMPLETION_POPUP_DELAY:
801 lexrc >> completion_popup_delay;
804 case RC_COMPLETION_POPUP_MATH:
805 lexrc >> completion_popup_math;
808 case RC_COMPLETION_POPUP_TEXT:
809 lexrc >> completion_popup_text;
812 case RC_COMPLETION_CURSOR_TEXT:
813 lexrc >> completion_cursor_text;
816 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
817 lexrc >> completion_popup_after_complete;
820 case RC_COMPLETION_MINLENGTH:
821 lexrc >> completion_minlength;
824 case RC_NUMLASTFILES:
825 lexrc >> num_lastfiles;
828 case RC_CHECKLASTFILES:
829 lexrc >> check_lastfiles;
836 case RC_SCREEN_FONT_ROMAN:
838 roman_font_name = lexrc.getString();
839 oldFontFormat(roman_font_name,
844 case RC_SCREEN_FONT_SANS:
846 sans_font_name = lexrc.getString();
847 oldFontFormat(sans_font_name, sans_font_foundry);
851 case RC_SCREEN_FONT_TYPEWRITER:
853 typewriter_font_name = lexrc.getString();
854 oldFontFormat(typewriter_font_name,
855 typewriter_font_foundry);
859 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
860 lexrc >> roman_font_foundry;
863 case RC_SCREEN_FONT_SANS_FOUNDRY:
864 lexrc >> sans_font_foundry;
867 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
868 lexrc >> typewriter_font_foundry;
873 lexrc.printError("Missing color tag.");
876 string lyx_name = lexrc.getString();
879 lexrc.printError("Missing color name for color: `$$Token'");
882 string x11_name = lexrc.getString();
884 ColorCode const col =
885 lcolor.getFromLyXName(lyx_name);
886 if (col == Color_none ||
887 col == Color_inherit ||
891 if (!lcolor.setColor(col, x11_name))
892 LYXERR0("Bad lyxrc set_color for " << lyx_name);
896 case RC_AUTOREGIONDELETE:
897 // Auto region delete defaults to true
898 lexrc >> auto_region_delete;
903 lyxpipes = os::internal_path(lexrc.getString());
904 lyxpipes = expandPath(lyxpipes);
908 case RC_CURSOR_FOLLOWS_SCROLLBAR:
909 lexrc >> cursor_follows_scrollbar;
912 case RC_CURSOR_WIDTH:
913 lexrc >> cursor_width;
916 case RC_SCROLL_BELOW_DOCUMENT:
917 lexrc >> scroll_below_document;
920 case RC_PARAGRAPH_MARKERS:
921 lexrc >> paragraph_markers;
924 case RC_MAC_DONTSWAP_CTRL_META:
925 lexrc >> mac_dontswap_ctrl_meta;
928 case RC_MAC_LIKE_WORD_MOVEMENT:
929 lexrc >> mac_like_word_movement;
932 case RC_MACRO_EDIT_STYLE:
934 switch (lexrc.getInteger()) {
935 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
936 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
937 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
942 case RC_DIALOGS_ICONIFY_WITH_MAIN:
943 lexrc >> dialogs_iconify_with_main;
946 case RC_PLAINTEXT_LINELEN:
947 lexrc >> plaintext_linelen;
949 // Spellchecker settings:
950 case RC_ACCEPT_COMPOUND:
951 lexrc >> spellchecker_accept_compound;
953 case RC_USE_SYSTEM_COLORS:
954 lexrc >> use_system_colors;
957 lexrc >> use_tooltip;
959 case RC_USE_PIXMAP_CACHE:
960 lexrc >> use_pixmap_cache;
965 case RC_SPELLCHECKER:
966 lexrc >> spellchecker;
969 lexrc >> spellchecker_alt_lang;
972 lexrc >> spellchecker_esc_chars;
974 case RC_SPELLCHECK_CONTINUOUSLY:
975 lexrc >> spellcheck_continuously;
977 case RC_SPELLCHECK_NOTES:
978 lexrc >> spellcheck_notes;
981 lexrc >> make_backup;
983 case RC_SAVE_COMPRESSED:
984 lexrc >> save_compressed;
986 case RC_BACKUPDIR_PATH:
988 backupdir_path = os::internal_path(lexrc.getString());
989 backupdir_path = expandPath(backupdir_path);
992 case RC_DEFAULT_DECIMAL_POINT:
993 lexrc >> default_decimal_point;
995 case RC_DEFAULT_LENGTH_UNIT:
997 default_length_unit = (Length::UNIT) lexrc.getInteger();
999 case RC_DATE_INSERT_FORMAT:
1000 lexrc >> date_insert_format;
1002 case RC_LANGUAGE_CUSTOM_PACKAGE:
1003 lexrc >> language_custom_package;
1005 case RC_LANGUAGE_AUTO_BEGIN:
1006 lexrc >> language_auto_begin;
1008 case RC_LANGUAGE_AUTO_END:
1009 lexrc >> language_auto_end;
1011 case RC_LANGUAGE_GLOBAL_OPTIONS:
1012 lexrc >> language_global_options;
1014 case RC_LANGUAGE_PACKAGE_SELECTION:
1016 switch (lexrc.getInteger()) {
1018 language_package_selection = LP_AUTO;
1021 language_package_selection = LP_BABEL;
1024 language_package_selection = LP_CUSTOM;
1027 language_package_selection = LP_NONE;
1032 case RC_LANGUAGE_COMMAND_BEGIN:
1033 lexrc >> language_command_begin;
1035 case RC_LANGUAGE_COMMAND_END:
1036 lexrc >> language_command_end;
1038 case RC_LANGUAGE_COMMAND_LOCAL:
1039 lexrc >> language_command_local;
1041 case RC_RTL_SUPPORT:
1042 lexrc >> rtl_support;
1044 case RC_VISUAL_CURSOR:
1045 lexrc >> visual_cursor;
1047 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
1048 lexrc >> close_buffer_with_last_view;
1050 case RC_AUTO_NUMBER:
1051 lexrc >> auto_number;
1053 case RC_MARK_FOREIGN_LANGUAGE:
1054 lexrc >> mark_foreign_language;
1058 string fmt, command;
1060 fmt = lexrc.getString();
1061 if (lexrc.next(true))
1062 command = lexrc.getString();
1063 setMover(fmt, command);
1067 case RC_CONVERTER: {
1068 string from, to, command, flags;
1070 from = lexrc.getString();
1072 to = lexrc.getString();
1073 if (lexrc.next(true))
1074 command = lexrc.getString();
1076 flags = lexrc.getString();
1077 if (command.empty())
1078 theConverters().erase(from, to);
1080 theConverters().add(from, to, command, flags);
1083 // compatibility with versions older than 1.4.0 only
1085 string format, command;
1086 lexrc >> format >> command;
1087 formats.setViewer(format, command);
1090 case RC_FILEFORMAT: {
1092 string format, extensions, prettyname, shortcut;
1093 if (!(lexrc >> format >> extensions))
1095 if (ok && lexrc.next(true))
1096 prettyname = lexrc.getString();
1100 if(!(lexrc >> shortcut))
1102 string viewer, editor;
1103 if (ok && lexrc.next(true))
1104 viewer = lexrc.getString();
1107 if (ok && lexrc.next(true))
1108 editor = lexrc.getString();
1112 if (!(lexrc >> flags >> mime))
1114 int flgs = Format::none;
1115 while (!flags.empty()) {
1117 flags = split(flags, flag, ',');
1118 if (flag == "document")
1119 flgs |= Format::document;
1120 else if (flag == "vector")
1121 flgs |= Format::vector;
1122 else if (flag == "zipped=native")
1123 flgs |= Format::zipped_native;
1124 else if (flag == "menu=export")
1125 flgs |= Format::export_menu;
1127 LYXERR0("Ignoring unknown flag `"
1128 << flag << "' for format `"
1132 LYXERR0("Syntax error in format " << format);
1133 else if (prettyname.empty()) {
1134 if (theConverters().formatIsUsed(format))
1135 LYXERR0("Can't delete format " << format);
1137 formats.erase(format);
1139 formats.add(format, extensions, prettyname,
1140 shortcut, viewer, editor, mime, flgs);
1144 case RC_VIEWER_ALTERNATIVES: {
1145 string format, command;
1148 viewer_alternatives[format].insert(command);
1151 case RC_EDITOR_ALTERNATIVES: {
1152 string format, command;
1155 editor_alternatives[format].insert(command);
1159 case RC_DEFAULT_VIEW_FORMAT:
1160 lexrc >> default_view_format;
1163 case RC_GUI_LANGUAGE:
1164 lexrc >> gui_language;
1167 case RC_SHOW_BANNER:
1168 lexrc >> show_banner;
1173 string const tmp = lexrc.getString();
1174 if (tmp == "true" || tmp == "on")
1175 preview = PREVIEW_ON;
1176 else if (tmp == "no_math")
1177 preview = PREVIEW_NO_MATH;
1179 preview = PREVIEW_OFF;
1180 if (tmp != "false" && tmp != "off")
1181 LYXERR0("Unrecognized preview status \""
1187 case RC_PREVIEW_HASHED_LABELS:
1188 lexrc >> preview_hashed_labels;
1191 case RC_PREVIEW_SCALE_FACTOR:
1192 lexrc >> preview_scale_factor;
1199 lexrc >> user_email;
1202 case RC_PATH_PREFIX:
1203 lexrc >> path_prefix;
1206 case RC_USE_CONVERTER_CACHE:
1207 lexrc >> use_converter_cache;
1209 case RC_CONVERTER_CACHE_MAXAGE:
1210 lexrc >> converter_cache_maxage;
1213 case RC_SORT_LAYOUTS:
1214 lexrc >> sort_layouts;
1216 case RC_GROUP_LAYOUTS:
1217 lexrc >> group_layouts;
1219 case RC_FULL_SCREEN_LIMIT:
1220 lexrc >> full_screen_limit;
1222 case RC_FULL_SCREEN_TOOLBARS:
1223 lexrc >> full_screen_toolbars;
1225 case RC_FULL_SCREEN_SCROLLBAR:
1226 lexrc >> full_screen_scrollbar;
1228 case RC_FULL_SCREEN_TABBAR:
1229 lexrc >> full_screen_tabbar;
1231 case RC_FULL_SCREEN_MENUBAR:
1232 lexrc >> full_screen_menubar;
1234 case RC_FULL_SCREEN_WIDTH:
1235 lexrc >> full_screen_width;
1237 case RC_OPEN_BUFFERS_IN_TABS:
1238 lexrc >> open_buffers_in_tabs;
1240 case RC_SINGLE_CLOSE_TAB_BUTTON:
1241 lexrc >> single_close_tab_button;
1243 case RC_SINGLE_INSTANCE:
1244 lexrc >> single_instance;
1245 if (run_mode == PREFERRED)
1246 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1248 case RC_FORWARD_SEARCH_DVI:
1249 if (lexrc.next(true))
1250 forward_search_dvi = lexrc.getString();
1252 case RC_FORWARD_SEARCH_PDF:
1253 if (lexrc.next(true))
1254 forward_search_pdf = lexrc.getString();
1256 case RC_EXPORT_OVERWRITE:
1258 string const tmp = lexrc.getString();
1259 if (tmp == "all" || tmp == "true")
1260 export_overwrite = ALL_FILES;
1261 else if (tmp == "main")
1262 export_overwrite = MAIN_FILE;
1264 export_overwrite = NO_FILES;
1265 if (tmp != "ask" && tmp != "false")
1266 LYXERR0("Unrecognized export_overwrite status \""
1271 case RC_SCROLL_WHEEL_ZOOM:
1273 string const tmp = lexrc.getString();
1275 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1276 else if (tmp == "shift")
1277 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1278 else if (tmp == "alt")
1279 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1281 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1282 if (tmp != "off" && tmp != "false")
1283 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1290 break; // this is just a dummy
1293 // This is triggered the first time through the loop unless
1294 // we hit a format tag.
1295 if (check_format && format != LYXRC_FILEFORMAT)
1296 return FormatMismatch;
1299 /// Update converters data-structures
1300 theConverters().update(formats);
1301 theConverters().buildGraph();
1307 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1309 ofstream ofs(filename.toFilesystemEncoding().c_str());
1311 write(ofs, ignore_system_lyxrc);
1315 void LyXRC::print() const
1317 if (lyxerr.debugging())
1318 write(lyxerr, false);
1326 typedef pair<string, SpecialisedMover> Data;
1328 SameMover(Data const & comparison)
1329 : comparison_(comparison) {}
1331 bool operator()(Data const & data) const
1333 return data.first == comparison_.first &&
1334 data.second.command() == comparison_.second.command();
1344 // Escape \ and " so that LyXLex can read the string later
1345 string escapeCommand(string const & str) {
1346 return subst(subst(str , "\\", "\\\\"),
1353 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1355 LyXRCTags tag = RC_LAST;
1357 if (!name.empty()) {
1358 for (int i = 0; i != lyxrcCount; ++i)
1359 if ("\\" + name == lyxrcTags[i].tag)
1360 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1364 os << "# LyX " << lyx_version
1365 << " generated this file. If you want to make your own\n"
1366 << "# modifications you should do them from inside LyX and save.\n\n"
1367 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1369 // Why the switch you might ask. It is a trick to ensure that all
1370 // the elements in the LyXRCTags enum are handled. As you can see
1371 // there are no breaks at all. So it is just a huge fall-through.
1372 // The nice thing is that we will get a warning from the compiler
1373 // if we forget an element.
1377 // input/include files are not done here
1378 case RC_LYXRCFORMAT:
1380 if (ignore_system_lyxrc ||
1381 bind_file != system_lyxrc.bind_file) {
1382 string const path = os::external_path(bind_file);
1383 os << "\\bind_file \"" << path << "\"\n";
1389 if (ignore_system_lyxrc ||
1390 def_file != system_lyxrc.def_file) {
1391 string const path = os::external_path(def_file);
1392 os << "\\def_file \"" << path << "\"\n";
1401 << "# MISC SECTION ######################################\n"
1403 // bind files are not done here.
1405 case RC_PATH_PREFIX:
1406 if (ignore_system_lyxrc ||
1407 path_prefix != system_lyxrc.path_prefix) {
1408 os << "\\path_prefix \"" << path_prefix << "\"\n";
1413 if (ignore_system_lyxrc ||
1414 ui_file != system_lyxrc.ui_file) {
1415 string const path = os::external_path(ui_file);
1416 os << "\\ui_file \"" << path << "\"\n";
1420 case RC_AUTOREGIONDELETE:
1421 if (ignore_system_lyxrc ||
1422 auto_region_delete != system_lyxrc.auto_region_delete) {
1423 os << "# Set to false to inhibit automatic replacement of\n"
1424 << "# the current selection.\n"
1425 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1430 case RC_AUTORESET_OPTIONS:
1431 if (ignore_system_lyxrc ||
1432 auto_reset_options != system_lyxrc.auto_reset_options) {
1433 os << "# Set to false to inhibit automatic reset of\n"
1434 << "# the class options to defaults on class change.\n"
1435 << "\\auto_reset_options "
1436 << convert<string>(auto_reset_options)
1442 if (ignore_system_lyxrc ||
1443 autosave != system_lyxrc.autosave) {
1444 os << "# The time interval between auto-saves in seconds.\n"
1445 << "\\autosave " << autosave << '\n';
1449 case RC_DISPLAY_GRAPHICS:
1450 if (ignore_system_lyxrc ||
1451 display_graphics != system_lyxrc.display_graphics) {
1452 os << "# Display graphics within LyX\n"
1454 << "\\display_graphics "
1455 << (display_graphics ? "true" : "false")
1460 case RC_SORT_LAYOUTS:
1461 if (ignore_system_lyxrc ||
1462 sort_layouts != system_lyxrc.sort_layouts) {
1463 os << "# Sort layouts alphabetically.\n"
1464 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1468 case RC_GROUP_LAYOUTS:
1469 if (ignore_system_lyxrc ||
1470 group_layouts != system_lyxrc.group_layouts) {
1471 os << "# Group layouts by their category.\n"
1472 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1476 case RC_VIEWDVI_PAPEROPTION:
1477 if (ignore_system_lyxrc ||
1478 view_dvi_paper_option
1479 != system_lyxrc.view_dvi_paper_option) {
1480 os << "# Options used to specify paper size to the\n"
1481 << "# view_dvi_command (e.g. -paper)\n"
1482 << "\\view_dvi_paper_option \""
1483 << view_dvi_paper_option << "\"\n";
1487 case RC_CHKTEX_COMMAND:
1488 if (ignore_system_lyxrc ||
1489 chktex_command != system_lyxrc.chktex_command) {
1490 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1494 case RC_BIBTEX_ALTERNATIVES: {
1495 CommandSet::const_iterator it = bibtex_alternatives.begin();
1496 CommandSet::const_iterator end = bibtex_alternatives.end();
1497 for ( ; it != end; ++it) {
1498 if (ignore_system_lyxrc
1499 || !system_lyxrc.bibtex_alternatives.count(*it))
1500 os << "\\bibtex_alternatives \""
1506 case RC_BIBTEX_COMMAND:
1507 if (ignore_system_lyxrc ||
1508 bibtex_command != system_lyxrc.bibtex_command) {
1509 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1513 case RC_JBIBTEX_COMMAND:
1514 if (ignore_system_lyxrc ||
1515 jbibtex_command != system_lyxrc.jbibtex_command) {
1516 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1520 case RC_INDEX_ALTERNATIVES: {
1521 CommandSet::const_iterator it = index_alternatives.begin();
1522 CommandSet::const_iterator end = index_alternatives.end();
1523 for ( ; it != end; ++it) {
1524 if (ignore_system_lyxrc
1525 || !system_lyxrc.index_alternatives.count(*it))
1526 os << "\\index_alternatives \""
1532 case RC_INDEX_COMMAND:
1533 if (ignore_system_lyxrc ||
1534 index_command != system_lyxrc.index_command) {
1535 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1539 case RC_JINDEX_COMMAND:
1540 if (ignore_system_lyxrc ||
1541 jindex_command != system_lyxrc.jindex_command) {
1542 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1546 case RC_SPLITINDEX_COMMAND:
1547 if (ignore_system_lyxrc ||
1548 splitindex_command != system_lyxrc.splitindex_command) {
1549 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1553 case RC_NOMENCL_COMMAND:
1554 if (ignore_system_lyxrc ||
1555 nomencl_command != system_lyxrc.nomencl_command) {
1556 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1560 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1561 // Don't write this setting to the preferences file,
1562 // but allow temporary changes (bug 7557).
1563 if (ignore_system_lyxrc) {
1564 os << "\\tex_expects_windows_paths "
1565 << convert<string>(windows_style_tex_paths) << '\n';
1569 case RC_TEX_ALLOWS_SPACES:
1570 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1571 os << "\\tex_allows_spaces "
1572 << 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';
1583 case RC_KBMAP_PRIMARY:
1584 if (ignore_system_lyxrc ||
1585 primary_kbmap != system_lyxrc.primary_kbmap) {
1586 string const path = os::external_path(primary_kbmap);
1587 os << "\\kbmap_primary \"" << path << "\"\n";
1591 case RC_KBMAP_SECONDARY:
1592 if (ignore_system_lyxrc ||
1593 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1594 string const path = os::external_path(secondary_kbmap);
1595 os << "\\kbmap_secondary \"" << path << "\"\n";
1600 if (ignore_system_lyxrc ||
1601 lyxpipes != system_lyxrc.lyxpipes) {
1602 string const path = os::external_path(lyxpipes);
1603 os << "\\serverpipe \"" << path << "\"\n";
1607 case RC_DATE_INSERT_FORMAT:
1608 if (ignore_system_lyxrc ||
1609 date_insert_format != system_lyxrc.date_insert_format) {
1610 os << "\\date_insert_format \"" << date_insert_format
1617 os << "\\user_name \"" << user_name << "\"\n";
1622 os << "\\user_email \"" << user_email << "\"\n";
1626 case RC_SHOW_BANNER:
1627 if (ignore_system_lyxrc ||
1628 show_banner != system_lyxrc.show_banner) {
1629 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1635 if (ignore_system_lyxrc ||
1636 preview != system_lyxrc.preview) {
1642 case PREVIEW_NO_MATH:
1649 os << "\\preview " << status << '\n';
1654 case RC_PREVIEW_HASHED_LABELS:
1655 if (ignore_system_lyxrc ||
1656 preview_hashed_labels !=
1657 system_lyxrc.preview_hashed_labels) {
1658 os << "\\preview_hashed_labels "
1659 << convert<string>(preview_hashed_labels) << '\n';
1664 case RC_PREVIEW_SCALE_FACTOR:
1665 if (ignore_system_lyxrc ||
1666 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1667 os << "\\preview_scale_factor "
1668 << preview_scale_factor << '\n';
1673 case RC_USE_CONVERTER_CACHE:
1674 if (ignore_system_lyxrc ||
1675 use_converter_cache != system_lyxrc.use_converter_cache) {
1676 os << "\\use_converter_cache "
1677 << convert<string>(use_converter_cache) << '\n';
1682 case RC_CONVERTER_CACHE_MAXAGE:
1683 if (ignore_system_lyxrc ||
1684 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1685 os << "\\converter_cache_maxage "
1686 << converter_cache_maxage << '\n';
1692 << "# SCREEN & FONTS SECTION ############################\n"
1696 if (ignore_system_lyxrc ||
1697 icon_set != system_lyxrc.icon_set) {
1698 os << "\\icon_set \"" << icon_set
1705 if (ignore_system_lyxrc ||
1706 dpi != system_lyxrc.dpi) {
1707 os << "\\screen_dpi " << dpi << '\n';
1711 case RC_SCREEN_ZOOM:
1712 if (ignore_system_lyxrc ||
1713 zoom != system_lyxrc.zoom) {
1714 os << "\\screen_zoom " << zoom << '\n';
1718 case RC_GEOMETRY_SESSION:
1719 if (ignore_system_lyxrc ||
1720 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1721 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1726 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1727 if (ignore_system_lyxrc ||
1728 cursor_follows_scrollbar
1729 != system_lyxrc.cursor_follows_scrollbar) {
1730 os << "\\cursor_follows_scrollbar "
1731 << convert<string>(cursor_follows_scrollbar) << '\n';
1735 case RC_CURSOR_WIDTH:
1736 if (ignore_system_lyxrc ||
1738 != system_lyxrc.cursor_width) {
1739 os << "\\cursor_width "
1740 << cursor_width << '\n';
1744 case RC_SCROLL_BELOW_DOCUMENT:
1745 if (ignore_system_lyxrc ||
1746 scroll_below_document
1747 != system_lyxrc.scroll_below_document) {
1748 os << "\\scroll_below_document "
1749 << convert<string>(scroll_below_document) << '\n';
1753 case RC_PARAGRAPH_MARKERS:
1754 if (ignore_system_lyxrc ||
1756 != system_lyxrc.paragraph_markers) {
1757 os << "\\paragraph_markers "
1758 << convert<string>(paragraph_markers) << '\n';
1762 case RC_MAC_DONTSWAP_CTRL_META:
1763 if (ignore_system_lyxrc ||
1764 mac_dontswap_ctrl_meta
1765 != system_lyxrc.mac_dontswap_ctrl_meta) {
1766 os << "\\mac_dontswap_ctrl_meta "
1767 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1771 case RC_MAC_LIKE_WORD_MOVEMENT:
1772 if (ignore_system_lyxrc ||
1773 mac_like_word_movement
1774 != system_lyxrc.mac_like_word_movement) {
1775 os << "\\mac_like_word_movement "
1776 << convert<string>(mac_like_word_movement) << '\n';
1780 case RC_MACRO_EDIT_STYLE:
1781 if (ignore_system_lyxrc ||
1783 != system_lyxrc.macro_edit_style) {
1784 os << "\\macro_edit_style ";
1785 switch (macro_edit_style) {
1786 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1787 case MACRO_EDIT_INLINE: os << "1\n"; break;
1788 case MACRO_EDIT_LIST: os << "2\n"; break;
1793 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1794 if (ignore_system_lyxrc ||
1795 dialogs_iconify_with_main
1796 != system_lyxrc.dialogs_iconify_with_main) {
1797 os << "\\dialogs_iconify_with_main "
1798 << convert<string>(dialogs_iconify_with_main) << '\n';
1802 case RC_SCREEN_FONT_ROMAN:
1803 if (ignore_system_lyxrc ||
1804 roman_font_name != system_lyxrc.roman_font_name) {
1805 os << "\\screen_font_roman \"" << roman_font_name
1810 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1811 if (ignore_system_lyxrc ||
1812 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1813 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1818 case RC_SCREEN_FONT_SANS:
1819 if (ignore_system_lyxrc ||
1820 sans_font_name != system_lyxrc.sans_font_name) {
1821 os << "\\screen_font_sans \"" << sans_font_name
1826 case RC_SCREEN_FONT_SANS_FOUNDRY:
1827 if (ignore_system_lyxrc ||
1828 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1829 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1834 case RC_SCREEN_FONT_TYPEWRITER:
1835 if (ignore_system_lyxrc ||
1836 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1837 os << "\\screen_font_typewriter \""
1838 << typewriter_font_name << "\"\n";
1842 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1843 if (ignore_system_lyxrc ||
1844 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1845 os << "\\screen_font_typewriter_foundry \""
1846 << typewriter_font_foundry << "\"\n";
1851 case RC_SCREEN_FONT_SCALABLE:
1852 if (ignore_system_lyxrc ||
1853 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1854 os << "\\screen_font_scalable "
1855 << convert<string>(use_scalable_fonts)
1860 case RC_SCREEN_FONT_SIZES:
1861 if (ignore_system_lyxrc ||
1862 font_sizes[FONT_SIZE_TINY]
1863 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1864 font_sizes[FONT_SIZE_SCRIPT]
1865 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1866 font_sizes[FONT_SIZE_FOOTNOTE]
1867 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1868 font_sizes[FONT_SIZE_SMALL]
1869 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1870 font_sizes[FONT_SIZE_NORMAL]
1871 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1872 font_sizes[FONT_SIZE_LARGE]
1873 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1874 font_sizes[FONT_SIZE_LARGER]
1875 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1876 font_sizes[FONT_SIZE_LARGEST]
1877 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1878 font_sizes[FONT_SIZE_HUGE]
1879 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1880 font_sizes[FONT_SIZE_HUGER]
1881 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1882 os.setf(ios::fixed);
1884 os << "\\screen_font_sizes"
1885 << ' ' << font_sizes[FONT_SIZE_TINY]
1886 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1887 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1888 << ' ' << font_sizes[FONT_SIZE_SMALL]
1889 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1890 << ' ' << font_sizes[FONT_SIZE_LARGE]
1891 << ' ' << font_sizes[FONT_SIZE_LARGER]
1892 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1893 << ' ' << font_sizes[FONT_SIZE_HUGE]
1894 << ' ' << font_sizes[FONT_SIZE_HUGER]
1899 case RC_FULL_SCREEN_LIMIT:
1900 if (ignore_system_lyxrc ||
1901 full_screen_limit != system_lyxrc.full_screen_limit) {
1902 os << "\\fullscreen_limit "
1903 << convert<string>(full_screen_limit)
1908 case RC_FULL_SCREEN_TOOLBARS:
1909 if (ignore_system_lyxrc ||
1910 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1911 os << "\\fullscreen_toolbars "
1912 << convert<string>(full_screen_toolbars)
1917 case RC_FULL_SCREEN_SCROLLBAR:
1918 if (ignore_system_lyxrc ||
1919 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1920 os << "\\fullscreen_scrollbar "
1921 << convert<string>(full_screen_scrollbar)
1926 case RC_FULL_SCREEN_TABBAR:
1927 if (ignore_system_lyxrc ||
1928 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1929 os << "\\fullscreen_tabbar "
1930 << convert<string>(full_screen_tabbar)
1935 case RC_FULL_SCREEN_MENUBAR:
1936 if (ignore_system_lyxrc ||
1937 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1938 os << "\\fullscreen_menubar "
1939 << convert<string>(full_screen_menubar)
1944 case RC_FULL_SCREEN_WIDTH:
1945 if (ignore_system_lyxrc ||
1946 full_screen_width != system_lyxrc.full_screen_width) {
1947 os << "\\fullscreen_width "
1948 << convert<string>(full_screen_width)
1953 case RC_OPEN_BUFFERS_IN_TABS:
1954 if (ignore_system_lyxrc ||
1955 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1956 os << "\\open_buffers_in_tabs "
1957 << convert<string>(open_buffers_in_tabs)
1962 case RC_SINGLE_CLOSE_TAB_BUTTON:
1963 if (ignore_system_lyxrc ||
1964 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1965 os << "\\single_close_tab_button "
1966 << convert<string>(single_close_tab_button)
1971 case RC_SINGLE_INSTANCE:
1972 if (ignore_system_lyxrc ||
1973 single_instance != system_lyxrc.single_instance) {
1974 os << "\\single_instance "
1975 << convert<string>(single_instance)
1980 case RC_FORWARD_SEARCH_DVI:
1981 if (ignore_system_lyxrc ||
1982 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1983 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1987 case RC_FORWARD_SEARCH_PDF:
1988 if (ignore_system_lyxrc ||
1989 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1990 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1996 << "# COLOR SECTION ###################################\n"
2000 for (int i = 0; i < Color_ignore; ++i) {
2001 ColorCode lc = static_cast<ColorCode>(i);
2002 string const col = lcolor.getX11Name(lc);
2003 if (ignore_system_lyxrc
2004 || col != system_lcolor.getX11Name(lc)) {
2005 os << "\\set_color \""
2006 << lcolor.getLyXName(lc) << "\" \""
2014 << "# PRINTER SECTION ###################################\n"
2018 if (ignore_system_lyxrc ||
2019 printer != system_lyxrc.printer) {
2020 os << "\\printer \"" << printer << "\"\n";
2024 case RC_PRINT_ADAPTOUTPUT:
2025 if (ignore_system_lyxrc ||
2026 print_adapt_output != system_lyxrc.print_adapt_output) {
2027 os << "\\print_adapt_output "
2028 << convert<string>(print_adapt_output)
2033 case RC_PRINT_COMMAND:
2034 if (ignore_system_lyxrc ||
2035 print_command != system_lyxrc.print_command) {
2036 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2040 case RC_PRINTEXSTRAOPTIONS:
2041 if (ignore_system_lyxrc ||
2042 print_extra_options != system_lyxrc.print_extra_options) {
2043 os << "\\print_extra_options \"" << print_extra_options
2048 case RC_PRINTSPOOL_COMMAND:
2049 if (ignore_system_lyxrc ||
2050 print_spool_command != system_lyxrc.print_spool_command) {
2051 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2056 case RC_PRINTSPOOL_PRINTERPREFIX:
2057 if (ignore_system_lyxrc ||
2058 print_spool_printerprefix
2059 != system_lyxrc.print_spool_printerprefix) {
2060 os << "\\print_spool_printerprefix \""
2061 << print_spool_printerprefix << "\"\n";
2065 case RC_PRINTEVENPAGEFLAG:
2066 if (ignore_system_lyxrc ||
2067 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2068 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2073 case RC_PRINTODDPAGEFLAG:
2074 if (ignore_system_lyxrc ||
2075 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2076 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2081 case RC_PRINTREVERSEFLAG:
2082 if (ignore_system_lyxrc ||
2083 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2084 os << "\\print_reverse_flag \"" << print_reverse_flag
2089 case RC_PRINTLANDSCAPEFLAG:
2090 if (ignore_system_lyxrc ||
2091 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2092 os << "\\print_landscape_flag \"" << print_landscape_flag
2097 case RC_PRINTPAGERANGEFLAG:
2098 if (ignore_system_lyxrc ||
2099 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2100 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2105 case RC_PRINTCOPIESFLAG:
2106 if (ignore_system_lyxrc ||
2107 print_copies_flag != system_lyxrc.print_copies_flag) {
2108 os << "\\print_copies_flag \"" << print_copies_flag
2113 case RC_PRINTCOLLCOPIESFLAG:
2114 if (ignore_system_lyxrc ||
2115 print_collcopies_flag
2116 != system_lyxrc.print_collcopies_flag) {
2117 os << "\\print_collcopies_flag \""
2118 << print_collcopies_flag
2123 case RC_PRINTPAPERFLAG:
2124 if (ignore_system_lyxrc ||
2125 print_paper_flag != system_lyxrc.print_paper_flag) {
2126 os << "\\print_paper_flag \"" << print_paper_flag
2131 case RC_PRINTPAPERDIMENSIONFLAG:
2132 if (ignore_system_lyxrc ||
2133 print_paper_dimension_flag
2134 != system_lyxrc.print_paper_dimension_flag) {
2135 os << "\\print_paper_dimension_flag \""
2136 << print_paper_dimension_flag << "\"\n";
2140 case RC_PRINTTOPRINTER:
2141 if (ignore_system_lyxrc ||
2142 print_to_printer != system_lyxrc.print_to_printer) {
2143 os << "\\print_to_printer \"" << print_to_printer
2148 case RC_PRINTTOFILE:
2149 if (ignore_system_lyxrc ||
2150 print_to_file != system_lyxrc.print_to_file) {
2151 string const path = os::external_path(print_to_file);
2152 os << "\\print_to_file \"" << path << "\"\n";
2156 case RC_PRINTFILEEXTENSION:
2157 if (ignore_system_lyxrc ||
2158 print_file_extension != system_lyxrc.print_file_extension) {
2159 os << "\\print_file_extension \""
2160 << print_file_extension
2167 << "# TEX SECTION #######################################\n"
2170 case RC_TEXINPUTS_PREFIX:
2171 if (ignore_system_lyxrc ||
2172 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2173 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2178 case RC_FONT_ENCODING:
2179 if (ignore_system_lyxrc ||
2180 fontenc != system_lyxrc.fontenc) {
2181 os << "\\font_encoding \"" << fontenc << "\"\n";
2186 case RC_FORCE_PAINT_SINGLE_CHAR:
2187 if (ignore_system_lyxrc ||
2188 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2189 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2195 << "# FILE SECTION ######################################\n"
2198 case RC_DOCUMENTPATH:
2199 if (ignore_system_lyxrc ||
2200 document_path != system_lyxrc.document_path) {
2201 string const path = os::external_path(document_path);
2202 os << "\\document_path \"" << path << "\"\n";
2206 case RC_USELASTFILEPOS:
2207 if (ignore_system_lyxrc ||
2208 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2209 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2214 case RC_LOADSESSION:
2215 if (ignore_system_lyxrc ||
2216 load_session != system_lyxrc.load_session) {
2217 os << "\\load_session " << convert<string>(load_session)
2222 case RC_MOUSE_WHEEL_SPEED:
2223 if (ignore_system_lyxrc ||
2224 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2225 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2229 case RC_COMPLETION_INLINE_DELAY:
2230 if (ignore_system_lyxrc ||
2231 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2232 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2236 case RC_COMPLETION_INLINE_MATH:
2237 if (ignore_system_lyxrc ||
2238 completion_inline_math != system_lyxrc.completion_inline_math) {
2239 os << "\\completion_inline_math "
2240 << convert<string>(completion_inline_math) << '\n';
2244 case RC_COMPLETION_INLINE_TEXT:
2245 if (ignore_system_lyxrc ||
2246 completion_inline_text != system_lyxrc.completion_inline_text) {
2247 os << "\\completion_inline_text "
2248 << convert<string>(completion_inline_text) << '\n';
2252 case RC_COMPLETION_INLINE_DOTS:
2253 if (ignore_system_lyxrc ||
2254 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2255 os << "\\completion_inline_dots "
2256 << convert<string>(completion_inline_dots) << '\n';
2260 case RC_AUTOCORRECTION_MATH:
2261 if (ignore_system_lyxrc ||
2262 autocorrection_math != system_lyxrc.autocorrection_math) {
2263 os << "\\autocorrection_math "
2264 << convert<string>(autocorrection_math) << '\n';
2268 case RC_COMPLETION_POPUP_DELAY:
2269 if (ignore_system_lyxrc ||
2270 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2271 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2275 case RC_COMPLETION_POPUP_MATH:
2276 if (ignore_system_lyxrc ||
2277 completion_popup_math != system_lyxrc.completion_popup_math) {
2278 os << "\\completion_popup_math "
2279 << convert<string>(completion_popup_math) << '\n';
2283 case RC_COMPLETION_POPUP_TEXT:
2284 if (ignore_system_lyxrc ||
2285 completion_popup_text != system_lyxrc.completion_popup_text) {
2286 os << "\\completion_popup_text "
2287 << convert<string>(completion_popup_text) << '\n';
2291 case RC_COMPLETION_CURSOR_TEXT:
2292 if (ignore_system_lyxrc ||
2293 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2294 os << "\\completion_cursor_text "
2295 << convert<string>(completion_cursor_text) << '\n';
2299 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2300 if (ignore_system_lyxrc ||
2301 completion_popup_after_complete
2302 != system_lyxrc.completion_popup_after_complete) {
2303 os << "\\completion_popup_after_complete "
2304 << convert<string>(completion_popup_after_complete) << '\n';
2308 case RC_COMPLETION_MINLENGTH:
2309 if (ignore_system_lyxrc ||
2310 completion_minlength != system_lyxrc.completion_minlength) {
2311 os << "\\completion_minlength " << convert<string>(completion_minlength)
2317 case RC_NUMLASTFILES:
2318 if (ignore_system_lyxrc ||
2319 num_lastfiles != system_lyxrc.num_lastfiles) {
2320 os << "\\num_lastfiles " << num_lastfiles << '\n';
2324 case RC_CHECKLASTFILES:
2325 if (ignore_system_lyxrc ||
2326 check_lastfiles != system_lyxrc.check_lastfiles) {
2327 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2332 case RC_EXAMPLEPATH:
2333 if (ignore_system_lyxrc ||
2334 example_path != system_lyxrc.example_path) {
2335 string const path = os::external_path(example_path);
2336 os << "\\example_path \"" << path << "\"\n";
2340 case RC_TEMPLATEPATH:
2341 if (ignore_system_lyxrc ||
2342 template_path != system_lyxrc.template_path) {
2343 string const path = os::external_path(template_path);
2344 os << "\\template_path \"" << path << "\"\n";
2348 case RC_TEMPDIRPATH:
2349 if (ignore_system_lyxrc ||
2350 tempdir_path != system_lyxrc.tempdir_path) {
2351 string const path = os::external_path(tempdir_path);
2352 os << "\\tempdir_path \"" << path << "\"\n";
2356 case RC_THESAURUSDIRPATH:
2357 if (ignore_system_lyxrc ||
2358 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2359 string const path = os::external_path(thesaurusdir_path);
2360 os << "\\thesaurusdir_path \"" << path << "\"\n";
2364 case RC_HUNSPELLDIR_PATH:
2365 if (ignore_system_lyxrc ||
2366 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2367 string const path = os::external_path(hunspelldir_path);
2368 os << "\\hunspelldir_path \"" << path << "\"\n";
2372 case RC_PLAINTEXT_LINELEN:
2373 if (ignore_system_lyxrc ||
2374 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2375 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2379 case RC_MAKE_BACKUP:
2380 if (ignore_system_lyxrc ||
2381 make_backup != system_lyxrc.make_backup) {
2382 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2386 case RC_SAVE_COMPRESSED:
2387 if (ignore_system_lyxrc ||
2388 save_compressed != system_lyxrc.save_compressed) {
2389 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2393 case RC_BACKUPDIR_PATH:
2394 if (ignore_system_lyxrc ||
2395 backupdir_path != system_lyxrc.backupdir_path) {
2396 string const path = os::external_path(backupdir_path);
2397 os << "\\backupdir_path \"" << path << "\"\n";
2403 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2407 << "# SPELLCHECKER SECTION ##############################\n"
2410 case RC_ACCEPT_COMPOUND:
2411 if (ignore_system_lyxrc ||
2412 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2413 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2419 if (ignore_system_lyxrc ||
2420 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2421 os << "\\alternate_language \"" << spellchecker_alt_lang
2427 if (ignore_system_lyxrc ||
2428 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2429 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2433 case RC_USE_SYSTEM_COLORS:
2434 if (ignore_system_lyxrc ||
2435 use_system_colors != system_lyxrc.use_system_colors) {
2436 os << "\\use_system_colors "
2437 << convert<string>(use_system_colors)
2442 case RC_USE_TOOLTIP:
2443 if (ignore_system_lyxrc ||
2444 use_tooltip != system_lyxrc.use_tooltip) {
2445 os << "\\use_tooltip "
2446 << convert<string>(use_tooltip)
2451 case RC_USE_PIXMAP_CACHE:
2452 if (ignore_system_lyxrc ||
2453 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2454 os << "\\use_pixmap_cache "
2455 << convert<string>(use_pixmap_cache)
2461 if (ignore_system_lyxrc ||
2462 use_qimage != system_lyxrc.use_qimage) {
2463 os << "\\use_qimage "
2464 << convert<string>(use_qimage)
2471 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2476 case RC_DEFAULT_DECIMAL_POINT:
2477 if (ignore_system_lyxrc ||
2478 default_decimal_point != system_lyxrc.default_decimal_point) {
2479 os << "\\default_decimal_point " << default_decimal_point << '\n';
2484 case RC_DEFAULT_LENGTH_UNIT:
2485 if (ignore_system_lyxrc ||
2486 default_length_unit != system_lyxrc.default_length_unit) {
2487 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2492 case RC_SPELLCHECKER:
2493 if (ignore_system_lyxrc ||
2494 spellchecker != system_lyxrc.spellchecker) {
2495 os << "\\spellchecker " << spellchecker << '\n';
2500 case RC_SPELLCHECK_CONTINUOUSLY:
2501 if (ignore_system_lyxrc ||
2502 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2503 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2509 case RC_SPELLCHECK_NOTES:
2510 if (ignore_system_lyxrc ||
2511 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2512 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2518 case RC_RTL_SUPPORT:
2519 if (ignore_system_lyxrc ||
2520 rtl_support != system_lyxrc.rtl_support) {
2521 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2525 case RC_VISUAL_CURSOR:
2526 if (ignore_system_lyxrc ||
2527 visual_cursor != system_lyxrc.visual_cursor) {
2528 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2532 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
2533 if (ignore_system_lyxrc ||
2534 close_buffer_with_last_view != system_lyxrc.close_buffer_with_last_view) {
2535 os << "# When closing last view, buffer closes (yes), hides (no), or ask the user (ask)\n";
2536 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
2548 case RC_LANGUAGE_GLOBAL_OPTIONS:
2549 if (ignore_system_lyxrc ||
2550 language_global_options
2551 != system_lyxrc.language_global_options) {
2552 os << "\\language_global_options \""
2553 << convert<string>(language_global_options)
2558 case RC_LANGUAGE_PACKAGE_SELECTION:
2559 if (ignore_system_lyxrc ||
2560 language_package_selection != system_lyxrc.language_package_selection) {
2561 os << "\\language_package_selection ";
2562 switch (language_package_selection) {
2579 case RC_LANGUAGE_COMMAND_BEGIN:
2580 if (ignore_system_lyxrc ||
2581 language_command_begin
2582 != system_lyxrc.language_command_begin) {
2583 os << "\\language_command_begin \""
2584 << language_command_begin
2589 case RC_LANGUAGE_COMMAND_END:
2590 if (ignore_system_lyxrc ||
2591 language_command_end
2592 != system_lyxrc.language_command_end) {
2593 os << "\\language_command_end \"" << language_command_end
2598 case RC_LANGUAGE_COMMAND_LOCAL:
2599 if (ignore_system_lyxrc ||
2600 language_command_local
2601 != system_lyxrc.language_command_local) {
2602 os << "\\language_command_local \""
2603 << language_command_local
2608 case RC_LANGUAGE_AUTO_BEGIN:
2609 if (ignore_system_lyxrc ||
2610 language_auto_begin != system_lyxrc.language_auto_begin) {
2611 os << "\\language_auto_begin "
2612 << convert<string>(language_auto_begin) << '\n';
2616 case RC_LANGUAGE_AUTO_END:
2617 if (ignore_system_lyxrc ||
2618 language_auto_end != system_lyxrc.language_auto_end) {
2619 os << "\\language_auto_end "
2620 << convert<string>(language_auto_end) << '\n';
2624 case RC_MARK_FOREIGN_LANGUAGE:
2625 if (ignore_system_lyxrc ||
2626 mark_foreign_language
2627 != system_lyxrc.mark_foreign_language) {
2628 os << "\\mark_foreign_language " <<
2629 convert<string>(mark_foreign_language) << '\n';
2635 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2638 case RC_AUTO_NUMBER:
2639 if (ignore_system_lyxrc ||
2640 auto_number != system_lyxrc.auto_number) {
2641 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2645 case RC_GUI_LANGUAGE:
2646 if (ignore_system_lyxrc ||
2647 gui_language != system_lyxrc.gui_language) {
2648 os << "\\gui_language " << gui_language << '\n';
2652 case RC_EXPORT_OVERWRITE:
2653 if (ignore_system_lyxrc ||
2654 export_overwrite != system_lyxrc.export_overwrite) {
2656 switch (export_overwrite) {
2667 os << "\\export_overwrite " << status << '\n';
2672 case RC_SCROLL_WHEEL_ZOOM:
2673 if (ignore_system_lyxrc ||
2674 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2676 switch (scroll_wheel_zoom) {
2677 case SCROLL_WHEEL_ZOOM_OFF:
2680 case SCROLL_WHEEL_ZOOM_CTRL:
2683 case SCROLL_WHEEL_ZOOM_SHIFT:
2686 case SCROLL_WHEEL_ZOOM_ALT:
2690 os << "\\scroll_wheel_zoom " << status << '\n';
2696 << "# FORMATS SECTION ##########################\n"
2700 // New/modified formats
2701 for (Formats::const_iterator cit = formats.begin();
2702 cit != formats.end(); ++cit) {
2703 Format const * format =
2704 system_formats.getFormat(cit->name());
2706 format->extensions() != cit->extensions() ||
2707 format->prettyname() != cit->prettyname() ||
2708 format->shortcut() != cit->shortcut() ||
2709 format->viewer() != cit->viewer() ||
2710 format->editor() != cit->editor() ||
2711 format->documentFormat() != cit->documentFormat() ||
2712 format->vectorFormat() != cit->vectorFormat() ||
2713 format->inExportMenu() != cit->inExportMenu() ||
2714 format->mime() != cit->mime()) {
2715 os << "\\format \"" << cit->name() << "\" \""
2716 << cit->extensions() << "\" \""
2717 << cit->prettyname() << "\" \""
2718 << cit->shortcut() << "\" \""
2719 << escapeCommand(cit->viewer()) << "\" \""
2720 << escapeCommand(cit->editor()) << "\" \"";
2721 vector<string> flags;
2722 if (cit->documentFormat())
2723 flags.push_back("document");
2724 if (cit->vectorFormat())
2725 flags.push_back("vector");
2726 if (cit->zippedNative())
2727 flags.push_back("zipped=native");
2728 if (cit->inExportMenu())
2729 flags.push_back("menu=export");
2731 os << getStringFromVector(flags);
2732 os << "\" \"" << cit->mime() << "\"\n";
2736 // Look for deleted formats
2737 for (Formats::const_iterator cit = system_formats.begin();
2738 cit != system_formats.end(); ++cit)
2739 if (!formats.getFormat(cit->name()))
2740 os << "\\format \"" << cit->name()
2741 << "\" \"\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2744 case RC_VIEWER_ALTERNATIVES: {
2745 Alternatives::const_iterator it = viewer_alternatives.begin();
2746 Alternatives::const_iterator const en = viewer_alternatives.end();
2747 Alternatives::const_iterator const sysend =
2748 system_lyxrc.viewer_alternatives.end();
2749 for (; it != en; ++it) {
2750 string const & fmt = it->first;
2751 CommandSet const & cmd = it->second;
2752 CommandSet::const_iterator sit = cmd.begin();
2753 CommandSet::const_iterator const sen = cmd.end();
2754 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2755 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2756 system_lyxrc.viewer_alternatives.find(fmt);
2757 for (; sit != sen; ++sit) {
2758 string const & cmd = *sit;
2759 if (ignore_system_lyxrc
2760 || sysfmt == sysend // format not found
2761 || sysfmt->second.count(cmd) == 0 // this command not found
2763 os << "\\viewer_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2769 case RC_EDITOR_ALTERNATIVES: {
2770 Alternatives::const_iterator it = editor_alternatives.begin();
2771 Alternatives::const_iterator const en = editor_alternatives.end();
2772 Alternatives::const_iterator const sysend =
2773 system_lyxrc.editor_alternatives.end();
2774 for (; it != en; ++it) {
2775 string const & fmt = it->first;
2776 CommandSet const & cmd = it->second;
2777 CommandSet::const_iterator sit = cmd.begin();
2778 CommandSet::const_iterator const sen = cmd.end();
2779 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2780 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2781 system_lyxrc.editor_alternatives.find(fmt);
2782 for (; sit != sen; ++sit) {
2783 string const & cmd = *sit;
2784 if (ignore_system_lyxrc
2785 || sysfmt == sysend // format not found
2786 || sysfmt->second.count(cmd) == 0 // this command not found
2788 os << "\\editor_alternatives " << fmt << " \"" << escapeCommand(cmd) << "\"\n";
2794 case RC_DEFAULT_VIEW_FORMAT:
2795 if (ignore_system_lyxrc ||
2796 default_view_format != system_lyxrc.default_view_format) {
2797 os << "\\default_view_format " << default_view_format << '\n';
2807 << "# CONVERTERS SECTION ##########################\n"
2811 // Look for new converters
2812 for (Converters::const_iterator cit = theConverters().begin();
2813 cit != theConverters().end(); ++cit) {
2814 Converter const * converter =
2815 theSystemConverters().getConverter(cit->from,
2818 converter->command != cit->command ||
2819 converter->flags != cit->flags)
2820 os << "\\converter \"" << cit->from << "\" \""
2821 << cit->to << "\" \""
2822 << escapeCommand(cit->command) << "\" \""
2823 << cit->flags << "\"\n";
2826 // New/modifed converters
2827 for (Converters::const_iterator cit = theSystemConverters().begin();
2828 cit != theSystemConverters().end(); ++cit)
2829 if (!theConverters().getConverter(cit->from, cit->to))
2830 os << "\\converter \"" << cit->from
2831 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2838 << "# COPIERS SECTION ##########################\n"
2841 // Look for new movers
2842 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2843 Movers::const_iterator const sysend = theSystemMovers().end();
2844 Movers::const_iterator it = theMovers().begin();
2845 Movers::const_iterator end = theMovers().end();
2847 for (; it != end; ++it) {
2848 Movers::const_iterator const sysit =
2849 find_if(sysbegin, sysend, SameMover(*it));
2850 if (sysit == sysend) {
2851 string const & fmt = it->first;
2852 string const & command =
2853 it->second.command();
2855 os << "\\copier " << fmt
2856 << " \"" << escapeCommand(command) << "\"\n";
2862 // We don't actually delete SpecialisedMover(s) from the
2863 // map, just clear their 'command', so there's no need
2864 // to test for anything else.
2871 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2873 // Why the switch you might ask. It is a trick to ensure that all
2874 // the elements in the LyXRCTags enum is handled. As you can see
2875 // there are no breaks at all. So it is just a huge fall-through.
2876 // The nice thing is that we will get a warning from the compiler
2877 // if we forget an element.
2878 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2880 case LyXRC::RC_LAST:
2881 case LyXRC::RC_ACCEPT_COMPOUND:
2882 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2883 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2884 case LyXRC::RC_ALT_LANG:
2885 case LyXRC::RC_PLAINTEXT_LINELEN:
2886 case LyXRC::RC_AUTOCORRECTION_MATH:
2887 case LyXRC::RC_AUTOREGIONDELETE:
2888 case LyXRC::RC_AUTORESET_OPTIONS:
2889 case LyXRC::RC_AUTOSAVE:
2890 case LyXRC::RC_AUTO_NUMBER:
2891 case LyXRC::RC_BACKUPDIR_PATH:
2892 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2893 case LyXRC::RC_BIBTEX_COMMAND:
2894 case LyXRC::RC_BINDFILE:
2895 case LyXRC::RC_CHECKLASTFILES:
2896 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2897 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2898 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2899 case LyXRC::RC_COMPLETION_INLINE_MATH:
2900 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2901 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2902 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2903 case LyXRC::RC_COMPLETION_POPUP_MATH:
2904 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2905 case LyXRC::RC_COMPLETION_MINLENGTH:
2906 case LyXRC::RC_USELASTFILEPOS:
2907 case LyXRC::RC_LOADSESSION:
2908 case LyXRC::RC_CHKTEX_COMMAND:
2909 case LyXRC::RC_CONVERTER:
2910 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2911 case LyXRC::RC_COPIER:
2912 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2913 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2914 case LyXRC::RC_DATE_INSERT_FORMAT:
2915 case LyXRC::RC_GUI_LANGUAGE:
2916 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2917 case LyXRC::RC_DEFFILE:
2918 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2919 case LyXRC::RC_DISPLAY_GRAPHICS:
2920 case LyXRC::RC_DOCUMENTPATH:
2921 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2922 FileName path(lyxrc_new.document_path);
2923 if (path.exists() && path.isDirectory())
2924 package().document_dir() = FileName(lyxrc.document_path);
2926 case LyXRC::RC_EDITOR_ALTERNATIVES:
2927 case LyXRC::RC_ESC_CHARS:
2928 case LyXRC::RC_EXAMPLEPATH:
2929 case LyXRC::RC_FONT_ENCODING:
2930 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2931 case LyXRC::RC_FILEFORMAT:
2932 case LyXRC::RC_GROUP_LAYOUTS:
2933 case LyXRC::RC_HUNSPELLDIR_PATH:
2934 case LyXRC::RC_ICON_SET:
2935 case LyXRC::RC_INDEX_ALTERNATIVES:
2936 case LyXRC::RC_INDEX_COMMAND:
2937 case LyXRC::RC_JBIBTEX_COMMAND:
2938 case LyXRC::RC_JINDEX_COMMAND:
2939 case LyXRC::RC_NOMENCL_COMMAND:
2940 case LyXRC::RC_INPUT:
2941 case LyXRC::RC_KBMAP:
2942 case LyXRC::RC_KBMAP_PRIMARY:
2943 case LyXRC::RC_KBMAP_SECONDARY:
2944 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2945 case LyXRC::RC_LANGUAGE_AUTO_END:
2946 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2947 case LyXRC::RC_LANGUAGE_COMMAND_END:
2948 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2949 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2950 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2951 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2952 case LyXRC::RC_LYXRCFORMAT:
2953 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2954 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2955 case LyXRC::RC_MACRO_EDIT_STYLE:
2956 case LyXRC::RC_MAKE_BACKUP:
2957 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2958 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2959 case LyXRC::RC_NUMLASTFILES:
2960 case LyXRC::RC_PARAGRAPH_MARKERS:
2961 case LyXRC::RC_PATH_PREFIX:
2962 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2963 prependEnvPath("PATH", lyxrc_new.path_prefix);
2965 case LyXRC::RC_PREVIEW:
2966 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2967 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2968 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2969 case LyXRC::RC_PRINTCOPIESFLAG:
2970 case LyXRC::RC_PRINTER:
2971 case LyXRC::RC_PRINTEVENPAGEFLAG:
2972 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2973 case LyXRC::RC_PRINTFILEEXTENSION:
2974 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2975 case LyXRC::RC_PRINTODDPAGEFLAG:
2976 case LyXRC::RC_PRINTPAGERANGEFLAG:
2977 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2978 case LyXRC::RC_PRINTPAPERFLAG:
2979 case LyXRC::RC_PRINTREVERSEFLAG:
2980 case LyXRC::RC_PRINTSPOOL_COMMAND:
2981 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2982 case LyXRC::RC_PRINTTOFILE:
2983 case LyXRC::RC_PRINTTOPRINTER:
2984 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2985 case LyXRC::RC_PRINT_COMMAND:
2986 case LyXRC::RC_RTL_SUPPORT:
2987 case LyXRC::RC_SAVE_COMPRESSED:
2988 case LyXRC::RC_SCREEN_DPI:
2989 case LyXRC::RC_SCREEN_FONT_ROMAN:
2990 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2991 case LyXRC::RC_SCREEN_FONT_SANS:
2992 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2993 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2994 case LyXRC::RC_SCREEN_FONT_SIZES:
2995 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2996 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2997 case LyXRC::RC_GEOMETRY_SESSION:
2998 case LyXRC::RC_SCREEN_ZOOM:
2999 case LyXRC::RC_SERVERPIPE:
3000 case LyXRC::RC_SET_COLOR:
3001 case LyXRC::RC_SHOW_BANNER:
3002 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3003 case LyXRC::RC_SPELLCHECKER:
3004 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3006 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3007 case LyXRC::RC_SPELLCHECK_NOTES:
3008 case LyXRC::RC_SPLITINDEX_COMMAND:
3009 case LyXRC::RC_TEMPDIRPATH:
3010 case LyXRC::RC_TEMPLATEPATH:
3011 case LyXRC::RC_TEX_ALLOWS_SPACES:
3012 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3013 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3014 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3016 case LyXRC::RC_TEXINPUTS_PREFIX:
3017 case LyXRC::RC_THESAURUSDIRPATH:
3018 case LyXRC::RC_UIFILE:
3019 case LyXRC::RC_USER_EMAIL:
3020 case LyXRC::RC_USER_NAME:
3021 case LyXRC::RC_USE_CONVERTER_CACHE:
3022 case LyXRC::RC_USE_SYSTEM_COLORS:
3023 case LyXRC::RC_USE_TOOLTIP:
3024 case LyXRC::RC_USE_PIXMAP_CACHE:
3025 case LyXRC::RC_USE_QIMAGE:
3026 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3027 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3028 case LyXRC::RC_SINGLE_INSTANCE:
3029 case LyXRC::RC_SORT_LAYOUTS:
3030 case LyXRC::RC_FULL_SCREEN_LIMIT:
3031 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3032 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3033 case LyXRC::RC_FULL_SCREEN_TABBAR:
3034 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3035 case LyXRC::RC_FULL_SCREEN_WIDTH:
3036 case LyXRC::RC_VISUAL_CURSOR:
3037 case LyXRC::RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3038 case LyXRC::RC_VIEWER:
3039 case LyXRC::RC_VIEWER_ALTERNATIVES:
3040 case LyXRC::RC_FORWARD_SEARCH_DVI:
3041 case LyXRC::RC_FORWARD_SEARCH_PDF:
3042 case LyXRC::RC_EXPORT_OVERWRITE:
3043 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3044 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3045 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3046 case LyXRC::RC_CURSOR_WIDTH:
3053 string const LyXRC::getDescription(LyXRCTags tag)
3058 case RC_ACCEPT_COMPOUND:
3059 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3063 str = _("Specify an alternate language. The default is to use the language of the document.");
3066 case RC_PLAINTEXT_LINELEN:
3067 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.");
3070 case RC_AUTOREGIONDELETE:
3071 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3074 case RC_AUTORESET_OPTIONS:
3075 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3079 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3082 case RC_AUTO_NUMBER:
3085 case RC_BACKUPDIR_PATH:
3086 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.");
3089 case RC_BIBTEX_COMMAND:
3090 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3093 case RC_JBIBTEX_COMMAND:
3094 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3098 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3101 case RC_CHECKLASTFILES:
3102 str = _("Select to check whether the lastfiles still exist.");
3105 case RC_CHKTEX_COMMAND:
3106 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3115 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3116 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.");
3119 case RC_CURSOR_WIDTH:
3120 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3123 case RC_SCROLL_BELOW_DOCUMENT:
3124 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");
3127 case RC_MAC_DONTSWAP_CTRL_META:
3128 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3131 case RC_MAC_LIKE_WORD_MOVEMENT:
3132 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3135 case RC_SHOW_MACRO_LABEL:
3136 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3139 case RC_DATE_INSERT_FORMAT:
3140 //xgettext:no-c-format
3141 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3145 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3148 case RC_DEFAULT_VIEW_FORMAT:
3149 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3152 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3153 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3156 case RC_DISPLAY_GRAPHICS:
3157 str = _("Select how LyX will display any graphics.");
3160 case RC_DOCUMENTPATH:
3161 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3165 str = _("Specify additional chars that can be part of a word.");
3168 case RC_EXAMPLEPATH:
3169 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3172 case RC_FONT_ENCODING:
3173 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3176 case RC_FORCE_PAINT_SINGLE_CHAR:
3177 str = _("Disable any kerning and ligatures for text drawing on screen.");
3183 case RC_INDEX_COMMAND:
3184 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\".");
3187 case RC_JINDEX_COMMAND:
3188 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3191 case RC_NOMENCL_COMMAND:
3192 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3199 case RC_KBMAP_PRIMARY:
3200 case RC_KBMAP_SECONDARY:
3201 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.");
3204 case RC_LANGUAGE_AUTO_BEGIN:
3205 str = _("Select if a language switching command is needed at the beginning of the document.");
3208 case RC_LANGUAGE_AUTO_END:
3209 str = _("Select if a language switching command is needed at the end of the document.");
3212 case RC_LANGUAGE_COMMAND_BEGIN:
3213 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.");
3216 case RC_LANGUAGE_COMMAND_END:
3217 str = _("The LaTeX command for changing back to the language of the document.");
3220 case RC_LANGUAGE_COMMAND_LOCAL:
3221 str = _("The LaTeX command for local changing of the language.");
3224 case RC_LANGUAGE_GLOBAL_OPTIONS:
3225 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3228 case RC_LANGUAGE_CUSTOM_PACKAGE:
3229 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3232 case RC_LANGUAGE_PACKAGE_SELECTION:
3233 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3236 case RC_USELASTFILEPOS:
3237 str = _("De-select if you do not want LyX to scroll to saved position.");
3240 case RC_LOADSESSION:
3241 str = _("De-select to prevent loading files opened from the last LyX session.");
3244 case RC_MAKE_BACKUP:
3245 str = _("De-select if you don't want LyX to create backup files.");
3248 case RC_MARK_FOREIGN_LANGUAGE:
3249 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3252 case RC_MOUSE_WHEEL_SPEED:
3253 str = bformat(_("The scrolling speed of the mouse wheel."),
3257 case RC_COMPLETION_POPUP_DELAY:
3258 str = _("The completion popup delay.");
3261 case RC_COMPLETION_POPUP_MATH:
3262 str = _("Select to display the completion popup in math mode.");
3265 case RC_COMPLETION_POPUP_TEXT:
3266 str = _("Select to display the completion popup in text mode.");
3269 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3270 str = _("Show the completion popup without delay after non-unique completion attempt.");
3273 case RC_COMPLETION_POPUP_TEXT:
3274 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3277 case RC_COMPLETION_POPUP_DELAY:
3278 str = _("The inline completion delay.");
3281 case RC_COMPLETION_INLINE_MATH:
3282 str = _("Select to display the inline completion in math mode.");
3285 case RC_COMPLETION_INLINE_TEXT:
3286 str = _("Select to display the inline completion in text mode.");
3289 case RC_COMPLETION_INLINE_DOTS:
3290 str = _("Use \"...\" to shorten long completions.");
3293 case RC_AUTOCORRECTION_MATH:
3294 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3297 case RC_NUMLASTFILES:
3298 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3302 case RC_PATH_PREFIX:
3303 str = _("Specify those directories which should be "
3304 "prepended to the PATH environment variable.\n"
3305 "Use the OS native format.");
3309 str = _("Shows a typeset preview of things such as math");
3312 case RC_PREVIEW_HASHED_LABELS:
3313 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3316 case RC_PREVIEW_SCALE_FACTOR:
3317 str = _("Scale the preview size to suit.");
3320 case RC_PRINTCOLLCOPIESFLAG:
3321 str = _("The option for specifying whether the copies should be collated.");
3324 case RC_PRINTCOPIESFLAG:
3325 str = _("The option for specifying the number of copies to print.");
3329 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3332 case RC_PRINTEVENPAGEFLAG:
3333 str = _("The option to print only even pages.");
3336 case RC_PRINTEXSTRAOPTIONS:
3337 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3340 case RC_PRINTFILEEXTENSION:
3341 str = _("Extension of printer program output file. Usually \".ps\".");
3344 case RC_PRINTLANDSCAPEFLAG:
3345 str = _("The option to print out in landscape.");
3348 case RC_PRINTODDPAGEFLAG:
3349 str = _("The option to print only odd pages.");
3352 case RC_PRINTPAGERANGEFLAG:
3353 str = _("The option for specifying a comma-separated list of pages to print.");
3356 case RC_PRINTPAPERDIMENSIONFLAG:
3357 str = _("Option to specify the dimensions of the print paper.");
3360 case RC_PRINTPAPERFLAG:
3361 str = _("The option to specify paper type.");
3364 case RC_PRINTREVERSEFLAG:
3365 str = _("The option to reverse the order of the pages printed.");
3368 case RC_PRINTSPOOL_COMMAND:
3369 str = _("When set, this printer option automatically prints to a file and then calls a separate print spooling program on that file with the given name and arguments.");
3372 case RC_PRINTSPOOL_PRINTERPREFIX:
3373 str = _("If you specify a printer name in the print dialog, the following argument is prepended along with the printer name after the spool command.");
3376 case RC_PRINTTOFILE:
3377 str = _("Option to pass to the print program to print to a file.");
3380 case RC_PRINTTOPRINTER:
3381 str = _("Option to pass to the print program to print on a specific printer.");
3384 case RC_PRINT_ADAPTOUTPUT:
3385 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3388 case RC_PRINT_COMMAND:
3389 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3392 case RC_RTL_SUPPORT:
3393 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3396 case RC_VISUAL_CURSOR:
3397 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3400 case RC_CLOSE_BUFFER_WITH_LAST_VIEW:
3401 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).");
3405 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3408 case RC_SCREEN_FONT_ROMAN:
3409 case RC_SCREEN_FONT_SANS:
3410 case RC_SCREEN_FONT_TYPEWRITER:
3411 str = _("The screen fonts used to display the text while editing.");
3414 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3415 case RC_SCREEN_FONT_SANS_FOUNDRY:
3416 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3419 case RC_SCREEN_FONT_SCALABLE:
3420 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.");
3423 case RC_SCREEN_FONT_SIZES:
3424 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3427 case RC_SCREEN_ZOOM:
3428 //xgettext:no-c-format
3429 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3432 case RC_GEOMETRY_SESSION:
3433 str = _("Allow session manager to save and restore windows geometry.");
3437 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3443 case RC_SHOW_BANNER:
3444 str = _("De-select if you don't want the startup banner.");
3447 case RC_TEMPDIRPATH:
3448 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3451 case RC_THESAURUSDIRPATH:
3452 str = _("This is the place where the files of the thesaurus library reside.");
3455 case RC_TEMPLATEPATH:
3456 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3459 case RC_TEX_ALLOWS_SPACES:
3462 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3465 case RC_TEXINPUTS_PREFIX:
3466 str = _("Specify those directories which should be "
3467 "prepended to the TEXINPUTS environment variable.\n"
3468 "A '.' represents the current document directory. "
3469 "Use the OS native format.");
3473 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3482 case RC_USE_USE_SYSTEM_COLORS:
3483 str = _("Enable use the system colors for some things like main window background and selection.");
3486 case RC_USE_TOOLTIP:
3487 str = _("Enable the automatic appearance of tool tips in the work area.");
3490 case RC_USE_PIXMAP_CACHE:
3491 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3494 case RC_VIEWDVI_PAPEROPTION:
3495 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3510 // The global instance
3513 // The global copy of the system lyxrc entries (everything except preferences)