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"
30 #include "graphics/GraphicsTypes.h"
32 #include "support/convert.h"
33 #include "support/debug.h"
34 #include "support/environment.h"
35 #include "support/FileName.h"
36 #include "support/filetools.h"
37 #include "support/gettext.h"
38 #include "support/lstrings.h"
39 #include "support/os.h"
40 #include "support/Package.h"
41 #include "support/userinfo.h"
47 using namespace lyx::support;
51 namespace os = support::os;
55 // when adding something to this array keep it sorted!
56 LexerKeyword lyxrcTags[] = {
57 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
58 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
59 { "\\alternate_language", LyXRC::RC_ALT_LANG },
60 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
61 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
62 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
63 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
64 { "\\autosave", LyXRC::RC_AUTOSAVE },
65 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
66 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
67 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
68 { "\\bind_file", LyXRC::RC_BINDFILE },
69 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
70 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
71 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
72 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
73 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
74 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
75 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
76 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
77 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
78 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
79 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
80 { "\\converter", LyXRC::RC_CONVERTER },
81 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
82 { "\\copier", LyXRC::RC_COPIER },
83 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
84 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
85 { "\\def_file", LyXRC::RC_DEFFILE },
86 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
87 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
88 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
89 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
90 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
91 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
92 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
93 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
94 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
95 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
96 { "\\format", LyXRC::RC_FORMAT },
97 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
98 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
99 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
100 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
101 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
102 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
103 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
104 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
105 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
106 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
107 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
108 { "\\input", LyXRC::RC_INPUT },
109 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
110 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
111 { "\\kbmap", LyXRC::RC_KBMAP },
112 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
113 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
114 { "\\label_init_length", LyXRC::RC_LABEL_INIT_LENGTH },
115 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
116 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
117 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
118 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
119 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
120 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
121 { "\\language_package", LyXRC::RC_LANGUAGE_PACKAGE },
122 { "\\language_use_babel", LyXRC::RC_LANGUAGE_USE_BABEL },
123 { "\\load_session", LyXRC::RC_LOADSESSION },
124 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
125 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
126 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
127 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
128 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
129 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
130 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
131 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
132 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
133 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
134 { "\\personal_dictionary", LyXRC::RC_PERS_DICT },
135 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
136 { "\\plaintext_roff_command", LyXRC::RC_PLAINTEXT_ROFF_COMMAND },
137 { "\\preview", LyXRC::RC_PREVIEW },
138 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
139 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
140 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
141 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
142 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
143 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
144 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
145 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
146 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
147 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
148 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
149 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
150 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
151 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
152 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
153 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
154 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
155 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
156 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
157 { "\\printer", LyXRC::RC_PRINTER },
158 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
159 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
160 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
161 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
162 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
163 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
164 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
165 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
166 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
167 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
168 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
169 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
170 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
171 { "\\set_color", LyXRC::RC_SET_COLOR },
172 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
173 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
174 { "\\spell_command", LyXRC::RC_SPELL_COMMAND },
175 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
176 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
177 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
178 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
179 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
180 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
181 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
182 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
183 { "\\ui_file", LyXRC::RC_UIFILE },
184 { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG },
185 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
186 { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
187 { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
188 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
189 { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
190 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
191 // compatibility with versions older than 1.4.0 only
192 { "\\use_pspell", LyXRC::RC_USE_SPELL_LIB },
193 // compatibility with versions older than 1.4.0 only
194 { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
195 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
196 { "\\user_email", LyXRC::RC_USER_EMAIL },
197 { "\\user_name", LyXRC::RC_USER_NAME },
198 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
199 // compatibility with versions older than 1.4.0 only
200 { "\\viewer", LyXRC::RC_VIEWER},
201 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
202 { "\\visual_cursor" ,LyXRC::RC_VISUAL_CURSOR}
205 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
216 void LyXRC::setDefaults()
219 def_file = "default";
221 // Get printer from the environment. If fail, use default "",
222 // assuming that everything is set up correctly.
223 printer = getEnv("PRINTER");
224 print_adapt_output = false;
225 print_command = "dvips";
226 print_evenpage_flag = "-B";
227 print_oddpage_flag = "-A";
228 print_pagerange_flag = "-pp";
229 print_copies_flag = "-c";
230 print_collcopies_flag = "-C";
231 print_reverse_flag = "-r";
232 print_landscape_flag = "-t landscape";
233 print_to_printer = "-P";
234 print_to_file = "-o ";
235 print_file_extension = ".ps";
236 print_paper_flag = "-t";
237 print_paper_dimension_flag = "-T";
238 document_path.erase();
239 view_dvi_paper_option.erase();
240 default_papersize = PAPER_DEFAULT;
241 default_view_format = "pdf2";
242 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
243 bibtex_command = "bibtex";
245 index_command = "makeindex -c -q";
246 nomencl_command = "makeindex -s nomencl.ist";
248 // Because a screen is typically wider than a piece of paper:
250 allow_geometry_session = true;
251 // Default LaTeX font size:
252 font_sizes[FONT_SIZE_TINY] = "5.0";
253 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
254 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
255 font_sizes[FONT_SIZE_SMALL] = "9.0";
256 font_sizes[FONT_SIZE_NORMAL] = "10.0";
257 font_sizes[FONT_SIZE_LARGE] = "12.0";
258 font_sizes[FONT_SIZE_LARGER] = "14.4";
259 font_sizes[FONT_SIZE_LARGEST] = "17.26";
260 font_sizes[FONT_SIZE_HUGE] = "20.74";
261 font_sizes[FONT_SIZE_HUGER] = "24.88";
262 use_scalable_fonts = true;
263 roman_font_name = "";
265 typewriter_font_name = "";
267 auto_region_delete = true;
268 auto_reset_options = false;
269 plaintext_linelen = 65;
270 mouse_wheel_speed = 1.0;
271 num_lastfiles = maxlastfiles;
272 check_lastfiles = true;
273 use_lastfilepos = true;
274 load_session = false;
276 backupdir_path.erase();
277 display_graphics = true;
278 // Spellchecker settings:
279 spellchecker = "aspell";
280 spellchecker_accept_compound = false;
281 spellcheck_continuously = false;
284 visual_cursor = false;
286 mark_foreign_language = true;
287 language_auto_begin = true;
288 language_auto_end = true;
289 language_global_options = true;
290 language_use_babel = true;
291 language_package = "\\usepackage{babel}";
292 language_command_begin = "\\selectlanguage{$$lang}";
293 language_command_local = "\\foreignlanguage{$$lang}{";
294 sort_layouts = false;
295 group_layouts = true;
296 default_language = "english";
297 gui_language = "auto";
299 windows_style_tex_paths = false;
300 tex_allows_spaces = false;
301 date_insert_format = "%x";
302 cursor_follows_scrollbar = false;
303 scroll_below_document = false;
304 paragraph_markers = false;
305 mac_like_word_movement = false;
306 macro_edit_style = MACRO_EDIT_INLINE_BOX;
307 dialogs_iconify_with_main = false;
308 label_init_length = 3;
309 preview = PREVIEW_OFF;
310 preview_hashed_labels = false;
311 preview_scale_factor = 1.0;
312 use_converter_cache = true;
314 use_pixmap_cache = false;
315 converter_cache_maxage = 6 * 30 * 24 * 3600; // 6 months
316 user_name = to_utf8(support::user_name());
317 user_email = to_utf8(support::user_email());
318 open_buffers_in_tabs = true;
320 // Fullscreen settings
321 full_screen_limit = false;
322 full_screen_toolbars = true;
323 full_screen_tabbar = true;
324 full_screen_menubar = true;
325 full_screen_scrollbar = true;
326 full_screen_width = 700;
328 completion_cursor_text = true;
329 completion_popup_math = true;
330 completion_popup_text = false;
331 completion_popup_delay = 2.0;
332 completion_popup_after_complete = true;
333 autocorrection_math = false;
334 completion_inline_math = true;
335 completion_inline_text = false;
336 completion_inline_dots = -1;
337 completion_inline_delay = 0.2;
343 void oldFontFormat(string & family, string & foundry)
345 if (family.empty() || family[0] != '-')
347 foundry = token(family, '-', 1);
348 family = token(family, '-', 2);
356 int LyXRC::read(FileName const & filename)
358 Lexer lexrc(lyxrcTags);
359 if (lyxerr.debugging(Debug::PARSER))
360 lexrc.printTable(lyxerr);
362 lexrc.setFile(filename);
366 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
372 int LyXRC::read(istream & is)
374 Lexer lexrc(lyxrcTags);
375 if (lyxerr.debugging(Debug::PARSER))
376 lexrc.printTable(lyxerr);
382 LYXERR(Debug::LYXRC, "Reading istream...");
388 int LyXRC::read(Lexer & lexrc)
393 while (lexrc.isOK()) {
394 // By using two switches we take advantage of the compiler
395 // telling us if we have missed a LyXRCTags element in
396 // the second switch.
397 // Note that this also shows a problem with Lexer since it
398 // helps us avoid taking advantage of the strictness of the
401 int le = lexrc.lex();
403 case Lexer::LEX_UNDEF:
404 lexrc.printError("Unknown tag `$$Token'");
406 case Lexer::LEX_FEOF:
411 switch (static_cast<LyXRCTags>(le)) {
412 case RC_INPUT: // Include file
415 libFileSearch(string(),
418 lexrc.printError("Error reading "
419 "included file: " + tmp.absFilename());
425 bind_file = os::internal_path(lexrc.getString());
430 def_file = os::internal_path(lexrc.getString());
435 ui_file = os::internal_path(lexrc.getString());
438 case RC_AUTORESET_OPTIONS:
439 lexrc >> auto_reset_options;
442 case RC_DISPLAY_GRAPHICS:
444 display_graphics = lexrc.getString() == "true";
447 case RC_TEX_EXPECTS_WINDOWS_PATHS:
448 lexrc >> windows_style_tex_paths;
451 case RC_TEX_ALLOWS_SPACES:
452 lexrc >> tex_allows_spaces;
459 case RC_KBMAP_PRIMARY:
461 string const kmap(os::internal_path(lexrc.getString()));
462 if (!libFileSearch("kbd", kmap, "kmap").empty()
464 primary_kbmap = kmap;
466 lexrc.printError("LyX: Keymap `$$Token' not found");
471 case RC_KBMAP_SECONDARY:
473 string const kmap(os::internal_path(lexrc.getString()));
474 if (!libFileSearch("kbd", kmap, "kmap").empty()
476 secondary_kbmap = kmap;
478 lexrc.printError("LyX: Keymap `$$Token' not found");
483 case RC_FONT_ENCODING:
491 case RC_PRINT_COMMAND:
492 if (lexrc.next(true)) {
493 print_command = lexrc.getString();
497 case RC_PRINTEVENPAGEFLAG:
498 lexrc >> print_evenpage_flag;
501 case RC_PRINTODDPAGEFLAG:
502 lexrc >> print_oddpage_flag;
505 case RC_PRINTPAGERANGEFLAG:
506 lexrc >> print_pagerange_flag;
509 case RC_PRINTCOPIESFLAG:
510 lexrc >> print_copies_flag;
513 case RC_PRINTCOLLCOPIESFLAG:
514 lexrc >> print_collcopies_flag;
517 case RC_PRINTREVERSEFLAG:
518 lexrc >> print_reverse_flag;
521 case RC_PRINTLANDSCAPEFLAG:
522 lexrc >> print_landscape_flag;
525 case RC_PRINTTOPRINTER:
526 lexrc >> print_to_printer;
529 case RC_PRINT_ADAPTOUTPUT:
530 lexrc >> print_adapt_output;
535 print_to_file = os::internal_path(lexrc.getString());
539 case RC_PRINTFILEEXTENSION:
540 lexrc >> print_file_extension;
543 case RC_PRINTEXSTRAOPTIONS:
544 lexrc >> print_extra_options;
547 case RC_PRINTSPOOL_COMMAND:
548 if (lexrc.next(true)) {
549 print_spool_command = lexrc.getString();
553 case RC_PRINTSPOOL_PRINTERPREFIX:
554 lexrc >> print_spool_printerprefix;
557 case RC_PRINTPAPERDIMENSIONFLAG:
558 lexrc >> print_paper_dimension_flag;
561 case RC_PRINTPAPERFLAG:
562 lexrc >> print_paper_flag;
565 case RC_DEFAULT_PAPERSIZE:
567 string const size = ascii_lowercase(lexrc.getString());
568 if (size == "usletter")
569 default_papersize = PAPER_USLETTER;
570 else if (size == "legal")
571 default_papersize = PAPER_USLEGAL;
572 else if (size == "executive")
573 default_papersize = PAPER_USEXECUTIVE;
574 else if (size == "a3")
575 default_papersize = PAPER_A3;
576 else if (size == "a4")
577 default_papersize = PAPER_A4;
578 else if (size == "a5")
579 default_papersize = PAPER_A5;
580 else if (size == "b5")
581 default_papersize = PAPER_B5;
582 else if (size == "default")
583 default_papersize = PAPER_DEFAULT;
587 case RC_VIEWDVI_PAPEROPTION:
589 view_dvi_paper_option = lexrc.getString();
591 view_dvi_paper_option.erase();
594 case RC_CHKTEX_COMMAND:
595 if (lexrc.next(true)) {
596 chktex_command = lexrc.getString();
600 case RC_BIBTEX_ALTERNATIVES:
601 if (lexrc.next(true)) {
602 bibtex_alternatives.insert(lexrc.getString());
606 case RC_BIBTEX_COMMAND:
607 if (lexrc.next(true)) {
608 bibtex_command = lexrc.getString();
612 case RC_JBIBTEX_COMMAND:
613 if (lexrc.next(true)) {
614 jbibtex_command = lexrc.getString();
618 case RC_INDEX_ALTERNATIVES:
619 if (lexrc.next(true)) {
620 index_alternatives.insert(lexrc.getString());
624 case RC_INDEX_COMMAND:
625 if (lexrc.next(true)) {
626 index_command = lexrc.getString();
630 case RC_JINDEX_COMMAND:
631 if (lexrc.next(true)) {
632 jindex_command = lexrc.getString();
636 case RC_SPLITINDEX_COMMAND:
637 if (lexrc.next(true)) {
638 splitindex_command = lexrc.getString();
642 case RC_NOMENCL_COMMAND:
643 if (lexrc.next(true)) {
644 nomencl_command = lexrc.getString();
656 case RC_GEOMETRY_SESSION:
657 lexrc >> allow_geometry_session;
660 case RC_SCREEN_FONT_SIZES:
661 lexrc >> font_sizes[FONT_SIZE_TINY];
662 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
663 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
664 lexrc >> font_sizes[FONT_SIZE_SMALL];
665 lexrc >> font_sizes[FONT_SIZE_NORMAL];
666 lexrc >> font_sizes[FONT_SIZE_LARGE];
667 lexrc >> font_sizes[FONT_SIZE_LARGER];
668 lexrc >> font_sizes[FONT_SIZE_LARGEST];
669 lexrc >> font_sizes[FONT_SIZE_HUGE];
670 lexrc >> font_sizes[FONT_SIZE_HUGER];
673 case RC_SCREEN_FONT_SCALABLE:
674 lexrc >> use_scalable_fonts;
681 case RC_DOCUMENTPATH:
683 document_path = os::internal_path(lexrc.getString());
684 document_path = expandPath(document_path);
690 example_path = os::internal_path(lexrc.getString());
691 example_path = expandPath(example_path);
695 case RC_TEMPLATEPATH:
697 template_path = os::internal_path(lexrc.getString());
698 template_path = expandPath(template_path);
704 tempdir_path = os::internal_path(lexrc.getString());
705 tempdir_path = expandPath(tempdir_path);
709 case RC_THESAURUSDIRPATH:
711 thesaurusdir_path = os::internal_path(lexrc.getString());
712 thesaurusdir_path = expandPath(thesaurusdir_path);
716 case RC_HUNSPELLDIR_PATH:
718 hunspelldir_path = os::internal_path(lexrc.getString());
719 hunspelldir_path = expandPath(hunspelldir_path);
723 case RC_USELASTFILEPOS:
724 lexrc >> use_lastfilepos;
728 lexrc >> load_session;
731 case RC_MOUSE_WHEEL_SPEED:
732 lexrc >> mouse_wheel_speed;
735 case RC_COMPLETION_INLINE_DELAY:
736 lexrc >> completion_inline_delay;
739 case RC_COMPLETION_INLINE_MATH:
740 lexrc >> completion_inline_math;
743 case RC_COMPLETION_INLINE_TEXT:
744 lexrc >> completion_inline_text;
747 case RC_COMPLETION_INLINE_DOTS:
748 lexrc >> completion_inline_dots;
751 case RC_AUTOCORRECTION_MATH:
752 lexrc >> autocorrection_math;
755 case RC_COMPLETION_POPUP_DELAY:
756 lexrc >> completion_popup_delay;
759 case RC_COMPLETION_POPUP_MATH:
760 lexrc >> completion_popup_math;
763 case RC_COMPLETION_POPUP_TEXT:
764 lexrc >> completion_popup_text;
767 case RC_COMPLETION_CURSOR_TEXT:
768 lexrc >> completion_cursor_text;
771 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
772 lexrc >> completion_popup_after_complete;
775 case RC_NUMLASTFILES:
776 lexrc >> num_lastfiles;
779 case RC_CHECKLASTFILES:
780 lexrc >> check_lastfiles;
783 case RC_SCREEN_FONT_ROMAN:
785 roman_font_name = lexrc.getString();
786 oldFontFormat(roman_font_name,
791 case RC_SCREEN_FONT_SANS:
793 sans_font_name = lexrc.getString();
794 oldFontFormat(sans_font_name, sans_font_foundry);
798 case RC_SCREEN_FONT_TYPEWRITER:
800 typewriter_font_name = lexrc.getString();
801 oldFontFormat(typewriter_font_name,
802 typewriter_font_foundry);
806 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
807 lexrc >> roman_font_foundry;
810 case RC_SCREEN_FONT_SANS_FOUNDRY:
811 lexrc >> sans_font_foundry;
814 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
815 lexrc >> typewriter_font_foundry;
820 lexrc.printError("Missing color tag.");
823 string lyx_name = lexrc.getString();
826 lexrc.printError("Missing color name for color: `$$Token'");
829 string x11_name = lexrc.getString();
831 ColorCode const col =
832 lcolor.getFromLyXName(lyx_name);
833 if (col == Color_none ||
834 col == Color_inherit ||
838 if (!lcolor.setColor(col, x11_name))
839 LYXERR0("Bad lyxrc set_color for " << lyx_name);
843 case RC_AUTOREGIONDELETE:
844 // Auto region delete defaults to true
845 lexrc >> auto_region_delete;
850 lyxpipes = os::internal_path(lexrc.getString());
851 lyxpipes = expandPath(lyxpipes);
855 case RC_CURSOR_FOLLOWS_SCROLLBAR:
856 lexrc >> cursor_follows_scrollbar;
859 case RC_SCROLL_BELOW_DOCUMENT:
860 lexrc >> scroll_below_document;
863 case RC_PARAGRAPH_MARKERS:
864 lexrc >> paragraph_markers;
867 case RC_MAC_LIKE_WORD_MOVEMENT:
868 lexrc >> mac_like_word_movement;
871 case RC_MACRO_EDIT_STYLE:
873 switch (lexrc.getInteger()) {
874 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
875 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
876 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
881 case RC_DIALOGS_ICONIFY_WITH_MAIN:
882 lexrc >> dialogs_iconify_with_main;
885 case RC_PLAINTEXT_LINELEN:
886 lexrc >> plaintext_linelen;
888 // Spellchecker settings:
889 case RC_ACCEPT_COMPOUND:
890 lexrc >> spellchecker_accept_compound;
893 lexrc >> use_tooltip;
895 case RC_USE_PIXMAP_CACHE:
896 lexrc >> use_pixmap_cache;
898 case RC_SPELLCHECKER:
899 lexrc >> spellchecker;
902 lexrc >> spellchecker_alt_lang;
905 lexrc >> spellchecker_esc_chars;
907 case RC_SPELLCHECK_CONTINUOUSLY:
908 lexrc >> spellcheck_continuously;
911 lexrc >> make_backup;
913 case RC_BACKUPDIR_PATH:
915 backupdir_path = os::internal_path(lexrc.getString());
916 backupdir_path = expandPath(backupdir_path);
919 case RC_DATE_INSERT_FORMAT:
920 lexrc >> date_insert_format;
922 case RC_LANGUAGE_PACKAGE:
923 lexrc >> language_package;
925 case RC_LANGUAGE_AUTO_BEGIN:
926 lexrc >> language_auto_begin;
928 case RC_LANGUAGE_AUTO_END:
929 lexrc >> language_auto_end;
931 case RC_LANGUAGE_GLOBAL_OPTIONS:
932 lexrc >> language_global_options;
934 case RC_LANGUAGE_USE_BABEL:
935 lexrc >> language_use_babel;
937 case RC_LANGUAGE_COMMAND_BEGIN:
938 lexrc >> language_command_begin;
940 case RC_LANGUAGE_COMMAND_END:
941 lexrc >> language_command_end;
943 case RC_LANGUAGE_COMMAND_LOCAL:
944 lexrc >> language_command_local;
947 lexrc >> rtl_support;
949 case RC_VISUAL_CURSOR:
950 lexrc >> visual_cursor;
953 lexrc >> auto_number;
955 case RC_MARK_FOREIGN_LANGUAGE:
956 lexrc >> mark_foreign_language;
962 fmt = lexrc.getString();
963 if (lexrc.next(true))
964 command = lexrc.getString();
965 setMover(fmt, command);
970 string from, to, command, flags;
972 from = lexrc.getString();
974 to = lexrc.getString();
975 if (lexrc.next(true))
976 command = lexrc.getString();
978 flags = lexrc.getString();
980 theConverters().erase(from, to);
982 theConverters().add(from, to, command, flags);
985 // compatibility with versions older than 1.4.0 only
987 string format, command;
988 lexrc >> format >> command;
989 formats.setViewer(format, command);
993 string format, extension, prettyname, shortcut;
994 lexrc >> format >> extension >> prettyname >> shortcut;
995 string viewer, editor;
996 if (lexrc.next(true))
997 viewer = lexrc.getString();
998 if (lexrc.next(true))
999 editor = lexrc.getString();
1001 // Hack to ensure compatibility with versions older
1003 int le = lexrc.lex();
1004 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1005 flags = lexrc.getString();
1006 if (le != Lexer::LEX_DATA) {
1007 // We have got a known token.
1008 // Therefore this is an old style
1009 // format definition without
1011 lexrc.pushToken(flags);
1015 int flgs = Format::none;
1016 while (!flags.empty()) {
1018 flags = split(flags, flag, ',');
1019 if (flag == "document")
1020 flgs |= Format::document;
1021 else if (flag == "vector")
1022 flgs |= Format::vector;
1024 LYXERR0("Ignoring unknown flag `"
1025 << flag << "' for format `"
1028 if (prettyname.empty()) {
1029 if (theConverters().formatIsUsed(format))
1030 LYXERR0("Can't delete format " << format);
1032 formats.erase(format);
1034 formats.add(format, extension, prettyname,
1035 shortcut, viewer, editor, flgs);
1039 case RC_VIEWER_ALTERNATIVES: {
1040 string format, command;
1042 format = lexrc.getString();
1043 if (lexrc.eatLine())
1044 command = lexrc.getString();
1045 viewer_alternatives.push_back(make_pair(format, command));
1048 case RC_EDITOR_ALTERNATIVES: {
1049 string format, command;
1050 lexrc >> format >> command;
1051 editor_alternatives.push_back(make_pair(format, command));
1055 case RC_DEFAULT_VIEW_FORMAT:
1056 lexrc >> default_view_format;
1059 case RC_DEFAULT_LANGUAGE:
1060 lexrc >> default_language;
1063 case RC_GUI_LANGUAGE:
1064 lexrc >> gui_language;
1067 case RC_LABEL_INIT_LENGTH:
1068 lexrc >> label_init_length;
1071 case RC_SHOW_BANNER:
1072 lexrc >> show_banner;
1077 string const tmp = lexrc.getString();
1078 if (tmp == "true" || tmp == "on")
1079 preview = PREVIEW_ON;
1080 else if (tmp == "no_math")
1081 preview = PREVIEW_NO_MATH;
1083 preview = PREVIEW_OFF;
1084 if (tmp != "false" && tmp != "off")
1085 LYXERR0("Unrecognized preview status \""
1091 case RC_PREVIEW_HASHED_LABELS:
1092 lexrc >> preview_hashed_labels;
1095 case RC_PREVIEW_SCALE_FACTOR:
1096 lexrc >> preview_scale_factor;
1103 lexrc >> user_email;
1106 case RC_PATH_PREFIX:
1107 lexrc >> path_prefix;
1110 case RC_USE_CONVERTER_CACHE:
1111 lexrc >> use_converter_cache;
1113 case RC_CONVERTER_CACHE_MAXAGE:
1114 lexrc >> converter_cache_maxage;
1117 case RC_SORT_LAYOUTS:
1118 lexrc >> sort_layouts;
1120 case RC_GROUP_LAYOUTS:
1121 lexrc >> group_layouts;
1123 case RC_FULL_SCREEN_LIMIT:
1124 lexrc >> full_screen_limit;
1126 case RC_FULL_SCREEN_TOOLBARS:
1127 lexrc >> full_screen_toolbars;
1129 case RC_FULL_SCREEN_SCROLLBAR:
1130 lexrc >> full_screen_scrollbar;
1132 case RC_FULL_SCREEN_TABBAR:
1133 lexrc >> full_screen_tabbar;
1135 case RC_FULL_SCREEN_MENUBAR:
1136 lexrc >> full_screen_menubar;
1138 case RC_FULL_SCREEN_WIDTH:
1139 lexrc >> full_screen_width;
1141 case RC_OPEN_BUFFERS_IN_TABS:
1142 lexrc >> open_buffers_in_tabs;
1145 // Obsoteted in 1.4.0
1148 case RC_SPELL_COMMAND:
1150 case RC_PLAINTEXT_ROFF_COMMAND:
1151 case RC_USE_ALT_LANG:
1152 case RC_USE_ESC_CHARS:
1153 case RC_USE_INP_ENC:
1154 case RC_USE_PERS_DICT:
1155 case RC_USE_SPELL_LIB:
1156 LYXERR(Debug::LYXRC, "Skipping obsolete tag `"
1157 << lexrc.getString() << "'.");
1162 break; // this is just a dummy
1166 /// Update converters data-structures
1167 theConverters().update(formats);
1168 theConverters().buildGraph();
1174 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1176 ofstream ofs(filename.toFilesystemEncoding().c_str());
1178 write(ofs, ignore_system_lyxrc);
1182 void LyXRC::print() const
1184 if (lyxerr.debugging())
1185 write(lyxerr, false);
1193 typedef pair<string, SpecialisedMover> Data;
1195 SameMover(Data const & comparison)
1196 : comparison_(comparison) {}
1198 bool operator()(Data const & data) const
1200 return data.first == comparison_.first &&
1201 data.second.command() == comparison_.second.command();
1211 // Escape \ and " so that LyXLex can read the string later
1212 string escapeCommand(string const & str) {
1213 return subst(subst(str , "\\", "\\\\"),
1220 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1222 LyXRCTags tag = RC_LAST;
1224 if (!name.empty()) {
1225 for (int i = 0; i != lyxrcCount; ++i)
1226 if ("\\" + name == lyxrcTags[i].tag)
1227 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1231 os << "# LyX " << lyx_version
1232 << " generated this file. If you want to make your own\n"
1233 << "# modifications you should do them from inside LyX and save.\n"
1236 // Why the switch you might ask. It is a trick to ensure that all
1237 // the elements in the LyXRCTags enum are handled. As you can see
1238 // there are no breaks at all. So it is just a huge fall-through.
1239 // The nice thing is that we will get a warning from the compiler
1240 // if we forget an element.
1244 // input/include files are not done here
1246 if (ignore_system_lyxrc ||
1247 bind_file != system_lyxrc.bind_file) {
1248 string const path = os::external_path(bind_file);
1249 os << "\\bind_file \"" << path << "\"\n";
1255 if (ignore_system_lyxrc ||
1256 def_file != system_lyxrc.def_file) {
1257 string const path = os::external_path(def_file);
1258 os << "\\def_file \"" << path << "\"\n";
1267 << "# MISC SECTION ######################################\n"
1269 // bind files are not done here.
1271 case RC_PATH_PREFIX:
1272 if (ignore_system_lyxrc ||
1273 path_prefix != system_lyxrc.path_prefix) {
1274 os << "\\path_prefix \"" << path_prefix << "\"\n";
1279 if (ignore_system_lyxrc ||
1280 ui_file != system_lyxrc.ui_file) {
1281 string const path = os::external_path(ui_file);
1282 os << "\\ui_file \"" << path << "\"\n";
1286 case RC_AUTOREGIONDELETE:
1287 if (ignore_system_lyxrc ||
1288 auto_region_delete != system_lyxrc.auto_region_delete) {
1289 os << "# Set to false to inhibit automatic replacement of\n"
1290 << "# the current selection.\n"
1291 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1296 case RC_AUTORESET_OPTIONS:
1297 if (ignore_system_lyxrc ||
1298 auto_reset_options != system_lyxrc.auto_reset_options) {
1299 os << "# Set to false to inhibit automatic reset of\n"
1300 << "# the class options to defaults on class change.\n"
1301 << "\\auto_reset_options "
1302 << convert<string>(auto_reset_options)
1308 if (ignore_system_lyxrc ||
1309 autosave != system_lyxrc.autosave) {
1310 os << "# The time interval between auto-saves in seconds.\n"
1311 << "\\autosave " << autosave << '\n';
1315 case RC_DISPLAY_GRAPHICS:
1316 if (ignore_system_lyxrc ||
1317 display_graphics != system_lyxrc.display_graphics) {
1318 os << "# Display graphics within LyX\n"
1320 << "\\display_graphics "
1321 << (display_graphics ? "true" : "false")
1326 case RC_SORT_LAYOUTS:
1327 if (ignore_system_lyxrc ||
1328 sort_layouts != system_lyxrc.sort_layouts) {
1329 os << "# Sort layouts alphabetically.\n"
1330 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1334 case RC_GROUP_LAYOUTS:
1335 if (ignore_system_lyxrc ||
1336 group_layouts != system_lyxrc.group_layouts) {
1337 os << "# Group layouts by their category.\n"
1338 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1342 case RC_VIEWDVI_PAPEROPTION:
1343 if (ignore_system_lyxrc ||
1344 view_dvi_paper_option
1345 != system_lyxrc.view_dvi_paper_option) {
1346 os << "# Options used to specify paper size to the\n"
1347 << "# view_dvi_command (e.g. -paper)\n"
1348 << "\\view_dvi_paper_option \""
1349 << view_dvi_paper_option << "\"\n";
1353 case RC_DEFAULT_PAPERSIZE:
1354 if (ignore_system_lyxrc ||
1355 default_papersize != system_lyxrc.default_papersize) {
1356 os << "# The default papersize to use.\n"
1357 << "\\default_papersize \"";
1358 switch (default_papersize) {
1360 os << "default"; break;
1361 case PAPER_USLETTER:
1362 os << "usletter"; break;
1364 os << "legal"; break;
1365 case PAPER_USEXECUTIVE:
1366 os << "executive"; break;
1377 case PAPER_B4: break;
1383 case RC_CHKTEX_COMMAND:
1384 if (ignore_system_lyxrc ||
1385 chktex_command != system_lyxrc.chktex_command) {
1386 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1390 case RC_BIBTEX_ALTERNATIVES: {
1391 set<string>::const_iterator it = bibtex_alternatives.begin();
1392 set<string>::const_iterator end = bibtex_alternatives.end();
1393 for ( ; it != end; ++it) {
1394 if (ignore_system_lyxrc
1395 || !system_lyxrc.bibtex_alternatives.count(*it))
1396 os << "\\bibtex_alternatives \""
1402 case RC_BIBTEX_COMMAND:
1403 if (ignore_system_lyxrc ||
1404 bibtex_command != system_lyxrc.bibtex_command) {
1405 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1409 case RC_JBIBTEX_COMMAND:
1410 if (ignore_system_lyxrc ||
1411 jbibtex_command != system_lyxrc.jbibtex_command) {
1412 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1416 case RC_INDEX_ALTERNATIVES: {
1417 set<string>::const_iterator it = index_alternatives.begin();
1418 set<string>::const_iterator end = index_alternatives.end();
1419 for ( ; it != end; ++it) {
1420 if (ignore_system_lyxrc
1421 || !system_lyxrc.index_alternatives.count(*it))
1422 os << "\\index_alternatives \""
1428 case RC_INDEX_COMMAND:
1429 if (ignore_system_lyxrc ||
1430 index_command != system_lyxrc.index_command) {
1431 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1435 case RC_JINDEX_COMMAND:
1436 if (ignore_system_lyxrc ||
1437 jindex_command != system_lyxrc.jindex_command) {
1438 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1442 case RC_SPLITINDEX_COMMAND:
1443 if (ignore_system_lyxrc ||
1444 splitindex_command != system_lyxrc.splitindex_command) {
1445 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1449 case RC_NOMENCL_COMMAND:
1450 if (ignore_system_lyxrc ||
1451 nomencl_command != system_lyxrc.nomencl_command) {
1452 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1456 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1457 if (ignore_system_lyxrc ||
1458 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1459 os << "\\tex_expects_windows_paths "
1460 << convert<string>(windows_style_tex_paths) << '\n';
1464 case RC_TEX_ALLOWS_SPACES:
1465 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1466 os << "\\tex_allows_spaces "
1467 << convert<string>(tex_allows_spaces) << '\n';
1472 if (ignore_system_lyxrc ||
1473 use_kbmap != system_lyxrc.use_kbmap) {
1474 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1478 case RC_KBMAP_PRIMARY:
1479 if (ignore_system_lyxrc ||
1480 primary_kbmap != system_lyxrc.primary_kbmap) {
1481 string const path = os::external_path(primary_kbmap);
1482 os << "\\kbmap_primary \"" << path << "\"\n";
1486 case RC_KBMAP_SECONDARY:
1487 if (ignore_system_lyxrc ||
1488 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1489 string const path = os::external_path(secondary_kbmap);
1490 os << "\\kbmap_secondary \"" << path << "\"\n";
1495 if (ignore_system_lyxrc ||
1496 lyxpipes != system_lyxrc.lyxpipes) {
1497 string const path = os::external_path(lyxpipes);
1498 os << "\\serverpipe \"" << path << "\"\n";
1502 case RC_DATE_INSERT_FORMAT:
1503 if (ignore_system_lyxrc ||
1504 date_insert_format != system_lyxrc.date_insert_format) {
1505 os << "\\date_insert_format \"" << date_insert_format
1510 case RC_LABEL_INIT_LENGTH:
1511 if (ignore_system_lyxrc ||
1512 label_init_length != system_lyxrc.label_init_length) {
1513 os << "\\label_init_length " << label_init_length
1520 os << "\\user_name \"" << user_name << "\"\n";
1525 os << "\\user_email \"" << user_email << "\"\n";
1529 case RC_SHOW_BANNER:
1530 if (ignore_system_lyxrc ||
1531 show_banner != system_lyxrc.show_banner) {
1532 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1538 if (ignore_system_lyxrc ||
1539 preview != system_lyxrc.preview) {
1545 case PREVIEW_NO_MATH:
1552 os << "\\preview " << status << '\n';
1557 case RC_PREVIEW_HASHED_LABELS:
1558 if (ignore_system_lyxrc ||
1559 preview_hashed_labels !=
1560 system_lyxrc.preview_hashed_labels) {
1561 os << "\\preview_hashed_labels "
1562 << convert<string>(preview_hashed_labels) << '\n';
1567 case RC_PREVIEW_SCALE_FACTOR:
1568 if (ignore_system_lyxrc ||
1569 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1570 os << "\\preview_scale_factor "
1571 << preview_scale_factor << '\n';
1576 case RC_USE_CONVERTER_CACHE:
1577 if (ignore_system_lyxrc ||
1578 use_converter_cache != system_lyxrc.use_converter_cache) {
1579 os << "\\use_converter_cache "
1580 << convert<string>(use_converter_cache) << '\n';
1585 case RC_CONVERTER_CACHE_MAXAGE:
1586 if (ignore_system_lyxrc ||
1587 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1588 os << "\\converter_cache_maxage "
1589 << converter_cache_maxage << '\n';
1595 << "# SCREEN & FONTS SECTION ############################\n"
1599 if (ignore_system_lyxrc ||
1600 dpi != system_lyxrc.dpi) {
1601 os << "\\screen_dpi " << dpi << '\n';
1605 case RC_SCREEN_ZOOM:
1606 if (ignore_system_lyxrc ||
1607 zoom != system_lyxrc.zoom) {
1608 os << "\\screen_zoom " << zoom << '\n';
1612 case RC_GEOMETRY_SESSION:
1613 if (ignore_system_lyxrc ||
1614 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1615 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1620 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1621 if (ignore_system_lyxrc ||
1622 cursor_follows_scrollbar
1623 != system_lyxrc.cursor_follows_scrollbar) {
1624 os << "\\cursor_follows_scrollbar "
1625 << convert<string>(cursor_follows_scrollbar) << '\n';
1629 case RC_SCROLL_BELOW_DOCUMENT:
1630 if (ignore_system_lyxrc ||
1631 scroll_below_document
1632 != system_lyxrc.scroll_below_document) {
1633 os << "\\scroll_below_document "
1634 << convert<string>(scroll_below_document) << '\n';
1638 case RC_PARAGRAPH_MARKERS:
1639 if (ignore_system_lyxrc ||
1641 != system_lyxrc.paragraph_markers) {
1642 os << "\\paragraph_markers "
1643 << convert<string>(paragraph_markers) << '\n';
1647 case RC_MAC_LIKE_WORD_MOVEMENT:
1648 if (ignore_system_lyxrc ||
1649 mac_like_word_movement
1650 != system_lyxrc.mac_like_word_movement) {
1651 os << "\\mac_like_word_movement "
1652 << convert<string>(mac_like_word_movement) << '\n';
1656 case RC_MACRO_EDIT_STYLE:
1657 if (ignore_system_lyxrc ||
1659 != system_lyxrc.macro_edit_style) {
1660 os << "\\macro_edit_style ";
1661 switch (macro_edit_style) {
1662 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1663 case MACRO_EDIT_INLINE: os << "1\n"; break;
1664 case MACRO_EDIT_LIST: os << "2\n"; break;
1669 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1670 if (ignore_system_lyxrc ||
1671 dialogs_iconify_with_main
1672 != system_lyxrc.dialogs_iconify_with_main) {
1673 os << "\\dialogs_iconify_with_main "
1674 << convert<string>(dialogs_iconify_with_main) << '\n';
1678 case RC_SCREEN_FONT_ROMAN:
1679 if (ignore_system_lyxrc ||
1680 roman_font_name != system_lyxrc.roman_font_name) {
1681 os << "\\screen_font_roman \"" << roman_font_name
1686 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1687 if (ignore_system_lyxrc ||
1688 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1689 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1694 case RC_SCREEN_FONT_SANS:
1695 if (ignore_system_lyxrc ||
1696 sans_font_name != system_lyxrc.sans_font_name) {
1697 os << "\\screen_font_sans \"" << sans_font_name
1702 case RC_SCREEN_FONT_SANS_FOUNDRY:
1703 if (ignore_system_lyxrc ||
1704 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1705 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1710 case RC_SCREEN_FONT_TYPEWRITER:
1711 if (ignore_system_lyxrc ||
1712 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1713 os << "\\screen_font_typewriter \""
1714 << typewriter_font_name << "\"\n";
1718 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1719 if (ignore_system_lyxrc ||
1720 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1721 os << "\\screen_font_typewriter_foundry \""
1722 << typewriter_font_foundry << "\"\n";
1727 case RC_SCREEN_FONT_SCALABLE:
1728 if (ignore_system_lyxrc ||
1729 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1730 os << "\\screen_font_scalable "
1731 << convert<string>(use_scalable_fonts)
1736 case RC_SCREEN_FONT_SIZES:
1737 if (ignore_system_lyxrc ||
1738 font_sizes[FONT_SIZE_TINY]
1739 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1740 font_sizes[FONT_SIZE_SCRIPT]
1741 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1742 font_sizes[FONT_SIZE_FOOTNOTE]
1743 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1744 font_sizes[FONT_SIZE_SMALL]
1745 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1746 font_sizes[FONT_SIZE_NORMAL]
1747 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1748 font_sizes[FONT_SIZE_LARGE]
1749 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1750 font_sizes[FONT_SIZE_LARGER]
1751 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1752 font_sizes[FONT_SIZE_LARGEST]
1753 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1754 font_sizes[FONT_SIZE_HUGE]
1755 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1756 font_sizes[FONT_SIZE_HUGER]
1757 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1758 os.setf(ios::fixed);
1760 os << "\\screen_font_sizes"
1761 << ' ' << font_sizes[FONT_SIZE_TINY]
1762 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1763 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1764 << ' ' << font_sizes[FONT_SIZE_SMALL]
1765 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1766 << ' ' << font_sizes[FONT_SIZE_LARGE]
1767 << ' ' << font_sizes[FONT_SIZE_LARGER]
1768 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1769 << ' ' << font_sizes[FONT_SIZE_HUGE]
1770 << ' ' << font_sizes[FONT_SIZE_HUGER]
1775 case RC_FULL_SCREEN_LIMIT:
1776 if (ignore_system_lyxrc ||
1777 full_screen_limit != system_lyxrc.full_screen_limit) {
1778 os << "\\fullscreen_limit "
1779 << convert<string>(full_screen_limit)
1784 case RC_FULL_SCREEN_TOOLBARS:
1785 if (ignore_system_lyxrc ||
1786 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1787 os << "\\fullscreen_toolbars "
1788 << convert<string>(full_screen_toolbars)
1793 case RC_FULL_SCREEN_SCROLLBAR:
1794 if (ignore_system_lyxrc ||
1795 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1796 os << "\\fullscreen_scrollbar "
1797 << convert<string>(full_screen_scrollbar)
1802 case RC_FULL_SCREEN_TABBAR:
1803 if (ignore_system_lyxrc ||
1804 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1805 os << "\\fullscreen_tabbar "
1806 << convert<string>(full_screen_tabbar)
1811 case RC_FULL_SCREEN_MENUBAR:
1812 if (ignore_system_lyxrc ||
1813 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1814 os << "\\fullscreen_menubar "
1815 << convert<string>(full_screen_menubar)
1820 case RC_FULL_SCREEN_WIDTH:
1821 if (ignore_system_lyxrc ||
1822 full_screen_width != system_lyxrc.full_screen_width) {
1823 os << "\\fullscreen_width "
1824 << convert<string>(full_screen_width)
1829 case RC_OPEN_BUFFERS_IN_TABS:
1830 if (ignore_system_lyxrc ||
1831 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1832 os << "\\open_buffers_in_tabs "
1833 << convert<string>(open_buffers_in_tabs)
1840 << "# COLOR SECTION ###################################\n"
1844 for (int i = 0; i < Color_ignore; ++i) {
1845 ColorCode lc = static_cast<ColorCode>(i);
1846 string const col = lcolor.getX11Name(lc);
1847 if (ignore_system_lyxrc
1848 || col != system_lcolor.getX11Name(lc)) {
1849 os << "\\set_color \""
1850 << lcolor.getLyXName(lc) << "\" \""
1858 << "# PRINTER SECTION ###################################\n"
1862 if (ignore_system_lyxrc ||
1863 printer != system_lyxrc.printer) {
1864 os << "\\printer \"" << printer << "\"\n";
1868 case RC_PRINT_ADAPTOUTPUT:
1869 if (ignore_system_lyxrc ||
1870 print_adapt_output != system_lyxrc.print_adapt_output) {
1871 os << "\\print_adapt_output "
1872 << convert<string>(print_adapt_output)
1877 case RC_PRINT_COMMAND:
1878 if (ignore_system_lyxrc ||
1879 print_command != system_lyxrc.print_command) {
1880 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
1884 case RC_PRINTEXSTRAOPTIONS:
1885 if (ignore_system_lyxrc ||
1886 print_extra_options != system_lyxrc.print_extra_options) {
1887 os << "\\print_extra_options \"" << print_extra_options
1892 case RC_PRINTSPOOL_COMMAND:
1893 if (ignore_system_lyxrc ||
1894 print_spool_command != system_lyxrc.print_spool_command) {
1895 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
1900 case RC_PRINTSPOOL_PRINTERPREFIX:
1901 if (ignore_system_lyxrc ||
1902 print_spool_printerprefix
1903 != system_lyxrc.print_spool_printerprefix) {
1904 os << "\\print_spool_printerprefix \""
1905 << print_spool_printerprefix << "\"\n";
1909 case RC_PRINTEVENPAGEFLAG:
1910 if (ignore_system_lyxrc ||
1911 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
1912 os << "\\print_evenpage_flag \"" << print_evenpage_flag
1917 case RC_PRINTODDPAGEFLAG:
1918 if (ignore_system_lyxrc ||
1919 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
1920 os << "\\print_oddpage_flag \"" << print_oddpage_flag
1925 case RC_PRINTREVERSEFLAG:
1926 if (ignore_system_lyxrc ||
1927 print_reverse_flag != system_lyxrc.print_reverse_flag) {
1928 os << "\\print_reverse_flag \"" << print_reverse_flag
1933 case RC_PRINTLANDSCAPEFLAG:
1934 if (ignore_system_lyxrc ||
1935 print_landscape_flag != system_lyxrc.print_landscape_flag) {
1936 os << "\\print_landscape_flag \"" << print_landscape_flag
1941 case RC_PRINTPAGERANGEFLAG:
1942 if (ignore_system_lyxrc ||
1943 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
1944 os << "\\print_pagerange_flag \"" << print_pagerange_flag
1949 case RC_PRINTCOPIESFLAG:
1950 if (ignore_system_lyxrc ||
1951 print_copies_flag != system_lyxrc.print_copies_flag) {
1952 os << "\\print_copies_flag \"" << print_copies_flag
1957 case RC_PRINTCOLLCOPIESFLAG:
1958 if (ignore_system_lyxrc ||
1959 print_collcopies_flag
1960 != system_lyxrc.print_collcopies_flag) {
1961 os << "\\print_collcopies_flag \""
1962 << print_collcopies_flag
1967 case RC_PRINTPAPERFLAG:
1968 if (ignore_system_lyxrc ||
1969 print_paper_flag != system_lyxrc.print_paper_flag) {
1970 os << "\\print_paper_flag \"" << print_paper_flag
1975 case RC_PRINTPAPERDIMENSIONFLAG:
1976 if (ignore_system_lyxrc ||
1977 print_paper_dimension_flag
1978 != system_lyxrc.print_paper_dimension_flag) {
1979 os << "\\print_paper_dimension_flag \""
1980 << print_paper_dimension_flag << "\"\n";
1984 case RC_PRINTTOPRINTER:
1985 if (ignore_system_lyxrc ||
1986 print_to_printer != system_lyxrc.print_to_printer) {
1987 os << "\\print_to_printer \"" << print_to_printer
1992 case RC_PRINTTOFILE:
1993 if (ignore_system_lyxrc ||
1994 print_to_file != system_lyxrc.print_to_file) {
1995 string const path = os::external_path(print_to_file);
1996 os << "\\print_to_file \"" << path << "\"\n";
2000 case RC_PRINTFILEEXTENSION:
2001 if (ignore_system_lyxrc ||
2002 print_file_extension != system_lyxrc.print_file_extension) {
2003 os << "\\print_file_extension \""
2004 << print_file_extension
2011 << "# TEX SECTION #######################################\n"
2014 case RC_FONT_ENCODING:
2015 if (ignore_system_lyxrc ||
2016 fontenc != system_lyxrc.fontenc) {
2017 os << "\\font_encoding \"" << fontenc << "\"\n";
2023 << "# FILE SECTION ######################################\n"
2026 case RC_DOCUMENTPATH:
2027 if (ignore_system_lyxrc ||
2028 document_path != system_lyxrc.document_path) {
2029 string const path = os::external_path(document_path);
2030 os << "\\document_path \"" << path << "\"\n";
2034 case RC_USELASTFILEPOS:
2035 if (ignore_system_lyxrc ||
2036 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2037 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2042 case RC_LOADSESSION:
2043 if (ignore_system_lyxrc ||
2044 load_session != system_lyxrc.load_session) {
2045 os << "\\load_session " << convert<string>(load_session)
2050 case RC_MOUSE_WHEEL_SPEED:
2051 if (ignore_system_lyxrc ||
2052 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2053 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2057 case RC_COMPLETION_INLINE_DELAY:
2058 if (ignore_system_lyxrc ||
2059 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2060 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2064 case RC_COMPLETION_INLINE_MATH:
2065 if (ignore_system_lyxrc ||
2066 completion_inline_math != system_lyxrc.completion_inline_math) {
2067 os << "\\completion_inline_math "
2068 << convert<string>(completion_inline_math) << '\n';
2072 case RC_COMPLETION_INLINE_TEXT:
2073 if (ignore_system_lyxrc ||
2074 completion_inline_text != system_lyxrc.completion_inline_text) {
2075 os << "\\completion_inline_text "
2076 << convert<string>(completion_inline_text) << '\n';
2080 case RC_COMPLETION_INLINE_DOTS:
2081 if (ignore_system_lyxrc ||
2082 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2083 os << "\\completion_inline_dots "
2084 << convert<string>(completion_inline_dots) << '\n';
2088 case RC_AUTOCORRECTION_MATH:
2089 if (ignore_system_lyxrc ||
2090 autocorrection_math != system_lyxrc.autocorrection_math) {
2091 os << "\\autocorrection_math "
2092 << convert<string>(autocorrection_math) << '\n';
2096 case RC_COMPLETION_POPUP_DELAY:
2097 if (ignore_system_lyxrc ||
2098 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2099 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2103 case RC_COMPLETION_POPUP_MATH:
2104 if (ignore_system_lyxrc ||
2105 completion_popup_math != system_lyxrc.completion_popup_math) {
2106 os << "\\completion_popup_math "
2107 << convert<string>(completion_popup_math) << '\n';
2111 case RC_COMPLETION_POPUP_TEXT:
2112 if (ignore_system_lyxrc ||
2113 completion_popup_text != system_lyxrc.completion_popup_text) {
2114 os << "\\completion_popup_text "
2115 << convert<string>(completion_popup_text) << '\n';
2119 case RC_COMPLETION_CURSOR_TEXT:
2120 if (ignore_system_lyxrc ||
2121 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2122 os << "\\completion_cursor_text "
2123 << convert<string>(completion_cursor_text) << '\n';
2127 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2128 if (ignore_system_lyxrc ||
2129 completion_popup_after_complete
2130 != system_lyxrc.completion_popup_after_complete) {
2131 os << "\\completion_popup_after_complete "
2132 << convert<string>(completion_popup_after_complete) << '\n';
2136 case RC_NUMLASTFILES:
2137 if (ignore_system_lyxrc ||
2138 num_lastfiles != system_lyxrc.num_lastfiles) {
2139 os << "\\num_lastfiles " << num_lastfiles << '\n';
2143 case RC_CHECKLASTFILES:
2144 if (ignore_system_lyxrc ||
2145 check_lastfiles != system_lyxrc.check_lastfiles) {
2146 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2151 case RC_EXAMPLEPATH:
2152 if (ignore_system_lyxrc ||
2153 example_path != system_lyxrc.example_path) {
2154 string const path = os::external_path(example_path);
2155 os << "\\example_path \"" << path << "\"\n";
2159 case RC_TEMPLATEPATH:
2160 if (ignore_system_lyxrc ||
2161 template_path != system_lyxrc.template_path) {
2162 string const path = os::external_path(template_path);
2163 os << "\\template_path \"" << path << "\"\n";
2167 case RC_TEMPDIRPATH:
2168 if (ignore_system_lyxrc ||
2169 tempdir_path != system_lyxrc.tempdir_path) {
2170 string const path = os::external_path(tempdir_path);
2171 os << "\\tempdir_path \"" << path << "\"\n";
2175 case RC_THESAURUSDIRPATH:
2176 if (ignore_system_lyxrc ||
2177 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2178 string const path = os::external_path(thesaurusdir_path);
2179 os << "\\thesaurusdir_path \"" << path << "\"\n";
2183 case RC_HUNSPELLDIR_PATH:
2184 if (ignore_system_lyxrc ||
2185 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2186 string const path = os::external_path(hunspelldir_path);
2187 os << "\\hunspelldir_path \"" << path << "\"\n";
2195 case RC_PLAINTEXT_ROFF_COMMAND: // Obsoleted in 2.0
2198 case RC_PLAINTEXT_LINELEN:
2199 if (ignore_system_lyxrc ||
2200 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2201 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2205 case RC_MAKE_BACKUP:
2206 if (ignore_system_lyxrc ||
2207 make_backup != system_lyxrc.make_backup) {
2208 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2212 case RC_BACKUPDIR_PATH:
2213 if (ignore_system_lyxrc ||
2214 backupdir_path != system_lyxrc.backupdir_path) {
2215 string const path = os::external_path(backupdir_path);
2216 os << "\\backupdir_path \"" << path << "\"\n";
2222 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2226 << "# SPELLCHECKER SECTION ##############################\n"
2229 case RC_SPELL_COMMAND:
2230 case RC_USE_SPELL_LIB:
2234 case RC_ACCEPT_COMPOUND:
2235 if (ignore_system_lyxrc ||
2236 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2237 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2242 case RC_USE_ALT_LANG:
2247 if (ignore_system_lyxrc ||
2248 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2249 os << "\\alternate_language \"" << spellchecker_alt_lang
2254 case RC_USE_ESC_CHARS:
2258 if (ignore_system_lyxrc ||
2259 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2260 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2264 case RC_USE_PERS_DICT:
2268 case RC_USE_TOOLTIP:
2269 if (ignore_system_lyxrc ||
2270 use_tooltip != system_lyxrc.use_tooltip) {
2271 os << "\\use_tooltip "
2272 << convert<string>(use_tooltip)
2277 case RC_USE_PIXMAP_CACHE:
2278 if (ignore_system_lyxrc ||
2279 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2280 os << "\\use_pixmap_cache "
2281 << convert<string>(use_pixmap_cache)
2290 case RC_USE_INP_ENC:
2296 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2301 case RC_SPELLCHECKER:
2302 if (ignore_system_lyxrc ||
2303 spellchecker != system_lyxrc.spellchecker) {
2304 os << "\\spellchecker " << spellchecker << '\n';
2309 case RC_SPELLCHECK_CONTINUOUSLY:
2310 if (ignore_system_lyxrc ||
2311 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2312 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2318 case RC_RTL_SUPPORT:
2319 if (ignore_system_lyxrc ||
2320 rtl_support != system_lyxrc.rtl_support) {
2321 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2325 case RC_VISUAL_CURSOR:
2326 if (ignore_system_lyxrc ||
2327 visual_cursor != system_lyxrc.visual_cursor) {
2328 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2332 case RC_LANGUAGE_PACKAGE:
2333 if (ignore_system_lyxrc ||
2334 language_package != system_lyxrc.language_package) {
2335 os << "\\language_package \"" << language_package
2340 case RC_LANGUAGE_GLOBAL_OPTIONS:
2341 if (ignore_system_lyxrc ||
2342 language_global_options
2343 != system_lyxrc.language_global_options) {
2344 os << "\\language_global_options \""
2345 << convert<string>(language_global_options)
2350 case RC_LANGUAGE_USE_BABEL:
2351 if (ignore_system_lyxrc ||
2352 language_use_babel != system_lyxrc.language_use_babel) {
2353 os << "\\language_use_babel \""
2354 << convert<string>(language_use_babel)
2359 case RC_LANGUAGE_COMMAND_BEGIN:
2360 if (ignore_system_lyxrc ||
2361 language_command_begin
2362 != system_lyxrc.language_command_begin) {
2363 os << "\\language_command_begin \""
2364 << language_command_begin
2369 case RC_LANGUAGE_COMMAND_END:
2370 if (ignore_system_lyxrc ||
2371 language_command_end
2372 != system_lyxrc.language_command_end) {
2373 os << "\\language_command_end \"" << language_command_end
2378 case RC_LANGUAGE_COMMAND_LOCAL:
2379 if (ignore_system_lyxrc ||
2380 language_command_local
2381 != system_lyxrc.language_command_local) {
2382 os << "\\language_command_local \""
2383 << language_command_local
2388 case RC_LANGUAGE_AUTO_BEGIN:
2389 if (ignore_system_lyxrc ||
2390 language_auto_begin != system_lyxrc.language_auto_begin) {
2391 os << "\\language_auto_begin "
2392 << convert<string>(language_auto_begin) << '\n';
2396 case RC_LANGUAGE_AUTO_END:
2397 if (ignore_system_lyxrc ||
2398 language_auto_end != system_lyxrc.language_auto_end) {
2399 os << "\\language_auto_end "
2400 << convert<string>(language_auto_end) << '\n';
2404 case RC_MARK_FOREIGN_LANGUAGE:
2405 if (ignore_system_lyxrc ||
2406 mark_foreign_language
2407 != system_lyxrc.mark_foreign_language) {
2408 os << "\\mark_foreign_language " <<
2409 convert<string>(mark_foreign_language) << '\n';
2415 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2418 case RC_AUTO_NUMBER:
2419 if (ignore_system_lyxrc ||
2420 auto_number != system_lyxrc.auto_number) {
2421 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2425 case RC_DEFAULT_LANGUAGE:
2426 if (ignore_system_lyxrc ||
2427 default_language != system_lyxrc.default_language) {
2428 os << "\\default_language " << default_language << '\n';
2432 case RC_GUI_LANGUAGE:
2433 if (ignore_system_lyxrc ||
2434 gui_language != system_lyxrc.gui_language) {
2435 os << "\\gui_language " << gui_language << '\n';
2441 << "# FORMATS SECTION ##########################\n"
2445 // New/modified formats
2446 for (Formats::const_iterator cit = formats.begin();
2447 cit != formats.end(); ++cit) {
2448 Format const * format =
2449 system_formats.getFormat(cit->name());
2451 format->extension() != cit->extension() ||
2452 format->prettyname() != cit->prettyname() ||
2453 format->shortcut() != cit->shortcut() ||
2454 format->viewer() != cit->viewer() ||
2455 format->editor() != cit->editor() ||
2456 format->documentFormat() != cit->documentFormat() ||
2457 format->vectorFormat() != cit->vectorFormat()) {
2458 os << "\\format \"" << cit->name() << "\" \""
2459 << cit->extension() << "\" \""
2460 << cit->prettyname() << "\" \""
2461 << cit->shortcut() << "\" \""
2462 << escapeCommand(cit->viewer()) << "\" \""
2463 << escapeCommand(cit->editor()) << "\" \"";
2464 vector<string> flags;
2465 if (cit->documentFormat())
2466 flags.push_back("document");
2467 if (cit->vectorFormat())
2468 flags.push_back("vector");
2469 os << getStringFromVector(flags);
2474 // Look for deleted formats
2475 for (Formats::const_iterator cit = system_formats.begin();
2476 cit != system_formats.end(); ++cit)
2477 if (!formats.getFormat(cit->name()))
2478 os << "\\format \"" << cit->name()
2479 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2482 case RC_VIEWER_ALTERNATIVES:
2483 if (ignore_system_lyxrc ||
2484 viewer_alternatives != system_lyxrc.viewer_alternatives) {
2485 for (vector<pair<string, string> >::const_iterator it = viewer_alternatives.begin();
2486 it != viewer_alternatives.end(); ++it)
2487 os << "\\viewer_alternatives "
2488 << it->first << " " << it->second << "\n";
2492 case RC_EDITOR_ALTERNATIVES:
2493 if (ignore_system_lyxrc ||
2494 editor_alternatives != system_lyxrc.editor_alternatives) {
2495 for (vector<pair<string, string> >::const_iterator it = editor_alternatives.begin();
2496 it != editor_alternatives.end(); ++it)
2497 os << "\\editor_alternatives "
2498 << it->first << " " << it->second << "\n";
2502 case RC_DEFAULT_VIEW_FORMAT:
2503 if (ignore_system_lyxrc ||
2504 default_view_format != system_lyxrc.default_view_format) {
2505 os << "\\default_view_format " << default_view_format << '\n';
2515 << "# CONVERTERS SECTION ##########################\n"
2519 // Look for new converters
2520 for (Converters::const_iterator cit = theConverters().begin();
2521 cit != theConverters().end(); ++cit) {
2522 Converter const * converter =
2523 theSystemConverters().getConverter(cit->from,
2526 converter->command != cit->command ||
2527 converter->flags != cit->flags)
2528 os << "\\converter \"" << cit->from << "\" \""
2529 << cit->to << "\" \""
2530 << escapeCommand(cit->command) << "\" \""
2531 << cit->flags << "\"\n";
2534 // New/modifed converters
2535 for (Converters::const_iterator cit = theSystemConverters().begin();
2536 cit != theSystemConverters().end(); ++cit)
2537 if (!theConverters().getConverter(cit->from, cit->to))
2538 os << "\\converter \"" << cit->from
2539 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2546 << "# COPIERS SECTION ##########################\n"
2549 // Look for new movers
2550 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2551 Movers::const_iterator const sysend = theSystemMovers().end();
2552 Movers::const_iterator it = theMovers().begin();
2553 Movers::const_iterator end = theMovers().end();
2555 for (; it != end; ++it) {
2556 Movers::const_iterator const sysit =
2557 find_if(sysbegin, sysend, SameMover(*it));
2558 if (sysit == sysend) {
2559 string const & fmt = it->first;
2560 string const & command =
2561 it->second.command();
2563 os << "\\copier " << fmt
2564 << " \"" << escapeCommand(command) << "\"\n";
2570 // We don't actually delete SpecialisedMover(s) from the
2571 // map, just clear their 'command', so there's no need
2572 // to test for anything else.
2579 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2581 // Why the switch you might ask. It is a trick to ensure that all
2582 // the elements in the LyXRCTags enum is handled. As you can see
2583 // there are no breaks at all. So it is just a huge fall-through.
2584 // The nice thing is that we will get a warning from the compiler
2585 // if we forget an element.
2586 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2588 case LyXRC::RC_ACCEPT_COMPOUND:
2589 case LyXRC::RC_ALT_LANG:
2590 case LyXRC::RC_PLAINTEXT_LINELEN:
2591 case LyXRC::RC_PLAINTEXT_ROFF_COMMAND:
2592 case LyXRC::RC_AUTOCORRECTION_MATH:
2593 case LyXRC::RC_AUTOREGIONDELETE:
2594 case LyXRC::RC_AUTORESET_OPTIONS:
2595 case LyXRC::RC_AUTOSAVE:
2596 case LyXRC::RC_AUTO_NUMBER:
2597 case LyXRC::RC_BACKUPDIR_PATH:
2598 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2599 case LyXRC::RC_BIBTEX_COMMAND:
2600 case LyXRC::RC_BINDFILE:
2601 case LyXRC::RC_CHECKLASTFILES:
2602 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2603 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2604 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2605 case LyXRC::RC_COMPLETION_INLINE_MATH:
2606 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2607 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2608 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2609 case LyXRC::RC_COMPLETION_POPUP_MATH:
2610 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2611 case LyXRC::RC_USELASTFILEPOS:
2612 case LyXRC::RC_LOADSESSION:
2613 case LyXRC::RC_CHKTEX_COMMAND:
2614 case LyXRC::RC_CONVERTER:
2615 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2616 case LyXRC::RC_COPIER:
2617 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2618 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2619 case LyXRC::RC_DATE_INSERT_FORMAT:
2620 case LyXRC::RC_DEFAULT_LANGUAGE:
2621 case LyXRC::RC_GUI_LANGUAGE:
2622 case LyXRC::RC_DEFAULT_PAPERSIZE:
2623 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2624 case LyXRC::RC_DEFFILE:
2625 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2626 case LyXRC::RC_DISPLAY_GRAPHICS:
2627 case LyXRC::RC_DOCUMENTPATH:
2628 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2629 FileName path(lyxrc_new.document_path);
2630 if (path.exists() && path.isDirectory())
2631 package().document_dir() = FileName(lyxrc.document_path);
2633 case LyXRC::RC_EDITOR_ALTERNATIVES:
2634 case LyXRC::RC_ESC_CHARS:
2635 case LyXRC::RC_EXAMPLEPATH:
2636 case LyXRC::RC_FONT_ENCODING:
2637 case LyXRC::RC_FORMAT:
2638 case LyXRC::RC_GROUP_LAYOUTS:
2639 case LyXRC::RC_HUNSPELLDIR_PATH:
2640 case LyXRC::RC_INDEX_ALTERNATIVES:
2641 case LyXRC::RC_INDEX_COMMAND:
2642 case LyXRC::RC_JBIBTEX_COMMAND:
2643 case LyXRC::RC_JINDEX_COMMAND:
2644 case LyXRC::RC_NOMENCL_COMMAND:
2645 case LyXRC::RC_INPUT:
2646 case LyXRC::RC_KBMAP:
2647 case LyXRC::RC_KBMAP_PRIMARY:
2648 case LyXRC::RC_KBMAP_SECONDARY:
2649 case LyXRC::RC_LABEL_INIT_LENGTH:
2650 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2651 case LyXRC::RC_LANGUAGE_AUTO_END:
2652 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2653 case LyXRC::RC_LANGUAGE_COMMAND_END:
2654 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2655 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2656 case LyXRC::RC_LANGUAGE_PACKAGE:
2657 case LyXRC::RC_LANGUAGE_USE_BABEL:
2658 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2659 case LyXRC::RC_MACRO_EDIT_STYLE:
2660 case LyXRC::RC_MAKE_BACKUP:
2661 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2662 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2663 case LyXRC::RC_NUMLASTFILES:
2664 case LyXRC::RC_PARAGRAPH_MARKERS:
2665 case LyXRC::RC_PATH_PREFIX:
2666 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2667 prependEnvPath("PATH", lyxrc.path_prefix);
2669 case LyXRC::RC_PERS_DICT:
2670 case LyXRC::RC_PREVIEW:
2671 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2672 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2673 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2674 case LyXRC::RC_PRINTCOPIESFLAG:
2675 case LyXRC::RC_PRINTER:
2676 case LyXRC::RC_PRINTEVENPAGEFLAG:
2677 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2678 case LyXRC::RC_PRINTFILEEXTENSION:
2679 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2680 case LyXRC::RC_PRINTODDPAGEFLAG:
2681 case LyXRC::RC_PRINTPAGERANGEFLAG:
2682 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2683 case LyXRC::RC_PRINTPAPERFLAG:
2684 case LyXRC::RC_PRINTREVERSEFLAG:
2685 case LyXRC::RC_PRINTSPOOL_COMMAND:
2686 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2687 case LyXRC::RC_PRINTTOFILE:
2688 case LyXRC::RC_PRINTTOPRINTER:
2689 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2690 case LyXRC::RC_PRINT_COMMAND:
2691 case LyXRC::RC_RTL_SUPPORT:
2692 case LyXRC::RC_SCREEN_DPI:
2693 case LyXRC::RC_SCREEN_FONT_ROMAN:
2694 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2695 case LyXRC::RC_SCREEN_FONT_SANS:
2696 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2697 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2698 case LyXRC::RC_SCREEN_FONT_SIZES:
2699 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2700 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2701 case LyXRC::RC_GEOMETRY_SESSION:
2702 case LyXRC::RC_SCREEN_ZOOM:
2703 case LyXRC::RC_SERVERPIPE:
2704 case LyXRC::RC_SET_COLOR:
2705 case LyXRC::RC_SHOW_BANNER:
2706 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2707 case LyXRC::RC_SPELL_COMMAND:
2708 case LyXRC::RC_SPELLCHECKER:
2709 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2710 case LyXRC::RC_SPLITINDEX_COMMAND:
2711 case LyXRC::RC_TEMPDIRPATH:
2712 case LyXRC::RC_TEMPLATEPATH:
2713 case LyXRC::RC_TEX_ALLOWS_SPACES:
2714 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2715 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2716 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2718 case LyXRC::RC_THESAURUSDIRPATH:
2719 case LyXRC::RC_UIFILE:
2720 case LyXRC::RC_USER_EMAIL:
2721 case LyXRC::RC_USER_NAME:
2722 case LyXRC::RC_USETEMPDIR:
2723 case LyXRC::RC_USE_ALT_LANG:
2724 case LyXRC::RC_USE_CONVERTER_CACHE:
2725 case LyXRC::RC_USE_ESC_CHARS:
2726 case LyXRC::RC_USE_INP_ENC:
2727 case LyXRC::RC_USE_PERS_DICT:
2728 case LyXRC::RC_USE_TOOLTIP:
2729 case LyXRC::RC_USE_PIXMAP_CACHE:
2730 case LyXRC::RC_USE_SPELL_LIB:
2731 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2732 case LyXRC::RC_SORT_LAYOUTS:
2733 case LyXRC::RC_FULL_SCREEN_LIMIT:
2734 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2735 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2736 case LyXRC::RC_FULL_SCREEN_TABBAR:
2737 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2738 case LyXRC::RC_FULL_SCREEN_WIDTH:
2739 case LyXRC::RC_VISUAL_CURSOR:
2740 case LyXRC::RC_VIEWER:
2741 case LyXRC::RC_VIEWER_ALTERNATIVES:
2742 case LyXRC::RC_LAST:
2749 string const LyXRC::getDescription(LyXRCTags tag)
2754 case RC_ACCEPT_COMPOUND:
2755 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
2759 case RC_USE_ALT_LANG:
2760 str = _("Specify an alternate language. The default is to use the language of the document.");
2763 case RC_PLAINTEXT_ROFF_COMMAND:
2764 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.");
2767 case RC_PLAINTEXT_LINELEN:
2768 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.");
2771 case RC_AUTOREGIONDELETE:
2772 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
2775 case RC_AUTORESET_OPTIONS:
2776 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
2780 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
2783 case RC_AUTO_NUMBER:
2786 case RC_BACKUPDIR_PATH:
2787 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.");
2790 case RC_BIBTEX_COMMAND:
2791 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
2794 case RC_JBIBTEX_COMMAND:
2795 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
2799 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
2802 case RC_CHECKLASTFILES:
2803 str = _("Select to check whether the lastfiles still exist.");
2806 case RC_CHKTEX_COMMAND:
2807 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
2816 case RC_CURSOR_FOLLOWS_SCROLLBAR:
2817 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.");
2820 case RC_SCROLL_BELOW_DOCUMENT:
2821 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");
2824 case RC_MAC_LIKE_WORD_MOVEMENT:
2825 str = _("Use the Mac OS X conventions for the word-level cursor movement");
2828 case RC_SHOW_MACRO_LABEL:
2829 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
2832 case RC_DATE_INSERT_FORMAT:
2833 //xgettext:no-c-format
2834 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
2838 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
2841 case RC_DEFAULT_VIEW_FORMAT:
2842 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
2845 case RC_DEFAULT_LANGUAGE:
2846 str = _("New documents will be assigned this language.");
2849 case RC_DEFAULT_PAPERSIZE:
2850 str = _("Specify the default paper size.");
2853 case RC_DIALOGS_ICONIFY_WITH_MAIN:
2854 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
2857 case RC_DISPLAY_GRAPHICS:
2858 str = _("Select how LyX will display any graphics.");
2861 case RC_DOCUMENTPATH:
2862 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
2866 case RC_USE_ESC_CHARS:
2867 str = _("Specify additional chars that can be part of a word.");
2870 case RC_EXAMPLEPATH:
2871 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
2874 case RC_FONT_ENCODING:
2875 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
2881 case RC_INDEX_COMMAND:
2882 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\".");
2885 case RC_JINDEX_COMMAND:
2886 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
2889 case RC_NOMENCL_COMMAND:
2890 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
2897 case RC_KBMAP_PRIMARY:
2898 case RC_KBMAP_SECONDARY:
2899 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.");
2902 case RC_LABEL_INIT_LENGTH:
2903 str = _("Maximum number of words in the initialization string for a new label");
2906 case RC_LANGUAGE_AUTO_BEGIN:
2907 str = _("Select if a language switching command is needed at the beginning of the document.");
2910 case RC_LANGUAGE_AUTO_END:
2911 str = _("Select if a language switching command is needed at the end of the document.");
2914 case RC_LANGUAGE_COMMAND_BEGIN:
2915 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.");
2918 case RC_LANGUAGE_COMMAND_END:
2919 str = _("The LaTeX command for changing back to the language of the document.");
2922 case RC_LANGUAGE_COMMAND_LOCAL:
2923 str = _("The LaTeX command for local changing of the language.");
2926 case RC_LANGUAGE_GLOBAL_OPTIONS:
2927 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
2930 case RC_LANGUAGE_PACKAGE:
2931 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
2934 case RC_LANGUAGE_USE_BABEL:
2935 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
2938 case RC_USELASTFILEPOS:
2939 str = _("De-select if you do not want LyX to scroll to saved position.");
2942 case RC_LOADSESSION:
2943 str = _("De-select to prevent loading files opened from the last LyX session.");
2946 case RC_MAKE_BACKUP:
2947 str = _("De-select if you don't want LyX to create backup files.");
2950 case RC_MARK_FOREIGN_LANGUAGE:
2951 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
2954 case RC_MOUSE_WHEEL_SPEED:
2955 str = bformat(_("The scrolling speed of the mouse wheel."),
2959 case RC_COMPLETION_POPUP_DELAY:
2960 str = _("The completion popup delay.");
2963 case RC_COMPLETION_POPUP_MATH:
2964 str = _("Select to display the completion popup in math mode.");
2967 case RC_COMPLETION_POPUP_TEXT:
2968 str = _("Select to display the completion popup in text mode.");
2971 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2972 str = _("Show the completion popup without delay after non-unique completion attempt.");
2975 case RC_COMPLETION_POPUP_TEXT:
2976 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
2979 case RC_COMPLETION_POPUP_DELAY:
2980 str = _("The inline completion delay.");
2983 case RC_COMPLETION_INLINE_MATH:
2984 str = _("Select to display the inline completion in math mode.");
2987 case RC_COMPLETION_INLINE_TEXT:
2988 str = _("Select to display the inline completion in text mode.");
2991 case RC_COMPLETION_INLINE_DOTS:
2992 str = _("Use \"...\" to shorten long completions.");
2995 case RC_AUTOCORRECTION_MATH:
2996 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
2999 case RC_NUMLASTFILES:
3000 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3004 case RC_PATH_PREFIX:
3005 str = _("Specify those directories which should be "
3006 "prepended to the PATH environment variable. "
3007 "Use the OS native format.");
3011 str = _("Shows a typeset preview of things such as math");
3014 case RC_PREVIEW_HASHED_LABELS:
3015 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3018 case RC_PREVIEW_SCALE_FACTOR:
3019 str = _("Scale the preview size to suit.");
3022 case RC_PRINTCOLLCOPIESFLAG:
3023 str = _("The option for specifying whether the copies should be collated.");
3026 case RC_PRINTCOPIESFLAG:
3027 str = _("The option for specifying the number of copies to print.");
3031 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3034 case RC_PRINTEVENPAGEFLAG:
3035 str = _("The option to print only even pages.");
3038 case RC_PRINTEXSTRAOPTIONS:
3039 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3042 case RC_PRINTFILEEXTENSION:
3043 str = _("Extension of printer program output file. Usually \".ps\".");
3046 case RC_PRINTLANDSCAPEFLAG:
3047 str = _("The option to print out in landscape.");
3050 case RC_PRINTODDPAGEFLAG:
3051 str = _("The option to print only odd pages.");
3054 case RC_PRINTPAGERANGEFLAG:
3055 str = _("The option for specifying a comma-separated list of pages to print.");
3058 case RC_PRINTPAPERDIMENSIONFLAG:
3059 str = _("Option to specify the dimensions of the print paper.");
3062 case RC_PRINTPAPERFLAG:
3063 str = _("The option to specify paper type.");
3066 case RC_PRINTREVERSEFLAG:
3067 str = _("The option to reverse the order of the pages printed.");
3070 case RC_PRINTSPOOL_COMMAND:
3071 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.");
3074 case RC_PRINTSPOOL_PRINTERPREFIX:
3075 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.");
3078 case RC_PRINTTOFILE:
3079 str = _("Option to pass to the print program to print to a file.");
3082 case RC_PRINTTOPRINTER:
3083 str = _("Option to pass to the print program to print on a specific printer.");
3086 case RC_PRINT_ADAPTOUTPUT:
3087 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3090 case RC_PRINT_COMMAND:
3091 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3094 case RC_RTL_SUPPORT:
3095 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3098 case RC_VISUAL_CURSOR:
3099 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3103 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3106 case RC_SCREEN_FONT_ROMAN:
3107 case RC_SCREEN_FONT_SANS:
3108 case RC_SCREEN_FONT_TYPEWRITER:
3109 str = _("The screen fonts used to display the text while editing.");
3112 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3113 case RC_SCREEN_FONT_SANS_FOUNDRY:
3114 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3117 case RC_SCREEN_FONT_SCALABLE:
3118 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.");
3121 case RC_SCREEN_FONT_SIZES:
3122 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3125 case RC_SCREEN_ZOOM:
3126 //xgettext:no-c-format
3127 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3130 case RC_GEOMETRY_SESSION:
3131 str = _("Allow session manager to save and restore windows geometry.");
3135 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3141 case RC_SHOW_BANNER:
3142 str = _("De-select if you don't want the startup banner.");
3145 case RC_TEMPDIRPATH:
3146 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3149 case RC_THESAURUSDIRPATH:
3150 str = _("This is the place where the files of the thesaurus library reside.");
3153 case RC_TEMPLATEPATH:
3154 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3157 case RC_TEX_ALLOWS_SPACES:
3160 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3164 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3176 case RC_USE_TOOLTIP:
3177 str = _("Enable the automatic appearance of tool tips in the work area.");
3180 case RC_USE_PIXMAP_CACHE:
3181 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3184 case RC_USE_SPELL_LIB:
3187 case RC_VIEWDVI_PAPEROPTION:
3188 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3203 // The global instance
3206 // The global copy of the system lyxrc entries (everything except preferences)