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 // when adding something to this array keep it sorted!
58 LexerKeyword lyxrcTags[] = {
59 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
60 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
61 { "\\alternate_language", LyXRC::RC_ALT_LANG },
62 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
63 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
64 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
65 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
66 { "\\autosave", LyXRC::RC_AUTOSAVE },
67 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
68 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
69 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
70 { "\\bind_file", LyXRC::RC_BINDFILE },
71 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
72 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
73 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
74 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
75 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
76 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
77 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
78 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
79 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
80 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
81 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
82 { "\\converter", LyXRC::RC_CONVERTER },
83 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
84 { "\\copier", LyXRC::RC_COPIER },
85 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
86 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
87 { "\\def_file", LyXRC::RC_DEFFILE },
88 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
89 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
90 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
91 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
92 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
93 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
94 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
95 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
96 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
97 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
98 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
99 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
100 { "\\format", LyXRC::RC_FORMAT },
101 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
102 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
103 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
104 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
105 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
106 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
107 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
108 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
109 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
110 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
111 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
112 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
113 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
114 { "\\input", LyXRC::RC_INPUT },
115 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
116 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
117 { "\\kbmap", LyXRC::RC_KBMAP },
118 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
119 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
120 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
121 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
122 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
123 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
124 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
125 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
126 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
127 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
128 { "\\load_session", LyXRC::RC_LOADSESSION },
129 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
130 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
131 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
132 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
133 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
134 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
135 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
136 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
137 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
138 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
139 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
140 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
141 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
142 { "\\preview", LyXRC::RC_PREVIEW },
143 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
144 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
145 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
146 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
147 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
148 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
149 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
150 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
151 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
152 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
153 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
154 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
155 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
156 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
157 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
158 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
159 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
160 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
161 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
162 { "\\printer", LyXRC::RC_PRINTER },
163 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
164 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
165 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
166 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
167 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
168 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
169 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
170 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
171 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
172 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
173 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
174 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
175 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
176 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
177 { "\\set_color", LyXRC::RC_SET_COLOR },
178 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
179 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
180 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
181 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
182 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
183 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
184 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
185 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
186 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
187 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
188 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
189 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
190 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
191 { "\\ui_file", LyXRC::RC_UIFILE },
192 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
193 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
194 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
195 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
196 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
197 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
198 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
199 // compatibility with versions older than 1.4.0 only
200 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
201 // compatibility with versions older than 1.4.0 only
202 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
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}
213 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
224 void LyXRC::setDefaults()
227 def_file = "default";
229 // Get printer from the environment. If fail, use default "",
230 // assuming that everything is set up correctly.
231 printer = getEnv("PRINTER");
232 print_adapt_output = false;
233 print_command = "dvips";
234 print_evenpage_flag = "-B";
235 print_oddpage_flag = "-A";
236 print_pagerange_flag = "-pp";
237 print_copies_flag = "-c";
238 print_collcopies_flag = "-C";
239 print_reverse_flag = "-r";
240 print_landscape_flag = "-t landscape";
241 print_to_printer = "-P";
242 print_to_file = "-o ";
243 print_file_extension = ".ps";
244 print_paper_flag = "-t";
245 print_paper_dimension_flag = "-T";
246 document_path.erase();
247 view_dvi_paper_option.erase();
248 default_papersize = PAPER_DEFAULT;
249 default_view_format = "pdf2";
250 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
251 bibtex_command = "bibtex";
253 index_command = "makeindex -c -q";
254 nomencl_command = "makeindex -s nomencl.ist";
256 // Because a screen is typically wider than a piece of paper:
258 allow_geometry_session = true;
259 // Default LaTeX font size:
260 font_sizes[FONT_SIZE_TINY] = "5.0";
261 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
262 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
263 font_sizes[FONT_SIZE_SMALL] = "9.0";
264 font_sizes[FONT_SIZE_NORMAL] = "10.0";
265 font_sizes[FONT_SIZE_LARGE] = "12.0";
266 font_sizes[FONT_SIZE_LARGER] = "14.4";
267 font_sizes[FONT_SIZE_LARGEST] = "17.26";
268 font_sizes[FONT_SIZE_HUGE] = "20.74";
269 font_sizes[FONT_SIZE_HUGER] = "24.88";
270 use_scalable_fonts = true;
271 roman_font_name = "";
273 typewriter_font_name = "";
275 auto_region_delete = true;
276 auto_reset_options = false;
277 plaintext_linelen = 65;
278 mouse_wheel_speed = 1.0;
279 num_lastfiles = maxlastfiles;
280 check_lastfiles = true;
281 use_lastfilepos = true;
282 load_session = false;
284 save_compressed = false;
285 backupdir_path.erase();
286 display_graphics = true;
287 // Spellchecker settings:
288 // FIXME: this check should test the target platform (darwin)
289 #if defined(USE_MACOSX_PACKAGING)
290 spellchecker = "native";
291 #elif defined(USE_ASPELL)
292 spellchecker = "aspell";
293 #elif defined(USE_HUNSPELL)
294 spellchecker = "hunspell";
296 spellchecker = "aspell";
298 spellchecker_accept_compound = false;
299 spellcheck_continuously = false;
300 spellcheck_notes = true;
303 visual_cursor = false;
305 mark_foreign_language = true;
306 language_auto_begin = true;
307 language_auto_end = true;
308 language_global_options = true;
309 language_use_babel = true;
310 language_package = "\\usepackage{babel}";
311 language_command_begin = "\\selectlanguage{$$lang}";
312 language_command_local = "\\foreignlanguage{$$lang}{";
313 sort_layouts = false;
314 group_layouts = true;
315 default_language = "english";
316 gui_language = "auto";
318 windows_style_tex_paths = false;
319 tex_allows_spaces = false;
320 date_insert_format = "%x";
321 cursor_follows_scrollbar = false;
322 scroll_below_document = false;
323 paragraph_markers = 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;
332 use_pixmap_cache = false;
333 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
334 user_name = to_utf8(support::user_name());
335 user_email = to_utf8(support::user_email());
336 open_buffers_in_tabs = true;
337 single_close_tab_button = false;
338 forward_search_dvi = string();
339 forward_search_pdf = string();
340 export_overwrite = NO_FILES;
342 // Fullscreen settings
343 full_screen_limit = false;
344 full_screen_toolbars = true;
345 full_screen_tabbar = true;
346 full_screen_menubar = true;
347 full_screen_scrollbar = true;
348 full_screen_width = 700;
350 completion_cursor_text = true;
351 completion_popup_math = true;
352 completion_popup_text = false;
353 completion_popup_delay = 2.0;
354 completion_popup_after_complete = true;
355 autocorrection_math = false;
356 completion_inline_math = true;
357 completion_inline_text = false;
358 completion_inline_dots = -1;
359 completion_inline_delay = 0.2;
360 default_decimal_point = ".";
366 void oldFontFormat(string & family, string & foundry)
368 if (family.empty() || family[0] != '-')
370 foundry = token(family, '-', 1);
371 family = token(family, '-', 2);
379 int LyXRC::read(FileName const & filename)
381 Lexer lexrc(lyxrcTags);
382 if (lyxerr.debugging(Debug::PARSER))
383 lexrc.printTable(lyxerr);
385 lexrc.setFile(filename);
389 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
395 int LyXRC::read(istream & is)
397 Lexer lexrc(lyxrcTags);
398 if (lyxerr.debugging(Debug::PARSER))
399 lexrc.printTable(lyxerr);
405 LYXERR(Debug::LYXRC, "Reading istream...");
411 int LyXRC::read(Lexer & lexrc)
416 while (lexrc.isOK()) {
417 // By using two switches we take advantage of the compiler
418 // telling us if we have missed a LyXRCTags element in
419 // the second switch.
420 // Note that this also shows a problem with Lexer since it
421 // helps us avoid taking advantage of the strictness of the
424 int le = lexrc.lex();
426 case Lexer::LEX_UNDEF:
427 lexrc.printError("Unknown tag `$$Token'");
429 case Lexer::LEX_FEOF:
434 switch (static_cast<LyXRCTags>(le)) {
435 case RC_INPUT: // Include file
438 libFileSearch(string(),
441 lexrc.printError("Error reading "
442 "included file: " + tmp.absFileName());
448 bind_file = os::internal_path(lexrc.getString());
453 def_file = os::internal_path(lexrc.getString());
458 ui_file = os::internal_path(lexrc.getString());
461 case RC_AUTORESET_OPTIONS:
462 lexrc >> auto_reset_options;
465 case RC_DISPLAY_GRAPHICS:
467 display_graphics = lexrc.getString() == "true";
470 case RC_TEX_EXPECTS_WINDOWS_PATHS:
471 lexrc >> windows_style_tex_paths;
474 case RC_TEX_ALLOWS_SPACES:
475 lexrc >> tex_allows_spaces;
482 case RC_KBMAP_PRIMARY:
484 string const kmap(os::internal_path(lexrc.getString()));
485 if (!libFileSearch("kbd", kmap, "kmap").empty()
487 primary_kbmap = kmap;
489 lexrc.printError("LyX: Keymap `$$Token' not found");
494 case RC_KBMAP_SECONDARY:
496 string const kmap(os::internal_path(lexrc.getString()));
497 if (!libFileSearch("kbd", kmap, "kmap").empty()
499 secondary_kbmap = kmap;
501 lexrc.printError("LyX: Keymap `$$Token' not found");
506 case RC_FONT_ENCODING:
514 case RC_PRINT_COMMAND:
515 if (lexrc.next(true)) {
516 print_command = lexrc.getString();
520 case RC_PRINTEVENPAGEFLAG:
521 lexrc >> print_evenpage_flag;
524 case RC_PRINTODDPAGEFLAG:
525 lexrc >> print_oddpage_flag;
528 case RC_PRINTPAGERANGEFLAG:
529 lexrc >> print_pagerange_flag;
532 case RC_PRINTCOPIESFLAG:
533 lexrc >> print_copies_flag;
536 case RC_PRINTCOLLCOPIESFLAG:
537 lexrc >> print_collcopies_flag;
540 case RC_PRINTREVERSEFLAG:
541 lexrc >> print_reverse_flag;
544 case RC_PRINTLANDSCAPEFLAG:
545 lexrc >> print_landscape_flag;
548 case RC_PRINTTOPRINTER:
549 lexrc >> print_to_printer;
552 case RC_PRINT_ADAPTOUTPUT:
553 lexrc >> print_adapt_output;
558 print_to_file = os::internal_path(lexrc.getString());
562 case RC_PRINTFILEEXTENSION:
563 lexrc >> print_file_extension;
566 case RC_PRINTEXSTRAOPTIONS:
567 lexrc >> print_extra_options;
570 case RC_PRINTSPOOL_COMMAND:
571 if (lexrc.next(true)) {
572 print_spool_command = lexrc.getString();
576 case RC_PRINTSPOOL_PRINTERPREFIX:
577 lexrc >> print_spool_printerprefix;
580 case RC_PRINTPAPERDIMENSIONFLAG:
581 lexrc >> print_paper_dimension_flag;
584 case RC_PRINTPAPERFLAG:
585 lexrc >> print_paper_flag;
588 case RC_DEFAULT_PAPERSIZE:
590 string const size = ascii_lowercase(lexrc.getString());
591 if (size == "usletter")
592 default_papersize = PAPER_USLETTER;
593 else if (size == "legal")
594 default_papersize = PAPER_USLEGAL;
595 else if (size == "executive")
596 default_papersize = PAPER_USEXECUTIVE;
597 else if (size == "a3")
598 default_papersize = PAPER_A3;
599 else if (size == "a4")
600 default_papersize = PAPER_A4;
601 else if (size == "a5")
602 default_papersize = PAPER_A5;
603 else if (size == "b5")
604 default_papersize = PAPER_B5;
605 else if (size == "default")
606 default_papersize = PAPER_DEFAULT;
610 case RC_VIEWDVI_PAPEROPTION:
612 view_dvi_paper_option = lexrc.getString();
614 view_dvi_paper_option.erase();
617 case RC_CHKTEX_COMMAND:
618 if (lexrc.next(true)) {
619 chktex_command = lexrc.getString();
623 case RC_BIBTEX_ALTERNATIVES:
624 if (lexrc.next(true)) {
625 bibtex_alternatives.insert(lexrc.getString());
629 case RC_BIBTEX_COMMAND:
630 if (lexrc.next(true)) {
631 bibtex_command = lexrc.getString();
635 case RC_JBIBTEX_COMMAND:
636 if (lexrc.next(true)) {
637 jbibtex_command = lexrc.getString();
641 case RC_INDEX_ALTERNATIVES:
642 if (lexrc.next(true)) {
643 index_alternatives.insert(lexrc.getString());
647 case RC_INDEX_COMMAND:
648 if (lexrc.next(true)) {
649 index_command = lexrc.getString();
653 case RC_JINDEX_COMMAND:
654 if (lexrc.next(true)) {
655 jindex_command = lexrc.getString();
659 case RC_SPLITINDEX_COMMAND:
660 if (lexrc.next(true)) {
661 splitindex_command = lexrc.getString();
665 case RC_NOMENCL_COMMAND:
666 if (lexrc.next(true)) {
667 nomencl_command = lexrc.getString();
679 case RC_GEOMETRY_SESSION:
680 lexrc >> allow_geometry_session;
683 case RC_SCREEN_FONT_SIZES:
684 lexrc >> font_sizes[FONT_SIZE_TINY];
685 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
686 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
687 lexrc >> font_sizes[FONT_SIZE_SMALL];
688 lexrc >> font_sizes[FONT_SIZE_NORMAL];
689 lexrc >> font_sizes[FONT_SIZE_LARGE];
690 lexrc >> font_sizes[FONT_SIZE_LARGER];
691 lexrc >> font_sizes[FONT_SIZE_LARGEST];
692 lexrc >> font_sizes[FONT_SIZE_HUGE];
693 lexrc >> font_sizes[FONT_SIZE_HUGER];
696 case RC_SCREEN_FONT_SCALABLE:
697 lexrc >> use_scalable_fonts;
704 case RC_DOCUMENTPATH:
706 document_path = os::internal_path(lexrc.getString());
707 document_path = expandPath(document_path);
713 example_path = os::internal_path(lexrc.getString());
714 example_path = expandPath(example_path);
718 case RC_TEMPLATEPATH:
720 template_path = os::internal_path(lexrc.getString());
721 template_path = expandPath(template_path);
727 tempdir_path = os::internal_path(lexrc.getString());
728 tempdir_path = expandPath(tempdir_path);
732 case RC_THESAURUSDIRPATH:
734 thesaurusdir_path = os::internal_path(lexrc.getString());
735 thesaurusdir_path = expandPath(thesaurusdir_path);
739 case RC_HUNSPELLDIR_PATH:
741 hunspelldir_path = os::internal_path(lexrc.getString());
742 hunspelldir_path = expandPath(hunspelldir_path);
746 case RC_USELASTFILEPOS:
747 lexrc >> use_lastfilepos;
751 lexrc >> load_session;
754 case RC_MOUSE_WHEEL_SPEED:
755 lexrc >> mouse_wheel_speed;
758 case RC_COMPLETION_INLINE_DELAY:
759 lexrc >> completion_inline_delay;
762 case RC_COMPLETION_INLINE_MATH:
763 lexrc >> completion_inline_math;
766 case RC_COMPLETION_INLINE_TEXT:
767 lexrc >> completion_inline_text;
770 case RC_COMPLETION_INLINE_DOTS:
771 lexrc >> completion_inline_dots;
774 case RC_AUTOCORRECTION_MATH:
775 lexrc >> autocorrection_math;
778 case RC_COMPLETION_POPUP_DELAY:
779 lexrc >> completion_popup_delay;
782 case RC_COMPLETION_POPUP_MATH:
783 lexrc >> completion_popup_math;
786 case RC_COMPLETION_POPUP_TEXT:
787 lexrc >> completion_popup_text;
790 case RC_COMPLETION_CURSOR_TEXT:
791 lexrc >> completion_cursor_text;
794 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
795 lexrc >> completion_popup_after_complete;
798 case RC_NUMLASTFILES:
799 lexrc >> num_lastfiles;
802 case RC_CHECKLASTFILES:
803 lexrc >> check_lastfiles;
806 case RC_SCREEN_FONT_ROMAN:
808 roman_font_name = lexrc.getString();
809 oldFontFormat(roman_font_name,
814 case RC_SCREEN_FONT_SANS:
816 sans_font_name = lexrc.getString();
817 oldFontFormat(sans_font_name, sans_font_foundry);
821 case RC_SCREEN_FONT_TYPEWRITER:
823 typewriter_font_name = lexrc.getString();
824 oldFontFormat(typewriter_font_name,
825 typewriter_font_foundry);
829 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
830 lexrc >> roman_font_foundry;
833 case RC_SCREEN_FONT_SANS_FOUNDRY:
834 lexrc >> sans_font_foundry;
837 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
838 lexrc >> typewriter_font_foundry;
843 lexrc.printError("Missing color tag.");
846 string lyx_name = lexrc.getString();
849 lexrc.printError("Missing color name for color: `$$Token'");
852 string x11_name = lexrc.getString();
854 ColorCode const col =
855 lcolor.getFromLyXName(lyx_name);
856 if (col == Color_none ||
857 col == Color_inherit ||
861 if (!lcolor.setColor(col, x11_name))
862 LYXERR0("Bad lyxrc set_color for " << lyx_name);
866 case RC_AUTOREGIONDELETE:
867 // Auto region delete defaults to true
868 lexrc >> auto_region_delete;
873 lyxpipes = os::internal_path(lexrc.getString());
874 lyxpipes = expandPath(lyxpipes);
878 case RC_CURSOR_FOLLOWS_SCROLLBAR:
879 lexrc >> cursor_follows_scrollbar;
882 case RC_SCROLL_BELOW_DOCUMENT:
883 lexrc >> scroll_below_document;
886 case RC_PARAGRAPH_MARKERS:
887 lexrc >> paragraph_markers;
890 case RC_MAC_LIKE_WORD_MOVEMENT:
891 lexrc >> mac_like_word_movement;
894 case RC_MACRO_EDIT_STYLE:
896 switch (lexrc.getInteger()) {
897 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
898 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
899 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
904 case RC_DIALOGS_ICONIFY_WITH_MAIN:
905 lexrc >> dialogs_iconify_with_main;
908 case RC_PLAINTEXT_LINELEN:
909 lexrc >> plaintext_linelen;
911 // Spellchecker settings:
912 case RC_ACCEPT_COMPOUND:
913 lexrc >> spellchecker_accept_compound;
916 lexrc >> use_tooltip;
918 case RC_USE_PIXMAP_CACHE:
919 lexrc >> use_pixmap_cache;
921 case RC_SPELLCHECKER:
922 lexrc >> spellchecker;
925 lexrc >> spellchecker_alt_lang;
928 lexrc >> spellchecker_esc_chars;
930 case RC_SPELLCHECK_CONTINUOUSLY:
931 lexrc >> spellcheck_continuously;
933 case RC_SPELLCHECK_NOTES:
934 lexrc >> spellcheck_notes;
937 lexrc >> make_backup;
939 case RC_SAVE_COMPRESSED:
940 lexrc >> save_compressed;
942 case RC_BACKUPDIR_PATH:
944 backupdir_path = os::internal_path(lexrc.getString());
945 backupdir_path = expandPath(backupdir_path);
948 case RC_DEFAULT_DECIMAL_POINT:
949 lexrc >> default_decimal_point;
951 case RC_DATE_INSERT_FORMAT:
952 lexrc >> date_insert_format;
954 case RC_LANGUAGE_PACKAGE:
955 lexrc >> language_package;
957 case RC_LANGUAGE_AUTO_BEGIN:
958 lexrc >> language_auto_begin;
960 case RC_LANGUAGE_AUTO_END:
961 lexrc >> language_auto_end;
963 case RC_LANGUAGE_GLOBAL_OPTIONS:
964 lexrc >> language_global_options;
966 case RC_LANGUAGE_USE_BABEL:
967 lexrc >> language_use_babel;
969 case RC_LANGUAGE_COMMAND_BEGIN:
970 lexrc >> language_command_begin;
972 case RC_LANGUAGE_COMMAND_END:
973 lexrc >> language_command_end;
975 case RC_LANGUAGE_COMMAND_LOCAL:
976 lexrc >> language_command_local;
979 lexrc >> rtl_support;
981 case RC_VISUAL_CURSOR:
982 lexrc >> visual_cursor;
985 lexrc >> auto_number;
987 case RC_MARK_FOREIGN_LANGUAGE:
988 lexrc >> mark_foreign_language;
994 fmt = lexrc.getString();
995 if (lexrc.next(true))
996 command = lexrc.getString();
997 setMover(fmt, command);
1001 case RC_CONVERTER: {
1002 string from, to, command, flags;
1004 from = lexrc.getString();
1006 to = lexrc.getString();
1007 if (lexrc.next(true))
1008 command = lexrc.getString();
1010 flags = lexrc.getString();
1011 if (command.empty())
1012 theConverters().erase(from, to);
1014 theConverters().add(from, to, command, flags);
1017 // compatibility with versions older than 1.4.0 only
1019 string format, command;
1020 lexrc >> format >> command;
1021 formats.setViewer(format, command);
1025 string format, extension, prettyname, shortcut;
1026 lexrc >> format >> extension >> prettyname >> shortcut;
1027 string viewer, editor;
1028 if (lexrc.next(true))
1029 viewer = lexrc.getString();
1030 if (lexrc.next(true))
1031 editor = lexrc.getString();
1033 // Hack to ensure compatibility with versions older
1035 int le = lexrc.lex();
1036 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1037 flags = lexrc.getString();
1038 if (le != Lexer::LEX_DATA) {
1039 // We have got a known token.
1040 // Therefore this is an old style
1041 // format definition without
1043 lexrc.pushToken(flags);
1047 int flgs = Format::none;
1048 while (!flags.empty()) {
1050 flags = split(flags, flag, ',');
1051 if (flag == "document")
1052 flgs |= Format::document;
1053 else if (flag == "vector")
1054 flgs |= Format::vector;
1056 LYXERR0("Ignoring unknown flag `"
1057 << flag << "' for format `"
1060 if (prettyname.empty()) {
1061 if (theConverters().formatIsUsed(format))
1062 LYXERR0("Can't delete format " << format);
1064 formats.erase(format);
1066 formats.add(format, extension, prettyname,
1067 shortcut, viewer, editor, flgs);
1071 case RC_VIEWER_ALTERNATIVES: {
1072 string format, command;
1074 format = lexrc.getString();
1075 if (lexrc.eatLine())
1076 command = lexrc.getString();
1077 viewer_alternatives[format].insert(command);
1080 case RC_EDITOR_ALTERNATIVES: {
1081 string format, command;
1082 lexrc >> format >> command;
1083 editor_alternatives[format].insert(command);
1087 case RC_DEFAULT_VIEW_FORMAT:
1088 lexrc >> default_view_format;
1091 case RC_DEFAULT_LANGUAGE:
1092 lexrc >> default_language;
1095 case RC_GUI_LANGUAGE:
1096 lexrc >> gui_language;
1099 case RC_SHOW_BANNER:
1100 lexrc >> show_banner;
1105 string const tmp = lexrc.getString();
1106 if (tmp == "true" || tmp == "on")
1107 preview = PREVIEW_ON;
1108 else if (tmp == "no_math")
1109 preview = PREVIEW_NO_MATH;
1111 preview = PREVIEW_OFF;
1112 if (tmp != "false" && tmp != "off")
1113 LYXERR0("Unrecognized preview status \""
1119 case RC_PREVIEW_HASHED_LABELS:
1120 lexrc >> preview_hashed_labels;
1123 case RC_PREVIEW_SCALE_FACTOR:
1124 lexrc >> preview_scale_factor;
1131 lexrc >> user_email;
1134 case RC_PATH_PREFIX:
1135 lexrc >> path_prefix;
1138 case RC_USE_CONVERTER_CACHE:
1139 lexrc >> use_converter_cache;
1141 case RC_CONVERTER_CACHE_MAXAGE:
1142 lexrc >> converter_cache_maxage;
1145 case RC_SORT_LAYOUTS:
1146 lexrc >> sort_layouts;
1148 case RC_GROUP_LAYOUTS:
1149 lexrc >> group_layouts;
1151 case RC_FULL_SCREEN_LIMIT:
1152 lexrc >> full_screen_limit;
1154 case RC_FULL_SCREEN_TOOLBARS:
1155 lexrc >> full_screen_toolbars;
1157 case RC_FULL_SCREEN_SCROLLBAR:
1158 lexrc >> full_screen_scrollbar;
1160 case RC_FULL_SCREEN_TABBAR:
1161 lexrc >> full_screen_tabbar;
1163 case RC_FULL_SCREEN_MENUBAR:
1164 lexrc >> full_screen_menubar;
1166 case RC_FULL_SCREEN_WIDTH:
1167 lexrc >> full_screen_width;
1169 case RC_OPEN_BUFFERS_IN_TABS:
1170 lexrc >> open_buffers_in_tabs;
1172 case RC_SINGLE_CLOSE_TAB_BUTTON:
1173 lexrc >> single_close_tab_button;
1175 case RC_FORWARD_SEARCH_DVI:
1176 if (lexrc.next(true))
1177 forward_search_dvi = lexrc.getString();
1179 case RC_FORWARD_SEARCH_PDF:
1180 if (lexrc.next(true))
1181 forward_search_pdf = lexrc.getString();
1183 case RC_EXPORT_OVERWRITE:
1185 string const tmp = lexrc.getString();
1186 if (tmp == "all" || tmp == "true")
1187 export_overwrite = ALL_FILES;
1188 else if (tmp == "main")
1189 export_overwrite = MAIN_FILE;
1191 export_overwrite = NO_FILES;
1192 if (tmp != "ask" && tmp != "false")
1193 LYXERR0("Unrecognized export_overwrite status \""
1199 // Obsoteted in 1.4.0
1202 case RC_SPELL_COMMAND:
1204 case RC_PLAINTEXT_ROFF_COMMAND:
1205 case RC_USE_ALT_LANG:
1206 case RC_USE_ESC_CHARS:
1207 case RC_USE_INP_ENC:
1208 case RC_USE_PERS_DICT:
1209 case RC_USE_SPELL_LIB:
1210 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1211 << lexrc.getString() << "'.");
1216 break; // this is just a dummy
1220 /// Update converters data-structures
1221 theConverters().update(formats);
1222 theConverters().buildGraph();
1228 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1230 ofstream ofs(filename.toFilesystemEncoding().c_str());
1232 write(ofs, ignore_system_lyxrc);
1236 void LyXRC::print() const
1238 if (lyxerr.debugging())
1239 write(lyxerr, false);
1247 typedef pair<string, SpecialisedMover> Data;
1249 SameMover(Data const & comparison)
1250 : comparison_(comparison) {}
1252 bool operator()(Data const & data) const
1254 return data.first == comparison_.first &&
1255 data.second.command() == comparison_.second.command();
1265 // Escape \ and " so that LyXLex can read the string later
1266 string escapeCommand(string const & str) {
1267 return subst(subst(str , "\\", "\\\\"),
1274 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1276 LyXRCTags tag = RC_LAST;
1278 if (!name.empty()) {
1279 for (int i = 0; i != lyxrcCount; ++i)
1280 if ("\\" + name == lyxrcTags[i].tag)
1281 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1285 os << "# LyX " << lyx_version
1286 << " generated this file. If you want to make your own\n"
1287 << "# modifications you should do them from inside LyX and save.\n"
1290 // Why the switch you might ask. It is a trick to ensure that all
1291 // the elements in the LyXRCTags enum are handled. As you can see
1292 // there are no breaks at all. So it is just a huge fall-through.
1293 // The nice thing is that we will get a warning from the compiler
1294 // if we forget an element.
1298 // input/include files are not done here
1300 if (ignore_system_lyxrc ||
1301 bind_file != system_lyxrc.bind_file) {
1302 string const path = os::external_path(bind_file);
1303 os << "\\bind_file \"" << path << "\"\n";
1309 if (ignore_system_lyxrc ||
1310 def_file != system_lyxrc.def_file) {
1311 string const path = os::external_path(def_file);
1312 os << "\\def_file \"" << path << "\"\n";
1321 << "# MISC SECTION ######################################\n"
1323 // bind files are not done here.
1325 case RC_PATH_PREFIX:
1326 if (ignore_system_lyxrc ||
1327 path_prefix != system_lyxrc.path_prefix) {
1328 os << "\\path_prefix \"" << path_prefix << "\"\n";
1333 if (ignore_system_lyxrc ||
1334 ui_file != system_lyxrc.ui_file) {
1335 string const path = os::external_path(ui_file);
1336 os << "\\ui_file \"" << path << "\"\n";
1340 case RC_AUTOREGIONDELETE:
1341 if (ignore_system_lyxrc ||
1342 auto_region_delete != system_lyxrc.auto_region_delete) {
1343 os << "# Set to false to inhibit automatic replacement of\n"
1344 << "# the current selection.\n"
1345 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1350 case RC_AUTORESET_OPTIONS:
1351 if (ignore_system_lyxrc ||
1352 auto_reset_options != system_lyxrc.auto_reset_options) {
1353 os << "# Set to false to inhibit automatic reset of\n"
1354 << "# the class options to defaults on class change.\n"
1355 << "\\auto_reset_options "
1356 << convert<string>(auto_reset_options)
1362 if (ignore_system_lyxrc ||
1363 autosave != system_lyxrc.autosave) {
1364 os << "# The time interval between auto-saves in seconds.\n"
1365 << "\\autosave " << autosave << '\n';
1369 case RC_DISPLAY_GRAPHICS:
1370 if (ignore_system_lyxrc ||
1371 display_graphics != system_lyxrc.display_graphics) {
1372 os << "# Display graphics within LyX\n"
1374 << "\\display_graphics "
1375 << (display_graphics ? "true" : "false")
1380 case RC_SORT_LAYOUTS:
1381 if (ignore_system_lyxrc ||
1382 sort_layouts != system_lyxrc.sort_layouts) {
1383 os << "# Sort layouts alphabetically.\n"
1384 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1388 case RC_GROUP_LAYOUTS:
1389 if (ignore_system_lyxrc ||
1390 group_layouts != system_lyxrc.group_layouts) {
1391 os << "# Group layouts by their category.\n"
1392 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1396 case RC_VIEWDVI_PAPEROPTION:
1397 if (ignore_system_lyxrc ||
1398 view_dvi_paper_option
1399 != system_lyxrc.view_dvi_paper_option) {
1400 os << "# Options used to specify paper size to the\n"
1401 << "# view_dvi_command (e.g. -paper)\n"
1402 << "\\view_dvi_paper_option \""
1403 << view_dvi_paper_option << "\"\n";
1407 case RC_DEFAULT_PAPERSIZE:
1408 if (ignore_system_lyxrc ||
1409 default_papersize != system_lyxrc.default_papersize) {
1410 os << "# The default papersize to use.\n"
1411 << "\\default_papersize \"";
1412 switch (default_papersize) {
1414 os << "default"; break;
1415 case PAPER_USLETTER:
1416 os << "usletter"; break;
1418 os << "legal"; break;
1419 case PAPER_USEXECUTIVE:
1420 os << "executive"; break;
1453 case PAPER_JISB6: break;
1459 case RC_CHKTEX_COMMAND:
1460 if (ignore_system_lyxrc ||
1461 chktex_command != system_lyxrc.chktex_command) {
1462 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1466 case RC_BIBTEX_ALTERNATIVES: {
1467 CommandSet::const_iterator it = bibtex_alternatives.begin();
1468 CommandSet::const_iterator end = bibtex_alternatives.end();
1469 for ( ; it != end; ++it) {
1470 if (ignore_system_lyxrc
1471 || !system_lyxrc.bibtex_alternatives.count(*it))
1472 os << "\\bibtex_alternatives \""
1478 case RC_BIBTEX_COMMAND:
1479 if (ignore_system_lyxrc ||
1480 bibtex_command != system_lyxrc.bibtex_command) {
1481 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1485 case RC_JBIBTEX_COMMAND:
1486 if (ignore_system_lyxrc ||
1487 jbibtex_command != system_lyxrc.jbibtex_command) {
1488 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1492 case RC_INDEX_ALTERNATIVES: {
1493 CommandSet::const_iterator it = index_alternatives.begin();
1494 CommandSet::const_iterator end = index_alternatives.end();
1495 for ( ; it != end; ++it) {
1496 if (ignore_system_lyxrc
1497 || !system_lyxrc.index_alternatives.count(*it))
1498 os << "\\index_alternatives \""
1504 case RC_INDEX_COMMAND:
1505 if (ignore_system_lyxrc ||
1506 index_command != system_lyxrc.index_command) {
1507 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1511 case RC_JINDEX_COMMAND:
1512 if (ignore_system_lyxrc ||
1513 jindex_command != system_lyxrc.jindex_command) {
1514 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1518 case RC_SPLITINDEX_COMMAND:
1519 if (ignore_system_lyxrc ||
1520 splitindex_command != system_lyxrc.splitindex_command) {
1521 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1525 case RC_NOMENCL_COMMAND:
1526 if (ignore_system_lyxrc ||
1527 nomencl_command != system_lyxrc.nomencl_command) {
1528 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1532 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1533 if (ignore_system_lyxrc ||
1534 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1535 os << "\\tex_expects_windows_paths "
1536 << convert<string>(windows_style_tex_paths) << '\n';
1540 case RC_TEX_ALLOWS_SPACES:
1541 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1542 os << "\\tex_allows_spaces "
1543 << convert<string>(tex_allows_spaces) << '\n';
1548 if (ignore_system_lyxrc ||
1549 use_kbmap != system_lyxrc.use_kbmap) {
1550 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1554 case RC_KBMAP_PRIMARY:
1555 if (ignore_system_lyxrc ||
1556 primary_kbmap != system_lyxrc.primary_kbmap) {
1557 string const path = os::external_path(primary_kbmap);
1558 os << "\\kbmap_primary \"" << path << "\"\n";
1562 case RC_KBMAP_SECONDARY:
1563 if (ignore_system_lyxrc ||
1564 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1565 string const path = os::external_path(secondary_kbmap);
1566 os << "\\kbmap_secondary \"" << path << "\"\n";
1571 if (ignore_system_lyxrc ||
1572 lyxpipes != system_lyxrc.lyxpipes) {
1573 string const path = os::external_path(lyxpipes);
1574 os << "\\serverpipe \"" << path << "\"\n";
1578 case RC_DATE_INSERT_FORMAT:
1579 if (ignore_system_lyxrc ||
1580 date_insert_format != system_lyxrc.date_insert_format) {
1581 os << "\\date_insert_format \"" << date_insert_format
1588 os << "\\user_name \"" << user_name << "\"\n";
1593 os << "\\user_email \"" << user_email << "\"\n";
1597 case RC_SHOW_BANNER:
1598 if (ignore_system_lyxrc ||
1599 show_banner != system_lyxrc.show_banner) {
1600 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1606 if (ignore_system_lyxrc ||
1607 preview != system_lyxrc.preview) {
1613 case PREVIEW_NO_MATH:
1620 os << "\\preview " << status << '\n';
1625 case RC_PREVIEW_HASHED_LABELS:
1626 if (ignore_system_lyxrc ||
1627 preview_hashed_labels !=
1628 system_lyxrc.preview_hashed_labels) {
1629 os << "\\preview_hashed_labels "
1630 << convert<string>(preview_hashed_labels) << '\n';
1635 case RC_PREVIEW_SCALE_FACTOR:
1636 if (ignore_system_lyxrc ||
1637 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1638 os << "\\preview_scale_factor "
1639 << preview_scale_factor << '\n';
1644 case RC_USE_CONVERTER_CACHE:
1645 if (ignore_system_lyxrc ||
1646 use_converter_cache != system_lyxrc.use_converter_cache) {
1647 os << "\\use_converter_cache "
1648 << convert<string>(use_converter_cache) << '\n';
1653 case RC_CONVERTER_CACHE_MAXAGE:
1654 if (ignore_system_lyxrc ||
1655 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1656 os << "\\converter_cache_maxage "
1657 << converter_cache_maxage << '\n';
1663 << "# SCREEN & FONTS SECTION ############################\n"
1667 if (ignore_system_lyxrc ||
1668 dpi != system_lyxrc.dpi) {
1669 os << "\\screen_dpi " << dpi << '\n';
1673 case RC_SCREEN_ZOOM:
1674 if (ignore_system_lyxrc ||
1675 zoom != system_lyxrc.zoom) {
1676 os << "\\screen_zoom " << zoom << '\n';
1680 case RC_GEOMETRY_SESSION:
1681 if (ignore_system_lyxrc ||
1682 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1683 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1688 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1689 if (ignore_system_lyxrc ||
1690 cursor_follows_scrollbar
1691 != system_lyxrc.cursor_follows_scrollbar) {
1692 os << "\\cursor_follows_scrollbar "
1693 << convert<string>(cursor_follows_scrollbar) << '\n';
1697 case RC_SCROLL_BELOW_DOCUMENT:
1698 if (ignore_system_lyxrc ||
1699 scroll_below_document
1700 != system_lyxrc.scroll_below_document) {
1701 os << "\\scroll_below_document "
1702 << convert<string>(scroll_below_document) << '\n';
1706 case RC_PARAGRAPH_MARKERS:
1707 if (ignore_system_lyxrc ||
1709 != system_lyxrc.paragraph_markers) {
1710 os << "\\paragraph_markers "
1711 << convert<string>(paragraph_markers) << '\n';
1715 case RC_MAC_LIKE_WORD_MOVEMENT:
1716 if (ignore_system_lyxrc ||
1717 mac_like_word_movement
1718 != system_lyxrc.mac_like_word_movement) {
1719 os << "\\mac_like_word_movement "
1720 << convert<string>(mac_like_word_movement) << '\n';
1724 case RC_MACRO_EDIT_STYLE:
1725 if (ignore_system_lyxrc ||
1727 != system_lyxrc.macro_edit_style) {
1728 os << "\\macro_edit_style ";
1729 switch (macro_edit_style) {
1730 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1731 case MACRO_EDIT_INLINE: os << "1\n"; break;
1732 case MACRO_EDIT_LIST: os << "2\n"; break;
1737 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1738 if (ignore_system_lyxrc ||
1739 dialogs_iconify_with_main
1740 != system_lyxrc.dialogs_iconify_with_main) {
1741 os << "\\dialogs_iconify_with_main "
1742 << convert<string>(dialogs_iconify_with_main) << '\n';
1746 case RC_SCREEN_FONT_ROMAN:
1747 if (ignore_system_lyxrc ||
1748 roman_font_name != system_lyxrc.roman_font_name) {
1749 os << "\\screen_font_roman \"" << roman_font_name
1754 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1755 if (ignore_system_lyxrc ||
1756 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1757 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1762 case RC_SCREEN_FONT_SANS:
1763 if (ignore_system_lyxrc ||
1764 sans_font_name != system_lyxrc.sans_font_name) {
1765 os << "\\screen_font_sans \"" << sans_font_name
1770 case RC_SCREEN_FONT_SANS_FOUNDRY:
1771 if (ignore_system_lyxrc ||
1772 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1773 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1778 case RC_SCREEN_FONT_TYPEWRITER:
1779 if (ignore_system_lyxrc ||
1780 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1781 os << "\\screen_font_typewriter \""
1782 << typewriter_font_name << "\"\n";
1786 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1787 if (ignore_system_lyxrc ||
1788 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1789 os << "\\screen_font_typewriter_foundry \""
1790 << typewriter_font_foundry << "\"\n";
1795 case RC_SCREEN_FONT_SCALABLE:
1796 if (ignore_system_lyxrc ||
1797 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1798 os << "\\screen_font_scalable "
1799 << convert<string>(use_scalable_fonts)
1804 case RC_SCREEN_FONT_SIZES:
1805 if (ignore_system_lyxrc ||
1806 font_sizes[FONT_SIZE_TINY]
1807 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1808 font_sizes[FONT_SIZE_SCRIPT]
1809 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1810 font_sizes[FONT_SIZE_FOOTNOTE]
1811 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1812 font_sizes[FONT_SIZE_SMALL]
1813 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1814 font_sizes[FONT_SIZE_NORMAL]
1815 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1816 font_sizes[FONT_SIZE_LARGE]
1817 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1818 font_sizes[FONT_SIZE_LARGER]
1819 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1820 font_sizes[FONT_SIZE_LARGEST]
1821 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1822 font_sizes[FONT_SIZE_HUGE]
1823 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1824 font_sizes[FONT_SIZE_HUGER]
1825 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1826 os.setf(ios::fixed);
1828 os << "\\screen_font_sizes"
1829 << ' ' << font_sizes[FONT_SIZE_TINY]
1830 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1831 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1832 << ' ' << font_sizes[FONT_SIZE_SMALL]
1833 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1834 << ' ' << font_sizes[FONT_SIZE_LARGE]
1835 << ' ' << font_sizes[FONT_SIZE_LARGER]
1836 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1837 << ' ' << font_sizes[FONT_SIZE_HUGE]
1838 << ' ' << font_sizes[FONT_SIZE_HUGER]
1843 case RC_FULL_SCREEN_LIMIT:
1844 if (ignore_system_lyxrc ||
1845 full_screen_limit != system_lyxrc.full_screen_limit) {
1846 os << "\\fullscreen_limit "
1847 << convert<string>(full_screen_limit)
1852 case RC_FULL_SCREEN_TOOLBARS:
1853 if (ignore_system_lyxrc ||
1854 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1855 os << "\\fullscreen_toolbars "
1856 << convert<string>(full_screen_toolbars)
1861 case RC_FULL_SCREEN_SCROLLBAR:
1862 if (ignore_system_lyxrc ||
1863 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1864 os << "\\fullscreen_scrollbar "
1865 << convert<string>(full_screen_scrollbar)
1870 case RC_FULL_SCREEN_TABBAR:
1871 if (ignore_system_lyxrc ||
1872 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1873 os << "\\fullscreen_tabbar "
1874 << convert<string>(full_screen_tabbar)
1879 case RC_FULL_SCREEN_MENUBAR:
1880 if (ignore_system_lyxrc ||
1881 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1882 os << "\\fullscreen_menubar "
1883 << convert<string>(full_screen_menubar)
1888 case RC_FULL_SCREEN_WIDTH:
1889 if (ignore_system_lyxrc ||
1890 full_screen_width != system_lyxrc.full_screen_width) {
1891 os << "\\fullscreen_width "
1892 << convert<string>(full_screen_width)
1897 case RC_OPEN_BUFFERS_IN_TABS:
1898 if (ignore_system_lyxrc ||
1899 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1900 os << "\\open_buffers_in_tabs "
1901 << convert<string>(open_buffers_in_tabs)
1906 case RC_SINGLE_CLOSE_TAB_BUTTON:
1907 if (ignore_system_lyxrc ||
1908 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1909 os << "\\single_close_tab_button "
1910 << convert<string>(single_close_tab_button)
1915 case RC_FORWARD_SEARCH_DVI:
1916 if (ignore_system_lyxrc ||
1917 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1918 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1922 case RC_FORWARD_SEARCH_PDF:
1923 if (ignore_system_lyxrc ||
1924 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1925 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
1931 << "# COLOR SECTION ###################################\n"
1935 for (int i = 0; i < Color_ignore; ++i) {
1936 ColorCode lc = static_cast<ColorCode>(i);
1937 string const col = lcolor.getX11Name(lc);
1938 if (ignore_system_lyxrc
1939 || col != system_lcolor.getX11Name(lc)) {
1940 os << "\\set_color \""
1941 << lcolor.getLyXName(lc) << "\" \""
1949 << "# PRINTER SECTION ###################################\n"
1953 if (ignore_system_lyxrc ||
1954 printer != system_lyxrc.printer) {
1955 os << "\\printer \"" << printer << "\"\n";
1959 case RC_PRINT_ADAPTOUTPUT:
1960 if (ignore_system_lyxrc ||
1961 print_adapt_output != system_lyxrc.print_adapt_output) {
1962 os << "\\print_adapt_output "
1963 << convert<string>(print_adapt_output)
1968 case RC_PRINT_COMMAND:
1969 if (ignore_system_lyxrc ||
1970 print_command != system_lyxrc.print_command) {
1971 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1975 case RC_PRINTEXSTRAOPTIONS:
1976 if (ignore_system_lyxrc ||
1977 print_extra_options != system_lyxrc.print_extra_options) {
1978 os << "\\print_extra_options \"" << print_extra_options
1983 case RC_PRINTSPOOL_COMMAND:
1984 if (ignore_system_lyxrc ||
1985 print_spool_command != system_lyxrc.print_spool_command) {
1986 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1991 case RC_PRINTSPOOL_PRINTERPREFIX:
1992 if (ignore_system_lyxrc ||
1993 print_spool_printerprefix
1994 != system_lyxrc.print_spool_printerprefix) {
1995 os << "\\print_spool_printerprefix \""
1996 << print_spool_printerprefix << "\"\n";
2000 case RC_PRINTEVENPAGEFLAG:
2001 if (ignore_system_lyxrc ||
2002 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2003 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2008 case RC_PRINTODDPAGEFLAG:
2009 if (ignore_system_lyxrc ||
2010 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2011 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2016 case RC_PRINTREVERSEFLAG:
2017 if (ignore_system_lyxrc ||
2018 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2019 os << "\\print_reverse_flag \"" << print_reverse_flag
2024 case RC_PRINTLANDSCAPEFLAG:
2025 if (ignore_system_lyxrc ||
2026 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2027 os << "\\print_landscape_flag \"" << print_landscape_flag
2032 case RC_PRINTPAGERANGEFLAG:
2033 if (ignore_system_lyxrc ||
2034 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2035 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2040 case RC_PRINTCOPIESFLAG:
2041 if (ignore_system_lyxrc ||
2042 print_copies_flag != system_lyxrc.print_copies_flag) {
2043 os << "\\print_copies_flag \"" << print_copies_flag
2048 case RC_PRINTCOLLCOPIESFLAG:
2049 if (ignore_system_lyxrc ||
2050 print_collcopies_flag
2051 != system_lyxrc.print_collcopies_flag) {
2052 os << "\\print_collcopies_flag \""
2053 << print_collcopies_flag
2058 case RC_PRINTPAPERFLAG:
2059 if (ignore_system_lyxrc ||
2060 print_paper_flag != system_lyxrc.print_paper_flag) {
2061 os << "\\print_paper_flag \"" << print_paper_flag
2066 case RC_PRINTPAPERDIMENSIONFLAG:
2067 if (ignore_system_lyxrc ||
2068 print_paper_dimension_flag
2069 != system_lyxrc.print_paper_dimension_flag) {
2070 os << "\\print_paper_dimension_flag \""
2071 << print_paper_dimension_flag << "\"\n";
2075 case RC_PRINTTOPRINTER:
2076 if (ignore_system_lyxrc ||
2077 print_to_printer != system_lyxrc.print_to_printer) {
2078 os << "\\print_to_printer \"" << print_to_printer
2083 case RC_PRINTTOFILE:
2084 if (ignore_system_lyxrc ||
2085 print_to_file != system_lyxrc.print_to_file) {
2086 string const path = os::external_path(print_to_file);
2087 os << "\\print_to_file \"" << path << "\"\n";
2091 case RC_PRINTFILEEXTENSION:
2092 if (ignore_system_lyxrc ||
2093 print_file_extension != system_lyxrc.print_file_extension) {
2094 os << "\\print_file_extension \""
2095 << print_file_extension
2102 << "# TEX SECTION #######################################\n"
2105 case RC_FONT_ENCODING:
2106 if (ignore_system_lyxrc ||
2107 fontenc != system_lyxrc.fontenc) {
2108 os << "\\font_encoding \"" << fontenc << "\"\n";
2114 << "# FILE SECTION ######################################\n"
2117 case RC_DOCUMENTPATH:
2118 if (ignore_system_lyxrc ||
2119 document_path != system_lyxrc.document_path) {
2120 string const path = os::external_path(document_path);
2121 os << "\\document_path \"" << path << "\"\n";
2125 case RC_USELASTFILEPOS:
2126 if (ignore_system_lyxrc ||
2127 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2128 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2133 case RC_LOADSESSION:
2134 if (ignore_system_lyxrc ||
2135 load_session != system_lyxrc.load_session) {
2136 os << "\\load_session " << convert<string>(load_session)
2141 case RC_MOUSE_WHEEL_SPEED:
2142 if (ignore_system_lyxrc ||
2143 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2144 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2148 case RC_COMPLETION_INLINE_DELAY:
2149 if (ignore_system_lyxrc ||
2150 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2151 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2155 case RC_COMPLETION_INLINE_MATH:
2156 if (ignore_system_lyxrc ||
2157 completion_inline_math != system_lyxrc.completion_inline_math) {
2158 os << "\\completion_inline_math "
2159 << convert<string>(completion_inline_math) << '\n';
2163 case RC_COMPLETION_INLINE_TEXT:
2164 if (ignore_system_lyxrc ||
2165 completion_inline_text != system_lyxrc.completion_inline_text) {
2166 os << "\\completion_inline_text "
2167 << convert<string>(completion_inline_text) << '\n';
2171 case RC_COMPLETION_INLINE_DOTS:
2172 if (ignore_system_lyxrc ||
2173 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2174 os << "\\completion_inline_dots "
2175 << convert<string>(completion_inline_dots) << '\n';
2179 case RC_AUTOCORRECTION_MATH:
2180 if (ignore_system_lyxrc ||
2181 autocorrection_math != system_lyxrc.autocorrection_math) {
2182 os << "\\autocorrection_math "
2183 << convert<string>(autocorrection_math) << '\n';
2187 case RC_COMPLETION_POPUP_DELAY:
2188 if (ignore_system_lyxrc ||
2189 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2190 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2194 case RC_COMPLETION_POPUP_MATH:
2195 if (ignore_system_lyxrc ||
2196 completion_popup_math != system_lyxrc.completion_popup_math) {
2197 os << "\\completion_popup_math "
2198 << convert<string>(completion_popup_math) << '\n';
2202 case RC_COMPLETION_POPUP_TEXT:
2203 if (ignore_system_lyxrc ||
2204 completion_popup_text != system_lyxrc.completion_popup_text) {
2205 os << "\\completion_popup_text "
2206 << convert<string>(completion_popup_text) << '\n';
2210 case RC_COMPLETION_CURSOR_TEXT:
2211 if (ignore_system_lyxrc ||
2212 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2213 os << "\\completion_cursor_text "
2214 << convert<string>(completion_cursor_text) << '\n';
2218 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2219 if (ignore_system_lyxrc ||
2220 completion_popup_after_complete
2221 != system_lyxrc.completion_popup_after_complete) {
2222 os << "\\completion_popup_after_complete "
2223 << convert<string>(completion_popup_after_complete) << '\n';
2227 case RC_NUMLASTFILES:
2228 if (ignore_system_lyxrc ||
2229 num_lastfiles != system_lyxrc.num_lastfiles) {
2230 os << "\\num_lastfiles " << num_lastfiles << '\n';
2234 case RC_CHECKLASTFILES:
2235 if (ignore_system_lyxrc ||
2236 check_lastfiles != system_lyxrc.check_lastfiles) {
2237 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2242 case RC_EXAMPLEPATH:
2243 if (ignore_system_lyxrc ||
2244 example_path != system_lyxrc.example_path) {
2245 string const path = os::external_path(example_path);
2246 os << "\\example_path \"" << path << "\"\n";
2250 case RC_TEMPLATEPATH:
2251 if (ignore_system_lyxrc ||
2252 template_path != system_lyxrc.template_path) {
2253 string const path = os::external_path(template_path);
2254 os << "\\template_path \"" << path << "\"\n";
2258 case RC_TEMPDIRPATH:
2259 if (ignore_system_lyxrc ||
2260 tempdir_path != system_lyxrc.tempdir_path) {
2261 string const path = os::external_path(tempdir_path);
2262 os << "\\tempdir_path \"" << path << "\"\n";
2266 case RC_THESAURUSDIRPATH:
2267 if (ignore_system_lyxrc ||
2268 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2269 string const path = os::external_path(thesaurusdir_path);
2270 os << "\\thesaurusdir_path \"" << path << "\"\n";
2274 case RC_HUNSPELLDIR_PATH:
2275 if (ignore_system_lyxrc ||
2276 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2277 string const path = os::external_path(hunspelldir_path);
2278 os << "\\hunspelldir_path \"" << path << "\"\n";
2286 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2289 case RC_PLAINTEXT_LINELEN:
2290 if (ignore_system_lyxrc ||
2291 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2292 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2296 case RC_MAKE_BACKUP:
2297 if (ignore_system_lyxrc ||
2298 make_backup != system_lyxrc.make_backup) {
2299 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2303 case RC_SAVE_COMPRESSED:
2304 if (ignore_system_lyxrc ||
2305 save_compressed != system_lyxrc.save_compressed) {
2306 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2310 case RC_BACKUPDIR_PATH:
2311 if (ignore_system_lyxrc ||
2312 backupdir_path != system_lyxrc.backupdir_path) {
2313 string const path = os::external_path(backupdir_path);
2314 os << "\\backupdir_path \"" << path << "\"\n";
2320 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2324 << "# SPELLCHECKER SECTION ##############################\n"
2327 case RC_SPELL_COMMAND:
2328 case RC_USE_SPELL_LIB:
2332 case RC_ACCEPT_COMPOUND:
2333 if (ignore_system_lyxrc ||
2334 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2335 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2340 case RC_USE_ALT_LANG:
2345 if (ignore_system_lyxrc ||
2346 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2347 os << "\\alternate_language \"" << spellchecker_alt_lang
2352 case RC_USE_ESC_CHARS:
2356 if (ignore_system_lyxrc ||
2357 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2358 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2362 case RC_USE_PERS_DICT:
2366 case RC_USE_TOOLTIP:
2367 if (ignore_system_lyxrc ||
2368 use_tooltip != system_lyxrc.use_tooltip) {
2369 os << "\\use_tooltip "
2370 << convert<string>(use_tooltip)
2375 case RC_USE_PIXMAP_CACHE:
2376 if (ignore_system_lyxrc ||
2377 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2378 os << "\\use_pixmap_cache "
2379 << convert<string>(use_pixmap_cache)
2388 case RC_USE_INP_ENC:
2394 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2399 case RC_DEFAULT_DECIMAL_POINT:
2400 if (ignore_system_lyxrc ||
2401 default_decimal_point != system_lyxrc.default_decimal_point) {
2402 os << "\\default_decimal_point " << default_decimal_point << '\n';
2407 case RC_SPELLCHECKER:
2408 if (ignore_system_lyxrc ||
2409 spellchecker != system_lyxrc.spellchecker) {
2410 os << "\\spellchecker " << spellchecker << '\n';
2415 case RC_SPELLCHECK_CONTINUOUSLY:
2416 if (ignore_system_lyxrc ||
2417 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2418 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2424 case RC_SPELLCHECK_NOTES:
2425 if (ignore_system_lyxrc ||
2426 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2427 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2433 case RC_RTL_SUPPORT:
2434 if (ignore_system_lyxrc ||
2435 rtl_support != system_lyxrc.rtl_support) {
2436 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2440 case RC_VISUAL_CURSOR:
2441 if (ignore_system_lyxrc ||
2442 visual_cursor != system_lyxrc.visual_cursor) {
2443 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2447 case RC_LANGUAGE_PACKAGE:
2448 if (ignore_system_lyxrc ||
2449 language_package != system_lyxrc.language_package) {
2450 os << "\\language_package \"" << language_package
2455 case RC_LANGUAGE_GLOBAL_OPTIONS:
2456 if (ignore_system_lyxrc ||
2457 language_global_options
2458 != system_lyxrc.language_global_options) {
2459 os << "\\language_global_options \""
2460 << convert<string>(language_global_options)
2465 case RC_LANGUAGE_USE_BABEL:
2466 if (ignore_system_lyxrc ||
2467 language_use_babel != system_lyxrc.language_use_babel) {
2468 os << "\\language_use_babel \""
2469 << convert<string>(language_use_babel)
2474 case RC_LANGUAGE_COMMAND_BEGIN:
2475 if (ignore_system_lyxrc ||
2476 language_command_begin
2477 != system_lyxrc.language_command_begin) {
2478 os << "\\language_command_begin \""
2479 << language_command_begin
2484 case RC_LANGUAGE_COMMAND_END:
2485 if (ignore_system_lyxrc ||
2486 language_command_end
2487 != system_lyxrc.language_command_end) {
2488 os << "\\language_command_end \"" << language_command_end
2493 case RC_LANGUAGE_COMMAND_LOCAL:
2494 if (ignore_system_lyxrc ||
2495 language_command_local
2496 != system_lyxrc.language_command_local) {
2497 os << "\\language_command_local \""
2498 << language_command_local
2503 case RC_LANGUAGE_AUTO_BEGIN:
2504 if (ignore_system_lyxrc ||
2505 language_auto_begin != system_lyxrc.language_auto_begin) {
2506 os << "\\language_auto_begin "
2507 << convert<string>(language_auto_begin) << '\n';
2511 case RC_LANGUAGE_AUTO_END:
2512 if (ignore_system_lyxrc ||
2513 language_auto_end != system_lyxrc.language_auto_end) {
2514 os << "\\language_auto_end "
2515 << convert<string>(language_auto_end) << '\n';
2519 case RC_MARK_FOREIGN_LANGUAGE:
2520 if (ignore_system_lyxrc ||
2521 mark_foreign_language
2522 != system_lyxrc.mark_foreign_language) {
2523 os << "\\mark_foreign_language " <<
2524 convert<string>(mark_foreign_language) << '\n';
2530 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2533 case RC_AUTO_NUMBER:
2534 if (ignore_system_lyxrc ||
2535 auto_number != system_lyxrc.auto_number) {
2536 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2540 case RC_DEFAULT_LANGUAGE:
2541 if (ignore_system_lyxrc ||
2542 default_language != system_lyxrc.default_language) {
2543 os << "\\default_language " << default_language << '\n';
2547 case RC_GUI_LANGUAGE:
2548 if (ignore_system_lyxrc ||
2549 gui_language != system_lyxrc.gui_language) {
2550 os << "\\gui_language " << gui_language << '\n';
2554 case RC_EXPORT_OVERWRITE:
2555 if (ignore_system_lyxrc ||
2556 export_overwrite != system_lyxrc.export_overwrite) {
2558 switch (export_overwrite) {
2569 os << "\\export_overwrite " << status << '\n';
2575 << "# FORMATS SECTION ##########################\n"
2579 // New/modified formats
2580 for (Formats::const_iterator cit = formats.begin();
2581 cit != formats.end(); ++cit) {
2582 Format const * format =
2583 system_formats.getFormat(cit->name());
2585 format->extension() != cit->extension() ||
2586 format->prettyname() != cit->prettyname() ||
2587 format->shortcut() != cit->shortcut() ||
2588 format->viewer() != cit->viewer() ||
2589 format->editor() != cit->editor() ||
2590 format->documentFormat() != cit->documentFormat() ||
2591 format->vectorFormat() != cit->vectorFormat()) {
2592 os << "\\format \"" << cit->name() << "\" \""
2593 << cit->extension() << "\" \""
2594 << cit->prettyname() << "\" \""
2595 << cit->shortcut() << "\" \""
2596 << escapeCommand(cit->viewer()) << "\" \""
2597 << escapeCommand(cit->editor()) << "\" \"";
2598 vector<string> flags;
2599 if (cit->documentFormat())
2600 flags.push_back("document");
2601 if (cit->vectorFormat())
2602 flags.push_back("vector");
2603 os << getStringFromVector(flags);
2608 // Look for deleted formats
2609 for (Formats::const_iterator cit = system_formats.begin();
2610 cit != system_formats.end(); ++cit)
2611 if (!formats.getFormat(cit->name()))
2612 os << "\\format \"" << cit->name()
2613 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2616 case RC_VIEWER_ALTERNATIVES: {
2617 Alternatives::const_iterator it = viewer_alternatives.begin();
2618 Alternatives::const_iterator const en = viewer_alternatives.end();
2619 Alternatives::const_iterator const sysend =
2620 system_lyxrc.viewer_alternatives.end();
2621 for (; it != en; ++it) {
2622 string const & fmt = it->first;
2623 CommandSet const & cmd = it->second;
2624 CommandSet::const_iterator sit = cmd.begin();
2625 CommandSet::const_iterator const sen = cmd.end();
2626 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2627 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2628 system_lyxrc.viewer_alternatives.find(fmt);
2629 for (; sit != sen; ++sit) {
2630 string const & cmd = *sit;
2631 if (ignore_system_lyxrc
2632 || sysfmt == sysend // format not found
2633 || sysfmt->second.count(cmd) == 0 // this command not found
2635 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2641 case RC_EDITOR_ALTERNATIVES: {
2642 Alternatives::const_iterator it = editor_alternatives.begin();
2643 Alternatives::const_iterator const en = editor_alternatives.end();
2644 Alternatives::const_iterator const sysend =
2645 system_lyxrc.editor_alternatives.end();
2646 for (; it != en; ++it) {
2647 string const & fmt = it->first;
2648 CommandSet const & cmd = it->second;
2649 CommandSet::const_iterator sit = cmd.begin();
2650 CommandSet::const_iterator const sen = cmd.end();
2651 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2652 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2653 system_lyxrc.editor_alternatives.find(fmt);
2654 for (; sit != sen; ++sit) {
2655 string const & cmd = *sit;
2656 if (ignore_system_lyxrc
2657 || sysfmt == sysend // format not found
2658 || sysfmt->second.count(cmd) == 0 // this command not found
2660 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2666 case RC_DEFAULT_VIEW_FORMAT:
2667 if (ignore_system_lyxrc ||
2668 default_view_format != system_lyxrc.default_view_format) {
2669 os << "\\default_view_format " << default_view_format << '\n';
2679 << "# CONVERTERS SECTION ##########################\n"
2683 // Look for new converters
2684 for (Converters::const_iterator cit = theConverters().begin();
2685 cit != theConverters().end(); ++cit) {
2686 Converter const * converter =
2687 theSystemConverters().getConverter(cit->from,
2690 converter->command != cit->command ||
2691 converter->flags != cit->flags)
2692 os << "\\converter \"" << cit->from << "\" \""
2693 << cit->to << "\" \""
2694 << escapeCommand(cit->command) << "\" \""
2695 << cit->flags << "\"\n";
2698 // New/modifed converters
2699 for (Converters::const_iterator cit = theSystemConverters().begin();
2700 cit != theSystemConverters().end(); ++cit)
2701 if (!theConverters().getConverter(cit->from, cit->to))
2702 os << "\\converter \"" << cit->from
2703 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2710 << "# COPIERS SECTION ##########################\n"
2713 // Look for new movers
2714 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2715 Movers::const_iterator const sysend = theSystemMovers().end();
2716 Movers::const_iterator it = theMovers().begin();
2717 Movers::const_iterator end = theMovers().end();
2719 for (; it != end; ++it) {
2720 Movers::const_iterator const sysit =
2721 find_if(sysbegin, sysend, SameMover(*it));
2722 if (sysit == sysend) {
2723 string const & fmt = it->first;
2724 string const & command =
2725 it->second.command();
2727 os << "\\copier " << fmt
2728 << " \"" << escapeCommand(command) << "\"\n";
2734 // We don't actually delete SpecialisedMover(s) from the
2735 // map, just clear their 'command', so there's no need
2736 // to test for anything else.
2743 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2745 // Why the switch you might ask. It is a trick to ensure that all
2746 // the elements in the LyXRCTags enum is handled. As you can see
2747 // there are no breaks at all. So it is just a huge fall-through.
2748 // The nice thing is that we will get a warning from the compiler
2749 // if we forget an element.
2750 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2752 case LyXRC::RC_ACCEPT_COMPOUND:
2753 case LyXRC::RC_ALT_LANG:
2754 case LyXRC::RC_PLAINTEXT_LINELEN:
2755 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2756 case LyXRC::RC_AUTOCORRECTION_MATH:
2757 case LyXRC::RC_AUTOREGIONDELETE:
2758 case LyXRC::RC_AUTORESET_OPTIONS:
2759 case LyXRC::RC_AUTOSAVE:
2760 case LyXRC::RC_AUTO_NUMBER:
2761 case LyXRC::RC_BACKUPDIR_PATH:
2762 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2763 case LyXRC::RC_BIBTEX_COMMAND:
2764 case LyXRC::RC_BINDFILE:
2765 case LyXRC::RC_CHECKLASTFILES:
2766 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2767 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2768 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2769 case LyXRC::RC_COMPLETION_INLINE_MATH:
2770 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2771 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2772 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2773 case LyXRC::RC_COMPLETION_POPUP_MATH:
2774 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2775 case LyXRC::RC_USELASTFILEPOS:
2776 case LyXRC::RC_LOADSESSION:
2777 case LyXRC::RC_CHKTEX_COMMAND:
2778 case LyXRC::RC_CONVERTER:
2779 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2780 case LyXRC::RC_COPIER:
2781 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2782 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2783 case LyXRC::RC_DATE_INSERT_FORMAT:
2784 case LyXRC::RC_DEFAULT_LANGUAGE:
2785 case LyXRC::RC_GUI_LANGUAGE:
2786 case LyXRC::RC_DEFAULT_PAPERSIZE:
2787 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2788 case LyXRC::RC_DEFFILE:
2789 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2790 case LyXRC::RC_DISPLAY_GRAPHICS:
2791 case LyXRC::RC_DOCUMENTPATH:
2792 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2793 FileName path(lyxrc_new.document_path);
2794 if (path.exists() && path.isDirectory())
2795 package().document_dir() = FileName(lyxrc.document_path);
2797 case LyXRC::RC_EDITOR_ALTERNATIVES:
2798 case LyXRC::RC_ESC_CHARS:
2799 case LyXRC::RC_EXAMPLEPATH:
2800 case LyXRC::RC_FONT_ENCODING:
2801 case LyXRC::RC_FORMAT:
2802 case LyXRC::RC_GROUP_LAYOUTS:
2803 case LyXRC::RC_HUNSPELLDIR_PATH:
2804 case LyXRC::RC_INDEX_ALTERNATIVES:
2805 case LyXRC::RC_INDEX_COMMAND:
2806 case LyXRC::RC_JBIBTEX_COMMAND:
2807 case LyXRC::RC_JINDEX_COMMAND:
2808 case LyXRC::RC_NOMENCL_COMMAND:
2809 case LyXRC::RC_INPUT:
2810 case LyXRC::RC_KBMAP:
2811 case LyXRC::RC_KBMAP_PRIMARY:
2812 case LyXRC::RC_KBMAP_SECONDARY:
2813 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2814 case LyXRC::RC_LANGUAGE_AUTO_END:
2815 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2816 case LyXRC::RC_LANGUAGE_COMMAND_END:
2817 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2818 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2819 case LyXRC::RC_LANGUAGE_PACKAGE:
2820 case LyXRC::RC_LANGUAGE_USE_BABEL:
2821 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2822 case LyXRC::RC_MACRO_EDIT_STYLE:
2823 case LyXRC::RC_MAKE_BACKUP:
2824 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2825 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2826 case LyXRC::RC_NUMLASTFILES:
2827 case LyXRC::RC_PARAGRAPH_MARKERS:
2828 case LyXRC::RC_PATH_PREFIX:
2829 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2830 prependEnvPath("PATH", lyxrc.path_prefix);
2832 case LyXRC::RC_PERS_DICT:
2833 case LyXRC::RC_PREVIEW:
2834 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2835 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2836 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2837 case LyXRC::RC_PRINTCOPIESFLAG:
2838 case LyXRC::RC_PRINTER:
2839 case LyXRC::RC_PRINTEVENPAGEFLAG:
2840 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2841 case LyXRC::RC_PRINTFILEEXTENSION:
2842 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2843 case LyXRC::RC_PRINTODDPAGEFLAG:
2844 case LyXRC::RC_PRINTPAGERANGEFLAG:
2845 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2846 case LyXRC::RC_PRINTPAPERFLAG:
2847 case LyXRC::RC_PRINTREVERSEFLAG:
2848 case LyXRC::RC_PRINTSPOOL_COMMAND:
2849 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2850 case LyXRC::RC_PRINTTOFILE:
2851 case LyXRC::RC_PRINTTOPRINTER:
2852 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2853 case LyXRC::RC_PRINT_COMMAND:
2854 case LyXRC::RC_RTL_SUPPORT:
2855 case LyXRC::RC_SAVE_COMPRESSED:
2856 case LyXRC::RC_SCREEN_DPI:
2857 case LyXRC::RC_SCREEN_FONT_ROMAN:
2858 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2859 case LyXRC::RC_SCREEN_FONT_SANS:
2860 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2861 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2862 case LyXRC::RC_SCREEN_FONT_SIZES:
2863 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2864 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2865 case LyXRC::RC_GEOMETRY_SESSION:
2866 case LyXRC::RC_SCREEN_ZOOM:
2867 case LyXRC::RC_SERVERPIPE:
2868 case LyXRC::RC_SET_COLOR:
2869 case LyXRC::RC_SHOW_BANNER:
2870 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2871 case LyXRC::RC_SPELL_COMMAND:
2872 case LyXRC::RC_SPELLCHECKER:
2873 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2874 case LyXRC::RC_SPELLCHECK_NOTES:
2875 case LyXRC::RC_SPLITINDEX_COMMAND:
2876 case LyXRC::RC_TEMPDIRPATH:
2877 case LyXRC::RC_TEMPLATEPATH:
2878 case LyXRC::RC_TEX_ALLOWS_SPACES:
2879 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2880 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2881 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2883 case LyXRC::RC_THESAURUSDIRPATH:
2884 case LyXRC::RC_UIFILE:
2885 case LyXRC::RC_USER_EMAIL:
2886 case LyXRC::RC_USER_NAME:
2887 case LyXRC::RC_USETEMPDIR:
2888 case LyXRC::RC_USE_ALT_LANG:
2889 case LyXRC::RC_USE_CONVERTER_CACHE:
2890 case LyXRC::RC_USE_ESC_CHARS:
2891 case LyXRC::RC_USE_INP_ENC:
2892 case LyXRC::RC_USE_PERS_DICT:
2893 case LyXRC::RC_USE_TOOLTIP:
2894 case LyXRC::RC_USE_PIXMAP_CACHE:
2895 case LyXRC::RC_USE_SPELL_LIB:
2896 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2897 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2898 case LyXRC::RC_SORT_LAYOUTS:
2899 case LyXRC::RC_FULL_SCREEN_LIMIT:
2900 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2901 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2902 case LyXRC::RC_FULL_SCREEN_TABBAR:
2903 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2904 case LyXRC::RC_FULL_SCREEN_WIDTH:
2905 case LyXRC::RC_VISUAL_CURSOR:
2906 case LyXRC::RC_VIEWER:
2907 case LyXRC::RC_VIEWER_ALTERNATIVES:
2908 case LyXRC::RC_FORWARD_SEARCH_DVI:
2909 case LyXRC::RC_FORWARD_SEARCH_PDF:
2910 case LyXRC::RC_EXPORT_OVERWRITE:
2911 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2912 case LyXRC::RC_LAST:
2919 string const LyXRC::getDescription(LyXRCTags tag)
2924 case RC_ACCEPT_COMPOUND:
2925 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2929 case RC_USE_ALT_LANG:
2930 str = _("Specify an alternate language. The default is to use the language of the document.");
2933 case RC_PLAINTEXT_ROFF_COMMAND:
2934 str = _("Use to define an external program to render tables in plain text output. E.g. \"groff -t -Tlatin1 $$FName\" where $$FName is the input file. If \"\" is specified, an internal routine is used.");
2937 case RC_PLAINTEXT_LINELEN:
2938 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.");
2941 case RC_AUTOREGIONDELETE:
2942 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2945 case RC_AUTORESET_OPTIONS:
2946 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2950 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2953 case RC_AUTO_NUMBER:
2956 case RC_BACKUPDIR_PATH:
2957 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.");
2960 case RC_BIBTEX_COMMAND:
2961 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2964 case RC_JBIBTEX_COMMAND:
2965 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2969 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2972 case RC_CHECKLASTFILES:
2973 str = _("Select to check whether the lastfiles still exist.");
2976 case RC_CHKTEX_COMMAND:
2977 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2986 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2987 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.");
2990 case RC_SCROLL_BELOW_DOCUMENT:
2991 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");
2994 case RC_MAC_LIKE_WORD_MOVEMENT:
2995 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2998 case RC_SHOW_MACRO_LABEL:
2999 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3002 case RC_DATE_INSERT_FORMAT:
3003 //xgettext:no-c-format
3004 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3008 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3011 case RC_DEFAULT_VIEW_FORMAT:
3012 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3015 case RC_DEFAULT_LANGUAGE:
3016 str = _("New documents will be assigned this language.");
3019 case RC_DEFAULT_PAPERSIZE:
3020 str = _("Specify the default paper size.");
3023 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3024 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3027 case RC_DISPLAY_GRAPHICS:
3028 str = _("Select how LyX will display any graphics.");
3031 case RC_DOCUMENTPATH:
3032 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3036 case RC_USE_ESC_CHARS:
3037 str = _("Specify additional chars that can be part of a word.");
3040 case RC_EXAMPLEPATH:
3041 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3044 case RC_FONT_ENCODING:
3045 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3051 case RC_INDEX_COMMAND:
3052 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\".");
3055 case RC_JINDEX_COMMAND:
3056 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3059 case RC_NOMENCL_COMMAND:
3060 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3067 case RC_KBMAP_PRIMARY:
3068 case RC_KBMAP_SECONDARY:
3069 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.");
3072 case RC_LANGUAGE_AUTO_BEGIN:
3073 str = _("Select if a language switching command is needed at the beginning of the document.");
3076 case RC_LANGUAGE_AUTO_END:
3077 str = _("Select if a language switching command is needed at the end of the document.");
3080 case RC_LANGUAGE_COMMAND_BEGIN:
3081 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.");
3084 case RC_LANGUAGE_COMMAND_END:
3085 str = _("The LaTeX command for changing back to the language of the document.");
3088 case RC_LANGUAGE_COMMAND_LOCAL:
3089 str = _("The LaTeX command for local changing of the language.");
3092 case RC_LANGUAGE_GLOBAL_OPTIONS:
3093 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3096 case RC_LANGUAGE_PACKAGE:
3097 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3100 case RC_LANGUAGE_USE_BABEL:
3101 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3104 case RC_USELASTFILEPOS:
3105 str = _("De-select if you do not want LyX to scroll to saved position.");
3108 case RC_LOADSESSION:
3109 str = _("De-select to prevent loading files opened from the last LyX session.");
3112 case RC_MAKE_BACKUP:
3113 str = _("De-select if you don't want LyX to create backup files.");
3116 case RC_MARK_FOREIGN_LANGUAGE:
3117 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3120 case RC_MOUSE_WHEEL_SPEED:
3121 str = bformat(_("The scrolling speed of the mouse wheel."),
3125 case RC_COMPLETION_POPUP_DELAY:
3126 str = _("The completion popup delay.");
3129 case RC_COMPLETION_POPUP_MATH:
3130 str = _("Select to display the completion popup in math mode.");
3133 case RC_COMPLETION_POPUP_TEXT:
3134 str = _("Select to display the completion popup in text mode.");
3137 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3138 str = _("Show the completion popup without delay after non-unique completion attempt.");
3141 case RC_COMPLETION_POPUP_TEXT:
3142 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3145 case RC_COMPLETION_POPUP_DELAY:
3146 str = _("The inline completion delay.");
3149 case RC_COMPLETION_INLINE_MATH:
3150 str = _("Select to display the inline completion in math mode.");
3153 case RC_COMPLETION_INLINE_TEXT:
3154 str = _("Select to display the inline completion in text mode.");
3157 case RC_COMPLETION_INLINE_DOTS:
3158 str = _("Use \"...\" to shorten long completions.");
3161 case RC_AUTOCORRECTION_MATH:
3162 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3165 case RC_NUMLASTFILES:
3166 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3170 case RC_PATH_PREFIX:
3171 str = _("Specify those directories which should be "
3172 "prepended to the PATH environment variable. "
3173 "Use the OS native format.");
3177 str = _("Shows a typeset preview of things such as math");
3180 case RC_PREVIEW_HASHED_LABELS:
3181 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3184 case RC_PREVIEW_SCALE_FACTOR:
3185 str = _("Scale the preview size to suit.");
3188 case RC_PRINTCOLLCOPIESFLAG:
3189 str = _("The option for specifying whether the copies should be collated.");
3192 case RC_PRINTCOPIESFLAG:
3193 str = _("The option for specifying the number of copies to print.");
3197 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3200 case RC_PRINTEVENPAGEFLAG:
3201 str = _("The option to print only even pages.");
3204 case RC_PRINTEXSTRAOPTIONS:
3205 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3208 case RC_PRINTFILEEXTENSION:
3209 str = _("Extension of printer program output file. Usually \".ps\".");
3212 case RC_PRINTLANDSCAPEFLAG:
3213 str = _("The option to print out in landscape.");
3216 case RC_PRINTODDPAGEFLAG:
3217 str = _("The option to print only odd pages.");
3220 case RC_PRINTPAGERANGEFLAG:
3221 str = _("The option for specifying a comma-separated list of pages to print.");
3224 case RC_PRINTPAPERDIMENSIONFLAG:
3225 str = _("Option to specify the dimensions of the print paper.");
3228 case RC_PRINTPAPERFLAG:
3229 str = _("The option to specify paper type.");
3232 case RC_PRINTREVERSEFLAG:
3233 str = _("The option to reverse the order of the pages printed.");
3236 case RC_PRINTSPOOL_COMMAND:
3237 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.");
3240 case RC_PRINTSPOOL_PRINTERPREFIX:
3241 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.");
3244 case RC_PRINTTOFILE:
3245 str = _("Option to pass to the print program to print to a file.");
3248 case RC_PRINTTOPRINTER:
3249 str = _("Option to pass to the print program to print on a specific printer.");
3252 case RC_PRINT_ADAPTOUTPUT:
3253 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3256 case RC_PRINT_COMMAND:
3257 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3260 case RC_RTL_SUPPORT:
3261 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3264 case RC_VISUAL_CURSOR:
3265 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3269 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3272 case RC_SCREEN_FONT_ROMAN:
3273 case RC_SCREEN_FONT_SANS:
3274 case RC_SCREEN_FONT_TYPEWRITER:
3275 str = _("The screen fonts used to display the text while editing.");
3278 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3279 case RC_SCREEN_FONT_SANS_FOUNDRY:
3280 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3283 case RC_SCREEN_FONT_SCALABLE:
3284 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.");
3287 case RC_SCREEN_FONT_SIZES:
3288 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3291 case RC_SCREEN_ZOOM:
3292 //xgettext:no-c-format
3293 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3296 case RC_GEOMETRY_SESSION:
3297 str = _("Allow session manager to save and restore windows geometry.");
3301 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3307 case RC_SHOW_BANNER:
3308 str = _("De-select if you don't want the startup banner.");
3311 case RC_TEMPDIRPATH:
3312 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3315 case RC_THESAURUSDIRPATH:
3316 str = _("This is the place where the files of the thesaurus library reside.");
3319 case RC_TEMPLATEPATH:
3320 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3323 case RC_TEX_ALLOWS_SPACES:
3326 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3330 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3342 case RC_USE_TOOLTIP:
3343 str = _("Enable the automatic appearance of tool tips in the work area.");
3346 case RC_USE_PIXMAP_CACHE:
3347 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3350 case RC_USE_SPELL_LIB:
3353 case RC_VIEWDVI_PAPEROPTION:
3354 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3369 // The global instance
3372 // The global copy of the system lyxrc entries (everything except preferences)