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 = 4; // vfr: remove default paper size
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_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
95 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
96 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
97 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
98 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
99 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
100 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
101 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
102 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
103 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
104 { "\\format", LyXRC::RC_FILEFORMAT },
105 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
106 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
107 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
108 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
109 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
110 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
111 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
112 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
113 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
114 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
115 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
116 { "\\icon_set", LyXRC::RC_ICON_SET },
117 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
118 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
119 { "\\input", LyXRC::RC_INPUT },
120 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
121 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
122 { "\\kbmap", LyXRC::RC_KBMAP },
123 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
124 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
125 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
126 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
127 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
128 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
129 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
130 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
131 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
132 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
133 { "\\load_session", LyXRC::RC_LOADSESSION },
134 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
135 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
136 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
137 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
138 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
139 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
140 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
141 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
142 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
143 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
144 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
145 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
146 { "\\preview", LyXRC::RC_PREVIEW },
147 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
148 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
149 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
150 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
151 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
152 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
153 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
154 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
155 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
156 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
157 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
158 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
159 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
160 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
161 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
162 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
163 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
164 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
165 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
166 { "\\printer", LyXRC::RC_PRINTER },
167 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
168 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
169 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
170 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
171 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
172 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
173 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
174 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
175 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
176 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
177 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
178 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
179 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
180 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
181 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
182 { "\\set_color", LyXRC::RC_SET_COLOR },
183 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
184 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
185 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
186 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
187 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
188 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
189 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
190 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
191 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
192 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
193 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
194 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
195 { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
196 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
197 { "\\ui_file", LyXRC::RC_UIFILE },
198 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
199 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
200 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
201 // compatibility with versions older than 1.4.0 only
202 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
203 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
204 { "\\user_email", LyXRC::RC_USER_EMAIL },
205 { "\\user_name", LyXRC::RC_USER_NAME },
206 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
207 // compatibility with versions older than 1.4.0 only
208 { "\\viewer", LyXRC::RC_VIEWER},
209 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
210 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
211 { "format", LyXRC::RC_LYXRCFORMAT }
214 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
225 void LyXRC::setDefaults()
229 def_file = "default";
231 // The current document directory
232 texinputs_prefix = ".";
233 // Get printer from the environment. If fail, use default "",
234 // assuming that everything is set up correctly.
235 printer = getEnv("PRINTER");
236 print_adapt_output = false;
237 print_command = "dvips";
238 print_evenpage_flag = "-B";
239 print_oddpage_flag = "-A";
240 print_pagerange_flag = "-pp";
241 print_copies_flag = "-c";
242 print_collcopies_flag = "-C";
243 print_reverse_flag = "-r";
244 print_landscape_flag = "-t landscape";
245 print_to_printer = "-P";
246 print_to_file = "-o ";
247 print_file_extension = ".ps";
248 print_paper_flag = "-t";
249 print_paper_dimension_flag = "-T";
250 document_path.erase();
251 view_dvi_paper_option.erase();
252 default_view_format = "pdf2";
253 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
254 bibtex_command = "bibtex";
256 index_command = "makeindex -c -q";
257 nomencl_command = "makeindex -s nomencl.ist";
259 // Because a screen is typically wider than a piece of paper:
261 allow_geometry_session = true;
262 // Default LaTeX font size:
263 font_sizes[FONT_SIZE_TINY] = "5.0";
264 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
265 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
266 font_sizes[FONT_SIZE_SMALL] = "9.0";
267 font_sizes[FONT_SIZE_NORMAL] = "10.0";
268 font_sizes[FONT_SIZE_LARGE] = "12.0";
269 font_sizes[FONT_SIZE_LARGER] = "14.4";
270 font_sizes[FONT_SIZE_LARGEST] = "17.26";
271 font_sizes[FONT_SIZE_HUGE] = "20.74";
272 font_sizes[FONT_SIZE_HUGER] = "24.88";
273 use_scalable_fonts = true;
274 roman_font_name = "";
276 typewriter_font_name = "";
278 auto_region_delete = true;
279 auto_reset_options = false;
280 plaintext_linelen = 65;
281 mouse_wheel_speed = 1.0;
282 num_lastfiles = maxlastfiles;
283 check_lastfiles = true;
284 use_lastfilepos = true;
285 load_session = false;
287 save_compressed = false;
288 backupdir_path.erase();
289 display_graphics = true;
290 // Spellchecker settings:
291 // FIXME: this check should test the target platform (darwin)
292 #if defined(USE_MACOSX_PACKAGING)
293 spellchecker = "native";
294 #elif defined(USE_ASPELL)
295 spellchecker = "aspell";
296 #elif defined(USE_HUNSPELL)
297 spellchecker = "hunspell";
299 spellchecker = "aspell";
301 spellchecker_accept_compound = false;
302 spellcheck_continuously = false;
303 spellcheck_notes = true;
306 visual_cursor = false;
308 mark_foreign_language = true;
309 language_auto_begin = true;
310 language_auto_end = true;
311 language_global_options = true;
312 language_package_selection = LP_AUTO;
313 language_custom_package = "\\usepackage{babel}";
314 language_command_begin = "\\selectlanguage{$$lang}";
315 language_command_local = "\\foreignlanguage{$$lang}{";
316 sort_layouts = false;
317 group_layouts = true;
318 default_language = "english";
319 gui_language = "auto";
321 windows_style_tex_paths = false;
322 tex_allows_spaces = false;
323 date_insert_format = "%x";
324 cursor_follows_scrollbar = false;
325 scroll_below_document = false;
326 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
327 paragraph_markers = false;
328 mac_dontswap_ctrl_meta = false;
329 mac_like_word_movement = false;
330 macro_edit_style = MACRO_EDIT_INLINE_BOX;
331 dialogs_iconify_with_main = false;
332 preview = PREVIEW_OFF;
333 preview_hashed_labels = false;
334 preview_scale_factor = 1.0;
335 use_converter_cache = true;
336 use_system_colors = false;
338 use_pixmap_cache = false;
339 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
340 user_name = to_utf8(support::user_name());
341 user_email = to_utf8(support::user_email());
342 open_buffers_in_tabs = true;
343 single_close_tab_button = false;
344 single_instance = true;
345 forward_search_dvi = string();
346 forward_search_pdf = string();
347 export_overwrite = NO_FILES;
349 // Fullscreen settings
350 full_screen_limit = false;
351 full_screen_toolbars = true;
352 full_screen_tabbar = true;
353 full_screen_menubar = true;
354 full_screen_scrollbar = true;
355 full_screen_width = 700;
357 completion_cursor_text = true;
358 completion_popup_math = true;
359 completion_popup_text = false;
360 completion_popup_delay = 2.0;
361 completion_popup_after_complete = true;
362 autocorrection_math = false;
363 completion_inline_math = true;
364 completion_inline_text = false;
365 completion_inline_dots = -1;
366 completion_inline_delay = 0.2;
367 default_decimal_point = ".";
374 void oldFontFormat(string & family, string & foundry)
376 if (family.empty() || family[0] != '-')
378 foundry = token(family, '-', 1);
379 family = token(family, '-', 2);
387 bool LyXRC::read(FileName const & filename, bool check_format)
389 Lexer lexrc(lyxrcTags);
390 lexrc.setFile(filename);
391 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
392 ReturnValues retval = read(lexrc, check_format);
393 if (!check_format || retval != FormatMismatch)
394 return retval == ReadOK;
396 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
397 FileName const tempfile = FileName::tempName("convert_lyxrc");
398 bool const success = prefs2prefs(filename, tempfile, false);
400 LYXERR0 ("Unable to convert " << filename.absFileName() <<
401 " to format " << LYXRC_FILEFORMAT);
404 // Keep this in the else branch, such that lexrc2 goes out
405 // of scope and releases the lock on tempfile before we
406 // attempt to remove it. This matters on Windows.
407 Lexer lexrc2(lyxrcTags);
408 lexrc2.setFile(tempfile);
409 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
410 retval = read(lexrc2, check_format);
412 tempfile.removeFile();
413 return retval == ReadOK;
417 // don't need to worry about conversion, because this is always
418 // from an internal source
419 bool LyXRC::read(istream & is)
421 Lexer lexrc(lyxrcTags);
423 LYXERR(Debug::LYXRC, "Reading istream...");
424 return read(lexrc, false) == ReadOK;
428 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
430 if (lyxerr.debugging(Debug::PARSER))
431 lexrc.printTable(lyxerr);
436 // default for current rowpainter capabilities
437 force_paint_single_char = true;
439 // format prior to 2.0 and introduction of format tag
440 unsigned int format = 0;
442 while (lexrc.isOK()) {
443 // By using two switches we take advantage of the compiler
444 // telling us if we have missed a LyXRCTags element in
445 // the second switch.
446 // Note that this also shows a problem with Lexer since it
447 // helps us avoid taking advantage of the strictness of the
450 int le = lexrc.lex();
452 case Lexer::LEX_UNDEF:
453 lexrc.printError("Unknown tag `$$Token'");
455 case Lexer::LEX_FEOF:
460 switch (static_cast<LyXRCTags>(le)) {
463 format = lexrc.getInteger();
465 case RC_INPUT: // Include file
468 libFileSearch(string(),
470 if (read(tmp, check_format)) {
472 "Error reading included file: " + tmp.absFileName());
478 bind_file = os::internal_path(lexrc.getString());
483 def_file = os::internal_path(lexrc.getString());
488 ui_file = os::internal_path(lexrc.getString());
491 case RC_AUTORESET_OPTIONS:
492 lexrc >> auto_reset_options;
495 case RC_DISPLAY_GRAPHICS:
497 display_graphics = lexrc.getString() == "true";
500 case RC_TEX_EXPECTS_WINDOWS_PATHS:
501 lexrc >> windows_style_tex_paths;
504 case RC_TEX_ALLOWS_SPACES:
505 lexrc >> tex_allows_spaces;
508 case RC_TEXINPUTS_PREFIX:
509 lexrc >> texinputs_prefix;
516 case RC_KBMAP_PRIMARY:
518 string const kmap(os::internal_path(lexrc.getString()));
519 if (!libFileSearch("kbd", kmap, "kmap").empty()
521 primary_kbmap = kmap;
523 lexrc.printError("LyX: Keymap `$$Token' not found");
528 case RC_KBMAP_SECONDARY:
530 string const kmap(os::internal_path(lexrc.getString()));
531 if (!libFileSearch("kbd", kmap, "kmap").empty()
533 secondary_kbmap = kmap;
535 lexrc.printError("LyX: Keymap `$$Token' not found");
540 case RC_FONT_ENCODING:
544 case RC_FORCE_PAINT_SINGLE_CHAR:
545 lexrc >> force_paint_single_char;
552 case RC_PRINT_COMMAND:
553 if (lexrc.next(true)) {
554 print_command = lexrc.getString();
558 case RC_PRINTEVENPAGEFLAG:
559 lexrc >> print_evenpage_flag;
562 case RC_PRINTODDPAGEFLAG:
563 lexrc >> print_oddpage_flag;
566 case RC_PRINTPAGERANGEFLAG:
567 lexrc >> print_pagerange_flag;
570 case RC_PRINTCOPIESFLAG:
571 lexrc >> print_copies_flag;
574 case RC_PRINTCOLLCOPIESFLAG:
575 lexrc >> print_collcopies_flag;
578 case RC_PRINTREVERSEFLAG:
579 lexrc >> print_reverse_flag;
582 case RC_PRINTLANDSCAPEFLAG:
583 lexrc >> print_landscape_flag;
586 case RC_PRINTTOPRINTER:
587 lexrc >> print_to_printer;
590 case RC_PRINT_ADAPTOUTPUT:
591 lexrc >> print_adapt_output;
596 print_to_file = os::internal_path(lexrc.getString());
600 case RC_PRINTFILEEXTENSION:
601 lexrc >> print_file_extension;
604 case RC_PRINTEXSTRAOPTIONS:
605 lexrc >> print_extra_options;
608 case RC_PRINTSPOOL_COMMAND:
609 if (lexrc.next(true)) {
610 print_spool_command = lexrc.getString();
614 case RC_PRINTSPOOL_PRINTERPREFIX:
615 lexrc >> print_spool_printerprefix;
618 case RC_PRINTPAPERDIMENSIONFLAG:
619 lexrc >> print_paper_dimension_flag;
622 case RC_PRINTPAPERFLAG:
623 lexrc >> print_paper_flag;
626 case RC_VIEWDVI_PAPEROPTION:
628 view_dvi_paper_option = lexrc.getString();
630 view_dvi_paper_option.erase();
633 case RC_CHKTEX_COMMAND:
634 if (lexrc.next(true)) {
635 chktex_command = lexrc.getString();
639 case RC_BIBTEX_ALTERNATIVES:
640 if (lexrc.next(true)) {
641 bibtex_alternatives.insert(lexrc.getString());
645 case RC_BIBTEX_COMMAND:
646 if (lexrc.next(true)) {
647 bibtex_command = lexrc.getString();
651 case RC_JBIBTEX_COMMAND:
652 if (lexrc.next(true)) {
653 jbibtex_command = lexrc.getString();
657 case RC_INDEX_ALTERNATIVES:
658 if (lexrc.next(true)) {
659 index_alternatives.insert(lexrc.getString());
663 case RC_INDEX_COMMAND:
664 if (lexrc.next(true)) {
665 index_command = lexrc.getString();
669 case RC_JINDEX_COMMAND:
670 if (lexrc.next(true)) {
671 jindex_command = lexrc.getString();
675 case RC_SPLITINDEX_COMMAND:
676 if (lexrc.next(true)) {
677 splitindex_command = lexrc.getString();
681 case RC_NOMENCL_COMMAND:
682 if (lexrc.next(true)) {
683 nomencl_command = lexrc.getString();
695 case RC_GEOMETRY_SESSION:
696 lexrc >> allow_geometry_session;
699 case RC_SCREEN_FONT_SIZES:
700 lexrc >> font_sizes[FONT_SIZE_TINY];
701 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
702 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
703 lexrc >> font_sizes[FONT_SIZE_SMALL];
704 lexrc >> font_sizes[FONT_SIZE_NORMAL];
705 lexrc >> font_sizes[FONT_SIZE_LARGE];
706 lexrc >> font_sizes[FONT_SIZE_LARGER];
707 lexrc >> font_sizes[FONT_SIZE_LARGEST];
708 lexrc >> font_sizes[FONT_SIZE_HUGE];
709 lexrc >> font_sizes[FONT_SIZE_HUGER];
712 case RC_SCREEN_FONT_SCALABLE:
713 lexrc >> use_scalable_fonts;
720 case RC_DOCUMENTPATH:
722 document_path = os::internal_path(lexrc.getString());
723 document_path = expandPath(document_path);
729 example_path = os::internal_path(lexrc.getString());
730 example_path = expandPath(example_path);
734 case RC_TEMPLATEPATH:
736 template_path = os::internal_path(lexrc.getString());
737 template_path = expandPath(template_path);
743 tempdir_path = os::internal_path(lexrc.getString());
744 tempdir_path = expandPath(tempdir_path);
748 case RC_THESAURUSDIRPATH:
750 thesaurusdir_path = os::internal_path(lexrc.getString());
751 thesaurusdir_path = expandPath(thesaurusdir_path);
755 case RC_HUNSPELLDIR_PATH:
757 hunspelldir_path = os::internal_path(lexrc.getString());
758 hunspelldir_path = expandPath(hunspelldir_path);
762 case RC_USELASTFILEPOS:
763 lexrc >> use_lastfilepos;
767 lexrc >> load_session;
770 case RC_MOUSE_WHEEL_SPEED:
771 lexrc >> mouse_wheel_speed;
774 case RC_COMPLETION_INLINE_DELAY:
775 lexrc >> completion_inline_delay;
778 case RC_COMPLETION_INLINE_MATH:
779 lexrc >> completion_inline_math;
782 case RC_COMPLETION_INLINE_TEXT:
783 lexrc >> completion_inline_text;
786 case RC_COMPLETION_INLINE_DOTS:
787 lexrc >> completion_inline_dots;
790 case RC_AUTOCORRECTION_MATH:
791 lexrc >> autocorrection_math;
794 case RC_COMPLETION_POPUP_DELAY:
795 lexrc >> completion_popup_delay;
798 case RC_COMPLETION_POPUP_MATH:
799 lexrc >> completion_popup_math;
802 case RC_COMPLETION_POPUP_TEXT:
803 lexrc >> completion_popup_text;
806 case RC_COMPLETION_CURSOR_TEXT:
807 lexrc >> completion_cursor_text;
810 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
811 lexrc >> completion_popup_after_complete;
814 case RC_NUMLASTFILES:
815 lexrc >> num_lastfiles;
818 case RC_CHECKLASTFILES:
819 lexrc >> check_lastfiles;
826 case RC_SCREEN_FONT_ROMAN:
828 roman_font_name = lexrc.getString();
829 oldFontFormat(roman_font_name,
834 case RC_SCREEN_FONT_SANS:
836 sans_font_name = lexrc.getString();
837 oldFontFormat(sans_font_name, sans_font_foundry);
841 case RC_SCREEN_FONT_TYPEWRITER:
843 typewriter_font_name = lexrc.getString();
844 oldFontFormat(typewriter_font_name,
845 typewriter_font_foundry);
849 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
850 lexrc >> roman_font_foundry;
853 case RC_SCREEN_FONT_SANS_FOUNDRY:
854 lexrc >> sans_font_foundry;
857 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
858 lexrc >> typewriter_font_foundry;
863 lexrc.printError("Missing color tag.");
866 string lyx_name = lexrc.getString();
869 lexrc.printError("Missing color name for color: `$$Token'");
872 string x11_name = lexrc.getString();
874 ColorCode const col =
875 lcolor.getFromLyXName(lyx_name);
876 if (col == Color_none ||
877 col == Color_inherit ||
881 if (!lcolor.setColor(col, x11_name))
882 LYXERR0("Bad lyxrc set_color for " << lyx_name);
886 case RC_AUTOREGIONDELETE:
887 // Auto region delete defaults to true
888 lexrc >> auto_region_delete;
893 lyxpipes = os::internal_path(lexrc.getString());
894 lyxpipes = expandPath(lyxpipes);
898 case RC_CURSOR_FOLLOWS_SCROLLBAR:
899 lexrc >> cursor_follows_scrollbar;
902 case RC_CURSOR_WIDTH:
903 lexrc >> cursor_width;
906 case RC_SCROLL_BELOW_DOCUMENT:
907 lexrc >> scroll_below_document;
910 case RC_PARAGRAPH_MARKERS:
911 lexrc >> paragraph_markers;
914 case RC_MAC_DONTSWAP_CTRL_META:
915 lexrc >> mac_dontswap_ctrl_meta;
918 case RC_MAC_LIKE_WORD_MOVEMENT:
919 lexrc >> mac_like_word_movement;
922 case RC_MACRO_EDIT_STYLE:
924 switch (lexrc.getInteger()) {
925 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
926 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
927 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
932 case RC_DIALOGS_ICONIFY_WITH_MAIN:
933 lexrc >> dialogs_iconify_with_main;
936 case RC_PLAINTEXT_LINELEN:
937 lexrc >> plaintext_linelen;
939 // Spellchecker settings:
940 case RC_ACCEPT_COMPOUND:
941 lexrc >> spellchecker_accept_compound;
943 case RC_USE_SYSTEM_COLORS:
944 lexrc >> use_system_colors;
947 lexrc >> use_tooltip;
949 case RC_USE_PIXMAP_CACHE:
950 lexrc >> use_pixmap_cache;
952 case RC_SPELLCHECKER:
953 lexrc >> spellchecker;
956 lexrc >> spellchecker_alt_lang;
959 lexrc >> spellchecker_esc_chars;
961 case RC_SPELLCHECK_CONTINUOUSLY:
962 lexrc >> spellcheck_continuously;
964 case RC_SPELLCHECK_NOTES:
965 lexrc >> spellcheck_notes;
968 lexrc >> make_backup;
970 case RC_SAVE_COMPRESSED:
971 lexrc >> save_compressed;
973 case RC_BACKUPDIR_PATH:
975 backupdir_path = os::internal_path(lexrc.getString());
976 backupdir_path = expandPath(backupdir_path);
979 case RC_DEFAULT_DECIMAL_POINT:
980 lexrc >> default_decimal_point;
982 case RC_DATE_INSERT_FORMAT:
983 lexrc >> date_insert_format;
985 case RC_LANGUAGE_CUSTOM_PACKAGE:
986 lexrc >> language_custom_package;
988 case RC_LANGUAGE_AUTO_BEGIN:
989 lexrc >> language_auto_begin;
991 case RC_LANGUAGE_AUTO_END:
992 lexrc >> language_auto_end;
994 case RC_LANGUAGE_GLOBAL_OPTIONS:
995 lexrc >> language_global_options;
997 case RC_LANGUAGE_PACKAGE_SELECTION:
999 switch (lexrc.getInteger()) {
1001 language_package_selection = LP_AUTO;
1004 language_package_selection = LP_BABEL;
1007 language_package_selection = LP_CUSTOM;
1010 language_package_selection = LP_NONE;
1015 case RC_LANGUAGE_COMMAND_BEGIN:
1016 lexrc >> language_command_begin;
1018 case RC_LANGUAGE_COMMAND_END:
1019 lexrc >> language_command_end;
1021 case RC_LANGUAGE_COMMAND_LOCAL:
1022 lexrc >> language_command_local;
1024 case RC_RTL_SUPPORT:
1025 lexrc >> rtl_support;
1027 case RC_VISUAL_CURSOR:
1028 lexrc >> visual_cursor;
1030 case RC_AUTO_NUMBER:
1031 lexrc >> auto_number;
1033 case RC_MARK_FOREIGN_LANGUAGE:
1034 lexrc >> mark_foreign_language;
1038 string fmt, command;
1040 fmt = lexrc.getString();
1041 if (lexrc.next(true))
1042 command = lexrc.getString();
1043 setMover(fmt, command);
1047 case RC_CONVERTER: {
1048 string from, to, command, flags;
1050 from = lexrc.getString();
1052 to = lexrc.getString();
1053 if (lexrc.next(true))
1054 command = lexrc.getString();
1056 flags = lexrc.getString();
1057 if (command.empty())
1058 theConverters().erase(from, to);
1060 theConverters().add(from, to, command, flags);
1063 // compatibility with versions older than 1.4.0 only
1065 string format, command;
1066 lexrc >> format >> command;
1067 formats.setViewer(format, command);
1070 case RC_FILEFORMAT: {
1071 string format, extensions, prettyname, shortcut;
1072 lexrc >> format >> extensions >> prettyname >> shortcut;
1073 string viewer, editor;
1074 if (lexrc.next(true))
1075 viewer = lexrc.getString();
1076 if (lexrc.next(true))
1077 editor = lexrc.getString();
1079 // Hack to ensure compatibility with versions older
1081 int le = lexrc.lex();
1082 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1083 flags = lexrc.getString();
1084 if (le != Lexer::LEX_DATA) {
1085 // We have got a known token.
1086 // Therefore this is an old style
1087 // format definition without
1089 lexrc.pushToken(flags);
1093 int flgs = Format::none;
1094 while (!flags.empty()) {
1096 flags = split(flags, flag, ',');
1097 if (flag == "document")
1098 flgs |= Format::document;
1099 else if (flag == "vector")
1100 flgs |= Format::vector;
1101 else if (flag == "zipped=native")
1102 flgs |= Format::zipped_native;
1103 else if (flag == "menu=export")
1104 flgs |= Format::export_menu;
1106 LYXERR0("Ignoring unknown flag `"
1107 << flag << "' for format `"
1110 if (prettyname.empty()) {
1111 if (theConverters().formatIsUsed(format))
1112 LYXERR0("Can't delete format " << format);
1114 formats.erase(format);
1116 formats.add(format, extensions, prettyname,
1117 shortcut, viewer, editor, flgs);
1121 case RC_VIEWER_ALTERNATIVES: {
1122 string format, command;
1124 format = lexrc.getString();
1125 if (lexrc.eatLine())
1126 command = lexrc.getString();
1127 viewer_alternatives[format].insert(command);
1130 case RC_EDITOR_ALTERNATIVES: {
1131 string format, command;
1133 format = lexrc.getString();
1134 if (lexrc.eatLine())
1135 command = lexrc.getString();
1136 editor_alternatives[format].insert(command);
1140 case RC_DEFAULT_VIEW_FORMAT:
1141 lexrc >> default_view_format;
1144 case RC_DEFAULT_LANGUAGE:
1145 lexrc >> default_language;
1148 case RC_GUI_LANGUAGE:
1149 lexrc >> gui_language;
1152 case RC_SHOW_BANNER:
1153 lexrc >> show_banner;
1158 string const tmp = lexrc.getString();
1159 if (tmp == "true" || tmp == "on")
1160 preview = PREVIEW_ON;
1161 else if (tmp == "no_math")
1162 preview = PREVIEW_NO_MATH;
1164 preview = PREVIEW_OFF;
1165 if (tmp != "false" && tmp != "off")
1166 LYXERR0("Unrecognized preview status \""
1172 case RC_PREVIEW_HASHED_LABELS:
1173 lexrc >> preview_hashed_labels;
1176 case RC_PREVIEW_SCALE_FACTOR:
1177 lexrc >> preview_scale_factor;
1184 lexrc >> user_email;
1187 case RC_PATH_PREFIX:
1188 lexrc >> path_prefix;
1191 case RC_USE_CONVERTER_CACHE:
1192 lexrc >> use_converter_cache;
1194 case RC_CONVERTER_CACHE_MAXAGE:
1195 lexrc >> converter_cache_maxage;
1198 case RC_SORT_LAYOUTS:
1199 lexrc >> sort_layouts;
1201 case RC_GROUP_LAYOUTS:
1202 lexrc >> group_layouts;
1204 case RC_FULL_SCREEN_LIMIT:
1205 lexrc >> full_screen_limit;
1207 case RC_FULL_SCREEN_TOOLBARS:
1208 lexrc >> full_screen_toolbars;
1210 case RC_FULL_SCREEN_SCROLLBAR:
1211 lexrc >> full_screen_scrollbar;
1213 case RC_FULL_SCREEN_TABBAR:
1214 lexrc >> full_screen_tabbar;
1216 case RC_FULL_SCREEN_MENUBAR:
1217 lexrc >> full_screen_menubar;
1219 case RC_FULL_SCREEN_WIDTH:
1220 lexrc >> full_screen_width;
1222 case RC_OPEN_BUFFERS_IN_TABS:
1223 lexrc >> open_buffers_in_tabs;
1225 case RC_SINGLE_CLOSE_TAB_BUTTON:
1226 lexrc >> single_close_tab_button;
1228 case RC_SINGLE_INSTANCE:
1229 lexrc >> single_instance;
1230 if (run_mode == PREFERRED)
1231 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1233 case RC_FORWARD_SEARCH_DVI:
1234 if (lexrc.next(true))
1235 forward_search_dvi = lexrc.getString();
1237 case RC_FORWARD_SEARCH_PDF:
1238 if (lexrc.next(true))
1239 forward_search_pdf = lexrc.getString();
1241 case RC_EXPORT_OVERWRITE:
1243 string const tmp = lexrc.getString();
1244 if (tmp == "all" || tmp == "true")
1245 export_overwrite = ALL_FILES;
1246 else if (tmp == "main")
1247 export_overwrite = MAIN_FILE;
1249 export_overwrite = NO_FILES;
1250 if (tmp != "ask" && tmp != "false")
1251 LYXERR0("Unrecognized export_overwrite status \""
1256 case RC_SCROLL_WHEEL_ZOOM:
1258 string const tmp = lexrc.getString();
1260 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1261 else if (tmp == "shift")
1262 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1263 else if (tmp == "alt")
1264 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1266 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1267 if (tmp != "off" && tmp != "false")
1268 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1275 break; // this is just a dummy
1278 // This is triggered the first time through the loop unless
1279 // we hit a format tag.
1280 if (check_format && format != LYXRC_FILEFORMAT)
1281 return FormatMismatch;
1284 /// Update converters data-structures
1285 theConverters().update(formats);
1286 theConverters().buildGraph();
1292 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1294 ofstream ofs(filename.toFilesystemEncoding().c_str());
1296 write(ofs, ignore_system_lyxrc);
1300 void LyXRC::print() const
1302 if (lyxerr.debugging())
1303 write(lyxerr, false);
1311 typedef pair<string, SpecialisedMover> Data;
1313 SameMover(Data const & comparison)
1314 : comparison_(comparison) {}
1316 bool operator()(Data const & data) const
1318 return data.first == comparison_.first &&
1319 data.second.command() == comparison_.second.command();
1329 // Escape \ and " so that LyXLex can read the string later
1330 string escapeCommand(string const & str) {
1331 return subst(subst(str , "\\", "\\\\"),
1338 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1340 LyXRCTags tag = RC_LAST;
1342 if (!name.empty()) {
1343 for (int i = 0; i != lyxrcCount; ++i)
1344 if ("\\" + name == lyxrcTags[i].tag)
1345 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1349 os << "# LyX " << lyx_version
1350 << " generated this file. If you want to make your own\n"
1351 << "# modifications you should do them from inside LyX and save.\n\n"
1352 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1354 // Why the switch you might ask. It is a trick to ensure that all
1355 // the elements in the LyXRCTags enum are handled. As you can see
1356 // there are no breaks at all. So it is just a huge fall-through.
1357 // The nice thing is that we will get a warning from the compiler
1358 // if we forget an element.
1362 // input/include files are not done here
1363 case RC_LYXRCFORMAT:
1365 if (ignore_system_lyxrc ||
1366 bind_file != system_lyxrc.bind_file) {
1367 string const path = os::external_path(bind_file);
1368 os << "\\bind_file \"" << path << "\"\n";
1374 if (ignore_system_lyxrc ||
1375 def_file != system_lyxrc.def_file) {
1376 string const path = os::external_path(def_file);
1377 os << "\\def_file \"" << path << "\"\n";
1386 << "# MISC SECTION ######################################\n"
1388 // bind files are not done here.
1390 case RC_PATH_PREFIX:
1391 if (ignore_system_lyxrc ||
1392 path_prefix != system_lyxrc.path_prefix) {
1393 os << "\\path_prefix \"" << path_prefix << "\"\n";
1398 if (ignore_system_lyxrc ||
1399 ui_file != system_lyxrc.ui_file) {
1400 string const path = os::external_path(ui_file);
1401 os << "\\ui_file \"" << path << "\"\n";
1405 case RC_AUTOREGIONDELETE:
1406 if (ignore_system_lyxrc ||
1407 auto_region_delete != system_lyxrc.auto_region_delete) {
1408 os << "# Set to false to inhibit automatic replacement of\n"
1409 << "# the current selection.\n"
1410 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1415 case RC_AUTORESET_OPTIONS:
1416 if (ignore_system_lyxrc ||
1417 auto_reset_options != system_lyxrc.auto_reset_options) {
1418 os << "# Set to false to inhibit automatic reset of\n"
1419 << "# the class options to defaults on class change.\n"
1420 << "\\auto_reset_options "
1421 << convert<string>(auto_reset_options)
1427 if (ignore_system_lyxrc ||
1428 autosave != system_lyxrc.autosave) {
1429 os << "# The time interval between auto-saves in seconds.\n"
1430 << "\\autosave " << autosave << '\n';
1434 case RC_DISPLAY_GRAPHICS:
1435 if (ignore_system_lyxrc ||
1436 display_graphics != system_lyxrc.display_graphics) {
1437 os << "# Display graphics within LyX\n"
1439 << "\\display_graphics "
1440 << (display_graphics ? "true" : "false")
1445 case RC_SORT_LAYOUTS:
1446 if (ignore_system_lyxrc ||
1447 sort_layouts != system_lyxrc.sort_layouts) {
1448 os << "# Sort layouts alphabetically.\n"
1449 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1453 case RC_GROUP_LAYOUTS:
1454 if (ignore_system_lyxrc ||
1455 group_layouts != system_lyxrc.group_layouts) {
1456 os << "# Group layouts by their category.\n"
1457 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1461 case RC_VIEWDVI_PAPEROPTION:
1462 if (ignore_system_lyxrc ||
1463 view_dvi_paper_option
1464 != system_lyxrc.view_dvi_paper_option) {
1465 os << "# Options used to specify paper size to the\n"
1466 << "# view_dvi_command (e.g. -paper)\n"
1467 << "\\view_dvi_paper_option \""
1468 << view_dvi_paper_option << "\"\n";
1472 case RC_CHKTEX_COMMAND:
1473 if (ignore_system_lyxrc ||
1474 chktex_command != system_lyxrc.chktex_command) {
1475 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1479 case RC_BIBTEX_ALTERNATIVES: {
1480 CommandSet::const_iterator it = bibtex_alternatives.begin();
1481 CommandSet::const_iterator end = bibtex_alternatives.end();
1482 for ( ; it != end; ++it) {
1483 if (ignore_system_lyxrc
1484 || !system_lyxrc.bibtex_alternatives.count(*it))
1485 os << "\\bibtex_alternatives \""
1491 case RC_BIBTEX_COMMAND:
1492 if (ignore_system_lyxrc ||
1493 bibtex_command != system_lyxrc.bibtex_command) {
1494 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1498 case RC_JBIBTEX_COMMAND:
1499 if (ignore_system_lyxrc ||
1500 jbibtex_command != system_lyxrc.jbibtex_command) {
1501 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1505 case RC_INDEX_ALTERNATIVES: {
1506 CommandSet::const_iterator it = index_alternatives.begin();
1507 CommandSet::const_iterator end = index_alternatives.end();
1508 for ( ; it != end; ++it) {
1509 if (ignore_system_lyxrc
1510 || !system_lyxrc.index_alternatives.count(*it))
1511 os << "\\index_alternatives \""
1517 case RC_INDEX_COMMAND:
1518 if (ignore_system_lyxrc ||
1519 index_command != system_lyxrc.index_command) {
1520 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1524 case RC_JINDEX_COMMAND:
1525 if (ignore_system_lyxrc ||
1526 jindex_command != system_lyxrc.jindex_command) {
1527 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1531 case RC_SPLITINDEX_COMMAND:
1532 if (ignore_system_lyxrc ||
1533 splitindex_command != system_lyxrc.splitindex_command) {
1534 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1538 case RC_NOMENCL_COMMAND:
1539 if (ignore_system_lyxrc ||
1540 nomencl_command != system_lyxrc.nomencl_command) {
1541 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1545 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1546 // Don't write this setting to the preferences file,
1547 // but allow temporary changes (bug 7557).
1548 if (ignore_system_lyxrc) {
1549 os << "\\tex_expects_windows_paths "
1550 << convert<string>(windows_style_tex_paths) << '\n';
1554 case RC_TEX_ALLOWS_SPACES:
1555 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1556 os << "\\tex_allows_spaces "
1557 << convert<string>(tex_allows_spaces) << '\n';
1562 if (ignore_system_lyxrc ||
1563 use_kbmap != system_lyxrc.use_kbmap) {
1564 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1568 case RC_KBMAP_PRIMARY:
1569 if (ignore_system_lyxrc ||
1570 primary_kbmap != system_lyxrc.primary_kbmap) {
1571 string const path = os::external_path(primary_kbmap);
1572 os << "\\kbmap_primary \"" << path << "\"\n";
1576 case RC_KBMAP_SECONDARY:
1577 if (ignore_system_lyxrc ||
1578 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1579 string const path = os::external_path(secondary_kbmap);
1580 os << "\\kbmap_secondary \"" << path << "\"\n";
1585 if (ignore_system_lyxrc ||
1586 lyxpipes != system_lyxrc.lyxpipes) {
1587 string const path = os::external_path(lyxpipes);
1588 os << "\\serverpipe \"" << path << "\"\n";
1592 case RC_DATE_INSERT_FORMAT:
1593 if (ignore_system_lyxrc ||
1594 date_insert_format != system_lyxrc.date_insert_format) {
1595 os << "\\date_insert_format \"" << date_insert_format
1602 os << "\\user_name \"" << user_name << "\"\n";
1607 os << "\\user_email \"" << user_email << "\"\n";
1611 case RC_SHOW_BANNER:
1612 if (ignore_system_lyxrc ||
1613 show_banner != system_lyxrc.show_banner) {
1614 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1620 if (ignore_system_lyxrc ||
1621 preview != system_lyxrc.preview) {
1627 case PREVIEW_NO_MATH:
1634 os << "\\preview " << status << '\n';
1639 case RC_PREVIEW_HASHED_LABELS:
1640 if (ignore_system_lyxrc ||
1641 preview_hashed_labels !=
1642 system_lyxrc.preview_hashed_labels) {
1643 os << "\\preview_hashed_labels "
1644 << convert<string>(preview_hashed_labels) << '\n';
1649 case RC_PREVIEW_SCALE_FACTOR:
1650 if (ignore_system_lyxrc ||
1651 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1652 os << "\\preview_scale_factor "
1653 << preview_scale_factor << '\n';
1658 case RC_USE_CONVERTER_CACHE:
1659 if (ignore_system_lyxrc ||
1660 use_converter_cache != system_lyxrc.use_converter_cache) {
1661 os << "\\use_converter_cache "
1662 << convert<string>(use_converter_cache) << '\n';
1667 case RC_CONVERTER_CACHE_MAXAGE:
1668 if (ignore_system_lyxrc ||
1669 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1670 os << "\\converter_cache_maxage "
1671 << converter_cache_maxage << '\n';
1677 << "# SCREEN & FONTS SECTION ############################\n"
1681 if (ignore_system_lyxrc ||
1682 icon_set != system_lyxrc.icon_set) {
1683 os << "\\icon_set \"" << icon_set
1690 if (ignore_system_lyxrc ||
1691 dpi != system_lyxrc.dpi) {
1692 os << "\\screen_dpi " << dpi << '\n';
1696 case RC_SCREEN_ZOOM:
1697 if (ignore_system_lyxrc ||
1698 zoom != system_lyxrc.zoom) {
1699 os << "\\screen_zoom " << zoom << '\n';
1703 case RC_GEOMETRY_SESSION:
1704 if (ignore_system_lyxrc ||
1705 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1706 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1711 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1712 if (ignore_system_lyxrc ||
1713 cursor_follows_scrollbar
1714 != system_lyxrc.cursor_follows_scrollbar) {
1715 os << "\\cursor_follows_scrollbar "
1716 << convert<string>(cursor_follows_scrollbar) << '\n';
1720 case RC_CURSOR_WIDTH:
1721 if (ignore_system_lyxrc ||
1723 != system_lyxrc.cursor_width) {
1724 os << "\\cursor_width "
1725 << cursor_width << '\n';
1729 case RC_SCROLL_BELOW_DOCUMENT:
1730 if (ignore_system_lyxrc ||
1731 scroll_below_document
1732 != system_lyxrc.scroll_below_document) {
1733 os << "\\scroll_below_document "
1734 << convert<string>(scroll_below_document) << '\n';
1738 case RC_PARAGRAPH_MARKERS:
1739 if (ignore_system_lyxrc ||
1741 != system_lyxrc.paragraph_markers) {
1742 os << "\\paragraph_markers "
1743 << convert<string>(paragraph_markers) << '\n';
1747 case RC_MAC_DONTSWAP_CTRL_META:
1748 if (ignore_system_lyxrc ||
1749 mac_dontswap_ctrl_meta
1750 != system_lyxrc.mac_dontswap_ctrl_meta) {
1751 os << "\\mac_dontswap_ctrl_meta "
1752 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1756 case RC_MAC_LIKE_WORD_MOVEMENT:
1757 if (ignore_system_lyxrc ||
1758 mac_like_word_movement
1759 != system_lyxrc.mac_like_word_movement) {
1760 os << "\\mac_like_word_movement "
1761 << convert<string>(mac_like_word_movement) << '\n';
1765 case RC_MACRO_EDIT_STYLE:
1766 if (ignore_system_lyxrc ||
1768 != system_lyxrc.macro_edit_style) {
1769 os << "\\macro_edit_style ";
1770 switch (macro_edit_style) {
1771 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1772 case MACRO_EDIT_INLINE: os << "1\n"; break;
1773 case MACRO_EDIT_LIST: os << "2\n"; break;
1778 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1779 if (ignore_system_lyxrc ||
1780 dialogs_iconify_with_main
1781 != system_lyxrc.dialogs_iconify_with_main) {
1782 os << "\\dialogs_iconify_with_main "
1783 << convert<string>(dialogs_iconify_with_main) << '\n';
1787 case RC_SCREEN_FONT_ROMAN:
1788 if (ignore_system_lyxrc ||
1789 roman_font_name != system_lyxrc.roman_font_name) {
1790 os << "\\screen_font_roman \"" << roman_font_name
1795 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1796 if (ignore_system_lyxrc ||
1797 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1798 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1803 case RC_SCREEN_FONT_SANS:
1804 if (ignore_system_lyxrc ||
1805 sans_font_name != system_lyxrc.sans_font_name) {
1806 os << "\\screen_font_sans \"" << sans_font_name
1811 case RC_SCREEN_FONT_SANS_FOUNDRY:
1812 if (ignore_system_lyxrc ||
1813 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1814 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1819 case RC_SCREEN_FONT_TYPEWRITER:
1820 if (ignore_system_lyxrc ||
1821 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1822 os << "\\screen_font_typewriter \""
1823 << typewriter_font_name << "\"\n";
1827 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1828 if (ignore_system_lyxrc ||
1829 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1830 os << "\\screen_font_typewriter_foundry \""
1831 << typewriter_font_foundry << "\"\n";
1836 case RC_SCREEN_FONT_SCALABLE:
1837 if (ignore_system_lyxrc ||
1838 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1839 os << "\\screen_font_scalable "
1840 << convert<string>(use_scalable_fonts)
1845 case RC_SCREEN_FONT_SIZES:
1846 if (ignore_system_lyxrc ||
1847 font_sizes[FONT_SIZE_TINY]
1848 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1849 font_sizes[FONT_SIZE_SCRIPT]
1850 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1851 font_sizes[FONT_SIZE_FOOTNOTE]
1852 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1853 font_sizes[FONT_SIZE_SMALL]
1854 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1855 font_sizes[FONT_SIZE_NORMAL]
1856 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1857 font_sizes[FONT_SIZE_LARGE]
1858 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1859 font_sizes[FONT_SIZE_LARGER]
1860 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1861 font_sizes[FONT_SIZE_LARGEST]
1862 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1863 font_sizes[FONT_SIZE_HUGE]
1864 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1865 font_sizes[FONT_SIZE_HUGER]
1866 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1867 os.setf(ios::fixed);
1869 os << "\\screen_font_sizes"
1870 << ' ' << font_sizes[FONT_SIZE_TINY]
1871 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1872 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1873 << ' ' << font_sizes[FONT_SIZE_SMALL]
1874 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1875 << ' ' << font_sizes[FONT_SIZE_LARGE]
1876 << ' ' << font_sizes[FONT_SIZE_LARGER]
1877 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1878 << ' ' << font_sizes[FONT_SIZE_HUGE]
1879 << ' ' << font_sizes[FONT_SIZE_HUGER]
1884 case RC_FULL_SCREEN_LIMIT:
1885 if (ignore_system_lyxrc ||
1886 full_screen_limit != system_lyxrc.full_screen_limit) {
1887 os << "\\fullscreen_limit "
1888 << convert<string>(full_screen_limit)
1893 case RC_FULL_SCREEN_TOOLBARS:
1894 if (ignore_system_lyxrc ||
1895 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1896 os << "\\fullscreen_toolbars "
1897 << convert<string>(full_screen_toolbars)
1902 case RC_FULL_SCREEN_SCROLLBAR:
1903 if (ignore_system_lyxrc ||
1904 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1905 os << "\\fullscreen_scrollbar "
1906 << convert<string>(full_screen_scrollbar)
1911 case RC_FULL_SCREEN_TABBAR:
1912 if (ignore_system_lyxrc ||
1913 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1914 os << "\\fullscreen_tabbar "
1915 << convert<string>(full_screen_tabbar)
1920 case RC_FULL_SCREEN_MENUBAR:
1921 if (ignore_system_lyxrc ||
1922 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1923 os << "\\fullscreen_menubar "
1924 << convert<string>(full_screen_menubar)
1929 case RC_FULL_SCREEN_WIDTH:
1930 if (ignore_system_lyxrc ||
1931 full_screen_width != system_lyxrc.full_screen_width) {
1932 os << "\\fullscreen_width "
1933 << convert<string>(full_screen_width)
1938 case RC_OPEN_BUFFERS_IN_TABS:
1939 if (ignore_system_lyxrc ||
1940 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1941 os << "\\open_buffers_in_tabs "
1942 << convert<string>(open_buffers_in_tabs)
1947 case RC_SINGLE_CLOSE_TAB_BUTTON:
1948 if (ignore_system_lyxrc ||
1949 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1950 os << "\\single_close_tab_button "
1951 << convert<string>(single_close_tab_button)
1956 case RC_SINGLE_INSTANCE:
1957 if (ignore_system_lyxrc ||
1958 single_instance != system_lyxrc.single_instance) {
1959 os << "\\single_instance "
1960 << convert<string>(single_instance)
1965 case RC_FORWARD_SEARCH_DVI:
1966 if (ignore_system_lyxrc ||
1967 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1968 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1972 case RC_FORWARD_SEARCH_PDF:
1973 if (ignore_system_lyxrc ||
1974 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1975 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1981 << "# COLOR SECTION ###################################\n"
1985 for (int i = 0; i < Color_ignore; ++i) {
1986 ColorCode lc = static_cast<ColorCode>(i);
1987 string const col = lcolor.getX11Name(lc);
1988 if (ignore_system_lyxrc
1989 || col != system_lcolor.getX11Name(lc)) {
1990 os << "\\set_color \""
1991 << lcolor.getLyXName(lc) << "\" \""
1999 << "# PRINTER SECTION ###################################\n"
2003 if (ignore_system_lyxrc ||
2004 printer != system_lyxrc.printer) {
2005 os << "\\printer \"" << printer << "\"\n";
2009 case RC_PRINT_ADAPTOUTPUT:
2010 if (ignore_system_lyxrc ||
2011 print_adapt_output != system_lyxrc.print_adapt_output) {
2012 os << "\\print_adapt_output "
2013 << convert<string>(print_adapt_output)
2018 case RC_PRINT_COMMAND:
2019 if (ignore_system_lyxrc ||
2020 print_command != system_lyxrc.print_command) {
2021 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2025 case RC_PRINTEXSTRAOPTIONS:
2026 if (ignore_system_lyxrc ||
2027 print_extra_options != system_lyxrc.print_extra_options) {
2028 os << "\\print_extra_options \"" << print_extra_options
2033 case RC_PRINTSPOOL_COMMAND:
2034 if (ignore_system_lyxrc ||
2035 print_spool_command != system_lyxrc.print_spool_command) {
2036 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2041 case RC_PRINTSPOOL_PRINTERPREFIX:
2042 if (ignore_system_lyxrc ||
2043 print_spool_printerprefix
2044 != system_lyxrc.print_spool_printerprefix) {
2045 os << "\\print_spool_printerprefix \""
2046 << print_spool_printerprefix << "\"\n";
2050 case RC_PRINTEVENPAGEFLAG:
2051 if (ignore_system_lyxrc ||
2052 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2053 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2058 case RC_PRINTODDPAGEFLAG:
2059 if (ignore_system_lyxrc ||
2060 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2061 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2066 case RC_PRINTREVERSEFLAG:
2067 if (ignore_system_lyxrc ||
2068 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2069 os << "\\print_reverse_flag \"" << print_reverse_flag
2074 case RC_PRINTLANDSCAPEFLAG:
2075 if (ignore_system_lyxrc ||
2076 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2077 os << "\\print_landscape_flag \"" << print_landscape_flag
2082 case RC_PRINTPAGERANGEFLAG:
2083 if (ignore_system_lyxrc ||
2084 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2085 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2090 case RC_PRINTCOPIESFLAG:
2091 if (ignore_system_lyxrc ||
2092 print_copies_flag != system_lyxrc.print_copies_flag) {
2093 os << "\\print_copies_flag \"" << print_copies_flag
2098 case RC_PRINTCOLLCOPIESFLAG:
2099 if (ignore_system_lyxrc ||
2100 print_collcopies_flag
2101 != system_lyxrc.print_collcopies_flag) {
2102 os << "\\print_collcopies_flag \""
2103 << print_collcopies_flag
2108 case RC_PRINTPAPERFLAG:
2109 if (ignore_system_lyxrc ||
2110 print_paper_flag != system_lyxrc.print_paper_flag) {
2111 os << "\\print_paper_flag \"" << print_paper_flag
2116 case RC_PRINTPAPERDIMENSIONFLAG:
2117 if (ignore_system_lyxrc ||
2118 print_paper_dimension_flag
2119 != system_lyxrc.print_paper_dimension_flag) {
2120 os << "\\print_paper_dimension_flag \""
2121 << print_paper_dimension_flag << "\"\n";
2125 case RC_PRINTTOPRINTER:
2126 if (ignore_system_lyxrc ||
2127 print_to_printer != system_lyxrc.print_to_printer) {
2128 os << "\\print_to_printer \"" << print_to_printer
2133 case RC_PRINTTOFILE:
2134 if (ignore_system_lyxrc ||
2135 print_to_file != system_lyxrc.print_to_file) {
2136 string const path = os::external_path(print_to_file);
2137 os << "\\print_to_file \"" << path << "\"\n";
2141 case RC_PRINTFILEEXTENSION:
2142 if (ignore_system_lyxrc ||
2143 print_file_extension != system_lyxrc.print_file_extension) {
2144 os << "\\print_file_extension \""
2145 << print_file_extension
2152 << "# TEX SECTION #######################################\n"
2155 case RC_TEXINPUTS_PREFIX:
2156 if (ignore_system_lyxrc ||
2157 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2158 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2163 case RC_FONT_ENCODING:
2164 if (ignore_system_lyxrc ||
2165 fontenc != system_lyxrc.fontenc) {
2166 os << "\\font_encoding \"" << fontenc << "\"\n";
2171 case RC_FORCE_PAINT_SINGLE_CHAR:
2172 if (ignore_system_lyxrc ||
2173 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2174 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2180 << "# FILE SECTION ######################################\n"
2183 case RC_DOCUMENTPATH:
2184 if (ignore_system_lyxrc ||
2185 document_path != system_lyxrc.document_path) {
2186 string const path = os::external_path(document_path);
2187 os << "\\document_path \"" << path << "\"\n";
2191 case RC_USELASTFILEPOS:
2192 if (ignore_system_lyxrc ||
2193 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2194 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2199 case RC_LOADSESSION:
2200 if (ignore_system_lyxrc ||
2201 load_session != system_lyxrc.load_session) {
2202 os << "\\load_session " << convert<string>(load_session)
2207 case RC_MOUSE_WHEEL_SPEED:
2208 if (ignore_system_lyxrc ||
2209 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2210 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2214 case RC_COMPLETION_INLINE_DELAY:
2215 if (ignore_system_lyxrc ||
2216 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2217 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2221 case RC_COMPLETION_INLINE_MATH:
2222 if (ignore_system_lyxrc ||
2223 completion_inline_math != system_lyxrc.completion_inline_math) {
2224 os << "\\completion_inline_math "
2225 << convert<string>(completion_inline_math) << '\n';
2229 case RC_COMPLETION_INLINE_TEXT:
2230 if (ignore_system_lyxrc ||
2231 completion_inline_text != system_lyxrc.completion_inline_text) {
2232 os << "\\completion_inline_text "
2233 << convert<string>(completion_inline_text) << '\n';
2237 case RC_COMPLETION_INLINE_DOTS:
2238 if (ignore_system_lyxrc ||
2239 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2240 os << "\\completion_inline_dots "
2241 << convert<string>(completion_inline_dots) << '\n';
2245 case RC_AUTOCORRECTION_MATH:
2246 if (ignore_system_lyxrc ||
2247 autocorrection_math != system_lyxrc.autocorrection_math) {
2248 os << "\\autocorrection_math "
2249 << convert<string>(autocorrection_math) << '\n';
2253 case RC_COMPLETION_POPUP_DELAY:
2254 if (ignore_system_lyxrc ||
2255 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2256 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2260 case RC_COMPLETION_POPUP_MATH:
2261 if (ignore_system_lyxrc ||
2262 completion_popup_math != system_lyxrc.completion_popup_math) {
2263 os << "\\completion_popup_math "
2264 << convert<string>(completion_popup_math) << '\n';
2268 case RC_COMPLETION_POPUP_TEXT:
2269 if (ignore_system_lyxrc ||
2270 completion_popup_text != system_lyxrc.completion_popup_text) {
2271 os << "\\completion_popup_text "
2272 << convert<string>(completion_popup_text) << '\n';
2276 case RC_COMPLETION_CURSOR_TEXT:
2277 if (ignore_system_lyxrc ||
2278 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2279 os << "\\completion_cursor_text "
2280 << convert<string>(completion_cursor_text) << '\n';
2284 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2285 if (ignore_system_lyxrc ||
2286 completion_popup_after_complete
2287 != system_lyxrc.completion_popup_after_complete) {
2288 os << "\\completion_popup_after_complete "
2289 << convert<string>(completion_popup_after_complete) << '\n';
2293 case RC_NUMLASTFILES:
2294 if (ignore_system_lyxrc ||
2295 num_lastfiles != system_lyxrc.num_lastfiles) {
2296 os << "\\num_lastfiles " << num_lastfiles << '\n';
2300 case RC_CHECKLASTFILES:
2301 if (ignore_system_lyxrc ||
2302 check_lastfiles != system_lyxrc.check_lastfiles) {
2303 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2308 case RC_EXAMPLEPATH:
2309 if (ignore_system_lyxrc ||
2310 example_path != system_lyxrc.example_path) {
2311 string const path = os::external_path(example_path);
2312 os << "\\example_path \"" << path << "\"\n";
2316 case RC_TEMPLATEPATH:
2317 if (ignore_system_lyxrc ||
2318 template_path != system_lyxrc.template_path) {
2319 string const path = os::external_path(template_path);
2320 os << "\\template_path \"" << path << "\"\n";
2324 case RC_TEMPDIRPATH:
2325 if (ignore_system_lyxrc ||
2326 tempdir_path != system_lyxrc.tempdir_path) {
2327 string const path = os::external_path(tempdir_path);
2328 os << "\\tempdir_path \"" << path << "\"\n";
2332 case RC_THESAURUSDIRPATH:
2333 if (ignore_system_lyxrc ||
2334 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2335 string const path = os::external_path(thesaurusdir_path);
2336 os << "\\thesaurusdir_path \"" << path << "\"\n";
2340 case RC_HUNSPELLDIR_PATH:
2341 if (ignore_system_lyxrc ||
2342 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2343 string const path = os::external_path(hunspelldir_path);
2344 os << "\\hunspelldir_path \"" << path << "\"\n";
2348 case RC_PLAINTEXT_LINELEN:
2349 if (ignore_system_lyxrc ||
2350 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2351 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2355 case RC_MAKE_BACKUP:
2356 if (ignore_system_lyxrc ||
2357 make_backup != system_lyxrc.make_backup) {
2358 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2362 case RC_SAVE_COMPRESSED:
2363 if (ignore_system_lyxrc ||
2364 save_compressed != system_lyxrc.save_compressed) {
2365 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2369 case RC_BACKUPDIR_PATH:
2370 if (ignore_system_lyxrc ||
2371 backupdir_path != system_lyxrc.backupdir_path) {
2372 string const path = os::external_path(backupdir_path);
2373 os << "\\backupdir_path \"" << path << "\"\n";
2379 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2383 << "# SPELLCHECKER SECTION ##############################\n"
2386 case RC_ACCEPT_COMPOUND:
2387 if (ignore_system_lyxrc ||
2388 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2389 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2395 if (ignore_system_lyxrc ||
2396 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2397 os << "\\alternate_language \"" << spellchecker_alt_lang
2403 if (ignore_system_lyxrc ||
2404 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2405 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2409 case RC_USE_SYSTEM_COLORS:
2410 if (ignore_system_lyxrc ||
2411 use_system_colors != system_lyxrc.use_system_colors) {
2412 os << "\\use_system_colors "
2413 << convert<string>(use_system_colors)
2418 case RC_USE_TOOLTIP:
2419 if (ignore_system_lyxrc ||
2420 use_tooltip != system_lyxrc.use_tooltip) {
2421 os << "\\use_tooltip "
2422 << convert<string>(use_tooltip)
2427 case RC_USE_PIXMAP_CACHE:
2428 if (ignore_system_lyxrc ||
2429 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2430 os << "\\use_pixmap_cache "
2431 << convert<string>(use_pixmap_cache)
2438 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2443 case RC_DEFAULT_DECIMAL_POINT:
2444 if (ignore_system_lyxrc ||
2445 default_decimal_point != system_lyxrc.default_decimal_point) {
2446 os << "\\default_decimal_point " << default_decimal_point << '\n';
2451 case RC_SPELLCHECKER:
2452 if (ignore_system_lyxrc ||
2453 spellchecker != system_lyxrc.spellchecker) {
2454 os << "\\spellchecker " << spellchecker << '\n';
2459 case RC_SPELLCHECK_CONTINUOUSLY:
2460 if (ignore_system_lyxrc ||
2461 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2462 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2468 case RC_SPELLCHECK_NOTES:
2469 if (ignore_system_lyxrc ||
2470 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2471 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2477 case RC_RTL_SUPPORT:
2478 if (ignore_system_lyxrc ||
2479 rtl_support != system_lyxrc.rtl_support) {
2480 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2484 case RC_VISUAL_CURSOR:
2485 if (ignore_system_lyxrc ||
2486 visual_cursor != system_lyxrc.visual_cursor) {
2487 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2491 case RC_LANGUAGE_CUSTOM_PACKAGE:
2492 if (ignore_system_lyxrc ||
2493 language_custom_package != system_lyxrc.language_custom_package) {
2494 os << "\\language_custom_package \"" << language_custom_package
2499 case RC_LANGUAGE_GLOBAL_OPTIONS:
2500 if (ignore_system_lyxrc ||
2501 language_global_options
2502 != system_lyxrc.language_global_options) {
2503 os << "\\language_global_options \""
2504 << convert<string>(language_global_options)
2509 case RC_LANGUAGE_PACKAGE_SELECTION:
2510 if (ignore_system_lyxrc ||
2511 language_package_selection != system_lyxrc.language_package_selection) {
2512 os << "\\language_package_selection ";
2513 switch (language_package_selection) {
2530 case RC_LANGUAGE_COMMAND_BEGIN:
2531 if (ignore_system_lyxrc ||
2532 language_command_begin
2533 != system_lyxrc.language_command_begin) {
2534 os << "\\language_command_begin \""
2535 << language_command_begin
2540 case RC_LANGUAGE_COMMAND_END:
2541 if (ignore_system_lyxrc ||
2542 language_command_end
2543 != system_lyxrc.language_command_end) {
2544 os << "\\language_command_end \"" << language_command_end
2549 case RC_LANGUAGE_COMMAND_LOCAL:
2550 if (ignore_system_lyxrc ||
2551 language_command_local
2552 != system_lyxrc.language_command_local) {
2553 os << "\\language_command_local \""
2554 << language_command_local
2559 case RC_LANGUAGE_AUTO_BEGIN:
2560 if (ignore_system_lyxrc ||
2561 language_auto_begin != system_lyxrc.language_auto_begin) {
2562 os << "\\language_auto_begin "
2563 << convert<string>(language_auto_begin) << '\n';
2567 case RC_LANGUAGE_AUTO_END:
2568 if (ignore_system_lyxrc ||
2569 language_auto_end != system_lyxrc.language_auto_end) {
2570 os << "\\language_auto_end "
2571 << convert<string>(language_auto_end) << '\n';
2575 case RC_MARK_FOREIGN_LANGUAGE:
2576 if (ignore_system_lyxrc ||
2577 mark_foreign_language
2578 != system_lyxrc.mark_foreign_language) {
2579 os << "\\mark_foreign_language " <<
2580 convert<string>(mark_foreign_language) << '\n';
2586 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2589 case RC_AUTO_NUMBER:
2590 if (ignore_system_lyxrc ||
2591 auto_number != system_lyxrc.auto_number) {
2592 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2596 case RC_DEFAULT_LANGUAGE:
2597 if (ignore_system_lyxrc ||
2598 default_language != system_lyxrc.default_language) {
2599 os << "\\default_language " << default_language << '\n';
2603 case RC_GUI_LANGUAGE:
2604 if (ignore_system_lyxrc ||
2605 gui_language != system_lyxrc.gui_language) {
2606 os << "\\gui_language " << gui_language << '\n';
2610 case RC_EXPORT_OVERWRITE:
2611 if (ignore_system_lyxrc ||
2612 export_overwrite != system_lyxrc.export_overwrite) {
2614 switch (export_overwrite) {
2625 os << "\\export_overwrite " << status << '\n';
2630 case RC_SCROLL_WHEEL_ZOOM:
2631 if (ignore_system_lyxrc ||
2632 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2634 switch (scroll_wheel_zoom) {
2635 case SCROLL_WHEEL_ZOOM_OFF:
2638 case SCROLL_WHEEL_ZOOM_CTRL:
2641 case SCROLL_WHEEL_ZOOM_SHIFT:
2644 case SCROLL_WHEEL_ZOOM_ALT:
2648 os << "\\scroll_wheel_zoom " << status << '\n';
2654 << "# FORMATS SECTION ##########################\n"
2658 // New/modified formats
2659 for (Formats::const_iterator cit = formats.begin();
2660 cit != formats.end(); ++cit) {
2661 Format const * format =
2662 system_formats.getFormat(cit->name());
2664 format->extensions() != cit->extensions() ||
2665 format->prettyname() != cit->prettyname() ||
2666 format->shortcut() != cit->shortcut() ||
2667 format->viewer() != cit->viewer() ||
2668 format->editor() != cit->editor() ||
2669 format->documentFormat() != cit->documentFormat() ||
2670 format->vectorFormat() != cit->vectorFormat() ||
2671 format->inExportMenu() != cit->inExportMenu()) {
2672 os << "\\format \"" << cit->name() << "\" \""
2673 << cit->extensions() << "\" \""
2674 << cit->prettyname() << "\" \""
2675 << cit->shortcut() << "\" \""
2676 << escapeCommand(cit->viewer()) << "\" \""
2677 << escapeCommand(cit->editor()) << "\" \"";
2678 vector<string> flags;
2679 if (cit->documentFormat())
2680 flags.push_back("document");
2681 if (cit->vectorFormat())
2682 flags.push_back("vector");
2683 if (cit->zippedNative())
2684 flags.push_back("zipped=native");
2685 if (cit->inExportMenu())
2686 flags.push_back("menu=export");
2688 os << getStringFromVector(flags);
2693 // Look for deleted formats
2694 for (Formats::const_iterator cit = system_formats.begin();
2695 cit != system_formats.end(); ++cit)
2696 if (!formats.getFormat(cit->name()))
2697 os << "\\format \"" << cit->name()
2698 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2701 case RC_VIEWER_ALTERNATIVES: {
2702 Alternatives::const_iterator it = viewer_alternatives.begin();
2703 Alternatives::const_iterator const en = viewer_alternatives.end();
2704 Alternatives::const_iterator const sysend =
2705 system_lyxrc.viewer_alternatives.end();
2706 for (; it != en; ++it) {
2707 string const & fmt = it->first;
2708 CommandSet const & cmd = it->second;
2709 CommandSet::const_iterator sit = cmd.begin();
2710 CommandSet::const_iterator const sen = cmd.end();
2711 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2712 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2713 system_lyxrc.viewer_alternatives.find(fmt);
2714 for (; sit != sen; ++sit) {
2715 string const & cmd = *sit;
2716 if (ignore_system_lyxrc
2717 || sysfmt == sysend // format not found
2718 || sysfmt->second.count(cmd) == 0 // this command not found
2720 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2726 case RC_EDITOR_ALTERNATIVES: {
2727 Alternatives::const_iterator it = editor_alternatives.begin();
2728 Alternatives::const_iterator const en = editor_alternatives.end();
2729 Alternatives::const_iterator const sysend =
2730 system_lyxrc.editor_alternatives.end();
2731 for (; it != en; ++it) {
2732 string const & fmt = it->first;
2733 CommandSet const & cmd = it->second;
2734 CommandSet::const_iterator sit = cmd.begin();
2735 CommandSet::const_iterator const sen = cmd.end();
2736 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2737 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2738 system_lyxrc.editor_alternatives.find(fmt);
2739 for (; sit != sen; ++sit) {
2740 string const & cmd = *sit;
2741 if (ignore_system_lyxrc
2742 || sysfmt == sysend // format not found
2743 || sysfmt->second.count(cmd) == 0 // this command not found
2745 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2751 case RC_DEFAULT_VIEW_FORMAT:
2752 if (ignore_system_lyxrc ||
2753 default_view_format != system_lyxrc.default_view_format) {
2754 os << "\\default_view_format " << default_view_format << '\n';
2764 << "# CONVERTERS SECTION ##########################\n"
2768 // Look for new converters
2769 for (Converters::const_iterator cit = theConverters().begin();
2770 cit != theConverters().end(); ++cit) {
2771 Converter const * converter =
2772 theSystemConverters().getConverter(cit->from,
2775 converter->command != cit->command ||
2776 converter->flags != cit->flags)
2777 os << "\\converter \"" << cit->from << "\" \""
2778 << cit->to << "\" \""
2779 << escapeCommand(cit->command) << "\" \""
2780 << cit->flags << "\"\n";
2783 // New/modifed converters
2784 for (Converters::const_iterator cit = theSystemConverters().begin();
2785 cit != theSystemConverters().end(); ++cit)
2786 if (!theConverters().getConverter(cit->from, cit->to))
2787 os << "\\converter \"" << cit->from
2788 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2795 << "# COPIERS SECTION ##########################\n"
2798 // Look for new movers
2799 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2800 Movers::const_iterator const sysend = theSystemMovers().end();
2801 Movers::const_iterator it = theMovers().begin();
2802 Movers::const_iterator end = theMovers().end();
2804 for (; it != end; ++it) {
2805 Movers::const_iterator const sysit =
2806 find_if(sysbegin, sysend, SameMover(*it));
2807 if (sysit == sysend) {
2808 string const & fmt = it->first;
2809 string const & command =
2810 it->second.command();
2812 os << "\\copier " << fmt
2813 << " \"" << escapeCommand(command) << "\"\n";
2819 // We don't actually delete SpecialisedMover(s) from the
2820 // map, just clear their 'command', so there's no need
2821 // to test for anything else.
2828 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2830 // Why the switch you might ask. It is a trick to ensure that all
2831 // the elements in the LyXRCTags enum is handled. As you can see
2832 // there are no breaks at all. So it is just a huge fall-through.
2833 // The nice thing is that we will get a warning from the compiler
2834 // if we forget an element.
2835 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2837 case LyXRC::RC_LAST:
2838 case LyXRC::RC_ACCEPT_COMPOUND:
2839 if (lyxrc_orig.spellchecker_accept_compound != lyxrc_new.spellchecker_accept_compound)
2840 if (theSpellChecker()) theSpellChecker()->advanceChangeNumber();
2841 case LyXRC::RC_ALT_LANG:
2842 case LyXRC::RC_PLAINTEXT_LINELEN:
2843 case LyXRC::RC_AUTOCORRECTION_MATH:
2844 case LyXRC::RC_AUTOREGIONDELETE:
2845 case LyXRC::RC_AUTORESET_OPTIONS:
2846 case LyXRC::RC_AUTOSAVE:
2847 case LyXRC::RC_AUTO_NUMBER:
2848 case LyXRC::RC_BACKUPDIR_PATH:
2849 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2850 case LyXRC::RC_BIBTEX_COMMAND:
2851 case LyXRC::RC_BINDFILE:
2852 case LyXRC::RC_CHECKLASTFILES:
2853 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2854 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2855 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2856 case LyXRC::RC_COMPLETION_INLINE_MATH:
2857 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2858 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2859 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2860 case LyXRC::RC_COMPLETION_POPUP_MATH:
2861 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2862 case LyXRC::RC_USELASTFILEPOS:
2863 case LyXRC::RC_LOADSESSION:
2864 case LyXRC::RC_CHKTEX_COMMAND:
2865 case LyXRC::RC_CONVERTER:
2866 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2867 case LyXRC::RC_COPIER:
2868 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2869 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2870 case LyXRC::RC_DATE_INSERT_FORMAT:
2871 case LyXRC::RC_DEFAULT_LANGUAGE:
2872 case LyXRC::RC_GUI_LANGUAGE:
2873 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2874 case LyXRC::RC_DEFFILE:
2875 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2876 case LyXRC::RC_DISPLAY_GRAPHICS:
2877 case LyXRC::RC_DOCUMENTPATH:
2878 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2879 FileName path(lyxrc_new.document_path);
2880 if (path.exists() && path.isDirectory())
2881 package().document_dir() = FileName(lyxrc.document_path);
2883 case LyXRC::RC_EDITOR_ALTERNATIVES:
2884 case LyXRC::RC_ESC_CHARS:
2885 case LyXRC::RC_EXAMPLEPATH:
2886 case LyXRC::RC_FONT_ENCODING:
2887 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2888 case LyXRC::RC_FILEFORMAT:
2889 case LyXRC::RC_GROUP_LAYOUTS:
2890 case LyXRC::RC_HUNSPELLDIR_PATH:
2891 case LyXRC::RC_ICON_SET:
2892 case LyXRC::RC_INDEX_ALTERNATIVES:
2893 case LyXRC::RC_INDEX_COMMAND:
2894 case LyXRC::RC_JBIBTEX_COMMAND:
2895 case LyXRC::RC_JINDEX_COMMAND:
2896 case LyXRC::RC_NOMENCL_COMMAND:
2897 case LyXRC::RC_INPUT:
2898 case LyXRC::RC_KBMAP:
2899 case LyXRC::RC_KBMAP_PRIMARY:
2900 case LyXRC::RC_KBMAP_SECONDARY:
2901 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2902 case LyXRC::RC_LANGUAGE_AUTO_END:
2903 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2904 case LyXRC::RC_LANGUAGE_COMMAND_END:
2905 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2906 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2907 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2908 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2909 case LyXRC::RC_LYXRCFORMAT:
2910 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2911 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2912 case LyXRC::RC_MACRO_EDIT_STYLE:
2913 case LyXRC::RC_MAKE_BACKUP:
2914 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2915 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2916 case LyXRC::RC_NUMLASTFILES:
2917 case LyXRC::RC_PARAGRAPH_MARKERS:
2918 case LyXRC::RC_PATH_PREFIX:
2919 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2920 prependEnvPath("PATH", lyxrc_new.path_prefix);
2922 case LyXRC::RC_PREVIEW:
2923 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2924 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2925 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2926 case LyXRC::RC_PRINTCOPIESFLAG:
2927 case LyXRC::RC_PRINTER:
2928 case LyXRC::RC_PRINTEVENPAGEFLAG:
2929 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2930 case LyXRC::RC_PRINTFILEEXTENSION:
2931 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2932 case LyXRC::RC_PRINTODDPAGEFLAG:
2933 case LyXRC::RC_PRINTPAGERANGEFLAG:
2934 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2935 case LyXRC::RC_PRINTPAPERFLAG:
2936 case LyXRC::RC_PRINTREVERSEFLAG:
2937 case LyXRC::RC_PRINTSPOOL_COMMAND:
2938 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2939 case LyXRC::RC_PRINTTOFILE:
2940 case LyXRC::RC_PRINTTOPRINTER:
2941 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2942 case LyXRC::RC_PRINT_COMMAND:
2943 case LyXRC::RC_RTL_SUPPORT:
2944 case LyXRC::RC_SAVE_COMPRESSED:
2945 case LyXRC::RC_SCREEN_DPI:
2946 case LyXRC::RC_SCREEN_FONT_ROMAN:
2947 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2948 case LyXRC::RC_SCREEN_FONT_SANS:
2949 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2950 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2951 case LyXRC::RC_SCREEN_FONT_SIZES:
2952 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2953 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2954 case LyXRC::RC_GEOMETRY_SESSION:
2955 case LyXRC::RC_SCREEN_ZOOM:
2956 case LyXRC::RC_SERVERPIPE:
2957 case LyXRC::RC_SET_COLOR:
2958 case LyXRC::RC_SHOW_BANNER:
2959 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2960 case LyXRC::RC_SPELLCHECKER:
2961 if (lyxrc_orig.spellchecker != lyxrc_new.spellchecker)
2963 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2964 case LyXRC::RC_SPELLCHECK_NOTES:
2965 case LyXRC::RC_SPLITINDEX_COMMAND:
2966 case LyXRC::RC_TEMPDIRPATH:
2967 case LyXRC::RC_TEMPLATEPATH:
2968 case LyXRC::RC_TEX_ALLOWS_SPACES:
2969 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2970 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2971 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2973 case LyXRC::RC_TEXINPUTS_PREFIX:
2974 case LyXRC::RC_THESAURUSDIRPATH:
2975 case LyXRC::RC_UIFILE:
2976 case LyXRC::RC_USER_EMAIL:
2977 case LyXRC::RC_USER_NAME:
2978 case LyXRC::RC_USE_CONVERTER_CACHE:
2979 case LyXRC::RC_USE_SYSTEM_COLORS:
2980 case LyXRC::RC_USE_TOOLTIP:
2981 case LyXRC::RC_USE_PIXMAP_CACHE:
2982 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2983 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2984 case LyXRC::RC_SINGLE_INSTANCE:
2985 case LyXRC::RC_SORT_LAYOUTS:
2986 case LyXRC::RC_FULL_SCREEN_LIMIT:
2987 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2988 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2989 case LyXRC::RC_FULL_SCREEN_TABBAR:
2990 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2991 case LyXRC::RC_FULL_SCREEN_WIDTH:
2992 case LyXRC::RC_VISUAL_CURSOR:
2993 case LyXRC::RC_VIEWER:
2994 case LyXRC::RC_VIEWER_ALTERNATIVES:
2995 case LyXRC::RC_FORWARD_SEARCH_DVI:
2996 case LyXRC::RC_FORWARD_SEARCH_PDF:
2997 case LyXRC::RC_EXPORT_OVERWRITE:
2998 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2999 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3000 case LyXRC::RC_CURSOR_WIDTH:
3007 string const LyXRC::getDescription(LyXRCTags tag)
3012 case RC_ACCEPT_COMPOUND:
3013 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3017 str = _("Specify an alternate language. The default is to use the language of the document.");
3020 case RC_PLAINTEXT_LINELEN:
3021 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.");
3024 case RC_AUTOREGIONDELETE:
3025 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3028 case RC_AUTORESET_OPTIONS:
3029 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3033 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3036 case RC_AUTO_NUMBER:
3039 case RC_BACKUPDIR_PATH:
3040 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.");
3043 case RC_BIBTEX_COMMAND:
3044 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3047 case RC_JBIBTEX_COMMAND:
3048 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3052 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3055 case RC_CHECKLASTFILES:
3056 str = _("Select to check whether the lastfiles still exist.");
3059 case RC_CHKTEX_COMMAND:
3060 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3069 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3070 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.");
3073 case RC_CURSOR_WIDTH:
3074 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3077 case RC_SCROLL_BELOW_DOCUMENT:
3078 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");
3081 case RC_MAC_DONTSWAP_CTRL_META:
3082 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3085 case RC_MAC_LIKE_WORD_MOVEMENT:
3086 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3089 case RC_SHOW_MACRO_LABEL:
3090 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3093 case RC_DATE_INSERT_FORMAT:
3094 //xgettext:no-c-format
3095 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3099 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3102 case RC_DEFAULT_VIEW_FORMAT:
3103 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3106 case RC_DEFAULT_LANGUAGE:
3107 str = _("New documents will be assigned this language.");
3110 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3111 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3114 case RC_DISPLAY_GRAPHICS:
3115 str = _("Select how LyX will display any graphics.");
3118 case RC_DOCUMENTPATH:
3119 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3123 str = _("Specify additional chars that can be part of a word.");
3126 case RC_EXAMPLEPATH:
3127 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3130 case RC_FONT_ENCODING:
3131 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3134 case RC_FORCE_PAINT_SINGLE_CHAR:
3135 str = _("Disable any kerning and ligatures for text drawing on screen.");
3141 case RC_INDEX_COMMAND:
3142 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\".");
3145 case RC_JINDEX_COMMAND:
3146 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3149 case RC_NOMENCL_COMMAND:
3150 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3157 case RC_KBMAP_PRIMARY:
3158 case RC_KBMAP_SECONDARY:
3159 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.");
3162 case RC_LANGUAGE_AUTO_BEGIN:
3163 str = _("Select if a language switching command is needed at the beginning of the document.");
3166 case RC_LANGUAGE_AUTO_END:
3167 str = _("Select if a language switching command is needed at the end of the document.");
3170 case RC_LANGUAGE_COMMAND_BEGIN:
3171 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.");
3174 case RC_LANGUAGE_COMMAND_END:
3175 str = _("The LaTeX command for changing back to the language of the document.");
3178 case RC_LANGUAGE_COMMAND_LOCAL:
3179 str = _("The LaTeX command for local changing of the language.");
3182 case RC_LANGUAGE_GLOBAL_OPTIONS:
3183 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3186 case RC_LANGUAGE_CUSTOM_PACKAGE:
3187 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3190 case RC_LANGUAGE_PACKAGE_SELECTION:
3191 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3194 case RC_USELASTFILEPOS:
3195 str = _("De-select if you do not want LyX to scroll to saved position.");
3198 case RC_LOADSESSION:
3199 str = _("De-select to prevent loading files opened from the last LyX session.");
3202 case RC_MAKE_BACKUP:
3203 str = _("De-select if you don't want LyX to create backup files.");
3206 case RC_MARK_FOREIGN_LANGUAGE:
3207 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3210 case RC_MOUSE_WHEEL_SPEED:
3211 str = bformat(_("The scrolling speed of the mouse wheel."),
3215 case RC_COMPLETION_POPUP_DELAY:
3216 str = _("The completion popup delay.");
3219 case RC_COMPLETION_POPUP_MATH:
3220 str = _("Select to display the completion popup in math mode.");
3223 case RC_COMPLETION_POPUP_TEXT:
3224 str = _("Select to display the completion popup in text mode.");
3227 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3228 str = _("Show the completion popup without delay after non-unique completion attempt.");
3231 case RC_COMPLETION_POPUP_TEXT:
3232 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3235 case RC_COMPLETION_POPUP_DELAY:
3236 str = _("The inline completion delay.");
3239 case RC_COMPLETION_INLINE_MATH:
3240 str = _("Select to display the inline completion in math mode.");
3243 case RC_COMPLETION_INLINE_TEXT:
3244 str = _("Select to display the inline completion in text mode.");
3247 case RC_COMPLETION_INLINE_DOTS:
3248 str = _("Use \"...\" to shorten long completions.");
3251 case RC_AUTOCORRECTION_MATH:
3252 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3255 case RC_NUMLASTFILES:
3256 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3260 case RC_PATH_PREFIX:
3261 str = _("Specify those directories which should be "
3262 "prepended to the PATH environment variable.\n"
3263 "Use the OS native format.");
3267 str = _("Shows a typeset preview of things such as math");
3270 case RC_PREVIEW_HASHED_LABELS:
3271 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3274 case RC_PREVIEW_SCALE_FACTOR:
3275 str = _("Scale the preview size to suit.");
3278 case RC_PRINTCOLLCOPIESFLAG:
3279 str = _("The option for specifying whether the copies should be collated.");
3282 case RC_PRINTCOPIESFLAG:
3283 str = _("The option for specifying the number of copies to print.");
3287 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3290 case RC_PRINTEVENPAGEFLAG:
3291 str = _("The option to print only even pages.");
3294 case RC_PRINTEXSTRAOPTIONS:
3295 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3298 case RC_PRINTFILEEXTENSION:
3299 str = _("Extension of printer program output file. Usually \".ps\".");
3302 case RC_PRINTLANDSCAPEFLAG:
3303 str = _("The option to print out in landscape.");
3306 case RC_PRINTODDPAGEFLAG:
3307 str = _("The option to print only odd pages.");
3310 case RC_PRINTPAGERANGEFLAG:
3311 str = _("The option for specifying a comma-separated list of pages to print.");
3314 case RC_PRINTPAPERDIMENSIONFLAG:
3315 str = _("Option to specify the dimensions of the print paper.");
3318 case RC_PRINTPAPERFLAG:
3319 str = _("The option to specify paper type.");
3322 case RC_PRINTREVERSEFLAG:
3323 str = _("The option to reverse the order of the pages printed.");
3326 case RC_PRINTSPOOL_COMMAND:
3327 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.");
3330 case RC_PRINTSPOOL_PRINTERPREFIX:
3331 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.");
3334 case RC_PRINTTOFILE:
3335 str = _("Option to pass to the print program to print to a file.");
3338 case RC_PRINTTOPRINTER:
3339 str = _("Option to pass to the print program to print on a specific printer.");
3342 case RC_PRINT_ADAPTOUTPUT:
3343 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3346 case RC_PRINT_COMMAND:
3347 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3350 case RC_RTL_SUPPORT:
3351 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3354 case RC_VISUAL_CURSOR:
3355 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3359 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3362 case RC_SCREEN_FONT_ROMAN:
3363 case RC_SCREEN_FONT_SANS:
3364 case RC_SCREEN_FONT_TYPEWRITER:
3365 str = _("The screen fonts used to display the text while editing.");
3368 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3369 case RC_SCREEN_FONT_SANS_FOUNDRY:
3370 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3373 case RC_SCREEN_FONT_SCALABLE:
3374 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.");
3377 case RC_SCREEN_FONT_SIZES:
3378 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3381 case RC_SCREEN_ZOOM:
3382 //xgettext:no-c-format
3383 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3386 case RC_GEOMETRY_SESSION:
3387 str = _("Allow session manager to save and restore windows geometry.");
3391 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3397 case RC_SHOW_BANNER:
3398 str = _("De-select if you don't want the startup banner.");
3401 case RC_TEMPDIRPATH:
3402 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3405 case RC_THESAURUSDIRPATH:
3406 str = _("This is the place where the files of the thesaurus library reside.");
3409 case RC_TEMPLATEPATH:
3410 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3413 case RC_TEX_ALLOWS_SPACES:
3416 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3419 case RC_TEXINPUTS_PREFIX:
3420 str = _("Specify those directories which should be "
3421 "prepended to the TEXINPUTS environment variable.\n"
3422 "A '.' represents the current document directory. "
3423 "Use the OS native format.");
3427 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3436 case RC_USE_USE_SYSTEM_COLORS:
3437 str = _("Enable use the system colors for some things like main window background and selection.");
3440 case RC_USE_TOOLTIP:
3441 str = _("Enable the automatic appearance of tool tips in the work area.");
3444 case RC_USE_PIXMAP_CACHE:
3445 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3448 case RC_VIEWDVI_PAPEROPTION:
3449 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3464 // The global instance
3467 // The global copy of the system lyxrc entries (everything except preferences)