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 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
89 { "\\def_file", LyXRC::RC_DEFFILE },
90 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
91 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
92 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
93 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
94 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
95 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
96 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
97 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
98 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
99 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
100 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
101 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
102 { "\\force_paint_single_char", LyXRC::RC_FORCE_PAINT_SINGLE_CHAR },
103 { "\\format", LyXRC::RC_FILEFORMAT },
104 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
105 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
106 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
107 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
108 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
109 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
110 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
111 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
112 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
113 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
114 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
115 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
116 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
117 { "\\input", LyXRC::RC_INPUT },
118 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
119 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
120 { "\\kbmap", LyXRC::RC_KBMAP },
121 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
122 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
123 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
124 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
125 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
126 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
127 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
128 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
129 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
130 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
131 { "\\load_session", LyXRC::RC_LOADSESSION },
132 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
133 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
134 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
135 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
136 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
137 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
138 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
139 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
140 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
141 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
142 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
143 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
144 { "\\preview", LyXRC::RC_PREVIEW },
145 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
146 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
147 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
148 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
149 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
150 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
151 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
152 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
153 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
154 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
155 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
156 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
157 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
158 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
159 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
160 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
161 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
162 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
163 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
164 { "\\printer", LyXRC::RC_PRINTER },
165 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
166 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
167 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
168 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
169 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
170 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
171 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
172 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
173 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
174 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
175 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
176 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
177 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
178 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
179 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
180 { "\\set_color", LyXRC::RC_SET_COLOR },
181 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
182 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
183 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
184 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
185 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
186 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
187 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
188 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
189 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
190 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
191 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
192 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
193 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
194 { "\\ui_file", LyXRC::RC_UIFILE },
195 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
196 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
197 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
198 // compatibility with versions older than 1.4.0 only
199 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
200 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
201 { "\\user_email", LyXRC::RC_USER_EMAIL },
202 { "\\user_name", LyXRC::RC_USER_NAME },
203 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
204 // compatibility with versions older than 1.4.0 only
205 { "\\viewer", LyXRC::RC_VIEWER},
206 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
207 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
208 { "format", LyXRC::RC_LYXRCFORMAT }
211 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
222 void LyXRC::setDefaults()
225 def_file = "default";
227 // Get printer from the environment. If fail, use default "",
228 // assuming that everything is set up correctly.
229 printer = getEnv("PRINTER");
230 print_adapt_output = false;
231 print_command = "dvips";
232 print_evenpage_flag = "-B";
233 print_oddpage_flag = "-A";
234 print_pagerange_flag = "-pp";
235 print_copies_flag = "-c";
236 print_collcopies_flag = "-C";
237 print_reverse_flag = "-r";
238 print_landscape_flag = "-t landscape";
239 print_to_printer = "-P";
240 print_to_file = "-o ";
241 print_file_extension = ".ps";
242 print_paper_flag = "-t";
243 print_paper_dimension_flag = "-T";
244 document_path.erase();
245 view_dvi_paper_option.erase();
246 default_papersize = PAPER_DEFAULT;
247 default_view_format = "pdf2";
248 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
249 bibtex_command = "bibtex";
251 index_command = "makeindex -c -q";
252 nomencl_command = "makeindex -s nomencl.ist";
254 // Because a screen is typically wider than a piece of paper:
256 allow_geometry_session = true;
257 // Default LaTeX font size:
258 font_sizes[FONT_SIZE_TINY] = "5.0";
259 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
260 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
261 font_sizes[FONT_SIZE_SMALL] = "9.0";
262 font_sizes[FONT_SIZE_NORMAL] = "10.0";
263 font_sizes[FONT_SIZE_LARGE] = "12.0";
264 font_sizes[FONT_SIZE_LARGER] = "14.4";
265 font_sizes[FONT_SIZE_LARGEST] = "17.26";
266 font_sizes[FONT_SIZE_HUGE] = "20.74";
267 font_sizes[FONT_SIZE_HUGER] = "24.88";
268 use_scalable_fonts = true;
269 roman_font_name = "";
271 typewriter_font_name = "";
273 auto_region_delete = true;
274 auto_reset_options = false;
275 plaintext_linelen = 65;
276 mouse_wheel_speed = 1.0;
277 num_lastfiles = maxlastfiles;
278 check_lastfiles = true;
279 use_lastfilepos = true;
280 load_session = false;
282 save_compressed = false;
283 backupdir_path.erase();
284 display_graphics = true;
285 // Spellchecker settings:
286 // FIXME: this check should test the target platform (darwin)
287 #if defined(USE_MACOSX_PACKAGING)
288 spellchecker = "native";
289 #elif defined(USE_ASPELL)
290 spellchecker = "aspell";
291 #elif defined(USE_HUNSPELL)
292 spellchecker = "hunspell";
294 spellchecker = "aspell";
296 spellchecker_accept_compound = false;
297 spellcheck_continuously = false;
298 spellcheck_notes = true;
301 visual_cursor = false;
303 mark_foreign_language = true;
304 language_auto_begin = true;
305 language_auto_end = true;
306 language_global_options = true;
307 language_package_selection = LP_AUTO;
308 language_custom_package = "\\usepackage{babel}";
309 language_command_begin = "\\selectlanguage{$$lang}";
310 language_command_local = "\\foreignlanguage{$$lang}{";
311 sort_layouts = false;
312 group_layouts = true;
313 default_language = "english";
314 gui_language = "auto";
316 windows_style_tex_paths = false;
317 tex_allows_spaces = false;
318 date_insert_format = "%x";
319 cursor_follows_scrollbar = false;
320 scroll_below_document = false;
321 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
322 paragraph_markers = false;
323 mac_dontswap_ctrl_meta = false;
324 mac_like_word_movement = false;
325 macro_edit_style = MACRO_EDIT_INLINE_BOX;
326 dialogs_iconify_with_main = false;
327 preview = PREVIEW_OFF;
328 preview_hashed_labels = false;
329 preview_scale_factor = 1.0;
330 use_converter_cache = true;
331 use_system_colors = false;
333 use_pixmap_cache = false;
334 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
335 user_name = to_utf8(support::user_name());
336 user_email = to_utf8(support::user_email());
337 open_buffers_in_tabs = true;
338 single_close_tab_button = false;
339 single_instance = true;
340 forward_search_dvi = string();
341 forward_search_pdf = string();
342 export_overwrite = NO_FILES;
344 // Fullscreen settings
345 full_screen_limit = false;
346 full_screen_toolbars = true;
347 full_screen_tabbar = true;
348 full_screen_menubar = true;
349 full_screen_scrollbar = true;
350 full_screen_width = 700;
352 completion_cursor_text = true;
353 completion_popup_math = true;
354 completion_popup_text = false;
355 completion_popup_delay = 2.0;
356 completion_popup_after_complete = true;
357 autocorrection_math = false;
358 completion_inline_math = true;
359 completion_inline_text = false;
360 completion_inline_dots = -1;
361 completion_inline_delay = 0.2;
362 default_decimal_point = ".";
368 void oldFontFormat(string & family, string & foundry)
370 if (family.empty() || family[0] != '-')
372 foundry = token(family, '-', 1);
373 family = token(family, '-', 2);
381 bool LyXRC::read(FileName const & filename, bool check_format)
383 Lexer lexrc(lyxrcTags);
384 lexrc.setFile(filename);
385 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
386 ReturnValues retval = read(lexrc, check_format);
387 if (!check_format || retval != FormatMismatch)
388 return retval == ReadOK;
390 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
391 FileName const tempfile = FileName::tempName("convert_lyxrc");
392 bool const success = prefs2prefs(filename, tempfile, false);
394 LYXERR0 ("Unable to convert " << filename.absFileName() <<
395 " to format " << LYXRC_FILEFORMAT);
398 Lexer lexrc2(lyxrcTags);
399 lexrc2.setFile(tempfile);
400 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
401 retval = read(lexrc2, check_format);
402 tempfile.removeFile();
403 return retval == ReadOK;
407 // don't need to worry about conversion, because this is always
408 // from an internal source
409 bool LyXRC::read(istream & is)
411 Lexer lexrc(lyxrcTags);
413 LYXERR(Debug::LYXRC, "Reading istream...");
414 return read(lexrc, false) == ReadOK;
418 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
420 if (lyxerr.debugging(Debug::PARSER))
421 lexrc.printTable(lyxerr);
426 // default for current rowpainter capabilities
427 force_paint_single_char = true;
429 // format prior to 2.0 and introduction of format tag
430 unsigned int format = 0;
432 while (lexrc.isOK()) {
433 // By using two switches we take advantage of the compiler
434 // telling us if we have missed a LyXRCTags element in
435 // the second switch.
436 // Note that this also shows a problem with Lexer since it
437 // helps us avoid taking advantage of the strictness of the
440 int le = lexrc.lex();
442 case Lexer::LEX_UNDEF:
443 lexrc.printError("Unknown tag `$$Token'");
445 case Lexer::LEX_FEOF:
450 switch (static_cast<LyXRCTags>(le)) {
453 format = lexrc.getInteger();
455 case RC_INPUT: // Include file
458 libFileSearch(string(),
460 if (read(tmp, check_format)) {
462 "Error reading included file: " + tmp.absFileName());
468 bind_file = os::internal_path(lexrc.getString());
473 def_file = os::internal_path(lexrc.getString());
478 ui_file = os::internal_path(lexrc.getString());
481 case RC_AUTORESET_OPTIONS:
482 lexrc >> auto_reset_options;
485 case RC_DISPLAY_GRAPHICS:
487 display_graphics = lexrc.getString() == "true";
490 case RC_TEX_EXPECTS_WINDOWS_PATHS:
491 lexrc >> windows_style_tex_paths;
494 case RC_TEX_ALLOWS_SPACES:
495 lexrc >> tex_allows_spaces;
502 case RC_KBMAP_PRIMARY:
504 string const kmap(os::internal_path(lexrc.getString()));
505 if (!libFileSearch("kbd", kmap, "kmap").empty()
507 primary_kbmap = kmap;
509 lexrc.printError("LyX: Keymap `$$Token' not found");
514 case RC_KBMAP_SECONDARY:
516 string const kmap(os::internal_path(lexrc.getString()));
517 if (!libFileSearch("kbd", kmap, "kmap").empty()
519 secondary_kbmap = kmap;
521 lexrc.printError("LyX: Keymap `$$Token' not found");
526 case RC_FONT_ENCODING:
530 case RC_FORCE_PAINT_SINGLE_CHAR:
531 lexrc >> force_paint_single_char;
538 case RC_PRINT_COMMAND:
539 if (lexrc.next(true)) {
540 print_command = lexrc.getString();
544 case RC_PRINTEVENPAGEFLAG:
545 lexrc >> print_evenpage_flag;
548 case RC_PRINTODDPAGEFLAG:
549 lexrc >> print_oddpage_flag;
552 case RC_PRINTPAGERANGEFLAG:
553 lexrc >> print_pagerange_flag;
556 case RC_PRINTCOPIESFLAG:
557 lexrc >> print_copies_flag;
560 case RC_PRINTCOLLCOPIESFLAG:
561 lexrc >> print_collcopies_flag;
564 case RC_PRINTREVERSEFLAG:
565 lexrc >> print_reverse_flag;
568 case RC_PRINTLANDSCAPEFLAG:
569 lexrc >> print_landscape_flag;
572 case RC_PRINTTOPRINTER:
573 lexrc >> print_to_printer;
576 case RC_PRINT_ADAPTOUTPUT:
577 lexrc >> print_adapt_output;
582 print_to_file = os::internal_path(lexrc.getString());
586 case RC_PRINTFILEEXTENSION:
587 lexrc >> print_file_extension;
590 case RC_PRINTEXSTRAOPTIONS:
591 lexrc >> print_extra_options;
594 case RC_PRINTSPOOL_COMMAND:
595 if (lexrc.next(true)) {
596 print_spool_command = lexrc.getString();
600 case RC_PRINTSPOOL_PRINTERPREFIX:
601 lexrc >> print_spool_printerprefix;
604 case RC_PRINTPAPERDIMENSIONFLAG:
605 lexrc >> print_paper_dimension_flag;
608 case RC_PRINTPAPERFLAG:
609 lexrc >> print_paper_flag;
612 case RC_DEFAULT_PAPERSIZE:
614 string const size = ascii_lowercase(lexrc.getString());
615 if (size == "usletter")
616 default_papersize = PAPER_USLETTER;
617 else if (size == "legal")
618 default_papersize = PAPER_USLEGAL;
619 else if (size == "executive")
620 default_papersize = PAPER_USEXECUTIVE;
621 else if (size == "a3")
622 default_papersize = PAPER_A3;
623 else if (size == "a4")
624 default_papersize = PAPER_A4;
625 else if (size == "a5")
626 default_papersize = PAPER_A5;
627 else if (size == "b5")
628 default_papersize = PAPER_B5;
629 else if (size == "default")
630 default_papersize = PAPER_DEFAULT;
634 case RC_VIEWDVI_PAPEROPTION:
636 view_dvi_paper_option = lexrc.getString();
638 view_dvi_paper_option.erase();
641 case RC_CHKTEX_COMMAND:
642 if (lexrc.next(true)) {
643 chktex_command = lexrc.getString();
647 case RC_BIBTEX_ALTERNATIVES:
648 if (lexrc.next(true)) {
649 bibtex_alternatives.insert(lexrc.getString());
653 case RC_BIBTEX_COMMAND:
654 if (lexrc.next(true)) {
655 bibtex_command = lexrc.getString();
659 case RC_JBIBTEX_COMMAND:
660 if (lexrc.next(true)) {
661 jbibtex_command = lexrc.getString();
665 case RC_INDEX_ALTERNATIVES:
666 if (lexrc.next(true)) {
667 index_alternatives.insert(lexrc.getString());
671 case RC_INDEX_COMMAND:
672 if (lexrc.next(true)) {
673 index_command = lexrc.getString();
677 case RC_JINDEX_COMMAND:
678 if (lexrc.next(true)) {
679 jindex_command = lexrc.getString();
683 case RC_SPLITINDEX_COMMAND:
684 if (lexrc.next(true)) {
685 splitindex_command = lexrc.getString();
689 case RC_NOMENCL_COMMAND:
690 if (lexrc.next(true)) {
691 nomencl_command = lexrc.getString();
703 case RC_GEOMETRY_SESSION:
704 lexrc >> allow_geometry_session;
707 case RC_SCREEN_FONT_SIZES:
708 lexrc >> font_sizes[FONT_SIZE_TINY];
709 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
710 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
711 lexrc >> font_sizes[FONT_SIZE_SMALL];
712 lexrc >> font_sizes[FONT_SIZE_NORMAL];
713 lexrc >> font_sizes[FONT_SIZE_LARGE];
714 lexrc >> font_sizes[FONT_SIZE_LARGER];
715 lexrc >> font_sizes[FONT_SIZE_LARGEST];
716 lexrc >> font_sizes[FONT_SIZE_HUGE];
717 lexrc >> font_sizes[FONT_SIZE_HUGER];
720 case RC_SCREEN_FONT_SCALABLE:
721 lexrc >> use_scalable_fonts;
728 case RC_DOCUMENTPATH:
730 document_path = os::internal_path(lexrc.getString());
731 document_path = expandPath(document_path);
737 example_path = os::internal_path(lexrc.getString());
738 example_path = expandPath(example_path);
742 case RC_TEMPLATEPATH:
744 template_path = os::internal_path(lexrc.getString());
745 template_path = expandPath(template_path);
751 tempdir_path = os::internal_path(lexrc.getString());
752 tempdir_path = expandPath(tempdir_path);
756 case RC_THESAURUSDIRPATH:
758 thesaurusdir_path = os::internal_path(lexrc.getString());
759 thesaurusdir_path = expandPath(thesaurusdir_path);
763 case RC_HUNSPELLDIR_PATH:
765 hunspelldir_path = os::internal_path(lexrc.getString());
766 hunspelldir_path = expandPath(hunspelldir_path);
770 case RC_USELASTFILEPOS:
771 lexrc >> use_lastfilepos;
775 lexrc >> load_session;
778 case RC_MOUSE_WHEEL_SPEED:
779 lexrc >> mouse_wheel_speed;
782 case RC_COMPLETION_INLINE_DELAY:
783 lexrc >> completion_inline_delay;
786 case RC_COMPLETION_INLINE_MATH:
787 lexrc >> completion_inline_math;
790 case RC_COMPLETION_INLINE_TEXT:
791 lexrc >> completion_inline_text;
794 case RC_COMPLETION_INLINE_DOTS:
795 lexrc >> completion_inline_dots;
798 case RC_AUTOCORRECTION_MATH:
799 lexrc >> autocorrection_math;
802 case RC_COMPLETION_POPUP_DELAY:
803 lexrc >> completion_popup_delay;
806 case RC_COMPLETION_POPUP_MATH:
807 lexrc >> completion_popup_math;
810 case RC_COMPLETION_POPUP_TEXT:
811 lexrc >> completion_popup_text;
814 case RC_COMPLETION_CURSOR_TEXT:
815 lexrc >> completion_cursor_text;
818 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
819 lexrc >> completion_popup_after_complete;
822 case RC_NUMLASTFILES:
823 lexrc >> num_lastfiles;
826 case RC_CHECKLASTFILES:
827 lexrc >> check_lastfiles;
830 case RC_SCREEN_FONT_ROMAN:
832 roman_font_name = lexrc.getString();
833 oldFontFormat(roman_font_name,
838 case RC_SCREEN_FONT_SANS:
840 sans_font_name = lexrc.getString();
841 oldFontFormat(sans_font_name, sans_font_foundry);
845 case RC_SCREEN_FONT_TYPEWRITER:
847 typewriter_font_name = lexrc.getString();
848 oldFontFormat(typewriter_font_name,
849 typewriter_font_foundry);
853 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
854 lexrc >> roman_font_foundry;
857 case RC_SCREEN_FONT_SANS_FOUNDRY:
858 lexrc >> sans_font_foundry;
861 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
862 lexrc >> typewriter_font_foundry;
867 lexrc.printError("Missing color tag.");
870 string lyx_name = lexrc.getString();
873 lexrc.printError("Missing color name for color: `$$Token'");
876 string x11_name = lexrc.getString();
878 ColorCode const col =
879 lcolor.getFromLyXName(lyx_name);
880 if (col == Color_none ||
881 col == Color_inherit ||
885 if (!lcolor.setColor(col, x11_name))
886 LYXERR0("Bad lyxrc set_color for " << lyx_name);
890 case RC_AUTOREGIONDELETE:
891 // Auto region delete defaults to true
892 lexrc >> auto_region_delete;
897 lyxpipes = os::internal_path(lexrc.getString());
898 lyxpipes = expandPath(lyxpipes);
902 case RC_CURSOR_FOLLOWS_SCROLLBAR:
903 lexrc >> cursor_follows_scrollbar;
906 case RC_SCROLL_BELOW_DOCUMENT:
907 lexrc >> scroll_below_document;
910 case RC_PARAGRAPH_MARKERS:
911 lexrc >> paragraph_markers;
914 case RC_MAC_DONTSWAP_CTRL_META:
915 lexrc >> mac_dontswap_ctrl_meta;
918 case RC_MAC_LIKE_WORD_MOVEMENT:
919 lexrc >> mac_like_word_movement;
922 case RC_MACRO_EDIT_STYLE:
924 switch (lexrc.getInteger()) {
925 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
926 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
927 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
932 case RC_DIALOGS_ICONIFY_WITH_MAIN:
933 lexrc >> dialogs_iconify_with_main;
936 case RC_PLAINTEXT_LINELEN:
937 lexrc >> plaintext_linelen;
939 // Spellchecker settings:
940 case RC_ACCEPT_COMPOUND:
941 lexrc >> spellchecker_accept_compound;
943 case RC_USE_SYSTEM_COLORS:
944 lexrc >> use_system_colors;
947 lexrc >> use_tooltip;
949 case RC_USE_PIXMAP_CACHE:
950 lexrc >> use_pixmap_cache;
952 case RC_SPELLCHECKER:
953 lexrc >> spellchecker;
956 lexrc >> spellchecker_alt_lang;
959 lexrc >> spellchecker_esc_chars;
961 case RC_SPELLCHECK_CONTINUOUSLY:
962 lexrc >> spellcheck_continuously;
964 case RC_SPELLCHECK_NOTES:
965 lexrc >> spellcheck_notes;
968 lexrc >> make_backup;
970 case RC_SAVE_COMPRESSED:
971 lexrc >> save_compressed;
973 case RC_BACKUPDIR_PATH:
975 backupdir_path = os::internal_path(lexrc.getString());
976 backupdir_path = expandPath(backupdir_path);
979 case RC_DEFAULT_DECIMAL_POINT:
980 lexrc >> default_decimal_point;
982 case RC_DATE_INSERT_FORMAT:
983 lexrc >> date_insert_format;
985 case RC_LANGUAGE_CUSTOM_PACKAGE:
986 lexrc >> language_custom_package;
988 case RC_LANGUAGE_AUTO_BEGIN:
989 lexrc >> language_auto_begin;
991 case RC_LANGUAGE_AUTO_END:
992 lexrc >> language_auto_end;
994 case RC_LANGUAGE_GLOBAL_OPTIONS:
995 lexrc >> language_global_options;
997 case RC_LANGUAGE_PACKAGE_SELECTION:
999 switch (lexrc.getInteger()) {
1001 language_package_selection = LP_AUTO;
1004 language_package_selection = LP_BABEL;
1007 language_package_selection = LP_CUSTOM;
1010 language_package_selection = LP_NONE;
1015 case RC_LANGUAGE_COMMAND_BEGIN:
1016 lexrc >> language_command_begin;
1018 case RC_LANGUAGE_COMMAND_END:
1019 lexrc >> language_command_end;
1021 case RC_LANGUAGE_COMMAND_LOCAL:
1022 lexrc >> language_command_local;
1024 case RC_RTL_SUPPORT:
1025 lexrc >> rtl_support;
1027 case RC_VISUAL_CURSOR:
1028 lexrc >> visual_cursor;
1030 case RC_AUTO_NUMBER:
1031 lexrc >> auto_number;
1033 case RC_MARK_FOREIGN_LANGUAGE:
1034 lexrc >> mark_foreign_language;
1038 string fmt, command;
1040 fmt = lexrc.getString();
1041 if (lexrc.next(true))
1042 command = lexrc.getString();
1043 setMover(fmt, command);
1047 case RC_CONVERTER: {
1048 string from, to, command, flags;
1050 from = lexrc.getString();
1052 to = lexrc.getString();
1053 if (lexrc.next(true))
1054 command = lexrc.getString();
1056 flags = lexrc.getString();
1057 if (command.empty())
1058 theConverters().erase(from, to);
1060 theConverters().add(from, to, command, flags);
1063 // compatibility with versions older than 1.4.0 only
1065 string format, command;
1066 lexrc >> format >> command;
1067 formats.setViewer(format, command);
1070 case RC_FILEFORMAT: {
1071 string format, extension, prettyname, shortcut;
1072 lexrc >> format >> extension >> prettyname >> shortcut;
1073 string viewer, editor;
1074 if (lexrc.next(true))
1075 viewer = lexrc.getString();
1076 if (lexrc.next(true))
1077 editor = lexrc.getString();
1079 // Hack to ensure compatibility with versions older
1081 int le = lexrc.lex();
1082 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1083 flags = lexrc.getString();
1084 if (le != Lexer::LEX_DATA) {
1085 // We have got a known token.
1086 // Therefore this is an old style
1087 // format definition without
1089 lexrc.pushToken(flags);
1093 int flgs = Format::none;
1094 while (!flags.empty()) {
1096 flags = split(flags, flag, ',');
1097 if (flag == "document")
1098 flgs |= Format::document;
1099 else if (flag == "vector")
1100 flgs |= Format::vector;
1101 else if (flag == "menu=export")
1102 flgs |= Format::export_menu;
1104 LYXERR0("Ignoring unknown flag `"
1105 << flag << "' for format `"
1108 if (prettyname.empty()) {
1109 if (theConverters().formatIsUsed(format))
1110 LYXERR0("Can't delete format " << format);
1112 formats.erase(format);
1114 formats.add(format, extension, prettyname,
1115 shortcut, viewer, editor, flgs);
1119 case RC_VIEWER_ALTERNATIVES: {
1120 string format, command;
1122 format = lexrc.getString();
1123 if (lexrc.eatLine())
1124 command = lexrc.getString();
1125 viewer_alternatives[format].insert(command);
1128 case RC_EDITOR_ALTERNATIVES: {
1129 string format, command;
1130 lexrc >> format >> command;
1131 editor_alternatives[format].insert(command);
1135 case RC_DEFAULT_VIEW_FORMAT:
1136 lexrc >> default_view_format;
1139 case RC_DEFAULT_LANGUAGE:
1140 lexrc >> default_language;
1143 case RC_GUI_LANGUAGE:
1144 lexrc >> gui_language;
1147 case RC_SHOW_BANNER:
1148 lexrc >> show_banner;
1153 string const tmp = lexrc.getString();
1154 if (tmp == "true" || tmp == "on")
1155 preview = PREVIEW_ON;
1156 else if (tmp == "no_math")
1157 preview = PREVIEW_NO_MATH;
1159 preview = PREVIEW_OFF;
1160 if (tmp != "false" && tmp != "off")
1161 LYXERR0("Unrecognized preview status \""
1167 case RC_PREVIEW_HASHED_LABELS:
1168 lexrc >> preview_hashed_labels;
1171 case RC_PREVIEW_SCALE_FACTOR:
1172 lexrc >> preview_scale_factor;
1179 lexrc >> user_email;
1182 case RC_PATH_PREFIX:
1183 lexrc >> path_prefix;
1186 case RC_USE_CONVERTER_CACHE:
1187 lexrc >> use_converter_cache;
1189 case RC_CONVERTER_CACHE_MAXAGE:
1190 lexrc >> converter_cache_maxage;
1193 case RC_SORT_LAYOUTS:
1194 lexrc >> sort_layouts;
1196 case RC_GROUP_LAYOUTS:
1197 lexrc >> group_layouts;
1199 case RC_FULL_SCREEN_LIMIT:
1200 lexrc >> full_screen_limit;
1202 case RC_FULL_SCREEN_TOOLBARS:
1203 lexrc >> full_screen_toolbars;
1205 case RC_FULL_SCREEN_SCROLLBAR:
1206 lexrc >> full_screen_scrollbar;
1208 case RC_FULL_SCREEN_TABBAR:
1209 lexrc >> full_screen_tabbar;
1211 case RC_FULL_SCREEN_MENUBAR:
1212 lexrc >> full_screen_menubar;
1214 case RC_FULL_SCREEN_WIDTH:
1215 lexrc >> full_screen_width;
1217 case RC_OPEN_BUFFERS_IN_TABS:
1218 lexrc >> open_buffers_in_tabs;
1220 case RC_SINGLE_CLOSE_TAB_BUTTON:
1221 lexrc >> single_close_tab_button;
1223 case RC_SINGLE_INSTANCE:
1224 lexrc >> single_instance;
1225 if (run_mode == PREFERRED)
1226 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1228 case RC_FORWARD_SEARCH_DVI:
1229 if (lexrc.next(true))
1230 forward_search_dvi = lexrc.getString();
1232 case RC_FORWARD_SEARCH_PDF:
1233 if (lexrc.next(true))
1234 forward_search_pdf = lexrc.getString();
1236 case RC_EXPORT_OVERWRITE:
1238 string const tmp = lexrc.getString();
1239 if (tmp == "all" || tmp == "true")
1240 export_overwrite = ALL_FILES;
1241 else if (tmp == "main")
1242 export_overwrite = MAIN_FILE;
1244 export_overwrite = NO_FILES;
1245 if (tmp != "ask" && tmp != "false")
1246 LYXERR0("Unrecognized export_overwrite status \""
1251 case RC_SCROLL_WHEEL_ZOOM:
1253 string const tmp = lexrc.getString();
1255 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1256 else if (tmp == "shift")
1257 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1258 else if (tmp == "alt")
1259 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1261 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1262 if (tmp != "off" && tmp != "false")
1263 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1270 break; // this is just a dummy
1273 // This is triggered the first time through the loop unless
1274 // we hit a format tag.
1275 if (check_format && format != LYXRC_FILEFORMAT)
1276 return FormatMismatch;
1279 /// Update converters data-structures
1280 theConverters().update(formats);
1281 theConverters().buildGraph();
1287 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1289 ofstream ofs(filename.toFilesystemEncoding().c_str());
1291 write(ofs, ignore_system_lyxrc);
1295 void LyXRC::print() const
1297 if (lyxerr.debugging())
1298 write(lyxerr, false);
1306 typedef pair<string, SpecialisedMover> Data;
1308 SameMover(Data const & comparison)
1309 : comparison_(comparison) {}
1311 bool operator()(Data const & data) const
1313 return data.first == comparison_.first &&
1314 data.second.command() == comparison_.second.command();
1324 // Escape \ and " so that LyXLex can read the string later
1325 string escapeCommand(string const & str) {
1326 return subst(subst(str , "\\", "\\\\"),
1333 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1335 LyXRCTags tag = RC_LAST;
1337 if (!name.empty()) {
1338 for (int i = 0; i != lyxrcCount; ++i)
1339 if ("\\" + name == lyxrcTags[i].tag)
1340 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1344 os << "# LyX " << lyx_version
1345 << " generated this file. If you want to make your own\n"
1346 << "# modifications you should do them from inside LyX and save.\n\n"
1347 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1349 // Why the switch you might ask. It is a trick to ensure that all
1350 // the elements in the LyXRCTags enum are handled. As you can see
1351 // there are no breaks at all. So it is just a huge fall-through.
1352 // The nice thing is that we will get a warning from the compiler
1353 // if we forget an element.
1357 // input/include files are not done here
1358 case RC_LYXRCFORMAT:
1360 if (ignore_system_lyxrc ||
1361 bind_file != system_lyxrc.bind_file) {
1362 string const path = os::external_path(bind_file);
1363 os << "\\bind_file \"" << path << "\"\n";
1369 if (ignore_system_lyxrc ||
1370 def_file != system_lyxrc.def_file) {
1371 string const path = os::external_path(def_file);
1372 os << "\\def_file \"" << path << "\"\n";
1381 << "# MISC SECTION ######################################\n"
1383 // bind files are not done here.
1385 case RC_PATH_PREFIX:
1386 if (ignore_system_lyxrc ||
1387 path_prefix != system_lyxrc.path_prefix) {
1388 os << "\\path_prefix \"" << path_prefix << "\"\n";
1393 if (ignore_system_lyxrc ||
1394 ui_file != system_lyxrc.ui_file) {
1395 string const path = os::external_path(ui_file);
1396 os << "\\ui_file \"" << path << "\"\n";
1400 case RC_AUTOREGIONDELETE:
1401 if (ignore_system_lyxrc ||
1402 auto_region_delete != system_lyxrc.auto_region_delete) {
1403 os << "# Set to false to inhibit automatic replacement of\n"
1404 << "# the current selection.\n"
1405 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1410 case RC_AUTORESET_OPTIONS:
1411 if (ignore_system_lyxrc ||
1412 auto_reset_options != system_lyxrc.auto_reset_options) {
1413 os << "# Set to false to inhibit automatic reset of\n"
1414 << "# the class options to defaults on class change.\n"
1415 << "\\auto_reset_options "
1416 << convert<string>(auto_reset_options)
1422 if (ignore_system_lyxrc ||
1423 autosave != system_lyxrc.autosave) {
1424 os << "# The time interval between auto-saves in seconds.\n"
1425 << "\\autosave " << autosave << '\n';
1429 case RC_DISPLAY_GRAPHICS:
1430 if (ignore_system_lyxrc ||
1431 display_graphics != system_lyxrc.display_graphics) {
1432 os << "# Display graphics within LyX\n"
1434 << "\\display_graphics "
1435 << (display_graphics ? "true" : "false")
1440 case RC_SORT_LAYOUTS:
1441 if (ignore_system_lyxrc ||
1442 sort_layouts != system_lyxrc.sort_layouts) {
1443 os << "# Sort layouts alphabetically.\n"
1444 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1448 case RC_GROUP_LAYOUTS:
1449 if (ignore_system_lyxrc ||
1450 group_layouts != system_lyxrc.group_layouts) {
1451 os << "# Group layouts by their category.\n"
1452 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1456 case RC_VIEWDVI_PAPEROPTION:
1457 if (ignore_system_lyxrc ||
1458 view_dvi_paper_option
1459 != system_lyxrc.view_dvi_paper_option) {
1460 os << "# Options used to specify paper size to the\n"
1461 << "# view_dvi_command (e.g. -paper)\n"
1462 << "\\view_dvi_paper_option \""
1463 << view_dvi_paper_option << "\"\n";
1467 case RC_DEFAULT_PAPERSIZE:
1468 if (ignore_system_lyxrc ||
1469 default_papersize != system_lyxrc.default_papersize) {
1470 os << "# The default papersize to use.\n"
1471 << "\\default_papersize \"";
1472 switch (default_papersize) {
1474 os << "default"; break;
1475 case PAPER_USLETTER:
1476 os << "usletter"; break;
1478 os << "legal"; break;
1479 case PAPER_USEXECUTIVE:
1480 os << "executive"; break;
1513 case PAPER_JISB6: break;
1519 case RC_CHKTEX_COMMAND:
1520 if (ignore_system_lyxrc ||
1521 chktex_command != system_lyxrc.chktex_command) {
1522 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1526 case RC_BIBTEX_ALTERNATIVES: {
1527 CommandSet::const_iterator it = bibtex_alternatives.begin();
1528 CommandSet::const_iterator end = bibtex_alternatives.end();
1529 for ( ; it != end; ++it) {
1530 if (ignore_system_lyxrc
1531 || !system_lyxrc.bibtex_alternatives.count(*it))
1532 os << "\\bibtex_alternatives \""
1538 case RC_BIBTEX_COMMAND:
1539 if (ignore_system_lyxrc ||
1540 bibtex_command != system_lyxrc.bibtex_command) {
1541 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1545 case RC_JBIBTEX_COMMAND:
1546 if (ignore_system_lyxrc ||
1547 jbibtex_command != system_lyxrc.jbibtex_command) {
1548 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1552 case RC_INDEX_ALTERNATIVES: {
1553 CommandSet::const_iterator it = index_alternatives.begin();
1554 CommandSet::const_iterator end = index_alternatives.end();
1555 for ( ; it != end; ++it) {
1556 if (ignore_system_lyxrc
1557 || !system_lyxrc.index_alternatives.count(*it))
1558 os << "\\index_alternatives \""
1564 case RC_INDEX_COMMAND:
1565 if (ignore_system_lyxrc ||
1566 index_command != system_lyxrc.index_command) {
1567 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1571 case RC_JINDEX_COMMAND:
1572 if (ignore_system_lyxrc ||
1573 jindex_command != system_lyxrc.jindex_command) {
1574 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1578 case RC_SPLITINDEX_COMMAND:
1579 if (ignore_system_lyxrc ||
1580 splitindex_command != system_lyxrc.splitindex_command) {
1581 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1585 case RC_NOMENCL_COMMAND:
1586 if (ignore_system_lyxrc ||
1587 nomencl_command != system_lyxrc.nomencl_command) {
1588 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1592 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1593 if (ignore_system_lyxrc ||
1594 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1595 os << "\\tex_expects_windows_paths "
1596 << convert<string>(windows_style_tex_paths) << '\n';
1600 case RC_TEX_ALLOWS_SPACES:
1601 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1602 os << "\\tex_allows_spaces "
1603 << convert<string>(tex_allows_spaces) << '\n';
1608 if (ignore_system_lyxrc ||
1609 use_kbmap != system_lyxrc.use_kbmap) {
1610 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1614 case RC_KBMAP_PRIMARY:
1615 if (ignore_system_lyxrc ||
1616 primary_kbmap != system_lyxrc.primary_kbmap) {
1617 string const path = os::external_path(primary_kbmap);
1618 os << "\\kbmap_primary \"" << path << "\"\n";
1622 case RC_KBMAP_SECONDARY:
1623 if (ignore_system_lyxrc ||
1624 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1625 string const path = os::external_path(secondary_kbmap);
1626 os << "\\kbmap_secondary \"" << path << "\"\n";
1631 if (ignore_system_lyxrc ||
1632 lyxpipes != system_lyxrc.lyxpipes) {
1633 string const path = os::external_path(lyxpipes);
1634 os << "\\serverpipe \"" << path << "\"\n";
1638 case RC_DATE_INSERT_FORMAT:
1639 if (ignore_system_lyxrc ||
1640 date_insert_format != system_lyxrc.date_insert_format) {
1641 os << "\\date_insert_format \"" << date_insert_format
1648 os << "\\user_name \"" << user_name << "\"\n";
1653 os << "\\user_email \"" << user_email << "\"\n";
1657 case RC_SHOW_BANNER:
1658 if (ignore_system_lyxrc ||
1659 show_banner != system_lyxrc.show_banner) {
1660 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1666 if (ignore_system_lyxrc ||
1667 preview != system_lyxrc.preview) {
1673 case PREVIEW_NO_MATH:
1680 os << "\\preview " << status << '\n';
1685 case RC_PREVIEW_HASHED_LABELS:
1686 if (ignore_system_lyxrc ||
1687 preview_hashed_labels !=
1688 system_lyxrc.preview_hashed_labels) {
1689 os << "\\preview_hashed_labels "
1690 << convert<string>(preview_hashed_labels) << '\n';
1695 case RC_PREVIEW_SCALE_FACTOR:
1696 if (ignore_system_lyxrc ||
1697 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1698 os << "\\preview_scale_factor "
1699 << preview_scale_factor << '\n';
1704 case RC_USE_CONVERTER_CACHE:
1705 if (ignore_system_lyxrc ||
1706 use_converter_cache != system_lyxrc.use_converter_cache) {
1707 os << "\\use_converter_cache "
1708 << convert<string>(use_converter_cache) << '\n';
1713 case RC_CONVERTER_CACHE_MAXAGE:
1714 if (ignore_system_lyxrc ||
1715 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1716 os << "\\converter_cache_maxage "
1717 << converter_cache_maxage << '\n';
1723 << "# SCREEN & FONTS SECTION ############################\n"
1727 if (ignore_system_lyxrc ||
1728 dpi != system_lyxrc.dpi) {
1729 os << "\\screen_dpi " << dpi << '\n';
1733 case RC_SCREEN_ZOOM:
1734 if (ignore_system_lyxrc ||
1735 zoom != system_lyxrc.zoom) {
1736 os << "\\screen_zoom " << zoom << '\n';
1740 case RC_GEOMETRY_SESSION:
1741 if (ignore_system_lyxrc ||
1742 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1743 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1748 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1749 if (ignore_system_lyxrc ||
1750 cursor_follows_scrollbar
1751 != system_lyxrc.cursor_follows_scrollbar) {
1752 os << "\\cursor_follows_scrollbar "
1753 << convert<string>(cursor_follows_scrollbar) << '\n';
1757 case RC_SCROLL_BELOW_DOCUMENT:
1758 if (ignore_system_lyxrc ||
1759 scroll_below_document
1760 != system_lyxrc.scroll_below_document) {
1761 os << "\\scroll_below_document "
1762 << convert<string>(scroll_below_document) << '\n';
1766 case RC_PARAGRAPH_MARKERS:
1767 if (ignore_system_lyxrc ||
1769 != system_lyxrc.paragraph_markers) {
1770 os << "\\paragraph_markers "
1771 << convert<string>(paragraph_markers) << '\n';
1775 case RC_MAC_DONTSWAP_CTRL_META:
1776 if (ignore_system_lyxrc ||
1777 mac_dontswap_ctrl_meta
1778 != system_lyxrc.mac_dontswap_ctrl_meta) {
1779 os << "\\mac_dontswap_ctrl_meta "
1780 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1784 case RC_MAC_LIKE_WORD_MOVEMENT:
1785 if (ignore_system_lyxrc ||
1786 mac_like_word_movement
1787 != system_lyxrc.mac_like_word_movement) {
1788 os << "\\mac_like_word_movement "
1789 << convert<string>(mac_like_word_movement) << '\n';
1793 case RC_MACRO_EDIT_STYLE:
1794 if (ignore_system_lyxrc ||
1796 != system_lyxrc.macro_edit_style) {
1797 os << "\\macro_edit_style ";
1798 switch (macro_edit_style) {
1799 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1800 case MACRO_EDIT_INLINE: os << "1\n"; break;
1801 case MACRO_EDIT_LIST: os << "2\n"; break;
1806 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1807 if (ignore_system_lyxrc ||
1808 dialogs_iconify_with_main
1809 != system_lyxrc.dialogs_iconify_with_main) {
1810 os << "\\dialogs_iconify_with_main "
1811 << convert<string>(dialogs_iconify_with_main) << '\n';
1815 case RC_SCREEN_FONT_ROMAN:
1816 if (ignore_system_lyxrc ||
1817 roman_font_name != system_lyxrc.roman_font_name) {
1818 os << "\\screen_font_roman \"" << roman_font_name
1823 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1824 if (ignore_system_lyxrc ||
1825 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1826 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1831 case RC_SCREEN_FONT_SANS:
1832 if (ignore_system_lyxrc ||
1833 sans_font_name != system_lyxrc.sans_font_name) {
1834 os << "\\screen_font_sans \"" << sans_font_name
1839 case RC_SCREEN_FONT_SANS_FOUNDRY:
1840 if (ignore_system_lyxrc ||
1841 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1842 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1847 case RC_SCREEN_FONT_TYPEWRITER:
1848 if (ignore_system_lyxrc ||
1849 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1850 os << "\\screen_font_typewriter \""
1851 << typewriter_font_name << "\"\n";
1855 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1856 if (ignore_system_lyxrc ||
1857 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1858 os << "\\screen_font_typewriter_foundry \""
1859 << typewriter_font_foundry << "\"\n";
1864 case RC_SCREEN_FONT_SCALABLE:
1865 if (ignore_system_lyxrc ||
1866 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1867 os << "\\screen_font_scalable "
1868 << convert<string>(use_scalable_fonts)
1873 case RC_SCREEN_FONT_SIZES:
1874 if (ignore_system_lyxrc ||
1875 font_sizes[FONT_SIZE_TINY]
1876 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1877 font_sizes[FONT_SIZE_SCRIPT]
1878 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1879 font_sizes[FONT_SIZE_FOOTNOTE]
1880 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1881 font_sizes[FONT_SIZE_SMALL]
1882 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1883 font_sizes[FONT_SIZE_NORMAL]
1884 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1885 font_sizes[FONT_SIZE_LARGE]
1886 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1887 font_sizes[FONT_SIZE_LARGER]
1888 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1889 font_sizes[FONT_SIZE_LARGEST]
1890 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1891 font_sizes[FONT_SIZE_HUGE]
1892 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1893 font_sizes[FONT_SIZE_HUGER]
1894 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1895 os.setf(ios::fixed);
1897 os << "\\screen_font_sizes"
1898 << ' ' << font_sizes[FONT_SIZE_TINY]
1899 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1900 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1901 << ' ' << font_sizes[FONT_SIZE_SMALL]
1902 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1903 << ' ' << font_sizes[FONT_SIZE_LARGE]
1904 << ' ' << font_sizes[FONT_SIZE_LARGER]
1905 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1906 << ' ' << font_sizes[FONT_SIZE_HUGE]
1907 << ' ' << font_sizes[FONT_SIZE_HUGER]
1912 case RC_FULL_SCREEN_LIMIT:
1913 if (ignore_system_lyxrc ||
1914 full_screen_limit != system_lyxrc.full_screen_limit) {
1915 os << "\\fullscreen_limit "
1916 << convert<string>(full_screen_limit)
1921 case RC_FULL_SCREEN_TOOLBARS:
1922 if (ignore_system_lyxrc ||
1923 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1924 os << "\\fullscreen_toolbars "
1925 << convert<string>(full_screen_toolbars)
1930 case RC_FULL_SCREEN_SCROLLBAR:
1931 if (ignore_system_lyxrc ||
1932 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1933 os << "\\fullscreen_scrollbar "
1934 << convert<string>(full_screen_scrollbar)
1939 case RC_FULL_SCREEN_TABBAR:
1940 if (ignore_system_lyxrc ||
1941 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1942 os << "\\fullscreen_tabbar "
1943 << convert<string>(full_screen_tabbar)
1948 case RC_FULL_SCREEN_MENUBAR:
1949 if (ignore_system_lyxrc ||
1950 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1951 os << "\\fullscreen_menubar "
1952 << convert<string>(full_screen_menubar)
1957 case RC_FULL_SCREEN_WIDTH:
1958 if (ignore_system_lyxrc ||
1959 full_screen_width != system_lyxrc.full_screen_width) {
1960 os << "\\fullscreen_width "
1961 << convert<string>(full_screen_width)
1966 case RC_OPEN_BUFFERS_IN_TABS:
1967 if (ignore_system_lyxrc ||
1968 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1969 os << "\\open_buffers_in_tabs "
1970 << convert<string>(open_buffers_in_tabs)
1975 case RC_SINGLE_CLOSE_TAB_BUTTON:
1976 if (ignore_system_lyxrc ||
1977 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1978 os << "\\single_close_tab_button "
1979 << convert<string>(single_close_tab_button)
1984 case RC_SINGLE_INSTANCE:
1985 if (ignore_system_lyxrc ||
1986 single_instance != system_lyxrc.single_instance) {
1987 os << "\\single_instance "
1988 << convert<string>(single_instance)
1993 case RC_FORWARD_SEARCH_DVI:
1994 if (ignore_system_lyxrc ||
1995 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1996 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
2000 case RC_FORWARD_SEARCH_PDF:
2001 if (ignore_system_lyxrc ||
2002 forward_search_pdf != system_lyxrc.forward_search_pdf) {
2003 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2009 << "# COLOR SECTION ###################################\n"
2013 for (int i = 0; i < Color_ignore; ++i) {
2014 ColorCode lc = static_cast<ColorCode>(i);
2015 string const col = lcolor.getX11Name(lc);
2016 if (ignore_system_lyxrc
2017 || col != system_lcolor.getX11Name(lc)) {
2018 os << "\\set_color \""
2019 << lcolor.getLyXName(lc) << "\" \""
2027 << "# PRINTER SECTION ###################################\n"
2031 if (ignore_system_lyxrc ||
2032 printer != system_lyxrc.printer) {
2033 os << "\\printer \"" << printer << "\"\n";
2037 case RC_PRINT_ADAPTOUTPUT:
2038 if (ignore_system_lyxrc ||
2039 print_adapt_output != system_lyxrc.print_adapt_output) {
2040 os << "\\print_adapt_output "
2041 << convert<string>(print_adapt_output)
2046 case RC_PRINT_COMMAND:
2047 if (ignore_system_lyxrc ||
2048 print_command != system_lyxrc.print_command) {
2049 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2053 case RC_PRINTEXSTRAOPTIONS:
2054 if (ignore_system_lyxrc ||
2055 print_extra_options != system_lyxrc.print_extra_options) {
2056 os << "\\print_extra_options \"" << print_extra_options
2061 case RC_PRINTSPOOL_COMMAND:
2062 if (ignore_system_lyxrc ||
2063 print_spool_command != system_lyxrc.print_spool_command) {
2064 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2069 case RC_PRINTSPOOL_PRINTERPREFIX:
2070 if (ignore_system_lyxrc ||
2071 print_spool_printerprefix
2072 != system_lyxrc.print_spool_printerprefix) {
2073 os << "\\print_spool_printerprefix \""
2074 << print_spool_printerprefix << "\"\n";
2078 case RC_PRINTEVENPAGEFLAG:
2079 if (ignore_system_lyxrc ||
2080 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2081 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2086 case RC_PRINTODDPAGEFLAG:
2087 if (ignore_system_lyxrc ||
2088 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2089 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2094 case RC_PRINTREVERSEFLAG:
2095 if (ignore_system_lyxrc ||
2096 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2097 os << "\\print_reverse_flag \"" << print_reverse_flag
2102 case RC_PRINTLANDSCAPEFLAG:
2103 if (ignore_system_lyxrc ||
2104 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2105 os << "\\print_landscape_flag \"" << print_landscape_flag
2110 case RC_PRINTPAGERANGEFLAG:
2111 if (ignore_system_lyxrc ||
2112 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2113 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2118 case RC_PRINTCOPIESFLAG:
2119 if (ignore_system_lyxrc ||
2120 print_copies_flag != system_lyxrc.print_copies_flag) {
2121 os << "\\print_copies_flag \"" << print_copies_flag
2126 case RC_PRINTCOLLCOPIESFLAG:
2127 if (ignore_system_lyxrc ||
2128 print_collcopies_flag
2129 != system_lyxrc.print_collcopies_flag) {
2130 os << "\\print_collcopies_flag \""
2131 << print_collcopies_flag
2136 case RC_PRINTPAPERFLAG:
2137 if (ignore_system_lyxrc ||
2138 print_paper_flag != system_lyxrc.print_paper_flag) {
2139 os << "\\print_paper_flag \"" << print_paper_flag
2144 case RC_PRINTPAPERDIMENSIONFLAG:
2145 if (ignore_system_lyxrc ||
2146 print_paper_dimension_flag
2147 != system_lyxrc.print_paper_dimension_flag) {
2148 os << "\\print_paper_dimension_flag \""
2149 << print_paper_dimension_flag << "\"\n";
2153 case RC_PRINTTOPRINTER:
2154 if (ignore_system_lyxrc ||
2155 print_to_printer != system_lyxrc.print_to_printer) {
2156 os << "\\print_to_printer \"" << print_to_printer
2161 case RC_PRINTTOFILE:
2162 if (ignore_system_lyxrc ||
2163 print_to_file != system_lyxrc.print_to_file) {
2164 string const path = os::external_path(print_to_file);
2165 os << "\\print_to_file \"" << path << "\"\n";
2169 case RC_PRINTFILEEXTENSION:
2170 if (ignore_system_lyxrc ||
2171 print_file_extension != system_lyxrc.print_file_extension) {
2172 os << "\\print_file_extension \""
2173 << print_file_extension
2180 << "# TEX SECTION #######################################\n"
2183 case RC_FONT_ENCODING:
2184 if (ignore_system_lyxrc ||
2185 fontenc != system_lyxrc.fontenc) {
2186 os << "\\font_encoding \"" << fontenc << "\"\n";
2191 case RC_FORCE_PAINT_SINGLE_CHAR:
2192 if (ignore_system_lyxrc ||
2193 force_paint_single_char != system_lyxrc.force_paint_single_char) {
2194 os << "\\force_paint_single_char \"" << force_paint_single_char << "\"\n";
2200 << "# FILE SECTION ######################################\n"
2203 case RC_DOCUMENTPATH:
2204 if (ignore_system_lyxrc ||
2205 document_path != system_lyxrc.document_path) {
2206 string const path = os::external_path(document_path);
2207 os << "\\document_path \"" << path << "\"\n";
2211 case RC_USELASTFILEPOS:
2212 if (ignore_system_lyxrc ||
2213 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2214 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2219 case RC_LOADSESSION:
2220 if (ignore_system_lyxrc ||
2221 load_session != system_lyxrc.load_session) {
2222 os << "\\load_session " << convert<string>(load_session)
2227 case RC_MOUSE_WHEEL_SPEED:
2228 if (ignore_system_lyxrc ||
2229 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2230 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2234 case RC_COMPLETION_INLINE_DELAY:
2235 if (ignore_system_lyxrc ||
2236 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2237 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2241 case RC_COMPLETION_INLINE_MATH:
2242 if (ignore_system_lyxrc ||
2243 completion_inline_math != system_lyxrc.completion_inline_math) {
2244 os << "\\completion_inline_math "
2245 << convert<string>(completion_inline_math) << '\n';
2249 case RC_COMPLETION_INLINE_TEXT:
2250 if (ignore_system_lyxrc ||
2251 completion_inline_text != system_lyxrc.completion_inline_text) {
2252 os << "\\completion_inline_text "
2253 << convert<string>(completion_inline_text) << '\n';
2257 case RC_COMPLETION_INLINE_DOTS:
2258 if (ignore_system_lyxrc ||
2259 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2260 os << "\\completion_inline_dots "
2261 << convert<string>(completion_inline_dots) << '\n';
2265 case RC_AUTOCORRECTION_MATH:
2266 if (ignore_system_lyxrc ||
2267 autocorrection_math != system_lyxrc.autocorrection_math) {
2268 os << "\\autocorrection_math "
2269 << convert<string>(autocorrection_math) << '\n';
2273 case RC_COMPLETION_POPUP_DELAY:
2274 if (ignore_system_lyxrc ||
2275 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2276 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2280 case RC_COMPLETION_POPUP_MATH:
2281 if (ignore_system_lyxrc ||
2282 completion_popup_math != system_lyxrc.completion_popup_math) {
2283 os << "\\completion_popup_math "
2284 << convert<string>(completion_popup_math) << '\n';
2288 case RC_COMPLETION_POPUP_TEXT:
2289 if (ignore_system_lyxrc ||
2290 completion_popup_text != system_lyxrc.completion_popup_text) {
2291 os << "\\completion_popup_text "
2292 << convert<string>(completion_popup_text) << '\n';
2296 case RC_COMPLETION_CURSOR_TEXT:
2297 if (ignore_system_lyxrc ||
2298 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2299 os << "\\completion_cursor_text "
2300 << convert<string>(completion_cursor_text) << '\n';
2304 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2305 if (ignore_system_lyxrc ||
2306 completion_popup_after_complete
2307 != system_lyxrc.completion_popup_after_complete) {
2308 os << "\\completion_popup_after_complete "
2309 << convert<string>(completion_popup_after_complete) << '\n';
2313 case RC_NUMLASTFILES:
2314 if (ignore_system_lyxrc ||
2315 num_lastfiles != system_lyxrc.num_lastfiles) {
2316 os << "\\num_lastfiles " << num_lastfiles << '\n';
2320 case RC_CHECKLASTFILES:
2321 if (ignore_system_lyxrc ||
2322 check_lastfiles != system_lyxrc.check_lastfiles) {
2323 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2328 case RC_EXAMPLEPATH:
2329 if (ignore_system_lyxrc ||
2330 example_path != system_lyxrc.example_path) {
2331 string const path = os::external_path(example_path);
2332 os << "\\example_path \"" << path << "\"\n";
2336 case RC_TEMPLATEPATH:
2337 if (ignore_system_lyxrc ||
2338 template_path != system_lyxrc.template_path) {
2339 string const path = os::external_path(template_path);
2340 os << "\\template_path \"" << path << "\"\n";
2344 case RC_TEMPDIRPATH:
2345 if (ignore_system_lyxrc ||
2346 tempdir_path != system_lyxrc.tempdir_path) {
2347 string const path = os::external_path(tempdir_path);
2348 os << "\\tempdir_path \"" << path << "\"\n";
2352 case RC_THESAURUSDIRPATH:
2353 if (ignore_system_lyxrc ||
2354 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2355 string const path = os::external_path(thesaurusdir_path);
2356 os << "\\thesaurusdir_path \"" << path << "\"\n";
2360 case RC_HUNSPELLDIR_PATH:
2361 if (ignore_system_lyxrc ||
2362 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2363 string const path = os::external_path(hunspelldir_path);
2364 os << "\\hunspelldir_path \"" << path << "\"\n";
2368 case RC_PLAINTEXT_LINELEN:
2369 if (ignore_system_lyxrc ||
2370 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2371 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2375 case RC_MAKE_BACKUP:
2376 if (ignore_system_lyxrc ||
2377 make_backup != system_lyxrc.make_backup) {
2378 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2382 case RC_SAVE_COMPRESSED:
2383 if (ignore_system_lyxrc ||
2384 save_compressed != system_lyxrc.save_compressed) {
2385 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2389 case RC_BACKUPDIR_PATH:
2390 if (ignore_system_lyxrc ||
2391 backupdir_path != system_lyxrc.backupdir_path) {
2392 string const path = os::external_path(backupdir_path);
2393 os << "\\backupdir_path \"" << path << "\"\n";
2399 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2403 << "# SPELLCHECKER SECTION ##############################\n"
2406 case RC_ACCEPT_COMPOUND:
2407 if (ignore_system_lyxrc ||
2408 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2409 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2415 if (ignore_system_lyxrc ||
2416 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2417 os << "\\alternate_language \"" << spellchecker_alt_lang
2423 if (ignore_system_lyxrc ||
2424 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2425 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2429 case RC_USE_SYSTEM_COLORS:
2430 if (ignore_system_lyxrc ||
2431 use_system_colors != system_lyxrc.use_system_colors) {
2432 os << "\\use_system_colors "
2433 << convert<string>(use_system_colors)
2438 case RC_USE_TOOLTIP:
2439 if (ignore_system_lyxrc ||
2440 use_tooltip != system_lyxrc.use_tooltip) {
2441 os << "\\use_tooltip "
2442 << convert<string>(use_tooltip)
2447 case RC_USE_PIXMAP_CACHE:
2448 if (ignore_system_lyxrc ||
2449 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2450 os << "\\use_pixmap_cache "
2451 << convert<string>(use_pixmap_cache)
2458 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2463 case RC_DEFAULT_DECIMAL_POINT:
2464 if (ignore_system_lyxrc ||
2465 default_decimal_point != system_lyxrc.default_decimal_point) {
2466 os << "\\default_decimal_point " << default_decimal_point << '\n';
2471 case RC_SPELLCHECKER:
2472 if (ignore_system_lyxrc ||
2473 spellchecker != system_lyxrc.spellchecker) {
2474 os << "\\spellchecker " << spellchecker << '\n';
2479 case RC_SPELLCHECK_CONTINUOUSLY:
2480 if (ignore_system_lyxrc ||
2481 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2482 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2488 case RC_SPELLCHECK_NOTES:
2489 if (ignore_system_lyxrc ||
2490 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2491 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2497 case RC_RTL_SUPPORT:
2498 if (ignore_system_lyxrc ||
2499 rtl_support != system_lyxrc.rtl_support) {
2500 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2504 case RC_VISUAL_CURSOR:
2505 if (ignore_system_lyxrc ||
2506 visual_cursor != system_lyxrc.visual_cursor) {
2507 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2511 case RC_LANGUAGE_CUSTOM_PACKAGE:
2512 if (ignore_system_lyxrc ||
2513 language_custom_package != system_lyxrc.language_custom_package) {
2514 os << "\\language_custom_package \"" << language_custom_package
2519 case RC_LANGUAGE_GLOBAL_OPTIONS:
2520 if (ignore_system_lyxrc ||
2521 language_global_options
2522 != system_lyxrc.language_global_options) {
2523 os << "\\language_global_options \""
2524 << convert<string>(language_global_options)
2529 case RC_LANGUAGE_PACKAGE_SELECTION:
2530 if (ignore_system_lyxrc ||
2531 language_package_selection != system_lyxrc.language_package_selection) {
2532 os << "\\language_package_selection ";
2533 switch (language_package_selection) {
2550 case RC_LANGUAGE_COMMAND_BEGIN:
2551 if (ignore_system_lyxrc ||
2552 language_command_begin
2553 != system_lyxrc.language_command_begin) {
2554 os << "\\language_command_begin \""
2555 << language_command_begin
2560 case RC_LANGUAGE_COMMAND_END:
2561 if (ignore_system_lyxrc ||
2562 language_command_end
2563 != system_lyxrc.language_command_end) {
2564 os << "\\language_command_end \"" << language_command_end
2569 case RC_LANGUAGE_COMMAND_LOCAL:
2570 if (ignore_system_lyxrc ||
2571 language_command_local
2572 != system_lyxrc.language_command_local) {
2573 os << "\\language_command_local \""
2574 << language_command_local
2579 case RC_LANGUAGE_AUTO_BEGIN:
2580 if (ignore_system_lyxrc ||
2581 language_auto_begin != system_lyxrc.language_auto_begin) {
2582 os << "\\language_auto_begin "
2583 << convert<string>(language_auto_begin) << '\n';
2587 case RC_LANGUAGE_AUTO_END:
2588 if (ignore_system_lyxrc ||
2589 language_auto_end != system_lyxrc.language_auto_end) {
2590 os << "\\language_auto_end "
2591 << convert<string>(language_auto_end) << '\n';
2595 case RC_MARK_FOREIGN_LANGUAGE:
2596 if (ignore_system_lyxrc ||
2597 mark_foreign_language
2598 != system_lyxrc.mark_foreign_language) {
2599 os << "\\mark_foreign_language " <<
2600 convert<string>(mark_foreign_language) << '\n';
2606 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2609 case RC_AUTO_NUMBER:
2610 if (ignore_system_lyxrc ||
2611 auto_number != system_lyxrc.auto_number) {
2612 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2616 case RC_DEFAULT_LANGUAGE:
2617 if (ignore_system_lyxrc ||
2618 default_language != system_lyxrc.default_language) {
2619 os << "\\default_language " << default_language << '\n';
2623 case RC_GUI_LANGUAGE:
2624 if (ignore_system_lyxrc ||
2625 gui_language != system_lyxrc.gui_language) {
2626 os << "\\gui_language " << gui_language << '\n';
2630 case RC_EXPORT_OVERWRITE:
2631 if (ignore_system_lyxrc ||
2632 export_overwrite != system_lyxrc.export_overwrite) {
2634 switch (export_overwrite) {
2645 os << "\\export_overwrite " << status << '\n';
2650 case RC_SCROLL_WHEEL_ZOOM:
2651 if (ignore_system_lyxrc ||
2652 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2654 switch (scroll_wheel_zoom) {
2655 case SCROLL_WHEEL_ZOOM_OFF:
2658 case SCROLL_WHEEL_ZOOM_CTRL:
2661 case SCROLL_WHEEL_ZOOM_SHIFT:
2664 case SCROLL_WHEEL_ZOOM_ALT:
2668 os << "\\scroll_wheel_zoom " << status << '\n';
2674 << "# FORMATS SECTION ##########################\n"
2678 // New/modified formats
2679 for (Formats::const_iterator cit = formats.begin();
2680 cit != formats.end(); ++cit) {
2681 Format const * format =
2682 system_formats.getFormat(cit->name());
2684 format->extension() != cit->extension() ||
2685 format->prettyname() != cit->prettyname() ||
2686 format->shortcut() != cit->shortcut() ||
2687 format->viewer() != cit->viewer() ||
2688 format->editor() != cit->editor() ||
2689 format->documentFormat() != cit->documentFormat() ||
2690 format->vectorFormat() != cit->vectorFormat()) {
2691 os << "\\format \"" << cit->name() << "\" \""
2692 << cit->extension() << "\" \""
2693 << cit->prettyname() << "\" \""
2694 << cit->shortcut() << "\" \""
2695 << escapeCommand(cit->viewer()) << "\" \""
2696 << escapeCommand(cit->editor()) << "\" \"";
2697 vector<string> flags;
2698 if (cit->documentFormat())
2699 flags.push_back("document");
2700 if (cit->vectorFormat())
2701 flags.push_back("vector");
2702 os << getStringFromVector(flags);
2707 // Look for deleted formats
2708 for (Formats::const_iterator cit = system_formats.begin();
2709 cit != system_formats.end(); ++cit)
2710 if (!formats.getFormat(cit->name()))
2711 os << "\\format \"" << cit->name()
2712 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2715 case RC_VIEWER_ALTERNATIVES: {
2716 Alternatives::const_iterator it = viewer_alternatives.begin();
2717 Alternatives::const_iterator const en = viewer_alternatives.end();
2718 Alternatives::const_iterator const sysend =
2719 system_lyxrc.viewer_alternatives.end();
2720 for (; it != en; ++it) {
2721 string const & fmt = it->first;
2722 CommandSet const & cmd = it->second;
2723 CommandSet::const_iterator sit = cmd.begin();
2724 CommandSet::const_iterator const sen = cmd.end();
2725 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2726 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2727 system_lyxrc.viewer_alternatives.find(fmt);
2728 for (; sit != sen; ++sit) {
2729 string const & cmd = *sit;
2730 if (ignore_system_lyxrc
2731 || sysfmt == sysend // format not found
2732 || sysfmt->second.count(cmd) == 0 // this command not found
2734 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2740 case RC_EDITOR_ALTERNATIVES: {
2741 Alternatives::const_iterator it = editor_alternatives.begin();
2742 Alternatives::const_iterator const en = editor_alternatives.end();
2743 Alternatives::const_iterator const sysend =
2744 system_lyxrc.editor_alternatives.end();
2745 for (; it != en; ++it) {
2746 string const & fmt = it->first;
2747 CommandSet const & cmd = it->second;
2748 CommandSet::const_iterator sit = cmd.begin();
2749 CommandSet::const_iterator const sen = cmd.end();
2750 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2751 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2752 system_lyxrc.editor_alternatives.find(fmt);
2753 for (; sit != sen; ++sit) {
2754 string const & cmd = *sit;
2755 if (ignore_system_lyxrc
2756 || sysfmt == sysend // format not found
2757 || sysfmt->second.count(cmd) == 0 // this command not found
2759 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2765 case RC_DEFAULT_VIEW_FORMAT:
2766 if (ignore_system_lyxrc ||
2767 default_view_format != system_lyxrc.default_view_format) {
2768 os << "\\default_view_format " << default_view_format << '\n';
2778 << "# CONVERTERS SECTION ##########################\n"
2782 // Look for new converters
2783 for (Converters::const_iterator cit = theConverters().begin();
2784 cit != theConverters().end(); ++cit) {
2785 Converter const * converter =
2786 theSystemConverters().getConverter(cit->from,
2789 converter->command != cit->command ||
2790 converter->flags != cit->flags)
2791 os << "\\converter \"" << cit->from << "\" \""
2792 << cit->to << "\" \""
2793 << escapeCommand(cit->command) << "\" \""
2794 << cit->flags << "\"\n";
2797 // New/modifed converters
2798 for (Converters::const_iterator cit = theSystemConverters().begin();
2799 cit != theSystemConverters().end(); ++cit)
2800 if (!theConverters().getConverter(cit->from, cit->to))
2801 os << "\\converter \"" << cit->from
2802 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2809 << "# COPIERS SECTION ##########################\n"
2812 // Look for new movers
2813 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2814 Movers::const_iterator const sysend = theSystemMovers().end();
2815 Movers::const_iterator it = theMovers().begin();
2816 Movers::const_iterator end = theMovers().end();
2818 for (; it != end; ++it) {
2819 Movers::const_iterator const sysit =
2820 find_if(sysbegin, sysend, SameMover(*it));
2821 if (sysit == sysend) {
2822 string const & fmt = it->first;
2823 string const & command =
2824 it->second.command();
2826 os << "\\copier " << fmt
2827 << " \"" << escapeCommand(command) << "\"\n";
2833 // We don't actually delete SpecialisedMover(s) from the
2834 // map, just clear their 'command', so there's no need
2835 // to test for anything else.
2842 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2844 // Why the switch you might ask. It is a trick to ensure that all
2845 // the elements in the LyXRCTags enum is handled. As you can see
2846 // there are no breaks at all. So it is just a huge fall-through.
2847 // The nice thing is that we will get a warning from the compiler
2848 // if we forget an element.
2849 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2851 case LyXRC::RC_ACCEPT_COMPOUND:
2852 case LyXRC::RC_ALT_LANG:
2853 case LyXRC::RC_PLAINTEXT_LINELEN:
2854 case LyXRC::RC_AUTOCORRECTION_MATH:
2855 case LyXRC::RC_AUTOREGIONDELETE:
2856 case LyXRC::RC_AUTORESET_OPTIONS:
2857 case LyXRC::RC_AUTOSAVE:
2858 case LyXRC::RC_AUTO_NUMBER:
2859 case LyXRC::RC_BACKUPDIR_PATH:
2860 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2861 case LyXRC::RC_BIBTEX_COMMAND:
2862 case LyXRC::RC_BINDFILE:
2863 case LyXRC::RC_CHECKLASTFILES:
2864 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2865 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2866 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2867 case LyXRC::RC_COMPLETION_INLINE_MATH:
2868 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2869 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2870 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2871 case LyXRC::RC_COMPLETION_POPUP_MATH:
2872 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2873 case LyXRC::RC_USELASTFILEPOS:
2874 case LyXRC::RC_LOADSESSION:
2875 case LyXRC::RC_CHKTEX_COMMAND:
2876 case LyXRC::RC_CONVERTER:
2877 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2878 case LyXRC::RC_COPIER:
2879 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2880 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2881 case LyXRC::RC_DATE_INSERT_FORMAT:
2882 case LyXRC::RC_DEFAULT_LANGUAGE:
2883 case LyXRC::RC_GUI_LANGUAGE:
2884 case LyXRC::RC_DEFAULT_PAPERSIZE:
2885 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2886 case LyXRC::RC_DEFFILE:
2887 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2888 case LyXRC::RC_DISPLAY_GRAPHICS:
2889 case LyXRC::RC_DOCUMENTPATH:
2890 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2891 FileName path(lyxrc_new.document_path);
2892 if (path.exists() && path.isDirectory())
2893 package().document_dir() = FileName(lyxrc.document_path);
2895 case LyXRC::RC_EDITOR_ALTERNATIVES:
2896 case LyXRC::RC_ESC_CHARS:
2897 case LyXRC::RC_EXAMPLEPATH:
2898 case LyXRC::RC_FONT_ENCODING:
2899 case LyXRC::RC_FORCE_PAINT_SINGLE_CHAR:
2900 case LyXRC::RC_FILEFORMAT:
2901 case LyXRC::RC_GROUP_LAYOUTS:
2902 case LyXRC::RC_HUNSPELLDIR_PATH:
2903 case LyXRC::RC_INDEX_ALTERNATIVES:
2904 case LyXRC::RC_INDEX_COMMAND:
2905 case LyXRC::RC_JBIBTEX_COMMAND:
2906 case LyXRC::RC_JINDEX_COMMAND:
2907 case LyXRC::RC_NOMENCL_COMMAND:
2908 case LyXRC::RC_INPUT:
2909 case LyXRC::RC_KBMAP:
2910 case LyXRC::RC_KBMAP_PRIMARY:
2911 case LyXRC::RC_KBMAP_SECONDARY:
2912 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2913 case LyXRC::RC_LANGUAGE_AUTO_END:
2914 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2915 case LyXRC::RC_LANGUAGE_COMMAND_END:
2916 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2917 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2918 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2919 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2920 case LyXRC::RC_LYXRCFORMAT:
2921 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2922 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2923 case LyXRC::RC_MACRO_EDIT_STYLE:
2924 case LyXRC::RC_MAKE_BACKUP:
2925 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2926 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2927 case LyXRC::RC_NUMLASTFILES:
2928 case LyXRC::RC_PARAGRAPH_MARKERS:
2929 case LyXRC::RC_PATH_PREFIX:
2930 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2931 prependEnvPath("PATH", lyxrc.path_prefix);
2933 case LyXRC::RC_PREVIEW:
2934 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2935 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2936 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2937 case LyXRC::RC_PRINTCOPIESFLAG:
2938 case LyXRC::RC_PRINTER:
2939 case LyXRC::RC_PRINTEVENPAGEFLAG:
2940 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2941 case LyXRC::RC_PRINTFILEEXTENSION:
2942 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2943 case LyXRC::RC_PRINTODDPAGEFLAG:
2944 case LyXRC::RC_PRINTPAGERANGEFLAG:
2945 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2946 case LyXRC::RC_PRINTPAPERFLAG:
2947 case LyXRC::RC_PRINTREVERSEFLAG:
2948 case LyXRC::RC_PRINTSPOOL_COMMAND:
2949 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2950 case LyXRC::RC_PRINTTOFILE:
2951 case LyXRC::RC_PRINTTOPRINTER:
2952 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2953 case LyXRC::RC_PRINT_COMMAND:
2954 case LyXRC::RC_RTL_SUPPORT:
2955 case LyXRC::RC_SAVE_COMPRESSED:
2956 case LyXRC::RC_SCREEN_DPI:
2957 case LyXRC::RC_SCREEN_FONT_ROMAN:
2958 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2959 case LyXRC::RC_SCREEN_FONT_SANS:
2960 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2961 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2962 case LyXRC::RC_SCREEN_FONT_SIZES:
2963 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2964 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2965 case LyXRC::RC_GEOMETRY_SESSION:
2966 case LyXRC::RC_SCREEN_ZOOM:
2967 case LyXRC::RC_SERVERPIPE:
2968 case LyXRC::RC_SET_COLOR:
2969 case LyXRC::RC_SHOW_BANNER:
2970 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2971 case LyXRC::RC_SPELLCHECKER:
2972 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2973 case LyXRC::RC_SPELLCHECK_NOTES:
2974 case LyXRC::RC_SPLITINDEX_COMMAND:
2975 case LyXRC::RC_TEMPDIRPATH:
2976 case LyXRC::RC_TEMPLATEPATH:
2977 case LyXRC::RC_TEX_ALLOWS_SPACES:
2978 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2979 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2980 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2982 case LyXRC::RC_THESAURUSDIRPATH:
2983 case LyXRC::RC_UIFILE:
2984 case LyXRC::RC_USER_EMAIL:
2985 case LyXRC::RC_USER_NAME:
2986 case LyXRC::RC_USE_CONVERTER_CACHE:
2987 case LyXRC::RC_USE_SYSTEM_COLORS:
2988 case LyXRC::RC_USE_TOOLTIP:
2989 case LyXRC::RC_USE_PIXMAP_CACHE:
2990 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2991 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2992 case LyXRC::RC_SINGLE_INSTANCE:
2993 case LyXRC::RC_SORT_LAYOUTS:
2994 case LyXRC::RC_FULL_SCREEN_LIMIT:
2995 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2996 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2997 case LyXRC::RC_FULL_SCREEN_TABBAR:
2998 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2999 case LyXRC::RC_FULL_SCREEN_WIDTH:
3000 case LyXRC::RC_VISUAL_CURSOR:
3001 case LyXRC::RC_VIEWER:
3002 case LyXRC::RC_VIEWER_ALTERNATIVES:
3003 case LyXRC::RC_FORWARD_SEARCH_DVI:
3004 case LyXRC::RC_FORWARD_SEARCH_PDF:
3005 case LyXRC::RC_EXPORT_OVERWRITE:
3006 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
3007 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
3008 case LyXRC::RC_LAST:
3015 string const LyXRC::getDescription(LyXRCTags tag)
3020 case RC_ACCEPT_COMPOUND:
3021 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3025 str = _("Specify an alternate language. The default is to use the language of the document.");
3028 case RC_PLAINTEXT_LINELEN:
3029 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.");
3032 case RC_AUTOREGIONDELETE:
3033 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3036 case RC_AUTORESET_OPTIONS:
3037 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3041 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3044 case RC_AUTO_NUMBER:
3047 case RC_BACKUPDIR_PATH:
3048 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.");
3051 case RC_BIBTEX_COMMAND:
3052 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3055 case RC_JBIBTEX_COMMAND:
3056 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3060 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3063 case RC_CHECKLASTFILES:
3064 str = _("Select to check whether the lastfiles still exist.");
3067 case RC_CHKTEX_COMMAND:
3068 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3077 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3078 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.");
3081 case RC_SCROLL_BELOW_DOCUMENT:
3082 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");
3085 case RC_MAC_DONTSWAP_CTRL_META:
3086 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3089 case RC_MAC_LIKE_WORD_MOVEMENT:
3090 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3093 case RC_SHOW_MACRO_LABEL:
3094 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3097 case RC_DATE_INSERT_FORMAT:
3098 //xgettext:no-c-format
3099 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3103 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3106 case RC_DEFAULT_VIEW_FORMAT:
3107 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3110 case RC_DEFAULT_LANGUAGE:
3111 str = _("New documents will be assigned this language.");
3114 case RC_DEFAULT_PAPERSIZE:
3115 str = _("Specify the default paper size.");
3118 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3119 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3122 case RC_DISPLAY_GRAPHICS:
3123 str = _("Select how LyX will display any graphics.");
3126 case RC_DOCUMENTPATH:
3127 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3131 str = _("Specify additional chars that can be part of a word.");
3134 case RC_EXAMPLEPATH:
3135 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3138 case RC_FONT_ENCODING:
3139 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3142 case RC_FORCE_PAINT_SINGLE_CHAR:
3143 str = _("Disable any kerning and ligatures for text drawing on screen.");
3149 case RC_INDEX_COMMAND:
3150 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\".");
3153 case RC_JINDEX_COMMAND:
3154 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3157 case RC_NOMENCL_COMMAND:
3158 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3165 case RC_KBMAP_PRIMARY:
3166 case RC_KBMAP_SECONDARY:
3167 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.");
3170 case RC_LANGUAGE_AUTO_BEGIN:
3171 str = _("Select if a language switching command is needed at the beginning of the document.");
3174 case RC_LANGUAGE_AUTO_END:
3175 str = _("Select if a language switching command is needed at the end of the document.");
3178 case RC_LANGUAGE_COMMAND_BEGIN:
3179 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.");
3182 case RC_LANGUAGE_COMMAND_END:
3183 str = _("The LaTeX command for changing back to the language of the document.");
3186 case RC_LANGUAGE_COMMAND_LOCAL:
3187 str = _("The LaTeX command for local changing of the language.");
3190 case RC_LANGUAGE_GLOBAL_OPTIONS:
3191 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3194 case RC_LANGUAGE_CUSTOM_PACKAGE:
3195 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3198 case RC_LANGUAGE_PACKAGE_SELECTION:
3199 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3202 case RC_USELASTFILEPOS:
3203 str = _("De-select if you do not want LyX to scroll to saved position.");
3206 case RC_LOADSESSION:
3207 str = _("De-select to prevent loading files opened from the last LyX session.");
3210 case RC_MAKE_BACKUP:
3211 str = _("De-select if you don't want LyX to create backup files.");
3214 case RC_MARK_FOREIGN_LANGUAGE:
3215 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3218 case RC_MOUSE_WHEEL_SPEED:
3219 str = bformat(_("The scrolling speed of the mouse wheel."),
3223 case RC_COMPLETION_POPUP_DELAY:
3224 str = _("The completion popup delay.");
3227 case RC_COMPLETION_POPUP_MATH:
3228 str = _("Select to display the completion popup in math mode.");
3231 case RC_COMPLETION_POPUP_TEXT:
3232 str = _("Select to display the completion popup in text mode.");
3235 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3236 str = _("Show the completion popup without delay after non-unique completion attempt.");
3239 case RC_COMPLETION_POPUP_TEXT:
3240 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3243 case RC_COMPLETION_POPUP_DELAY:
3244 str = _("The inline completion delay.");
3247 case RC_COMPLETION_INLINE_MATH:
3248 str = _("Select to display the inline completion in math mode.");
3251 case RC_COMPLETION_INLINE_TEXT:
3252 str = _("Select to display the inline completion in text mode.");
3255 case RC_COMPLETION_INLINE_DOTS:
3256 str = _("Use \"...\" to shorten long completions.");
3259 case RC_AUTOCORRECTION_MATH:
3260 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3263 case RC_NUMLASTFILES:
3264 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3268 case RC_PATH_PREFIX:
3269 str = _("Specify those directories which should be "
3270 "prepended to the PATH environment variable. "
3271 "Use the OS native format.");
3275 str = _("Shows a typeset preview of things such as math");
3278 case RC_PREVIEW_HASHED_LABELS:
3279 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3282 case RC_PREVIEW_SCALE_FACTOR:
3283 str = _("Scale the preview size to suit.");
3286 case RC_PRINTCOLLCOPIESFLAG:
3287 str = _("The option for specifying whether the copies should be collated.");
3290 case RC_PRINTCOPIESFLAG:
3291 str = _("The option for specifying the number of copies to print.");
3295 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3298 case RC_PRINTEVENPAGEFLAG:
3299 str = _("The option to print only even pages.");
3302 case RC_PRINTEXSTRAOPTIONS:
3303 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3306 case RC_PRINTFILEEXTENSION:
3307 str = _("Extension of printer program output file. Usually \".ps\".");
3310 case RC_PRINTLANDSCAPEFLAG:
3311 str = _("The option to print out in landscape.");
3314 case RC_PRINTODDPAGEFLAG:
3315 str = _("The option to print only odd pages.");
3318 case RC_PRINTPAGERANGEFLAG:
3319 str = _("The option for specifying a comma-separated list of pages to print.");
3322 case RC_PRINTPAPERDIMENSIONFLAG:
3323 str = _("Option to specify the dimensions of the print paper.");
3326 case RC_PRINTPAPERFLAG:
3327 str = _("The option to specify paper type.");
3330 case RC_PRINTREVERSEFLAG:
3331 str = _("The option to reverse the order of the pages printed.");
3334 case RC_PRINTSPOOL_COMMAND:
3335 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.");
3338 case RC_PRINTSPOOL_PRINTERPREFIX:
3339 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.");
3342 case RC_PRINTTOFILE:
3343 str = _("Option to pass to the print program to print to a file.");
3346 case RC_PRINTTOPRINTER:
3347 str = _("Option to pass to the print program to print on a specific printer.");
3350 case RC_PRINT_ADAPTOUTPUT:
3351 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3354 case RC_PRINT_COMMAND:
3355 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3358 case RC_RTL_SUPPORT:
3359 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3362 case RC_VISUAL_CURSOR:
3363 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3367 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3370 case RC_SCREEN_FONT_ROMAN:
3371 case RC_SCREEN_FONT_SANS:
3372 case RC_SCREEN_FONT_TYPEWRITER:
3373 str = _("The screen fonts used to display the text while editing.");
3376 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3377 case RC_SCREEN_FONT_SANS_FOUNDRY:
3378 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3381 case RC_SCREEN_FONT_SCALABLE:
3382 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.");
3385 case RC_SCREEN_FONT_SIZES:
3386 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3389 case RC_SCREEN_ZOOM:
3390 //xgettext:no-c-format
3391 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3394 case RC_GEOMETRY_SESSION:
3395 str = _("Allow session manager to save and restore windows geometry.");
3399 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3405 case RC_SHOW_BANNER:
3406 str = _("De-select if you don't want the startup banner.");
3409 case RC_TEMPDIRPATH:
3410 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3413 case RC_THESAURUSDIRPATH:
3414 str = _("This is the place where the files of the thesaurus library reside.");
3417 case RC_TEMPLATEPATH:
3418 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3421 case RC_TEX_ALLOWS_SPACES:
3424 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3428 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3437 case RC_USE_USE_SYSTEM_COLORS:
3438 str = _("Enable use the system colors for some things like main window background and selection.");
3441 case RC_USE_TOOLTIP:
3442 str = _("Enable the automatic appearance of tool tips in the work area.");
3445 case RC_USE_PIXMAP_CACHE:
3446 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3449 case RC_VIEWDVI_PAPEROPTION:
3450 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3465 // The global instance
3468 // The global copy of the system lyxrc entries (everything except preferences)