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 if (ignore_system_lyxrc ||
1616 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1617 os << "\\tex_expects_windows_paths "
1618 << convert<string>(windows_style_tex_paths) << '\n';
1622 case RC_TEX_ALLOWS_SPACES:
1623 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1624 os << "\\tex_allows_spaces "
1625 << convert<string>(tex_allows_spaces) << '\n';
1630 if (ignore_system_lyxrc ||
1631 use_kbmap != system_lyxrc.use_kbmap) {
1632 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1636 case RC_KBMAP_PRIMARY:
1637 if (ignore_system_lyxrc ||
1638 primary_kbmap != system_lyxrc.primary_kbmap) {
1639 string const path = os::external_path(primary_kbmap);
1640 os << "\\kbmap_primary \"" << path << "\"\n";
1644 case RC_KBMAP_SECONDARY:
1645 if (ignore_system_lyxrc ||
1646 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1647 string const path = os::external_path(secondary_kbmap);
1648 os << "\\kbmap_secondary \"" << path << "\"\n";
1653 if (ignore_system_lyxrc ||
1654 lyxpipes != system_lyxrc.lyxpipes) {
1655 string const path = os::external_path(lyxpipes);
1656 os << "\\serverpipe \"" << path << "\"\n";
1660 case RC_DATE_INSERT_FORMAT:
1661 if (ignore_system_lyxrc ||
1662 date_insert_format != system_lyxrc.date_insert_format) {
1663 os << "\\date_insert_format \"" << date_insert_format
1670 os << "\\user_name \"" << user_name << "\"\n";
1675 os << "\\user_email \"" << user_email << "\"\n";
1679 case RC_SHOW_BANNER:
1680 if (ignore_system_lyxrc ||
1681 show_banner != system_lyxrc.show_banner) {
1682 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1688 if (ignore_system_lyxrc ||
1689 preview != system_lyxrc.preview) {
1695 case PREVIEW_NO_MATH:
1702 os << "\\preview " << status << '\n';
1707 case RC_PREVIEW_HASHED_LABELS:
1708 if (ignore_system_lyxrc ||
1709 preview_hashed_labels !=
1710 system_lyxrc.preview_hashed_labels) {
1711 os << "\\preview_hashed_labels "
1712 << convert<string>(preview_hashed_labels) << '\n';
1717 case RC_PREVIEW_SCALE_FACTOR:
1718 if (ignore_system_lyxrc ||
1719 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1720 os << "\\preview_scale_factor "
1721 << preview_scale_factor << '\n';
1726 case RC_USE_CONVERTER_CACHE:
1727 if (ignore_system_lyxrc ||
1728 use_converter_cache != system_lyxrc.use_converter_cache) {
1729 os << "\\use_converter_cache "
1730 << convert<string>(use_converter_cache) << '\n';
1735 case RC_CONVERTER_CACHE_MAXAGE:
1736 if (ignore_system_lyxrc ||
1737 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1738 os << "\\converter_cache_maxage "
1739 << converter_cache_maxage << '\n';
1745 << "# SCREEN & FONTS SECTION ############################\n"
1749 if (ignore_system_lyxrc ||
1750 icon_set != system_lyxrc.icon_set) {
1751 os << "\\icon_set \"" << icon_set
1758 if (ignore_system_lyxrc ||
1759 dpi != system_lyxrc.dpi) {
1760 os << "\\screen_dpi " << dpi << '\n';
1764 case RC_SCREEN_ZOOM:
1765 if (ignore_system_lyxrc ||
1766 zoom != system_lyxrc.zoom) {
1767 os << "\\screen_zoom " << zoom << '\n';
1771 case RC_GEOMETRY_SESSION:
1772 if (ignore_system_lyxrc ||
1773 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1774 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1779 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1780 if (ignore_system_lyxrc ||
1781 cursor_follows_scrollbar
1782 != system_lyxrc.cursor_follows_scrollbar) {
1783 os << "\\cursor_follows_scrollbar "
1784 << convert<string>(cursor_follows_scrollbar) << '\n';
1788 case RC_CURSOR_WIDTH:
1789 if (ignore_system_lyxrc ||
1791 != system_lyxrc.cursor_width) {
1792 os << "\\cursor_width "
1793 << cursor_width << '\n';
1797 case RC_SCROLL_BELOW_DOCUMENT:
1798 if (ignore_system_lyxrc ||
1799 scroll_below_document
1800 != system_lyxrc.scroll_below_document) {
1801 os << "\\scroll_below_document "
1802 << convert<string>(scroll_below_document) << '\n';
1806 case RC_PARAGRAPH_MARKERS:
1807 if (ignore_system_lyxrc ||
1809 != system_lyxrc.paragraph_markers) {
1810 os << "\\paragraph_markers "
1811 << convert<string>(paragraph_markers) << '\n';
1815 case RC_MAC_DONTSWAP_CTRL_META:
1816 if (ignore_system_lyxrc ||
1817 mac_dontswap_ctrl_meta
1818 != system_lyxrc.mac_dontswap_ctrl_meta) {
1819 os << "\\mac_dontswap_ctrl_meta "
1820 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1824 case RC_MAC_LIKE_WORD_MOVEMENT:
1825 if (ignore_system_lyxrc ||
1826 mac_like_word_movement
1827 != system_lyxrc.mac_like_word_movement) {
1828 os << "\\mac_like_word_movement "
1829 << convert<string>(mac_like_word_movement) << '\n';
1833 case RC_MACRO_EDIT_STYLE:
1834 if (ignore_system_lyxrc ||
1836 != system_lyxrc.macro_edit_style) {
1837 os << "\\macro_edit_style ";
1838 switch (macro_edit_style) {
1839 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1840 case MACRO_EDIT_INLINE: os << "1\n"; break;
1841 case MACRO_EDIT_LIST: os << "2\n"; break;
1846 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1847 if (ignore_system_lyxrc ||
1848 dialogs_iconify_with_main
1849 != system_lyxrc.dialogs_iconify_with_main) {
1850 os << "\\dialogs_iconify_with_main "
1851 << convert<string>(dialogs_iconify_with_main) << '\n';
1855 case RC_SCREEN_FONT_ROMAN:
1856 if (ignore_system_lyxrc ||
1857 roman_font_name != system_lyxrc.roman_font_name) {
1858 os << "\\screen_font_roman \"" << roman_font_name
1863 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1864 if (ignore_system_lyxrc ||
1865 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1866 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1871 case RC_SCREEN_FONT_SANS:
1872 if (ignore_system_lyxrc ||
1873 sans_font_name != system_lyxrc.sans_font_name) {
1874 os << "\\screen_font_sans \"" << sans_font_name
1879 case RC_SCREEN_FONT_SANS_FOUNDRY:
1880 if (ignore_system_lyxrc ||
1881 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1882 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1887 case RC_SCREEN_FONT_TYPEWRITER:
1888 if (ignore_system_lyxrc ||
1889 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1890 os << "\\screen_font_typewriter \""
1891 << typewriter_font_name << "\"\n";
1895 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1896 if (ignore_system_lyxrc ||
1897 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1898 os << "\\screen_font_typewriter_foundry \""
1899 << typewriter_font_foundry << "\"\n";
1904 case RC_SCREEN_FONT_SCALABLE:
1905 if (ignore_system_lyxrc ||
1906 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1907 os << "\\screen_font_scalable "
1908 << convert<string>(use_scalable_fonts)
1913 case RC_SCREEN_FONT_SIZES:
1914 if (ignore_system_lyxrc ||
1915 font_sizes[FONT_SIZE_TINY]
1916 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1917 font_sizes[FONT_SIZE_SCRIPT]
1918 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1919 font_sizes[FONT_SIZE_FOOTNOTE]
1920 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1921 font_sizes[FONT_SIZE_SMALL]
1922 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1923 font_sizes[FONT_SIZE_NORMAL]
1924 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1925 font_sizes[FONT_SIZE_LARGE]
1926 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1927 font_sizes[FONT_SIZE_LARGER]
1928 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1929 font_sizes[FONT_SIZE_LARGEST]
1930 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1931 font_sizes[FONT_SIZE_HUGE]
1932 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1933 font_sizes[FONT_SIZE_HUGER]
1934 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1935 os.setf(ios::fixed);
1937 os << "\\screen_font_sizes"
1938 << ' ' << font_sizes[FONT_SIZE_TINY]
1939 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1940 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1941 << ' ' << font_sizes[FONT_SIZE_SMALL]
1942 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1943 << ' ' << font_sizes[FONT_SIZE_LARGE]
1944 << ' ' << font_sizes[FONT_SIZE_LARGER]
1945 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1946 << ' ' << font_sizes[FONT_SIZE_HUGE]
1947 << ' ' << font_sizes[FONT_SIZE_HUGER]
1952 case RC_FULL_SCREEN_LIMIT:
1953 if (ignore_system_lyxrc ||
1954 full_screen_limit != system_lyxrc.full_screen_limit) {
1955 os << "\\fullscreen_limit "
1956 << convert<string>(full_screen_limit)
1961 case RC_FULL_SCREEN_TOOLBARS:
1962 if (ignore_system_lyxrc ||
1963 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1964 os << "\\fullscreen_toolbars "
1965 << convert<string>(full_screen_toolbars)
1970 case RC_FULL_SCREEN_SCROLLBAR:
1971 if (ignore_system_lyxrc ||
1972 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1973 os << "\\fullscreen_scrollbar "
1974 << convert<string>(full_screen_scrollbar)
1979 case RC_FULL_SCREEN_TABBAR:
1980 if (ignore_system_lyxrc ||
1981 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1982 os << "\\fullscreen_tabbar "
1983 << convert<string>(full_screen_tabbar)
1988 case RC_FULL_SCREEN_MENUBAR:
1989 if (ignore_system_lyxrc ||
1990 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1991 os << "\\fullscreen_menubar "
1992 << convert<string>(full_screen_menubar)
1997 case RC_FULL_SCREEN_WIDTH:
1998 if (ignore_system_lyxrc ||
1999 full_screen_width != system_lyxrc.full_screen_width) {
2000 os << "\\fullscreen_width "
2001 << convert<string>(full_screen_width)
2006 case RC_OPEN_BUFFERS_IN_TABS:
2007 if (ignore_system_lyxrc ||
2008 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
2009 os << "\\open_buffers_in_tabs "
2010 << convert<string>(open_buffers_in_tabs)
2015 case RC_SINGLE_CLOSE_TAB_BUTTON:
2016 if (ignore_system_lyxrc ||
2017 single_close_tab_button != system_lyxrc.single_close_tab_button) {
2018 os << "\\single_close_tab_button "
2019 << convert<string>(single_close_tab_button)
2024 case RC_SINGLE_INSTANCE:
2025 if (ignore_system_lyxrc ||
2026 single_instance != system_lyxrc.single_instance) {
2027 os << "\\single_instance "
2028 << convert<string>(single_instance)
2033 case RC_FORWARD_SEARCH_DVI:
2034 if (ignore_system_lyxrc ||
2035 forward_search_dvi != system_lyxrc.forward_search_dvi) {
2036 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2040 case RC_FORWARD_SEARCH_PDF:
2041 if (ignore_system_lyxrc ||
2042 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2043 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2049 << "# COLOR SECTION ###################################\n"
2053 for (int i = 0; i < Color_ignore; ++i) {
2054 ColorCode lc = static_cast<ColorCode>(i);
2055 string const col = lcolor.getX11Name(lc);
2056 if (ignore_system_lyxrc
2057 || col != system_lcolor.getX11Name(lc)) {
2058 os << "\\set_color \""
2059 << lcolor.getLyXName(lc) << "\" \""
2067 << "# PRINTER SECTION ###################################\n"
2071 if (ignore_system_lyxrc ||
2072 printer != system_lyxrc.printer) {
2073 os << "\\printer \"" << printer << "\"\n";
2077 case RC_PRINT_ADAPTOUTPUT:
2078 if (ignore_system_lyxrc ||
2079 print_adapt_output != system_lyxrc.print_adapt_output) {
2080 os << "\\print_adapt_output "
2081 << convert<string>(print_adapt_output)
2086 case RC_PRINT_COMMAND:
2087 if (ignore_system_lyxrc ||
2088 print_command != system_lyxrc.print_command) {
2089 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2093 case RC_PRINTEXSTRAOPTIONS:
2094 if (ignore_system_lyxrc ||
2095 print_extra_options != system_lyxrc.print_extra_options) {
2096 os << "\\print_extra_options \"" << print_extra_options
2101 case RC_PRINTSPOOL_COMMAND:
2102 if (ignore_system_lyxrc ||
2103 print_spool_command != system_lyxrc.print_spool_command) {
2104 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2109 case RC_PRINTSPOOL_PRINTERPREFIX:
2110 if (ignore_system_lyxrc ||
2111 print_spool_printerprefix
2112 != system_lyxrc.print_spool_printerprefix) {
2113 os << "\\print_spool_printerprefix \""
2114 << print_spool_printerprefix << "\"\n";
2118 case RC_PRINTEVENPAGEFLAG:
2119 if (ignore_system_lyxrc ||
2120 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2121 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2126 case RC_PRINTODDPAGEFLAG:
2127 if (ignore_system_lyxrc ||
2128 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2129 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2134 case RC_PRINTREVERSEFLAG:
2135 if (ignore_system_lyxrc ||
2136 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2137 os << "\\print_reverse_flag \"" << print_reverse_flag
2142 case RC_PRINTLANDSCAPEFLAG:
2143 if (ignore_system_lyxrc ||
2144 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2145 os << "\\print_landscape_flag \"" << print_landscape_flag
2150 case RC_PRINTPAGERANGEFLAG:
2151 if (ignore_system_lyxrc ||
2152 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2153 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2158 case RC_PRINTCOPIESFLAG:
2159 if (ignore_system_lyxrc ||
2160 print_copies_flag != system_lyxrc.print_copies_flag) {
2161 os << "\\print_copies_flag \"" << print_copies_flag
2166 case RC_PRINTCOLLCOPIESFLAG:
2167 if (ignore_system_lyxrc ||
2168 print_collcopies_flag
2169 != system_lyxrc.print_collcopies_flag) {
2170 os << "\\print_collcopies_flag \""
2171 << print_collcopies_flag
2176 case RC_PRINTPAPERFLAG:
2177 if (ignore_system_lyxrc ||
2178 print_paper_flag != system_lyxrc.print_paper_flag) {
2179 os << "\\print_paper_flag \"" << print_paper_flag
2184 case RC_PRINTPAPERDIMENSIONFLAG:
2185 if (ignore_system_lyxrc ||
2186 print_paper_dimension_flag
2187 != system_lyxrc.print_paper_dimension_flag) {
2188 os << "\\print_paper_dimension_flag \""
2189 << print_paper_dimension_flag << "\"\n";
2193 case RC_PRINTTOPRINTER:
2194 if (ignore_system_lyxrc ||
2195 print_to_printer != system_lyxrc.print_to_printer) {
2196 os << "\\print_to_printer \"" << print_to_printer
2201 case RC_PRINTTOFILE:
2202 if (ignore_system_lyxrc ||
2203 print_to_file != system_lyxrc.print_to_file) {
2204 string const path = os::external_path(print_to_file);
2205 os << "\\print_to_file \"" << path << "\"\n";
2209 case RC_PRINTFILEEXTENSION:
2210 if (ignore_system_lyxrc ||
2211 print_file_extension != system_lyxrc.print_file_extension) {
2212 os << "\\print_file_extension \""
2213 << print_file_extension
2220 << "# TEX SECTION #######################################\n"
2223 case RC_TEXINPUTS_PREFIX:
2224 if (ignore_system_lyxrc ||
2225 texinputs_prefix != system_lyxrc.texinputs_prefix) {
2226 os << "\\texinputs_prefix \"" << texinputs_prefix << "\"\n";
2231 case RC_FONT_ENCODING:
2232 if (ignore_system_lyxrc ||
2233 fontenc != system_lyxrc.fontenc) {
2234 os << "\\font_encoding \"" << fontenc << "\"\n";
2239 case RC_FORCE_PAINT_SINGLE_CHAR:
2240 if (ignore_system_lyxrc ||
2241 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2242 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2248 << "# FILE SECTION ######################################\n"
2251 case RC_DOCUMENTPATH:
2252 if (ignore_system_lyxrc ||
2253 document_path != system_lyxrc.document_path) {
2254 string const path = os::external_path(document_path);
2255 os << "\\document_path \"" << path << "\"\n";
2259 case RC_USELASTFILEPOS:
2260 if (ignore_system_lyxrc ||
2261 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2262 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2267 case RC_LOADSESSION:
2268 if (ignore_system_lyxrc ||
2269 load_session != system_lyxrc.load_session) {
2270 os << "\\load_session " << convert<string>(load_session)
2275 case RC_MOUSE_WHEEL_SPEED:
2276 if (ignore_system_lyxrc ||
2277 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2278 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2282 case RC_COMPLETION_INLINE_DELAY:
2283 if (ignore_system_lyxrc ||
2284 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2285 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2289 case RC_COMPLETION_INLINE_MATH:
2290 if (ignore_system_lyxrc ||
2291 completion_inline_math != system_lyxrc.completion_inline_math) {
2292 os << "\\completion_inline_math "
2293 << convert<string>(completion_inline_math) << '\n';
2297 case RC_COMPLETION_INLINE_TEXT:
2298 if (ignore_system_lyxrc ||
2299 completion_inline_text != system_lyxrc.completion_inline_text) {
2300 os << "\\completion_inline_text "
2301 << convert<string>(completion_inline_text) << '\n';
2305 case RC_COMPLETION_INLINE_DOTS:
2306 if (ignore_system_lyxrc ||
2307 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2308 os << "\\completion_inline_dots "
2309 << convert<string>(completion_inline_dots) << '\n';
2313 case RC_AUTOCORRECTION_MATH:
2314 if (ignore_system_lyxrc ||
2315 autocorrection_math != system_lyxrc.autocorrection_math) {
2316 os << "\\autocorrection_math "
2317 << convert<string>(autocorrection_math) << '\n';
2321 case RC_COMPLETION_POPUP_DELAY:
2322 if (ignore_system_lyxrc ||
2323 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2324 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2328 case RC_COMPLETION_POPUP_MATH:
2329 if (ignore_system_lyxrc ||
2330 completion_popup_math != system_lyxrc.completion_popup_math) {
2331 os << "\\completion_popup_math "
2332 << convert<string>(completion_popup_math) << '\n';
2336 case RC_COMPLETION_POPUP_TEXT:
2337 if (ignore_system_lyxrc ||
2338 completion_popup_text != system_lyxrc.completion_popup_text) {
2339 os << "\\completion_popup_text "
2340 << convert<string>(completion_popup_text) << '\n';
2344 case RC_COMPLETION_CURSOR_TEXT:
2345 if (ignore_system_lyxrc ||
2346 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2347 os << "\\completion_cursor_text "
2348 << convert<string>(completion_cursor_text) << '\n';
2352 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2353 if (ignore_system_lyxrc ||
2354 completion_popup_after_complete
2355 != system_lyxrc.completion_popup_after_complete) {
2356 os << "\\completion_popup_after_complete "
2357 << convert<string>(completion_popup_after_complete) << '\n';
2361 case RC_NUMLASTFILES:
2362 if (ignore_system_lyxrc ||
2363 num_lastfiles != system_lyxrc.num_lastfiles) {
2364 os << "\\num_lastfiles " << num_lastfiles << '\n';
2368 case RC_CHECKLASTFILES:
2369 if (ignore_system_lyxrc ||
2370 check_lastfiles != system_lyxrc.check_lastfiles) {
2371 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2376 case RC_EXAMPLEPATH:
2377 if (ignore_system_lyxrc ||
2378 example_path != system_lyxrc.example_path) {
2379 string const path = os::external_path(example_path);
2380 os << "\\example_path \"" << path << "\"\n";
2384 case RC_TEMPLATEPATH:
2385 if (ignore_system_lyxrc ||
2386 template_path != system_lyxrc.template_path) {
2387 string const path = os::external_path(template_path);
2388 os << "\\template_path \"" << path << "\"\n";
2392 case RC_TEMPDIRPATH:
2393 if (ignore_system_lyxrc ||
2394 tempdir_path != system_lyxrc.tempdir_path) {
2395 string const path = os::external_path(tempdir_path);
2396 os << "\\tempdir_path \"" << path << "\"\n";
2400 case RC_THESAURUSDIRPATH:
2401 if (ignore_system_lyxrc ||
2402 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2403 string const path = os::external_path(thesaurusdir_path);
2404 os << "\\thesaurusdir_path \"" << path << "\"\n";
2408 case RC_HUNSPELLDIR_PATH:
2409 if (ignore_system_lyxrc ||
2410 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2411 string const path = os::external_path(hunspelldir_path);
2412 os << "\\hunspelldir_path \"" << path << "\"\n";
2416 case RC_PLAINTEXT_LINELEN:
2417 if (ignore_system_lyxrc ||
2418 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2419 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2423 case RC_MAKE_BACKUP:
2424 if (ignore_system_lyxrc ||
2425 make_backup != system_lyxrc.make_backup) {
2426 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2430 case RC_SAVE_COMPRESSED:
2431 if (ignore_system_lyxrc ||
2432 save_compressed != system_lyxrc.save_compressed) {
2433 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2437 case RC_BACKUPDIR_PATH:
2438 if (ignore_system_lyxrc ||
2439 backupdir_path != system_lyxrc.backupdir_path) {
2440 string const path = os::external_path(backupdir_path);
2441 os << "\\backupdir_path \"" << path << "\"\n";
2447 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2451 << "# SPELLCHECKER SECTION ##############################\n"
2454 case RC_ACCEPT_COMPOUND:
2455 if (ignore_system_lyxrc ||
2456 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2457 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2463 if (ignore_system_lyxrc ||
2464 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2465 os << "\\alternate_language \"" << spellchecker_alt_lang
2471 if (ignore_system_lyxrc ||
2472 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2473 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2477 case RC_USE_SYSTEM_COLORS:
2478 if (ignore_system_lyxrc ||
2479 use_system_colors != system_lyxrc.use_system_colors) {
2480 os << "\\use_system_colors "
2481 << convert<string>(use_system_colors)
2486 case RC_USE_TOOLTIP:
2487 if (ignore_system_lyxrc ||
2488 use_tooltip != system_lyxrc.use_tooltip) {
2489 os << "\\use_tooltip "
2490 << convert<string>(use_tooltip)
2495 case RC_USE_PIXMAP_CACHE:
2496 if (ignore_system_lyxrc ||
2497 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2498 os << "\\use_pixmap_cache "
2499 << convert<string>(use_pixmap_cache)
2506 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2511 case RC_DEFAULT_DECIMAL_POINT:
2512 if (ignore_system_lyxrc ||
2513 default_decimal_point != system_lyxrc.default_decimal_point) {
2514 os << "\\default_decimal_point " << default_decimal_point << '\n';
2519 case RC_SPELLCHECKER:
2520 if (ignore_system_lyxrc ||
2521 spellchecker != system_lyxrc.spellchecker) {
2522 os << "\\spellchecker " << spellchecker << '\n';
2527 case RC_SPELLCHECK_CONTINUOUSLY:
2528 if (ignore_system_lyxrc ||
2529 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2530 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2536 case RC_SPELLCHECK_NOTES:
2537 if (ignore_system_lyxrc ||
2538 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2539 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2545 case RC_RTL_SUPPORT:
2546 if (ignore_system_lyxrc ||
2547 rtl_support != system_lyxrc.rtl_support) {
2548 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2552 case RC_VISUAL_CURSOR:
2553 if (ignore_system_lyxrc ||
2554 visual_cursor != system_lyxrc.visual_cursor) {
2555 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2559 case RC_LANGUAGE_CUSTOM_PACKAGE:
2560 if (ignore_system_lyxrc ||
2561 language_custom_package != system_lyxrc.language_custom_package) {
2562 os << "\\language_custom_package \"" << language_custom_package
2567 case RC_LANGUAGE_GLOBAL_OPTIONS:
2568 if (ignore_system_lyxrc ||
2569 language_global_options
2570 != system_lyxrc.language_global_options) {
2571 os << "\\language_global_options \""
2572 << convert<string>(language_global_options)
2577 case RC_LANGUAGE_PACKAGE_SELECTION:
2578 if (ignore_system_lyxrc ||
2579 language_package_selection != system_lyxrc.language_package_selection) {
2580 os << "\\language_package_selection ";
2581 switch (language_package_selection) {
2598 case RC_LANGUAGE_COMMAND_BEGIN:
2599 if (ignore_system_lyxrc ||
2600 language_command_begin
2601 != system_lyxrc.language_command_begin) {
2602 os << "\\language_command_begin \""
2603 << language_command_begin
2608 case RC_LANGUAGE_COMMAND_END:
2609 if (ignore_system_lyxrc ||
2610 language_command_end
2611 != system_lyxrc.language_command_end) {
2612 os << "\\language_command_end \"" << language_command_end
2617 case RC_LANGUAGE_COMMAND_LOCAL:
2618 if (ignore_system_lyxrc ||
2619 language_command_local
2620 != system_lyxrc.language_command_local) {
2621 os << "\\language_command_local \""
2622 << language_command_local
2627 case RC_LANGUAGE_AUTO_BEGIN:
2628 if (ignore_system_lyxrc ||
2629 language_auto_begin != system_lyxrc.language_auto_begin) {
2630 os << "\\language_auto_begin "
2631 << convert<string>(language_auto_begin) << '\n';
2635 case RC_LANGUAGE_AUTO_END:
2636 if (ignore_system_lyxrc ||
2637 language_auto_end != system_lyxrc.language_auto_end) {
2638 os << "\\language_auto_end "
2639 << convert<string>(language_auto_end) << '\n';
2643 case RC_MARK_FOREIGN_LANGUAGE:
2644 if (ignore_system_lyxrc ||
2645 mark_foreign_language
2646 != system_lyxrc.mark_foreign_language) {
2647 os << "\\mark_foreign_language " <<
2648 convert<string>(mark_foreign_language) << '\n';
2654 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2657 case RC_AUTO_NUMBER:
2658 if (ignore_system_lyxrc ||
2659 auto_number != system_lyxrc.auto_number) {
2660 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2664 case RC_DEFAULT_LANGUAGE:
2665 if (ignore_system_lyxrc ||
2666 default_language != system_lyxrc.default_language) {
2667 os << "\\default_language " << default_language << '\n';
2671 case RC_GUI_LANGUAGE:
2672 if (ignore_system_lyxrc ||
2673 gui_language != system_lyxrc.gui_language) {
2674 os << "\\gui_language " << gui_language << '\n';
2678 case RC_EXPORT_OVERWRITE:
2679 if (ignore_system_lyxrc ||
2680 export_overwrite != system_lyxrc.export_overwrite) {
2682 switch (export_overwrite) {
2693 os << "\\export_overwrite " << status << '\n';
2698 case RC_SCROLL_WHEEL_ZOOM:
2699 if (ignore_system_lyxrc ||
2700 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2702 switch (scroll_wheel_zoom) {
2703 case SCROLL_WHEEL_ZOOM_OFF:
2706 case SCROLL_WHEEL_ZOOM_CTRL:
2709 case SCROLL_WHEEL_ZOOM_SHIFT:
2712 case SCROLL_WHEEL_ZOOM_ALT:
2716 os << "\\scroll_wheel_zoom " << status << '\n';
2722 << "# FORMATS SECTION ##########################\n"
2726 // New/modified formats
2727 for (Formats::const_iterator cit = formats.begin();
2728 cit != formats.end(); ++cit) {
2729 Format const * format =
2730 system_formats.getFormat(cit->name());
2732 format->extension() != cit->extension() ||
2733 format->prettyname() != cit->prettyname() ||
2734 format->shortcut() != cit->shortcut() ||
2735 format->viewer() != cit->viewer() ||
2736 format->editor() != cit->editor() ||
2737 format->documentFormat() != cit->documentFormat() ||
2738 format->vectorFormat() != cit->vectorFormat() ||
2739 format->inExportMenu() != cit->inExportMenu()) {
2740 os << "\\format \"" << cit->name() << "\" \""
2741 << cit->extension() << "\" \""
2742 << cit->prettyname() << "\" \""
2743 << cit->shortcut() << "\" \""
2744 << escapeCommand(cit->viewer()) << "\" \""
2745 << escapeCommand(cit->editor()) << "\" \"";
2746 vector<string> flags;
2747 if (cit->documentFormat())
2748 flags.push_back("document");
2749 if (cit->vectorFormat())
2750 flags.push_back("vector");
2751 if (cit->inExportMenu())
2752 flags.push_back("menu=export");
2754 os << getStringFromVector(flags);
2759 // Look for deleted formats
2760 for (Formats::const_iterator cit = system_formats.begin();
2761 cit != system_formats.end(); ++cit)
2762 if (!formats.getFormat(cit->name()))
2763 os << "\\format \"" << cit->name()
2764 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2767 case RC_VIEWER_ALTERNATIVES: {
2768 Alternatives::const_iterator it = viewer_alternatives.begin();
2769 Alternatives::const_iterator const en = viewer_alternatives.end();
2770 Alternatives::const_iterator const sysend =
2771 system_lyxrc.viewer_alternatives.end();
2772 for (; it != en; ++it) {
2773 string const & fmt = it->first;
2774 CommandSet const & cmd = it->second;
2775 CommandSet::const_iterator sit = cmd.begin();
2776 CommandSet::const_iterator const sen = cmd.end();
2777 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2778 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2779 system_lyxrc.viewer_alternatives.find(fmt);
2780 for (; sit != sen; ++sit) {
2781 string const & cmd = *sit;
2782 if (ignore_system_lyxrc
2783 || sysfmt == sysend // format not found
2784 || sysfmt->second.count(cmd) == 0 // this command not found
2786 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2792 case RC_EDITOR_ALTERNATIVES: {
2793 Alternatives::const_iterator it = editor_alternatives.begin();
2794 Alternatives::const_iterator const en = editor_alternatives.end();
2795 Alternatives::const_iterator const sysend =
2796 system_lyxrc.editor_alternatives.end();
2797 for (; it != en; ++it) {
2798 string const & fmt = it->first;
2799 CommandSet const & cmd = it->second;
2800 CommandSet::const_iterator sit = cmd.begin();
2801 CommandSet::const_iterator const sen = cmd.end();
2802 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2803 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2804 system_lyxrc.editor_alternatives.find(fmt);
2805 for (; sit != sen; ++sit) {
2806 string const & cmd = *sit;
2807 if (ignore_system_lyxrc
2808 || sysfmt == sysend // format not found
2809 || sysfmt->second.count(cmd) == 0 // this command not found
2811 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2817 case RC_DEFAULT_VIEW_FORMAT:
2818 if (ignore_system_lyxrc ||
2819 default_view_format != system_lyxrc.default_view_format) {
2820 os << "\\default_view_format " << default_view_format << '\n';
2830 << "# CONVERTERS SECTION ##########################\n"
2834 // Look for new converters
2835 for (Converters::const_iterator cit = theConverters().begin();
2836 cit != theConverters().end(); ++cit) {
2837 Converter const * converter =
2838 theSystemConverters().getConverter(cit->from,
2841 converter->command != cit->command ||
2842 converter->flags != cit->flags)
2843 os << "\\converter \"" << cit->from << "\" \""
2844 << cit->to << "\" \""
2845 << escapeCommand(cit->command) << "\" \""
2846 << cit->flags << "\"\n";
2849 // New/modifed converters
2850 for (Converters::const_iterator cit = theSystemConverters().begin();
2851 cit != theSystemConverters().end(); ++cit)
2852 if (!theConverters().getConverter(cit->from, cit->to))
2853 os << "\\converter \"" << cit->from
2854 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2861 << "# COPIERS SECTION ##########################\n"
2864 // Look for new movers
2865 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2866 Movers::const_iterator const sysend = theSystemMovers().end();
2867 Movers::const_iterator it = theMovers().begin();
2868 Movers::const_iterator end = theMovers().end();
2870 for (; it != end; ++it) {
2871 Movers::const_iterator const sysit =
2872 find_if(sysbegin, sysend, SameMover(*it));
2873 if (sysit == sysend) {
2874 string const & fmt = it->first;
2875 string const & command =
2876 it->second.command();
2878 os << "\\copier " << fmt
2879 << " \"" << escapeCommand(command) << "\"\n";
2885 // We don't actually delete SpecialisedMover(s) from the
2886 // map, just clear their 'command', so there's no need
2887 // to test for anything else.
2894 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2896 // Why the switch you might ask. It is a trick to ensure that all
2897 // the elements in the LyXRCTags enum is handled. As you can see
2898 // there are no breaks at all. So it is just a huge fall-through.
2899 // The nice thing is that we will get a warning from the compiler
2900 // if we forget an element.
2901 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2903 case LyXRC::RC_LAST:
2904 case LyXRC::RC_ACCEPT_COMPOUND:
2905 case LyXRC::RC_ALT_LANG:
2906 case LyXRC::RC_PLAINTEXT_LINELEN:
2907 case LyXRC::RC_AUTOCORRECTION_MATH:
2908 case LyXRC::RC_AUTOREGIONDELETE:
2909 case LyXRC::RC_AUTORESET_OPTIONS:
2910 case LyXRC::RC_AUTOSAVE:
2911 case LyXRC::RC_AUTO_NUMBER:
2912 case LyXRC::RC_BACKUPDIR_PATH:
2913 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2914 case LyXRC::RC_BIBTEX_COMMAND:
2915 case LyXRC::RC_BINDFILE:
2916 case LyXRC::RC_CHECKLASTFILES:
2917 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2918 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2919 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2920 case LyXRC::RC_COMPLETION_INLINE_MATH:
2921 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2922 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2923 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2924 case LyXRC::RC_COMPLETION_POPUP_MATH:
2925 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2926 case LyXRC::RC_USELASTFILEPOS:
2927 case LyXRC::RC_LOADSESSION:
2928 case LyXRC::RC_CHKTEX_COMMAND:
2929 case LyXRC::RC_CONVERTER:
2930 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2931 case LyXRC::RC_COPIER:
2932 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2933 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2934 case LyXRC::RC_DATE_INSERT_FORMAT:
2935 case LyXRC::RC_DEFAULT_LANGUAGE:
2936 case LyXRC::RC_GUI_LANGUAGE:
2937 case LyXRC::RC_DEFAULT_PAPERSIZE:
2938 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2939 case LyXRC::RC_DEFFILE:
2940 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2941 case LyXRC::RC_DISPLAY_GRAPHICS:
2942 case LyXRC::RC_DOCUMENTPATH:
2943 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2944 FileName path(lyxrc_new.document_path);
2945 if (path.exists() && path.isDirectory())
2946 package().document_dir() = FileName(lyxrc.document_path);
2948 case LyXRC::RC_EDITOR_ALTERNATIVES:
2949 case LyXRC::RC_ESC_CHARS:
2950 case LyXRC::RC_EXAMPLEPATH:
2951 case LyXRC::RC_FONT_ENCODING:
2952 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2953 case LyXRC::RC_FILEFORMAT:
2954 case LyXRC::RC_GROUP_LAYOUTS:
2955 case LyXRC::RC_HUNSPELLDIR_PATH:
2956 case LyXRC::RC_ICON_SET:
2957 case LyXRC::RC_INDEX_ALTERNATIVES:
2958 case LyXRC::RC_INDEX_COMMAND:
2959 case LyXRC::RC_JBIBTEX_COMMAND:
2960 case LyXRC::RC_JINDEX_COMMAND:
2961 case LyXRC::RC_NOMENCL_COMMAND:
2962 case LyXRC::RC_INPUT:
2963 case LyXRC::RC_KBMAP:
2964 case LyXRC::RC_KBMAP_PRIMARY:
2965 case LyXRC::RC_KBMAP_SECONDARY:
2966 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2967 case LyXRC::RC_LANGUAGE_AUTO_END:
2968 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2969 case LyXRC::RC_LANGUAGE_COMMAND_END:
2970 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2971 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2972 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2973 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2974 case LyXRC::RC_LYXRCFORMAT:
2975 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2976 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2977 case LyXRC::RC_MACRO_EDIT_STYLE:
2978 case LyXRC::RC_MAKE_BACKUP:
2979 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2980 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2981 case LyXRC::RC_NUMLASTFILES:
2982 case LyXRC::RC_PARAGRAPH_MARKERS:
2983 case LyXRC::RC_PATH_PREFIX:
2984 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2985 prependEnvPath("PATH", lyxrc_new.path_prefix);
2987 case LyXRC::RC_PREVIEW:
2988 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2989 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2990 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2991 case LyXRC::RC_PRINTCOPIESFLAG:
2992 case LyXRC::RC_PRINTER:
2993 case LyXRC::RC_PRINTEVENPAGEFLAG:
2994 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2995 case LyXRC::RC_PRINTFILEEXTENSION:
2996 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2997 case LyXRC::RC_PRINTODDPAGEFLAG:
2998 case LyXRC::RC_PRINTPAGERANGEFLAG:
2999 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
3000 case LyXRC::RC_PRINTPAPERFLAG:
3001 case LyXRC::RC_PRINTREVERSEFLAG:
3002 case LyXRC::RC_PRINTSPOOL_COMMAND:
3003 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
3004 case LyXRC::RC_PRINTTOFILE:
3005 case LyXRC::RC_PRINTTOPRINTER:
3006 case LyXRC::RC_PRINT_ADAPTOUTPUT:
3007 case LyXRC::RC_PRINT_COMMAND:
3008 case LyXRC::RC_RTL_SUPPORT:
3009 case LyXRC::RC_SAVE_COMPRESSED:
3010 case LyXRC::RC_SCREEN_DPI:
3011 case LyXRC::RC_SCREEN_FONT_ROMAN:
3012 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
3013 case LyXRC::RC_SCREEN_FONT_SANS:
3014 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
3015 case LyXRC::RC_SCREEN_FONT_SCALABLE:
3016 case LyXRC::RC_SCREEN_FONT_SIZES:
3017 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
3018 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3019 case LyXRC::RC_GEOMETRY_SESSION:
3020 case LyXRC::RC_SCREEN_ZOOM:
3021 case LyXRC::RC_SERVERPIPE:
3022 case LyXRC::RC_SET_COLOR:
3023 case LyXRC::RC_SHOW_BANNER:
3024 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
3025 case LyXRC::RC_SPELLCHECKER:
3026 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
3027 case LyXRC::RC_SPELLCHECK_NOTES:
3028 case LyXRC::RC_SPLITINDEX_COMMAND:
3029 case LyXRC::RC_TEMPDIRPATH:
3030 case LyXRC::RC_TEMPLATEPATH:
3031 case LyXRC::RC_TEX_ALLOWS_SPACES:
3032 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
3033 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
3034 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
3036 case LyXRC::RC_TEXINPUTS_PREFIX:
3037 case LyXRC::RC_THESAURUSDIRPATH:
3038 case LyXRC::RC_UIFILE:
3039 case LyXRC::RC_USER_EMAIL:
3040 case LyXRC::RC_USER_NAME:
3041 case LyXRC::RC_USE_CONVERTER_CACHE:
3042 case LyXRC::RC_USE_SYSTEM_COLORS:
3043 case LyXRC::RC_USE_TOOLTIP:
3044 case LyXRC::RC_USE_PIXMAP_CACHE:
3045 case LyXRC::RC_VIEWDVI_PAPEROPTION:
3046 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
3047 case LyXRC::RC_SINGLE_INSTANCE:
3048 case LyXRC::RC_SORT_LAYOUTS:
3049 case LyXRC::RC_FULL_SCREEN_LIMIT:
3050 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
3051 case LyXRC::RC_FULL_SCREEN_MENUBAR:
3052 case LyXRC::RC_FULL_SCREEN_TABBAR:
3053 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
3054 case LyXRC::RC_FULL_SCREEN_WIDTH:
3055 case LyXRC::RC_VISUAL_CURSOR:
3056 case LyXRC::RC_VIEWER:
3057 case LyXRC::RC_VIEWER_ALTERNATIVES:
3058 case LyXRC::RC_FORWARD_SEARCH_DVI:
3059 case LyXRC::RC_FORWARD_SEARCH_PDF:
3060 case LyXRC::RC_EXPORT_OVERWRITE:
3061 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3062 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3063 case LyXRC::RC_CURSOR_WIDTH:
3070 string const LyXRC::getDescription(LyXRCTags tag)
3075 case RC_ACCEPT_COMPOUND:
3076 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3080 str = _("Specify an alternate language. The default is to use the language of the document.");
3083 case RC_PLAINTEXT_LINELEN:
3084 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.");
3087 case RC_AUTOREGIONDELETE:
3088 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3091 case RC_AUTORESET_OPTIONS:
3092 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3096 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3099 case RC_AUTO_NUMBER:
3102 case RC_BACKUPDIR_PATH:
3103 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.");
3106 case RC_BIBTEX_COMMAND:
3107 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3110 case RC_JBIBTEX_COMMAND:
3111 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3115 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3118 case RC_CHECKLASTFILES:
3119 str = _("Select to check whether the lastfiles still exist.");
3122 case RC_CHKTEX_COMMAND:
3123 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3132 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3133 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.");
3136 case RC_CURSOR_WIDTH:
3137 str = _("Configure the width of the text cursor. Automatic zoom-controlled cursor width used when set to 0.");
3140 case RC_SCROLL_BELOW_DOCUMENT:
3141 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");
3144 case RC_MAC_DONTSWAP_CTRL_META:
3145 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3148 case RC_MAC_LIKE_WORD_MOVEMENT:
3149 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3152 case RC_SHOW_MACRO_LABEL:
3153 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3156 case RC_DATE_INSERT_FORMAT:
3157 //xgettext:no-c-format
3158 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3162 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3165 case RC_DEFAULT_VIEW_FORMAT:
3166 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3169 case RC_DEFAULT_LANGUAGE:
3170 str = _("New documents will be assigned this language.");
3173 case RC_DEFAULT_PAPERSIZE:
3174 str = _("Specify the default paper size.");
3177 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3178 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3181 case RC_DISPLAY_GRAPHICS:
3182 str = _("Select how LyX will display any graphics.");
3185 case RC_DOCUMENTPATH:
3186 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3190 str = _("Specify additional chars that can be part of a word.");
3193 case RC_EXAMPLEPATH:
3194 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3197 case RC_FONT_ENCODING:
3198 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3201 case RC_FORCE_PAINT_SINGLE_CHAR:
3202 str = _("Disable any kerning and ligatures for text drawing on screen.");
3208 case RC_INDEX_COMMAND:
3209 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\".");
3212 case RC_JINDEX_COMMAND:
3213 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3216 case RC_NOMENCL_COMMAND:
3217 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3224 case RC_KBMAP_PRIMARY:
3225 case RC_KBMAP_SECONDARY:
3226 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.");
3229 case RC_LANGUAGE_AUTO_BEGIN:
3230 str = _("Select if a language switching command is needed at the beginning of the document.");
3233 case RC_LANGUAGE_AUTO_END:
3234 str = _("Select if a language switching command is needed at the end of the document.");
3237 case RC_LANGUAGE_COMMAND_BEGIN:
3238 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.");
3241 case RC_LANGUAGE_COMMAND_END:
3242 str = _("The LaTeX command for changing back to the language of the document.");
3245 case RC_LANGUAGE_COMMAND_LOCAL:
3246 str = _("The LaTeX command for local changing of the language.");
3249 case RC_LANGUAGE_GLOBAL_OPTIONS:
3250 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3253 case RC_LANGUAGE_CUSTOM_PACKAGE:
3254 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3257 case RC_LANGUAGE_PACKAGE_SELECTION:
3258 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3261 case RC_USELASTFILEPOS:
3262 str = _("De-select if you do not want LyX to scroll to saved position.");
3265 case RC_LOADSESSION:
3266 str = _("De-select to prevent loading files opened from the last LyX session.");
3269 case RC_MAKE_BACKUP:
3270 str = _("De-select if you don't want LyX to create backup files.");
3273 case RC_MARK_FOREIGN_LANGUAGE:
3274 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3277 case RC_MOUSE_WHEEL_SPEED:
3278 str = bformat(_("The scrolling speed of the mouse wheel."),
3282 case RC_COMPLETION_POPUP_DELAY:
3283 str = _("The completion popup delay.");
3286 case RC_COMPLETION_POPUP_MATH:
3287 str = _("Select to display the completion popup in math mode.");
3290 case RC_COMPLETION_POPUP_TEXT:
3291 str = _("Select to display the completion popup in text mode.");
3294 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3295 str = _("Show the completion popup without delay after non-unique completion attempt.");
3298 case RC_COMPLETION_POPUP_TEXT:
3299 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3302 case RC_COMPLETION_POPUP_DELAY:
3303 str = _("The inline completion delay.");
3306 case RC_COMPLETION_INLINE_MATH:
3307 str = _("Select to display the inline completion in math mode.");
3310 case RC_COMPLETION_INLINE_TEXT:
3311 str = _("Select to display the inline completion in text mode.");
3314 case RC_COMPLETION_INLINE_DOTS:
3315 str = _("Use \"...\" to shorten long completions.");
3318 case RC_AUTOCORRECTION_MATH:
3319 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3322 case RC_NUMLASTFILES:
3323 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3327 case RC_PATH_PREFIX:
3328 str = _("Specify those directories which should be "
3329 "prepended to the PATH environment variable.\n"
3330 "Use the OS native format.");
3334 str = _("Shows a typeset preview of things such as math");
3337 case RC_PREVIEW_HASHED_LABELS:
3338 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3341 case RC_PREVIEW_SCALE_FACTOR:
3342 str = _("Scale the preview size to suit.");
3345 case RC_PRINTCOLLCOPIESFLAG:
3346 str = _("The option for specifying whether the copies should be collated.");
3349 case RC_PRINTCOPIESFLAG:
3350 str = _("The option for specifying the number of copies to print.");
3354 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3357 case RC_PRINTEVENPAGEFLAG:
3358 str = _("The option to print only even pages.");
3361 case RC_PRINTEXSTRAOPTIONS:
3362 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3365 case RC_PRINTFILEEXTENSION:
3366 str = _("Extension of printer program output file. Usually \".ps\".");
3369 case RC_PRINTLANDSCAPEFLAG:
3370 str = _("The option to print out in landscape.");
3373 case RC_PRINTODDPAGEFLAG:
3374 str = _("The option to print only odd pages.");
3377 case RC_PRINTPAGERANGEFLAG:
3378 str = _("The option for specifying a comma-separated list of pages to print.");
3381 case RC_PRINTPAPERDIMENSIONFLAG:
3382 str = _("Option to specify the dimensions of the print paper.");
3385 case RC_PRINTPAPERFLAG:
3386 str = _("The option to specify paper type.");
3389 case RC_PRINTREVERSEFLAG:
3390 str = _("The option to reverse the order of the pages printed.");
3393 case RC_PRINTSPOOL_COMMAND:
3394 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.");
3397 case RC_PRINTSPOOL_PRINTERPREFIX:
3398 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.");
3401 case RC_PRINTTOFILE:
3402 str = _("Option to pass to the print program to print to a file.");
3405 case RC_PRINTTOPRINTER:
3406 str = _("Option to pass to the print program to print on a specific printer.");
3409 case RC_PRINT_ADAPTOUTPUT:
3410 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3413 case RC_PRINT_COMMAND:
3414 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3417 case RC_RTL_SUPPORT:
3418 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3421 case RC_VISUAL_CURSOR:
3422 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3426 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3429 case RC_SCREEN_FONT_ROMAN:
3430 case RC_SCREEN_FONT_SANS:
3431 case RC_SCREEN_FONT_TYPEWRITER:
3432 str = _("The screen fonts used to display the text while editing.");
3435 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3436 case RC_SCREEN_FONT_SANS_FOUNDRY:
3437 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3440 case RC_SCREEN_FONT_SCALABLE:
3441 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.");
3444 case RC_SCREEN_FONT_SIZES:
3445 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3448 case RC_SCREEN_ZOOM:
3449 //xgettext:no-c-format
3450 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3453 case RC_GEOMETRY_SESSION:
3454 str = _("Allow session manager to save and restore windows geometry.");
3458 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3464 case RC_SHOW_BANNER:
3465 str = _("De-select if you don't want the startup banner.");
3468 case RC_TEMPDIRPATH:
3469 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3472 case RC_THESAURUSDIRPATH:
3473 str = _("This is the place where the files of the thesaurus library reside.");
3476 case RC_TEMPLATEPATH:
3477 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3480 case RC_TEX_ALLOWS_SPACES:
3483 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3486 case RC_TEXINPUTS_PREFIX:
3487 str = _("Specify those directories which should be "
3488 "prepended to the TEXINPUTS environment variable.\n"
3489 "A '.' represents the current document directory. "
3490 "Use the OS native format.");
3494 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3503 case RC_USE_USE_SYSTEM_COLORS:
3504 str = _("Enable use the system colors for some things like main window background and selection.");
3507 case RC_USE_TOOLTIP:
3508 str = _("Enable the automatic appearance of tool tips in the work area.");
3511 case RC_USE_PIXMAP_CACHE:
3512 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3515 case RC_VIEWDVI_PAPEROPTION:
3516 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3531 // The global instance
3534 // The global copy of the system lyxrc entries (everything except preferences)