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 = 1;
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, extension, prettyname, shortcut;
1092 lexrc >> format >> extension >> 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 == "menu=export")
1122 flgs |= Format::export_menu;
1124 LYXERR0("Ignoring unknown flag `"
1125 << flag << "' for format `"
1128 if (prettyname.empty()) {
1129 if (theConverters().formatIsUsed(format))
1130 LYXERR0("Can't delete format " << format);
1132 formats.erase(format);
1134 formats.add(format, extension, prettyname,
1135 shortcut, viewer, editor, flgs);
1139 case RC_VIEWER_ALTERNATIVES: {
1140 string format, command;
1142 format = lexrc.getString();
1143 if (lexrc.eatLine())
1144 command = lexrc.getString();
1145 viewer_alternatives[format].insert(command);
1148 case RC_EDITOR_ALTERNATIVES: {
1149 string format, command;
1151 format = lexrc.getString();
1152 if (lexrc.eatLine())
1153 command = lexrc.getString();
1154 editor_alternatives[format].insert(command);
1158 case RC_DEFAULT_VIEW_FORMAT:
1159 lexrc >> default_view_format;
1162 case RC_DEFAULT_LANGUAGE:
1163 lexrc >> default_language;
1166 case RC_GUI_LANGUAGE:
1167 lexrc >> gui_language;
1170 case RC_SHOW_BANNER:
1171 lexrc >> show_banner;
1176 string const tmp = lexrc.getString();
1177 if (tmp == "true" || tmp == "on")
1178 preview = PREVIEW_ON;
1179 else if (tmp == "no_math")
1180 preview = PREVIEW_NO_MATH;
1182 preview = PREVIEW_OFF;
1183 if (tmp != "false" && tmp != "off")
1184 LYXERR0("Unrecognized preview status \""
1190 case RC_PREVIEW_HASHED_LABELS:
1191 lexrc >> preview_hashed_labels;
1194 case RC_PREVIEW_SCALE_FACTOR:
1195 lexrc >> preview_scale_factor;
1202 lexrc >> user_email;
1205 case RC_PATH_PREFIX:
1206 lexrc >> path_prefix;
1209 case RC_USE_CONVERTER_CACHE:
1210 lexrc >> use_converter_cache;
1212 case RC_CONVERTER_CACHE_MAXAGE:
1213 lexrc >> converter_cache_maxage;
1216 case RC_SORT_LAYOUTS:
1217 lexrc >> sort_layouts;
1219 case RC_GROUP_LAYOUTS:
1220 lexrc >> group_layouts;
1222 case RC_FULL_SCREEN_LIMIT:
1223 lexrc >> full_screen_limit;
1225 case RC_FULL_SCREEN_TOOLBARS:
1226 lexrc >> full_screen_toolbars;
1228 case RC_FULL_SCREEN_SCROLLBAR:
1229 lexrc >> full_screen_scrollbar;
1231 case RC_FULL_SCREEN_TABBAR:
1232 lexrc >> full_screen_tabbar;
1234 case RC_FULL_SCREEN_MENUBAR:
1235 lexrc >> full_screen_menubar;
1237 case RC_FULL_SCREEN_WIDTH:
1238 lexrc >> full_screen_width;
1240 case RC_OPEN_BUFFERS_IN_TABS:
1241 lexrc >> open_buffers_in_tabs;
1243 case RC_SINGLE_CLOSE_TAB_BUTTON:
1244 lexrc >> single_close_tab_button;
1246 case RC_SINGLE_INSTANCE:
1247 lexrc >> single_instance;
1248 if (run_mode == PREFERRED)
1249 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1251 case RC_FORWARD_SEARCH_DVI:
1252 if (lexrc.next(true))
1253 forward_search_dvi = lexrc.getString();
1255 case RC_FORWARD_SEARCH_PDF:
1256 if (lexrc.next(true))
1257 forward_search_pdf = lexrc.getString();
1259 case RC_EXPORT_OVERWRITE:
1261 string const tmp = lexrc.getString();
1262 if (tmp == "all" || tmp == "true")
1263 export_overwrite = ALL_FILES;
1264 else if (tmp == "main")
1265 export_overwrite = MAIN_FILE;
1267 export_overwrite = NO_FILES;
1268 if (tmp != "ask" && tmp != "false")
1269 LYXERR0("Unrecognized export_overwrite status \""
1274 case RC_SCROLL_WHEEL_ZOOM:
1276 string const tmp = lexrc.getString();
1278 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1279 else if (tmp == "shift")
1280 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1281 else if (tmp == "alt")
1282 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1284 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1285 if (tmp != "off" && tmp != "false")
1286 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1293 break; // this is just a dummy
1296 // This is triggered the first time through the loop unless
1297 // we hit a format tag.
1298 if (check_format && format != LYXRC_FILEFORMAT)
1299 return FormatMismatch;
1302 /// Update converters data-structures
1303 theConverters().update(formats);
1304 theConverters().buildGraph();
1310 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1312 ofstream ofs(filename.toFilesystemEncoding().c_str());
1314 write(ofs, ignore_system_lyxrc);
1318 void LyXRC::print() const
1320 if (lyxerr.debugging())
1321 write(lyxerr, false);
1329 typedef pair<string, SpecialisedMover> Data;
1331 SameMover(Data const & comparison)
1332 : comparison_(comparison) {}
1334 bool operator()(Data const & data) const
1336 return data.first == comparison_.first &&
1337 data.second.command() == comparison_.second.command();
1347 // Escape \ and " so that LyXLex can read the string later
1348 string escapeCommand(string const & str) {
1349 return subst(subst(str , "\\", "\\\\"),
1356 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1358 LyXRCTags tag = RC_LAST;
1360 if (!name.empty()) {
1361 for (int i = 0; i != lyxrcCount; ++i)
1362 if ("\\" + name == lyxrcTags[i].tag)
1363 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1367 os << "# LyX " << lyx_version
1368 << " generated this file. If you want to make your own\n"
1369 << "# modifications you should do them from inside LyX and save.\n\n"
1370 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1372 // Why the switch you might ask. It is a trick to ensure that all
1373 // the elements in the LyXRCTags enum are handled. As you can see
1374 // there are no breaks at all. So it is just a huge fall-through.
1375 // The nice thing is that we will get a warning from the compiler
1376 // if we forget an element.
1380 // input/include files are not done here
1381 case RC_LYXRCFORMAT:
1383 if (ignore_system_lyxrc ||
1384 bind_file != system_lyxrc.bind_file) {
1385 string const path = os::external_path(bind_file);
1386 os << "\\bind_file \"" << path << "\"\n";
1392 if (ignore_system_lyxrc ||
1393 def_file != system_lyxrc.def_file) {
1394 string const path = os::external_path(def_file);
1395 os << "\\def_file \"" << path << "\"\n";
1404 << "# MISC SECTION ######################################\n"
1406 // bind files are not done here.
1408 case RC_PATH_PREFIX:
1409 if (ignore_system_lyxrc ||
1410 path_prefix != system_lyxrc.path_prefix) {
1411 os << "\\path_prefix \"" << path_prefix << "\"\n";
1416 if (ignore_system_lyxrc ||
1417 ui_file != system_lyxrc.ui_file) {
1418 string const path = os::external_path(ui_file);
1419 os << "\\ui_file \"" << path << "\"\n";
1423 case RC_AUTOREGIONDELETE:
1424 if (ignore_system_lyxrc ||
1425 auto_region_delete != system_lyxrc.auto_region_delete) {
1426 os << "# Set to false to inhibit automatic replacement of\n"
1427 << "# the current selection.\n"
1428 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1433 case RC_AUTORESET_OPTIONS:
1434 if (ignore_system_lyxrc ||
1435 auto_reset_options != system_lyxrc.auto_reset_options) {
1436 os << "# Set to false to inhibit automatic reset of\n"
1437 << "# the class options to defaults on class change.\n"
1438 << "\\auto_reset_options "
1439 << convert<string>(auto_reset_options)
1445 if (ignore_system_lyxrc ||
1446 autosave != system_lyxrc.autosave) {
1447 os << "# The time interval between auto-saves in seconds.\n"
1448 << "\\autosave " << autosave << '\n';
1452 case RC_DISPLAY_GRAPHICS:
1453 if (ignore_system_lyxrc ||
1454 display_graphics != system_lyxrc.display_graphics) {
1455 os << "# Display graphics within LyX\n"
1457 << "\\display_graphics "
1458 << (display_graphics ? "true" : "false")
1463 case RC_SORT_LAYOUTS:
1464 if (ignore_system_lyxrc ||
1465 sort_layouts != system_lyxrc.sort_layouts) {
1466 os << "# Sort layouts alphabetically.\n"
1467 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1471 case RC_GROUP_LAYOUTS:
1472 if (ignore_system_lyxrc ||
1473 group_layouts != system_lyxrc.group_layouts) {
1474 os << "# Group layouts by their category.\n"
1475 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1479 case RC_VIEWDVI_PAPEROPTION:
1480 if (ignore_system_lyxrc ||
1481 view_dvi_paper_option
1482 != system_lyxrc.view_dvi_paper_option) {
1483 os << "# Options used to specify paper size to the\n"
1484 << "# view_dvi_command (e.g. -paper)\n"
1485 << "\\view_dvi_paper_option \""
1486 << view_dvi_paper_option << "\"\n";
1490 case RC_DEFAULT_PAPERSIZE:
1491 if (ignore_system_lyxrc ||
1492 default_papersize != system_lyxrc.default_papersize) {
1493 os << "# The default papersize to use.\n"
1494 << "\\default_papersize \"";
1495 switch (default_papersize) {
1497 os << "default"; break;
1498 case PAPER_USLETTER:
1499 os << "usletter"; break;
1501 os << "legal"; break;
1502 case PAPER_USEXECUTIVE:
1503 os << "executive"; break;
1536 case PAPER_JISB6: break;
1542 case RC_CHKTEX_COMMAND:
1543 if (ignore_system_lyxrc ||
1544 chktex_command != system_lyxrc.chktex_command) {
1545 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1549 case RC_BIBTEX_ALTERNATIVES: {
1550 CommandSet::const_iterator it = bibtex_alternatives.begin();
1551 CommandSet::const_iterator end = bibtex_alternatives.end();
1552 for ( ; it != end; ++it) {
1553 if (ignore_system_lyxrc
1554 || !system_lyxrc.bibtex_alternatives.count(*it))
1555 os << "\\bibtex_alternatives \""
1561 case RC_BIBTEX_COMMAND:
1562 if (ignore_system_lyxrc ||
1563 bibtex_command != system_lyxrc.bibtex_command) {
1564 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1568 case RC_JBIBTEX_COMMAND:
1569 if (ignore_system_lyxrc ||
1570 jbibtex_command != system_lyxrc.jbibtex_command) {
1571 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1575 case RC_INDEX_ALTERNATIVES: {
1576 CommandSet::const_iterator it = index_alternatives.begin();
1577 CommandSet::const_iterator end = index_alternatives.end();
1578 for ( ; it != end; ++it) {
1579 if (ignore_system_lyxrc
1580 || !system_lyxrc.index_alternatives.count(*it))
1581 os << "\\index_alternatives \""
1587 case RC_INDEX_COMMAND:
1588 if (ignore_system_lyxrc ||
1589 index_command != system_lyxrc.index_command) {
1590 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1594 case RC_JINDEX_COMMAND:
1595 if (ignore_system_lyxrc ||
1596 jindex_command != system_lyxrc.jindex_command) {
1597 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1601 case RC_SPLITINDEX_COMMAND:
1602 if (ignore_system_lyxrc ||
1603 splitindex_command != system_lyxrc.splitindex_command) {
1604 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1608 case RC_NOMENCL_COMMAND:
1609 if (ignore_system_lyxrc ||
1610 nomencl_command != system_lyxrc.nomencl_command) {
1611 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1615 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1616 // Don't write this setting to the preferences file,
1617 // but allow temporary changes (bug 7557).
1618 if (ignore_system_lyxrc) {
1619 os << "\\tex_expects_windows_paths "
1620 << convert<string>(windows_style_tex_paths) << '\n';
1624 case RC_TEX_ALLOWS_SPACES:
1625 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1626 os << "\\tex_allows_spaces "
1627 << convert<string>(tex_allows_spaces) << '\n';
1632 if (ignore_system_lyxrc ||
1633 use_kbmap != system_lyxrc.use_kbmap) {
1634 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1638 case RC_KBMAP_PRIMARY:
1639 if (ignore_system_lyxrc ||
1640 primary_kbmap != system_lyxrc.primary_kbmap) {
1641 string const path = os::external_path(primary_kbmap);
1642 os << "\\kbmap_primary \"" << path << "\"\n";
1646 case RC_KBMAP_SECONDARY:
1647 if (ignore_system_lyxrc ||
1648 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1649 string const path = os::external_path(secondary_kbmap);
1650 os << "\\kbmap_secondary \"" << path << "\"\n";
1655 if (ignore_system_lyxrc ||
1656 lyxpipes != system_lyxrc.lyxpipes) {
1657 string const path = os::external_path(lyxpipes);
1658 os << "\\serverpipe \"" << path << "\"\n";
1662 case RC_DATE_INSERT_FORMAT:
1663 if (ignore_system_lyxrc ||
1664 date_insert_format != system_lyxrc.date_insert_format) {
1665 os << "\\date_insert_format \"" << date_insert_format
1672 os << "\\user_name \"" << user_name << "\"\n";
1677 os << "\\user_email \"" << user_email << "\"\n";
1681 case RC_SHOW_BANNER:
1682 if (ignore_system_lyxrc ||
1683 show_banner != system_lyxrc.show_banner) {
1684 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1690 if (ignore_system_lyxrc ||
1691 preview != system_lyxrc.preview) {
1697 case PREVIEW_NO_MATH:
1704 os << "\\preview " << status << '\n';
1709 case RC_PREVIEW_HASHED_LABELS:
1710 if (ignore_system_lyxrc ||
1711 preview_hashed_labels !=
1712 system_lyxrc.preview_hashed_labels) {
1713 os << "\\preview_hashed_labels "
1714 << convert<string>(preview_hashed_labels) << '\n';
1719 case RC_PREVIEW_SCALE_FACTOR:
1720 if (ignore_system_lyxrc ||
1721 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1722 os << "\\preview_scale_factor "
1723 << preview_scale_factor << '\n';
1728 case RC_USE_CONVERTER_CACHE:
1729 if (ignore_system_lyxrc ||
1730 use_converter_cache != system_lyxrc.use_converter_cache) {
1731 os << "\\use_converter_cache "
1732 << convert<string>(use_converter_cache) << '\n';
1737 case RC_CONVERTER_CACHE_MAXAGE:
1738 if (ignore_system_lyxrc ||
1739 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1740 os << "\\converter_cache_maxage "
1741 << converter_cache_maxage << '\n';
1747 << "# SCREEN & FONTS SECTION ############################\n"
1751 if (ignore_system_lyxrc ||
1752 icon_set != system_lyxrc.icon_set) {
1753 os << "\\icon_set \"" << icon_set
1760 if (ignore_system_lyxrc ||
1761 dpi != system_lyxrc.dpi) {
1762 os << "\\screen_dpi " << dpi << '\n';
1766 case RC_SCREEN_ZOOM:
1767 if (ignore_system_lyxrc ||
1768 zoom != system_lyxrc.zoom) {
1769 os << "\\screen_zoom " << zoom << '\n';
1773 case RC_GEOMETRY_SESSION:
1774 if (ignore_system_lyxrc ||
1775 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1776 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1781 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1782 if (ignore_system_lyxrc ||
1783 cursor_follows_scrollbar
1784 != system_lyxrc.cursor_follows_scrollbar) {
1785 os << "\\cursor_follows_scrollbar "
1786 << convert<string>(cursor_follows_scrollbar) << '\n';
1790 case RC_CURSOR_WIDTH:
1791 if (ignore_system_lyxrc ||
1793 != system_lyxrc.cursor_width) {
1794 os << "\\cursor_width "
1795 << cursor_width << '\n';
1799 case RC_SCROLL_BELOW_DOCUMENT:
1800 if (ignore_system_lyxrc ||
1801 scroll_below_document
1802 != system_lyxrc.scroll_below_document) {
1803 os << "\\scroll_below_document "
1804 << convert<string>(scroll_below_document) << '\n';
1808 case RC_PARAGRAPH_MARKERS:
1809 if (ignore_system_lyxrc ||
1811 != system_lyxrc.paragraph_markers) {
1812 os << "\\paragraph_markers "
1813 << convert<string>(paragraph_markers) << '\n';
1817 case RC_MAC_DONTSWAP_CTRL_META:
1818 if (ignore_system_lyxrc ||
1819 mac_dontswap_ctrl_meta
1820 != system_lyxrc.mac_dontswap_ctrl_meta) {
1821 os << "\\mac_dontswap_ctrl_meta "
1822 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1826 case RC_MAC_LIKE_WORD_MOVEMENT:
1827 if (ignore_system_lyxrc ||
1828 mac_like_word_movement
1829 != system_lyxrc.mac_like_word_movement) {
1830 os << "\\mac_like_word_movement "
1831 << convert<string>(mac_like_word_movement) << '\n';
1835 case RC_MACRO_EDIT_STYLE:
1836 if (ignore_system_lyxrc ||
1838 != system_lyxrc.macro_edit_style) {
1839 os << "\\macro_edit_style ";
1840 switch (macro_edit_style) {
1841 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1842 case MACRO_EDIT_INLINE: os << "1\n"; break;
1843 case MACRO_EDIT_LIST: os << "2\n"; break;
1848 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1849 if (ignore_system_lyxrc ||
1850 dialogs_iconify_with_main
1851 != system_lyxrc.dialogs_iconify_with_main) {
1852 os << "\\dialogs_iconify_with_main "
1853 << convert<string>(dialogs_iconify_with_main) << '\n';
1857 case RC_SCREEN_FONT_ROMAN:
1858 if (ignore_system_lyxrc ||
1859 roman_font_name != system_lyxrc.roman_font_name) {
1860 os << "\\screen_font_roman \"" << roman_font_name
1865 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1866 if (ignore_system_lyxrc ||
1867 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1868 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1873 case RC_SCREEN_FONT_SANS:
1874 if (ignore_system_lyxrc ||
1875 sans_font_name != system_lyxrc.sans_font_name) {
1876 os << "\\screen_font_sans \"" << sans_font_name
1881 case RC_SCREEN_FONT_SANS_FOUNDRY:
1882 if (ignore_system_lyxrc ||
1883 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1884 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1889 case RC_SCREEN_FONT_TYPEWRITER:
1890 if (ignore_system_lyxrc ||
1891 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1892 os << "\\screen_font_typewriter \""
1893 << typewriter_font_name << "\"\n";
1897 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1898 if (ignore_system_lyxrc ||
1899 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1900 os << "\\screen_font_typewriter_foundry \""
1901 << typewriter_font_foundry << "\"\n";
1906 case RC_SCREEN_FONT_SCALABLE:
1907 if (ignore_system_lyxrc ||
1908 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1909 os << "\\screen_font_scalable "
1910 << convert<string>(use_scalable_fonts)
1915 case RC_SCREEN_FONT_SIZES:
1916 if (ignore_system_lyxrc ||
1917 font_sizes[FONT_SIZE_TINY]
1918 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1919 font_sizes[FONT_SIZE_SCRIPT]
1920 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1921 font_sizes[FONT_SIZE_FOOTNOTE]
1922 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1923 font_sizes[FONT_SIZE_SMALL]
1924 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1925 font_sizes[FONT_SIZE_NORMAL]
1926 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1927 font_sizes[FONT_SIZE_LARGE]
1928 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1929 font_sizes[FONT_SIZE_LARGER]
1930 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1931 font_sizes[FONT_SIZE_LARGEST]
1932 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1933 font_sizes[FONT_SIZE_HUGE]
1934 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1935 font_sizes[FONT_SIZE_HUGER]
1936 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1937 os.setf(ios::fixed);
1939 os << "\\screen_font_sizes"
1940 << ' ' << font_sizes[FONT_SIZE_TINY]
1941 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1942 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1943 << ' ' << font_sizes[FONT_SIZE_SMALL]
1944 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1945 << ' ' << font_sizes[FONT_SIZE_LARGE]
1946 << ' ' << font_sizes[FONT_SIZE_LARGER]
1947 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1948 << ' ' << font_sizes[FONT_SIZE_HUGE]
1949 << ' ' << font_sizes[FONT_SIZE_HUGER]
1954 case RC_FULL_SCREEN_LIMIT:
1955 if (ignore_system_lyxrc ||
1956 full_screen_limit != system_lyxrc.full_screen_limit) {
1957 os << "\\fullscreen_limit "
1958 << convert<string>(full_screen_limit)
1963 case RC_FULL_SCREEN_TOOLBARS:
1964 if (ignore_system_lyxrc ||
1965 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1966 os << "\\fullscreen_toolbars "
1967 << convert<string>(full_screen_toolbars)
1972 case RC_FULL_SCREEN_SCROLLBAR:
1973 if (ignore_system_lyxrc ||
1974 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1975 os << "\\fullscreen_scrollbar "
1976 << convert<string>(full_screen_scrollbar)
1981 case RC_FULL_SCREEN_TABBAR:
1982 if (ignore_system_lyxrc ||
1983 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1984 os << "\\fullscreen_tabbar "
1985 << convert<string>(full_screen_tabbar)
1990 case RC_FULL_SCREEN_MENUBAR:
1991 if (ignore_system_lyxrc ||
1992 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1993 os << "\\fullscreen_menubar "
1994 << convert<string>(full_screen_menubar)
1999 case RC_FULL_SCREEN_WIDTH:
2000 if (ignore_system_lyxrc ||
2001 full_screen_width != system_lyxrc.full_screen_width) {
2002 os << "\\fullscreen_width "
2003 << convert<string>(full_screen_width)
2008 case RC_OPEN_BUFFERS_IN_TABS:
2009 if (ignore_system_lyxrc ||
2010 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2011 os << "\\open_buffers_in_tabs "
2012 << convert<string>(open_buffers_in_tabs)
2017 case RC_SINGLE_CLOSE_TAB_BUTTON:
2018 if (ignore_system_lyxrc ||
2019 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2020 os << "\\single_close_tab_button "
2021 << convert<string>(single_close_tab_button)
2026 case RC_SINGLE_INSTANCE:
2027 if (ignore_system_lyxrc ||
2028 single_instance != system_lyxrc.single_instance) {
2029 os << "\\single_instance "
2030 << convert<string>(single_instance)
2035 case RC_FORWARD_SEARCH_DVI:
2036 if (ignore_system_lyxrc ||
2037 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2038 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2042 case RC_FORWARD_SEARCH_PDF:
2043 if (ignore_system_lyxrc ||
2044 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2045 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2051 << "# COLOR SECTION ###################################\n"
2055 for (int i = 0; i < Color_ignore; ++i) {
2056 ColorCode lc = static_cast<ColorCode>(i);
2057 string const col = lcolor.getX11Name(lc);
2058 if (ignore_system_lyxrc
2059 || col != system_lcolor.getX11Name(lc)) {
2060 os << "\\set_color \""
2061 << lcolor.getLyXName(lc) << "\" \""
2069 << "# PRINTER SECTION ###################################\n"
2073 if (ignore_system_lyxrc ||
2074 printer != system_lyxrc.printer) {
2075 os << "\\printer \"" << printer << "\"\n";
2079 case RC_PRINT_ADAPTOUTPUT:
2080 if (ignore_system_lyxrc ||
2081 print_adapt_output != system_lyxrc.print_adapt_output) {
2082 os << "\\print_adapt_output "
2083 << convert<string>(print_adapt_output)
2088 case RC_PRINT_COMMAND:
2089 if (ignore_system_lyxrc ||
2090 print_command != system_lyxrc.print_command) {
2091 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2095 case RC_PRINTEXSTRAOPTIONS:
2096 if (ignore_system_lyxrc ||
2097 print_extra_options != system_lyxrc.print_extra_options) {
2098 os << "\\print_extra_options \"" << print_extra_options
2103 case RC_PRINTSPOOL_COMMAND:
2104 if (ignore_system_lyxrc ||
2105 print_spool_command != system_lyxrc.print_spool_command) {
2106 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2111 case RC_PRINTSPOOL_PRINTERPREFIX:
2112 if (ignore_system_lyxrc ||
2113 print_spool_printerprefix
2114 != system_lyxrc.print_spool_printerprefix) {
2115 os << "\\print_spool_printerprefix \""
2116 << print_spool_printerprefix << "\"\n";
2120 case RC_PRINTEVENPAGEFLAG:
2121 if (ignore_system_lyxrc ||
2122 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2123 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2128 case RC_PRINTODDPAGEFLAG:
2129 if (ignore_system_lyxrc ||
2130 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2131 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2136 case RC_PRINTREVERSEFLAG:
2137 if (ignore_system_lyxrc ||
2138 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2139 os << "\\print_reverse_flag \"" << print_reverse_flag
2144 case RC_PRINTLANDSCAPEFLAG:
2145 if (ignore_system_lyxrc ||
2146 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2147 os << "\\print_landscape_flag \"" << print_landscape_flag
2152 case RC_PRINTPAGERANGEFLAG:
2153 if (ignore_system_lyxrc ||
2154 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2155 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2160 case RC_PRINTCOPIESFLAG:
2161 if (ignore_system_lyxrc ||
2162 print_copies_flag != system_lyxrc.print_copies_flag) {
2163 os << "\\print_copies_flag \"" << print_copies_flag
2168 case RC_PRINTCOLLCOPIESFLAG:
2169 if (ignore_system_lyxrc ||
2170 print_collcopies_flag
2171 != system_lyxrc.print_collcopies_flag) {
2172 os << "\\print_collcopies_flag \""
2173 << print_collcopies_flag
2178 case RC_PRINTPAPERFLAG:
2179 if (ignore_system_lyxrc ||
2180 print_paper_flag != system_lyxrc.print_paper_flag) {
2181 os << "\\print_paper_flag \"" << print_paper_flag
2186 case RC_PRINTPAPERDIMENSIONFLAG:
2187 if (ignore_system_lyxrc ||
2188 print_paper_dimension_flag
2189 != system_lyxrc.print_paper_dimension_flag) {
2190 os << "\\print_paper_dimension_flag \""
2191 << print_paper_dimension_flag << "\"\n";
2195 case RC_PRINTTOPRINTER:
2196 if (ignore_system_lyxrc ||
2197 print_to_printer != system_lyxrc.print_to_printer) {
2198 os << "\\print_to_printer \"" << print_to_printer
2203 case RC_PRINTTOFILE:
2204 if (ignore_system_lyxrc ||
2205 print_to_file != system_lyxrc.print_to_file) {
2206 string const path = os::external_path(print_to_file);
2207 os << "\\print_to_file \"" << path << "\"\n";
2211 case RC_PRINTFILEEXTENSION:
2212 if (ignore_system_lyxrc ||
2213 print_file_extension != system_lyxrc.print_file_extension) {
2214 os << "\\print_file_extension \""
2215 << print_file_extension
2222 << "# TEX SECTION #######################################\n"
2225 case RC_TEXINPUTS_PREFIX:
2226 if (ignore_system_lyxrc ||
2227 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2228 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2233 case RC_FONT_ENCODING:
2234 if (ignore_system_lyxrc ||
2235 fontenc != system_lyxrc.fontenc) {
2236 os << "\\font_encoding \"" << fontenc << "\"\n";
2241 case RC_FORCE_PAINT_SINGLE_CHAR:
2242 if (ignore_system_lyxrc ||
2243 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2244 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2250 << "# FILE SECTION ######################################\n"
2253 case RC_DOCUMENTPATH:
2254 if (ignore_system_lyxrc ||
2255 document_path != system_lyxrc.document_path) {
2256 string const path = os::external_path(document_path);
2257 os << "\\document_path \"" << path << "\"\n";
2261 case RC_USELASTFILEPOS:
2262 if (ignore_system_lyxrc ||
2263 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2264 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2269 case RC_LOADSESSION:
2270 if (ignore_system_lyxrc ||
2271 load_session != system_lyxrc.load_session) {
2272 os << "\\load_session " << convert<string>(load_session)
2277 case RC_MOUSE_WHEEL_SPEED:
2278 if (ignore_system_lyxrc ||
2279 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2280 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2284 case RC_COMPLETION_INLINE_DELAY:
2285 if (ignore_system_lyxrc ||
2286 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2287 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2291 case RC_COMPLETION_INLINE_MATH:
2292 if (ignore_system_lyxrc ||
2293 completion_inline_math != system_lyxrc.completion_inline_math) {
2294 os << "\\completion_inline_math "
2295 << convert<string>(completion_inline_math) << '\n';
2299 case RC_COMPLETION_INLINE_TEXT:
2300 if (ignore_system_lyxrc ||
2301 completion_inline_text != system_lyxrc.completion_inline_text) {
2302 os << "\\completion_inline_text "
2303 << convert<string>(completion_inline_text) << '\n';
2307 case RC_COMPLETION_INLINE_DOTS:
2308 if (ignore_system_lyxrc ||
2309 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2310 os << "\\completion_inline_dots "
2311 << convert<string>(completion_inline_dots) << '\n';
2315 case RC_AUTOCORRECTION_MATH:
2316 if (ignore_system_lyxrc ||
2317 autocorrection_math != system_lyxrc.autocorrection_math) {
2318 os << "\\autocorrection_math "
2319 << convert<string>(autocorrection_math) << '\n';
2323 case RC_COMPLETION_POPUP_DELAY:
2324 if (ignore_system_lyxrc ||
2325 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2326 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2330 case RC_COMPLETION_POPUP_MATH:
2331 if (ignore_system_lyxrc ||
2332 completion_popup_math != system_lyxrc.completion_popup_math) {
2333 os << "\\completion_popup_math "
2334 << convert<string>(completion_popup_math) << '\n';
2338 case RC_COMPLETION_POPUP_TEXT:
2339 if (ignore_system_lyxrc ||
2340 completion_popup_text != system_lyxrc.completion_popup_text) {
2341 os << "\\completion_popup_text "
2342 << convert<string>(completion_popup_text) << '\n';
2346 case RC_COMPLETION_CURSOR_TEXT:
2347 if (ignore_system_lyxrc ||
2348 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2349 os << "\\completion_cursor_text "
2350 << convert<string>(completion_cursor_text) << '\n';
2354 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2355 if (ignore_system_lyxrc ||
2356 completion_popup_after_complete
2357 != system_lyxrc.completion_popup_after_complete) {
2358 os << "\\completion_popup_after_complete "
2359 << convert<string>(completion_popup_after_complete) << '\n';
2363 case RC_NUMLASTFILES:
2364 if (ignore_system_lyxrc ||
2365 num_lastfiles != system_lyxrc.num_lastfiles) {
2366 os << "\\num_lastfiles " << num_lastfiles << '\n';
2370 case RC_CHECKLASTFILES:
2371 if (ignore_system_lyxrc ||
2372 check_lastfiles != system_lyxrc.check_lastfiles) {
2373 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2378 case RC_EXAMPLEPATH:
2379 if (ignore_system_lyxrc ||
2380 example_path != system_lyxrc.example_path) {
2381 string const path = os::external_path(example_path);
2382 os << "\\example_path \"" << path << "\"\n";
2386 case RC_TEMPLATEPATH:
2387 if (ignore_system_lyxrc ||
2388 template_path != system_lyxrc.template_path) {
2389 string const path = os::external_path(template_path);
2390 os << "\\template_path \"" << path << "\"\n";
2394 case RC_TEMPDIRPATH:
2395 if (ignore_system_lyxrc ||
2396 tempdir_path != system_lyxrc.tempdir_path) {
2397 string const path = os::external_path(tempdir_path);
2398 os << "\\tempdir_path \"" << path << "\"\n";
2402 case RC_THESAURUSDIRPATH:
2403 if (ignore_system_lyxrc ||
2404 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2405 string const path = os::external_path(thesaurusdir_path);
2406 os << "\\thesaurusdir_path \"" << path << "\"\n";
2410 case RC_HUNSPELLDIR_PATH:
2411 if (ignore_system_lyxrc ||
2412 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2413 string const path = os::external_path(hunspelldir_path);
2414 os << "\\hunspelldir_path \"" << path << "\"\n";
2418 case RC_PLAINTEXT_LINELEN:
2419 if (ignore_system_lyxrc ||
2420 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2421 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2425 case RC_MAKE_BACKUP:
2426 if (ignore_system_lyxrc ||
2427 make_backup != system_lyxrc.make_backup) {
2428 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2432 case RC_SAVE_COMPRESSED:
2433 if (ignore_system_lyxrc ||
2434 save_compressed != system_lyxrc.save_compressed) {
2435 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2439 case RC_BACKUPDIR_PATH:
2440 if (ignore_system_lyxrc ||
2441 backupdir_path != system_lyxrc.backupdir_path) {
2442 string const path = os::external_path(backupdir_path);
2443 os << "\\backupdir_path \"" << path << "\"\n";
2449 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2453 << "# SPELLCHECKER SECTION ##############################\n"
2456 case RC_ACCEPT_COMPOUND:
2457 if (ignore_system_lyxrc ||
2458 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2459 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2465 if (ignore_system_lyxrc ||
2466 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2467 os << "\\alternate_language \"" << spellchecker_alt_lang
2473 if (ignore_system_lyxrc ||
2474 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2475 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2479 case RC_USE_SYSTEM_COLORS:
2480 if (ignore_system_lyxrc ||
2481 use_system_colors != system_lyxrc.use_system_colors) {
2482 os << "\\use_system_colors "
2483 << convert<string>(use_system_colors)
2488 case RC_USE_TOOLTIP:
2489 if (ignore_system_lyxrc ||
2490 use_tooltip != system_lyxrc.use_tooltip) {
2491 os << "\\use_tooltip "
2492 << convert<string>(use_tooltip)
2497 case RC_USE_PIXMAP_CACHE:
2498 if (ignore_system_lyxrc ||
2499 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2500 os << "\\use_pixmap_cache "
2501 << convert<string>(use_pixmap_cache)
2508 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2513 case RC_DEFAULT_DECIMAL_POINT:
2514 if (ignore_system_lyxrc ||
2515 default_decimal_point != system_lyxrc.default_decimal_point) {
2516 os << "\\default_decimal_point " << default_decimal_point << '\n';
2521 case RC_SPELLCHECKER:
2522 if (ignore_system_lyxrc ||
2523 spellchecker != system_lyxrc.spellchecker) {
2524 os << "\\spellchecker " << spellchecker << '\n';
2529 case RC_SPELLCHECK_CONTINUOUSLY:
2530 if (ignore_system_lyxrc ||
2531 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2532 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2538 case RC_SPELLCHECK_NOTES:
2539 if (ignore_system_lyxrc ||
2540 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2541 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2547 case RC_RTL_SUPPORT:
2548 if (ignore_system_lyxrc ||
2549 rtl_support != system_lyxrc.rtl_support) {
2550 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2554 case RC_VISUAL_CURSOR:
2555 if (ignore_system_lyxrc ||
2556 visual_cursor != system_lyxrc.visual_cursor) {
2557 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2561 case RC_LANGUAGE_CUSTOM_PACKAGE:
2562 if (ignore_system_lyxrc ||
2563 language_custom_package != system_lyxrc.language_custom_package) {
2564 os << "\\language_custom_package \"" << language_custom_package
2569 case RC_LANGUAGE_GLOBAL_OPTIONS:
2570 if (ignore_system_lyxrc ||
2571 language_global_options
2572 != system_lyxrc.language_global_options) {
2573 os << "\\language_global_options \""
2574 << convert<string>(language_global_options)
2579 case RC_LANGUAGE_PACKAGE_SELECTION:
2580 if (ignore_system_lyxrc ||
2581 language_package_selection != system_lyxrc.language_package_selection) {
2582 os << "\\language_package_selection ";
2583 switch (language_package_selection) {
2600 case RC_LANGUAGE_COMMAND_BEGIN:
2601 if (ignore_system_lyxrc ||
2602 language_command_begin
2603 != system_lyxrc.language_command_begin) {
2604 os << "\\language_command_begin \""
2605 << language_command_begin
2610 case RC_LANGUAGE_COMMAND_END:
2611 if (ignore_system_lyxrc ||
2612 language_command_end
2613 != system_lyxrc.language_command_end) {
2614 os << "\\language_command_end \"" << language_command_end
2619 case RC_LANGUAGE_COMMAND_LOCAL:
2620 if (ignore_system_lyxrc ||
2621 language_command_local
2622 != system_lyxrc.language_command_local) {
2623 os << "\\language_command_local \""
2624 << language_command_local
2629 case RC_LANGUAGE_AUTO_BEGIN:
2630 if (ignore_system_lyxrc ||
2631 language_auto_begin != system_lyxrc.language_auto_begin) {
2632 os << "\\language_auto_begin "
2633 << convert<string>(language_auto_begin) << '\n';
2637 case RC_LANGUAGE_AUTO_END:
2638 if (ignore_system_lyxrc ||
2639 language_auto_end != system_lyxrc.language_auto_end) {
2640 os << "\\language_auto_end "
2641 << convert<string>(language_auto_end) << '\n';
2645 case RC_MARK_FOREIGN_LANGUAGE:
2646 if (ignore_system_lyxrc ||
2647 mark_foreign_language
2648 != system_lyxrc.mark_foreign_language) {
2649 os << "\\mark_foreign_language " <<
2650 convert<string>(mark_foreign_language) << '\n';
2656 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2659 case RC_AUTO_NUMBER:
2660 if (ignore_system_lyxrc ||
2661 auto_number != system_lyxrc.auto_number) {
2662 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2666 case RC_DEFAULT_LANGUAGE:
2667 if (ignore_system_lyxrc ||
2668 default_language != system_lyxrc.default_language) {
2669 os << "\\default_language " << default_language << '\n';
2673 case RC_GUI_LANGUAGE:
2674 if (ignore_system_lyxrc ||
2675 gui_language != system_lyxrc.gui_language) {
2676 os << "\\gui_language " << gui_language << '\n';
2680 case RC_EXPORT_OVERWRITE:
2681 if (ignore_system_lyxrc ||
2682 export_overwrite != system_lyxrc.export_overwrite) {
2684 switch (export_overwrite) {
2695 os << "\\export_overwrite " << status << '\n';
2700 case RC_SCROLL_WHEEL_ZOOM:
2701 if (ignore_system_lyxrc ||
2702 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2704 switch (scroll_wheel_zoom) {
2705 case SCROLL_WHEEL_ZOOM_OFF:
2708 case SCROLL_WHEEL_ZOOM_CTRL:
2711 case SCROLL_WHEEL_ZOOM_SHIFT:
2714 case SCROLL_WHEEL_ZOOM_ALT:
2718 os << "\\scroll_wheel_zoom " << status << '\n';
2724 << "# FORMATS SECTION ##########################\n"
2728 // New/modified formats
2729 for (Formats::const_iterator cit = formats.begin();
2730 cit != formats.end(); ++cit) {
2731 Format const * format =
2732 system_formats.getFormat(cit->name());
2734 format->extension() != cit->extension() ||
2735 format->prettyname() != cit->prettyname() ||
2736 format->shortcut() != cit->shortcut() ||
2737 format->viewer() != cit->viewer() ||
2738 format->editor() != cit->editor() ||
2739 format->documentFormat() != cit->documentFormat() ||
2740 format->vectorFormat() != cit->vectorFormat() ||
2741 format->inExportMenu() != cit->inExportMenu()) {
2742 os << "\\format \"" << cit->name() << "\" \""
2743 << cit->extension() << "\" \""
2744 << cit->prettyname() << "\" \""
2745 << cit->shortcut() << "\" \""
2746 << escapeCommand(cit->viewer()) << "\" \""
2747 << escapeCommand(cit->editor()) << "\" \"";
2748 vector<string> flags;
2749 if (cit->documentFormat())
2750 flags.push_back("document");
2751 if (cit->vectorFormat())
2752 flags.push_back("vector");
2753 if (cit->inExportMenu())
2754 flags.push_back("menu=export");
2756 os << getStringFromVector(flags);
2761 // Look for deleted formats
2762 for (Formats::const_iterator cit = system_formats.begin();
2763 cit != system_formats.end(); ++cit)
2764 if (!formats.getFormat(cit->name()))
2765 os << "\\format \"" << cit->name()
2766 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2769 case RC_VIEWER_ALTERNATIVES: {
2770 Alternatives::const_iterator it = viewer_alternatives.begin();
2771 Alternatives::const_iterator const en = viewer_alternatives.end();
2772 Alternatives::const_iterator const sysend =
2773 system_lyxrc.viewer_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.viewer_alternatives.begin() : // we won't use it in this case
2781 system_lyxrc.viewer_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 << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2794 case RC_EDITOR_ALTERNATIVES: {
2795 Alternatives::const_iterator it = editor_alternatives.begin();
2796 Alternatives::const_iterator const en = editor_alternatives.end();
2797 Alternatives::const_iterator const sysend =
2798 system_lyxrc.editor_alternatives.end();
2799 for (; it != en; ++it) {
2800 string const & fmt = it->first;
2801 CommandSet const & cmd = it->second;
2802 CommandSet::const_iterator sit = cmd.begin();
2803 CommandSet::const_iterator const sen = cmd.end();
2804 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2805 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2806 system_lyxrc.editor_alternatives.find(fmt);
2807 for (; sit != sen; ++sit) {
2808 string const & cmd = *sit;
2809 if (ignore_system_lyxrc
2810 || sysfmt == sysend // format not found
2811 || sysfmt->second.count(cmd) == 0 // this command not found
2813 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2819 case RC_DEFAULT_VIEW_FORMAT:
2820 if (ignore_system_lyxrc ||
2821 default_view_format != system_lyxrc.default_view_format) {
2822 os << "\\default_view_format " << default_view_format << '\n';
2832 << "# CONVERTERS SECTION ##########################\n"
2836 // Look for new converters
2837 for (Converters::const_iterator cit = theConverters().begin();
2838 cit != theConverters().end(); ++cit) {
2839 Converter const * converter =
2840 theSystemConverters().getConverter(cit->from,
2843 converter->command != cit->command ||
2844 converter->flags != cit->flags)
2845 os << "\\converter \"" << cit->from << "\" \""
2846 << cit->to << "\" \""
2847 << escapeCommand(cit->command) << "\" \""
2848 << cit->flags << "\"\n";
2851 // New/modifed converters
2852 for (Converters::const_iterator cit = theSystemConverters().begin();
2853 cit != theSystemConverters().end(); ++cit)
2854 if (!theConverters().getConverter(cit->from, cit->to))
2855 os << "\\converter \"" << cit->from
2856 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2863 << "# COPIERS SECTION ##########################\n"
2866 // Look for new movers
2867 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2868 Movers::const_iterator const sysend = theSystemMovers().end();
2869 Movers::const_iterator it = theMovers().begin();
2870 Movers::const_iterator end = theMovers().end();
2872 for (; it != end; ++it) {
2873 Movers::const_iterator const sysit =
2874 find_if(sysbegin, sysend, SameMover(*it));
2875 if (sysit == sysend) {
2876 string const & fmt = it->first;
2877 string const & command =
2878 it->second.command();
2880 os << "\\copier " << fmt
2881 << " \"" << escapeCommand(command) << "\"\n";
2887 // We don't actually delete SpecialisedMover(s) from the
2888 // map, just clear their 'command', so there's no need
2889 // to test for anything else.
2896 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2898 // Why the switch you might ask. It is a trick to ensure that all
2899 // the elements in the LyXRCTags enum is handled. As you can see
2900 // there are no breaks at all. So it is just a huge fall-through.
2901 // The nice thing is that we will get a warning from the compiler
2902 // if we forget an element.
2903 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2905 case LyXRC::RC_LAST:
2906 case LyXRC::RC_ACCEPT_COMPOUND:
2907 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2908 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2909 case LyXRC::RC_ALT_LANG:
2910 case LyXRC::RC_PLAINTEXT_LINELEN:
2911 case LyXRC::RC_AUTOCORRECTION_MATH:
2912 case LyXRC::RC_AUTOREGIONDELETE:
2913 case LyXRC::RC_AUTORESET_OPTIONS:
2914 case LyXRC::RC_AUTOSAVE:
2915 case LyXRC::RC_AUTO_NUMBER:
2916 case LyXRC::RC_BACKUPDIR_PATH:
2917 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2918 case LyXRC::RC_BIBTEX_COMMAND:
2919 case LyXRC::RC_BINDFILE:
2920 case LyXRC::RC_CHECKLASTFILES:
2921 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2922 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2923 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2924 case LyXRC::RC_COMPLETION_INLINE_MATH:
2925 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2926 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2927 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2928 case LyXRC::RC_COMPLETION_POPUP_MATH:
2929 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2930 case LyXRC::RC_USELASTFILEPOS:
2931 case LyXRC::RC_LOADSESSION:
2932 case LyXRC::RC_CHKTEX_COMMAND:
2933 case LyXRC::RC_CONVERTER:
2934 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2935 case LyXRC::RC_COPIER:
2936 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2937 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2938 case LyXRC::RC_DATE_INSERT_FORMAT:
2939 case LyXRC::RC_DEFAULT_LANGUAGE:
2940 case LyXRC::RC_GUI_LANGUAGE:
2941 case LyXRC::RC_DEFAULT_PAPERSIZE:
2942 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2943 case LyXRC::RC_DEFFILE:
2944 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2945 case LyXRC::RC_DISPLAY_GRAPHICS:
2946 case LyXRC::RC_DOCUMENTPATH:
2947 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2948 FileName path(lyxrc_new.document_path);
2949 if (path.exists() && path.isDirectory())
2950 package().document_dir() = FileName(lyxrc.document_path);
2952 case LyXRC::RC_EDITOR_ALTERNATIVES:
2953 case LyXRC::RC_ESC_CHARS:
2954 case LyXRC::RC_EXAMPLEPATH:
2955 case LyXRC::RC_FONT_ENCODING:
2956 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2957 case LyXRC::RC_FILEFORMAT:
2958 case LyXRC::RC_GROUP_LAYOUTS:
2959 case LyXRC::RC_HUNSPELLDIR_PATH:
2960 case LyXRC::RC_ICON_SET:
2961 case LyXRC::RC_INDEX_ALTERNATIVES:
2962 case LyXRC::RC_INDEX_COMMAND:
2963 case LyXRC::RC_JBIBTEX_COMMAND:
2964 case LyXRC::RC_JINDEX_COMMAND:
2965 case LyXRC::RC_NOMENCL_COMMAND:
2966 case LyXRC::RC_INPUT:
2967 case LyXRC::RC_KBMAP:
2968 case LyXRC::RC_KBMAP_PRIMARY:
2969 case LyXRC::RC_KBMAP_SECONDARY:
2970 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2971 case LyXRC::RC_LANGUAGE_AUTO_END:
2972 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2973 case LyXRC::RC_LANGUAGE_COMMAND_END:
2974 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2975 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2976 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2977 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2978 case LyXRC::RC_LYXRCFORMAT:
2979 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2980 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2981 case LyXRC::RC_MACRO_EDIT_STYLE:
2982 case LyXRC::RC_MAKE_BACKUP:
2983 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2984 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2985 case LyXRC::RC_NUMLASTFILES:
2986 case LyXRC::RC_PARAGRAPH_MARKERS:
2987 case LyXRC::RC_PATH_PREFIX:
2988 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2989 prependEnvPath("PATH", lyxrc_new.path_prefix);
2991 case LyXRC::RC_PREVIEW:
2992 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2993 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2994 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2995 case LyXRC::RC_PRINTCOPIESFLAG:
2996 case LyXRC::RC_PRINTER:
2997 case LyXRC::RC_PRINTEVENPAGEFLAG:
2998 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2999 case LyXRC::RC_PRINTFILEEXTENSION:
3000 case LyXRC::RC_PRINTLANDSCAPEFLAG:
3001 case LyXRC::RC_PRINTODDPAGEFLAG:
3002 case LyXRC::RC_PRINTPAGERANGEFLAG:
3003 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3004 case LyXRC::RC_PRINTPAPERFLAG:
3005 case LyXRC::RC_PRINTREVERSEFLAG:
3006 case LyXRC::RC_PRINTSPOOL_COMMAND:
3007 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
3008 case LyXRC::RC_PRINTTOFILE:
3009 case LyXRC::RC_PRINTTOPRINTER:
3010 case LyXRC::RC_PRINT_ADAPTOUTPUT:
3011 case LyXRC::RC_PRINT_COMMAND:
3012 case LyXRC::RC_RTL_SUPPORT:
3013 case LyXRC::RC_SAVE_COMPRESSED:
3014 case LyXRC::RC_SCREEN_DPI:
3015 case LyXRC::RC_SCREEN_FONT_ROMAN:
3016 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3017 case LyXRC::RC_SCREEN_FONT_SANS:
3018 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3019 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3020 case LyXRC::RC_SCREEN_FONT_SIZES:
3021 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3022 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3023 case LyXRC::RC_GEOMETRY_SESSION:
3024 case LyXRC::RC_SCREEN_ZOOM:
3025 case LyXRC::RC_SERVERPIPE:
3026 case LyXRC::RC_SET_COLOR:
3027 case LyXRC::RC_SHOW_BANNER:
3028 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3029 case LyXRC::RC_SPELLCHECKER:
3030 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
3032 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3033 case LyXRC::RC_SPELLCHECK_NOTES:
3034 case LyXRC::RC_SPLITINDEX_COMMAND:
3035 case LyXRC::RC_TEMPDIRPATH:
3036 case LyXRC::RC_TEMPLATEPATH:
3037 case LyXRC::RC_TEX_ALLOWS_SPACES:
3038 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3039 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3040 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3042 case LyXRC::RC_TEXINPUTS_PREFIX:
3043 case LyXRC::RC_THESAURUSDIRPATH:
3044 case LyXRC::RC_UIFILE:
3045 case LyXRC::RC_USER_EMAIL:
3046 case LyXRC::RC_USER_NAME:
3047 case LyXRC::RC_USE_CONVERTER_CACHE:
3048 case LyXRC::RC_USE_SYSTEM_COLORS:
3049 case LyXRC::RC_USE_TOOLTIP:
3050 case LyXRC::RC_USE_PIXMAP_CACHE:
3051 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3052 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3053 case LyXRC::RC_SINGLE_INSTANCE:
3054 case LyXRC::RC_SORT_LAYOUTS:
3055 case LyXRC::RC_FULL_SCREEN_LIMIT:
3056 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3057 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3058 case LyXRC::RC_FULL_SCREEN_TABBAR:
3059 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3060 case LyXRC::RC_FULL_SCREEN_WIDTH:
3061 case LyXRC::RC_VISUAL_CURSOR:
3062 case LyXRC::RC_VIEWER:
3063 case LyXRC::RC_VIEWER_ALTERNATIVES:
3064 case LyXRC::RC_FORWARD_SEARCH_DVI:
3065 case LyXRC::RC_FORWARD_SEARCH_PDF:
3066 case LyXRC::RC_EXPORT_OVERWRITE:
3067 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3068 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3069 case LyXRC::RC_CURSOR_WIDTH:
3076 string const LyXRC::getDescription(LyXRCTags tag)
3081 case RC_ACCEPT_COMPOUND:
3082 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3086 str = _("Specify an alternate language. The default is to use the language of the document.");
3089 case RC_PLAINTEXT_LINELEN:
3090 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.");
3093 case RC_AUTOREGIONDELETE:
3094 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3097 case RC_AUTORESET_OPTIONS:
3098 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3102 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3105 case RC_AUTO_NUMBER:
3108 case RC_BACKUPDIR_PATH:
3109 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.");
3112 case RC_BIBTEX_COMMAND:
3113 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3116 case RC_JBIBTEX_COMMAND:
3117 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3121 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3124 case RC_CHECKLASTFILES:
3125 str = _("Select to check whether the lastfiles still exist.");
3128 case RC_CHKTEX_COMMAND:
3129 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3138 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3139 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.");
3142 case RC_CURSOR_WIDTH:
3143 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3146 case RC_SCROLL_BELOW_DOCUMENT:
3147 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");
3150 case RC_MAC_DONTSWAP_CTRL_META:
3151 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3154 case RC_MAC_LIKE_WORD_MOVEMENT:
3155 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3158 case RC_SHOW_MACRO_LABEL:
3159 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3162 case RC_DATE_INSERT_FORMAT:
3163 //xgettext:no-c-format
3164 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3168 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3171 case RC_DEFAULT_VIEW_FORMAT:
3172 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3175 case RC_DEFAULT_LANGUAGE:
3176 str = _("New documents will be assigned this language.");
3179 case RC_DEFAULT_PAPERSIZE:
3180 str = _("Specify the default paper size.");
3183 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3184 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3187 case RC_DISPLAY_GRAPHICS:
3188 str = _("Select how LyX will display any graphics.");
3191 case RC_DOCUMENTPATH:
3192 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3196 str = _("Specify additional chars that can be part of a word.");
3199 case RC_EXAMPLEPATH:
3200 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3203 case RC_FONT_ENCODING:
3204 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3207 case RC_FORCE_PAINT_SINGLE_CHAR:
3208 str = _("Disable any kerning and ligatures for text drawing on screen.");
3214 case RC_INDEX_COMMAND:
3215 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\".");
3218 case RC_JINDEX_COMMAND:
3219 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3222 case RC_NOMENCL_COMMAND:
3223 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3230 case RC_KBMAP_PRIMARY:
3231 case RC_KBMAP_SECONDARY:
3232 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.");
3235 case RC_LANGUAGE_AUTO_BEGIN:
3236 str = _("Select if a language switching command is needed at the beginning of the document.");
3239 case RC_LANGUAGE_AUTO_END:
3240 str = _("Select if a language switching command is needed at the end of the document.");
3243 case RC_LANGUAGE_COMMAND_BEGIN:
3244 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.");
3247 case RC_LANGUAGE_COMMAND_END:
3248 str = _("The LaTeX command for changing back to the language of the document.");
3251 case RC_LANGUAGE_COMMAND_LOCAL:
3252 str = _("The LaTeX command for local changing of the language.");
3255 case RC_LANGUAGE_GLOBAL_OPTIONS:
3256 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3259 case RC_LANGUAGE_CUSTOM_PACKAGE:
3260 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3263 case RC_LANGUAGE_PACKAGE_SELECTION:
3264 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3267 case RC_USELASTFILEPOS:
3268 str = _("De-select if you do not want LyX to scroll to saved position.");
3271 case RC_LOADSESSION:
3272 str = _("De-select to prevent loading files opened from the last LyX session.");
3275 case RC_MAKE_BACKUP:
3276 str = _("De-select if you don't want LyX to create backup files.");
3279 case RC_MARK_FOREIGN_LANGUAGE:
3280 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3283 case RC_MOUSE_WHEEL_SPEED:
3284 str = bformat(_("The scrolling speed of the mouse wheel."),
3288 case RC_COMPLETION_POPUP_DELAY:
3289 str = _("The completion popup delay.");
3292 case RC_COMPLETION_POPUP_MATH:
3293 str = _("Select to display the completion popup in math mode.");
3296 case RC_COMPLETION_POPUP_TEXT:
3297 str = _("Select to display the completion popup in text mode.");
3300 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3301 str = _("Show the completion popup without delay after non-unique completion attempt.");
3304 case RC_COMPLETION_POPUP_TEXT:
3305 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3308 case RC_COMPLETION_POPUP_DELAY:
3309 str = _("The inline completion delay.");
3312 case RC_COMPLETION_INLINE_MATH:
3313 str = _("Select to display the inline completion in math mode.");
3316 case RC_COMPLETION_INLINE_TEXT:
3317 str = _("Select to display the inline completion in text mode.");
3320 case RC_COMPLETION_INLINE_DOTS:
3321 str = _("Use \"...\" to shorten long completions.");
3324 case RC_AUTOCORRECTION_MATH:
3325 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3328 case RC_NUMLASTFILES:
3329 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3333 case RC_PATH_PREFIX:
3334 str = _("Specify those directories which should be "
3335 "prepended to the PATH environment variable.\n"
3336 "Use the OS native format.");
3340 str = _("Shows a typeset preview of things such as math");
3343 case RC_PREVIEW_HASHED_LABELS:
3344 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3347 case RC_PREVIEW_SCALE_FACTOR:
3348 str = _("Scale the preview size to suit.");
3351 case RC_PRINTCOLLCOPIESFLAG:
3352 str = _("The option for specifying whether the copies should be collated.");
3355 case RC_PRINTCOPIESFLAG:
3356 str = _("The option for specifying the number of copies to print.");
3360 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3363 case RC_PRINTEVENPAGEFLAG:
3364 str = _("The option to print only even pages.");
3367 case RC_PRINTEXSTRAOPTIONS:
3368 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3371 case RC_PRINTFILEEXTENSION:
3372 str = _("Extension of printer program output file. Usually \".ps\".");
3375 case RC_PRINTLANDSCAPEFLAG:
3376 str = _("The option to print out in landscape.");
3379 case RC_PRINTODDPAGEFLAG:
3380 str = _("The option to print only odd pages.");
3383 case RC_PRINTPAGERANGEFLAG:
3384 str = _("The option for specifying a comma-separated list of pages to print.");
3387 case RC_PRINTPAPERDIMENSIONFLAG:
3388 str = _("Option to specify the dimensions of the print paper.");
3391 case RC_PRINTPAPERFLAG:
3392 str = _("The option to specify paper type.");
3395 case RC_PRINTREVERSEFLAG:
3396 str = _("The option to reverse the order of the pages printed.");
3399 case RC_PRINTSPOOL_COMMAND:
3400 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.");
3403 case RC_PRINTSPOOL_PRINTERPREFIX:
3404 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.");
3407 case RC_PRINTTOFILE:
3408 str = _("Option to pass to the print program to print to a file.");
3411 case RC_PRINTTOPRINTER:
3412 str = _("Option to pass to the print program to print on a specific printer.");
3415 case RC_PRINT_ADAPTOUTPUT:
3416 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3419 case RC_PRINT_COMMAND:
3420 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3423 case RC_RTL_SUPPORT:
3424 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3427 case RC_VISUAL_CURSOR:
3428 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3432 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3435 case RC_SCREEN_FONT_ROMAN:
3436 case RC_SCREEN_FONT_SANS:
3437 case RC_SCREEN_FONT_TYPEWRITER:
3438 str = _("The screen fonts used to display the text while editing.");
3441 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3442 case RC_SCREEN_FONT_SANS_FOUNDRY:
3443 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3446 case RC_SCREEN_FONT_SCALABLE:
3447 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.");
3450 case RC_SCREEN_FONT_SIZES:
3451 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3454 case RC_SCREEN_ZOOM:
3455 //xgettext:no-c-format
3456 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3459 case RC_GEOMETRY_SESSION:
3460 str = _("Allow session manager to save and restore windows geometry.");
3464 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3470 case RC_SHOW_BANNER:
3471 str = _("De-select if you don't want the startup banner.");
3474 case RC_TEMPDIRPATH:
3475 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3478 case RC_THESAURUSDIRPATH:
3479 str = _("This is the place where the files of the thesaurus library reside.");
3482 case RC_TEMPLATEPATH:
3483 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3486 case RC_TEX_ALLOWS_SPACES:
3489 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3492 case RC_TEXINPUTS_PREFIX:
3493 str = _("Specify those directories which should be "
3494 "prepended to the TEXINPUTS environment variable.\n"
3495 "A '.' represents the current document directory. "
3496 "Use the OS native format.");
3500 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3509 case RC_USE_USE_SYSTEM_COLORS:
3510 str = _("Enable use the system colors for some things like main window background and selection.");
3513 case RC_USE_TOOLTIP:
3514 str = _("Enable the automatic appearance of tool tips in the work area.");
3517 case RC_USE_PIXMAP_CACHE:
3518 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3521 case RC_VIEWDVI_PAPEROPTION:
3522 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3537 // The global instance
3540 // The global copy of the system lyxrc entries (everything except preferences)