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 { "\\use_qimage", LyXRC::RC_USE_QIMAGE },
203 // compatibility with versions older than 1.4.0 only
204 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
205 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
206 { "\\user_email", LyXRC::RC_USER_EMAIL },
207 { "\\user_name", LyXRC::RC_USER_NAME },
208 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
209 // compatibility with versions older than 1.4.0 only
210 { "\\viewer", LyXRC::RC_VIEWER},
211 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
212 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
213 { "format", LyXRC::RC_LYXRCFORMAT }
216 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
227 void LyXRC::setDefaults()
231 def_file = "default";
233 // The current document directory
234 texinputs_prefix = ".";
235 // Get printer from the environment. If fail, use default "",
236 // assuming that everything is set up correctly.
237 printer = getEnv("PRINTER");
238 print_adapt_output = false;
239 print_command = "dvips";
240 print_evenpage_flag = "-B";
241 print_oddpage_flag = "-A";
242 print_pagerange_flag = "-pp";
243 print_copies_flag = "-c";
244 print_collcopies_flag = "-C";
245 print_reverse_flag = "-r";
246 print_landscape_flag = "-t landscape";
247 print_to_printer = "-P";
248 print_to_file = "-o ";
249 print_file_extension = ".ps";
250 print_paper_flag = "-t";
251 print_paper_dimension_flag = "-T";
252 document_path.erase();
253 view_dvi_paper_option.erase();
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;
342 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
343 user_name = to_utf8(support::user_name());
344 user_email = to_utf8(support::user_email());
345 open_buffers_in_tabs = true;
346 single_close_tab_button = false;
347 single_instance = true;
348 forward_search_dvi = string();
349 forward_search_pdf = string();
350 export_overwrite = NO_FILES;
352 // Fullscreen settings
353 full_screen_limit = false;
354 full_screen_toolbars = true;
355 full_screen_tabbar = true;
356 full_screen_menubar = true;
357 full_screen_scrollbar = true;
358 full_screen_width = 700;
360 completion_cursor_text = true;
361 completion_popup_math = true;
362 completion_popup_text = false;
363 completion_popup_delay = 2.0;
364 completion_popup_after_complete = true;
365 autocorrection_math = false;
366 completion_inline_math = true;
367 completion_inline_text = false;
368 completion_inline_dots = -1;
369 completion_inline_delay = 0.2;
370 default_decimal_point = ".";
371 default_length_unit = Length::CM;
378 void oldFontFormat(string & family, string & foundry)
380 if (family.empty() || family[0] != '-')
382 foundry = token(family, '-', 1);
383 family = token(family, '-', 2);
391 bool LyXRC::read(FileName const & filename, bool check_format)
393 Lexer lexrc(lyxrcTags);
394 lexrc.setFile(filename);
395 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
396 ReturnValues retval = read(lexrc, check_format);
397 if (!check_format || retval != FormatMismatch)
398 return retval == ReadOK;
400 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
401 FileName const tempfile = FileName::tempName("convert_lyxrc");
402 bool const success = prefs2prefs(filename, tempfile, false);
404 LYXERR0 ("Unable to convert " << filename.absFileName() <<
405 " to format " << LYXRC_FILEFORMAT);
408 // Keep this in the else branch, such that lexrc2 goes out
409 // of scope and releases the lock on tempfile before we
410 // attempt to remove it. This matters on Windows.
411 Lexer lexrc2(lyxrcTags);
412 lexrc2.setFile(tempfile);
413 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
414 retval = read(lexrc2, check_format);
416 tempfile.removeFile();
417 return retval == ReadOK;
421 // don't need to worry about conversion, because this is always
422 // from an internal source
423 bool LyXRC::read(istream & is)
425 Lexer lexrc(lyxrcTags);
427 LYXERR(Debug::LYXRC, "Reading istream...");
428 return read(lexrc, false) == ReadOK;
432 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
434 if (lyxerr.debugging(Debug::PARSER))
435 lexrc.printTable(lyxerr);
440 // default for current rowpainter capabilities
441 force_paint_single_char = true;
443 // format prior to 2.0 and introduction of format tag
444 unsigned int format = 0;
446 while (lexrc.isOK()) {
447 // By using two switches we take advantage of the compiler
448 // telling us if we have missed a LyXRCTags element in
449 // the second switch.
450 // Note that this also shows a problem with Lexer since it
451 // helps us avoid taking advantage of the strictness of the
454 int le = lexrc.lex();
456 case Lexer::LEX_UNDEF:
457 lexrc.printError("Unknown tag `$$Token'");
459 case Lexer::LEX_FEOF:
464 switch (static_cast<LyXRCTags>(le)) {
467 format = lexrc.getInteger();
469 case RC_INPUT: // Include file
472 libFileSearch(string(),
474 if (read(tmp, check_format)) {
476 "Error reading included file: " + tmp.absFileName());
482 bind_file = os::internal_path(lexrc.getString());
487 def_file = os::internal_path(lexrc.getString());
492 ui_file = os::internal_path(lexrc.getString());
495 case RC_AUTORESET_OPTIONS:
496 lexrc >> auto_reset_options;
499 case RC_DISPLAY_GRAPHICS:
501 display_graphics = lexrc.getString() == "true";
504 case RC_TEX_EXPECTS_WINDOWS_PATHS:
505 lexrc >> windows_style_tex_paths;
508 case RC_TEX_ALLOWS_SPACES:
509 lexrc >> tex_allows_spaces;
512 case RC_TEXINPUTS_PREFIX:
513 lexrc >> texinputs_prefix;
520 case RC_KBMAP_PRIMARY:
522 string const kmap(os::internal_path(lexrc.getString()));
523 if (!libFileSearch("kbd", kmap, "kmap").empty()
525 primary_kbmap = kmap;
527 lexrc.printError("LyX: Keymap `$$Token' not found");
532 case RC_KBMAP_SECONDARY:
534 string const kmap(os::internal_path(lexrc.getString()));
535 if (!libFileSearch("kbd", kmap, "kmap").empty()
537 secondary_kbmap = kmap;
539 lexrc.printError("LyX: Keymap `$$Token' not found");
544 case RC_FONT_ENCODING:
548 case RC_FORCE_PAINT_SINGLE_CHAR:
549 lexrc >> force_paint_single_char;
556 case RC_PRINT_COMMAND:
557 if (lexrc.next(true)) {
558 print_command = lexrc.getString();
562 case RC_PRINTEVENPAGEFLAG:
563 lexrc >> print_evenpage_flag;
566 case RC_PRINTODDPAGEFLAG:
567 lexrc >> print_oddpage_flag;
570 case RC_PRINTPAGERANGEFLAG:
571 lexrc >> print_pagerange_flag;
574 case RC_PRINTCOPIESFLAG:
575 lexrc >> print_copies_flag;
578 case RC_PRINTCOLLCOPIESFLAG:
579 lexrc >> print_collcopies_flag;
582 case RC_PRINTREVERSEFLAG:
583 lexrc >> print_reverse_flag;
586 case RC_PRINTLANDSCAPEFLAG:
587 lexrc >> print_landscape_flag;
590 case RC_PRINTTOPRINTER:
591 lexrc >> print_to_printer;
594 case RC_PRINT_ADAPTOUTPUT:
595 lexrc >> print_adapt_output;
600 print_to_file = os::internal_path(lexrc.getString());
604 case RC_PRINTFILEEXTENSION:
605 lexrc >> print_file_extension;
608 case RC_PRINTEXSTRAOPTIONS:
609 lexrc >> print_extra_options;
612 case RC_PRINTSPOOL_COMMAND:
613 if (lexrc.next(true)) {
614 print_spool_command = lexrc.getString();
618 case RC_PRINTSPOOL_PRINTERPREFIX:
619 lexrc >> print_spool_printerprefix;
622 case RC_PRINTPAPERDIMENSIONFLAG:
623 lexrc >> print_paper_dimension_flag;
626 case RC_PRINTPAPERFLAG:
627 lexrc >> print_paper_flag;
630 case RC_VIEWDVI_PAPEROPTION:
632 view_dvi_paper_option = lexrc.getString();
634 view_dvi_paper_option.erase();
637 case RC_CHKTEX_COMMAND:
638 if (lexrc.next(true)) {
639 chktex_command = lexrc.getString();
643 case RC_BIBTEX_ALTERNATIVES:
644 if (lexrc.next(true)) {
645 bibtex_alternatives.insert(lexrc.getString());
649 case RC_BIBTEX_COMMAND:
650 if (lexrc.next(true)) {
651 bibtex_command = lexrc.getString();
655 case RC_JBIBTEX_COMMAND:
656 if (lexrc.next(true)) {
657 jbibtex_command = lexrc.getString();
661 case RC_INDEX_ALTERNATIVES:
662 if (lexrc.next(true)) {
663 index_alternatives.insert(lexrc.getString());
667 case RC_INDEX_COMMAND:
668 if (lexrc.next(true)) {
669 index_command = lexrc.getString();
673 case RC_JINDEX_COMMAND:
674 if (lexrc.next(true)) {
675 jindex_command = lexrc.getString();
679 case RC_SPLITINDEX_COMMAND:
680 if (lexrc.next(true)) {
681 splitindex_command = lexrc.getString();
685 case RC_NOMENCL_COMMAND:
686 if (lexrc.next(true)) {
687 nomencl_command = lexrc.getString();
699 case RC_GEOMETRY_SESSION:
700 lexrc >> allow_geometry_session;
703 case RC_SCREEN_FONT_SIZES:
704 lexrc >> font_sizes[FONT_SIZE_TINY];
705 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
706 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
707 lexrc >> font_sizes[FONT_SIZE_SMALL];
708 lexrc >> font_sizes[FONT_SIZE_NORMAL];
709 lexrc >> font_sizes[FONT_SIZE_LARGE];
710 lexrc >> font_sizes[FONT_SIZE_LARGER];
711 lexrc >> font_sizes[FONT_SIZE_LARGEST];
712 lexrc >> font_sizes[FONT_SIZE_HUGE];
713 lexrc >> font_sizes[FONT_SIZE_HUGER];
716 case RC_SCREEN_FONT_SCALABLE:
717 lexrc >> use_scalable_fonts;
724 case RC_DOCUMENTPATH:
726 document_path = os::internal_path(lexrc.getString());
727 document_path = expandPath(document_path);
733 example_path = os::internal_path(lexrc.getString());
734 example_path = expandPath(example_path);
738 case RC_TEMPLATEPATH:
740 template_path = os::internal_path(lexrc.getString());
741 template_path = expandPath(template_path);
747 tempdir_path = os::internal_path(lexrc.getString());
748 tempdir_path = expandPath(tempdir_path);
752 case RC_THESAURUSDIRPATH:
754 thesaurusdir_path = os::internal_path(lexrc.getString());
755 thesaurusdir_path = expandPath(thesaurusdir_path);
759 case RC_HUNSPELLDIR_PATH:
761 hunspelldir_path = os::internal_path(lexrc.getString());
762 hunspelldir_path = expandPath(hunspelldir_path);
766 case RC_USELASTFILEPOS:
767 lexrc >> use_lastfilepos;
771 lexrc >> load_session;
774 case RC_MOUSE_WHEEL_SPEED:
775 lexrc >> mouse_wheel_speed;
778 case RC_COMPLETION_INLINE_DELAY:
779 lexrc >> completion_inline_delay;
782 case RC_COMPLETION_INLINE_MATH:
783 lexrc >> completion_inline_math;
786 case RC_COMPLETION_INLINE_TEXT:
787 lexrc >> completion_inline_text;
790 case RC_COMPLETION_INLINE_DOTS:
791 lexrc >> completion_inline_dots;
794 case RC_AUTOCORRECTION_MATH:
795 lexrc >> autocorrection_math;
798 case RC_COMPLETION_POPUP_DELAY:
799 lexrc >> completion_popup_delay;
802 case RC_COMPLETION_POPUP_MATH:
803 lexrc >> completion_popup_math;
806 case RC_COMPLETION_POPUP_TEXT:
807 lexrc >> completion_popup_text;
810 case RC_COMPLETION_CURSOR_TEXT:
811 lexrc >> completion_cursor_text;
814 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
815 lexrc >> completion_popup_after_complete;
818 case RC_NUMLASTFILES:
819 lexrc >> num_lastfiles;
822 case RC_CHECKLASTFILES:
823 lexrc >> check_lastfiles;
830 case RC_SCREEN_FONT_ROMAN:
832 roman_font_name = lexrc.getString();
833 oldFontFormat(roman_font_name,
838 case RC_SCREEN_FONT_SANS:
840 sans_font_name = lexrc.getString();
841 oldFontFormat(sans_font_name, sans_font_foundry);
845 case RC_SCREEN_FONT_TYPEWRITER:
847 typewriter_font_name = lexrc.getString();
848 oldFontFormat(typewriter_font_name,
849 typewriter_font_foundry);
853 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
854 lexrc >> roman_font_foundry;
857 case RC_SCREEN_FONT_SANS_FOUNDRY:
858 lexrc >> sans_font_foundry;
861 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
862 lexrc >> typewriter_font_foundry;
867 lexrc.printError("Missing color tag.");
870 string lyx_name = lexrc.getString();
873 lexrc.printError("Missing color name for color: `$$Token'");
876 string x11_name = lexrc.getString();
878 ColorCode const col =
879 lcolor.getFromLyXName(lyx_name);
880 if (col == Color_none ||
881 col == Color_inherit ||
885 if (!lcolor.setColor(col, x11_name))
886 LYXERR0("Bad lyxrc set_color for " << lyx_name);
890 case RC_AUTOREGIONDELETE:
891 // Auto region delete defaults to true
892 lexrc >> auto_region_delete;
897 lyxpipes = os::internal_path(lexrc.getString());
898 lyxpipes = expandPath(lyxpipes);
902 case RC_CURSOR_FOLLOWS_SCROLLBAR:
903 lexrc >> cursor_follows_scrollbar;
906 case RC_CURSOR_WIDTH:
907 lexrc >> cursor_width;
910 case RC_SCROLL_BELOW_DOCUMENT:
911 lexrc >> scroll_below_document;
914 case RC_PARAGRAPH_MARKERS:
915 lexrc >> paragraph_markers;
918 case RC_MAC_DONTSWAP_CTRL_META:
919 lexrc >> mac_dontswap_ctrl_meta;
922 case RC_MAC_LIKE_WORD_MOVEMENT:
923 lexrc >> mac_like_word_movement;
926 case RC_MACRO_EDIT_STYLE:
928 switch (lexrc.getInteger()) {
929 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
930 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
931 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
936 case RC_DIALOGS_ICONIFY_WITH_MAIN:
937 lexrc >> dialogs_iconify_with_main;
940 case RC_PLAINTEXT_LINELEN:
941 lexrc >> plaintext_linelen;
943 // Spellchecker settings:
944 case RC_ACCEPT_COMPOUND:
945 lexrc >> spellchecker_accept_compound;
947 case RC_USE_SYSTEM_COLORS:
948 lexrc >> use_system_colors;
951 lexrc >> use_tooltip;
953 case RC_USE_PIXMAP_CACHE:
954 lexrc >> use_pixmap_cache;
959 case RC_SPELLCHECKER:
960 lexrc >> spellchecker;
963 lexrc >> spellchecker_alt_lang;
966 lexrc >> spellchecker_esc_chars;
968 case RC_SPELLCHECK_CONTINUOUSLY:
969 lexrc >> spellcheck_continuously;
971 case RC_SPELLCHECK_NOTES:
972 lexrc >> spellcheck_notes;
975 lexrc >> make_backup;
977 case RC_SAVE_COMPRESSED:
978 lexrc >> save_compressed;
980 case RC_BACKUPDIR_PATH:
982 backupdir_path = os::internal_path(lexrc.getString());
983 backupdir_path = expandPath(backupdir_path);
986 case RC_DEFAULT_DECIMAL_POINT:
987 lexrc >> default_decimal_point;
989 case RC_DEFAULT_LENGTH_UNIT:
991 default_length_unit = (Length::UNIT) lexrc.getInteger();
993 case RC_DATE_INSERT_FORMAT:
994 lexrc >> date_insert_format;
996 case RC_LANGUAGE_CUSTOM_PACKAGE:
997 lexrc >> language_custom_package;
999 case RC_LANGUAGE_AUTO_BEGIN:
1000 lexrc >> language_auto_begin;
1002 case RC_LANGUAGE_AUTO_END:
1003 lexrc >> language_auto_end;
1005 case RC_LANGUAGE_GLOBAL_OPTIONS:
1006 lexrc >> language_global_options;
1008 case RC_LANGUAGE_PACKAGE_SELECTION:
1010 switch (lexrc.getInteger()) {
1012 language_package_selection = LP_AUTO;
1015 language_package_selection = LP_BABEL;
1018 language_package_selection = LP_CUSTOM;
1021 language_package_selection = LP_NONE;
1026 case RC_LANGUAGE_COMMAND_BEGIN:
1027 lexrc >> language_command_begin;
1029 case RC_LANGUAGE_COMMAND_END:
1030 lexrc >> language_command_end;
1032 case RC_LANGUAGE_COMMAND_LOCAL:
1033 lexrc >> language_command_local;
1035 case RC_RTL_SUPPORT:
1036 lexrc >> rtl_support;
1038 case RC_VISUAL_CURSOR:
1039 lexrc >> visual_cursor;
1041 case RC_AUTO_NUMBER:
1042 lexrc >> auto_number;
1044 case RC_MARK_FOREIGN_LANGUAGE:
1045 lexrc >> mark_foreign_language;
1049 string fmt, command;
1051 fmt = lexrc.getString();
1052 if (lexrc.next(true))
1053 command = lexrc.getString();
1054 setMover(fmt, command);
1058 case RC_CONVERTER: {
1059 string from, to, command, flags;
1061 from = lexrc.getString();
1063 to = lexrc.getString();
1064 if (lexrc.next(true))
1065 command = lexrc.getString();
1067 flags = lexrc.getString();
1068 if (command.empty())
1069 theConverters().erase(from, to);
1071 theConverters().add(from, to, command, flags);
1074 // compatibility with versions older than 1.4.0 only
1076 string format, command;
1077 lexrc >> format >> command;
1078 formats.setViewer(format, command);
1081 case RC_FILEFORMAT: {
1082 string format, extensions, prettyname, shortcut;
1083 lexrc >> format >> extensions >> prettyname >> shortcut;
1084 string viewer, editor;
1085 if (lexrc.next(true))
1086 viewer = lexrc.getString();
1087 if (lexrc.next(true))
1088 editor = lexrc.getString();
1090 // Hack to ensure compatibility with versions older
1092 int le = lexrc.lex();
1093 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1094 flags = lexrc.getString();
1095 if (le != Lexer::LEX_DATA) {
1096 // We have got a known token.
1097 // Therefore this is an old style
1098 // format definition without
1100 lexrc.pushToken(flags);
1104 int flgs = Format::none;
1105 while (!flags.empty()) {
1107 flags = split(flags, flag, ',');
1108 if (flag == "document")
1109 flgs |= Format::document;
1110 else if (flag == "vector")
1111 flgs |= Format::vector;
1112 else if (flag == "zipped=native")
1113 flgs |= Format::zipped_native;
1114 else if (flag == "menu=export")
1115 flgs |= Format::export_menu;
1117 LYXERR0("Ignoring unknown flag `"
1118 << flag << "' for format `"
1121 if (prettyname.empty()) {
1122 if (theConverters().formatIsUsed(format))
1123 LYXERR0("Can't delete format " << format);
1125 formats.erase(format);
1127 formats.add(format, extensions, prettyname,
1128 shortcut, viewer, editor, flgs);
1132 case RC_VIEWER_ALTERNATIVES: {
1133 string format, command;
1135 format = lexrc.getString();
1136 if (lexrc.eatLine())
1137 command = lexrc.getString();
1138 viewer_alternatives[format].insert(command);
1141 case RC_EDITOR_ALTERNATIVES: {
1142 string format, command;
1144 format = lexrc.getString();
1145 if (lexrc.eatLine())
1146 command = lexrc.getString();
1147 editor_alternatives[format].insert(command);
1151 case RC_DEFAULT_VIEW_FORMAT:
1152 lexrc >> default_view_format;
1155 case RC_DEFAULT_LANGUAGE:
1156 lexrc >> default_language;
1159 case RC_GUI_LANGUAGE:
1160 lexrc >> gui_language;
1163 case RC_SHOW_BANNER:
1164 lexrc >> show_banner;
1169 string const tmp = lexrc.getString();
1170 if (tmp == "true" || tmp == "on")
1171 preview = PREVIEW_ON;
1172 else if (tmp == "no_math")
1173 preview = PREVIEW_NO_MATH;
1175 preview = PREVIEW_OFF;
1176 if (tmp != "false" && tmp != "off")
1177 LYXERR0("Unrecognized preview status \""
1183 case RC_PREVIEW_HASHED_LABELS:
1184 lexrc >> preview_hashed_labels;
1187 case RC_PREVIEW_SCALE_FACTOR:
1188 lexrc >> preview_scale_factor;
1195 lexrc >> user_email;
1198 case RC_PATH_PREFIX:
1199 lexrc >> path_prefix;
1202 case RC_USE_CONVERTER_CACHE:
1203 lexrc >> use_converter_cache;
1205 case RC_CONVERTER_CACHE_MAXAGE:
1206 lexrc >> converter_cache_maxage;
1209 case RC_SORT_LAYOUTS:
1210 lexrc >> sort_layouts;
1212 case RC_GROUP_LAYOUTS:
1213 lexrc >> group_layouts;
1215 case RC_FULL_SCREEN_LIMIT:
1216 lexrc >> full_screen_limit;
1218 case RC_FULL_SCREEN_TOOLBARS:
1219 lexrc >> full_screen_toolbars;
1221 case RC_FULL_SCREEN_SCROLLBAR:
1222 lexrc >> full_screen_scrollbar;
1224 case RC_FULL_SCREEN_TABBAR:
1225 lexrc >> full_screen_tabbar;
1227 case RC_FULL_SCREEN_MENUBAR:
1228 lexrc >> full_screen_menubar;
1230 case RC_FULL_SCREEN_WIDTH:
1231 lexrc >> full_screen_width;
1233 case RC_OPEN_BUFFERS_IN_TABS:
1234 lexrc >> open_buffers_in_tabs;
1236 case RC_SINGLE_CLOSE_TAB_BUTTON:
1237 lexrc >> single_close_tab_button;
1239 case RC_SINGLE_INSTANCE:
1240 lexrc >> single_instance;
1241 if (run_mode == PREFERRED)
1242 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1244 case RC_FORWARD_SEARCH_DVI:
1245 if (lexrc.next(true))
1246 forward_search_dvi = lexrc.getString();
1248 case RC_FORWARD_SEARCH_PDF:
1249 if (lexrc.next(true))
1250 forward_search_pdf = lexrc.getString();
1252 case RC_EXPORT_OVERWRITE:
1254 string const tmp = lexrc.getString();
1255 if (tmp == "all" || tmp == "true")
1256 export_overwrite = ALL_FILES;
1257 else if (tmp == "main")
1258 export_overwrite = MAIN_FILE;
1260 export_overwrite = NO_FILES;
1261 if (tmp != "ask" && tmp != "false")
1262 LYXERR0("Unrecognized export_overwrite status \""
1267 case RC_SCROLL_WHEEL_ZOOM:
1269 string const tmp = lexrc.getString();
1271 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1272 else if (tmp == "shift")
1273 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1274 else if (tmp == "alt")
1275 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1277 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1278 if (tmp != "off" && tmp != "false")
1279 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1286 break; // this is just a dummy
1289 // This is triggered the first time through the loop unless
1290 // we hit a format tag.
1291 if (check_format && format != LYXRC_FILEFORMAT)
1292 return FormatMismatch;
1295 /// Update converters data-structures
1296 theConverters().update(formats);
1297 theConverters().buildGraph();
1303 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1305 ofstream ofs(filename.toFilesystemEncoding().c_str());
1307 write(ofs, ignore_system_lyxrc);
1311 void LyXRC::print() const
1313 if (lyxerr.debugging())
1314 write(lyxerr, false);
1322 typedef pair<string, SpecialisedMover> Data;
1324 SameMover(Data const & comparison)
1325 : comparison_(comparison) {}
1327 bool operator()(Data const & data) const
1329 return data.first == comparison_.first &&
1330 data.second.command() == comparison_.second.command();
1340 // Escape \ and " so that LyXLex can read the string later
1341 string escapeCommand(string const & str) {
1342 return subst(subst(str , "\\", "\\\\"),
1349 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1351 LyXRCTags tag = RC_LAST;
1353 if (!name.empty()) {
1354 for (int i = 0; i != lyxrcCount; ++i)
1355 if ("\\" + name == lyxrcTags[i].tag)
1356 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1360 os << "# LyX " << lyx_version
1361 << " generated this file. If you want to make your own\n"
1362 << "# modifications you should do them from inside LyX and save.\n\n"
1363 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1365 // Why the switch you might ask. It is a trick to ensure that all
1366 // the elements in the LyXRCTags enum are handled. As you can see
1367 // there are no breaks at all. So it is just a huge fall-through.
1368 // The nice thing is that we will get a warning from the compiler
1369 // if we forget an element.
1373 // input/include files are not done here
1374 case RC_LYXRCFORMAT:
1376 if (ignore_system_lyxrc ||
1377 bind_file != system_lyxrc.bind_file) {
1378 string const path = os::external_path(bind_file);
1379 os << "\\bind_file \"" << path << "\"\n";
1385 if (ignore_system_lyxrc ||
1386 def_file != system_lyxrc.def_file) {
1387 string const path = os::external_path(def_file);
1388 os << "\\def_file \"" << path << "\"\n";
1397 << "# MISC SECTION ######################################\n"
1399 // bind files are not done here.
1401 case RC_PATH_PREFIX:
1402 if (ignore_system_lyxrc ||
1403 path_prefix != system_lyxrc.path_prefix) {
1404 os << "\\path_prefix \"" << path_prefix << "\"\n";
1409 if (ignore_system_lyxrc ||
1410 ui_file != system_lyxrc.ui_file) {
1411 string const path = os::external_path(ui_file);
1412 os << "\\ui_file \"" << path << "\"\n";
1416 case RC_AUTOREGIONDELETE:
1417 if (ignore_system_lyxrc ||
1418 auto_region_delete != system_lyxrc.auto_region_delete) {
1419 os << "# Set to false to inhibit automatic replacement of\n"
1420 << "# the current selection.\n"
1421 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1426 case RC_AUTORESET_OPTIONS:
1427 if (ignore_system_lyxrc ||
1428 auto_reset_options != system_lyxrc.auto_reset_options) {
1429 os << "# Set to false to inhibit automatic reset of\n"
1430 << "# the class options to defaults on class change.\n"
1431 << "\\auto_reset_options "
1432 << convert<string>(auto_reset_options)
1438 if (ignore_system_lyxrc ||
1439 autosave != system_lyxrc.autosave) {
1440 os << "# The time interval between auto-saves in seconds.\n"
1441 << "\\autosave " << autosave << '\n';
1445 case RC_DISPLAY_GRAPHICS:
1446 if (ignore_system_lyxrc ||
1447 display_graphics != system_lyxrc.display_graphics) {
1448 os << "# Display graphics within LyX\n"
1450 << "\\display_graphics "
1451 << (display_graphics ? "true" : "false")
1456 case RC_SORT_LAYOUTS:
1457 if (ignore_system_lyxrc ||
1458 sort_layouts != system_lyxrc.sort_layouts) {
1459 os << "# Sort layouts alphabetically.\n"
1460 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1464 case RC_GROUP_LAYOUTS:
1465 if (ignore_system_lyxrc ||
1466 group_layouts != system_lyxrc.group_layouts) {
1467 os << "# Group layouts by their category.\n"
1468 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1472 case RC_VIEWDVI_PAPEROPTION:
1473 if (ignore_system_lyxrc ||
1474 view_dvi_paper_option
1475 != system_lyxrc.view_dvi_paper_option) {
1476 os << "# Options used to specify paper size to the\n"
1477 << "# view_dvi_command (e.g. -paper)\n"
1478 << "\\view_dvi_paper_option \""
1479 << view_dvi_paper_option << "\"\n";
1483 case RC_CHKTEX_COMMAND:
1484 if (ignore_system_lyxrc ||
1485 chktex_command != system_lyxrc.chktex_command) {
1486 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1490 case RC_BIBTEX_ALTERNATIVES: {
1491 CommandSet::const_iterator it = bibtex_alternatives.begin();
1492 CommandSet::const_iterator end = bibtex_alternatives.end();
1493 for ( ; it != end; ++it) {
1494 if (ignore_system_lyxrc
1495 || !system_lyxrc.bibtex_alternatives.count(*it))
1496 os << "\\bibtex_alternatives \""
1502 case RC_BIBTEX_COMMAND:
1503 if (ignore_system_lyxrc ||
1504 bibtex_command != system_lyxrc.bibtex_command) {
1505 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1509 case RC_JBIBTEX_COMMAND:
1510 if (ignore_system_lyxrc ||
1511 jbibtex_command != system_lyxrc.jbibtex_command) {
1512 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1516 case RC_INDEX_ALTERNATIVES: {
1517 CommandSet::const_iterator it = index_alternatives.begin();
1518 CommandSet::const_iterator end = index_alternatives.end();
1519 for ( ; it != end; ++it) {
1520 if (ignore_system_lyxrc
1521 || !system_lyxrc.index_alternatives.count(*it))
1522 os << "\\index_alternatives \""
1528 case RC_INDEX_COMMAND:
1529 if (ignore_system_lyxrc ||
1530 index_command != system_lyxrc.index_command) {
1531 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1535 case RC_JINDEX_COMMAND:
1536 if (ignore_system_lyxrc ||
1537 jindex_command != system_lyxrc.jindex_command) {
1538 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1542 case RC_SPLITINDEX_COMMAND:
1543 if (ignore_system_lyxrc ||
1544 splitindex_command != system_lyxrc.splitindex_command) {
1545 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1549 case RC_NOMENCL_COMMAND:
1550 if (ignore_system_lyxrc ||
1551 nomencl_command != system_lyxrc.nomencl_command) {
1552 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1556 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1557 // Don't write this setting to the preferences file,
1558 // but allow temporary changes (bug 7557).
1559 if (ignore_system_lyxrc) {
1560 os << "\\tex_expects_windows_paths "
1561 << convert<string>(windows_style_tex_paths) << '\n';
1565 case RC_TEX_ALLOWS_SPACES:
1566 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1567 os << "\\tex_allows_spaces "
1568 << convert<string>(tex_allows_spaces) << '\n';
1573 if (ignore_system_lyxrc ||
1574 use_kbmap != system_lyxrc.use_kbmap) {
1575 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1579 case RC_KBMAP_PRIMARY:
1580 if (ignore_system_lyxrc ||
1581 primary_kbmap != system_lyxrc.primary_kbmap) {
1582 string const path = os::external_path(primary_kbmap);
1583 os << "\\kbmap_primary \"" << path << "\"\n";
1587 case RC_KBMAP_SECONDARY:
1588 if (ignore_system_lyxrc ||
1589 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1590 string const path = os::external_path(secondary_kbmap);
1591 os << "\\kbmap_secondary \"" << path << "\"\n";
1596 if (ignore_system_lyxrc ||
1597 lyxpipes != system_lyxrc.lyxpipes) {
1598 string const path = os::external_path(lyxpipes);
1599 os << "\\serverpipe \"" << path << "\"\n";
1603 case RC_DATE_INSERT_FORMAT:
1604 if (ignore_system_lyxrc ||
1605 date_insert_format != system_lyxrc.date_insert_format) {
1606 os << "\\date_insert_format \"" << date_insert_format
1613 os << "\\user_name \"" << user_name << "\"\n";
1618 os << "\\user_email \"" << user_email << "\"\n";
1622 case RC_SHOW_BANNER:
1623 if (ignore_system_lyxrc ||
1624 show_banner != system_lyxrc.show_banner) {
1625 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1631 if (ignore_system_lyxrc ||
1632 preview != system_lyxrc.preview) {
1638 case PREVIEW_NO_MATH:
1645 os << "\\preview " << status << '\n';
1650 case RC_PREVIEW_HASHED_LABELS:
1651 if (ignore_system_lyxrc ||
1652 preview_hashed_labels !=
1653 system_lyxrc.preview_hashed_labels) {
1654 os << "\\preview_hashed_labels "
1655 << convert<string>(preview_hashed_labels) << '\n';
1660 case RC_PREVIEW_SCALE_FACTOR:
1661 if (ignore_system_lyxrc ||
1662 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1663 os << "\\preview_scale_factor "
1664 << preview_scale_factor << '\n';
1669 case RC_USE_CONVERTER_CACHE:
1670 if (ignore_system_lyxrc ||
1671 use_converter_cache != system_lyxrc.use_converter_cache) {
1672 os << "\\use_converter_cache "
1673 << convert<string>(use_converter_cache) << '\n';
1678 case RC_CONVERTER_CACHE_MAXAGE:
1679 if (ignore_system_lyxrc ||
1680 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1681 os << "\\converter_cache_maxage "
1682 << converter_cache_maxage << '\n';
1688 << "# SCREEN & FONTS SECTION ############################\n"
1692 if (ignore_system_lyxrc ||
1693 icon_set != system_lyxrc.icon_set) {
1694 os << "\\icon_set \"" << icon_set
1701 if (ignore_system_lyxrc ||
1702 dpi != system_lyxrc.dpi) {
1703 os << "\\screen_dpi " << dpi << '\n';
1707 case RC_SCREEN_ZOOM:
1708 if (ignore_system_lyxrc ||
1709 zoom != system_lyxrc.zoom) {
1710 os << "\\screen_zoom " << zoom << '\n';
1714 case RC_GEOMETRY_SESSION:
1715 if (ignore_system_lyxrc ||
1716 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1717 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1722 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1723 if (ignore_system_lyxrc ||
1724 cursor_follows_scrollbar
1725 != system_lyxrc.cursor_follows_scrollbar) {
1726 os << "\\cursor_follows_scrollbar "
1727 << convert<string>(cursor_follows_scrollbar) << '\n';
1731 case RC_CURSOR_WIDTH:
1732 if (ignore_system_lyxrc ||
1734 != system_lyxrc.cursor_width) {
1735 os << "\\cursor_width "
1736 << cursor_width << '\n';
1740 case RC_SCROLL_BELOW_DOCUMENT:
1741 if (ignore_system_lyxrc ||
1742 scroll_below_document
1743 != system_lyxrc.scroll_below_document) {
1744 os << "\\scroll_below_document "
1745 << convert<string>(scroll_below_document) << '\n';
1749 case RC_PARAGRAPH_MARKERS:
1750 if (ignore_system_lyxrc ||
1752 != system_lyxrc.paragraph_markers) {
1753 os << "\\paragraph_markers "
1754 << convert<string>(paragraph_markers) << '\n';
1758 case RC_MAC_DONTSWAP_CTRL_META:
1759 if (ignore_system_lyxrc ||
1760 mac_dontswap_ctrl_meta
1761 != system_lyxrc.mac_dontswap_ctrl_meta) {
1762 os << "\\mac_dontswap_ctrl_meta "
1763 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1767 case RC_MAC_LIKE_WORD_MOVEMENT:
1768 if (ignore_system_lyxrc ||
1769 mac_like_word_movement
1770 != system_lyxrc.mac_like_word_movement) {
1771 os << "\\mac_like_word_movement "
1772 << convert<string>(mac_like_word_movement) << '\n';
1776 case RC_MACRO_EDIT_STYLE:
1777 if (ignore_system_lyxrc ||
1779 != system_lyxrc.macro_edit_style) {
1780 os << "\\macro_edit_style ";
1781 switch (macro_edit_style) {
1782 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1783 case MACRO_EDIT_INLINE: os << "1\n"; break;
1784 case MACRO_EDIT_LIST: os << "2\n"; break;
1789 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1790 if (ignore_system_lyxrc ||
1791 dialogs_iconify_with_main
1792 != system_lyxrc.dialogs_iconify_with_main) {
1793 os << "\\dialogs_iconify_with_main "
1794 << convert<string>(dialogs_iconify_with_main) << '\n';
1798 case RC_SCREEN_FONT_ROMAN:
1799 if (ignore_system_lyxrc ||
1800 roman_font_name != system_lyxrc.roman_font_name) {
1801 os << "\\screen_font_roman \"" << roman_font_name
1806 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1807 if (ignore_system_lyxrc ||
1808 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1809 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1814 case RC_SCREEN_FONT_SANS:
1815 if (ignore_system_lyxrc ||
1816 sans_font_name != system_lyxrc.sans_font_name) {
1817 os << "\\screen_font_sans \"" << sans_font_name
1822 case RC_SCREEN_FONT_SANS_FOUNDRY:
1823 if (ignore_system_lyxrc ||
1824 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1825 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1830 case RC_SCREEN_FONT_TYPEWRITER:
1831 if (ignore_system_lyxrc ||
1832 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1833 os << "\\screen_font_typewriter \""
1834 << typewriter_font_name << "\"\n";
1838 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1839 if (ignore_system_lyxrc ||
1840 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1841 os << "\\screen_font_typewriter_foundry \""
1842 << typewriter_font_foundry << "\"\n";
1847 case RC_SCREEN_FONT_SCALABLE:
1848 if (ignore_system_lyxrc ||
1849 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1850 os << "\\screen_font_scalable "
1851 << convert<string>(use_scalable_fonts)
1856 case RC_SCREEN_FONT_SIZES:
1857 if (ignore_system_lyxrc ||
1858 font_sizes[FONT_SIZE_TINY]
1859 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1860 font_sizes[FONT_SIZE_SCRIPT]
1861 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1862 font_sizes[FONT_SIZE_FOOTNOTE]
1863 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1864 font_sizes[FONT_SIZE_SMALL]
1865 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1866 font_sizes[FONT_SIZE_NORMAL]
1867 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1868 font_sizes[FONT_SIZE_LARGE]
1869 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1870 font_sizes[FONT_SIZE_LARGER]
1871 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1872 font_sizes[FONT_SIZE_LARGEST]
1873 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1874 font_sizes[FONT_SIZE_HUGE]
1875 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1876 font_sizes[FONT_SIZE_HUGER]
1877 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1878 os.setf(ios::fixed);
1880 os << "\\screen_font_sizes"
1881 << ' ' << font_sizes[FONT_SIZE_TINY]
1882 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1883 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1884 << ' ' << font_sizes[FONT_SIZE_SMALL]
1885 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1886 << ' ' << font_sizes[FONT_SIZE_LARGE]
1887 << ' ' << font_sizes[FONT_SIZE_LARGER]
1888 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1889 << ' ' << font_sizes[FONT_SIZE_HUGE]
1890 << ' ' << font_sizes[FONT_SIZE_HUGER]
1895 case RC_FULL_SCREEN_LIMIT:
1896 if (ignore_system_lyxrc ||
1897 full_screen_limit != system_lyxrc.full_screen_limit) {
1898 os << "\\fullscreen_limit "
1899 << convert<string>(full_screen_limit)
1904 case RC_FULL_SCREEN_TOOLBARS:
1905 if (ignore_system_lyxrc ||
1906 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1907 os << "\\fullscreen_toolbars "
1908 << convert<string>(full_screen_toolbars)
1913 case RC_FULL_SCREEN_SCROLLBAR:
1914 if (ignore_system_lyxrc ||
1915 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1916 os << "\\fullscreen_scrollbar "
1917 << convert<string>(full_screen_scrollbar)
1922 case RC_FULL_SCREEN_TABBAR:
1923 if (ignore_system_lyxrc ||
1924 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1925 os << "\\fullscreen_tabbar "
1926 << convert<string>(full_screen_tabbar)
1931 case RC_FULL_SCREEN_MENUBAR:
1932 if (ignore_system_lyxrc ||
1933 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1934 os << "\\fullscreen_menubar "
1935 << convert<string>(full_screen_menubar)
1940 case RC_FULL_SCREEN_WIDTH:
1941 if (ignore_system_lyxrc ||
1942 full_screen_width != system_lyxrc.full_screen_width) {
1943 os << "\\fullscreen_width "
1944 << convert<string>(full_screen_width)
1949 case RC_OPEN_BUFFERS_IN_TABS:
1950 if (ignore_system_lyxrc ||
1951 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1952 os << "\\open_buffers_in_tabs "
1953 << convert<string>(open_buffers_in_tabs)
1958 case RC_SINGLE_CLOSE_TAB_BUTTON:
1959 if (ignore_system_lyxrc ||
1960 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1961 os << "\\single_close_tab_button "
1962 << convert<string>(single_close_tab_button)
1967 case RC_SINGLE_INSTANCE:
1968 if (ignore_system_lyxrc ||
1969 single_instance != system_lyxrc.single_instance) {
1970 os << "\\single_instance "
1971 << convert<string>(single_instance)
1976 case RC_FORWARD_SEARCH_DVI:
1977 if (ignore_system_lyxrc ||
1978 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1979 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1983 case RC_FORWARD_SEARCH_PDF:
1984 if (ignore_system_lyxrc ||
1985 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1986 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1992 << "# COLOR SECTION ###################################\n"
1996 for (int i = 0; i < Color_ignore; ++i) {
1997 ColorCode lc = static_cast<ColorCode>(i);
1998 string const col = lcolor.getX11Name(lc);
1999 if (ignore_system_lyxrc
2000 || col != system_lcolor.getX11Name(lc)) {
2001 os << "\\set_color \""
2002 << lcolor.getLyXName(lc) << "\" \""
2010 << "# PRINTER SECTION ###################################\n"
2014 if (ignore_system_lyxrc ||
2015 printer != system_lyxrc.printer) {
2016 os << "\\printer \"" << printer << "\"\n";
2020 case RC_PRINT_ADAPTOUTPUT:
2021 if (ignore_system_lyxrc ||
2022 print_adapt_output != system_lyxrc.print_adapt_output) {
2023 os << "\\print_adapt_output "
2024 << convert<string>(print_adapt_output)
2029 case RC_PRINT_COMMAND:
2030 if (ignore_system_lyxrc ||
2031 print_command != system_lyxrc.print_command) {
2032 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2036 case RC_PRINTEXSTRAOPTIONS:
2037 if (ignore_system_lyxrc ||
2038 print_extra_options != system_lyxrc.print_extra_options) {
2039 os << "\\print_extra_options \"" << print_extra_options
2044 case RC_PRINTSPOOL_COMMAND:
2045 if (ignore_system_lyxrc ||
2046 print_spool_command != system_lyxrc.print_spool_command) {
2047 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2052 case RC_PRINTSPOOL_PRINTERPREFIX:
2053 if (ignore_system_lyxrc ||
2054 print_spool_printerprefix
2055 != system_lyxrc.print_spool_printerprefix) {
2056 os << "\\print_spool_printerprefix \""
2057 << print_spool_printerprefix << "\"\n";
2061 case RC_PRINTEVENPAGEFLAG:
2062 if (ignore_system_lyxrc ||
2063 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2064 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2069 case RC_PRINTODDPAGEFLAG:
2070 if (ignore_system_lyxrc ||
2071 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2072 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2077 case RC_PRINTREVERSEFLAG:
2078 if (ignore_system_lyxrc ||
2079 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2080 os << "\\print_reverse_flag \"" << print_reverse_flag
2085 case RC_PRINTLANDSCAPEFLAG:
2086 if (ignore_system_lyxrc ||
2087 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2088 os << "\\print_landscape_flag \"" << print_landscape_flag
2093 case RC_PRINTPAGERANGEFLAG:
2094 if (ignore_system_lyxrc ||
2095 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2096 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2101 case RC_PRINTCOPIESFLAG:
2102 if (ignore_system_lyxrc ||
2103 print_copies_flag != system_lyxrc.print_copies_flag) {
2104 os << "\\print_copies_flag \"" << print_copies_flag
2109 case RC_PRINTCOLLCOPIESFLAG:
2110 if (ignore_system_lyxrc ||
2111 print_collcopies_flag
2112 != system_lyxrc.print_collcopies_flag) {
2113 os << "\\print_collcopies_flag \""
2114 << print_collcopies_flag
2119 case RC_PRINTPAPERFLAG:
2120 if (ignore_system_lyxrc ||
2121 print_paper_flag != system_lyxrc.print_paper_flag) {
2122 os << "\\print_paper_flag \"" << print_paper_flag
2127 case RC_PRINTPAPERDIMENSIONFLAG:
2128 if (ignore_system_lyxrc ||
2129 print_paper_dimension_flag
2130 != system_lyxrc.print_paper_dimension_flag) {
2131 os << "\\print_paper_dimension_flag \""
2132 << print_paper_dimension_flag << "\"\n";
2136 case RC_PRINTTOPRINTER:
2137 if (ignore_system_lyxrc ||
2138 print_to_printer != system_lyxrc.print_to_printer) {
2139 os << "\\print_to_printer \"" << print_to_printer
2144 case RC_PRINTTOFILE:
2145 if (ignore_system_lyxrc ||
2146 print_to_file != system_lyxrc.print_to_file) {
2147 string const path = os::external_path(print_to_file);
2148 os << "\\print_to_file \"" << path << "\"\n";
2152 case RC_PRINTFILEEXTENSION:
2153 if (ignore_system_lyxrc ||
2154 print_file_extension != system_lyxrc.print_file_extension) {
2155 os << "\\print_file_extension \""
2156 << print_file_extension
2163 << "# TEX SECTION #######################################\n"
2166 case RC_TEXINPUTS_PREFIX:
2167 if (ignore_system_lyxrc ||
2168 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2169 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2174 case RC_FONT_ENCODING:
2175 if (ignore_system_lyxrc ||
2176 fontenc != system_lyxrc.fontenc) {
2177 os << "\\font_encoding \"" << fontenc << "\"\n";
2182 case RC_FORCE_PAINT_SINGLE_CHAR:
2183 if (ignore_system_lyxrc ||
2184 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2185 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2191 << "# FILE SECTION ######################################\n"
2194 case RC_DOCUMENTPATH:
2195 if (ignore_system_lyxrc ||
2196 document_path != system_lyxrc.document_path) {
2197 string const path = os::external_path(document_path);
2198 os << "\\document_path \"" << path << "\"\n";
2202 case RC_USELASTFILEPOS:
2203 if (ignore_system_lyxrc ||
2204 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2205 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2210 case RC_LOADSESSION:
2211 if (ignore_system_lyxrc ||
2212 load_session != system_lyxrc.load_session) {
2213 os << "\\load_session " << convert<string>(load_session)
2218 case RC_MOUSE_WHEEL_SPEED:
2219 if (ignore_system_lyxrc ||
2220 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2221 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2225 case RC_COMPLETION_INLINE_DELAY:
2226 if (ignore_system_lyxrc ||
2227 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2228 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2232 case RC_COMPLETION_INLINE_MATH:
2233 if (ignore_system_lyxrc ||
2234 completion_inline_math != system_lyxrc.completion_inline_math) {
2235 os << "\\completion_inline_math "
2236 << convert<string>(completion_inline_math) << '\n';
2240 case RC_COMPLETION_INLINE_TEXT:
2241 if (ignore_system_lyxrc ||
2242 completion_inline_text != system_lyxrc.completion_inline_text) {
2243 os << "\\completion_inline_text "
2244 << convert<string>(completion_inline_text) << '\n';
2248 case RC_COMPLETION_INLINE_DOTS:
2249 if (ignore_system_lyxrc ||
2250 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2251 os << "\\completion_inline_dots "
2252 << convert<string>(completion_inline_dots) << '\n';
2256 case RC_AUTOCORRECTION_MATH:
2257 if (ignore_system_lyxrc ||
2258 autocorrection_math != system_lyxrc.autocorrection_math) {
2259 os << "\\autocorrection_math "
2260 << convert<string>(autocorrection_math) << '\n';
2264 case RC_COMPLETION_POPUP_DELAY:
2265 if (ignore_system_lyxrc ||
2266 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2267 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2271 case RC_COMPLETION_POPUP_MATH:
2272 if (ignore_system_lyxrc ||
2273 completion_popup_math != system_lyxrc.completion_popup_math) {
2274 os << "\\completion_popup_math "
2275 << convert<string>(completion_popup_math) << '\n';
2279 case RC_COMPLETION_POPUP_TEXT:
2280 if (ignore_system_lyxrc ||
2281 completion_popup_text != system_lyxrc.completion_popup_text) {
2282 os << "\\completion_popup_text "
2283 << convert<string>(completion_popup_text) << '\n';
2287 case RC_COMPLETION_CURSOR_TEXT:
2288 if (ignore_system_lyxrc ||
2289 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2290 os << "\\completion_cursor_text "
2291 << convert<string>(completion_cursor_text) << '\n';
2295 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2296 if (ignore_system_lyxrc ||
2297 completion_popup_after_complete
2298 != system_lyxrc.completion_popup_after_complete) {
2299 os << "\\completion_popup_after_complete "
2300 << convert<string>(completion_popup_after_complete) << '\n';
2304 case RC_NUMLASTFILES:
2305 if (ignore_system_lyxrc ||
2306 num_lastfiles != system_lyxrc.num_lastfiles) {
2307 os << "\\num_lastfiles " << num_lastfiles << '\n';
2311 case RC_CHECKLASTFILES:
2312 if (ignore_system_lyxrc ||
2313 check_lastfiles != system_lyxrc.check_lastfiles) {
2314 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2319 case RC_EXAMPLEPATH:
2320 if (ignore_system_lyxrc ||
2321 example_path != system_lyxrc.example_path) {
2322 string const path = os::external_path(example_path);
2323 os << "\\example_path \"" << path << "\"\n";
2327 case RC_TEMPLATEPATH:
2328 if (ignore_system_lyxrc ||
2329 template_path != system_lyxrc.template_path) {
2330 string const path = os::external_path(template_path);
2331 os << "\\template_path \"" << path << "\"\n";
2335 case RC_TEMPDIRPATH:
2336 if (ignore_system_lyxrc ||
2337 tempdir_path != system_lyxrc.tempdir_path) {
2338 string const path = os::external_path(tempdir_path);
2339 os << "\\tempdir_path \"" << path << "\"\n";
2343 case RC_THESAURUSDIRPATH:
2344 if (ignore_system_lyxrc ||
2345 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2346 string const path = os::external_path(thesaurusdir_path);
2347 os << "\\thesaurusdir_path \"" << path << "\"\n";
2351 case RC_HUNSPELLDIR_PATH:
2352 if (ignore_system_lyxrc ||
2353 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2354 string const path = os::external_path(hunspelldir_path);
2355 os << "\\hunspelldir_path \"" << path << "\"\n";
2359 case RC_PLAINTEXT_LINELEN:
2360 if (ignore_system_lyxrc ||
2361 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2362 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2366 case RC_MAKE_BACKUP:
2367 if (ignore_system_lyxrc ||
2368 make_backup != system_lyxrc.make_backup) {
2369 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2373 case RC_SAVE_COMPRESSED:
2374 if (ignore_system_lyxrc ||
2375 save_compressed != system_lyxrc.save_compressed) {
2376 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2380 case RC_BACKUPDIR_PATH:
2381 if (ignore_system_lyxrc ||
2382 backupdir_path != system_lyxrc.backupdir_path) {
2383 string const path = os::external_path(backupdir_path);
2384 os << "\\backupdir_path \"" << path << "\"\n";
2390 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2394 << "# SPELLCHECKER SECTION ##############################\n"
2397 case RC_ACCEPT_COMPOUND:
2398 if (ignore_system_lyxrc ||
2399 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2400 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2406 if (ignore_system_lyxrc ||
2407 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2408 os << "\\alternate_language \"" << spellchecker_alt_lang
2414 if (ignore_system_lyxrc ||
2415 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2416 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2420 case RC_USE_SYSTEM_COLORS:
2421 if (ignore_system_lyxrc ||
2422 use_system_colors != system_lyxrc.use_system_colors) {
2423 os << "\\use_system_colors "
2424 << convert<string>(use_system_colors)
2429 case RC_USE_TOOLTIP:
2430 if (ignore_system_lyxrc ||
2431 use_tooltip != system_lyxrc.use_tooltip) {
2432 os << "\\use_tooltip "
2433 << convert<string>(use_tooltip)
2438 case RC_USE_PIXMAP_CACHE:
2439 if (ignore_system_lyxrc ||
2440 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2441 os << "\\use_pixmap_cache "
2442 << convert<string>(use_pixmap_cache)
2448 if (ignore_system_lyxrc ||
2449 use_qimage != system_lyxrc.use_qimage) {
2450 os << "\\use_qimage "
2451 << convert<string>(use_qimage)
2458 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2463 case RC_DEFAULT_DECIMAL_POINT:
2464 if (ignore_system_lyxrc ||
2465 default_decimal_point != system_lyxrc.default_decimal_point) {
2466 os << "\\default_decimal_point " << default_decimal_point << '\n';
2471 case RC_DEFAULT_LENGTH_UNIT:
2472 if (ignore_system_lyxrc ||
2473 default_length_unit != system_lyxrc.default_length_unit) {
2474 os << "\\default_length_unit " << int(default_length_unit) << '\n';
2479 case RC_SPELLCHECKER:
2480 if (ignore_system_lyxrc ||
2481 spellchecker != system_lyxrc.spellchecker) {
2482 os << "\\spellchecker " << spellchecker << '\n';
2487 case RC_SPELLCHECK_CONTINUOUSLY:
2488 if (ignore_system_lyxrc ||
2489 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2490 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2496 case RC_SPELLCHECK_NOTES:
2497 if (ignore_system_lyxrc ||
2498 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2499 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2505 case RC_RTL_SUPPORT:
2506 if (ignore_system_lyxrc ||
2507 rtl_support != system_lyxrc.rtl_support) {
2508 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2512 case RC_VISUAL_CURSOR:
2513 if (ignore_system_lyxrc ||
2514 visual_cursor != system_lyxrc.visual_cursor) {
2515 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2519 case RC_LANGUAGE_CUSTOM_PACKAGE:
2520 if (ignore_system_lyxrc ||
2521 language_custom_package != system_lyxrc.language_custom_package) {
2522 os << "\\language_custom_package \"" << language_custom_package
2527 case RC_LANGUAGE_GLOBAL_OPTIONS:
2528 if (ignore_system_lyxrc ||
2529 language_global_options
2530 != system_lyxrc.language_global_options) {
2531 os << "\\language_global_options \""
2532 << convert<string>(language_global_options)
2537 case RC_LANGUAGE_PACKAGE_SELECTION:
2538 if (ignore_system_lyxrc ||
2539 language_package_selection != system_lyxrc.language_package_selection) {
2540 os << "\\language_package_selection ";
2541 switch (language_package_selection) {
2558 case RC_LANGUAGE_COMMAND_BEGIN:
2559 if (ignore_system_lyxrc ||
2560 language_command_begin
2561 != system_lyxrc.language_command_begin) {
2562 os << "\\language_command_begin \""
2563 << language_command_begin
2568 case RC_LANGUAGE_COMMAND_END:
2569 if (ignore_system_lyxrc ||
2570 language_command_end
2571 != system_lyxrc.language_command_end) {
2572 os << "\\language_command_end \"" << language_command_end
2577 case RC_LANGUAGE_COMMAND_LOCAL:
2578 if (ignore_system_lyxrc ||
2579 language_command_local
2580 != system_lyxrc.language_command_local) {
2581 os << "\\language_command_local \""
2582 << language_command_local
2587 case RC_LANGUAGE_AUTO_BEGIN:
2588 if (ignore_system_lyxrc ||
2589 language_auto_begin != system_lyxrc.language_auto_begin) {
2590 os << "\\language_auto_begin "
2591 << convert<string>(language_auto_begin) << '\n';
2595 case RC_LANGUAGE_AUTO_END:
2596 if (ignore_system_lyxrc ||
2597 language_auto_end != system_lyxrc.language_auto_end) {
2598 os << "\\language_auto_end "
2599 << convert<string>(language_auto_end) << '\n';
2603 case RC_MARK_FOREIGN_LANGUAGE:
2604 if (ignore_system_lyxrc ||
2605 mark_foreign_language
2606 != system_lyxrc.mark_foreign_language) {
2607 os << "\\mark_foreign_language " <<
2608 convert<string>(mark_foreign_language) << '\n';
2614 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2617 case RC_AUTO_NUMBER:
2618 if (ignore_system_lyxrc ||
2619 auto_number != system_lyxrc.auto_number) {
2620 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2624 case RC_DEFAULT_LANGUAGE:
2625 if (ignore_system_lyxrc ||
2626 default_language != system_lyxrc.default_language) {
2627 os << "\\default_language " << default_language << '\n';
2631 case RC_GUI_LANGUAGE:
2632 if (ignore_system_lyxrc ||
2633 gui_language != system_lyxrc.gui_language) {
2634 os << "\\gui_language " << gui_language << '\n';
2638 case RC_EXPORT_OVERWRITE:
2639 if (ignore_system_lyxrc ||
2640 export_overwrite != system_lyxrc.export_overwrite) {
2642 switch (export_overwrite) {
2653 os << "\\export_overwrite " << status << '\n';
2658 case RC_SCROLL_WHEEL_ZOOM:
2659 if (ignore_system_lyxrc ||
2660 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2662 switch (scroll_wheel_zoom) {
2663 case SCROLL_WHEEL_ZOOM_OFF:
2666 case SCROLL_WHEEL_ZOOM_CTRL:
2669 case SCROLL_WHEEL_ZOOM_SHIFT:
2672 case SCROLL_WHEEL_ZOOM_ALT:
2676 os << "\\scroll_wheel_zoom " << status << '\n';
2682 << "# FORMATS SECTION ##########################\n"
2686 // New/modified formats
2687 for (Formats::const_iterator cit = formats.begin();
2688 cit != formats.end(); ++cit) {
2689 Format const * format =
2690 system_formats.getFormat(cit->name());
2692 format->extensions() != cit->extensions() ||
2693 format->prettyname() != cit->prettyname() ||
2694 format->shortcut() != cit->shortcut() ||
2695 format->viewer() != cit->viewer() ||
2696 format->editor() != cit->editor() ||
2697 format->documentFormat() != cit->documentFormat() ||
2698 format->vectorFormat() != cit->vectorFormat() ||
2699 format->inExportMenu() != cit->inExportMenu()) {
2700 os << "\\format \"" << cit->name() << "\" \""
2701 << cit->extensions() << "\" \""
2702 << cit->prettyname() << "\" \""
2703 << cit->shortcut() << "\" \""
2704 << escapeCommand(cit->viewer()) << "\" \""
2705 << escapeCommand(cit->editor()) << "\" \"";
2706 vector<string> flags;
2707 if (cit->documentFormat())
2708 flags.push_back("document");
2709 if (cit->vectorFormat())
2710 flags.push_back("vector");
2711 if (cit->zippedNative())
2712 flags.push_back("zipped=native");
2713 if (cit->inExportMenu())
2714 flags.push_back("menu=export");
2716 os << getStringFromVector(flags);
2721 // Look for deleted formats
2722 for (Formats::const_iterator cit = system_formats.begin();
2723 cit != system_formats.end(); ++cit)
2724 if (!formats.getFormat(cit->name()))
2725 os << "\\format \"" << cit->name()
2726 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2729 case RC_VIEWER_ALTERNATIVES: {
2730 Alternatives::const_iterator it = viewer_alternatives.begin();
2731 Alternatives::const_iterator const en = viewer_alternatives.end();
2732 Alternatives::const_iterator const sysend =
2733 system_lyxrc.viewer_alternatives.end();
2734 for (; it != en; ++it) {
2735 string const & fmt = it->first;
2736 CommandSet const & cmd = it->second;
2737 CommandSet::const_iterator sit = cmd.begin();
2738 CommandSet::const_iterator const sen = cmd.end();
2739 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2740 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2741 system_lyxrc.viewer_alternatives.find(fmt);
2742 for (; sit != sen; ++sit) {
2743 string const & cmd = *sit;
2744 if (ignore_system_lyxrc
2745 || sysfmt == sysend // format not found
2746 || sysfmt->second.count(cmd) == 0 // this command not found
2748 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2754 case RC_EDITOR_ALTERNATIVES: {
2755 Alternatives::const_iterator it = editor_alternatives.begin();
2756 Alternatives::const_iterator const en = editor_alternatives.end();
2757 Alternatives::const_iterator const sysend =
2758 system_lyxrc.editor_alternatives.end();
2759 for (; it != en; ++it) {
2760 string const & fmt = it->first;
2761 CommandSet const & cmd = it->second;
2762 CommandSet::const_iterator sit = cmd.begin();
2763 CommandSet::const_iterator const sen = cmd.end();
2764 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2765 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2766 system_lyxrc.editor_alternatives.find(fmt);
2767 for (; sit != sen; ++sit) {
2768 string const & cmd = *sit;
2769 if (ignore_system_lyxrc
2770 || sysfmt == sysend // format not found
2771 || sysfmt->second.count(cmd) == 0 // this command not found
2773 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2779 case RC_DEFAULT_VIEW_FORMAT:
2780 if (ignore_system_lyxrc ||
2781 default_view_format != system_lyxrc.default_view_format) {
2782 os << "\\default_view_format " << default_view_format << '\n';
2792 << "# CONVERTERS SECTION ##########################\n"
2796 // Look for new converters
2797 for (Converters::const_iterator cit = theConverters().begin();
2798 cit != theConverters().end(); ++cit) {
2799 Converter const * converter =
2800 theSystemConverters().getConverter(cit->from,
2803 converter->command != cit->command ||
2804 converter->flags != cit->flags)
2805 os << "\\converter \"" << cit->from << "\" \""
2806 << cit->to << "\" \""
2807 << escapeCommand(cit->command) << "\" \""
2808 << cit->flags << "\"\n";
2811 // New/modifed converters
2812 for (Converters::const_iterator cit = theSystemConverters().begin();
2813 cit != theSystemConverters().end(); ++cit)
2814 if (!theConverters().getConverter(cit->from, cit->to))
2815 os << "\\converter \"" << cit->from
2816 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2823 << "# COPIERS SECTION ##########################\n"
2826 // Look for new movers
2827 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2828 Movers::const_iterator const sysend = theSystemMovers().end();
2829 Movers::const_iterator it = theMovers().begin();
2830 Movers::const_iterator end = theMovers().end();
2832 for (; it != end; ++it) {
2833 Movers::const_iterator const sysit =
2834 find_if(sysbegin, sysend, SameMover(*it));
2835 if (sysit == sysend) {
2836 string const & fmt = it->first;
2837 string const & command =
2838 it->second.command();
2840 os << "\\copier " << fmt
2841 << " \"" << escapeCommand(command) << "\"\n";
2847 // We don't actually delete SpecialisedMover(s) from the
2848 // map, just clear their 'command', so there's no need
2849 // to test for anything else.
2856 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2858 // Why the switch you might ask. It is a trick to ensure that all
2859 // the elements in the LyXRCTags enum is handled. As you can see
2860 // there are no breaks at all. So it is just a huge fall-through.
2861 // The nice thing is that we will get a warning from the compiler
2862 // if we forget an element.
2863 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2865 case LyXRC::RC_LAST:
2866 case LyXRC::RC_ACCEPT_COMPOUND:
2867 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2868 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2869 case LyXRC::RC_ALT_LANG:
2870 case LyXRC::RC_PLAINTEXT_LINELEN:
2871 case LyXRC::RC_AUTOCORRECTION_MATH:
2872 case LyXRC::RC_AUTOREGIONDELETE:
2873 case LyXRC::RC_AUTORESET_OPTIONS:
2874 case LyXRC::RC_AUTOSAVE:
2875 case LyXRC::RC_AUTO_NUMBER:
2876 case LyXRC::RC_BACKUPDIR_PATH:
2877 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2878 case LyXRC::RC_BIBTEX_COMMAND:
2879 case LyXRC::RC_BINDFILE:
2880 case LyXRC::RC_CHECKLASTFILES:
2881 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2882 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2883 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2884 case LyXRC::RC_COMPLETION_INLINE_MATH:
2885 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2886 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2887 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2888 case LyXRC::RC_COMPLETION_POPUP_MATH:
2889 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2890 case LyXRC::RC_USELASTFILEPOS:
2891 case LyXRC::RC_LOADSESSION:
2892 case LyXRC::RC_CHKTEX_COMMAND:
2893 case LyXRC::RC_CONVERTER:
2894 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2895 case LyXRC::RC_COPIER:
2896 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2897 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2898 case LyXRC::RC_DATE_INSERT_FORMAT:
2899 case LyXRC::RC_DEFAULT_LANGUAGE:
2900 case LyXRC::RC_GUI_LANGUAGE:
2901 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2902 case LyXRC::RC_DEFFILE:
2903 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2904 case LyXRC::RC_DISPLAY_GRAPHICS:
2905 case LyXRC::RC_DOCUMENTPATH:
2906 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2907 FileName path(lyxrc_new.document_path);
2908 if (path.exists() && path.isDirectory())
2909 package().document_dir() = FileName(lyxrc.document_path);
2911 case LyXRC::RC_EDITOR_ALTERNATIVES:
2912 case LyXRC::RC_ESC_CHARS:
2913 case LyXRC::RC_EXAMPLEPATH:
2914 case LyXRC::RC_FONT_ENCODING:
2915 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2916 case LyXRC::RC_FILEFORMAT:
2917 case LyXRC::RC_GROUP_LAYOUTS:
2918 case LyXRC::RC_HUNSPELLDIR_PATH:
2919 case LyXRC::RC_ICON_SET:
2920 case LyXRC::RC_INDEX_ALTERNATIVES:
2921 case LyXRC::RC_INDEX_COMMAND:
2922 case LyXRC::RC_JBIBTEX_COMMAND:
2923 case LyXRC::RC_JINDEX_COMMAND:
2924 case LyXRC::RC_NOMENCL_COMMAND:
2925 case LyXRC::RC_INPUT:
2926 case LyXRC::RC_KBMAP:
2927 case LyXRC::RC_KBMAP_PRIMARY:
2928 case LyXRC::RC_KBMAP_SECONDARY:
2929 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2930 case LyXRC::RC_LANGUAGE_AUTO_END:
2931 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2932 case LyXRC::RC_LANGUAGE_COMMAND_END:
2933 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2934 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2935 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2936 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2937 case LyXRC::RC_LYXRCFORMAT:
2938 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2939 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2940 case LyXRC::RC_MACRO_EDIT_STYLE:
2941 case LyXRC::RC_MAKE_BACKUP:
2942 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2943 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2944 case LyXRC::RC_NUMLASTFILES:
2945 case LyXRC::RC_PARAGRAPH_MARKERS:
2946 case LyXRC::RC_PATH_PREFIX:
2947 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2948 prependEnvPath("PATH", lyxrc_new.path_prefix);
2950 case LyXRC::RC_PREVIEW:
2951 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2952 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2953 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2954 case LyXRC::RC_PRINTCOPIESFLAG:
2955 case LyXRC::RC_PRINTER:
2956 case LyXRC::RC_PRINTEVENPAGEFLAG:
2957 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2958 case LyXRC::RC_PRINTFILEEXTENSION:
2959 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2960 case LyXRC::RC_PRINTODDPAGEFLAG:
2961 case LyXRC::RC_PRINTPAGERANGEFLAG:
2962 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2963 case LyXRC::RC_PRINTPAPERFLAG:
2964 case LyXRC::RC_PRINTREVERSEFLAG:
2965 case LyXRC::RC_PRINTSPOOL_COMMAND:
2966 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2967 case LyXRC::RC_PRINTTOFILE:
2968 case LyXRC::RC_PRINTTOPRINTER:
2969 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2970 case LyXRC::RC_PRINT_COMMAND:
2971 case LyXRC::RC_RTL_SUPPORT:
2972 case LyXRC::RC_SAVE_COMPRESSED:
2973 case LyXRC::RC_SCREEN_DPI:
2974 case LyXRC::RC_SCREEN_FONT_ROMAN:
2975 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2976 case LyXRC::RC_SCREEN_FONT_SANS:
2977 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2978 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2979 case LyXRC::RC_SCREEN_FONT_SIZES:
2980 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2981 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2982 case LyXRC::RC_GEOMETRY_SESSION:
2983 case LyXRC::RC_SCREEN_ZOOM:
2984 case LyXRC::RC_SERVERPIPE:
2985 case LyXRC::RC_SET_COLOR:
2986 case LyXRC::RC_SHOW_BANNER:
2987 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2988 case LyXRC::RC_SPELLCHECKER:
2989 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2991 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2992 case LyXRC::RC_SPELLCHECK_NOTES:
2993 case LyXRC::RC_SPLITINDEX_COMMAND:
2994 case LyXRC::RC_TEMPDIRPATH:
2995 case LyXRC::RC_TEMPLATEPATH:
2996 case LyXRC::RC_TEX_ALLOWS_SPACES:
2997 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2998 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2999 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3001 case LyXRC::RC_TEXINPUTS_PREFIX:
3002 case LyXRC::RC_THESAURUSDIRPATH:
3003 case LyXRC::RC_UIFILE:
3004 case LyXRC::RC_USER_EMAIL:
3005 case LyXRC::RC_USER_NAME:
3006 case LyXRC::RC_USE_CONVERTER_CACHE:
3007 case LyXRC::RC_USE_SYSTEM_COLORS:
3008 case LyXRC::RC_USE_TOOLTIP:
3009 case LyXRC::RC_USE_PIXMAP_CACHE:
3010 case LyXRC::RC_USE_QIMAGE:
3011 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3012 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3013 case LyXRC::RC_SINGLE_INSTANCE:
3014 case LyXRC::RC_SORT_LAYOUTS:
3015 case LyXRC::RC_FULL_SCREEN_LIMIT:
3016 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3017 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3018 case LyXRC::RC_FULL_SCREEN_TABBAR:
3019 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3020 case LyXRC::RC_FULL_SCREEN_WIDTH:
3021 case LyXRC::RC_VISUAL_CURSOR:
3022 case LyXRC::RC_VIEWER:
3023 case LyXRC::RC_VIEWER_ALTERNATIVES:
3024 case LyXRC::RC_FORWARD_SEARCH_DVI:
3025 case LyXRC::RC_FORWARD_SEARCH_PDF:
3026 case LyXRC::RC_EXPORT_OVERWRITE:
3027 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3028 case LyXRC::RC_DEFAULT_LENGTH_UNIT:
3029 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3030 case LyXRC::RC_CURSOR_WIDTH:
3037 string const LyXRC::getDescription(LyXRCTags tag)
3042 case RC_ACCEPT_COMPOUND:
3043 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3047 str = _("Specify an alternate language. The default is to use the language of the document.");
3050 case RC_PLAINTEXT_LINELEN:
3051 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.");
3054 case RC_AUTOREGIONDELETE:
3055 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3058 case RC_AUTORESET_OPTIONS:
3059 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3063 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3066 case RC_AUTO_NUMBER:
3069 case RC_BACKUPDIR_PATH:
3070 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.");
3073 case RC_BIBTEX_COMMAND:
3074 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3077 case RC_JBIBTEX_COMMAND:
3078 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3082 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3085 case RC_CHECKLASTFILES:
3086 str = _("Select to check whether the lastfiles still exist.");
3089 case RC_CHKTEX_COMMAND:
3090 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3099 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3100 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.");
3103 case RC_CURSOR_WIDTH:
3104 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3107 case RC_SCROLL_BELOW_DOCUMENT:
3108 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");
3111 case RC_MAC_DONTSWAP_CTRL_META:
3112 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3115 case RC_MAC_LIKE_WORD_MOVEMENT:
3116 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3119 case RC_SHOW_MACRO_LABEL:
3120 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3123 case RC_DATE_INSERT_FORMAT:
3124 //xgettext:no-c-format
3125 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3129 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3132 case RC_DEFAULT_VIEW_FORMAT:
3133 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3136 case RC_DEFAULT_LANGUAGE:
3137 str = _("New documents will be assigned this language.");
3140 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3141 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3144 case RC_DISPLAY_GRAPHICS:
3145 str = _("Select how LyX will display any graphics.");
3148 case RC_DOCUMENTPATH:
3149 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3153 str = _("Specify additional chars that can be part of a word.");
3156 case RC_EXAMPLEPATH:
3157 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3160 case RC_FONT_ENCODING:
3161 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3164 case RC_FORCE_PAINT_SINGLE_CHAR:
3165 str = _("Disable any kerning and ligatures for text drawing on screen.");
3171 case RC_INDEX_COMMAND:
3172 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\".");
3175 case RC_JINDEX_COMMAND:
3176 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3179 case RC_NOMENCL_COMMAND:
3180 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3187 case RC_KBMAP_PRIMARY:
3188 case RC_KBMAP_SECONDARY:
3189 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.");
3192 case RC_LANGUAGE_AUTO_BEGIN:
3193 str = _("Select if a language switching command is needed at the beginning of the document.");
3196 case RC_LANGUAGE_AUTO_END:
3197 str = _("Select if a language switching command is needed at the end of the document.");
3200 case RC_LANGUAGE_COMMAND_BEGIN:
3201 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.");
3204 case RC_LANGUAGE_COMMAND_END:
3205 str = _("The LaTeX command for changing back to the language of the document.");
3208 case RC_LANGUAGE_COMMAND_LOCAL:
3209 str = _("The LaTeX command for local changing of the language.");
3212 case RC_LANGUAGE_GLOBAL_OPTIONS:
3213 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3216 case RC_LANGUAGE_CUSTOM_PACKAGE:
3217 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3220 case RC_LANGUAGE_PACKAGE_SELECTION:
3221 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3224 case RC_USELASTFILEPOS:
3225 str = _("De-select if you do not want LyX to scroll to saved position.");
3228 case RC_LOADSESSION:
3229 str = _("De-select to prevent loading files opened from the last LyX session.");
3232 case RC_MAKE_BACKUP:
3233 str = _("De-select if you don't want LyX to create backup files.");
3236 case RC_MARK_FOREIGN_LANGUAGE:
3237 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3240 case RC_MOUSE_WHEEL_SPEED:
3241 str = bformat(_("The scrolling speed of the mouse wheel."),
3245 case RC_COMPLETION_POPUP_DELAY:
3246 str = _("The completion popup delay.");
3249 case RC_COMPLETION_POPUP_MATH:
3250 str = _("Select to display the completion popup in math mode.");
3253 case RC_COMPLETION_POPUP_TEXT:
3254 str = _("Select to display the completion popup in text mode.");
3257 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3258 str = _("Show the completion popup without delay after non-unique completion attempt.");
3261 case RC_COMPLETION_POPUP_TEXT:
3262 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3265 case RC_COMPLETION_POPUP_DELAY:
3266 str = _("The inline completion delay.");
3269 case RC_COMPLETION_INLINE_MATH:
3270 str = _("Select to display the inline completion in math mode.");
3273 case RC_COMPLETION_INLINE_TEXT:
3274 str = _("Select to display the inline completion in text mode.");
3277 case RC_COMPLETION_INLINE_DOTS:
3278 str = _("Use \"...\" to shorten long completions.");
3281 case RC_AUTOCORRECTION_MATH:
3282 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3285 case RC_NUMLASTFILES:
3286 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3290 case RC_PATH_PREFIX:
3291 str = _("Specify those directories which should be "
3292 "prepended to the PATH environment variable.\n"
3293 "Use the OS native format.");
3297 str = _("Shows a typeset preview of things such as math");
3300 case RC_PREVIEW_HASHED_LABELS:
3301 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3304 case RC_PREVIEW_SCALE_FACTOR:
3305 str = _("Scale the preview size to suit.");
3308 case RC_PRINTCOLLCOPIESFLAG:
3309 str = _("The option for specifying whether the copies should be collated.");
3312 case RC_PRINTCOPIESFLAG:
3313 str = _("The option for specifying the number of copies to print.");
3317 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3320 case RC_PRINTEVENPAGEFLAG:
3321 str = _("The option to print only even pages.");
3324 case RC_PRINTEXSTRAOPTIONS:
3325 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3328 case RC_PRINTFILEEXTENSION:
3329 str = _("Extension of printer program output file. Usually \".ps\".");
3332 case RC_PRINTLANDSCAPEFLAG:
3333 str = _("The option to print out in landscape.");
3336 case RC_PRINTODDPAGEFLAG:
3337 str = _("The option to print only odd pages.");
3340 case RC_PRINTPAGERANGEFLAG:
3341 str = _("The option for specifying a comma-separated list of pages to print.");
3344 case RC_PRINTPAPERDIMENSIONFLAG:
3345 str = _("Option to specify the dimensions of the print paper.");
3348 case RC_PRINTPAPERFLAG:
3349 str = _("The option to specify paper type.");
3352 case RC_PRINTREVERSEFLAG:
3353 str = _("The option to reverse the order of the pages printed.");
3356 case RC_PRINTSPOOL_COMMAND:
3357 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.");
3360 case RC_PRINTSPOOL_PRINTERPREFIX:
3361 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.");
3364 case RC_PRINTTOFILE:
3365 str = _("Option to pass to the print program to print to a file.");
3368 case RC_PRINTTOPRINTER:
3369 str = _("Option to pass to the print program to print on a specific printer.");
3372 case RC_PRINT_ADAPTOUTPUT:
3373 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3376 case RC_PRINT_COMMAND:
3377 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3380 case RC_RTL_SUPPORT:
3381 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3384 case RC_VISUAL_CURSOR:
3385 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3389 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3392 case RC_SCREEN_FONT_ROMAN:
3393 case RC_SCREEN_FONT_SANS:
3394 case RC_SCREEN_FONT_TYPEWRITER:
3395 str = _("The screen fonts used to display the text while editing.");
3398 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3399 case RC_SCREEN_FONT_SANS_FOUNDRY:
3400 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3403 case RC_SCREEN_FONT_SCALABLE:
3404 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.");
3407 case RC_SCREEN_FONT_SIZES:
3408 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3411 case RC_SCREEN_ZOOM:
3412 //xgettext:no-c-format
3413 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3416 case RC_GEOMETRY_SESSION:
3417 str = _("Allow session manager to save and restore windows geometry.");
3421 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3427 case RC_SHOW_BANNER:
3428 str = _("De-select if you don't want the startup banner.");
3431 case RC_TEMPDIRPATH:
3432 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3435 case RC_THESAURUSDIRPATH:
3436 str = _("This is the place where the files of the thesaurus library reside.");
3439 case RC_TEMPLATEPATH:
3440 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3443 case RC_TEX_ALLOWS_SPACES:
3446 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3449 case RC_TEXINPUTS_PREFIX:
3450 str = _("Specify those directories which should be "
3451 "prepended to the TEXINPUTS environment variable.\n"
3452 "A '.' represents the current document directory. "
3453 "Use the OS native format.");
3457 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3466 case RC_USE_USE_SYSTEM_COLORS:
3467 str = _("Enable use the system colors for some things like main window background and selection.");
3470 case RC_USE_TOOLTIP:
3471 str = _("Enable the automatic appearance of tool tips in the work area.");
3474 case RC_USE_PIXMAP_CACHE:
3475 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3478 case RC_VIEWDVI_PAPEROPTION:
3479 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3494 // The global instance
3497 // The global copy of the system lyxrc entries (everything except preferences)