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 = 5; // vfr: add default length unit
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_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
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_view_format = "pdf2";
254 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
255 bibtex_command = "bibtex";
257 index_command = "makeindex -c -q";
258 nomencl_command = "makeindex -s nomencl.ist";
260 // Because a screen is typically wider than a piece of paper:
262 allow_geometry_session = true;
263 // Default LaTeX font size:
264 font_sizes[FONT_SIZE_TINY] = "5.0";
265 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
266 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
267 font_sizes[FONT_SIZE_SMALL] = "9.0";
268 font_sizes[FONT_SIZE_NORMAL] = "10.0";
269 font_sizes[FONT_SIZE_LARGE] = "12.0";
270 font_sizes[FONT_SIZE_LARGER] = "14.4";
271 font_sizes[FONT_SIZE_LARGEST] = "17.26";
272 font_sizes[FONT_SIZE_HUGE] = "20.74";
273 font_sizes[FONT_SIZE_HUGER] = "24.88";
274 use_scalable_fonts = true;
275 roman_font_name = "";
277 typewriter_font_name = "";
279 auto_region_delete = true;
280 auto_reset_options = false;
281 plaintext_linelen = 65;
282 mouse_wheel_speed = 1.0;
283 num_lastfiles = maxlastfiles;
284 check_lastfiles = true;
285 use_lastfilepos = true;
286 load_session = false;
288 save_compressed = false;
289 backupdir_path.erase();
290 display_graphics = true;
291 // Spellchecker settings:
292 // FIXME: this check should test the target platform (darwin)
293 #if defined(USE_MACOSX_PACKAGING)
294 spellchecker = "native";
295 #elif defined(USE_ASPELL)
296 spellchecker = "aspell";
297 #elif defined(USE_HUNSPELL)
298 spellchecker = "hunspell";
300 spellchecker = "aspell";
302 spellchecker_accept_compound = false;
303 spellcheck_continuously = false;
304 spellcheck_notes = true;
307 visual_cursor = false;
309 mark_foreign_language = true;
310 language_auto_begin = true;
311 language_auto_end = true;
312 language_global_options = true;
313 language_package_selection = LP_AUTO;
314 language_custom_package = "\\usepackage{babel}";
315 language_command_begin = "\\selectlanguage{$$lang}";
316 language_command_local = "\\foreignlanguage{$$lang}{";
317 sort_layouts = false;
318 group_layouts = true;
319 default_language = "english";
320 gui_language = "auto";
322 windows_style_tex_paths = false;
323 tex_allows_spaces = false;
324 date_insert_format = "%x";
325 cursor_follows_scrollbar = false;
326 scroll_below_document = false;
327 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
328 paragraph_markers = false;
329 mac_dontswap_ctrl_meta = false;
330 mac_like_word_movement = false;
331 macro_edit_style = MACRO_EDIT_INLINE_BOX;
332 dialogs_iconify_with_main = false;
333 preview = PREVIEW_OFF;
334 preview_hashed_labels = false;
335 preview_scale_factor = 1.0;
336 use_converter_cache = true;
337 use_system_colors = false;
339 use_pixmap_cache = false;
340 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
341 user_name = to_utf8(support::user_name());
342 user_email = to_utf8(support::user_email());
343 open_buffers_in_tabs = true;
344 single_close_tab_button = false;
345 single_instance = true;
346 forward_search_dvi = string();
347 forward_search_pdf = string();
348 export_overwrite = NO_FILES;
350 // Fullscreen settings
351 full_screen_limit = false;
352 full_screen_toolbars = true;
353 full_screen_tabbar = true;
354 full_screen_menubar = true;
355 full_screen_scrollbar = true;
356 full_screen_width = 700;
358 completion_cursor_text = true;
359 completion_popup_math = true;
360 completion_popup_text = false;
361 completion_popup_delay = 2.0;
362 completion_popup_after_complete = true;
363 autocorrection_math = false;
364 completion_inline_math = true;
365 completion_inline_text = false;
366 completion_inline_dots = -1;
367 completion_inline_delay = 0.2;
368 default_decimal_point = ".";
369 default_length_unit = Length::CM;
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 // Keep this in the else branch, such that lexrc2 goes out
407 // of scope and releases the lock on tempfile before we
408 // attempt to remove it. This matters on Windows.
409 Lexer lexrc2(lyxrcTags);
410 lexrc2.setFile(tempfile);
411 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
412 retval = read(lexrc2, check_format);
414 tempfile.removeFile();
415 return retval == ReadOK;
419 // don't need to worry about conversion, because this is always
420 // from an internal source
421 bool LyXRC::read(istream & is)
423 Lexer lexrc(lyxrcTags);
425 LYXERR(Debug::LYXRC, "Reading istream...");
426 return read(lexrc, false) == ReadOK;
430 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
432 if (lyxerr.debugging(Debug::PARSER))
433 lexrc.printTable(lyxerr);
438 // default for current rowpainter capabilities
439 force_paint_single_char = true;
441 // format prior to 2.0 and introduction of format tag
442 unsigned int format = 0;
444 while (lexrc.isOK()) {
445 // By using two switches we take advantage of the compiler
446 // telling us if we have missed a LyXRCTags element in
447 // the second switch.
448 // Note that this also shows a problem with Lexer since it
449 // helps us avoid taking advantage of the strictness of the
452 int le = lexrc.lex();
454 case Lexer::LEX_UNDEF:
455 lexrc.printError("Unknown tag `$$Token'");
457 case Lexer::LEX_FEOF:
462 switch (static_cast<LyXRCTags>(le)) {
465 format = lexrc.getInteger();
467 case RC_INPUT: // Include file
470 libFileSearch(string(),
472 if (read(tmp, check_format)) {
474 "Error reading included file: " + tmp.absFileName());
480 bind_file = os::internal_path(lexrc.getString());
485 def_file = os::internal_path(lexrc.getString());
490 ui_file = os::internal_path(lexrc.getString());
493 case RC_AUTORESET_OPTIONS:
494 lexrc >> auto_reset_options;
497 case RC_DISPLAY_GRAPHICS:
499 display_graphics = lexrc.getString() == "true";
502 case RC_TEX_EXPECTS_WINDOWS_PATHS:
503 lexrc >> windows_style_tex_paths;
506 case RC_TEX_ALLOWS_SPACES:
507 lexrc >> tex_allows_spaces;
510 case RC_TEXINPUTS_PREFIX:
511 lexrc >> texinputs_prefix;
518 case RC_KBMAP_PRIMARY:
520 string const kmap(os::internal_path(lexrc.getString()));
521 if (!libFileSearch("kbd", kmap, "kmap").empty()
523 primary_kbmap = kmap;
525 lexrc.printError("LyX: Keymap `$$Token' not found");
530 case RC_KBMAP_SECONDARY:
532 string const kmap(os::internal_path(lexrc.getString()));
533 if (!libFileSearch("kbd", kmap, "kmap").empty()
535 secondary_kbmap = kmap;
537 lexrc.printError("LyX: Keymap `$$Token' not found");
542 case RC_FONT_ENCODING:
546 case RC_FORCE_PAINT_SINGLE_CHAR:
547 lexrc >> force_paint_single_char;
554 case RC_PRINT_COMMAND:
555 if (lexrc.next(true)) {
556 print_command = lexrc.getString();
560 case RC_PRINTEVENPAGEFLAG:
561 lexrc >> print_evenpage_flag;
564 case RC_PRINTODDPAGEFLAG:
565 lexrc >> print_oddpage_flag;
568 case RC_PRINTPAGERANGEFLAG:
569 lexrc >> print_pagerange_flag;
572 case RC_PRINTCOPIESFLAG:
573 lexrc >> print_copies_flag;
576 case RC_PRINTCOLLCOPIESFLAG:
577 lexrc >> print_collcopies_flag;
580 case RC_PRINTREVERSEFLAG:
581 lexrc >> print_reverse_flag;
584 case RC_PRINTLANDSCAPEFLAG:
585 lexrc >> print_landscape_flag;
588 case RC_PRINTTOPRINTER:
589 lexrc >> print_to_printer;
592 case RC_PRINT_ADAPTOUTPUT:
593 lexrc >> print_adapt_output;
598 print_to_file = os::internal_path(lexrc.getString());
602 case RC_PRINTFILEEXTENSION:
603 lexrc >> print_file_extension;
606 case RC_PRINTEXSTRAOPTIONS:
607 lexrc >> print_extra_options;
610 case RC_PRINTSPOOL_COMMAND:
611 if (lexrc.next(true)) {
612 print_spool_command = lexrc.getString();
616 case RC_PRINTSPOOL_PRINTERPREFIX:
617 lexrc >> print_spool_printerprefix;
620 case RC_PRINTPAPERDIMENSIONFLAG:
621 lexrc >> print_paper_dimension_flag;
624 case RC_PRINTPAPERFLAG:
625 lexrc >> print_paper_flag;
628 case RC_VIEWDVI_PAPEROPTION:
630 view_dvi_paper_option = lexrc.getString();
632 view_dvi_paper_option.erase();
635 case RC_CHKTEX_COMMAND:
636 if (lexrc.next(true)) {
637 chktex_command = lexrc.getString();
641 case RC_BIBTEX_ALTERNATIVES:
642 if (lexrc.next(true)) {
643 bibtex_alternatives.insert(lexrc.getString());
647 case RC_BIBTEX_COMMAND:
648 if (lexrc.next(true)) {
649 bibtex_command = lexrc.getString();
653 case RC_JBIBTEX_COMMAND:
654 if (lexrc.next(true)) {
655 jbibtex_command = lexrc.getString();
659 case RC_INDEX_ALTERNATIVES:
660 if (lexrc.next(true)) {
661 index_alternatives.insert(lexrc.getString());
665 case RC_INDEX_COMMAND:
666 if (lexrc.next(true)) {
667 index_command = lexrc.getString();
671 case RC_JINDEX_COMMAND:
672 if (lexrc.next(true)) {
673 jindex_command = lexrc.getString();
677 case RC_SPLITINDEX_COMMAND:
678 if (lexrc.next(true)) {
679 splitindex_command = lexrc.getString();
683 case RC_NOMENCL_COMMAND:
684 if (lexrc.next(true)) {
685 nomencl_command = lexrc.getString();
697 case RC_GEOMETRY_SESSION:
698 lexrc >> allow_geometry_session;
701 case RC_SCREEN_FONT_SIZES:
702 lexrc >> font_sizes[FONT_SIZE_TINY];
703 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
704 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
705 lexrc >> font_sizes[FONT_SIZE_SMALL];
706 lexrc >> font_sizes[FONT_SIZE_NORMAL];
707 lexrc >> font_sizes[FONT_SIZE_LARGE];
708 lexrc >> font_sizes[FONT_SIZE_LARGER];
709 lexrc >> font_sizes[FONT_SIZE_LARGEST];
710 lexrc >> font_sizes[FONT_SIZE_HUGE];
711 lexrc >> font_sizes[FONT_SIZE_HUGER];
714 case RC_SCREEN_FONT_SCALABLE:
715 lexrc >> use_scalable_fonts;
722 case RC_DOCUMENTPATH:
724 document_path = os::internal_path(lexrc.getString());
725 document_path = expandPath(document_path);
731 example_path = os::internal_path(lexrc.getString());
732 example_path = expandPath(example_path);
736 case RC_TEMPLATEPATH:
738 template_path = os::internal_path(lexrc.getString());
739 template_path = expandPath(template_path);
745 tempdir_path = os::internal_path(lexrc.getString());
746 tempdir_path = expandPath(tempdir_path);
750 case RC_THESAURUSDIRPATH:
752 thesaurusdir_path = os::internal_path(lexrc.getString());
753 thesaurusdir_path = expandPath(thesaurusdir_path);
757 case RC_HUNSPELLDIR_PATH:
759 hunspelldir_path = os::internal_path(lexrc.getString());
760 hunspelldir_path = expandPath(hunspelldir_path);
764 case RC_USELASTFILEPOS:
765 lexrc >> use_lastfilepos;
769 lexrc >> load_session;
772 case RC_MOUSE_WHEEL_SPEED:
773 lexrc >> mouse_wheel_speed;
776 case RC_COMPLETION_INLINE_DELAY:
777 lexrc >> completion_inline_delay;
780 case RC_COMPLETION_INLINE_MATH:
781 lexrc >> completion_inline_math;
784 case RC_COMPLETION_INLINE_TEXT:
785 lexrc >> completion_inline_text;
788 case RC_COMPLETION_INLINE_DOTS:
789 lexrc >> completion_inline_dots;
792 case RC_AUTOCORRECTION_MATH:
793 lexrc >> autocorrection_math;
796 case RC_COMPLETION_POPUP_DELAY:
797 lexrc >> completion_popup_delay;
800 case RC_COMPLETION_POPUP_MATH:
801 lexrc >> completion_popup_math;
804 case RC_COMPLETION_POPUP_TEXT:
805 lexrc >> completion_popup_text;
808 case RC_COMPLETION_CURSOR_TEXT:
809 lexrc >> completion_cursor_text;
812 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
813 lexrc >> completion_popup_after_complete;
816 case RC_NUMLASTFILES:
817 lexrc >> num_lastfiles;
820 case RC_CHECKLASTFILES:
821 lexrc >> check_lastfiles;
828 case RC_SCREEN_FONT_ROMAN:
830 roman_font_name = lexrc.getString();
831 oldFontFormat(roman_font_name,
836 case RC_SCREEN_FONT_SANS:
838 sans_font_name = lexrc.getString();
839 oldFontFormat(sans_font_name, sans_font_foundry);
843 case RC_SCREEN_FONT_TYPEWRITER:
845 typewriter_font_name = lexrc.getString();
846 oldFontFormat(typewriter_font_name,
847 typewriter_font_foundry);
851 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
852 lexrc >> roman_font_foundry;
855 case RC_SCREEN_FONT_SANS_FOUNDRY:
856 lexrc >> sans_font_foundry;
859 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
860 lexrc >> typewriter_font_foundry;
865 lexrc.printError("Missing color tag.");
868 string lyx_name = lexrc.getString();
871 lexrc.printError("Missing color name for color: `$$Token'");
874 string x11_name = lexrc.getString();
876 ColorCode const col =
877 lcolor.getFromLyXName(lyx_name);
878 if (col == Color_none ||
879 col == Color_inherit ||
883 if (!lcolor.setColor(col, x11_name))
884 LYXERR0("Bad lyxrc set_color for " << lyx_name);
888 case RC_AUTOREGIONDELETE:
889 // Auto region delete defaults to true
890 lexrc >> auto_region_delete;
895 lyxpipes = os::internal_path(lexrc.getString());
896 lyxpipes = expandPath(lyxpipes);
900 case RC_CURSOR_FOLLOWS_SCROLLBAR:
901 lexrc >> cursor_follows_scrollbar;
904 case RC_CURSOR_WIDTH:
905 lexrc >> cursor_width;
908 case RC_SCROLL_BELOW_DOCUMENT:
909 lexrc >> scroll_below_document;
912 case RC_PARAGRAPH_MARKERS:
913 lexrc >> paragraph_markers;
916 case RC_MAC_DONTSWAP_CTRL_META:
917 lexrc >> mac_dontswap_ctrl_meta;
920 case RC_MAC_LIKE_WORD_MOVEMENT:
921 lexrc >> mac_like_word_movement;
924 case RC_MACRO_EDIT_STYLE:
926 switch (lexrc.getInteger()) {
927 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
928 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
929 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
934 case RC_DIALOGS_ICONIFY_WITH_MAIN:
935 lexrc >> dialogs_iconify_with_main;
938 case RC_PLAINTEXT_LINELEN:
939 lexrc >> plaintext_linelen;
941 // Spellchecker settings:
942 case RC_ACCEPT_COMPOUND:
943 lexrc >> spellchecker_accept_compound;
945 case RC_USE_SYSTEM_COLORS:
946 lexrc >> use_system_colors;
949 lexrc >> use_tooltip;
951 case RC_USE_PIXMAP_CACHE:
952 lexrc >> use_pixmap_cache;
954 case RC_SPELLCHECKER:
955 lexrc >> spellchecker;
958 lexrc >> spellchecker_alt_lang;
961 lexrc >> spellchecker_esc_chars;
963 case RC_SPELLCHECK_CONTINUOUSLY:
964 lexrc >> spellcheck_continuously;
966 case RC_SPELLCHECK_NOTES:
967 lexrc >> spellcheck_notes;
970 lexrc >> make_backup;
972 case RC_SAVE_COMPRESSED:
973 lexrc >> save_compressed;
975 case RC_BACKUPDIR_PATH:
977 backupdir_path = os::internal_path(lexrc.getString());
978 backupdir_path = expandPath(backupdir_path);
981 case RC_DEFAULT_DECIMAL_POINT:
982 lexrc >> default_decimal_point;
984 case RC_DEFAULT_LENGTH_UNIT:
986 default_length_unit = (Length::UNIT) lexrc.getInteger();
988 case RC_DATE_INSERT_FORMAT:
989 lexrc >> date_insert_format;
991 case RC_LANGUAGE_CUSTOM_PACKAGE:
992 lexrc >> language_custom_package;
994 case RC_LANGUAGE_AUTO_BEGIN:
995 lexrc >> language_auto_begin;
997 case RC_LANGUAGE_AUTO_END:
998 lexrc >> language_auto_end;
1000 case RC_LANGUAGE_GLOBAL_OPTIONS:
1001 lexrc >> language_global_options;
1003 case RC_LANGUAGE_PACKAGE_SELECTION:
1005 switch (lexrc.getInteger()) {
1007 language_package_selection = LP_AUTO;
1010 language_package_selection = LP_BABEL;
1013 language_package_selection = LP_CUSTOM;
1016 language_package_selection = LP_NONE;
1021 case RC_LANGUAGE_COMMAND_BEGIN:
1022 lexrc >> language_command_begin;
1024 case RC_LANGUAGE_COMMAND_END:
1025 lexrc >> language_command_end;
1027 case RC_LANGUAGE_COMMAND_LOCAL:
1028 lexrc >> language_command_local;
1030 case RC_RTL_SUPPORT:
1031 lexrc >> rtl_support;
1033 case RC_VISUAL_CURSOR:
1034 lexrc >> visual_cursor;
1036 case RC_AUTO_NUMBER:
1037 lexrc >> auto_number;
1039 case RC_MARK_FOREIGN_LANGUAGE:
1040 lexrc >> mark_foreign_language;
1044 string fmt, command;
1046 fmt = lexrc.getString();
1047 if (lexrc.next(true))
1048 command = lexrc.getString();
1049 setMover(fmt, command);
1053 case RC_CONVERTER: {
1054 string from, to, command, flags;
1056 from = lexrc.getString();
1058 to = lexrc.getString();
1059 if (lexrc.next(true))
1060 command = lexrc.getString();
1062 flags = lexrc.getString();
1063 if (command.empty())
1064 theConverters().erase(from, to);
1066 theConverters().add(from, to, command, flags);
1069 // compatibility with versions older than 1.4.0 only
1071 string format, command;
1072 lexrc >> format >> command;
1073 formats.setViewer(format, command);
1076 case RC_FILEFORMAT: {
1077 string format, extensions, prettyname, shortcut;
1078 lexrc >> format >> extensions >> prettyname >> shortcut;
1079 string viewer, editor;
1080 if (lexrc.next(true))
1081 viewer = lexrc.getString();
1082 if (lexrc.next(true))
1083 editor = lexrc.getString();
1085 // Hack to ensure compatibility with versions older
1087 int le = lexrc.lex();
1088 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1089 flags = lexrc.getString();
1090 if (le != Lexer::LEX_DATA) {
1091 // We have got a known token.
1092 // Therefore this is an old style
1093 // format definition without
1095 lexrc.pushToken(flags);
1099 int flgs = Format::none;
1100 while (!flags.empty()) {
1102 flags = split(flags, flag, ',');
1103 if (flag == "document")
1104 flgs |= Format::document;
1105 else if (flag == "vector")
1106 flgs |= Format::vector;
1107 else if (flag == "zipped=native")
1108 flgs |= Format::zipped_native;
1109 else if (flag == "menu=export")
1110 flgs |= Format::export_menu;
1112 LYXERR0("Ignoring unknown flag `"
1113 << flag << "' for format `"
1116 if (prettyname.empty()) {
1117 if (theConverters().formatIsUsed(format))
1118 LYXERR0("Can't delete format " << format);
1120 formats.erase(format);
1122 formats.add(format, extensions, prettyname,
1123 shortcut, viewer, editor, flgs);
1127 case RC_VIEWER_ALTERNATIVES: {
1128 string format, command;
1130 format = lexrc.getString();
1131 if (lexrc.eatLine())
1132 command = lexrc.getString();
1133 viewer_alternatives[format].insert(command);
1136 case RC_EDITOR_ALTERNATIVES: {
1137 string format, command;
1139 format = lexrc.getString();
1140 if (lexrc.eatLine())
1141 command = lexrc.getString();
1142 editor_alternatives[format].insert(command);
1146 case RC_DEFAULT_VIEW_FORMAT:
1147 lexrc >> default_view_format;
1150 case RC_DEFAULT_LANGUAGE:
1151 lexrc >> default_language;
1154 case RC_GUI_LANGUAGE:
1155 lexrc >> gui_language;
1158 case RC_SHOW_BANNER:
1159 lexrc >> show_banner;
1164 string const tmp = lexrc.getString();
1165 if (tmp == "true" || tmp == "on")
1166 preview = PREVIEW_ON;
1167 else if (tmp == "no_math")
1168 preview = PREVIEW_NO_MATH;
1170 preview = PREVIEW_OFF;
1171 if (tmp != "false" && tmp != "off")
1172 LYXERR0("Unrecognized preview status \""
1178 case RC_PREVIEW_HASHED_LABELS:
1179 lexrc >> preview_hashed_labels;
1182 case RC_PREVIEW_SCALE_FACTOR:
1183 lexrc >> preview_scale_factor;
1190 lexrc >> user_email;
1193 case RC_PATH_PREFIX:
1194 lexrc >> path_prefix;
1197 case RC_USE_CONVERTER_CACHE:
1198 lexrc >> use_converter_cache;
1200 case RC_CONVERTER_CACHE_MAXAGE:
1201 lexrc >> converter_cache_maxage;
1204 case RC_SORT_LAYOUTS:
1205 lexrc >> sort_layouts;
1207 case RC_GROUP_LAYOUTS:
1208 lexrc >> group_layouts;
1210 case RC_FULL_SCREEN_LIMIT:
1211 lexrc >> full_screen_limit;
1213 case RC_FULL_SCREEN_TOOLBARS:
1214 lexrc >> full_screen_toolbars;
1216 case RC_FULL_SCREEN_SCROLLBAR:
1217 lexrc >> full_screen_scrollbar;
1219 case RC_FULL_SCREEN_TABBAR:
1220 lexrc >> full_screen_tabbar;
1222 case RC_FULL_SCREEN_MENUBAR:
1223 lexrc >> full_screen_menubar;
1225 case RC_FULL_SCREEN_WIDTH:
1226 lexrc >> full_screen_width;
1228 case RC_OPEN_BUFFERS_IN_TABS:
1229 lexrc >> open_buffers_in_tabs;
1231 case RC_SINGLE_CLOSE_TAB_BUTTON:
1232 lexrc >> single_close_tab_button;
1234 case RC_SINGLE_INSTANCE:
1235 lexrc >> single_instance;
1236 if (run_mode == PREFERRED)
1237 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1239 case RC_FORWARD_SEARCH_DVI:
1240 if (lexrc.next(true))
1241 forward_search_dvi = lexrc.getString();
1243 case RC_FORWARD_SEARCH_PDF:
1244 if (lexrc.next(true))
1245 forward_search_pdf = lexrc.getString();
1247 case RC_EXPORT_OVERWRITE:
1249 string const tmp = lexrc.getString();
1250 if (tmp == "all" || tmp == "true")
1251 export_overwrite = ALL_FILES;
1252 else if (tmp == "main")
1253 export_overwrite = MAIN_FILE;
1255 export_overwrite = NO_FILES;
1256 if (tmp != "ask" && tmp != "false")
1257 LYXERR0("Unrecognized export_overwrite status \""
1262 case RC_SCROLL_WHEEL_ZOOM:
1264 string const tmp = lexrc.getString();
1266 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1267 else if (tmp == "shift")
1268 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1269 else if (tmp == "alt")
1270 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1272 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1273 if (tmp != "off" && tmp != "false")
1274 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1281 break; // this is just a dummy
1284 // This is triggered the first time through the loop unless
1285 // we hit a format tag.
1286 if (check_format && format != LYXRC_FILEFORMAT)
1287 return FormatMismatch;
1290 /// Update converters data-structures
1291 theConverters().update(formats);
1292 theConverters().buildGraph();
1298 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1300 ofstream ofs(filename.toFilesystemEncoding().c_str());
1302 write(ofs, ignore_system_lyxrc);
1306 void LyXRC::print() const
1308 if (lyxerr.debugging())
1309 write(lyxerr, false);
1317 typedef pair<string, SpecialisedMover> Data;
1319 SameMover(Data const & comparison)
1320 : comparison_(comparison) {}
1322 bool operator()(Data const & data) const
1324 return data.first == comparison_.first &&
1325 data.second.command() == comparison_.second.command();
1335 // Escape \ and " so that LyXLex can read the string later
1336 string escapeCommand(string const & str) {
1337 return subst(subst(str , "\\", "\\\\"),
1344 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1346 LyXRCTags tag = RC_LAST;
1348 if (!name.empty()) {
1349 for (int i = 0; i != lyxrcCount; ++i)
1350 if ("\\" + name == lyxrcTags[i].tag)
1351 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1355 os << "# LyX " << lyx_version
1356 << " generated this file. If you want to make your own\n"
1357 << "# modifications you should do them from inside LyX and save.\n\n"
1358 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1360 // Why the switch you might ask. It is a trick to ensure that all
1361 // the elements in the LyXRCTags enum are handled. As you can see
1362 // there are no breaks at all. So it is just a huge fall-through.
1363 // The nice thing is that we will get a warning from the compiler
1364 // if we forget an element.
1368 // input/include files are not done here
1369 case RC_LYXRCFORMAT:
1371 if (ignore_system_lyxrc ||
1372 bind_file != system_lyxrc.bind_file) {
1373 string const path = os::external_path(bind_file);
1374 os << "\\bind_file \"" << path << "\"\n";
1380 if (ignore_system_lyxrc ||
1381 def_file != system_lyxrc.def_file) {
1382 string const path = os::external_path(def_file);
1383 os << "\\def_file \"" << path << "\"\n";
1392 << "# MISC SECTION ######################################\n"
1394 // bind files are not done here.
1396 case RC_PATH_PREFIX:
1397 if (ignore_system_lyxrc ||
1398 path_prefix != system_lyxrc.path_prefix) {
1399 os << "\\path_prefix \"" << path_prefix << "\"\n";
1404 if (ignore_system_lyxrc ||
1405 ui_file != system_lyxrc.ui_file) {
1406 string const path = os::external_path(ui_file);
1407 os << "\\ui_file \"" << path << "\"\n";
1411 case RC_AUTOREGIONDELETE:
1412 if (ignore_system_lyxrc ||
1413 auto_region_delete != system_lyxrc.auto_region_delete) {
1414 os << "# Set to false to inhibit automatic replacement of\n"
1415 << "# the current selection.\n"
1416 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1421 case RC_AUTORESET_OPTIONS:
1422 if (ignore_system_lyxrc ||
1423 auto_reset_options != system_lyxrc.auto_reset_options) {
1424 os << "# Set to false to inhibit automatic reset of\n"
1425 << "# the class options to defaults on class change.\n"
1426 << "\\auto_reset_options "
1427 << convert<string>(auto_reset_options)
1433 if (ignore_system_lyxrc ||
1434 autosave != system_lyxrc.autosave) {
1435 os << "# The time interval between auto-saves in seconds.\n"
1436 << "\\autosave " << autosave << '\n';
1440 case RC_DISPLAY_GRAPHICS:
1441 if (ignore_system_lyxrc ||
1442 display_graphics != system_lyxrc.display_graphics) {
1443 os << "# Display graphics within LyX\n"
1445 << "\\display_graphics "
1446 << (display_graphics ? "true" : "false")
1451 case RC_SORT_LAYOUTS:
1452 if (ignore_system_lyxrc ||
1453 sort_layouts != system_lyxrc.sort_layouts) {
1454 os << "# Sort layouts alphabetically.\n"
1455 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1459 case RC_GROUP_LAYOUTS:
1460 if (ignore_system_lyxrc ||
1461 group_layouts != system_lyxrc.group_layouts) {
1462 os << "# Group layouts by their category.\n"
1463 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1467 case RC_VIEWDVI_PAPEROPTION:
1468 if (ignore_system_lyxrc ||
1469 view_dvi_paper_option
1470 != system_lyxrc.view_dvi_paper_option) {
1471 os << "# Options used to specify paper size to the\n"
1472 << "# view_dvi_command (e.g. -paper)\n"
1473 << "\\view_dvi_paper_option \""
1474 << view_dvi_paper_option << "\"\n";
1478 case RC_CHKTEX_COMMAND:
1479 if (ignore_system_lyxrc ||
1480 chktex_command != system_lyxrc.chktex_command) {
1481 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1485 case RC_BIBTEX_ALTERNATIVES: {
1486 CommandSet::const_iterator it = bibtex_alternatives.begin();
1487 CommandSet::const_iterator end = bibtex_alternatives.end();
1488 for ( ; it != end; ++it) {
1489 if (ignore_system_lyxrc
1490 || !system_lyxrc.bibtex_alternatives.count(*it))
1491 os << "\\bibtex_alternatives \""
1497 case RC_BIBTEX_COMMAND:
1498 if (ignore_system_lyxrc ||
1499 bibtex_command != system_lyxrc.bibtex_command) {
1500 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1504 case RC_JBIBTEX_COMMAND:
1505 if (ignore_system_lyxrc ||
1506 jbibtex_command != system_lyxrc.jbibtex_command) {
1507 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1511 case RC_INDEX_ALTERNATIVES: {
1512 CommandSet::const_iterator it = index_alternatives.begin();
1513 CommandSet::const_iterator end = index_alternatives.end();
1514 for ( ; it != end; ++it) {
1515 if (ignore_system_lyxrc
1516 || !system_lyxrc.index_alternatives.count(*it))
1517 os << "\\index_alternatives \""
1523 case RC_INDEX_COMMAND:
1524 if (ignore_system_lyxrc ||
1525 index_command != system_lyxrc.index_command) {
1526 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1530 case RC_JINDEX_COMMAND:
1531 if (ignore_system_lyxrc ||
1532 jindex_command != system_lyxrc.jindex_command) {
1533 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1537 case RC_SPLITINDEX_COMMAND:
1538 if (ignore_system_lyxrc ||
1539 splitindex_command != system_lyxrc.splitindex_command) {
1540 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1544 case RC_NOMENCL_COMMAND:
1545 if (ignore_system_lyxrc ||
1546 nomencl_command != system_lyxrc.nomencl_command) {
1547 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1551 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1552 // Don't write this setting to the preferences file,
1553 // but allow temporary changes (bug 7557).
1554 if (ignore_system_lyxrc) {
1555 os << "\\tex_expects_windows_paths "
1556 << convert<string>(windows_style_tex_paths) << '\n';
1560 case RC_TEX_ALLOWS_SPACES:
1561 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1562 os << "\\tex_allows_spaces "
1563 << convert<string>(tex_allows_spaces) << '\n';
1568 if (ignore_system_lyxrc ||
1569 use_kbmap != system_lyxrc.use_kbmap) {
1570 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1574 case RC_KBMAP_PRIMARY:
1575 if (ignore_system_lyxrc ||
1576 primary_kbmap != system_lyxrc.primary_kbmap) {
1577 string const path = os::external_path(primary_kbmap);
1578 os << "\\kbmap_primary \"" << path << "\"\n";
1582 case RC_KBMAP_SECONDARY:
1583 if (ignore_system_lyxrc ||
1584 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1585 string const path = os::external_path(secondary_kbmap);
1586 os << "\\kbmap_secondary \"" << path << "\"\n";
1591 if (ignore_system_lyxrc ||
1592 lyxpipes != system_lyxrc.lyxpipes) {
1593 string const path = os::external_path(lyxpipes);
1594 os << "\\serverpipe \"" << path << "\"\n";
1598 case RC_DATE_INSERT_FORMAT:
1599 if (ignore_system_lyxrc ||
1600 date_insert_format != system_lyxrc.date_insert_format) {
1601 os << "\\date_insert_format \"" << date_insert_format
1608 os << "\\user_name \"" << user_name << "\"\n";
1613 os << "\\user_email \"" << user_email << "\"\n";
1617 case RC_SHOW_BANNER:
1618 if (ignore_system_lyxrc ||
1619 show_banner != system_lyxrc.show_banner) {
1620 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1626 if (ignore_system_lyxrc ||
1627 preview != system_lyxrc.preview) {
1633 case PREVIEW_NO_MATH:
1640 os << "\\preview " << status << '\n';
1645 case RC_PREVIEW_HASHED_LABELS:
1646 if (ignore_system_lyxrc ||
1647 preview_hashed_labels !=
1648 system_lyxrc.preview_hashed_labels) {
1649 os << "\\preview_hashed_labels "
1650 << convert<string>(preview_hashed_labels) << '\n';
1655 case RC_PREVIEW_SCALE_FACTOR:
1656 if (ignore_system_lyxrc ||
1657 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1658 os << "\\preview_scale_factor "
1659 << preview_scale_factor << '\n';
1664 case RC_USE_CONVERTER_CACHE:
1665 if (ignore_system_lyxrc ||
1666 use_converter_cache != system_lyxrc.use_converter_cache) {
1667 os << "\\use_converter_cache "
1668 << convert<string>(use_converter_cache) << '\n';
1673 case RC_CONVERTER_CACHE_MAXAGE:
1674 if (ignore_system_lyxrc ||
1675 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1676 os << "\\converter_cache_maxage "
1677 << converter_cache_maxage << '\n';
1683 << "# SCREEN & FONTS SECTION ############################\n"
1687 if (ignore_system_lyxrc ||
1688 icon_set != system_lyxrc.icon_set) {
1689 os << "\\icon_set \"" << icon_set
1696 if (ignore_system_lyxrc ||
1697 dpi != system_lyxrc.dpi) {
1698 os << "\\screen_dpi " << dpi << '\n';
1702 case RC_SCREEN_ZOOM:
1703 if (ignore_system_lyxrc ||
1704 zoom != system_lyxrc.zoom) {
1705 os << "\\screen_zoom " << zoom << '\n';
1709 case RC_GEOMETRY_SESSION:
1710 if (ignore_system_lyxrc ||
1711 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1712 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1717 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1718 if (ignore_system_lyxrc ||
1719 cursor_follows_scrollbar
1720 != system_lyxrc.cursor_follows_scrollbar) {
1721 os << "\\cursor_follows_scrollbar "
1722 << convert<string>(cursor_follows_scrollbar) << '\n';
1726 case RC_CURSOR_WIDTH:
1727 if (ignore_system_lyxrc ||
1729 != system_lyxrc.cursor_width) {
1730 os << "\\cursor_width "
1731 << cursor_width << '\n';
1735 case RC_SCROLL_BELOW_DOCUMENT:
1736 if (ignore_system_lyxrc ||
1737 scroll_below_document
1738 != system_lyxrc.scroll_below_document) {
1739 os << "\\scroll_below_document "
1740 << convert<string>(scroll_below_document) << '\n';
1744 case RC_PARAGRAPH_MARKERS:
1745 if (ignore_system_lyxrc ||
1747 != system_lyxrc.paragraph_markers) {
1748 os << "\\paragraph_markers "
1749 << convert<string>(paragraph_markers) << '\n';
1753 case RC_MAC_DONTSWAP_CTRL_META:
1754 if (ignore_system_lyxrc ||
1755 mac_dontswap_ctrl_meta
1756 != system_lyxrc.mac_dontswap_ctrl_meta) {
1757 os << "\\mac_dontswap_ctrl_meta "
1758 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1762 case RC_MAC_LIKE_WORD_MOVEMENT:
1763 if (ignore_system_lyxrc ||
1764 mac_like_word_movement
1765 != system_lyxrc.mac_like_word_movement) {
1766 os << "\\mac_like_word_movement "
1767 << convert<string>(mac_like_word_movement) << '\n';
1771 case RC_MACRO_EDIT_STYLE:
1772 if (ignore_system_lyxrc ||
1774 != system_lyxrc.macro_edit_style) {
1775 os << "\\macro_edit_style ";
1776 switch (macro_edit_style) {
1777 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1778 case MACRO_EDIT_INLINE: os << "1\n"; break;
1779 case MACRO_EDIT_LIST: os << "2\n"; break;
1784 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1785 if (ignore_system_lyxrc ||
1786 dialogs_iconify_with_main
1787 != system_lyxrc.dialogs_iconify_with_main) {
1788 os << "\\dialogs_iconify_with_main "
1789 << convert<string>(dialogs_iconify_with_main) << '\n';
1793 case RC_SCREEN_FONT_ROMAN:
1794 if (ignore_system_lyxrc ||
1795 roman_font_name != system_lyxrc.roman_font_name) {
1796 os << "\\screen_font_roman \"" << roman_font_name
1801 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1802 if (ignore_system_lyxrc ||
1803 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1804 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1809 case RC_SCREEN_FONT_SANS:
1810 if (ignore_system_lyxrc ||
1811 sans_font_name != system_lyxrc.sans_font_name) {
1812 os << "\\screen_font_sans \"" << sans_font_name
1817 case RC_SCREEN_FONT_SANS_FOUNDRY:
1818 if (ignore_system_lyxrc ||
1819 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1820 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1825 case RC_SCREEN_FONT_TYPEWRITER:
1826 if (ignore_system_lyxrc ||
1827 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1828 os << "\\screen_font_typewriter \""
1829 << typewriter_font_name << "\"\n";
1833 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1834 if (ignore_system_lyxrc ||
1835 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1836 os << "\\screen_font_typewriter_foundry \""
1837 << typewriter_font_foundry << "\"\n";
1842 case RC_SCREEN_FONT_SCALABLE:
1843 if (ignore_system_lyxrc ||
1844 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1845 os << "\\screen_font_scalable "
1846 << convert<string>(use_scalable_fonts)
1851 case RC_SCREEN_FONT_SIZES:
1852 if (ignore_system_lyxrc ||
1853 font_sizes[FONT_SIZE_TINY]
1854 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1855 font_sizes[FONT_SIZE_SCRIPT]
1856 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1857 font_sizes[FONT_SIZE_FOOTNOTE]
1858 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1859 font_sizes[FONT_SIZE_SMALL]
1860 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1861 font_sizes[FONT_SIZE_NORMAL]
1862 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1863 font_sizes[FONT_SIZE_LARGE]
1864 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1865 font_sizes[FONT_SIZE_LARGER]
1866 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1867 font_sizes[FONT_SIZE_LARGEST]
1868 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1869 font_sizes[FONT_SIZE_HUGE]
1870 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1871 font_sizes[FONT_SIZE_HUGER]
1872 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1873 os.setf(ios::fixed);
1875 os << "\\screen_font_sizes"
1876 << ' ' << font_sizes[FONT_SIZE_TINY]
1877 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1878 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1879 << ' ' << font_sizes[FONT_SIZE_SMALL]
1880 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1881 << ' ' << font_sizes[FONT_SIZE_LARGE]
1882 << ' ' << font_sizes[FONT_SIZE_LARGER]
1883 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1884 << ' ' << font_sizes[FONT_SIZE_HUGE]
1885 << ' ' << font_sizes[FONT_SIZE_HUGER]
1890 case RC_FULL_SCREEN_LIMIT:
1891 if (ignore_system_lyxrc ||
1892 full_screen_limit != system_lyxrc.full_screen_limit) {
1893 os << "\\fullscreen_limit "
1894 << convert<string>(full_screen_limit)
1899 case RC_FULL_SCREEN_TOOLBARS:
1900 if (ignore_system_lyxrc ||
1901 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1902 os << "\\fullscreen_toolbars "
1903 << convert<string>(full_screen_toolbars)
1908 case RC_FULL_SCREEN_SCROLLBAR:
1909 if (ignore_system_lyxrc ||
1910 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1911 os << "\\fullscreen_scrollbar "
1912 << convert<string>(full_screen_scrollbar)
1917 case RC_FULL_SCREEN_TABBAR:
1918 if (ignore_system_lyxrc ||
1919 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1920 os << "\\fullscreen_tabbar "
1921 << convert<string>(full_screen_tabbar)
1926 case RC_FULL_SCREEN_MENUBAR:
1927 if (ignore_system_lyxrc ||
1928 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1929 os << "\\fullscreen_menubar "
1930 << convert<string>(full_screen_menubar)
1935 case RC_FULL_SCREEN_WIDTH:
1936 if (ignore_system_lyxrc ||
1937 full_screen_width != system_lyxrc.full_screen_width) {
1938 os << "\\fullscreen_width "
1939 << convert<string>(full_screen_width)
1944 case RC_OPEN_BUFFERS_IN_TABS:
1945 if (ignore_system_lyxrc ||
1946 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1947 os << "\\open_buffers_in_tabs "
1948 << convert<string>(open_buffers_in_tabs)
1953 case RC_SINGLE_CLOSE_TAB_BUTTON:
1954 if (ignore_system_lyxrc ||
1955 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1956 os << "\\single_close_tab_button "
1957 << convert<string>(single_close_tab_button)
1962 case RC_SINGLE_INSTANCE:
1963 if (ignore_system_lyxrc ||
1964 single_instance != system_lyxrc.single_instance) {
1965 os << "\\single_instance "
1966 << convert<string>(single_instance)
1971 case RC_FORWARD_SEARCH_DVI:
1972 if (ignore_system_lyxrc ||
1973 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1974 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1978 case RC_FORWARD_SEARCH_PDF:
1979 if (ignore_system_lyxrc ||
1980 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1981 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1987 << "# COLOR SECTION ###################################\n"
1991 for (int i = 0; i < Color_ignore; ++i) {
1992 ColorCode lc = static_cast<ColorCode>(i);
1993 string const col = lcolor.getX11Name(lc);
1994 if (ignore_system_lyxrc
1995 || col != system_lcolor.getX11Name(lc)) {
1996 os << "\\set_color \""
1997 << lcolor.getLyXName(lc) << "\" \""
2005 << "# PRINTER SECTION ###################################\n"
2009 if (ignore_system_lyxrc ||
2010 printer != system_lyxrc.printer) {
2011 os << "\\printer \"" << printer << "\"\n";
2015 case RC_PRINT_ADAPTOUTPUT:
2016 if (ignore_system_lyxrc ||
2017 print_adapt_output != system_lyxrc.print_adapt_output) {
2018 os << "\\print_adapt_output "
2019 << convert<string>(print_adapt_output)
2024 case RC_PRINT_COMMAND:
2025 if (ignore_system_lyxrc ||
2026 print_command != system_lyxrc.print_command) {
2027 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2031 case RC_PRINTEXSTRAOPTIONS:
2032 if (ignore_system_lyxrc ||
2033 print_extra_options != system_lyxrc.print_extra_options) {
2034 os << "\\print_extra_options \"" << print_extra_options
2039 case RC_PRINTSPOOL_COMMAND:
2040 if (ignore_system_lyxrc ||
2041 print_spool_command != system_lyxrc.print_spool_command) {
2042 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2047 case RC_PRINTSPOOL_PRINTERPREFIX:
2048 if (ignore_system_lyxrc ||
2049 print_spool_printerprefix
2050 != system_lyxrc.print_spool_printerprefix) {
2051 os << "\\print_spool_printerprefix \""
2052 << print_spool_printerprefix << "\"\n";
2056 case RC_PRINTEVENPAGEFLAG:
2057 if (ignore_system_lyxrc ||
2058 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2059 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2064 case RC_PRINTODDPAGEFLAG:
2065 if (ignore_system_lyxrc ||
2066 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2067 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2072 case RC_PRINTREVERSEFLAG:
2073 if (ignore_system_lyxrc ||
2074 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2075 os << "\\print_reverse_flag \"" << print_reverse_flag
2080 case RC_PRINTLANDSCAPEFLAG:
2081 if (ignore_system_lyxrc ||
2082 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2083 os << "\\print_landscape_flag \"" << print_landscape_flag
2088 case RC_PRINTPAGERANGEFLAG:
2089 if (ignore_system_lyxrc ||
2090 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2091 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2096 case RC_PRINTCOPIESFLAG:
2097 if (ignore_system_lyxrc ||
2098 print_copies_flag != system_lyxrc.print_copies_flag) {
2099 os << "\\print_copies_flag \"" << print_copies_flag
2104 case RC_PRINTCOLLCOPIESFLAG:
2105 if (ignore_system_lyxrc ||
2106 print_collcopies_flag
2107 != system_lyxrc.print_collcopies_flag) {
2108 os << "\\print_collcopies_flag \""
2109 << print_collcopies_flag
2114 case RC_PRINTPAPERFLAG:
2115 if (ignore_system_lyxrc ||
2116 print_paper_flag != system_lyxrc.print_paper_flag) {
2117 os << "\\print_paper_flag \"" << print_paper_flag
2122 case RC_PRINTPAPERDIMENSIONFLAG:
2123 if (ignore_system_lyxrc ||
2124 print_paper_dimension_flag
2125 != system_lyxrc.print_paper_dimension_flag) {
2126 os << "\\print_paper_dimension_flag \""
2127 << print_paper_dimension_flag << "\"\n";
2131 case RC_PRINTTOPRINTER:
2132 if (ignore_system_lyxrc ||
2133 print_to_printer != system_lyxrc.print_to_printer) {
2134 os << "\\print_to_printer \"" << print_to_printer
2139 case RC_PRINTTOFILE:
2140 if (ignore_system_lyxrc ||
2141 print_to_file != system_lyxrc.print_to_file) {
2142 string const path = os::external_path(print_to_file);
2143 os << "\\print_to_file \"" << path << "\"\n";
2147 case RC_PRINTFILEEXTENSION:
2148 if (ignore_system_lyxrc ||
2149 print_file_extension != system_lyxrc.print_file_extension) {
2150 os << "\\print_file_extension \""
2151 << print_file_extension
2158 << "# TEX SECTION #######################################\n"
2161 case RC_TEXINPUTS_PREFIX:
2162 if (ignore_system_lyxrc ||
2163 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2164 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2169 case RC_FONT_ENCODING:
2170 if (ignore_system_lyxrc ||
2171 fontenc != system_lyxrc.fontenc) {
2172 os << "\\font_encoding \"" << fontenc << "\"\n";
2177 case RC_FORCE_PAINT_SINGLE_CHAR:
2178 if (ignore_system_lyxrc ||
2179 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2180 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2186 << "# FILE SECTION ######################################\n"
2189 case RC_DOCUMENTPATH:
2190 if (ignore_system_lyxrc ||
2191 document_path != system_lyxrc.document_path) {
2192 string const path = os::external_path(document_path);
2193 os << "\\document_path \"" << path << "\"\n";
2197 case RC_USELASTFILEPOS:
2198 if (ignore_system_lyxrc ||
2199 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2200 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2205 case RC_LOADSESSION:
2206 if (ignore_system_lyxrc ||
2207 load_session != system_lyxrc.load_session) {
2208 os << "\\load_session " << convert<string>(load_session)
2213 case RC_MOUSE_WHEEL_SPEED:
2214 if (ignore_system_lyxrc ||
2215 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2216 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2220 case RC_COMPLETION_INLINE_DELAY:
2221 if (ignore_system_lyxrc ||
2222 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2223 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2227 case RC_COMPLETION_INLINE_MATH:
2228 if (ignore_system_lyxrc ||
2229 completion_inline_math != system_lyxrc.completion_inline_math) {
2230 os << "\\completion_inline_math "
2231 << convert<string>(completion_inline_math) << '\n';
2235 case RC_COMPLETION_INLINE_TEXT:
2236 if (ignore_system_lyxrc ||
2237 completion_inline_text != system_lyxrc.completion_inline_text) {
2238 os << "\\completion_inline_text "
2239 << convert<string>(completion_inline_text) << '\n';
2243 case RC_COMPLETION_INLINE_DOTS:
2244 if (ignore_system_lyxrc ||
2245 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2246 os << "\\completion_inline_dots "
2247 << convert<string>(completion_inline_dots) << '\n';
2251 case RC_AUTOCORRECTION_MATH:
2252 if (ignore_system_lyxrc ||
2253 autocorrection_math != system_lyxrc.autocorrection_math) {
2254 os << "\\autocorrection_math "
2255 << convert<string>(autocorrection_math) << '\n';
2259 case RC_COMPLETION_POPUP_DELAY:
2260 if (ignore_system_lyxrc ||
2261 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2262 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2266 case RC_COMPLETION_POPUP_MATH:
2267 if (ignore_system_lyxrc ||
2268 completion_popup_math != system_lyxrc.completion_popup_math) {
2269 os << "\\completion_popup_math "
2270 << convert<string>(completion_popup_math) << '\n';
2274 case RC_COMPLETION_POPUP_TEXT:
2275 if (ignore_system_lyxrc ||
2276 completion_popup_text != system_lyxrc.completion_popup_text) {
2277 os << "\\completion_popup_text "
2278 << convert<string>(completion_popup_text) << '\n';
2282 case RC_COMPLETION_CURSOR_TEXT:
2283 if (ignore_system_lyxrc ||
2284 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2285 os << "\\completion_cursor_text "
2286 << convert<string>(completion_cursor_text) << '\n';
2290 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2291 if (ignore_system_lyxrc ||
2292 completion_popup_after_complete
2293 != system_lyxrc.completion_popup_after_complete) {
2294 os << "\\completion_popup_after_complete "
2295 << convert<string>(completion_popup_after_complete) << '\n';
2299 case RC_NUMLASTFILES:
2300 if (ignore_system_lyxrc ||
2301 num_lastfiles != system_lyxrc.num_lastfiles) {
2302 os << "\\num_lastfiles " << num_lastfiles << '\n';
2306 case RC_CHECKLASTFILES:
2307 if (ignore_system_lyxrc ||
2308 check_lastfiles != system_lyxrc.check_lastfiles) {
2309 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2314 case RC_EXAMPLEPATH:
2315 if (ignore_system_lyxrc ||
2316 example_path != system_lyxrc.example_path) {
2317 string const path = os::external_path(example_path);
2318 os << "\\example_path \"" << path << "\"\n";
2322 case RC_TEMPLATEPATH:
2323 if (ignore_system_lyxrc ||
2324 template_path != system_lyxrc.template_path) {
2325 string const path = os::external_path(template_path);
2326 os << "\\template_path \"" << path << "\"\n";
2330 case RC_TEMPDIRPATH:
2331 if (ignore_system_lyxrc ||
2332 tempdir_path != system_lyxrc.tempdir_path) {
2333 string const path = os::external_path(tempdir_path);
2334 os << "\\tempdir_path \"" << path << "\"\n";
2338 case RC_THESAURUSDIRPATH:
2339 if (ignore_system_lyxrc ||
2340 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2341 string const path = os::external_path(thesaurusdir_path);
2342 os << "\\thesaurusdir_path \"" << path << "\"\n";
2346 case RC_HUNSPELLDIR_PATH:
2347 if (ignore_system_lyxrc ||
2348 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2349 string const path = os::external_path(hunspelldir_path);
2350 os << "\\hunspelldir_path \"" << path << "\"\n";
2354 case RC_PLAINTEXT_LINELEN:
2355 if (ignore_system_lyxrc ||
2356 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2357 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2361 case RC_MAKE_BACKUP:
2362 if (ignore_system_lyxrc ||
2363 make_backup != system_lyxrc.make_backup) {
2364 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2368 case RC_SAVE_COMPRESSED:
2369 if (ignore_system_lyxrc ||
2370 save_compressed != system_lyxrc.save_compressed) {
2371 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2375 case RC_BACKUPDIR_PATH:
2376 if (ignore_system_lyxrc ||
2377 backupdir_path != system_lyxrc.backupdir_path) {
2378 string const path = os::external_path(backupdir_path);
2379 os << "\\backupdir_path \"" << path << "\"\n";
2385 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2389 << "# SPELLCHECKER SECTION ##############################\n"
2392 case RC_ACCEPT_COMPOUND:
2393 if (ignore_system_lyxrc ||
2394 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2395 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2401 if (ignore_system_lyxrc ||
2402 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2403 os << "\\alternate_language \"" << spellchecker_alt_lang
2409 if (ignore_system_lyxrc ||
2410 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2411 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2415 case RC_USE_SYSTEM_COLORS:
2416 if (ignore_system_lyxrc ||
2417 use_system_colors != system_lyxrc.use_system_colors) {
2418 os << "\\use_system_colors "
2419 << convert<string>(use_system_colors)
2424 case RC_USE_TOOLTIP:
2425 if (ignore_system_lyxrc ||
2426 use_tooltip != system_lyxrc.use_tooltip) {
2427 os << "\\use_tooltip "
2428 << convert<string>(use_tooltip)
2433 case RC_USE_PIXMAP_CACHE:
2434 if (ignore_system_lyxrc ||
2435 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2436 os << "\\use_pixmap_cache "
2437 << convert<string>(use_pixmap_cache)
2444 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2449 case RC_DEFAULT_DECIMAL_POINT:
2450 if (ignore_system_lyxrc ||
2451 default_decimal_point != system_lyxrc.default_decimal_point) {
2452 os << "\\default_decimal_point " << default_decimal_point << '\n';
2457 case RC_DEFAULT_LENGTH_UNIT:
2458 if (ignore_system_lyxrc ||
2459 default_length_unit != system_lyxrc.default_length_unit) {
2460 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2465 case RC_SPELLCHECKER:
2466 if (ignore_system_lyxrc ||
2467 spellchecker != system_lyxrc.spellchecker) {
2468 os << "\\spellchecker " << spellchecker << '\n';
2473 case RC_SPELLCHECK_CONTINUOUSLY:
2474 if (ignore_system_lyxrc ||
2475 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2476 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2482 case RC_SPELLCHECK_NOTES:
2483 if (ignore_system_lyxrc ||
2484 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2485 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2491 case RC_RTL_SUPPORT:
2492 if (ignore_system_lyxrc ||
2493 rtl_support != system_lyxrc.rtl_support) {
2494 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2498 case RC_VISUAL_CURSOR:
2499 if (ignore_system_lyxrc ||
2500 visual_cursor != system_lyxrc.visual_cursor) {
2501 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2505 case RC_LANGUAGE_CUSTOM_PACKAGE:
2506 if (ignore_system_lyxrc ||
2507 language_custom_package != system_lyxrc.language_custom_package) {
2508 os << "\\language_custom_package \"" << language_custom_package
2513 case RC_LANGUAGE_GLOBAL_OPTIONS:
2514 if (ignore_system_lyxrc ||
2515 language_global_options
2516 != system_lyxrc.language_global_options) {
2517 os << "\\language_global_options \""
2518 << convert<string>(language_global_options)
2523 case RC_LANGUAGE_PACKAGE_SELECTION:
2524 if (ignore_system_lyxrc ||
2525 language_package_selection != system_lyxrc.language_package_selection) {
2526 os << "\\language_package_selection ";
2527 switch (language_package_selection) {
2544 case RC_LANGUAGE_COMMAND_BEGIN:
2545 if (ignore_system_lyxrc ||
2546 language_command_begin
2547 != system_lyxrc.language_command_begin) {
2548 os << "\\language_command_begin \""
2549 << language_command_begin
2554 case RC_LANGUAGE_COMMAND_END:
2555 if (ignore_system_lyxrc ||
2556 language_command_end
2557 != system_lyxrc.language_command_end) {
2558 os << "\\language_command_end \"" << language_command_end
2563 case RC_LANGUAGE_COMMAND_LOCAL:
2564 if (ignore_system_lyxrc ||
2565 language_command_local
2566 != system_lyxrc.language_command_local) {
2567 os << "\\language_command_local \""
2568 << language_command_local
2573 case RC_LANGUAGE_AUTO_BEGIN:
2574 if (ignore_system_lyxrc ||
2575 language_auto_begin != system_lyxrc.language_auto_begin) {
2576 os << "\\language_auto_begin "
2577 << convert<string>(language_auto_begin) << '\n';
2581 case RC_LANGUAGE_AUTO_END:
2582 if (ignore_system_lyxrc ||
2583 language_auto_end != system_lyxrc.language_auto_end) {
2584 os << "\\language_auto_end "
2585 << convert<string>(language_auto_end) << '\n';
2589 case RC_MARK_FOREIGN_LANGUAGE:
2590 if (ignore_system_lyxrc ||
2591 mark_foreign_language
2592 != system_lyxrc.mark_foreign_language) {
2593 os << "\\mark_foreign_language " <<
2594 convert<string>(mark_foreign_language) << '\n';
2600 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2603 case RC_AUTO_NUMBER:
2604 if (ignore_system_lyxrc ||
2605 auto_number != system_lyxrc.auto_number) {
2606 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2610 case RC_DEFAULT_LANGUAGE:
2611 if (ignore_system_lyxrc ||
2612 default_language != system_lyxrc.default_language) {
2613 os << "\\default_language " << default_language << '\n';
2617 case RC_GUI_LANGUAGE:
2618 if (ignore_system_lyxrc ||
2619 gui_language != system_lyxrc.gui_language) {
2620 os << "\\gui_language " << gui_language << '\n';
2624 case RC_EXPORT_OVERWRITE:
2625 if (ignore_system_lyxrc ||
2626 export_overwrite != system_lyxrc.export_overwrite) {
2628 switch (export_overwrite) {
2639 os << "\\export_overwrite " << status << '\n';
2644 case RC_SCROLL_WHEEL_ZOOM:
2645 if (ignore_system_lyxrc ||
2646 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2648 switch (scroll_wheel_zoom) {
2649 case SCROLL_WHEEL_ZOOM_OFF:
2652 case SCROLL_WHEEL_ZOOM_CTRL:
2655 case SCROLL_WHEEL_ZOOM_SHIFT:
2658 case SCROLL_WHEEL_ZOOM_ALT:
2662 os << "\\scroll_wheel_zoom " << status << '\n';
2668 << "# FORMATS SECTION ##########################\n"
2672 // New/modified formats
2673 for (Formats::const_iterator cit = formats.begin();
2674 cit != formats.end(); ++cit) {
2675 Format const * format =
2676 system_formats.getFormat(cit->name());
2678 format->extensions() != cit->extensions() ||
2679 format->prettyname() != cit->prettyname() ||
2680 format->shortcut() != cit->shortcut() ||
2681 format->viewer() != cit->viewer() ||
2682 format->editor() != cit->editor() ||
2683 format->documentFormat() != cit->documentFormat() ||
2684 format->vectorFormat() != cit->vectorFormat() ||
2685 format->inExportMenu() != cit->inExportMenu()) {
2686 os << "\\format \"" << cit->name() << "\" \""
2687 << cit->extensions() << "\" \""
2688 << cit->prettyname() << "\" \""
2689 << cit->shortcut() << "\" \""
2690 << escapeCommand(cit->viewer()) << "\" \""
2691 << escapeCommand(cit->editor()) << "\" \"";
2692 vector<string> flags;
2693 if (cit->documentFormat())
2694 flags.push_back("document");
2695 if (cit->vectorFormat())
2696 flags.push_back("vector");
2697 if (cit->zippedNative())
2698 flags.push_back("zipped=native");
2699 if (cit->inExportMenu())
2700 flags.push_back("menu=export");
2702 os << getStringFromVector(flags);
2707 // Look for deleted formats
2708 for (Formats::const_iterator cit = system_formats.begin();
2709 cit != system_formats.end(); ++cit)
2710 if (!formats.getFormat(cit->name()))
2711 os << "\\format \"" << cit->name()
2712 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2715 case RC_VIEWER_ALTERNATIVES: {
2716 Alternatives::const_iterator it = viewer_alternatives.begin();
2717 Alternatives::const_iterator const en = viewer_alternatives.end();
2718 Alternatives::const_iterator const sysend =
2719 system_lyxrc.viewer_alternatives.end();
2720 for (; it != en; ++it) {
2721 string const & fmt = it->first;
2722 CommandSet const & cmd = it->second;
2723 CommandSet::const_iterator sit = cmd.begin();
2724 CommandSet::const_iterator const sen = cmd.end();
2725 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2726 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2727 system_lyxrc.viewer_alternatives.find(fmt);
2728 for (; sit != sen; ++sit) {
2729 string const & cmd = *sit;
2730 if (ignore_system_lyxrc
2731 || sysfmt == sysend // format not found
2732 || sysfmt->second.count(cmd) == 0 // this command not found
2734 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2740 case RC_EDITOR_ALTERNATIVES: {
2741 Alternatives::const_iterator it = editor_alternatives.begin();
2742 Alternatives::const_iterator const en = editor_alternatives.end();
2743 Alternatives::const_iterator const sysend =
2744 system_lyxrc.editor_alternatives.end();
2745 for (; it != en; ++it) {
2746 string const & fmt = it->first;
2747 CommandSet const & cmd = it->second;
2748 CommandSet::const_iterator sit = cmd.begin();
2749 CommandSet::const_iterator const sen = cmd.end();
2750 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2751 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2752 system_lyxrc.editor_alternatives.find(fmt);
2753 for (; sit != sen; ++sit) {
2754 string const & cmd = *sit;
2755 if (ignore_system_lyxrc
2756 || sysfmt == sysend // format not found
2757 || sysfmt->second.count(cmd) == 0 // this command not found
2759 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2765 case RC_DEFAULT_VIEW_FORMAT:
2766 if (ignore_system_lyxrc ||
2767 default_view_format != system_lyxrc.default_view_format) {
2768 os << "\\default_view_format " << default_view_format << '\n';
2778 << "# CONVERTERS SECTION ##########################\n"
2782 // Look for new converters
2783 for (Converters::const_iterator cit = theConverters().begin();
2784 cit != theConverters().end(); ++cit) {
2785 Converter const * converter =
2786 theSystemConverters().getConverter(cit->from,
2789 converter->command != cit->command ||
2790 converter->flags != cit->flags)
2791 os << "\\converter \"" << cit->from << "\" \""
2792 << cit->to << "\" \""
2793 << escapeCommand(cit->command) << "\" \""
2794 << cit->flags << "\"\n";
2797 // New/modifed converters
2798 for (Converters::const_iterator cit = theSystemConverters().begin();
2799 cit != theSystemConverters().end(); ++cit)
2800 if (!theConverters().getConverter(cit->from, cit->to))
2801 os << "\\converter \"" << cit->from
2802 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2809 << "# COPIERS SECTION ##########################\n"
2812 // Look for new movers
2813 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2814 Movers::const_iterator const sysend = theSystemMovers().end();
2815 Movers::const_iterator it = theMovers().begin();
2816 Movers::const_iterator end = theMovers().end();
2818 for (; it != end; ++it) {
2819 Movers::const_iterator const sysit =
2820 find_if(sysbegin, sysend, SameMover(*it));
2821 if (sysit == sysend) {
2822 string const & fmt = it->first;
2823 string const & command =
2824 it->second.command();
2826 os << "\\copier " << fmt
2827 << " \"" << escapeCommand(command) << "\"\n";
2833 // We don't actually delete SpecialisedMover(s) from the
2834 // map, just clear their 'command', so there's no need
2835 // to test for anything else.
2842 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2844 // Why the switch you might ask. It is a trick to ensure that all
2845 // the elements in the LyXRCTags enum is handled. As you can see
2846 // there are no breaks at all. So it is just a huge fall-through.
2847 // The nice thing is that we will get a warning from the compiler
2848 // if we forget an element.
2849 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2851 case LyXRC::RC_LAST:
2852 case LyXRC::RC_ACCEPT_COMPOUND:
2853 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2854 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2855 case LyXRC::RC_ALT_LANG:
2856 case LyXRC::RC_PLAINTEXT_LINELEN:
2857 case LyXRC::RC_AUTOCORRECTION_MATH:
2858 case LyXRC::RC_AUTOREGIONDELETE:
2859 case LyXRC::RC_AUTORESET_OPTIONS:
2860 case LyXRC::RC_AUTOSAVE:
2861 case LyXRC::RC_AUTO_NUMBER:
2862 case LyXRC::RC_BACKUPDIR_PATH:
2863 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2864 case LyXRC::RC_BIBTEX_COMMAND:
2865 case LyXRC::RC_BINDFILE:
2866 case LyXRC::RC_CHECKLASTFILES:
2867 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2868 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2869 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2870 case LyXRC::RC_COMPLETION_INLINE_MATH:
2871 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2872 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2873 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2874 case LyXRC::RC_COMPLETION_POPUP_MATH:
2875 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2876 case LyXRC::RC_USELASTFILEPOS:
2877 case LyXRC::RC_LOADSESSION:
2878 case LyXRC::RC_CHKTEX_COMMAND:
2879 case LyXRC::RC_CONVERTER:
2880 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2881 case LyXRC::RC_COPIER:
2882 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2883 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2884 case LyXRC::RC_DATE_INSERT_FORMAT:
2885 case LyXRC::RC_DEFAULT_LANGUAGE:
2886 case LyXRC::RC_GUI_LANGUAGE:
2887 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2888 case LyXRC::RC_DEFFILE:
2889 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2890 case LyXRC::RC_DISPLAY_GRAPHICS:
2891 case LyXRC::RC_DOCUMENTPATH:
2892 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2893 FileName path(lyxrc_new.document_path);
2894 if (path.exists() && path.isDirectory())
2895 package().document_dir() = FileName(lyxrc.document_path);
2897 case LyXRC::RC_EDITOR_ALTERNATIVES:
2898 case LyXRC::RC_ESC_CHARS:
2899 case LyXRC::RC_EXAMPLEPATH:
2900 case LyXRC::RC_FONT_ENCODING:
2901 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2902 case LyXRC::RC_FILEFORMAT:
2903 case LyXRC::RC_GROUP_LAYOUTS:
2904 case LyXRC::RC_HUNSPELLDIR_PATH:
2905 case LyXRC::RC_ICON_SET:
2906 case LyXRC::RC_INDEX_ALTERNATIVES:
2907 case LyXRC::RC_INDEX_COMMAND:
2908 case LyXRC::RC_JBIBTEX_COMMAND:
2909 case LyXRC::RC_JINDEX_COMMAND:
2910 case LyXRC::RC_NOMENCL_COMMAND:
2911 case LyXRC::RC_INPUT:
2912 case LyXRC::RC_KBMAP:
2913 case LyXRC::RC_KBMAP_PRIMARY:
2914 case LyXRC::RC_KBMAP_SECONDARY:
2915 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2916 case LyXRC::RC_LANGUAGE_AUTO_END:
2917 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2918 case LyXRC::RC_LANGUAGE_COMMAND_END:
2919 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2920 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2921 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2922 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2923 case LyXRC::RC_LYXRCFORMAT:
2924 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2925 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2926 case LyXRC::RC_MACRO_EDIT_STYLE:
2927 case LyXRC::RC_MAKE_BACKUP:
2928 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2929 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2930 case LyXRC::RC_NUMLASTFILES:
2931 case LyXRC::RC_PARAGRAPH_MARKERS:
2932 case LyXRC::RC_PATH_PREFIX:
2933 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2934 prependEnvPath("PATH", lyxrc_new.path_prefix);
2936 case LyXRC::RC_PREVIEW:
2937 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2938 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2939 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2940 case LyXRC::RC_PRINTCOPIESFLAG:
2941 case LyXRC::RC_PRINTER:
2942 case LyXRC::RC_PRINTEVENPAGEFLAG:
2943 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2944 case LyXRC::RC_PRINTFILEEXTENSION:
2945 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2946 case LyXRC::RC_PRINTODDPAGEFLAG:
2947 case LyXRC::RC_PRINTPAGERANGEFLAG:
2948 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2949 case LyXRC::RC_PRINTPAPERFLAG:
2950 case LyXRC::RC_PRINTREVERSEFLAG:
2951 case LyXRC::RC_PRINTSPOOL_COMMAND:
2952 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2953 case LyXRC::RC_PRINTTOFILE:
2954 case LyXRC::RC_PRINTTOPRINTER:
2955 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2956 case LyXRC::RC_PRINT_COMMAND:
2957 case LyXRC::RC_RTL_SUPPORT:
2958 case LyXRC::RC_SAVE_COMPRESSED:
2959 case LyXRC::RC_SCREEN_DPI:
2960 case LyXRC::RC_SCREEN_FONT_ROMAN:
2961 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2962 case LyXRC::RC_SCREEN_FONT_SANS:
2963 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2964 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2965 case LyXRC::RC_SCREEN_FONT_SIZES:
2966 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2967 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2968 case LyXRC::RC_GEOMETRY_SESSION:
2969 case LyXRC::RC_SCREEN_ZOOM:
2970 case LyXRC::RC_SERVERPIPE:
2971 case LyXRC::RC_SET_COLOR:
2972 case LyXRC::RC_SHOW_BANNER:
2973 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2974 case LyXRC::RC_SPELLCHECKER:
2975 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2977 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2978 case LyXRC::RC_SPELLCHECK_NOTES:
2979 case LyXRC::RC_SPLITINDEX_COMMAND:
2980 case LyXRC::RC_TEMPDIRPATH:
2981 case LyXRC::RC_TEMPLATEPATH:
2982 case LyXRC::RC_TEX_ALLOWS_SPACES:
2983 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2984 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2985 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2987 case LyXRC::RC_TEXINPUTS_PREFIX:
2988 case LyXRC::RC_THESAURUSDIRPATH:
2989 case LyXRC::RC_UIFILE:
2990 case LyXRC::RC_USER_EMAIL:
2991 case LyXRC::RC_USER_NAME:
2992 case LyXRC::RC_USE_CONVERTER_CACHE:
2993 case LyXRC::RC_USE_SYSTEM_COLORS:
2994 case LyXRC::RC_USE_TOOLTIP:
2995 case LyXRC::RC_USE_PIXMAP_CACHE:
2996 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2997 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2998 case LyXRC::RC_SINGLE_INSTANCE:
2999 case LyXRC::RC_SORT_LAYOUTS:
3000 case LyXRC::RC_FULL_SCREEN_LIMIT:
3001 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3002 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3003 case LyXRC::RC_FULL_SCREEN_TABBAR:
3004 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3005 case LyXRC::RC_FULL_SCREEN_WIDTH:
3006 case LyXRC::RC_VISUAL_CURSOR:
3007 case LyXRC::RC_VIEWER:
3008 case LyXRC::RC_VIEWER_ALTERNATIVES:
3009 case LyXRC::RC_FORWARD_SEARCH_DVI:
3010 case LyXRC::RC_FORWARD_SEARCH_PDF:
3011 case LyXRC::RC_EXPORT_OVERWRITE:
3012 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3013 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3014 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3015 case LyXRC::RC_CURSOR_WIDTH:
3022 string const LyXRC::getDescription(LyXRCTags tag)
3027 case RC_ACCEPT_COMPOUND:
3028 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3032 str = _("Specify an alternate language. The default is to use the language of the document.");
3035 case RC_PLAINTEXT_LINELEN:
3036 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.");
3039 case RC_AUTOREGIONDELETE:
3040 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3043 case RC_AUTORESET_OPTIONS:
3044 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3048 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3051 case RC_AUTO_NUMBER:
3054 case RC_BACKUPDIR_PATH:
3055 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.");
3058 case RC_BIBTEX_COMMAND:
3059 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3062 case RC_JBIBTEX_COMMAND:
3063 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3067 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3070 case RC_CHECKLASTFILES:
3071 str = _("Select to check whether the lastfiles still exist.");
3074 case RC_CHKTEX_COMMAND:
3075 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3084 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3085 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.");
3088 case RC_CURSOR_WIDTH:
3089 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3092 case RC_SCROLL_BELOW_DOCUMENT:
3093 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");
3096 case RC_MAC_DONTSWAP_CTRL_META:
3097 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3100 case RC_MAC_LIKE_WORD_MOVEMENT:
3101 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3104 case RC_SHOW_MACRO_LABEL:
3105 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3108 case RC_DATE_INSERT_FORMAT:
3109 //xgettext:no-c-format
3110 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3114 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3117 case RC_DEFAULT_VIEW_FORMAT:
3118 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3121 case RC_DEFAULT_LANGUAGE:
3122 str = _("New documents will be assigned this language.");
3125 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3126 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3129 case RC_DISPLAY_GRAPHICS:
3130 str = _("Select how LyX will display any graphics.");
3133 case RC_DOCUMENTPATH:
3134 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3138 str = _("Specify additional chars that can be part of a word.");
3141 case RC_EXAMPLEPATH:
3142 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3145 case RC_FONT_ENCODING:
3146 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3149 case RC_FORCE_PAINT_SINGLE_CHAR:
3150 str = _("Disable any kerning and ligatures for text drawing on screen.");
3156 case RC_INDEX_COMMAND:
3157 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\".");
3160 case RC_JINDEX_COMMAND:
3161 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3164 case RC_NOMENCL_COMMAND:
3165 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3172 case RC_KBMAP_PRIMARY:
3173 case RC_KBMAP_SECONDARY:
3174 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.");
3177 case RC_LANGUAGE_AUTO_BEGIN:
3178 str = _("Select if a language switching command is needed at the beginning of the document.");
3181 case RC_LANGUAGE_AUTO_END:
3182 str = _("Select if a language switching command is needed at the end of the document.");
3185 case RC_LANGUAGE_COMMAND_BEGIN:
3186 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.");
3189 case RC_LANGUAGE_COMMAND_END:
3190 str = _("The LaTeX command for changing back to the language of the document.");
3193 case RC_LANGUAGE_COMMAND_LOCAL:
3194 str = _("The LaTeX command for local changing of the language.");
3197 case RC_LANGUAGE_GLOBAL_OPTIONS:
3198 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3201 case RC_LANGUAGE_CUSTOM_PACKAGE:
3202 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3205 case RC_LANGUAGE_PACKAGE_SELECTION:
3206 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3209 case RC_USELASTFILEPOS:
3210 str = _("De-select if you do not want LyX to scroll to saved position.");
3213 case RC_LOADSESSION:
3214 str = _("De-select to prevent loading files opened from the last LyX session.");
3217 case RC_MAKE_BACKUP:
3218 str = _("De-select if you don't want LyX to create backup files.");
3221 case RC_MARK_FOREIGN_LANGUAGE:
3222 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3225 case RC_MOUSE_WHEEL_SPEED:
3226 str = bformat(_("The scrolling speed of the mouse wheel."),
3230 case RC_COMPLETION_POPUP_DELAY:
3231 str = _("The completion popup delay.");
3234 case RC_COMPLETION_POPUP_MATH:
3235 str = _("Select to display the completion popup in math mode.");
3238 case RC_COMPLETION_POPUP_TEXT:
3239 str = _("Select to display the completion popup in text mode.");
3242 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3243 str = _("Show the completion popup without delay after non-unique completion attempt.");
3246 case RC_COMPLETION_POPUP_TEXT:
3247 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3250 case RC_COMPLETION_POPUP_DELAY:
3251 str = _("The inline completion delay.");
3254 case RC_COMPLETION_INLINE_MATH:
3255 str = _("Select to display the inline completion in math mode.");
3258 case RC_COMPLETION_INLINE_TEXT:
3259 str = _("Select to display the inline completion in text mode.");
3262 case RC_COMPLETION_INLINE_DOTS:
3263 str = _("Use \"...\" to shorten long completions.");
3266 case RC_AUTOCORRECTION_MATH:
3267 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3270 case RC_NUMLASTFILES:
3271 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3275 case RC_PATH_PREFIX:
3276 str = _("Specify those directories which should be "
3277 "prepended to the PATH environment variable.\n"
3278 "Use the OS native format.");
3282 str = _("Shows a typeset preview of things such as math");
3285 case RC_PREVIEW_HASHED_LABELS:
3286 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3289 case RC_PREVIEW_SCALE_FACTOR:
3290 str = _("Scale the preview size to suit.");
3293 case RC_PRINTCOLLCOPIESFLAG:
3294 str = _("The option for specifying whether the copies should be collated.");
3297 case RC_PRINTCOPIESFLAG:
3298 str = _("The option for specifying the number of copies to print.");
3302 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3305 case RC_PRINTEVENPAGEFLAG:
3306 str = _("The option to print only even pages.");
3309 case RC_PRINTEXSTRAOPTIONS:
3310 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3313 case RC_PRINTFILEEXTENSION:
3314 str = _("Extension of printer program output file. Usually \".ps\".");
3317 case RC_PRINTLANDSCAPEFLAG:
3318 str = _("The option to print out in landscape.");
3321 case RC_PRINTODDPAGEFLAG:
3322 str = _("The option to print only odd pages.");
3325 case RC_PRINTPAGERANGEFLAG:
3326 str = _("The option for specifying a comma-separated list of pages to print.");
3329 case RC_PRINTPAPERDIMENSIONFLAG:
3330 str = _("Option to specify the dimensions of the print paper.");
3333 case RC_PRINTPAPERFLAG:
3334 str = _("The option to specify paper type.");
3337 case RC_PRINTREVERSEFLAG:
3338 str = _("The option to reverse the order of the pages printed.");
3341 case RC_PRINTSPOOL_COMMAND:
3342 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.");
3345 case RC_PRINTSPOOL_PRINTERPREFIX:
3346 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.");
3349 case RC_PRINTTOFILE:
3350 str = _("Option to pass to the print program to print to a file.");
3353 case RC_PRINTTOPRINTER:
3354 str = _("Option to pass to the print program to print on a specific printer.");
3357 case RC_PRINT_ADAPTOUTPUT:
3358 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3361 case RC_PRINT_COMMAND:
3362 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3365 case RC_RTL_SUPPORT:
3366 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3369 case RC_VISUAL_CURSOR:
3370 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3374 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3377 case RC_SCREEN_FONT_ROMAN:
3378 case RC_SCREEN_FONT_SANS:
3379 case RC_SCREEN_FONT_TYPEWRITER:
3380 str = _("The screen fonts used to display the text while editing.");
3383 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3384 case RC_SCREEN_FONT_SANS_FOUNDRY:
3385 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3388 case RC_SCREEN_FONT_SCALABLE:
3389 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.");
3392 case RC_SCREEN_FONT_SIZES:
3393 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3396 case RC_SCREEN_ZOOM:
3397 //xgettext:no-c-format
3398 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3401 case RC_GEOMETRY_SESSION:
3402 str = _("Allow session manager to save and restore windows geometry.");
3406 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3412 case RC_SHOW_BANNER:
3413 str = _("De-select if you don't want the startup banner.");
3416 case RC_TEMPDIRPATH:
3417 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3420 case RC_THESAURUSDIRPATH:
3421 str = _("This is the place where the files of the thesaurus library reside.");
3424 case RC_TEMPLATEPATH:
3425 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3428 case RC_TEX_ALLOWS_SPACES:
3431 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3434 case RC_TEXINPUTS_PREFIX:
3435 str = _("Specify those directories which should be "
3436 "prepended to the TEXINPUTS environment variable.\n"
3437 "A '.' represents the current document directory. "
3438 "Use the OS native format.");
3442 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3451 case RC_USE_USE_SYSTEM_COLORS:
3452 str = _("Enable use the system colors for some things like main window background and selection.");
3455 case RC_USE_TOOLTIP:
3456 str = _("Enable the automatic appearance of tool tips in the work area.");
3459 case RC_USE_PIXMAP_CACHE:
3460 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3463 case RC_VIEWDVI_PAPEROPTION:
3464 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3479 // The global instance
3482 // The global copy of the system lyxrc entries (everything except preferences)