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 = 3;
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 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
77 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
78 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
79 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
80 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
81 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
82 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
83 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
84 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
85 { "\\converter", LyXRC::RC_CONVERTER },
86 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
87 { "\\copier", LyXRC::RC_COPIER },
88 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
89 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
90 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
91 { "\\def_file", LyXRC::RC_DEFFILE },
92 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
93 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
94 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
95 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
96 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
97 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
98 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
99 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
100 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
101 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
102 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
103 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
104 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
105 { "\\format", LyXRC::RC_FILEFORMAT },
106 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
107 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
108 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
109 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
110 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
111 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
112 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
113 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
114 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
115 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
116 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
117 { "\\icon_set", LyXRC::RC_ICON_SET },
118 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
119 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
120 { "\\input", LyXRC::RC_INPUT },
121 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
122 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
123 { "\\kbmap", LyXRC::RC_KBMAP },
124 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
125 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
126 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
127 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
128 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
129 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
130 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
131 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
132 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
133 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
134 { "\\load_session", LyXRC::RC_LOADSESSION },
135 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
136 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
137 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
138 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
139 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
140 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
141 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
142 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
143 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
144 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
145 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
146 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
147 { "\\preview", LyXRC::RC_PREVIEW },
148 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
149 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
150 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
151 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
152 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
153 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
154 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
155 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
156 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
157 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
158 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
159 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
160 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
161 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
162 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
163 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
164 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
165 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
166 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
167 { "\\printer", LyXRC::RC_PRINTER },
168 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
169 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
170 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
171 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
172 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
173 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
174 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
175 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
176 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
177 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
178 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
179 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
180 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
181 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
182 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
183 { "\\set_color", LyXRC::RC_SET_COLOR },
184 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
185 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
186 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
187 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
188 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
189 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
190 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
191 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
192 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
193 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
194 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
195 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
196 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
197 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
198 { "\\ui_file", LyXRC::RC_UIFILE },
199 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
200 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
201 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
202 // compatibility with versions older than 1.4.0 only
203 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
204 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
205 { "\\user_email", LyXRC::RC_USER_EMAIL },
206 { "\\user_name", LyXRC::RC_USER_NAME },
207 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
208 // compatibility with versions older than 1.4.0 only
209 { "\\viewer", LyXRC::RC_VIEWER},
210 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
211 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
212 { "format", LyXRC::RC_LYXRCFORMAT }
215 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
226 void LyXRC::setDefaults()
230 def_file = "default";
232 // The current document directory
233 texinputs_prefix = ".";
234 // Get printer from the environment. If fail, use default "",
235 // assuming that everything is set up correctly.
236 printer = getEnv("PRINTER");
237 print_adapt_output = false;
238 print_command = "dvips";
239 print_evenpage_flag = "-B";
240 print_oddpage_flag = "-A";
241 print_pagerange_flag = "-pp";
242 print_copies_flag = "-c";
243 print_collcopies_flag = "-C";
244 print_reverse_flag = "-r";
245 print_landscape_flag = "-t landscape";
246 print_to_printer = "-P";
247 print_to_file = "-o ";
248 print_file_extension = ".ps";
249 print_paper_flag = "-t";
250 print_paper_dimension_flag = "-T";
251 document_path.erase();
252 view_dvi_paper_option.erase();
253 default_papersize = PAPER_DEFAULT;
254 default_view_format = "pdf2";
255 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
256 bibtex_command = "bibtex";
258 index_command = "makeindex -c -q";
259 nomencl_command = "makeindex -s nomencl.ist";
261 // Because a screen is typically wider than a piece of paper:
263 allow_geometry_session = true;
264 // Default LaTeX font size:
265 font_sizes[FONT_SIZE_TINY] = "5.0";
266 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
267 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
268 font_sizes[FONT_SIZE_SMALL] = "9.0";
269 font_sizes[FONT_SIZE_NORMAL] = "10.0";
270 font_sizes[FONT_SIZE_LARGE] = "12.0";
271 font_sizes[FONT_SIZE_LARGER] = "14.4";
272 font_sizes[FONT_SIZE_LARGEST] = "17.26";
273 font_sizes[FONT_SIZE_HUGE] = "20.74";
274 font_sizes[FONT_SIZE_HUGER] = "24.88";
275 use_scalable_fonts = true;
276 roman_font_name = "";
278 typewriter_font_name = "";
280 auto_region_delete = true;
281 auto_reset_options = false;
282 plaintext_linelen = 65;
283 mouse_wheel_speed = 1.0;
284 num_lastfiles = maxlastfiles;
285 check_lastfiles = true;
286 use_lastfilepos = true;
287 load_session = false;
289 save_compressed = false;
290 backupdir_path.erase();
291 display_graphics = true;
292 // Spellchecker settings:
293 // FIXME: this check should test the target platform (darwin)
294 #if defined(USE_MACOSX_PACKAGING)
295 spellchecker = "native";
296 #elif defined(USE_ASPELL)
297 spellchecker = "aspell";
298 #elif defined(USE_HUNSPELL)
299 spellchecker = "hunspell";
301 spellchecker = "aspell";
303 spellchecker_accept_compound = false;
304 spellcheck_continuously = false;
305 spellcheck_notes = true;
308 visual_cursor = false;
310 mark_foreign_language = true;
311 language_auto_begin = true;
312 language_auto_end = true;
313 language_global_options = true;
314 language_package_selection = LP_AUTO;
315 language_custom_package = "\\usepackage{babel}";
316 language_command_begin = "\\selectlanguage{$$lang}";
317 language_command_local = "\\foreignlanguage{$$lang}{";
318 sort_layouts = false;
319 group_layouts = true;
320 default_language = "english";
321 gui_language = "auto";
323 windows_style_tex_paths = false;
324 tex_allows_spaces = false;
325 date_insert_format = "%x";
326 cursor_follows_scrollbar = false;
327 scroll_below_document = false;
328 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
329 paragraph_markers = false;
330 mac_dontswap_ctrl_meta = false;
331 mac_like_word_movement = false;
332 macro_edit_style = MACRO_EDIT_INLINE_BOX;
333 dialogs_iconify_with_main = false;
334 preview = PREVIEW_OFF;
335 preview_hashed_labels = false;
336 preview_scale_factor = 1.0;
337 use_converter_cache = true;
338 use_system_colors = false;
340 use_pixmap_cache = false;
341 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
342 user_name = to_utf8(support::user_name());
343 user_email = to_utf8(support::user_email());
344 open_buffers_in_tabs = true;
345 single_close_tab_button = false;
346 single_instance = true;
347 forward_search_dvi = string();
348 forward_search_pdf = string();
349 export_overwrite = NO_FILES;
351 // Fullscreen settings
352 full_screen_limit = false;
353 full_screen_toolbars = true;
354 full_screen_tabbar = true;
355 full_screen_menubar = true;
356 full_screen_scrollbar = true;
357 full_screen_width = 700;
359 completion_cursor_text = true;
360 completion_popup_math = true;
361 completion_popup_text = false;
362 completion_popup_delay = 2.0;
363 completion_popup_after_complete = true;
364 autocorrection_math = false;
365 completion_inline_math = true;
366 completion_inline_text = false;
367 completion_inline_dots = -1;
368 completion_inline_delay = 0.2;
369 default_decimal_point = ".";
376 void oldFontFormat(string & family, string & foundry)
378 if (family.empty() || family[0] != '-')
380 foundry = token(family, '-', 1);
381 family = token(family, '-', 2);
389 bool LyXRC::read(FileName const & filename, bool check_format)
391 Lexer lexrc(lyxrcTags);
392 lexrc.setFile(filename);
393 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
394 ReturnValues retval = read(lexrc, check_format);
395 if (!check_format || retval != FormatMismatch)
396 return retval == ReadOK;
398 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
399 FileName const tempfile = FileName::tempName("convert_lyxrc");
400 bool const success = prefs2prefs(filename, tempfile, false);
402 LYXERR0 ("Unable to convert " << filename.absFileName() <<
403 " to format " << LYXRC_FILEFORMAT);
406 Lexer lexrc2(lyxrcTags);
407 lexrc2.setFile(tempfile);
408 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
409 retval = read(lexrc2, check_format);
410 tempfile.removeFile();
411 return retval == ReadOK;
415 // don't need to worry about conversion, because this is always
416 // from an internal source
417 bool LyXRC::read(istream & is)
419 Lexer lexrc(lyxrcTags);
421 LYXERR(Debug::LYXRC, "Reading istream...");
422 return read(lexrc, false) == ReadOK;
426 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
428 if (lyxerr.debugging(Debug::PARSER))
429 lexrc.printTable(lyxerr);
434 // default for current rowpainter capabilities
435 force_paint_single_char = true;
437 // format prior to 2.0 and introduction of format tag
438 unsigned int format = 0;
440 while (lexrc.isOK()) {
441 // By using two switches we take advantage of the compiler
442 // telling us if we have missed a LyXRCTags element in
443 // the second switch.
444 // Note that this also shows a problem with Lexer since it
445 // helps us avoid taking advantage of the strictness of the
448 int le = lexrc.lex();
450 case Lexer::LEX_UNDEF:
451 lexrc.printError("Unknown tag `$$Token'");
453 case Lexer::LEX_FEOF:
458 switch (static_cast<LyXRCTags>(le)) {
461 format = lexrc.getInteger();
463 case RC_INPUT: // Include file
466 libFileSearch(string(),
468 if (read(tmp, check_format)) {
470 "Error reading included file: " + tmp.absFileName());
476 bind_file = os::internal_path(lexrc.getString());
481 def_file = os::internal_path(lexrc.getString());
486 ui_file = os::internal_path(lexrc.getString());
489 case RC_AUTORESET_OPTIONS:
490 lexrc >> auto_reset_options;
493 case RC_DISPLAY_GRAPHICS:
495 display_graphics = lexrc.getString() == "true";
498 case RC_TEX_EXPECTS_WINDOWS_PATHS:
499 lexrc >> windows_style_tex_paths;
502 case RC_TEX_ALLOWS_SPACES:
503 lexrc >> tex_allows_spaces;
506 case RC_TEXINPUTS_PREFIX:
507 lexrc >> texinputs_prefix;
514 case RC_KBMAP_PRIMARY:
516 string const kmap(os::internal_path(lexrc.getString()));
517 if (!libFileSearch("kbd", kmap, "kmap").empty()
519 primary_kbmap = kmap;
521 lexrc.printError("LyX: Keymap `$$Token' not found");
526 case RC_KBMAP_SECONDARY:
528 string const kmap(os::internal_path(lexrc.getString()));
529 if (!libFileSearch("kbd", kmap, "kmap").empty()
531 secondary_kbmap = kmap;
533 lexrc.printError("LyX: Keymap `$$Token' not found");
538 case RC_FONT_ENCODING:
542 case RC_FORCE_PAINT_SINGLE_CHAR:
543 lexrc >> force_paint_single_char;
550 case RC_PRINT_COMMAND:
551 if (lexrc.next(true)) {
552 print_command = lexrc.getString();
556 case RC_PRINTEVENPAGEFLAG:
557 lexrc >> print_evenpage_flag;
560 case RC_PRINTODDPAGEFLAG:
561 lexrc >> print_oddpage_flag;
564 case RC_PRINTPAGERANGEFLAG:
565 lexrc >> print_pagerange_flag;
568 case RC_PRINTCOPIESFLAG:
569 lexrc >> print_copies_flag;
572 case RC_PRINTCOLLCOPIESFLAG:
573 lexrc >> print_collcopies_flag;
576 case RC_PRINTREVERSEFLAG:
577 lexrc >> print_reverse_flag;
580 case RC_PRINTLANDSCAPEFLAG:
581 lexrc >> print_landscape_flag;
584 case RC_PRINTTOPRINTER:
585 lexrc >> print_to_printer;
588 case RC_PRINT_ADAPTOUTPUT:
589 lexrc >> print_adapt_output;
594 print_to_file = os::internal_path(lexrc.getString());
598 case RC_PRINTFILEEXTENSION:
599 lexrc >> print_file_extension;
602 case RC_PRINTEXSTRAOPTIONS:
603 lexrc >> print_extra_options;
606 case RC_PRINTSPOOL_COMMAND:
607 if (lexrc.next(true)) {
608 print_spool_command = lexrc.getString();
612 case RC_PRINTSPOOL_PRINTERPREFIX:
613 lexrc >> print_spool_printerprefix;
616 case RC_PRINTPAPERDIMENSIONFLAG:
617 lexrc >> print_paper_dimension_flag;
620 case RC_PRINTPAPERFLAG:
621 lexrc >> print_paper_flag;
624 case RC_DEFAULT_PAPERSIZE:
626 string const size = ascii_lowercase(lexrc.getString());
627 if (size == "usletter")
628 default_papersize = PAPER_USLETTER;
629 else if (size == "legal")
630 default_papersize = PAPER_USLEGAL;
631 else if (size == "executive")
632 default_papersize = PAPER_USEXECUTIVE;
633 else if (size == "a3")
634 default_papersize = PAPER_A3;
635 else if (size == "a4")
636 default_papersize = PAPER_A4;
637 else if (size == "a5")
638 default_papersize = PAPER_A5;
639 else if (size == "b5")
640 default_papersize = PAPER_B5;
641 else if (size == "default")
642 default_papersize = PAPER_DEFAULT;
646 case RC_VIEWDVI_PAPEROPTION:
648 view_dvi_paper_option = lexrc.getString();
650 view_dvi_paper_option.erase();
653 case RC_CHKTEX_COMMAND:
654 if (lexrc.next(true)) {
655 chktex_command = lexrc.getString();
659 case RC_BIBTEX_ALTERNATIVES:
660 if (lexrc.next(true)) {
661 bibtex_alternatives.insert(lexrc.getString());
665 case RC_BIBTEX_COMMAND:
666 if (lexrc.next(true)) {
667 bibtex_command = lexrc.getString();
671 case RC_JBIBTEX_COMMAND:
672 if (lexrc.next(true)) {
673 jbibtex_command = lexrc.getString();
677 case RC_INDEX_ALTERNATIVES:
678 if (lexrc.next(true)) {
679 index_alternatives.insert(lexrc.getString());
683 case RC_INDEX_COMMAND:
684 if (lexrc.next(true)) {
685 index_command = lexrc.getString();
689 case RC_JINDEX_COMMAND:
690 if (lexrc.next(true)) {
691 jindex_command = lexrc.getString();
695 case RC_SPLITINDEX_COMMAND:
696 if (lexrc.next(true)) {
697 splitindex_command = lexrc.getString();
701 case RC_NOMENCL_COMMAND:
702 if (lexrc.next(true)) {
703 nomencl_command = lexrc.getString();
715 case RC_GEOMETRY_SESSION:
716 lexrc >> allow_geometry_session;
719 case RC_SCREEN_FONT_SIZES:
720 lexrc >> font_sizes[FONT_SIZE_TINY];
721 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
722 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
723 lexrc >> font_sizes[FONT_SIZE_SMALL];
724 lexrc >> font_sizes[FONT_SIZE_NORMAL];
725 lexrc >> font_sizes[FONT_SIZE_LARGE];
726 lexrc >> font_sizes[FONT_SIZE_LARGER];
727 lexrc >> font_sizes[FONT_SIZE_LARGEST];
728 lexrc >> font_sizes[FONT_SIZE_HUGE];
729 lexrc >> font_sizes[FONT_SIZE_HUGER];
732 case RC_SCREEN_FONT_SCALABLE:
733 lexrc >> use_scalable_fonts;
740 case RC_DOCUMENTPATH:
742 document_path = os::internal_path(lexrc.getString());
743 document_path = expandPath(document_path);
749 example_path = os::internal_path(lexrc.getString());
750 example_path = expandPath(example_path);
754 case RC_TEMPLATEPATH:
756 template_path = os::internal_path(lexrc.getString());
757 template_path = expandPath(template_path);
763 tempdir_path = os::internal_path(lexrc.getString());
764 tempdir_path = expandPath(tempdir_path);
768 case RC_THESAURUSDIRPATH:
770 thesaurusdir_path = os::internal_path(lexrc.getString());
771 thesaurusdir_path = expandPath(thesaurusdir_path);
775 case RC_HUNSPELLDIR_PATH:
777 hunspelldir_path = os::internal_path(lexrc.getString());
778 hunspelldir_path = expandPath(hunspelldir_path);
782 case RC_USELASTFILEPOS:
783 lexrc >> use_lastfilepos;
787 lexrc >> load_session;
790 case RC_MOUSE_WHEEL_SPEED:
791 lexrc >> mouse_wheel_speed;
794 case RC_COMPLETION_INLINE_DELAY:
795 lexrc >> completion_inline_delay;
798 case RC_COMPLETION_INLINE_MATH:
799 lexrc >> completion_inline_math;
802 case RC_COMPLETION_INLINE_TEXT:
803 lexrc >> completion_inline_text;
806 case RC_COMPLETION_INLINE_DOTS:
807 lexrc >> completion_inline_dots;
810 case RC_AUTOCORRECTION_MATH:
811 lexrc >> autocorrection_math;
814 case RC_COMPLETION_POPUP_DELAY:
815 lexrc >> completion_popup_delay;
818 case RC_COMPLETION_POPUP_MATH:
819 lexrc >> completion_popup_math;
822 case RC_COMPLETION_POPUP_TEXT:
823 lexrc >> completion_popup_text;
826 case RC_COMPLETION_CURSOR_TEXT:
827 lexrc >> completion_cursor_text;
830 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
831 lexrc >> completion_popup_after_complete;
834 case RC_NUMLASTFILES:
835 lexrc >> num_lastfiles;
838 case RC_CHECKLASTFILES:
839 lexrc >> check_lastfiles;
846 case RC_SCREEN_FONT_ROMAN:
848 roman_font_name = lexrc.getString();
849 oldFontFormat(roman_font_name,
854 case RC_SCREEN_FONT_SANS:
856 sans_font_name = lexrc.getString();
857 oldFontFormat(sans_font_name, sans_font_foundry);
861 case RC_SCREEN_FONT_TYPEWRITER:
863 typewriter_font_name = lexrc.getString();
864 oldFontFormat(typewriter_font_name,
865 typewriter_font_foundry);
869 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
870 lexrc >> roman_font_foundry;
873 case RC_SCREEN_FONT_SANS_FOUNDRY:
874 lexrc >> sans_font_foundry;
877 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
878 lexrc >> typewriter_font_foundry;
883 lexrc.printError("Missing color tag.");
886 string lyx_name = lexrc.getString();
889 lexrc.printError("Missing color name for color: `$$Token'");
892 string x11_name = lexrc.getString();
894 ColorCode const col =
895 lcolor.getFromLyXName(lyx_name);
896 if (col == Color_none ||
897 col == Color_inherit ||
901 if (!lcolor.setColor(col, x11_name))
902 LYXERR0("Bad lyxrc set_color for " << lyx_name);
906 case RC_AUTOREGIONDELETE:
907 // Auto region delete defaults to true
908 lexrc >> auto_region_delete;
913 lyxpipes = os::internal_path(lexrc.getString());
914 lyxpipes = expandPath(lyxpipes);
918 case RC_CURSOR_FOLLOWS_SCROLLBAR:
919 lexrc >> cursor_follows_scrollbar;
922 case RC_CURSOR_WIDTH:
923 lexrc >> cursor_width;
926 case RC_SCROLL_BELOW_DOCUMENT:
927 lexrc >> scroll_below_document;
930 case RC_PARAGRAPH_MARKERS:
931 lexrc >> paragraph_markers;
934 case RC_MAC_DONTSWAP_CTRL_META:
935 lexrc >> mac_dontswap_ctrl_meta;
938 case RC_MAC_LIKE_WORD_MOVEMENT:
939 lexrc >> mac_like_word_movement;
942 case RC_MACRO_EDIT_STYLE:
944 switch (lexrc.getInteger()) {
945 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
946 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
947 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
952 case RC_DIALOGS_ICONIFY_WITH_MAIN:
953 lexrc >> dialogs_iconify_with_main;
956 case RC_PLAINTEXT_LINELEN:
957 lexrc >> plaintext_linelen;
959 // Spellchecker settings:
960 case RC_ACCEPT_COMPOUND:
961 lexrc >> spellchecker_accept_compound;
963 case RC_USE_SYSTEM_COLORS:
964 lexrc >> use_system_colors;
967 lexrc >> use_tooltip;
969 case RC_USE_PIXMAP_CACHE:
970 lexrc >> use_pixmap_cache;
972 case RC_SPELLCHECKER:
973 lexrc >> spellchecker;
976 lexrc >> spellchecker_alt_lang;
979 lexrc >> spellchecker_esc_chars;
981 case RC_SPELLCHECK_CONTINUOUSLY:
982 lexrc >> spellcheck_continuously;
984 case RC_SPELLCHECK_NOTES:
985 lexrc >> spellcheck_notes;
988 lexrc >> make_backup;
990 case RC_SAVE_COMPRESSED:
991 lexrc >> save_compressed;
993 case RC_BACKUPDIR_PATH:
995 backupdir_path = os::internal_path(lexrc.getString());
996 backupdir_path = expandPath(backupdir_path);
999 case RC_DEFAULT_DECIMAL_POINT:
1000 lexrc >> default_decimal_point;
1002 case RC_DATE_INSERT_FORMAT:
1003 lexrc >> date_insert_format;
1005 case RC_LANGUAGE_CUSTOM_PACKAGE:
1006 lexrc >> language_custom_package;
1008 case RC_LANGUAGE_AUTO_BEGIN:
1009 lexrc >> language_auto_begin;
1011 case RC_LANGUAGE_AUTO_END:
1012 lexrc >> language_auto_end;
1014 case RC_LANGUAGE_GLOBAL_OPTIONS:
1015 lexrc >> language_global_options;
1017 case RC_LANGUAGE_PACKAGE_SELECTION:
1019 switch (lexrc.getInteger()) {
1021 language_package_selection = LP_AUTO;
1024 language_package_selection = LP_BABEL;
1027 language_package_selection = LP_CUSTOM;
1030 language_package_selection = LP_NONE;
1035 case RC_LANGUAGE_COMMAND_BEGIN:
1036 lexrc >> language_command_begin;
1038 case RC_LANGUAGE_COMMAND_END:
1039 lexrc >> language_command_end;
1041 case RC_LANGUAGE_COMMAND_LOCAL:
1042 lexrc >> language_command_local;
1044 case RC_RTL_SUPPORT:
1045 lexrc >> rtl_support;
1047 case RC_VISUAL_CURSOR:
1048 lexrc >> visual_cursor;
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: {
1091 string format, extensions, prettyname, shortcut;
1092 lexrc >> format >> extensions >> prettyname >> shortcut;
1093 string viewer, editor;
1094 if (lexrc.next(true))
1095 viewer = lexrc.getString();
1096 if (lexrc.next(true))
1097 editor = lexrc.getString();
1099 // Hack to ensure compatibility with versions older
1101 int le = lexrc.lex();
1102 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1103 flags = lexrc.getString();
1104 if (le != Lexer::LEX_DATA) {
1105 // We have got a known token.
1106 // Therefore this is an old style
1107 // format definition without
1109 lexrc.pushToken(flags);
1113 int flgs = Format::none;
1114 while (!flags.empty()) {
1116 flags = split(flags, flag, ',');
1117 if (flag == "document")
1118 flgs |= Format::document;
1119 else if (flag == "vector")
1120 flgs |= Format::vector;
1121 else if (flag == "zipped=native")
1122 flgs |= Format::zipped_native;
1123 else if (flag == "menu=export")
1124 flgs |= Format::export_menu;
1126 LYXERR0("Ignoring unknown flag `"
1127 << flag << "' for format `"
1130 if (prettyname.empty()) {
1131 if (theConverters().formatIsUsed(format))
1132 LYXERR0("Can't delete format " << format);
1134 formats.erase(format);
1136 formats.add(format, extensions, prettyname,
1137 shortcut, viewer, editor, flgs);
1141 case RC_VIEWER_ALTERNATIVES: {
1142 string format, command;
1144 format = lexrc.getString();
1145 if (lexrc.eatLine())
1146 command = lexrc.getString();
1147 viewer_alternatives[format].insert(command);
1150 case RC_EDITOR_ALTERNATIVES: {
1151 string format, command;
1153 format = lexrc.getString();
1154 if (lexrc.eatLine())
1155 command = lexrc.getString();
1156 editor_alternatives[format].insert(command);
1160 case RC_DEFAULT_VIEW_FORMAT:
1161 lexrc >> default_view_format;
1164 case RC_DEFAULT_LANGUAGE:
1165 lexrc >> default_language;
1168 case RC_GUI_LANGUAGE:
1169 lexrc >> gui_language;
1172 case RC_SHOW_BANNER:
1173 lexrc >> show_banner;
1178 string const tmp = lexrc.getString();
1179 if (tmp == "true" || tmp == "on")
1180 preview = PREVIEW_ON;
1181 else if (tmp == "no_math")
1182 preview = PREVIEW_NO_MATH;
1184 preview = PREVIEW_OFF;
1185 if (tmp != "false" && tmp != "off")
1186 LYXERR0("Unrecognized preview status \""
1192 case RC_PREVIEW_HASHED_LABELS:
1193 lexrc >> preview_hashed_labels;
1196 case RC_PREVIEW_SCALE_FACTOR:
1197 lexrc >> preview_scale_factor;
1204 lexrc >> user_email;
1207 case RC_PATH_PREFIX:
1208 lexrc >> path_prefix;
1211 case RC_USE_CONVERTER_CACHE:
1212 lexrc >> use_converter_cache;
1214 case RC_CONVERTER_CACHE_MAXAGE:
1215 lexrc >> converter_cache_maxage;
1218 case RC_SORT_LAYOUTS:
1219 lexrc >> sort_layouts;
1221 case RC_GROUP_LAYOUTS:
1222 lexrc >> group_layouts;
1224 case RC_FULL_SCREEN_LIMIT:
1225 lexrc >> full_screen_limit;
1227 case RC_FULL_SCREEN_TOOLBARS:
1228 lexrc >> full_screen_toolbars;
1230 case RC_FULL_SCREEN_SCROLLBAR:
1231 lexrc >> full_screen_scrollbar;
1233 case RC_FULL_SCREEN_TABBAR:
1234 lexrc >> full_screen_tabbar;
1236 case RC_FULL_SCREEN_MENUBAR:
1237 lexrc >> full_screen_menubar;
1239 case RC_FULL_SCREEN_WIDTH:
1240 lexrc >> full_screen_width;
1242 case RC_OPEN_BUFFERS_IN_TABS:
1243 lexrc >> open_buffers_in_tabs;
1245 case RC_SINGLE_CLOSE_TAB_BUTTON:
1246 lexrc >> single_close_tab_button;
1248 case RC_SINGLE_INSTANCE:
1249 lexrc >> single_instance;
1250 if (run_mode == PREFERRED)
1251 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1253 case RC_FORWARD_SEARCH_DVI:
1254 if (lexrc.next(true))
1255 forward_search_dvi = lexrc.getString();
1257 case RC_FORWARD_SEARCH_PDF:
1258 if (lexrc.next(true))
1259 forward_search_pdf = lexrc.getString();
1261 case RC_EXPORT_OVERWRITE:
1263 string const tmp = lexrc.getString();
1264 if (tmp == "all" || tmp == "true")
1265 export_overwrite = ALL_FILES;
1266 else if (tmp == "main")
1267 export_overwrite = MAIN_FILE;
1269 export_overwrite = NO_FILES;
1270 if (tmp != "ask" && tmp != "false")
1271 LYXERR0("Unrecognized export_overwrite status \""
1276 case RC_SCROLL_WHEEL_ZOOM:
1278 string const tmp = lexrc.getString();
1280 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1281 else if (tmp == "shift")
1282 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1283 else if (tmp == "alt")
1284 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1286 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1287 if (tmp != "off" && tmp != "false")
1288 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1295 break; // this is just a dummy
1298 // This is triggered the first time through the loop unless
1299 // we hit a format tag.
1300 if (check_format && format != LYXRC_FILEFORMAT)
1301 return FormatMismatch;
1304 /// Update converters data-structures
1305 theConverters().update(formats);
1306 theConverters().buildGraph();
1312 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1314 ofstream ofs(filename.toFilesystemEncoding().c_str());
1316 write(ofs, ignore_system_lyxrc);
1320 void LyXRC::print() const
1322 if (lyxerr.debugging())
1323 write(lyxerr, false);
1331 typedef pair<string, SpecialisedMover> Data;
1333 SameMover(Data const & comparison)
1334 : comparison_(comparison) {}
1336 bool operator()(Data const & data) const
1338 return data.first == comparison_.first &&
1339 data.second.command() == comparison_.second.command();
1349 // Escape \ and " so that LyXLex can read the string later
1350 string escapeCommand(string const & str) {
1351 return subst(subst(str , "\\", "\\\\"),
1358 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1360 LyXRCTags tag = RC_LAST;
1362 if (!name.empty()) {
1363 for (int i = 0; i != lyxrcCount; ++i)
1364 if ("\\" + name == lyxrcTags[i].tag)
1365 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1369 os << "# LyX " << lyx_version
1370 << " generated this file. If you want to make your own\n"
1371 << "# modifications you should do them from inside LyX and save.\n\n"
1372 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1374 // Why the switch you might ask. It is a trick to ensure that all
1375 // the elements in the LyXRCTags enum are handled. As you can see
1376 // there are no breaks at all. So it is just a huge fall-through.
1377 // The nice thing is that we will get a warning from the compiler
1378 // if we forget an element.
1382 // input/include files are not done here
1383 case RC_LYXRCFORMAT:
1385 if (ignore_system_lyxrc ||
1386 bind_file != system_lyxrc.bind_file) {
1387 string const path = os::external_path(bind_file);
1388 os << "\\bind_file \"" << path << "\"\n";
1394 if (ignore_system_lyxrc ||
1395 def_file != system_lyxrc.def_file) {
1396 string const path = os::external_path(def_file);
1397 os << "\\def_file \"" << path << "\"\n";
1406 << "# MISC SECTION ######################################\n"
1408 // bind files are not done here.
1410 case RC_PATH_PREFIX:
1411 if (ignore_system_lyxrc ||
1412 path_prefix != system_lyxrc.path_prefix) {
1413 os << "\\path_prefix \"" << path_prefix << "\"\n";
1418 if (ignore_system_lyxrc ||
1419 ui_file != system_lyxrc.ui_file) {
1420 string const path = os::external_path(ui_file);
1421 os << "\\ui_file \"" << path << "\"\n";
1425 case RC_AUTOREGIONDELETE:
1426 if (ignore_system_lyxrc ||
1427 auto_region_delete != system_lyxrc.auto_region_delete) {
1428 os << "# Set to false to inhibit automatic replacement of\n"
1429 << "# the current selection.\n"
1430 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1435 case RC_AUTORESET_OPTIONS:
1436 if (ignore_system_lyxrc ||
1437 auto_reset_options != system_lyxrc.auto_reset_options) {
1438 os << "# Set to false to inhibit automatic reset of\n"
1439 << "# the class options to defaults on class change.\n"
1440 << "\\auto_reset_options "
1441 << convert<string>(auto_reset_options)
1447 if (ignore_system_lyxrc ||
1448 autosave != system_lyxrc.autosave) {
1449 os << "# The time interval between auto-saves in seconds.\n"
1450 << "\\autosave " << autosave << '\n';
1454 case RC_DISPLAY_GRAPHICS:
1455 if (ignore_system_lyxrc ||
1456 display_graphics != system_lyxrc.display_graphics) {
1457 os << "# Display graphics within LyX\n"
1459 << "\\display_graphics "
1460 << (display_graphics ? "true" : "false")
1465 case RC_SORT_LAYOUTS:
1466 if (ignore_system_lyxrc ||
1467 sort_layouts != system_lyxrc.sort_layouts) {
1468 os << "# Sort layouts alphabetically.\n"
1469 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1473 case RC_GROUP_LAYOUTS:
1474 if (ignore_system_lyxrc ||
1475 group_layouts != system_lyxrc.group_layouts) {
1476 os << "# Group layouts by their category.\n"
1477 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1481 case RC_VIEWDVI_PAPEROPTION:
1482 if (ignore_system_lyxrc ||
1483 view_dvi_paper_option
1484 != system_lyxrc.view_dvi_paper_option) {
1485 os << "# Options used to specify paper size to the\n"
1486 << "# view_dvi_command (e.g. -paper)\n"
1487 << "\\view_dvi_paper_option \""
1488 << view_dvi_paper_option << "\"\n";
1492 case RC_DEFAULT_PAPERSIZE:
1493 if (ignore_system_lyxrc ||
1494 default_papersize != system_lyxrc.default_papersize) {
1495 os << "# The default papersize to use.\n"
1496 << "\\default_papersize \"";
1497 switch (default_papersize) {
1499 os << "default"; break;
1500 case PAPER_USLETTER:
1501 os << "usletter"; break;
1503 os << "legal"; break;
1504 case PAPER_USEXECUTIVE:
1505 os << "executive"; break;
1538 case PAPER_JISB6: break;
1544 case RC_CHKTEX_COMMAND:
1545 if (ignore_system_lyxrc ||
1546 chktex_command != system_lyxrc.chktex_command) {
1547 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1551 case RC_BIBTEX_ALTERNATIVES: {
1552 CommandSet::const_iterator it = bibtex_alternatives.begin();
1553 CommandSet::const_iterator end = bibtex_alternatives.end();
1554 for ( ; it != end; ++it) {
1555 if (ignore_system_lyxrc
1556 || !system_lyxrc.bibtex_alternatives.count(*it))
1557 os << "\\bibtex_alternatives \""
1563 case RC_BIBTEX_COMMAND:
1564 if (ignore_system_lyxrc ||
1565 bibtex_command != system_lyxrc.bibtex_command) {
1566 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1570 case RC_JBIBTEX_COMMAND:
1571 if (ignore_system_lyxrc ||
1572 jbibtex_command != system_lyxrc.jbibtex_command) {
1573 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1577 case RC_INDEX_ALTERNATIVES: {
1578 CommandSet::const_iterator it = index_alternatives.begin();
1579 CommandSet::const_iterator end = index_alternatives.end();
1580 for ( ; it != end; ++it) {
1581 if (ignore_system_lyxrc
1582 || !system_lyxrc.index_alternatives.count(*it))
1583 os << "\\index_alternatives \""
1589 case RC_INDEX_COMMAND:
1590 if (ignore_system_lyxrc ||
1591 index_command != system_lyxrc.index_command) {
1592 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1596 case RC_JINDEX_COMMAND:
1597 if (ignore_system_lyxrc ||
1598 jindex_command != system_lyxrc.jindex_command) {
1599 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1603 case RC_SPLITINDEX_COMMAND:
1604 if (ignore_system_lyxrc ||
1605 splitindex_command != system_lyxrc.splitindex_command) {
1606 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1610 case RC_NOMENCL_COMMAND:
1611 if (ignore_system_lyxrc ||
1612 nomencl_command != system_lyxrc.nomencl_command) {
1613 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1617 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1618 // Don't write this setting to the preferences file,
1619 // but allow temporary changes (bug 7557).
1620 if (ignore_system_lyxrc) {
1621 os << "\\tex_expects_windows_paths "
1622 << convert<string>(windows_style_tex_paths) << '\n';
1626 case RC_TEX_ALLOWS_SPACES:
1627 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1628 os << "\\tex_allows_spaces "
1629 << convert<string>(tex_allows_spaces) << '\n';
1634 if (ignore_system_lyxrc ||
1635 use_kbmap != system_lyxrc.use_kbmap) {
1636 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1640 case RC_KBMAP_PRIMARY:
1641 if (ignore_system_lyxrc ||
1642 primary_kbmap != system_lyxrc.primary_kbmap) {
1643 string const path = os::external_path(primary_kbmap);
1644 os << "\\kbmap_primary \"" << path << "\"\n";
1648 case RC_KBMAP_SECONDARY:
1649 if (ignore_system_lyxrc ||
1650 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1651 string const path = os::external_path(secondary_kbmap);
1652 os << "\\kbmap_secondary \"" << path << "\"\n";
1657 if (ignore_system_lyxrc ||
1658 lyxpipes != system_lyxrc.lyxpipes) {
1659 string const path = os::external_path(lyxpipes);
1660 os << "\\serverpipe \"" << path << "\"\n";
1664 case RC_DATE_INSERT_FORMAT:
1665 if (ignore_system_lyxrc ||
1666 date_insert_format != system_lyxrc.date_insert_format) {
1667 os << "\\date_insert_format \"" << date_insert_format
1674 os << "\\user_name \"" << user_name << "\"\n";
1679 os << "\\user_email \"" << user_email << "\"\n";
1683 case RC_SHOW_BANNER:
1684 if (ignore_system_lyxrc ||
1685 show_banner != system_lyxrc.show_banner) {
1686 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1692 if (ignore_system_lyxrc ||
1693 preview != system_lyxrc.preview) {
1699 case PREVIEW_NO_MATH:
1706 os << "\\preview " << status << '\n';
1711 case RC_PREVIEW_HASHED_LABELS:
1712 if (ignore_system_lyxrc ||
1713 preview_hashed_labels !=
1714 system_lyxrc.preview_hashed_labels) {
1715 os << "\\preview_hashed_labels "
1716 << convert<string>(preview_hashed_labels) << '\n';
1721 case RC_PREVIEW_SCALE_FACTOR:
1722 if (ignore_system_lyxrc ||
1723 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1724 os << "\\preview_scale_factor "
1725 << preview_scale_factor << '\n';
1730 case RC_USE_CONVERTER_CACHE:
1731 if (ignore_system_lyxrc ||
1732 use_converter_cache != system_lyxrc.use_converter_cache) {
1733 os << "\\use_converter_cache "
1734 << convert<string>(use_converter_cache) << '\n';
1739 case RC_CONVERTER_CACHE_MAXAGE:
1740 if (ignore_system_lyxrc ||
1741 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1742 os << "\\converter_cache_maxage "
1743 << converter_cache_maxage << '\n';
1749 << "# SCREEN & FONTS SECTION ############################\n"
1753 if (ignore_system_lyxrc ||
1754 icon_set != system_lyxrc.icon_set) {
1755 os << "\\icon_set \"" << icon_set
1762 if (ignore_system_lyxrc ||
1763 dpi != system_lyxrc.dpi) {
1764 os << "\\screen_dpi " << dpi << '\n';
1768 case RC_SCREEN_ZOOM:
1769 if (ignore_system_lyxrc ||
1770 zoom != system_lyxrc.zoom) {
1771 os << "\\screen_zoom " << zoom << '\n';
1775 case RC_GEOMETRY_SESSION:
1776 if (ignore_system_lyxrc ||
1777 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1778 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1783 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1784 if (ignore_system_lyxrc ||
1785 cursor_follows_scrollbar
1786 != system_lyxrc.cursor_follows_scrollbar) {
1787 os << "\\cursor_follows_scrollbar "
1788 << convert<string>(cursor_follows_scrollbar) << '\n';
1792 case RC_CURSOR_WIDTH:
1793 if (ignore_system_lyxrc ||
1795 != system_lyxrc.cursor_width) {
1796 os << "\\cursor_width "
1797 << cursor_width << '\n';
1801 case RC_SCROLL_BELOW_DOCUMENT:
1802 if (ignore_system_lyxrc ||
1803 scroll_below_document
1804 != system_lyxrc.scroll_below_document) {
1805 os << "\\scroll_below_document "
1806 << convert<string>(scroll_below_document) << '\n';
1810 case RC_PARAGRAPH_MARKERS:
1811 if (ignore_system_lyxrc ||
1813 != system_lyxrc.paragraph_markers) {
1814 os << "\\paragraph_markers "
1815 << convert<string>(paragraph_markers) << '\n';
1819 case RC_MAC_DONTSWAP_CTRL_META:
1820 if (ignore_system_lyxrc ||
1821 mac_dontswap_ctrl_meta
1822 != system_lyxrc.mac_dontswap_ctrl_meta) {
1823 os << "\\mac_dontswap_ctrl_meta "
1824 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1828 case RC_MAC_LIKE_WORD_MOVEMENT:
1829 if (ignore_system_lyxrc ||
1830 mac_like_word_movement
1831 != system_lyxrc.mac_like_word_movement) {
1832 os << "\\mac_like_word_movement "
1833 << convert<string>(mac_like_word_movement) << '\n';
1837 case RC_MACRO_EDIT_STYLE:
1838 if (ignore_system_lyxrc ||
1840 != system_lyxrc.macro_edit_style) {
1841 os << "\\macro_edit_style ";
1842 switch (macro_edit_style) {
1843 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1844 case MACRO_EDIT_INLINE: os << "1\n"; break;
1845 case MACRO_EDIT_LIST: os << "2\n"; break;
1850 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1851 if (ignore_system_lyxrc ||
1852 dialogs_iconify_with_main
1853 != system_lyxrc.dialogs_iconify_with_main) {
1854 os << "\\dialogs_iconify_with_main "
1855 << convert<string>(dialogs_iconify_with_main) << '\n';
1859 case RC_SCREEN_FONT_ROMAN:
1860 if (ignore_system_lyxrc ||
1861 roman_font_name != system_lyxrc.roman_font_name) {
1862 os << "\\screen_font_roman \"" << roman_font_name
1867 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1868 if (ignore_system_lyxrc ||
1869 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1870 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1875 case RC_SCREEN_FONT_SANS:
1876 if (ignore_system_lyxrc ||
1877 sans_font_name != system_lyxrc.sans_font_name) {
1878 os << "\\screen_font_sans \"" << sans_font_name
1883 case RC_SCREEN_FONT_SANS_FOUNDRY:
1884 if (ignore_system_lyxrc ||
1885 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1886 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1891 case RC_SCREEN_FONT_TYPEWRITER:
1892 if (ignore_system_lyxrc ||
1893 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1894 os << "\\screen_font_typewriter \""
1895 << typewriter_font_name << "\"\n";
1899 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1900 if (ignore_system_lyxrc ||
1901 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1902 os << "\\screen_font_typewriter_foundry \""
1903 << typewriter_font_foundry << "\"\n";
1908 case RC_SCREEN_FONT_SCALABLE:
1909 if (ignore_system_lyxrc ||
1910 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1911 os << "\\screen_font_scalable "
1912 << convert<string>(use_scalable_fonts)
1917 case RC_SCREEN_FONT_SIZES:
1918 if (ignore_system_lyxrc ||
1919 font_sizes[FONT_SIZE_TINY]
1920 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1921 font_sizes[FONT_SIZE_SCRIPT]
1922 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1923 font_sizes[FONT_SIZE_FOOTNOTE]
1924 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1925 font_sizes[FONT_SIZE_SMALL]
1926 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1927 font_sizes[FONT_SIZE_NORMAL]
1928 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1929 font_sizes[FONT_SIZE_LARGE]
1930 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1931 font_sizes[FONT_SIZE_LARGER]
1932 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1933 font_sizes[FONT_SIZE_LARGEST]
1934 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1935 font_sizes[FONT_SIZE_HUGE]
1936 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1937 font_sizes[FONT_SIZE_HUGER]
1938 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1939 os.setf(ios::fixed);
1941 os << "\\screen_font_sizes"
1942 << ' ' << font_sizes[FONT_SIZE_TINY]
1943 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1944 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1945 << ' ' << font_sizes[FONT_SIZE_SMALL]
1946 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1947 << ' ' << font_sizes[FONT_SIZE_LARGE]
1948 << ' ' << font_sizes[FONT_SIZE_LARGER]
1949 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1950 << ' ' << font_sizes[FONT_SIZE_HUGE]
1951 << ' ' << font_sizes[FONT_SIZE_HUGER]
1956 case RC_FULL_SCREEN_LIMIT:
1957 if (ignore_system_lyxrc ||
1958 full_screen_limit != system_lyxrc.full_screen_limit) {
1959 os << "\\fullscreen_limit "
1960 << convert<string>(full_screen_limit)
1965 case RC_FULL_SCREEN_TOOLBARS:
1966 if (ignore_system_lyxrc ||
1967 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1968 os << "\\fullscreen_toolbars "
1969 << convert<string>(full_screen_toolbars)
1974 case RC_FULL_SCREEN_SCROLLBAR:
1975 if (ignore_system_lyxrc ||
1976 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1977 os << "\\fullscreen_scrollbar "
1978 << convert<string>(full_screen_scrollbar)
1983 case RC_FULL_SCREEN_TABBAR:
1984 if (ignore_system_lyxrc ||
1985 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1986 os << "\\fullscreen_tabbar "
1987 << convert<string>(full_screen_tabbar)
1992 case RC_FULL_SCREEN_MENUBAR:
1993 if (ignore_system_lyxrc ||
1994 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1995 os << "\\fullscreen_menubar "
1996 << convert<string>(full_screen_menubar)
2001 case RC_FULL_SCREEN_WIDTH:
2002 if (ignore_system_lyxrc ||
2003 full_screen_width != system_lyxrc.full_screen_width) {
2004 os << "\\fullscreen_width "
2005 << convert<string>(full_screen_width)
2010 case RC_OPEN_BUFFERS_IN_TABS:
2011 if (ignore_system_lyxrc ||
2012 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2013 os << "\\open_buffers_in_tabs "
2014 << convert<string>(open_buffers_in_tabs)
2019 case RC_SINGLE_CLOSE_TAB_BUTTON:
2020 if (ignore_system_lyxrc ||
2021 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2022 os << "\\single_close_tab_button "
2023 << convert<string>(single_close_tab_button)
2028 case RC_SINGLE_INSTANCE:
2029 if (ignore_system_lyxrc ||
2030 single_instance != system_lyxrc.single_instance) {
2031 os << "\\single_instance "
2032 << convert<string>(single_instance)
2037 case RC_FORWARD_SEARCH_DVI:
2038 if (ignore_system_lyxrc ||
2039 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2040 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2044 case RC_FORWARD_SEARCH_PDF:
2045 if (ignore_system_lyxrc ||
2046 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2047 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2053 << "# COLOR SECTION ###################################\n"
2057 for (int i = 0; i < Color_ignore; ++i) {
2058 ColorCode lc = static_cast<ColorCode>(i);
2059 string const col = lcolor.getX11Name(lc);
2060 if (ignore_system_lyxrc
2061 || col != system_lcolor.getX11Name(lc)) {
2062 os << "\\set_color \""
2063 << lcolor.getLyXName(lc) << "\" \""
2071 << "# PRINTER SECTION ###################################\n"
2075 if (ignore_system_lyxrc ||
2076 printer != system_lyxrc.printer) {
2077 os << "\\printer \"" << printer << "\"\n";
2081 case RC_PRINT_ADAPTOUTPUT:
2082 if (ignore_system_lyxrc ||
2083 print_adapt_output != system_lyxrc.print_adapt_output) {
2084 os << "\\print_adapt_output "
2085 << convert<string>(print_adapt_output)
2090 case RC_PRINT_COMMAND:
2091 if (ignore_system_lyxrc ||
2092 print_command != system_lyxrc.print_command) {
2093 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2097 case RC_PRINTEXSTRAOPTIONS:
2098 if (ignore_system_lyxrc ||
2099 print_extra_options != system_lyxrc.print_extra_options) {
2100 os << "\\print_extra_options \"" << print_extra_options
2105 case RC_PRINTSPOOL_COMMAND:
2106 if (ignore_system_lyxrc ||
2107 print_spool_command != system_lyxrc.print_spool_command) {
2108 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2113 case RC_PRINTSPOOL_PRINTERPREFIX:
2114 if (ignore_system_lyxrc ||
2115 print_spool_printerprefix
2116 != system_lyxrc.print_spool_printerprefix) {
2117 os << "\\print_spool_printerprefix \""
2118 << print_spool_printerprefix << "\"\n";
2122 case RC_PRINTEVENPAGEFLAG:
2123 if (ignore_system_lyxrc ||
2124 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2125 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2130 case RC_PRINTODDPAGEFLAG:
2131 if (ignore_system_lyxrc ||
2132 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2133 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2138 case RC_PRINTREVERSEFLAG:
2139 if (ignore_system_lyxrc ||
2140 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2141 os << "\\print_reverse_flag \"" << print_reverse_flag
2146 case RC_PRINTLANDSCAPEFLAG:
2147 if (ignore_system_lyxrc ||
2148 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2149 os << "\\print_landscape_flag \"" << print_landscape_flag
2154 case RC_PRINTPAGERANGEFLAG:
2155 if (ignore_system_lyxrc ||
2156 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2157 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2162 case RC_PRINTCOPIESFLAG:
2163 if (ignore_system_lyxrc ||
2164 print_copies_flag != system_lyxrc.print_copies_flag) {
2165 os << "\\print_copies_flag \"" << print_copies_flag
2170 case RC_PRINTCOLLCOPIESFLAG:
2171 if (ignore_system_lyxrc ||
2172 print_collcopies_flag
2173 != system_lyxrc.print_collcopies_flag) {
2174 os << "\\print_collcopies_flag \""
2175 << print_collcopies_flag
2180 case RC_PRINTPAPERFLAG:
2181 if (ignore_system_lyxrc ||
2182 print_paper_flag != system_lyxrc.print_paper_flag) {
2183 os << "\\print_paper_flag \"" << print_paper_flag
2188 case RC_PRINTPAPERDIMENSIONFLAG:
2189 if (ignore_system_lyxrc ||
2190 print_paper_dimension_flag
2191 != system_lyxrc.print_paper_dimension_flag) {
2192 os << "\\print_paper_dimension_flag \""
2193 << print_paper_dimension_flag << "\"\n";
2197 case RC_PRINTTOPRINTER:
2198 if (ignore_system_lyxrc ||
2199 print_to_printer != system_lyxrc.print_to_printer) {
2200 os << "\\print_to_printer \"" << print_to_printer
2205 case RC_PRINTTOFILE:
2206 if (ignore_system_lyxrc ||
2207 print_to_file != system_lyxrc.print_to_file) {
2208 string const path = os::external_path(print_to_file);
2209 os << "\\print_to_file \"" << path << "\"\n";
2213 case RC_PRINTFILEEXTENSION:
2214 if (ignore_system_lyxrc ||
2215 print_file_extension != system_lyxrc.print_file_extension) {
2216 os << "\\print_file_extension \""
2217 << print_file_extension
2224 << "# TEX SECTION #######################################\n"
2227 case RC_TEXINPUTS_PREFIX:
2228 if (ignore_system_lyxrc ||
2229 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2230 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2235 case RC_FONT_ENCODING:
2236 if (ignore_system_lyxrc ||
2237 fontenc != system_lyxrc.fontenc) {
2238 os << "\\font_encoding \"" << fontenc << "\"\n";
2243 case RC_FORCE_PAINT_SINGLE_CHAR:
2244 if (ignore_system_lyxrc ||
2245 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2246 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2252 << "# FILE SECTION ######################################\n"
2255 case RC_DOCUMENTPATH:
2256 if (ignore_system_lyxrc ||
2257 document_path != system_lyxrc.document_path) {
2258 string const path = os::external_path(document_path);
2259 os << "\\document_path \"" << path << "\"\n";
2263 case RC_USELASTFILEPOS:
2264 if (ignore_system_lyxrc ||
2265 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2266 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2271 case RC_LOADSESSION:
2272 if (ignore_system_lyxrc ||
2273 load_session != system_lyxrc.load_session) {
2274 os << "\\load_session " << convert<string>(load_session)
2279 case RC_MOUSE_WHEEL_SPEED:
2280 if (ignore_system_lyxrc ||
2281 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2282 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2286 case RC_COMPLETION_INLINE_DELAY:
2287 if (ignore_system_lyxrc ||
2288 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2289 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2293 case RC_COMPLETION_INLINE_MATH:
2294 if (ignore_system_lyxrc ||
2295 completion_inline_math != system_lyxrc.completion_inline_math) {
2296 os << "\\completion_inline_math "
2297 << convert<string>(completion_inline_math) << '\n';
2301 case RC_COMPLETION_INLINE_TEXT:
2302 if (ignore_system_lyxrc ||
2303 completion_inline_text != system_lyxrc.completion_inline_text) {
2304 os << "\\completion_inline_text "
2305 << convert<string>(completion_inline_text) << '\n';
2309 case RC_COMPLETION_INLINE_DOTS:
2310 if (ignore_system_lyxrc ||
2311 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2312 os << "\\completion_inline_dots "
2313 << convert<string>(completion_inline_dots) << '\n';
2317 case RC_AUTOCORRECTION_MATH:
2318 if (ignore_system_lyxrc ||
2319 autocorrection_math != system_lyxrc.autocorrection_math) {
2320 os << "\\autocorrection_math "
2321 << convert<string>(autocorrection_math) << '\n';
2325 case RC_COMPLETION_POPUP_DELAY:
2326 if (ignore_system_lyxrc ||
2327 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2328 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2332 case RC_COMPLETION_POPUP_MATH:
2333 if (ignore_system_lyxrc ||
2334 completion_popup_math != system_lyxrc.completion_popup_math) {
2335 os << "\\completion_popup_math "
2336 << convert<string>(completion_popup_math) << '\n';
2340 case RC_COMPLETION_POPUP_TEXT:
2341 if (ignore_system_lyxrc ||
2342 completion_popup_text != system_lyxrc.completion_popup_text) {
2343 os << "\\completion_popup_text "
2344 << convert<string>(completion_popup_text) << '\n';
2348 case RC_COMPLETION_CURSOR_TEXT:
2349 if (ignore_system_lyxrc ||
2350 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2351 os << "\\completion_cursor_text "
2352 << convert<string>(completion_cursor_text) << '\n';
2356 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2357 if (ignore_system_lyxrc ||
2358 completion_popup_after_complete
2359 != system_lyxrc.completion_popup_after_complete) {
2360 os << "\\completion_popup_after_complete "
2361 << convert<string>(completion_popup_after_complete) << '\n';
2365 case RC_NUMLASTFILES:
2366 if (ignore_system_lyxrc ||
2367 num_lastfiles != system_lyxrc.num_lastfiles) {
2368 os << "\\num_lastfiles " << num_lastfiles << '\n';
2372 case RC_CHECKLASTFILES:
2373 if (ignore_system_lyxrc ||
2374 check_lastfiles != system_lyxrc.check_lastfiles) {
2375 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2380 case RC_EXAMPLEPATH:
2381 if (ignore_system_lyxrc ||
2382 example_path != system_lyxrc.example_path) {
2383 string const path = os::external_path(example_path);
2384 os << "\\example_path \"" << path << "\"\n";
2388 case RC_TEMPLATEPATH:
2389 if (ignore_system_lyxrc ||
2390 template_path != system_lyxrc.template_path) {
2391 string const path = os::external_path(template_path);
2392 os << "\\template_path \"" << path << "\"\n";
2396 case RC_TEMPDIRPATH:
2397 if (ignore_system_lyxrc ||
2398 tempdir_path != system_lyxrc.tempdir_path) {
2399 string const path = os::external_path(tempdir_path);
2400 os << "\\tempdir_path \"" << path << "\"\n";
2404 case RC_THESAURUSDIRPATH:
2405 if (ignore_system_lyxrc ||
2406 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2407 string const path = os::external_path(thesaurusdir_path);
2408 os << "\\thesaurusdir_path \"" << path << "\"\n";
2412 case RC_HUNSPELLDIR_PATH:
2413 if (ignore_system_lyxrc ||
2414 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2415 string const path = os::external_path(hunspelldir_path);
2416 os << "\\hunspelldir_path \"" << path << "\"\n";
2420 case RC_PLAINTEXT_LINELEN:
2421 if (ignore_system_lyxrc ||
2422 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2423 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2427 case RC_MAKE_BACKUP:
2428 if (ignore_system_lyxrc ||
2429 make_backup != system_lyxrc.make_backup) {
2430 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2434 case RC_SAVE_COMPRESSED:
2435 if (ignore_system_lyxrc ||
2436 save_compressed != system_lyxrc.save_compressed) {
2437 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2441 case RC_BACKUPDIR_PATH:
2442 if (ignore_system_lyxrc ||
2443 backupdir_path != system_lyxrc.backupdir_path) {
2444 string const path = os::external_path(backupdir_path);
2445 os << "\\backupdir_path \"" << path << "\"\n";
2451 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2455 << "# SPELLCHECKER SECTION ##############################\n"
2458 case RC_ACCEPT_COMPOUND:
2459 if (ignore_system_lyxrc ||
2460 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2461 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2467 if (ignore_system_lyxrc ||
2468 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2469 os << "\\alternate_language \"" << spellchecker_alt_lang
2475 if (ignore_system_lyxrc ||
2476 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2477 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2481 case RC_USE_SYSTEM_COLORS:
2482 if (ignore_system_lyxrc ||
2483 use_system_colors != system_lyxrc.use_system_colors) {
2484 os << "\\use_system_colors "
2485 << convert<string>(use_system_colors)
2490 case RC_USE_TOOLTIP:
2491 if (ignore_system_lyxrc ||
2492 use_tooltip != system_lyxrc.use_tooltip) {
2493 os << "\\use_tooltip "
2494 << convert<string>(use_tooltip)
2499 case RC_USE_PIXMAP_CACHE:
2500 if (ignore_system_lyxrc ||
2501 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2502 os << "\\use_pixmap_cache "
2503 << convert<string>(use_pixmap_cache)
2510 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2515 case RC_DEFAULT_DECIMAL_POINT:
2516 if (ignore_system_lyxrc ||
2517 default_decimal_point != system_lyxrc.default_decimal_point) {
2518 os << "\\default_decimal_point " << default_decimal_point << '\n';
2523 case RC_SPELLCHECKER:
2524 if (ignore_system_lyxrc ||
2525 spellchecker != system_lyxrc.spellchecker) {
2526 os << "\\spellchecker " << spellchecker << '\n';
2531 case RC_SPELLCHECK_CONTINUOUSLY:
2532 if (ignore_system_lyxrc ||
2533 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2534 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2540 case RC_SPELLCHECK_NOTES:
2541 if (ignore_system_lyxrc ||
2542 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2543 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2549 case RC_RTL_SUPPORT:
2550 if (ignore_system_lyxrc ||
2551 rtl_support != system_lyxrc.rtl_support) {
2552 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2556 case RC_VISUAL_CURSOR:
2557 if (ignore_system_lyxrc ||
2558 visual_cursor != system_lyxrc.visual_cursor) {
2559 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2563 case RC_LANGUAGE_CUSTOM_PACKAGE:
2564 if (ignore_system_lyxrc ||
2565 language_custom_package != system_lyxrc.language_custom_package) {
2566 os << "\\language_custom_package \"" << language_custom_package
2571 case RC_LANGUAGE_GLOBAL_OPTIONS:
2572 if (ignore_system_lyxrc ||
2573 language_global_options
2574 != system_lyxrc.language_global_options) {
2575 os << "\\language_global_options \""
2576 << convert<string>(language_global_options)
2581 case RC_LANGUAGE_PACKAGE_SELECTION:
2582 if (ignore_system_lyxrc ||
2583 language_package_selection != system_lyxrc.language_package_selection) {
2584 os << "\\language_package_selection ";
2585 switch (language_package_selection) {
2602 case RC_LANGUAGE_COMMAND_BEGIN:
2603 if (ignore_system_lyxrc ||
2604 language_command_begin
2605 != system_lyxrc.language_command_begin) {
2606 os << "\\language_command_begin \""
2607 << language_command_begin
2612 case RC_LANGUAGE_COMMAND_END:
2613 if (ignore_system_lyxrc ||
2614 language_command_end
2615 != system_lyxrc.language_command_end) {
2616 os << "\\language_command_end \"" << language_command_end
2621 case RC_LANGUAGE_COMMAND_LOCAL:
2622 if (ignore_system_lyxrc ||
2623 language_command_local
2624 != system_lyxrc.language_command_local) {
2625 os << "\\language_command_local \""
2626 << language_command_local
2631 case RC_LANGUAGE_AUTO_BEGIN:
2632 if (ignore_system_lyxrc ||
2633 language_auto_begin != system_lyxrc.language_auto_begin) {
2634 os << "\\language_auto_begin "
2635 << convert<string>(language_auto_begin) << '\n';
2639 case RC_LANGUAGE_AUTO_END:
2640 if (ignore_system_lyxrc ||
2641 language_auto_end != system_lyxrc.language_auto_end) {
2642 os << "\\language_auto_end "
2643 << convert<string>(language_auto_end) << '\n';
2647 case RC_MARK_FOREIGN_LANGUAGE:
2648 if (ignore_system_lyxrc ||
2649 mark_foreign_language
2650 != system_lyxrc.mark_foreign_language) {
2651 os << "\\mark_foreign_language " <<
2652 convert<string>(mark_foreign_language) << '\n';
2658 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2661 case RC_AUTO_NUMBER:
2662 if (ignore_system_lyxrc ||
2663 auto_number != system_lyxrc.auto_number) {
2664 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2668 case RC_DEFAULT_LANGUAGE:
2669 if (ignore_system_lyxrc ||
2670 default_language != system_lyxrc.default_language) {
2671 os << "\\default_language " << default_language << '\n';
2675 case RC_GUI_LANGUAGE:
2676 if (ignore_system_lyxrc ||
2677 gui_language != system_lyxrc.gui_language) {
2678 os << "\\gui_language " << gui_language << '\n';
2682 case RC_EXPORT_OVERWRITE:
2683 if (ignore_system_lyxrc ||
2684 export_overwrite != system_lyxrc.export_overwrite) {
2686 switch (export_overwrite) {
2697 os << "\\export_overwrite " << status << '\n';
2702 case RC_SCROLL_WHEEL_ZOOM:
2703 if (ignore_system_lyxrc ||
2704 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2706 switch (scroll_wheel_zoom) {
2707 case SCROLL_WHEEL_ZOOM_OFF:
2710 case SCROLL_WHEEL_ZOOM_CTRL:
2713 case SCROLL_WHEEL_ZOOM_SHIFT:
2716 case SCROLL_WHEEL_ZOOM_ALT:
2720 os << "\\scroll_wheel_zoom " << status << '\n';
2726 << "# FORMATS SECTION ##########################\n"
2730 // New/modified formats
2731 for (Formats::const_iterator cit = formats.begin();
2732 cit != formats.end(); ++cit) {
2733 Format const * format =
2734 system_formats.getFormat(cit->name());
2736 format->extensions() != cit->extensions() ||
2737 format->prettyname() != cit->prettyname() ||
2738 format->shortcut() != cit->shortcut() ||
2739 format->viewer() != cit->viewer() ||
2740 format->editor() != cit->editor() ||
2741 format->documentFormat() != cit->documentFormat() ||
2742 format->vectorFormat() != cit->vectorFormat() ||
2743 format->inExportMenu() != cit->inExportMenu()) {
2744 os << "\\format \"" << cit->name() << "\" \""
2745 << cit->extensions() << "\" \""
2746 << cit->prettyname() << "\" \""
2747 << cit->shortcut() << "\" \""
2748 << escapeCommand(cit->viewer()) << "\" \""
2749 << escapeCommand(cit->editor()) << "\" \"";
2750 vector<string> flags;
2751 if (cit->documentFormat())
2752 flags.push_back("document");
2753 if (cit->vectorFormat())
2754 flags.push_back("vector");
2755 if (cit->zippedNative())
2756 flags.push_back("zipped=native");
2757 if (cit->inExportMenu())
2758 flags.push_back("menu=export");
2760 os << getStringFromVector(flags);
2765 // Look for deleted formats
2766 for (Formats::const_iterator cit = system_formats.begin();
2767 cit != system_formats.end(); ++cit)
2768 if (!formats.getFormat(cit->name()))
2769 os << "\\format \"" << cit->name()
2770 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2773 case RC_VIEWER_ALTERNATIVES: {
2774 Alternatives::const_iterator it = viewer_alternatives.begin();
2775 Alternatives::const_iterator const en = viewer_alternatives.end();
2776 Alternatives::const_iterator const sysend =
2777 system_lyxrc.viewer_alternatives.end();
2778 for (; it != en; ++it) {
2779 string const & fmt = it->first;
2780 CommandSet const & cmd = it->second;
2781 CommandSet::const_iterator sit = cmd.begin();
2782 CommandSet::const_iterator const sen = cmd.end();
2783 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2784 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2785 system_lyxrc.viewer_alternatives.find(fmt);
2786 for (; sit != sen; ++sit) {
2787 string const & cmd = *sit;
2788 if (ignore_system_lyxrc
2789 || sysfmt == sysend // format not found
2790 || sysfmt->second.count(cmd) == 0 // this command not found
2792 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2798 case RC_EDITOR_ALTERNATIVES: {
2799 Alternatives::const_iterator it = editor_alternatives.begin();
2800 Alternatives::const_iterator const en = editor_alternatives.end();
2801 Alternatives::const_iterator const sysend =
2802 system_lyxrc.editor_alternatives.end();
2803 for (; it != en; ++it) {
2804 string const & fmt = it->first;
2805 CommandSet const & cmd = it->second;
2806 CommandSet::const_iterator sit = cmd.begin();
2807 CommandSet::const_iterator const sen = cmd.end();
2808 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2809 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2810 system_lyxrc.editor_alternatives.find(fmt);
2811 for (; sit != sen; ++sit) {
2812 string const & cmd = *sit;
2813 if (ignore_system_lyxrc
2814 || sysfmt == sysend // format not found
2815 || sysfmt->second.count(cmd) == 0 // this command not found
2817 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2823 case RC_DEFAULT_VIEW_FORMAT:
2824 if (ignore_system_lyxrc ||
2825 default_view_format != system_lyxrc.default_view_format) {
2826 os << "\\default_view_format " << default_view_format << '\n';
2836 << "# CONVERTERS SECTION ##########################\n"
2840 // Look for new converters
2841 for (Converters::const_iterator cit = theConverters().begin();
2842 cit != theConverters().end(); ++cit) {
2843 Converter const * converter =
2844 theSystemConverters().getConverter(cit->from,
2847 converter->command != cit->command ||
2848 converter->flags != cit->flags)
2849 os << "\\converter \"" << cit->from << "\" \""
2850 << cit->to << "\" \""
2851 << escapeCommand(cit->command) << "\" \""
2852 << cit->flags << "\"\n";
2855 // New/modifed converters
2856 for (Converters::const_iterator cit = theSystemConverters().begin();
2857 cit != theSystemConverters().end(); ++cit)
2858 if (!theConverters().getConverter(cit->from, cit->to))
2859 os << "\\converter \"" << cit->from
2860 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2867 << "# COPIERS SECTION ##########################\n"
2870 // Look for new movers
2871 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2872 Movers::const_iterator const sysend = theSystemMovers().end();
2873 Movers::const_iterator it = theMovers().begin();
2874 Movers::const_iterator end = theMovers().end();
2876 for (; it != end; ++it) {
2877 Movers::const_iterator const sysit =
2878 find_if(sysbegin, sysend, SameMover(*it));
2879 if (sysit == sysend) {
2880 string const & fmt = it->first;
2881 string const & command =
2882 it->second.command();
2884 os << "\\copier " << fmt
2885 << " \"" << escapeCommand(command) << "\"\n";
2891 // We don't actually delete SpecialisedMover(s) from the
2892 // map, just clear their 'command', so there's no need
2893 // to test for anything else.
2900 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2902 // Why the switch you might ask. It is a trick to ensure that all
2903 // the elements in the LyXRCTags enum is handled. As you can see
2904 // there are no breaks at all. So it is just a huge fall-through.
2905 // The nice thing is that we will get a warning from the compiler
2906 // if we forget an element.
2907 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2909 case LyXRC::RC_LAST:
2910 case LyXRC::RC_ACCEPT_COMPOUND:
2911 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2912 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2913 case LyXRC::RC_ALT_LANG:
2914 case LyXRC::RC_PLAINTEXT_LINELEN:
2915 case LyXRC::RC_AUTOCORRECTION_MATH:
2916 case LyXRC::RC_AUTOREGIONDELETE:
2917 case LyXRC::RC_AUTORESET_OPTIONS:
2918 case LyXRC::RC_AUTOSAVE:
2919 case LyXRC::RC_AUTO_NUMBER:
2920 case LyXRC::RC_BACKUPDIR_PATH:
2921 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2922 case LyXRC::RC_BIBTEX_COMMAND:
2923 case LyXRC::RC_BINDFILE:
2924 case LyXRC::RC_CHECKLASTFILES:
2925 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2926 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2927 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2928 case LyXRC::RC_COMPLETION_INLINE_MATH:
2929 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2930 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2931 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2932 case LyXRC::RC_COMPLETION_POPUP_MATH:
2933 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2934 case LyXRC::RC_USELASTFILEPOS:
2935 case LyXRC::RC_LOADSESSION:
2936 case LyXRC::RC_CHKTEX_COMMAND:
2937 case LyXRC::RC_CONVERTER:
2938 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2939 case LyXRC::RC_COPIER:
2940 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2941 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2942 case LyXRC::RC_DATE_INSERT_FORMAT:
2943 case LyXRC::RC_DEFAULT_LANGUAGE:
2944 case LyXRC::RC_GUI_LANGUAGE:
2945 case LyXRC::RC_DEFAULT_PAPERSIZE:
2946 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2947 case LyXRC::RC_DEFFILE:
2948 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2949 case LyXRC::RC_DISPLAY_GRAPHICS:
2950 case LyXRC::RC_DOCUMENTPATH:
2951 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2952 FileName path(lyxrc_new.document_path);
2953 if (path.exists() && path.isDirectory())
2954 package().document_dir() = FileName(lyxrc.document_path);
2956 case LyXRC::RC_EDITOR_ALTERNATIVES:
2957 case LyXRC::RC_ESC_CHARS:
2958 case LyXRC::RC_EXAMPLEPATH:
2959 case LyXRC::RC_FONT_ENCODING:
2960 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2961 case LyXRC::RC_FILEFORMAT:
2962 case LyXRC::RC_GROUP_LAYOUTS:
2963 case LyXRC::RC_HUNSPELLDIR_PATH:
2964 case LyXRC::RC_ICON_SET:
2965 case LyXRC::RC_INDEX_ALTERNATIVES:
2966 case LyXRC::RC_INDEX_COMMAND:
2967 case LyXRC::RC_JBIBTEX_COMMAND:
2968 case LyXRC::RC_JINDEX_COMMAND:
2969 case LyXRC::RC_NOMENCL_COMMAND:
2970 case LyXRC::RC_INPUT:
2971 case LyXRC::RC_KBMAP:
2972 case LyXRC::RC_KBMAP_PRIMARY:
2973 case LyXRC::RC_KBMAP_SECONDARY:
2974 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2975 case LyXRC::RC_LANGUAGE_AUTO_END:
2976 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2977 case LyXRC::RC_LANGUAGE_COMMAND_END:
2978 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2979 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2980 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2981 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2982 case LyXRC::RC_LYXRCFORMAT:
2983 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2984 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2985 case LyXRC::RC_MACRO_EDIT_STYLE:
2986 case LyXRC::RC_MAKE_BACKUP:
2987 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2988 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2989 case LyXRC::RC_NUMLASTFILES:
2990 case LyXRC::RC_PARAGRAPH_MARKERS:
2991 case LyXRC::RC_PATH_PREFIX:
2992 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2993 prependEnvPath("PATH", lyxrc_new.path_prefix);
2995 case LyXRC::RC_PREVIEW:
2996 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2997 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2998 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2999 case LyXRC::RC_PRINTCOPIESFLAG:
3000 case LyXRC::RC_PRINTER:
3001 case LyXRC::RC_PRINTEVENPAGEFLAG:
3002 case LyXRC::RC_PRINTEXSTRAOPTIONS:
3003 case LyXRC::RC_PRINTFILEEXTENSION:
3004 case LyXRC::RC_PRINTLANDSCAPEFLAG:
3005 case LyXRC::RC_PRINTODDPAGEFLAG:
3006 case LyXRC::RC_PRINTPAGERANGEFLAG:
3007 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3008 case LyXRC::RC_PRINTPAPERFLAG:
3009 case LyXRC::RC_PRINTREVERSEFLAG:
3010 case LyXRC::RC_PRINTSPOOL_COMMAND:
3011 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
3012 case LyXRC::RC_PRINTTOFILE:
3013 case LyXRC::RC_PRINTTOPRINTER:
3014 case LyXRC::RC_PRINT_ADAPTOUTPUT:
3015 case LyXRC::RC_PRINT_COMMAND:
3016 case LyXRC::RC_RTL_SUPPORT:
3017 case LyXRC::RC_SAVE_COMPRESSED:
3018 case LyXRC::RC_SCREEN_DPI:
3019 case LyXRC::RC_SCREEN_FONT_ROMAN:
3020 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3021 case LyXRC::RC_SCREEN_FONT_SANS:
3022 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3023 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3024 case LyXRC::RC_SCREEN_FONT_SIZES:
3025 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3026 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3027 case LyXRC::RC_GEOMETRY_SESSION:
3028 case LyXRC::RC_SCREEN_ZOOM:
3029 case LyXRC::RC_SERVERPIPE:
3030 case LyXRC::RC_SET_COLOR:
3031 case LyXRC::RC_SHOW_BANNER:
3032 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3033 case LyXRC::RC_SPELLCHECKER:
3034 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3036 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3037 case LyXRC::RC_SPELLCHECK_NOTES:
3038 case LyXRC::RC_SPLITINDEX_COMMAND:
3039 case LyXRC::RC_TEMPDIRPATH:
3040 case LyXRC::RC_TEMPLATEPATH:
3041 case LyXRC::RC_TEX_ALLOWS_SPACES:
3042 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3043 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3044 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3046 case LyXRC::RC_TEXINPUTS_PREFIX:
3047 case LyXRC::RC_THESAURUSDIRPATH:
3048 case LyXRC::RC_UIFILE:
3049 case LyXRC::RC_USER_EMAIL:
3050 case LyXRC::RC_USER_NAME:
3051 case LyXRC::RC_USE_CONVERTER_CACHE:
3052 case LyXRC::RC_USE_SYSTEM_COLORS:
3053 case LyXRC::RC_USE_TOOLTIP:
3054 case LyXRC::RC_USE_PIXMAP_CACHE:
3055 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3056 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3057 case LyXRC::RC_SINGLE_INSTANCE:
3058 case LyXRC::RC_SORT_LAYOUTS:
3059 case LyXRC::RC_FULL_SCREEN_LIMIT:
3060 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3061 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3062 case LyXRC::RC_FULL_SCREEN_TABBAR:
3063 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3064 case LyXRC::RC_FULL_SCREEN_WIDTH:
3065 case LyXRC::RC_VISUAL_CURSOR:
3066 case LyXRC::RC_VIEWER:
3067 case LyXRC::RC_VIEWER_ALTERNATIVES:
3068 case LyXRC::RC_FORWARD_SEARCH_DVI:
3069 case LyXRC::RC_FORWARD_SEARCH_PDF:
3070 case LyXRC::RC_EXPORT_OVERWRITE:
3071 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3072 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3073 case LyXRC::RC_CURSOR_WIDTH:
3080 string const LyXRC::getDescription(LyXRCTags tag)
3085 case RC_ACCEPT_COMPOUND:
3086 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3090 str = _("Specify an alternate language. The default is to use the language of the document.");
3093 case RC_PLAINTEXT_LINELEN:
3094 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.");
3097 case RC_AUTOREGIONDELETE:
3098 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3101 case RC_AUTORESET_OPTIONS:
3102 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3106 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3109 case RC_AUTO_NUMBER:
3112 case RC_BACKUPDIR_PATH:
3113 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.");
3116 case RC_BIBTEX_COMMAND:
3117 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3120 case RC_JBIBTEX_COMMAND:
3121 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3125 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3128 case RC_CHECKLASTFILES:
3129 str = _("Select to check whether the lastfiles still exist.");
3132 case RC_CHKTEX_COMMAND:
3133 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3142 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3143 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.");
3146 case RC_CURSOR_WIDTH:
3147 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3150 case RC_SCROLL_BELOW_DOCUMENT:
3151 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");
3154 case RC_MAC_DONTSWAP_CTRL_META:
3155 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3158 case RC_MAC_LIKE_WORD_MOVEMENT:
3159 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3162 case RC_SHOW_MACRO_LABEL:
3163 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3166 case RC_DATE_INSERT_FORMAT:
3167 //xgettext:no-c-format
3168 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3172 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3175 case RC_DEFAULT_VIEW_FORMAT:
3176 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3179 case RC_DEFAULT_LANGUAGE:
3180 str = _("New documents will be assigned this language.");
3183 case RC_DEFAULT_PAPERSIZE:
3184 str = _("Specify the default paper size.");
3187 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3188 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3191 case RC_DISPLAY_GRAPHICS:
3192 str = _("Select how LyX will display any graphics.");
3195 case RC_DOCUMENTPATH:
3196 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3200 str = _("Specify additional chars that can be part of a word.");
3203 case RC_EXAMPLEPATH:
3204 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3207 case RC_FONT_ENCODING:
3208 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3211 case RC_FORCE_PAINT_SINGLE_CHAR:
3212 str = _("Disable any kerning and ligatures for text drawing on screen.");
3218 case RC_INDEX_COMMAND:
3219 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\".");
3222 case RC_JINDEX_COMMAND:
3223 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3226 case RC_NOMENCL_COMMAND:
3227 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3234 case RC_KBMAP_PRIMARY:
3235 case RC_KBMAP_SECONDARY:
3236 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.");
3239 case RC_LANGUAGE_AUTO_BEGIN:
3240 str = _("Select if a language switching command is needed at the beginning of the document.");
3243 case RC_LANGUAGE_AUTO_END:
3244 str = _("Select if a language switching command is needed at the end of the document.");
3247 case RC_LANGUAGE_COMMAND_BEGIN:
3248 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.");
3251 case RC_LANGUAGE_COMMAND_END:
3252 str = _("The LaTeX command for changing back to the language of the document.");
3255 case RC_LANGUAGE_COMMAND_LOCAL:
3256 str = _("The LaTeX command for local changing of the language.");
3259 case RC_LANGUAGE_GLOBAL_OPTIONS:
3260 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3263 case RC_LANGUAGE_CUSTOM_PACKAGE:
3264 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3267 case RC_LANGUAGE_PACKAGE_SELECTION:
3268 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3271 case RC_USELASTFILEPOS:
3272 str = _("De-select if you do not want LyX to scroll to saved position.");
3275 case RC_LOADSESSION:
3276 str = _("De-select to prevent loading files opened from the last LyX session.");
3279 case RC_MAKE_BACKUP:
3280 str = _("De-select if you don't want LyX to create backup files.");
3283 case RC_MARK_FOREIGN_LANGUAGE:
3284 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3287 case RC_MOUSE_WHEEL_SPEED:
3288 str = bformat(_("The scrolling speed of the mouse wheel."),
3292 case RC_COMPLETION_POPUP_DELAY:
3293 str = _("The completion popup delay.");
3296 case RC_COMPLETION_POPUP_MATH:
3297 str = _("Select to display the completion popup in math mode.");
3300 case RC_COMPLETION_POPUP_TEXT:
3301 str = _("Select to display the completion popup in text mode.");
3304 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3305 str = _("Show the completion popup without delay after non-unique completion attempt.");
3308 case RC_COMPLETION_POPUP_TEXT:
3309 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3312 case RC_COMPLETION_POPUP_DELAY:
3313 str = _("The inline completion delay.");
3316 case RC_COMPLETION_INLINE_MATH:
3317 str = _("Select to display the inline completion in math mode.");
3320 case RC_COMPLETION_INLINE_TEXT:
3321 str = _("Select to display the inline completion in text mode.");
3324 case RC_COMPLETION_INLINE_DOTS:
3325 str = _("Use \"...\" to shorten long completions.");
3328 case RC_AUTOCORRECTION_MATH:
3329 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3332 case RC_NUMLASTFILES:
3333 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3337 case RC_PATH_PREFIX:
3338 str = _("Specify those directories which should be "
3339 "prepended to the PATH environment variable.\n"
3340 "Use the OS native format.");
3344 str = _("Shows a typeset preview of things such as math");
3347 case RC_PREVIEW_HASHED_LABELS:
3348 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3351 case RC_PREVIEW_SCALE_FACTOR:
3352 str = _("Scale the preview size to suit.");
3355 case RC_PRINTCOLLCOPIESFLAG:
3356 str = _("The option for specifying whether the copies should be collated.");
3359 case RC_PRINTCOPIESFLAG:
3360 str = _("The option for specifying the number of copies to print.");
3364 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3367 case RC_PRINTEVENPAGEFLAG:
3368 str = _("The option to print only even pages.");
3371 case RC_PRINTEXSTRAOPTIONS:
3372 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3375 case RC_PRINTFILEEXTENSION:
3376 str = _("Extension of printer program output file. Usually \".ps\".");
3379 case RC_PRINTLANDSCAPEFLAG:
3380 str = _("The option to print out in landscape.");
3383 case RC_PRINTODDPAGEFLAG:
3384 str = _("The option to print only odd pages.");
3387 case RC_PRINTPAGERANGEFLAG:
3388 str = _("The option for specifying a comma-separated list of pages to print.");
3391 case RC_PRINTPAPERDIMENSIONFLAG:
3392 str = _("Option to specify the dimensions of the print paper.");
3395 case RC_PRINTPAPERFLAG:
3396 str = _("The option to specify paper type.");
3399 case RC_PRINTREVERSEFLAG:
3400 str = _("The option to reverse the order of the pages printed.");
3403 case RC_PRINTSPOOL_COMMAND:
3404 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.");
3407 case RC_PRINTSPOOL_PRINTERPREFIX:
3408 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.");
3411 case RC_PRINTTOFILE:
3412 str = _("Option to pass to the print program to print to a file.");
3415 case RC_PRINTTOPRINTER:
3416 str = _("Option to pass to the print program to print on a specific printer.");
3419 case RC_PRINT_ADAPTOUTPUT:
3420 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3423 case RC_PRINT_COMMAND:
3424 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3427 case RC_RTL_SUPPORT:
3428 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3431 case RC_VISUAL_CURSOR:
3432 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3436 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3439 case RC_SCREEN_FONT_ROMAN:
3440 case RC_SCREEN_FONT_SANS:
3441 case RC_SCREEN_FONT_TYPEWRITER:
3442 str = _("The screen fonts used to display the text while editing.");
3445 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3446 case RC_SCREEN_FONT_SANS_FOUNDRY:
3447 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3450 case RC_SCREEN_FONT_SCALABLE:
3451 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.");
3454 case RC_SCREEN_FONT_SIZES:
3455 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3458 case RC_SCREEN_ZOOM:
3459 //xgettext:no-c-format
3460 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3463 case RC_GEOMETRY_SESSION:
3464 str = _("Allow session manager to save and restore windows geometry.");
3468 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3474 case RC_SHOW_BANNER:
3475 str = _("De-select if you don't want the startup banner.");
3478 case RC_TEMPDIRPATH:
3479 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3482 case RC_THESAURUSDIRPATH:
3483 str = _("This is the place where the files of the thesaurus library reside.");
3486 case RC_TEMPLATEPATH:
3487 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3490 case RC_TEX_ALLOWS_SPACES:
3493 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3496 case RC_TEXINPUTS_PREFIX:
3497 str = _("Specify those directories which should be "
3498 "prepended to the TEXINPUTS environment variable.\n"
3499 "A '.' represents the current document directory. "
3500 "Use the OS native format.");
3504 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3513 case RC_USE_USE_SYSTEM_COLORS:
3514 str = _("Enable use the system colors for some things like main window background and selection.");
3517 case RC_USE_TOOLTIP:
3518 str = _("Enable the automatic appearance of tool tips in the work area.");
3521 case RC_USE_PIXMAP_CACHE:
3522 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3525 case RC_VIEWDVI_PAPEROPTION:
3526 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3541 // The global instance
3544 // The global copy of the system lyxrc entries (everything except preferences)