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"
31 #include "graphics/GraphicsTypes.h"
33 #include "support/convert.h"
34 #include "support/debug.h"
35 #include "support/environment.h"
36 #include "support/FileName.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/Package.h"
42 #include "support/userinfo.h"
49 using namespace lyx::support;
53 namespace os = support::os;
57 static unsigned int const LYXRC_FILEFORMAT = 1;
59 // when adding something to this array keep it sorted!
60 LexerKeyword lyxrcTags[] = {
61 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
62 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
63 { "\\alternate_language", LyXRC::RC_ALT_LANG },
64 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
65 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
66 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
67 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
68 { "\\autosave", LyXRC::RC_AUTOSAVE },
69 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
70 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
71 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
72 { "\\bind_file", LyXRC::RC_BINDFILE },
73 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
74 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
75 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
76 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
77 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
78 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
79 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
80 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
81 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
82 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
83 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
84 { "\\converter", LyXRC::RC_CONVERTER },
85 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
86 { "\\copier", LyXRC::RC_COPIER },
87 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
88 { "\\cursor_width", LyXRC::RC_CURSOR_WIDTH },
89 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
90 { "\\def_file", LyXRC::RC_DEFFILE },
91 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
92 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
93 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
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_papersize = PAPER_DEFAULT;
253 default_view_format = "pdf2";
254 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
255 bibtex_command = "bibtex";
257 index_command = "makeindex -c -q";
258 nomencl_command = "makeindex -s nomencl.ist";
260 // Because a screen is typically wider than a piece of paper:
262 allow_geometry_session = true;
263 // Default LaTeX font size:
264 font_sizes[FONT_SIZE_TINY] = "5.0";
265 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
266 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
267 font_sizes[FONT_SIZE_SMALL] = "9.0";
268 font_sizes[FONT_SIZE_NORMAL] = "10.0";
269 font_sizes[FONT_SIZE_LARGE] = "12.0";
270 font_sizes[FONT_SIZE_LARGER] = "14.4";
271 font_sizes[FONT_SIZE_LARGEST] = "17.26";
272 font_sizes[FONT_SIZE_HUGE] = "20.74";
273 font_sizes[FONT_SIZE_HUGER] = "24.88";
274 use_scalable_fonts = true;
275 roman_font_name = "";
277 typewriter_font_name = "";
279 auto_region_delete = true;
280 auto_reset_options = false;
281 plaintext_linelen = 65;
282 mouse_wheel_speed = 1.0;
283 num_lastfiles = maxlastfiles;
284 check_lastfiles = true;
285 use_lastfilepos = true;
286 load_session = false;
288 save_compressed = false;
289 backupdir_path.erase();
290 display_graphics = true;
291 // Spellchecker settings:
292 // FIXME: this check should test the target platform (darwin)
293 #if defined(USE_MACOSX_PACKAGING)
294 spellchecker = "native";
295 #elif defined(USE_ASPELL)
296 spellchecker = "aspell";
297 #elif defined(USE_HUNSPELL)
298 spellchecker = "hunspell";
300 spellchecker = "aspell";
302 spellchecker_accept_compound = false;
303 spellcheck_continuously = false;
304 spellcheck_notes = true;
307 visual_cursor = false;
309 mark_foreign_language = true;
310 language_auto_begin = true;
311 language_auto_end = true;
312 language_global_options = true;
313 language_package_selection = LP_AUTO;
314 language_custom_package = "\\usepackage{babel}";
315 language_command_begin = "\\selectlanguage{$$lang}";
316 language_command_local = "\\foreignlanguage{$$lang}{";
317 sort_layouts = false;
318 group_layouts = true;
319 default_language = "english";
320 gui_language = "auto";
322 windows_style_tex_paths = false;
323 tex_allows_spaces = false;
324 date_insert_format = "%x";
325 cursor_follows_scrollbar = false;
326 scroll_below_document = false;
327 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
328 paragraph_markers = false;
329 mac_dontswap_ctrl_meta = false;
330 mac_like_word_movement = false;
331 macro_edit_style = MACRO_EDIT_INLINE_BOX;
332 dialogs_iconify_with_main = false;
333 preview = PREVIEW_OFF;
334 preview_hashed_labels = false;
335 preview_scale_factor = 1.0;
336 use_converter_cache = true;
337 use_system_colors = false;
339 use_pixmap_cache = false;
340 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
341 user_name = to_utf8(support::user_name());
342 user_email = to_utf8(support::user_email());
343 open_buffers_in_tabs = true;
344 single_close_tab_button = false;
345 single_instance = true;
346 forward_search_dvi = string();
347 forward_search_pdf = string();
348 export_overwrite = NO_FILES;
350 // Fullscreen settings
351 full_screen_limit = false;
352 full_screen_toolbars = true;
353 full_screen_tabbar = true;
354 full_screen_menubar = true;
355 full_screen_scrollbar = true;
356 full_screen_width = 700;
358 completion_cursor_text = true;
359 completion_popup_math = true;
360 completion_popup_text = false;
361 completion_popup_delay = 2.0;
362 completion_popup_after_complete = true;
363 autocorrection_math = false;
364 completion_inline_math = true;
365 completion_inline_text = false;
366 completion_inline_dots = -1;
367 completion_inline_delay = 0.2;
368 default_decimal_point = ".";
375 void oldFontFormat(string & family, string & foundry)
377 if (family.empty() || family[0] != '-')
379 foundry = token(family, '-', 1);
380 family = token(family, '-', 2);
388 bool LyXRC::read(FileName const & filename, bool check_format)
390 Lexer lexrc(lyxrcTags);
391 lexrc.setFile(filename);
392 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
393 ReturnValues retval = read(lexrc, check_format);
394 if (!check_format || retval != FormatMismatch)
395 return retval == ReadOK;
397 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
398 FileName const tempfile = FileName::tempName("convert_lyxrc");
399 bool const success = prefs2prefs(filename, tempfile, false);
401 LYXERR0 ("Unable to convert " << filename.absFileName() <<
402 " to format " << LYXRC_FILEFORMAT);
405 Lexer lexrc2(lyxrcTags);
406 lexrc2.setFile(tempfile);
407 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
408 retval = read(lexrc2, check_format);
409 tempfile.removeFile();
410 return retval == ReadOK;
414 // don't need to worry about conversion, because this is always
415 // from an internal source
416 bool LyXRC::read(istream & is)
418 Lexer lexrc(lyxrcTags);
420 LYXERR(Debug::LYXRC, "Reading istream...");
421 return read(lexrc, false) == ReadOK;
425 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
427 if (lyxerr.debugging(Debug::PARSER))
428 lexrc.printTable(lyxerr);
433 // default for current rowpainter capabilities
434 force_paint_single_char = true;
436 // format prior to 2.0 and introduction of format tag
437 unsigned int format = 0;
439 while (lexrc.isOK()) {
440 // By using two switches we take advantage of the compiler
441 // telling us if we have missed a LyXRCTags element in
442 // the second switch.
443 // Note that this also shows a problem with Lexer since it
444 // helps us avoid taking advantage of the strictness of the
447 int le = lexrc.lex();
449 case Lexer::LEX_UNDEF:
450 lexrc.printError("Unknown tag `$$Token'");
452 case Lexer::LEX_FEOF:
457 switch (static_cast<LyXRCTags>(le)) {
460 format = lexrc.getInteger();
462 case RC_INPUT: // Include file
465 libFileSearch(string(),
467 if (read(tmp, check_format)) {
469 "Error reading included file: " + tmp.absFileName());
475 bind_file = os::internal_path(lexrc.getString());
480 def_file = os::internal_path(lexrc.getString());
485 ui_file = os::internal_path(lexrc.getString());
488 case RC_AUTORESET_OPTIONS:
489 lexrc >> auto_reset_options;
492 case RC_DISPLAY_GRAPHICS:
494 display_graphics = lexrc.getString() == "true";
497 case RC_TEX_EXPECTS_WINDOWS_PATHS:
498 lexrc >> windows_style_tex_paths;
501 case RC_TEX_ALLOWS_SPACES:
502 lexrc >> tex_allows_spaces;
505 case RC_TEXINPUTS_PREFIX:
506 lexrc >> texinputs_prefix;
513 case RC_KBMAP_PRIMARY:
515 string const kmap(os::internal_path(lexrc.getString()));
516 if (!libFileSearch("kbd", kmap, "kmap").empty()
518 primary_kbmap = kmap;
520 lexrc.printError("LyX: Keymap `$$Token' not found");
525 case RC_KBMAP_SECONDARY:
527 string const kmap(os::internal_path(lexrc.getString()));
528 if (!libFileSearch("kbd", kmap, "kmap").empty()
530 secondary_kbmap = kmap;
532 lexrc.printError("LyX: Keymap `$$Token' not found");
537 case RC_FONT_ENCODING:
541 case RC_FORCE_PAINT_SINGLE_CHAR:
542 lexrc >> force_paint_single_char;
549 case RC_PRINT_COMMAND:
550 if (lexrc.next(true)) {
551 print_command = lexrc.getString();
555 case RC_PRINTEVENPAGEFLAG:
556 lexrc >> print_evenpage_flag;
559 case RC_PRINTODDPAGEFLAG:
560 lexrc >> print_oddpage_flag;
563 case RC_PRINTPAGERANGEFLAG:
564 lexrc >> print_pagerange_flag;
567 case RC_PRINTCOPIESFLAG:
568 lexrc >> print_copies_flag;
571 case RC_PRINTCOLLCOPIESFLAG:
572 lexrc >> print_collcopies_flag;
575 case RC_PRINTREVERSEFLAG:
576 lexrc >> print_reverse_flag;
579 case RC_PRINTLANDSCAPEFLAG:
580 lexrc >> print_landscape_flag;
583 case RC_PRINTTOPRINTER:
584 lexrc >> print_to_printer;
587 case RC_PRINT_ADAPTOUTPUT:
588 lexrc >> print_adapt_output;
593 print_to_file = os::internal_path(lexrc.getString());
597 case RC_PRINTFILEEXTENSION:
598 lexrc >> print_file_extension;
601 case RC_PRINTEXSTRAOPTIONS:
602 lexrc >> print_extra_options;
605 case RC_PRINTSPOOL_COMMAND:
606 if (lexrc.next(true)) {
607 print_spool_command = lexrc.getString();
611 case RC_PRINTSPOOL_PRINTERPREFIX:
612 lexrc >> print_spool_printerprefix;
615 case RC_PRINTPAPERDIMENSIONFLAG:
616 lexrc >> print_paper_dimension_flag;
619 case RC_PRINTPAPERFLAG:
620 lexrc >> print_paper_flag;
623 case RC_DEFAULT_PAPERSIZE:
625 string const size = ascii_lowercase(lexrc.getString());
626 if (size == "usletter")
627 default_papersize = PAPER_USLETTER;
628 else if (size == "legal")
629 default_papersize = PAPER_USLEGAL;
630 else if (size == "executive")
631 default_papersize = PAPER_USEXECUTIVE;
632 else if (size == "a3")
633 default_papersize = PAPER_A3;
634 else if (size == "a4")
635 default_papersize = PAPER_A4;
636 else if (size == "a5")
637 default_papersize = PAPER_A5;
638 else if (size == "b5")
639 default_papersize = PAPER_B5;
640 else if (size == "default")
641 default_papersize = PAPER_DEFAULT;
645 case RC_VIEWDVI_PAPEROPTION:
647 view_dvi_paper_option = lexrc.getString();
649 view_dvi_paper_option.erase();
652 case RC_CHKTEX_COMMAND:
653 if (lexrc.next(true)) {
654 chktex_command = lexrc.getString();
658 case RC_BIBTEX_ALTERNATIVES:
659 if (lexrc.next(true)) {
660 bibtex_alternatives.insert(lexrc.getString());
664 case RC_BIBTEX_COMMAND:
665 if (lexrc.next(true)) {
666 bibtex_command = lexrc.getString();
670 case RC_JBIBTEX_COMMAND:
671 if (lexrc.next(true)) {
672 jbibtex_command = lexrc.getString();
676 case RC_INDEX_ALTERNATIVES:
677 if (lexrc.next(true)) {
678 index_alternatives.insert(lexrc.getString());
682 case RC_INDEX_COMMAND:
683 if (lexrc.next(true)) {
684 index_command = lexrc.getString();
688 case RC_JINDEX_COMMAND:
689 if (lexrc.next(true)) {
690 jindex_command = lexrc.getString();
694 case RC_SPLITINDEX_COMMAND:
695 if (lexrc.next(true)) {
696 splitindex_command = lexrc.getString();
700 case RC_NOMENCL_COMMAND:
701 if (lexrc.next(true)) {
702 nomencl_command = lexrc.getString();
714 case RC_GEOMETRY_SESSION:
715 lexrc >> allow_geometry_session;
718 case RC_SCREEN_FONT_SIZES:
719 lexrc >> font_sizes[FONT_SIZE_TINY];
720 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
721 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
722 lexrc >> font_sizes[FONT_SIZE_SMALL];
723 lexrc >> font_sizes[FONT_SIZE_NORMAL];
724 lexrc >> font_sizes[FONT_SIZE_LARGE];
725 lexrc >> font_sizes[FONT_SIZE_LARGER];
726 lexrc >> font_sizes[FONT_SIZE_LARGEST];
727 lexrc >> font_sizes[FONT_SIZE_HUGE];
728 lexrc >> font_sizes[FONT_SIZE_HUGER];
731 case RC_SCREEN_FONT_SCALABLE:
732 lexrc >> use_scalable_fonts;
739 case RC_DOCUMENTPATH:
741 document_path = os::internal_path(lexrc.getString());
742 document_path = expandPath(document_path);
748 example_path = os::internal_path(lexrc.getString());
749 example_path = expandPath(example_path);
753 case RC_TEMPLATEPATH:
755 template_path = os::internal_path(lexrc.getString());
756 template_path = expandPath(template_path);
762 tempdir_path = os::internal_path(lexrc.getString());
763 tempdir_path = expandPath(tempdir_path);
767 case RC_THESAURUSDIRPATH:
769 thesaurusdir_path = os::internal_path(lexrc.getString());
770 thesaurusdir_path = expandPath(thesaurusdir_path);
774 case RC_HUNSPELLDIR_PATH:
776 hunspelldir_path = os::internal_path(lexrc.getString());
777 hunspelldir_path = expandPath(hunspelldir_path);
781 case RC_USELASTFILEPOS:
782 lexrc >> use_lastfilepos;
786 lexrc >> load_session;
789 case RC_MOUSE_WHEEL_SPEED:
790 lexrc >> mouse_wheel_speed;
793 case RC_COMPLETION_INLINE_DELAY:
794 lexrc >> completion_inline_delay;
797 case RC_COMPLETION_INLINE_MATH:
798 lexrc >> completion_inline_math;
801 case RC_COMPLETION_INLINE_TEXT:
802 lexrc >> completion_inline_text;
805 case RC_COMPLETION_INLINE_DOTS:
806 lexrc >> completion_inline_dots;
809 case RC_AUTOCORRECTION_MATH:
810 lexrc >> autocorrection_math;
813 case RC_COMPLETION_POPUP_DELAY:
814 lexrc >> completion_popup_delay;
817 case RC_COMPLETION_POPUP_MATH:
818 lexrc >> completion_popup_math;
821 case RC_COMPLETION_POPUP_TEXT:
822 lexrc >> completion_popup_text;
825 case RC_COMPLETION_CURSOR_TEXT:
826 lexrc >> completion_cursor_text;
829 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
830 lexrc >> completion_popup_after_complete;
833 case RC_NUMLASTFILES:
834 lexrc >> num_lastfiles;
837 case RC_CHECKLASTFILES:
838 lexrc >> check_lastfiles;
845 case RC_SCREEN_FONT_ROMAN:
847 roman_font_name = lexrc.getString();
848 oldFontFormat(roman_font_name,
853 case RC_SCREEN_FONT_SANS:
855 sans_font_name = lexrc.getString();
856 oldFontFormat(sans_font_name, sans_font_foundry);
860 case RC_SCREEN_FONT_TYPEWRITER:
862 typewriter_font_name = lexrc.getString();
863 oldFontFormat(typewriter_font_name,
864 typewriter_font_foundry);
868 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
869 lexrc >> roman_font_foundry;
872 case RC_SCREEN_FONT_SANS_FOUNDRY:
873 lexrc >> sans_font_foundry;
876 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
877 lexrc >> typewriter_font_foundry;
882 lexrc.printError("Missing color tag.");
885 string lyx_name = lexrc.getString();
888 lexrc.printError("Missing color name for color: `$$Token'");
891 string x11_name = lexrc.getString();
893 ColorCode const col =
894 lcolor.getFromLyXName(lyx_name);
895 if (col == Color_none ||
896 col == Color_inherit ||
900 if (!lcolor.setColor(col, x11_name))
901 LYXERR0("Bad lyxrc set_color for " << lyx_name);
905 case RC_AUTOREGIONDELETE:
906 // Auto region delete defaults to true
907 lexrc >> auto_region_delete;
912 lyxpipes = os::internal_path(lexrc.getString());
913 lyxpipes = expandPath(lyxpipes);
917 case RC_CURSOR_FOLLOWS_SCROLLBAR:
918 lexrc >> cursor_follows_scrollbar;
921 case RC_CURSOR_WIDTH:
922 lexrc >> cursor_width;
925 case RC_SCROLL_BELOW_DOCUMENT:
926 lexrc >> scroll_below_document;
929 case RC_PARAGRAPH_MARKERS:
930 lexrc >> paragraph_markers;
933 case RC_MAC_DONTSWAP_CTRL_META:
934 lexrc >> mac_dontswap_ctrl_meta;
937 case RC_MAC_LIKE_WORD_MOVEMENT:
938 lexrc >> mac_like_word_movement;
941 case RC_MACRO_EDIT_STYLE:
943 switch (lexrc.getInteger()) {
944 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
945 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
946 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
951 case RC_DIALOGS_ICONIFY_WITH_MAIN:
952 lexrc >> dialogs_iconify_with_main;
955 case RC_PLAINTEXT_LINELEN:
956 lexrc >> plaintext_linelen;
958 // Spellchecker settings:
959 case RC_ACCEPT_COMPOUND:
960 lexrc >> spellchecker_accept_compound;
962 case RC_USE_SYSTEM_COLORS:
963 lexrc >> use_system_colors;
966 lexrc >> use_tooltip;
968 case RC_USE_PIXMAP_CACHE:
969 lexrc >> use_pixmap_cache;
971 case RC_SPELLCHECKER:
972 lexrc >> spellchecker;
975 lexrc >> spellchecker_alt_lang;
978 lexrc >> spellchecker_esc_chars;
980 case RC_SPELLCHECK_CONTINUOUSLY:
981 lexrc >> spellcheck_continuously;
983 case RC_SPELLCHECK_NOTES:
984 lexrc >> spellcheck_notes;
987 lexrc >> make_backup;
989 case RC_SAVE_COMPRESSED:
990 lexrc >> save_compressed;
992 case RC_BACKUPDIR_PATH:
994 backupdir_path = os::internal_path(lexrc.getString());
995 backupdir_path = expandPath(backupdir_path);
998 case RC_DEFAULT_DECIMAL_POINT:
999 lexrc >> default_decimal_point;
1001 case RC_DATE_INSERT_FORMAT:
1002 lexrc >> date_insert_format;
1004 case RC_LANGUAGE_CUSTOM_PACKAGE:
1005 lexrc >> language_custom_package;
1007 case RC_LANGUAGE_AUTO_BEGIN:
1008 lexrc >> language_auto_begin;
1010 case RC_LANGUAGE_AUTO_END:
1011 lexrc >> language_auto_end;
1013 case RC_LANGUAGE_GLOBAL_OPTIONS:
1014 lexrc >> language_global_options;
1016 case RC_LANGUAGE_PACKAGE_SELECTION:
1018 switch (lexrc.getInteger()) {
1020 language_package_selection = LP_AUTO;
1023 language_package_selection = LP_BABEL;
1026 language_package_selection = LP_CUSTOM;
1029 language_package_selection = LP_NONE;
1034 case RC_LANGUAGE_COMMAND_BEGIN:
1035 lexrc >> language_command_begin;
1037 case RC_LANGUAGE_COMMAND_END:
1038 lexrc >> language_command_end;
1040 case RC_LANGUAGE_COMMAND_LOCAL:
1041 lexrc >> language_command_local;
1043 case RC_RTL_SUPPORT:
1044 lexrc >> rtl_support;
1046 case RC_VISUAL_CURSOR:
1047 lexrc >> visual_cursor;
1049 case RC_AUTO_NUMBER:
1050 lexrc >> auto_number;
1052 case RC_MARK_FOREIGN_LANGUAGE:
1053 lexrc >> mark_foreign_language;
1057 string fmt, command;
1059 fmt = lexrc.getString();
1060 if (lexrc.next(true))
1061 command = lexrc.getString();
1062 setMover(fmt, command);
1066 case RC_CONVERTER: {
1067 string from, to, command, flags;
1069 from = lexrc.getString();
1071 to = lexrc.getString();
1072 if (lexrc.next(true))
1073 command = lexrc.getString();
1075 flags = lexrc.getString();
1076 if (command.empty())
1077 theConverters().erase(from, to);
1079 theConverters().add(from, to, command, flags);
1082 // compatibility with versions older than 1.4.0 only
1084 string format, command;
1085 lexrc >> format >> command;
1086 formats.setViewer(format, command);
1089 case RC_FILEFORMAT: {
1090 string format, extension, prettyname, shortcut;
1091 lexrc >> format >> extension >> prettyname >> shortcut;
1092 string viewer, editor;
1093 if (lexrc.next(true))
1094 viewer = lexrc.getString();
1095 if (lexrc.next(true))
1096 editor = lexrc.getString();
1098 // Hack to ensure compatibility with versions older
1100 int le = lexrc.lex();
1101 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1102 flags = lexrc.getString();
1103 if (le != Lexer::LEX_DATA) {
1104 // We have got a known token.
1105 // Therefore this is an old style
1106 // format definition without
1108 lexrc.pushToken(flags);
1112 int flgs = Format::none;
1113 while (!flags.empty()) {
1115 flags = split(flags, flag, ',');
1116 if (flag == "document")
1117 flgs |= Format::document;
1118 else if (flag == "vector")
1119 flgs |= Format::vector;
1120 else if (flag == "menu=export")
1121 flgs |= Format::export_menu;
1123 LYXERR0("Ignoring unknown flag `"
1124 << flag << "' for format `"
1127 if (prettyname.empty()) {
1128 if (theConverters().formatIsUsed(format))
1129 LYXERR0("Can't delete format " << format);
1131 formats.erase(format);
1133 formats.add(format, extension, prettyname,
1134 shortcut, viewer, editor, flgs);
1138 case RC_VIEWER_ALTERNATIVES: {
1139 string format, command;
1141 format = lexrc.getString();
1142 if (lexrc.eatLine())
1143 command = lexrc.getString();
1144 viewer_alternatives[format].insert(command);
1147 case RC_EDITOR_ALTERNATIVES: {
1148 string format, command;
1150 format = lexrc.getString();
1151 if (lexrc.eatLine())
1152 command = lexrc.getString();
1153 editor_alternatives[format].insert(command);
1157 case RC_DEFAULT_VIEW_FORMAT:
1158 lexrc >> default_view_format;
1161 case RC_DEFAULT_LANGUAGE:
1162 lexrc >> default_language;
1165 case RC_GUI_LANGUAGE:
1166 lexrc >> gui_language;
1169 case RC_SHOW_BANNER:
1170 lexrc >> show_banner;
1175 string const tmp = lexrc.getString();
1176 if (tmp == "true" || tmp == "on")
1177 preview = PREVIEW_ON;
1178 else if (tmp == "no_math")
1179 preview = PREVIEW_NO_MATH;
1181 preview = PREVIEW_OFF;
1182 if (tmp != "false" && tmp != "off")
1183 LYXERR0("Unrecognized preview status \""
1189 case RC_PREVIEW_HASHED_LABELS:
1190 lexrc >> preview_hashed_labels;
1193 case RC_PREVIEW_SCALE_FACTOR:
1194 lexrc >> preview_scale_factor;
1201 lexrc >> user_email;
1204 case RC_PATH_PREFIX:
1205 lexrc >> path_prefix;
1208 case RC_USE_CONVERTER_CACHE:
1209 lexrc >> use_converter_cache;
1211 case RC_CONVERTER_CACHE_MAXAGE:
1212 lexrc >> converter_cache_maxage;
1215 case RC_SORT_LAYOUTS:
1216 lexrc >> sort_layouts;
1218 case RC_GROUP_LAYOUTS:
1219 lexrc >> group_layouts;
1221 case RC_FULL_SCREEN_LIMIT:
1222 lexrc >> full_screen_limit;
1224 case RC_FULL_SCREEN_TOOLBARS:
1225 lexrc >> full_screen_toolbars;
1227 case RC_FULL_SCREEN_SCROLLBAR:
1228 lexrc >> full_screen_scrollbar;
1230 case RC_FULL_SCREEN_TABBAR:
1231 lexrc >> full_screen_tabbar;
1233 case RC_FULL_SCREEN_MENUBAR:
1234 lexrc >> full_screen_menubar;
1236 case RC_FULL_SCREEN_WIDTH:
1237 lexrc >> full_screen_width;
1239 case RC_OPEN_BUFFERS_IN_TABS:
1240 lexrc >> open_buffers_in_tabs;
1242 case RC_SINGLE_CLOSE_TAB_BUTTON:
1243 lexrc >> single_close_tab_button;
1245 case RC_SINGLE_INSTANCE:
1246 lexrc >> single_instance;
1247 if (run_mode == PREFERRED)
1248 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1250 case RC_FORWARD_SEARCH_DVI:
1251 if (lexrc.next(true))
1252 forward_search_dvi = lexrc.getString();
1254 case RC_FORWARD_SEARCH_PDF:
1255 if (lexrc.next(true))
1256 forward_search_pdf = lexrc.getString();
1258 case RC_EXPORT_OVERWRITE:
1260 string const tmp = lexrc.getString();
1261 if (tmp == "all" || tmp == "true")
1262 export_overwrite = ALL_FILES;
1263 else if (tmp == "main")
1264 export_overwrite = MAIN_FILE;
1266 export_overwrite = NO_FILES;
1267 if (tmp != "ask" && tmp != "false")
1268 LYXERR0("Unrecognized export_overwrite status \""
1273 case RC_SCROLL_WHEEL_ZOOM:
1275 string const tmp = lexrc.getString();
1277 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1278 else if (tmp == "shift")
1279 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1280 else if (tmp == "alt")
1281 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1283 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1284 if (tmp != "off" && tmp != "false")
1285 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1292 break; // this is just a dummy
1295 // This is triggered the first time through the loop unless
1296 // we hit a format tag.
1297 if (check_format && format != LYXRC_FILEFORMAT)
1298 return FormatMismatch;
1301 /// Update converters data-structures
1302 theConverters().update(formats);
1303 theConverters().buildGraph();
1309 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1311 ofstream ofs(filename.toFilesystemEncoding().c_str());
1313 write(ofs, ignore_system_lyxrc);
1317 void LyXRC::print() const
1319 if (lyxerr.debugging())
1320 write(lyxerr, false);
1328 typedef pair<string, SpecialisedMover> Data;
1330 SameMover(Data const & comparison)
1331 : comparison_(comparison) {}
1333 bool operator()(Data const & data) const
1335 return data.first == comparison_.first &&
1336 data.second.command() == comparison_.second.command();
1346 // Escape \ and " so that LyXLex can read the string later
1347 string escapeCommand(string const & str) {
1348 return subst(subst(str , "\\", "\\\\"),
1355 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1357 LyXRCTags tag = RC_LAST;
1359 if (!name.empty()) {
1360 for (int i = 0; i != lyxrcCount; ++i)
1361 if ("\\" + name == lyxrcTags[i].tag)
1362 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1366 os << "# LyX " << lyx_version
1367 << " generated this file. If you want to make your own\n"
1368 << "# modifications you should do them from inside LyX and save.\n\n"
1369 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1371 // Why the switch you might ask. It is a trick to ensure that all
1372 // the elements in the LyXRCTags enum are handled. As you can see
1373 // there are no breaks at all. So it is just a huge fall-through.
1374 // The nice thing is that we will get a warning from the compiler
1375 // if we forget an element.
1379 // input/include files are not done here
1380 case RC_LYXRCFORMAT:
1382 if (ignore_system_lyxrc ||
1383 bind_file != system_lyxrc.bind_file) {
1384 string const path = os::external_path(bind_file);
1385 os << "\\bind_file \"" << path << "\"\n";
1391 if (ignore_system_lyxrc ||
1392 def_file != system_lyxrc.def_file) {
1393 string const path = os::external_path(def_file);
1394 os << "\\def_file \"" << path << "\"\n";
1403 << "# MISC SECTION ######################################\n"
1405 // bind files are not done here.
1407 case RC_PATH_PREFIX:
1408 if (ignore_system_lyxrc ||
1409 path_prefix != system_lyxrc.path_prefix) {
1410 os << "\\path_prefix \"" << path_prefix << "\"\n";
1415 if (ignore_system_lyxrc ||
1416 ui_file != system_lyxrc.ui_file) {
1417 string const path = os::external_path(ui_file);
1418 os << "\\ui_file \"" << path << "\"\n";
1422 case RC_AUTOREGIONDELETE:
1423 if (ignore_system_lyxrc ||
1424 auto_region_delete != system_lyxrc.auto_region_delete) {
1425 os << "# Set to false to inhibit automatic replacement of\n"
1426 << "# the current selection.\n"
1427 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1432 case RC_AUTORESET_OPTIONS:
1433 if (ignore_system_lyxrc ||
1434 auto_reset_options != system_lyxrc.auto_reset_options) {
1435 os << "# Set to false to inhibit automatic reset of\n"
1436 << "# the class options to defaults on class change.\n"
1437 << "\\auto_reset_options "
1438 << convert<string>(auto_reset_options)
1444 if (ignore_system_lyxrc ||
1445 autosave != system_lyxrc.autosave) {
1446 os << "# The time interval between auto-saves in seconds.\n"
1447 << "\\autosave " << autosave << '\n';
1451 case RC_DISPLAY_GRAPHICS:
1452 if (ignore_system_lyxrc ||
1453 display_graphics != system_lyxrc.display_graphics) {
1454 os << "# Display graphics within LyX\n"
1456 << "\\display_graphics "
1457 << (display_graphics ? "true" : "false")
1462 case RC_SORT_LAYOUTS:
1463 if (ignore_system_lyxrc ||
1464 sort_layouts != system_lyxrc.sort_layouts) {
1465 os << "# Sort layouts alphabetically.\n"
1466 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1470 case RC_GROUP_LAYOUTS:
1471 if (ignore_system_lyxrc ||
1472 group_layouts != system_lyxrc.group_layouts) {
1473 os << "# Group layouts by their category.\n"
1474 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1478 case RC_VIEWDVI_PAPEROPTION:
1479 if (ignore_system_lyxrc ||
1480 view_dvi_paper_option
1481 != system_lyxrc.view_dvi_paper_option) {
1482 os << "# Options used to specify paper size to the\n"
1483 << "# view_dvi_command (e.g. -paper)\n"
1484 << "\\view_dvi_paper_option \""
1485 << view_dvi_paper_option << "\"\n";
1489 case RC_DEFAULT_PAPERSIZE:
1490 if (ignore_system_lyxrc ||
1491 default_papersize != system_lyxrc.default_papersize) {
1492 os << "# The default papersize to use.\n"
1493 << "\\default_papersize \"";
1494 switch (default_papersize) {
1496 os << "default"; break;
1497 case PAPER_USLETTER:
1498 os << "usletter"; break;
1500 os << "legal"; break;
1501 case PAPER_USEXECUTIVE:
1502 os << "executive"; break;
1535 case PAPER_JISB6: break;
1541 case RC_CHKTEX_COMMAND:
1542 if (ignore_system_lyxrc ||
1543 chktex_command != system_lyxrc.chktex_command) {
1544 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1548 case RC_BIBTEX_ALTERNATIVES: {
1549 CommandSet::const_iterator it = bibtex_alternatives.begin();
1550 CommandSet::const_iterator end = bibtex_alternatives.end();
1551 for ( ; it != end; ++it) {
1552 if (ignore_system_lyxrc
1553 || !system_lyxrc.bibtex_alternatives.count(*it))
1554 os << "\\bibtex_alternatives \""
1560 case RC_BIBTEX_COMMAND:
1561 if (ignore_system_lyxrc ||
1562 bibtex_command != system_lyxrc.bibtex_command) {
1563 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1567 case RC_JBIBTEX_COMMAND:
1568 if (ignore_system_lyxrc ||
1569 jbibtex_command != system_lyxrc.jbibtex_command) {
1570 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1574 case RC_INDEX_ALTERNATIVES: {
1575 CommandSet::const_iterator it = index_alternatives.begin();
1576 CommandSet::const_iterator end = index_alternatives.end();
1577 for ( ; it != end; ++it) {
1578 if (ignore_system_lyxrc
1579 || !system_lyxrc.index_alternatives.count(*it))
1580 os << "\\index_alternatives \""
1586 case RC_INDEX_COMMAND:
1587 if (ignore_system_lyxrc ||
1588 index_command != system_lyxrc.index_command) {
1589 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1593 case RC_JINDEX_COMMAND:
1594 if (ignore_system_lyxrc ||
1595 jindex_command != system_lyxrc.jindex_command) {
1596 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1600 case RC_SPLITINDEX_COMMAND:
1601 if (ignore_system_lyxrc ||
1602 splitindex_command != system_lyxrc.splitindex_command) {
1603 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1607 case RC_NOMENCL_COMMAND:
1608 if (ignore_system_lyxrc ||
1609 nomencl_command != system_lyxrc.nomencl_command) {
1610 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1614 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1615 // Don't write this setting to the preferences file,
1616 // but allow temporary changes (bug 7557).
1617 if (ignore_system_lyxrc) {
1618 os << "\\tex_expects_windows_paths "
1619 << convert<string>(windows_style_tex_paths) << '\n';
1623 case RC_TEX_ALLOWS_SPACES:
1624 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1625 os << "\\tex_allows_spaces "
1626 << convert<string>(tex_allows_spaces) << '\n';
1631 if (ignore_system_lyxrc ||
1632 use_kbmap != system_lyxrc.use_kbmap) {
1633 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1637 case RC_KBMAP_PRIMARY:
1638 if (ignore_system_lyxrc ||
1639 primary_kbmap != system_lyxrc.primary_kbmap) {
1640 string const path = os::external_path(primary_kbmap);
1641 os << "\\kbmap_primary \"" << path << "\"\n";
1645 case RC_KBMAP_SECONDARY:
1646 if (ignore_system_lyxrc ||
1647 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1648 string const path = os::external_path(secondary_kbmap);
1649 os << "\\kbmap_secondary \"" << path << "\"\n";
1654 if (ignore_system_lyxrc ||
1655 lyxpipes != system_lyxrc.lyxpipes) {
1656 string const path = os::external_path(lyxpipes);
1657 os << "\\serverpipe \"" << path << "\"\n";
1661 case RC_DATE_INSERT_FORMAT:
1662 if (ignore_system_lyxrc ||
1663 date_insert_format != system_lyxrc.date_insert_format) {
1664 os << "\\date_insert_format \"" << date_insert_format
1671 os << "\\user_name \"" << user_name << "\"\n";
1676 os << "\\user_email \"" << user_email << "\"\n";
1680 case RC_SHOW_BANNER:
1681 if (ignore_system_lyxrc ||
1682 show_banner != system_lyxrc.show_banner) {
1683 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1689 if (ignore_system_lyxrc ||
1690 preview != system_lyxrc.preview) {
1696 case PREVIEW_NO_MATH:
1703 os << "\\preview " << status << '\n';
1708 case RC_PREVIEW_HASHED_LABELS:
1709 if (ignore_system_lyxrc ||
1710 preview_hashed_labels !=
1711 system_lyxrc.preview_hashed_labels) {
1712 os << "\\preview_hashed_labels "
1713 << convert<string>(preview_hashed_labels) << '\n';
1718 case RC_PREVIEW_SCALE_FACTOR:
1719 if (ignore_system_lyxrc ||
1720 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1721 os << "\\preview_scale_factor "
1722 << preview_scale_factor << '\n';
1727 case RC_USE_CONVERTER_CACHE:
1728 if (ignore_system_lyxrc ||
1729 use_converter_cache != system_lyxrc.use_converter_cache) {
1730 os << "\\use_converter_cache "
1731 << convert<string>(use_converter_cache) << '\n';
1736 case RC_CONVERTER_CACHE_MAXAGE:
1737 if (ignore_system_lyxrc ||
1738 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1739 os << "\\converter_cache_maxage "
1740 << converter_cache_maxage << '\n';
1746 << "# SCREEN & FONTS SECTION ############################\n"
1750 if (ignore_system_lyxrc ||
1751 icon_set != system_lyxrc.icon_set) {
1752 os << "\\icon_set \"" << icon_set
1759 if (ignore_system_lyxrc ||
1760 dpi != system_lyxrc.dpi) {
1761 os << "\\screen_dpi " << dpi << '\n';
1765 case RC_SCREEN_ZOOM:
1766 if (ignore_system_lyxrc ||
1767 zoom != system_lyxrc.zoom) {
1768 os << "\\screen_zoom " << zoom << '\n';
1772 case RC_GEOMETRY_SESSION:
1773 if (ignore_system_lyxrc ||
1774 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1775 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1780 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1781 if (ignore_system_lyxrc ||
1782 cursor_follows_scrollbar
1783 != system_lyxrc.cursor_follows_scrollbar) {
1784 os << "\\cursor_follows_scrollbar "
1785 << convert<string>(cursor_follows_scrollbar) << '\n';
1789 case RC_CURSOR_WIDTH:
1790 if (ignore_system_lyxrc ||
1792 != system_lyxrc.cursor_width) {
1793 os << "\\cursor_width "
1794 << cursor_width << '\n';
1798 case RC_SCROLL_BELOW_DOCUMENT:
1799 if (ignore_system_lyxrc ||
1800 scroll_below_document
1801 != system_lyxrc.scroll_below_document) {
1802 os << "\\scroll_below_document "
1803 << convert<string>(scroll_below_document) << '\n';
1807 case RC_PARAGRAPH_MARKERS:
1808 if (ignore_system_lyxrc ||
1810 != system_lyxrc.paragraph_markers) {
1811 os << "\\paragraph_markers "
1812 << convert<string>(paragraph_markers) << '\n';
1816 case RC_MAC_DONTSWAP_CTRL_META:
1817 if (ignore_system_lyxrc ||
1818 mac_dontswap_ctrl_meta
1819 != system_lyxrc.mac_dontswap_ctrl_meta) {
1820 os << "\\mac_dontswap_ctrl_meta "
1821 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1825 case RC_MAC_LIKE_WORD_MOVEMENT:
1826 if (ignore_system_lyxrc ||
1827 mac_like_word_movement
1828 != system_lyxrc.mac_like_word_movement) {
1829 os << "\\mac_like_word_movement "
1830 << convert<string>(mac_like_word_movement) << '\n';
1834 case RC_MACRO_EDIT_STYLE:
1835 if (ignore_system_lyxrc ||
1837 != system_lyxrc.macro_edit_style) {
1838 os << "\\macro_edit_style ";
1839 switch (macro_edit_style) {
1840 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1841 case MACRO_EDIT_INLINE: os << "1\n"; break;
1842 case MACRO_EDIT_LIST: os << "2\n"; break;
1847 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1848 if (ignore_system_lyxrc ||
1849 dialogs_iconify_with_main
1850 != system_lyxrc.dialogs_iconify_with_main) {
1851 os << "\\dialogs_iconify_with_main "
1852 << convert<string>(dialogs_iconify_with_main) << '\n';
1856 case RC_SCREEN_FONT_ROMAN:
1857 if (ignore_system_lyxrc ||
1858 roman_font_name != system_lyxrc.roman_font_name) {
1859 os << "\\screen_font_roman \"" << roman_font_name
1864 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1865 if (ignore_system_lyxrc ||
1866 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1867 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1872 case RC_SCREEN_FONT_SANS:
1873 if (ignore_system_lyxrc ||
1874 sans_font_name != system_lyxrc.sans_font_name) {
1875 os << "\\screen_font_sans \"" << sans_font_name
1880 case RC_SCREEN_FONT_SANS_FOUNDRY:
1881 if (ignore_system_lyxrc ||
1882 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1883 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1888 case RC_SCREEN_FONT_TYPEWRITER:
1889 if (ignore_system_lyxrc ||
1890 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1891 os << "\\screen_font_typewriter \""
1892 << typewriter_font_name << "\"\n";
1896 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1897 if (ignore_system_lyxrc ||
1898 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1899 os << "\\screen_font_typewriter_foundry \""
1900 << typewriter_font_foundry << "\"\n";
1905 case RC_SCREEN_FONT_SCALABLE:
1906 if (ignore_system_lyxrc ||
1907 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1908 os << "\\screen_font_scalable "
1909 << convert<string>(use_scalable_fonts)
1914 case RC_SCREEN_FONT_SIZES:
1915 if (ignore_system_lyxrc ||
1916 font_sizes[FONT_SIZE_TINY]
1917 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1918 font_sizes[FONT_SIZE_SCRIPT]
1919 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1920 font_sizes[FONT_SIZE_FOOTNOTE]
1921 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1922 font_sizes[FONT_SIZE_SMALL]
1923 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1924 font_sizes[FONT_SIZE_NORMAL]
1925 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1926 font_sizes[FONT_SIZE_LARGE]
1927 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1928 font_sizes[FONT_SIZE_LARGER]
1929 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1930 font_sizes[FONT_SIZE_LARGEST]
1931 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1932 font_sizes[FONT_SIZE_HUGE]
1933 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1934 font_sizes[FONT_SIZE_HUGER]
1935 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1936 os.setf(ios::fixed);
1938 os << "\\screen_font_sizes"
1939 << ' ' << font_sizes[FONT_SIZE_TINY]
1940 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1941 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1942 << ' ' << font_sizes[FONT_SIZE_SMALL]
1943 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1944 << ' ' << font_sizes[FONT_SIZE_LARGE]
1945 << ' ' << font_sizes[FONT_SIZE_LARGER]
1946 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1947 << ' ' << font_sizes[FONT_SIZE_HUGE]
1948 << ' ' << font_sizes[FONT_SIZE_HUGER]
1953 case RC_FULL_SCREEN_LIMIT:
1954 if (ignore_system_lyxrc ||
1955 full_screen_limit != system_lyxrc.full_screen_limit) {
1956 os << "\\fullscreen_limit "
1957 << convert<string>(full_screen_limit)
1962 case RC_FULL_SCREEN_TOOLBARS:
1963 if (ignore_system_lyxrc ||
1964 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1965 os << "\\fullscreen_toolbars "
1966 << convert<string>(full_screen_toolbars)
1971 case RC_FULL_SCREEN_SCROLLBAR:
1972 if (ignore_system_lyxrc ||
1973 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1974 os << "\\fullscreen_scrollbar "
1975 << convert<string>(full_screen_scrollbar)
1980 case RC_FULL_SCREEN_TABBAR:
1981 if (ignore_system_lyxrc ||
1982 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1983 os << "\\fullscreen_tabbar "
1984 << convert<string>(full_screen_tabbar)
1989 case RC_FULL_SCREEN_MENUBAR:
1990 if (ignore_system_lyxrc ||
1991 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1992 os << "\\fullscreen_menubar "
1993 << convert<string>(full_screen_menubar)
1998 case RC_FULL_SCREEN_WIDTH:
1999 if (ignore_system_lyxrc ||
2000 full_screen_width != system_lyxrc.full_screen_width) {
2001 os << "\\fullscreen_width "
2002 << convert<string>(full_screen_width)
2007 case RC_OPEN_BUFFERS_IN_TABS:
2008 if (ignore_system_lyxrc ||
2009 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2010 os << "\\open_buffers_in_tabs "
2011 << convert<string>(open_buffers_in_tabs)
2016 case RC_SINGLE_CLOSE_TAB_BUTTON:
2017 if (ignore_system_lyxrc ||
2018 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2019 os << "\\single_close_tab_button "
2020 << convert<string>(single_close_tab_button)
2025 case RC_SINGLE_INSTANCE:
2026 if (ignore_system_lyxrc ||
2027 single_instance != system_lyxrc.single_instance) {
2028 os << "\\single_instance "
2029 << convert<string>(single_instance)
2034 case RC_FORWARD_SEARCH_DVI:
2035 if (ignore_system_lyxrc ||
2036 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2037 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2041 case RC_FORWARD_SEARCH_PDF:
2042 if (ignore_system_lyxrc ||
2043 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2044 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2050 << "# COLOR SECTION ###################################\n"
2054 for (int i = 0; i < Color_ignore; ++i) {
2055 ColorCode lc = static_cast<ColorCode>(i);
2056 string const col = lcolor.getX11Name(lc);
2057 if (ignore_system_lyxrc
2058 || col != system_lcolor.getX11Name(lc)) {
2059 os << "\\set_color \""
2060 << lcolor.getLyXName(lc) << "\" \""
2068 << "# PRINTER SECTION ###################################\n"
2072 if (ignore_system_lyxrc ||
2073 printer != system_lyxrc.printer) {
2074 os << "\\printer \"" << printer << "\"\n";
2078 case RC_PRINT_ADAPTOUTPUT:
2079 if (ignore_system_lyxrc ||
2080 print_adapt_output != system_lyxrc.print_adapt_output) {
2081 os << "\\print_adapt_output "
2082 << convert<string>(print_adapt_output)
2087 case RC_PRINT_COMMAND:
2088 if (ignore_system_lyxrc ||
2089 print_command != system_lyxrc.print_command) {
2090 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2094 case RC_PRINTEXSTRAOPTIONS:
2095 if (ignore_system_lyxrc ||
2096 print_extra_options != system_lyxrc.print_extra_options) {
2097 os << "\\print_extra_options \"" << print_extra_options
2102 case RC_PRINTSPOOL_COMMAND:
2103 if (ignore_system_lyxrc ||
2104 print_spool_command != system_lyxrc.print_spool_command) {
2105 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2110 case RC_PRINTSPOOL_PRINTERPREFIX:
2111 if (ignore_system_lyxrc ||
2112 print_spool_printerprefix
2113 != system_lyxrc.print_spool_printerprefix) {
2114 os << "\\print_spool_printerprefix \""
2115 << print_spool_printerprefix << "\"\n";
2119 case RC_PRINTEVENPAGEFLAG:
2120 if (ignore_system_lyxrc ||
2121 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2122 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2127 case RC_PRINTODDPAGEFLAG:
2128 if (ignore_system_lyxrc ||
2129 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2130 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2135 case RC_PRINTREVERSEFLAG:
2136 if (ignore_system_lyxrc ||
2137 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2138 os << "\\print_reverse_flag \"" << print_reverse_flag
2143 case RC_PRINTLANDSCAPEFLAG:
2144 if (ignore_system_lyxrc ||
2145 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2146 os << "\\print_landscape_flag \"" << print_landscape_flag
2151 case RC_PRINTPAGERANGEFLAG:
2152 if (ignore_system_lyxrc ||
2153 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2154 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2159 case RC_PRINTCOPIESFLAG:
2160 if (ignore_system_lyxrc ||
2161 print_copies_flag != system_lyxrc.print_copies_flag) {
2162 os << "\\print_copies_flag \"" << print_copies_flag
2167 case RC_PRINTCOLLCOPIESFLAG:
2168 if (ignore_system_lyxrc ||
2169 print_collcopies_flag
2170 != system_lyxrc.print_collcopies_flag) {
2171 os << "\\print_collcopies_flag \""
2172 << print_collcopies_flag
2177 case RC_PRINTPAPERFLAG:
2178 if (ignore_system_lyxrc ||
2179 print_paper_flag != system_lyxrc.print_paper_flag) {
2180 os << "\\print_paper_flag \"" << print_paper_flag
2185 case RC_PRINTPAPERDIMENSIONFLAG:
2186 if (ignore_system_lyxrc ||
2187 print_paper_dimension_flag
2188 != system_lyxrc.print_paper_dimension_flag) {
2189 os << "\\print_paper_dimension_flag \""
2190 << print_paper_dimension_flag << "\"\n";
2194 case RC_PRINTTOPRINTER:
2195 if (ignore_system_lyxrc ||
2196 print_to_printer != system_lyxrc.print_to_printer) {
2197 os << "\\print_to_printer \"" << print_to_printer
2202 case RC_PRINTTOFILE:
2203 if (ignore_system_lyxrc ||
2204 print_to_file != system_lyxrc.print_to_file) {
2205 string const path = os::external_path(print_to_file);
2206 os << "\\print_to_file \"" << path << "\"\n";
2210 case RC_PRINTFILEEXTENSION:
2211 if (ignore_system_lyxrc ||
2212 print_file_extension != system_lyxrc.print_file_extension) {
2213 os << "\\print_file_extension \""
2214 << print_file_extension
2221 << "# TEX SECTION #######################################\n"
2224 case RC_TEXINPUTS_PREFIX:
2225 if (ignore_system_lyxrc ||
2226 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2227 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2232 case RC_FONT_ENCODING:
2233 if (ignore_system_lyxrc ||
2234 fontenc != system_lyxrc.fontenc) {
2235 os << "\\font_encoding \"" << fontenc << "\"\n";
2240 case RC_FORCE_PAINT_SINGLE_CHAR:
2241 if (ignore_system_lyxrc ||
2242 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2243 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2249 << "# FILE SECTION ######################################\n"
2252 case RC_DOCUMENTPATH:
2253 if (ignore_system_lyxrc ||
2254 document_path != system_lyxrc.document_path) {
2255 string const path = os::external_path(document_path);
2256 os << "\\document_path \"" << path << "\"\n";
2260 case RC_USELASTFILEPOS:
2261 if (ignore_system_lyxrc ||
2262 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2263 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2268 case RC_LOADSESSION:
2269 if (ignore_system_lyxrc ||
2270 load_session != system_lyxrc.load_session) {
2271 os << "\\load_session " << convert<string>(load_session)
2276 case RC_MOUSE_WHEEL_SPEED:
2277 if (ignore_system_lyxrc ||
2278 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2279 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2283 case RC_COMPLETION_INLINE_DELAY:
2284 if (ignore_system_lyxrc ||
2285 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2286 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2290 case RC_COMPLETION_INLINE_MATH:
2291 if (ignore_system_lyxrc ||
2292 completion_inline_math != system_lyxrc.completion_inline_math) {
2293 os << "\\completion_inline_math "
2294 << convert<string>(completion_inline_math) << '\n';
2298 case RC_COMPLETION_INLINE_TEXT:
2299 if (ignore_system_lyxrc ||
2300 completion_inline_text != system_lyxrc.completion_inline_text) {
2301 os << "\\completion_inline_text "
2302 << convert<string>(completion_inline_text) << '\n';
2306 case RC_COMPLETION_INLINE_DOTS:
2307 if (ignore_system_lyxrc ||
2308 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2309 os << "\\completion_inline_dots "
2310 << convert<string>(completion_inline_dots) << '\n';
2314 case RC_AUTOCORRECTION_MATH:
2315 if (ignore_system_lyxrc ||
2316 autocorrection_math != system_lyxrc.autocorrection_math) {
2317 os << "\\autocorrection_math "
2318 << convert<string>(autocorrection_math) << '\n';
2322 case RC_COMPLETION_POPUP_DELAY:
2323 if (ignore_system_lyxrc ||
2324 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2325 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2329 case RC_COMPLETION_POPUP_MATH:
2330 if (ignore_system_lyxrc ||
2331 completion_popup_math != system_lyxrc.completion_popup_math) {
2332 os << "\\completion_popup_math "
2333 << convert<string>(completion_popup_math) << '\n';
2337 case RC_COMPLETION_POPUP_TEXT:
2338 if (ignore_system_lyxrc ||
2339 completion_popup_text != system_lyxrc.completion_popup_text) {
2340 os << "\\completion_popup_text "
2341 << convert<string>(completion_popup_text) << '\n';
2345 case RC_COMPLETION_CURSOR_TEXT:
2346 if (ignore_system_lyxrc ||
2347 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2348 os << "\\completion_cursor_text "
2349 << convert<string>(completion_cursor_text) << '\n';
2353 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2354 if (ignore_system_lyxrc ||
2355 completion_popup_after_complete
2356 != system_lyxrc.completion_popup_after_complete) {
2357 os << "\\completion_popup_after_complete "
2358 << convert<string>(completion_popup_after_complete) << '\n';
2362 case RC_NUMLASTFILES:
2363 if (ignore_system_lyxrc ||
2364 num_lastfiles != system_lyxrc.num_lastfiles) {
2365 os << "\\num_lastfiles " << num_lastfiles << '\n';
2369 case RC_CHECKLASTFILES:
2370 if (ignore_system_lyxrc ||
2371 check_lastfiles != system_lyxrc.check_lastfiles) {
2372 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2377 case RC_EXAMPLEPATH:
2378 if (ignore_system_lyxrc ||
2379 example_path != system_lyxrc.example_path) {
2380 string const path = os::external_path(example_path);
2381 os << "\\example_path \"" << path << "\"\n";
2385 case RC_TEMPLATEPATH:
2386 if (ignore_system_lyxrc ||
2387 template_path != system_lyxrc.template_path) {
2388 string const path = os::external_path(template_path);
2389 os << "\\template_path \"" << path << "\"\n";
2393 case RC_TEMPDIRPATH:
2394 if (ignore_system_lyxrc ||
2395 tempdir_path != system_lyxrc.tempdir_path) {
2396 string const path = os::external_path(tempdir_path);
2397 os << "\\tempdir_path \"" << path << "\"\n";
2401 case RC_THESAURUSDIRPATH:
2402 if (ignore_system_lyxrc ||
2403 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2404 string const path = os::external_path(thesaurusdir_path);
2405 os << "\\thesaurusdir_path \"" << path << "\"\n";
2409 case RC_HUNSPELLDIR_PATH:
2410 if (ignore_system_lyxrc ||
2411 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2412 string const path = os::external_path(hunspelldir_path);
2413 os << "\\hunspelldir_path \"" << path << "\"\n";
2417 case RC_PLAINTEXT_LINELEN:
2418 if (ignore_system_lyxrc ||
2419 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2420 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2424 case RC_MAKE_BACKUP:
2425 if (ignore_system_lyxrc ||
2426 make_backup != system_lyxrc.make_backup) {
2427 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2431 case RC_SAVE_COMPRESSED:
2432 if (ignore_system_lyxrc ||
2433 save_compressed != system_lyxrc.save_compressed) {
2434 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2438 case RC_BACKUPDIR_PATH:
2439 if (ignore_system_lyxrc ||
2440 backupdir_path != system_lyxrc.backupdir_path) {
2441 string const path = os::external_path(backupdir_path);
2442 os << "\\backupdir_path \"" << path << "\"\n";
2448 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2452 << "# SPELLCHECKER SECTION ##############################\n"
2455 case RC_ACCEPT_COMPOUND:
2456 if (ignore_system_lyxrc ||
2457 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2458 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2464 if (ignore_system_lyxrc ||
2465 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2466 os << "\\alternate_language \"" << spellchecker_alt_lang
2472 if (ignore_system_lyxrc ||
2473 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2474 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2478 case RC_USE_SYSTEM_COLORS:
2479 if (ignore_system_lyxrc ||
2480 use_system_colors != system_lyxrc.use_system_colors) {
2481 os << "\\use_system_colors "
2482 << convert<string>(use_system_colors)
2487 case RC_USE_TOOLTIP:
2488 if (ignore_system_lyxrc ||
2489 use_tooltip != system_lyxrc.use_tooltip) {
2490 os << "\\use_tooltip "
2491 << convert<string>(use_tooltip)
2496 case RC_USE_PIXMAP_CACHE:
2497 if (ignore_system_lyxrc ||
2498 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2499 os << "\\use_pixmap_cache "
2500 << convert<string>(use_pixmap_cache)
2507 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2512 case RC_DEFAULT_DECIMAL_POINT:
2513 if (ignore_system_lyxrc ||
2514 default_decimal_point != system_lyxrc.default_decimal_point) {
2515 os << "\\default_decimal_point " << default_decimal_point << '\n';
2520 case RC_SPELLCHECKER:
2521 if (ignore_system_lyxrc ||
2522 spellchecker != system_lyxrc.spellchecker) {
2523 os << "\\spellchecker " << spellchecker << '\n';
2528 case RC_SPELLCHECK_CONTINUOUSLY:
2529 if (ignore_system_lyxrc ||
2530 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2531 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2537 case RC_SPELLCHECK_NOTES:
2538 if (ignore_system_lyxrc ||
2539 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2540 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2546 case RC_RTL_SUPPORT:
2547 if (ignore_system_lyxrc ||
2548 rtl_support != system_lyxrc.rtl_support) {
2549 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2553 case RC_VISUAL_CURSOR:
2554 if (ignore_system_lyxrc ||
2555 visual_cursor != system_lyxrc.visual_cursor) {
2556 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2560 case RC_LANGUAGE_CUSTOM_PACKAGE:
2561 if (ignore_system_lyxrc ||
2562 language_custom_package != system_lyxrc.language_custom_package) {
2563 os << "\\language_custom_package \"" << language_custom_package
2568 case RC_LANGUAGE_GLOBAL_OPTIONS:
2569 if (ignore_system_lyxrc ||
2570 language_global_options
2571 != system_lyxrc.language_global_options) {
2572 os << "\\language_global_options \""
2573 << convert<string>(language_global_options)
2578 case RC_LANGUAGE_PACKAGE_SELECTION:
2579 if (ignore_system_lyxrc ||
2580 language_package_selection != system_lyxrc.language_package_selection) {
2581 os << "\\language_package_selection ";
2582 switch (language_package_selection) {
2599 case RC_LANGUAGE_COMMAND_BEGIN:
2600 if (ignore_system_lyxrc ||
2601 language_command_begin
2602 != system_lyxrc.language_command_begin) {
2603 os << "\\language_command_begin \""
2604 << language_command_begin
2609 case RC_LANGUAGE_COMMAND_END:
2610 if (ignore_system_lyxrc ||
2611 language_command_end
2612 != system_lyxrc.language_command_end) {
2613 os << "\\language_command_end \"" << language_command_end
2618 case RC_LANGUAGE_COMMAND_LOCAL:
2619 if (ignore_system_lyxrc ||
2620 language_command_local
2621 != system_lyxrc.language_command_local) {
2622 os << "\\language_command_local \""
2623 << language_command_local
2628 case RC_LANGUAGE_AUTO_BEGIN:
2629 if (ignore_system_lyxrc ||
2630 language_auto_begin != system_lyxrc.language_auto_begin) {
2631 os << "\\language_auto_begin "
2632 << convert<string>(language_auto_begin) << '\n';
2636 case RC_LANGUAGE_AUTO_END:
2637 if (ignore_system_lyxrc ||
2638 language_auto_end != system_lyxrc.language_auto_end) {
2639 os << "\\language_auto_end "
2640 << convert<string>(language_auto_end) << '\n';
2644 case RC_MARK_FOREIGN_LANGUAGE:
2645 if (ignore_system_lyxrc ||
2646 mark_foreign_language
2647 != system_lyxrc.mark_foreign_language) {
2648 os << "\\mark_foreign_language " <<
2649 convert<string>(mark_foreign_language) << '\n';
2655 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2658 case RC_AUTO_NUMBER:
2659 if (ignore_system_lyxrc ||
2660 auto_number != system_lyxrc.auto_number) {
2661 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2665 case RC_DEFAULT_LANGUAGE:
2666 if (ignore_system_lyxrc ||
2667 default_language != system_lyxrc.default_language) {
2668 os << "\\default_language " << default_language << '\n';
2672 case RC_GUI_LANGUAGE:
2673 if (ignore_system_lyxrc ||
2674 gui_language != system_lyxrc.gui_language) {
2675 os << "\\gui_language " << gui_language << '\n';
2679 case RC_EXPORT_OVERWRITE:
2680 if (ignore_system_lyxrc ||
2681 export_overwrite != system_lyxrc.export_overwrite) {
2683 switch (export_overwrite) {
2694 os << "\\export_overwrite " << status << '\n';
2699 case RC_SCROLL_WHEEL_ZOOM:
2700 if (ignore_system_lyxrc ||
2701 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2703 switch (scroll_wheel_zoom) {
2704 case SCROLL_WHEEL_ZOOM_OFF:
2707 case SCROLL_WHEEL_ZOOM_CTRL:
2710 case SCROLL_WHEEL_ZOOM_SHIFT:
2713 case SCROLL_WHEEL_ZOOM_ALT:
2717 os << "\\scroll_wheel_zoom " << status << '\n';
2723 << "# FORMATS SECTION ##########################\n"
2727 // New/modified formats
2728 for (Formats::const_iterator cit = formats.begin();
2729 cit != formats.end(); ++cit) {
2730 Format const * format =
2731 system_formats.getFormat(cit->name());
2733 format->extension() != cit->extension() ||
2734 format->prettyname() != cit->prettyname() ||
2735 format->shortcut() != cit->shortcut() ||
2736 format->viewer() != cit->viewer() ||
2737 format->editor() != cit->editor() ||
2738 format->documentFormat() != cit->documentFormat() ||
2739 format->vectorFormat() != cit->vectorFormat() ||
2740 format->inExportMenu() != cit->inExportMenu()) {
2741 os << "\\format \"" << cit->name() << "\" \""
2742 << cit->extension() << "\" \""
2743 << cit->prettyname() << "\" \""
2744 << cit->shortcut() << "\" \""
2745 << escapeCommand(cit->viewer()) << "\" \""
2746 << escapeCommand(cit->editor()) << "\" \"";
2747 vector<string> flags;
2748 if (cit->documentFormat())
2749 flags.push_back("document");
2750 if (cit->vectorFormat())
2751 flags.push_back("vector");
2752 if (cit->inExportMenu())
2753 flags.push_back("menu=export");
2755 os << getStringFromVector(flags);
2760 // Look for deleted formats
2761 for (Formats::const_iterator cit = system_formats.begin();
2762 cit != system_formats.end(); ++cit)
2763 if (!formats.getFormat(cit->name()))
2764 os << "\\format \"" << cit->name()
2765 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2768 case RC_VIEWER_ALTERNATIVES: {
2769 Alternatives::const_iterator it = viewer_alternatives.begin();
2770 Alternatives::const_iterator const en = viewer_alternatives.end();
2771 Alternatives::const_iterator const sysend =
2772 system_lyxrc.viewer_alternatives.end();
2773 for (; it != en; ++it) {
2774 string const & fmt = it->first;
2775 CommandSet const & cmd = it->second;
2776 CommandSet::const_iterator sit = cmd.begin();
2777 CommandSet::const_iterator const sen = cmd.end();
2778 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2779 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2780 system_lyxrc.viewer_alternatives.find(fmt);
2781 for (; sit != sen; ++sit) {
2782 string const & cmd = *sit;
2783 if (ignore_system_lyxrc
2784 || sysfmt == sysend // format not found
2785 || sysfmt->second.count(cmd) == 0 // this command not found
2787 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2793 case RC_EDITOR_ALTERNATIVES: {
2794 Alternatives::const_iterator it = editor_alternatives.begin();
2795 Alternatives::const_iterator const en = editor_alternatives.end();
2796 Alternatives::const_iterator const sysend =
2797 system_lyxrc.editor_alternatives.end();
2798 for (; it != en; ++it) {
2799 string const & fmt = it->first;
2800 CommandSet const & cmd = it->second;
2801 CommandSet::const_iterator sit = cmd.begin();
2802 CommandSet::const_iterator const sen = cmd.end();
2803 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2804 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2805 system_lyxrc.editor_alternatives.find(fmt);
2806 for (; sit != sen; ++sit) {
2807 string const & cmd = *sit;
2808 if (ignore_system_lyxrc
2809 || sysfmt == sysend // format not found
2810 || sysfmt->second.count(cmd) == 0 // this command not found
2812 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2818 case RC_DEFAULT_VIEW_FORMAT:
2819 if (ignore_system_lyxrc ||
2820 default_view_format != system_lyxrc.default_view_format) {
2821 os << "\\default_view_format " << default_view_format << '\n';
2831 << "# CONVERTERS SECTION ##########################\n"
2835 // Look for new converters
2836 for (Converters::const_iterator cit = theConverters().begin();
2837 cit != theConverters().end(); ++cit) {
2838 Converter const * converter =
2839 theSystemConverters().getConverter(cit->from,
2842 converter->command != cit->command ||
2843 converter->flags != cit->flags)
2844 os << "\\converter \"" << cit->from << "\" \""
2845 << cit->to << "\" \""
2846 << escapeCommand(cit->command) << "\" \""
2847 << cit->flags << "\"\n";
2850 // New/modifed converters
2851 for (Converters::const_iterator cit = theSystemConverters().begin();
2852 cit != theSystemConverters().end(); ++cit)
2853 if (!theConverters().getConverter(cit->from, cit->to))
2854 os << "\\converter \"" << cit->from
2855 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2862 << "# COPIERS SECTION ##########################\n"
2865 // Look for new movers
2866 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2867 Movers::const_iterator const sysend = theSystemMovers().end();
2868 Movers::const_iterator it = theMovers().begin();
2869 Movers::const_iterator end = theMovers().end();
2871 for (; it != end; ++it) {
2872 Movers::const_iterator const sysit =
2873 find_if(sysbegin, sysend, SameMover(*it));
2874 if (sysit == sysend) {
2875 string const & fmt = it->first;
2876 string const & command =
2877 it->second.command();
2879 os << "\\copier " << fmt
2880 << " \"" << escapeCommand(command) << "\"\n";
2886 // We don't actually delete SpecialisedMover(s) from the
2887 // map, just clear their 'command', so there's no need
2888 // to test for anything else.
2895 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2897 // Why the switch you might ask. It is a trick to ensure that all
2898 // the elements in the LyXRCTags enum is handled. As you can see
2899 // there are no breaks at all. So it is just a huge fall-through.
2900 // The nice thing is that we will get a warning from the compiler
2901 // if we forget an element.
2902 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2904 case LyXRC::RC_LAST:
2905 case LyXRC::RC_ACCEPT_COMPOUND:
2906 case LyXRC::RC_ALT_LANG:
2907 case LyXRC::RC_PLAINTEXT_LINELEN:
2908 case LyXRC::RC_AUTOCORRECTION_MATH:
2909 case LyXRC::RC_AUTOREGIONDELETE:
2910 case LyXRC::RC_AUTORESET_OPTIONS:
2911 case LyXRC::RC_AUTOSAVE:
2912 case LyXRC::RC_AUTO_NUMBER:
2913 case LyXRC::RC_BACKUPDIR_PATH:
2914 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2915 case LyXRC::RC_BIBTEX_COMMAND:
2916 case LyXRC::RC_BINDFILE:
2917 case LyXRC::RC_CHECKLASTFILES:
2918 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2919 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2920 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2921 case LyXRC::RC_COMPLETION_INLINE_MATH:
2922 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2923 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2924 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2925 case LyXRC::RC_COMPLETION_POPUP_MATH:
2926 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2927 case LyXRC::RC_USELASTFILEPOS:
2928 case LyXRC::RC_LOADSESSION:
2929 case LyXRC::RC_CHKTEX_COMMAND:
2930 case LyXRC::RC_CONVERTER:
2931 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2932 case LyXRC::RC_COPIER:
2933 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2934 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2935 case LyXRC::RC_DATE_INSERT_FORMAT:
2936 case LyXRC::RC_DEFAULT_LANGUAGE:
2937 case LyXRC::RC_GUI_LANGUAGE:
2938 case LyXRC::RC_DEFAULT_PAPERSIZE:
2939 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2940 case LyXRC::RC_DEFFILE:
2941 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2942 case LyXRC::RC_DISPLAY_GRAPHICS:
2943 case LyXRC::RC_DOCUMENTPATH:
2944 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2945 FileName path(lyxrc_new.document_path);
2946 if (path.exists() && path.isDirectory())
2947 package().document_dir() = FileName(lyxrc.document_path);
2949 case LyXRC::RC_EDITOR_ALTERNATIVES:
2950 case LyXRC::RC_ESC_CHARS:
2951 case LyXRC::RC_EXAMPLEPATH:
2952 case LyXRC::RC_FONT_ENCODING:
2953 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2954 case LyXRC::RC_FILEFORMAT:
2955 case LyXRC::RC_GROUP_LAYOUTS:
2956 case LyXRC::RC_HUNSPELLDIR_PATH:
2957 case LyXRC::RC_ICON_SET:
2958 case LyXRC::RC_INDEX_ALTERNATIVES:
2959 case LyXRC::RC_INDEX_COMMAND:
2960 case LyXRC::RC_JBIBTEX_COMMAND:
2961 case LyXRC::RC_JINDEX_COMMAND:
2962 case LyXRC::RC_NOMENCL_COMMAND:
2963 case LyXRC::RC_INPUT:
2964 case LyXRC::RC_KBMAP:
2965 case LyXRC::RC_KBMAP_PRIMARY:
2966 case LyXRC::RC_KBMAP_SECONDARY:
2967 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2968 case LyXRC::RC_LANGUAGE_AUTO_END:
2969 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2970 case LyXRC::RC_LANGUAGE_COMMAND_END:
2971 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2972 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2973 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2974 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2975 case LyXRC::RC_LYXRCFORMAT:
2976 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2977 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2978 case LyXRC::RC_MACRO_EDIT_STYLE:
2979 case LyXRC::RC_MAKE_BACKUP:
2980 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2981 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2982 case LyXRC::RC_NUMLASTFILES:
2983 case LyXRC::RC_PARAGRAPH_MARKERS:
2984 case LyXRC::RC_PATH_PREFIX:
2985 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2986 prependEnvPath("PATH", lyxrc_new.path_prefix);
2988 case LyXRC::RC_PREVIEW:
2989 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2990 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2991 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2992 case LyXRC::RC_PRINTCOPIESFLAG:
2993 case LyXRC::RC_PRINTER:
2994 case LyXRC::RC_PRINTEVENPAGEFLAG:
2995 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2996 case LyXRC::RC_PRINTFILEEXTENSION:
2997 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2998 case LyXRC::RC_PRINTODDPAGEFLAG:
2999 case LyXRC::RC_PRINTPAGERANGEFLAG:
3000 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3001 case LyXRC::RC_PRINTPAPERFLAG:
3002 case LyXRC::RC_PRINTREVERSEFLAG:
3003 case LyXRC::RC_PRINTSPOOL_COMMAND:
3004 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
3005 case LyXRC::RC_PRINTTOFILE:
3006 case LyXRC::RC_PRINTTOPRINTER:
3007 case LyXRC::RC_PRINT_ADAPTOUTPUT:
3008 case LyXRC::RC_PRINT_COMMAND:
3009 case LyXRC::RC_RTL_SUPPORT:
3010 case LyXRC::RC_SAVE_COMPRESSED:
3011 case LyXRC::RC_SCREEN_DPI:
3012 case LyXRC::RC_SCREEN_FONT_ROMAN:
3013 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3014 case LyXRC::RC_SCREEN_FONT_SANS:
3015 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3016 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3017 case LyXRC::RC_SCREEN_FONT_SIZES:
3018 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3019 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3020 case LyXRC::RC_GEOMETRY_SESSION:
3021 case LyXRC::RC_SCREEN_ZOOM:
3022 case LyXRC::RC_SERVERPIPE:
3023 case LyXRC::RC_SET_COLOR:
3024 case LyXRC::RC_SHOW_BANNER:
3025 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3026 case LyXRC::RC_SPELLCHECKER:
3027 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3028 case LyXRC::RC_SPELLCHECK_NOTES:
3029 case LyXRC::RC_SPLITINDEX_COMMAND:
3030 case LyXRC::RC_TEMPDIRPATH:
3031 case LyXRC::RC_TEMPLATEPATH:
3032 case LyXRC::RC_TEX_ALLOWS_SPACES:
3033 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3034 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3035 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3037 case LyXRC::RC_TEXINPUTS_PREFIX:
3038 case LyXRC::RC_THESAURUSDIRPATH:
3039 case LyXRC::RC_UIFILE:
3040 case LyXRC::RC_USER_EMAIL:
3041 case LyXRC::RC_USER_NAME:
3042 case LyXRC::RC_USE_CONVERTER_CACHE:
3043 case LyXRC::RC_USE_SYSTEM_COLORS:
3044 case LyXRC::RC_USE_TOOLTIP:
3045 case LyXRC::RC_USE_PIXMAP_CACHE:
3046 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3047 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3048 case LyXRC::RC_SINGLE_INSTANCE:
3049 case LyXRC::RC_SORT_LAYOUTS:
3050 case LyXRC::RC_FULL_SCREEN_LIMIT:
3051 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3052 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3053 case LyXRC::RC_FULL_SCREEN_TABBAR:
3054 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3055 case LyXRC::RC_FULL_SCREEN_WIDTH:
3056 case LyXRC::RC_VISUAL_CURSOR:
3057 case LyXRC::RC_VIEWER:
3058 case LyXRC::RC_VIEWER_ALTERNATIVES:
3059 case LyXRC::RC_FORWARD_SEARCH_DVI:
3060 case LyXRC::RC_FORWARD_SEARCH_PDF:
3061 case LyXRC::RC_EXPORT_OVERWRITE:
3062 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3063 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3064 case LyXRC::RC_CURSOR_WIDTH:
3071 string const LyXRC::getDescription(LyXRCTags tag)
3076 case RC_ACCEPT_COMPOUND:
3077 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3081 str = _("Specify an alternate language. The default is to use the language of the document.");
3084 case RC_PLAINTEXT_LINELEN:
3085 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.");
3088 case RC_AUTOREGIONDELETE:
3089 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3092 case RC_AUTORESET_OPTIONS:
3093 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3097 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3100 case RC_AUTO_NUMBER:
3103 case RC_BACKUPDIR_PATH:
3104 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.");
3107 case RC_BIBTEX_COMMAND:
3108 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3111 case RC_JBIBTEX_COMMAND:
3112 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3116 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3119 case RC_CHECKLASTFILES:
3120 str = _("Select to check whether the lastfiles still exist.");
3123 case RC_CHKTEX_COMMAND:
3124 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3133 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3134 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.");
3137 case RC_CURSOR_WIDTH:
3138 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3141 case RC_SCROLL_BELOW_DOCUMENT:
3142 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");
3145 case RC_MAC_DONTSWAP_CTRL_META:
3146 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3149 case RC_MAC_LIKE_WORD_MOVEMENT:
3150 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3153 case RC_SHOW_MACRO_LABEL:
3154 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3157 case RC_DATE_INSERT_FORMAT:
3158 //xgettext:no-c-format
3159 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3163 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3166 case RC_DEFAULT_VIEW_FORMAT:
3167 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3170 case RC_DEFAULT_LANGUAGE:
3171 str = _("New documents will be assigned this language.");
3174 case RC_DEFAULT_PAPERSIZE:
3175 str = _("Specify the default paper size.");
3178 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3179 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3182 case RC_DISPLAY_GRAPHICS:
3183 str = _("Select how LyX will display any graphics.");
3186 case RC_DOCUMENTPATH:
3187 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3191 str = _("Specify additional chars that can be part of a word.");
3194 case RC_EXAMPLEPATH:
3195 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3198 case RC_FONT_ENCODING:
3199 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3202 case RC_FORCE_PAINT_SINGLE_CHAR:
3203 str = _("Disable any kerning and ligatures for text drawing on screen.");
3209 case RC_INDEX_COMMAND:
3210 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\".");
3213 case RC_JINDEX_COMMAND:
3214 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3217 case RC_NOMENCL_COMMAND:
3218 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3225 case RC_KBMAP_PRIMARY:
3226 case RC_KBMAP_SECONDARY:
3227 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.");
3230 case RC_LANGUAGE_AUTO_BEGIN:
3231 str = _("Select if a language switching command is needed at the beginning of the document.");
3234 case RC_LANGUAGE_AUTO_END:
3235 str = _("Select if a language switching command is needed at the end of the document.");
3238 case RC_LANGUAGE_COMMAND_BEGIN:
3239 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.");
3242 case RC_LANGUAGE_COMMAND_END:
3243 str = _("The LaTeX command for changing back to the language of the document.");
3246 case RC_LANGUAGE_COMMAND_LOCAL:
3247 str = _("The LaTeX command for local changing of the language.");
3250 case RC_LANGUAGE_GLOBAL_OPTIONS:
3251 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3254 case RC_LANGUAGE_CUSTOM_PACKAGE:
3255 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3258 case RC_LANGUAGE_PACKAGE_SELECTION:
3259 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3262 case RC_USELASTFILEPOS:
3263 str = _("De-select if you do not want LyX to scroll to saved position.");
3266 case RC_LOADSESSION:
3267 str = _("De-select to prevent loading files opened from the last LyX session.");
3270 case RC_MAKE_BACKUP:
3271 str = _("De-select if you don't want LyX to create backup files.");
3274 case RC_MARK_FOREIGN_LANGUAGE:
3275 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3278 case RC_MOUSE_WHEEL_SPEED:
3279 str = bformat(_("The scrolling speed of the mouse wheel."),
3283 case RC_COMPLETION_POPUP_DELAY:
3284 str = _("The completion popup delay.");
3287 case RC_COMPLETION_POPUP_MATH:
3288 str = _("Select to display the completion popup in math mode.");
3291 case RC_COMPLETION_POPUP_TEXT:
3292 str = _("Select to display the completion popup in text mode.");
3295 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3296 str = _("Show the completion popup without delay after non-unique completion attempt.");
3299 case RC_COMPLETION_POPUP_TEXT:
3300 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3303 case RC_COMPLETION_POPUP_DELAY:
3304 str = _("The inline completion delay.");
3307 case RC_COMPLETION_INLINE_MATH:
3308 str = _("Select to display the inline completion in math mode.");
3311 case RC_COMPLETION_INLINE_TEXT:
3312 str = _("Select to display the inline completion in text mode.");
3315 case RC_COMPLETION_INLINE_DOTS:
3316 str = _("Use \"...\" to shorten long completions.");
3319 case RC_AUTOCORRECTION_MATH:
3320 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3323 case RC_NUMLASTFILES:
3324 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3328 case RC_PATH_PREFIX:
3329 str = _("Specify those directories which should be "
3330 "prepended to the PATH environment variable.\n"
3331 "Use the OS native format.");
3335 str = _("Shows a typeset preview of things such as math");
3338 case RC_PREVIEW_HASHED_LABELS:
3339 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3342 case RC_PREVIEW_SCALE_FACTOR:
3343 str = _("Scale the preview size to suit.");
3346 case RC_PRINTCOLLCOPIESFLAG:
3347 str = _("The option for specifying whether the copies should be collated.");
3350 case RC_PRINTCOPIESFLAG:
3351 str = _("The option for specifying the number of copies to print.");
3355 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3358 case RC_PRINTEVENPAGEFLAG:
3359 str = _("The option to print only even pages.");
3362 case RC_PRINTEXSTRAOPTIONS:
3363 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3366 case RC_PRINTFILEEXTENSION:
3367 str = _("Extension of printer program output file. Usually \".ps\".");
3370 case RC_PRINTLANDSCAPEFLAG:
3371 str = _("The option to print out in landscape.");
3374 case RC_PRINTODDPAGEFLAG:
3375 str = _("The option to print only odd pages.");
3378 case RC_PRINTPAGERANGEFLAG:
3379 str = _("The option for specifying a comma-separated list of pages to print.");
3382 case RC_PRINTPAPERDIMENSIONFLAG:
3383 str = _("Option to specify the dimensions of the print paper.");
3386 case RC_PRINTPAPERFLAG:
3387 str = _("The option to specify paper type.");
3390 case RC_PRINTREVERSEFLAG:
3391 str = _("The option to reverse the order of the pages printed.");
3394 case RC_PRINTSPOOL_COMMAND:
3395 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.");
3398 case RC_PRINTSPOOL_PRINTERPREFIX:
3399 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.");
3402 case RC_PRINTTOFILE:
3403 str = _("Option to pass to the print program to print to a file.");
3406 case RC_PRINTTOPRINTER:
3407 str = _("Option to pass to the print program to print on a specific printer.");
3410 case RC_PRINT_ADAPTOUTPUT:
3411 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3414 case RC_PRINT_COMMAND:
3415 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3418 case RC_RTL_SUPPORT:
3419 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3422 case RC_VISUAL_CURSOR:
3423 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3427 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3430 case RC_SCREEN_FONT_ROMAN:
3431 case RC_SCREEN_FONT_SANS:
3432 case RC_SCREEN_FONT_TYPEWRITER:
3433 str = _("The screen fonts used to display the text while editing.");
3436 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3437 case RC_SCREEN_FONT_SANS_FOUNDRY:
3438 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3441 case RC_SCREEN_FONT_SCALABLE:
3442 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.");
3445 case RC_SCREEN_FONT_SIZES:
3446 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3449 case RC_SCREEN_ZOOM:
3450 //xgettext:no-c-format
3451 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3454 case RC_GEOMETRY_SESSION:
3455 str = _("Allow session manager to save and restore windows geometry.");
3459 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3465 case RC_SHOW_BANNER:
3466 str = _("De-select if you don't want the startup banner.");
3469 case RC_TEMPDIRPATH:
3470 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3473 case RC_THESAURUSDIRPATH:
3474 str = _("This is the place where the files of the thesaurus library reside.");
3477 case RC_TEMPLATEPATH:
3478 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3481 case RC_TEX_ALLOWS_SPACES:
3484 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3487 case RC_TEXINPUTS_PREFIX:
3488 str = _("Specify those directories which should be "
3489 "prepended to the TEXINPUTS environment variable.\n"
3490 "A '.' represents the current document directory. "
3491 "Use the OS native format.");
3495 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3504 case RC_USE_USE_SYSTEM_COLORS:
3505 str = _("Enable use the system colors for some things like main window background and selection.");
3508 case RC_USE_TOOLTIP:
3509 str = _("Enable the automatic appearance of tool tips in the work area.");
3512 case RC_USE_PIXMAP_CACHE:
3513 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3516 case RC_VIEWDVI_PAPEROPTION:
3517 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3532 // The global instance
3535 // The global copy of the system lyxrc entries (everything except preferences)