3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
7 * \author Jean-Marc Lasgouttes
8 * \author Angus Leeming
10 * \author André Pönitz
14 * Full author contact details are available in file CREDITS.
22 #include "Converter.h"
23 #include "FontEnums.h"
31 #include "graphics/GraphicsTypes.h"
33 #include "support/convert.h"
34 #include "support/debug.h"
35 #include "support/environment.h"
36 #include "support/FileName.h"
37 #include "support/filetools.h"
38 #include "support/gettext.h"
39 #include "support/lstrings.h"
40 #include "support/os.h"
41 #include "support/Package.h"
42 #include "support/userinfo.h"
49 using namespace lyx::support;
53 namespace os = support::os;
57 static unsigned int const LYXRC_FILEFORMAT = 1;
59 // when adding something to this array keep it sorted!
60 LexerKeyword lyxrcTags[] = {
61 { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
62 { "\\allow_geometry_session", LyXRC::RC_GEOMETRY_SESSION },
63 { "\\alternate_language", LyXRC::RC_ALT_LANG },
64 { "\\auto_number", LyXRC::RC_AUTO_NUMBER },
65 { "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
66 { "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
67 { "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
68 { "\\autosave", LyXRC::RC_AUTOSAVE },
69 { "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
70 { "\\bibtex_alternatives", LyXRC::RC_BIBTEX_ALTERNATIVES },
71 { "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
72 { "\\bind_file", LyXRC::RC_BINDFILE },
73 { "\\check_lastfiles", LyXRC::RC_CHECKLASTFILES },
74 { "\\chktex_command", LyXRC::RC_CHKTEX_COMMAND },
75 { "\\completion_cursor_text", LyXRC::RC_COMPLETION_CURSOR_TEXT },
76 { "\\completion_inline_delay", LyXRC::RC_COMPLETION_INLINE_DELAY },
77 { "\\completion_inline_dots", LyXRC::RC_COMPLETION_INLINE_DOTS },
78 { "\\completion_inline_math", LyXRC::RC_COMPLETION_INLINE_MATH },
79 { "\\completion_inline_text", LyXRC::RC_COMPLETION_INLINE_TEXT },
80 { "\\completion_popup_after_complete", LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE },
81 { "\\completion_popup_delay", LyXRC::RC_COMPLETION_POPUP_DELAY },
82 { "\\completion_popup_math", LyXRC::RC_COMPLETION_POPUP_MATH },
83 { "\\completion_popup_text", LyXRC::RC_COMPLETION_POPUP_TEXT },
84 { "\\converter", LyXRC::RC_CONVERTER },
85 { "\\converter_cache_maxage", LyXRC::RC_CONVERTER_CACHE_MAXAGE },
86 { "\\copier", LyXRC::RC_COPIER },
87 { "\\cursor_follows_scrollbar", LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR },
88 { "\\date_insert_format", LyXRC::RC_DATE_INSERT_FORMAT },
89 { "\\def_file", LyXRC::RC_DEFFILE },
90 { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
91 { "\\default_language", LyXRC::RC_DEFAULT_LANGUAGE },
92 { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
93 { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
94 { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
95 { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
96 { "\\document_path", LyXRC::RC_DOCUMENTPATH },
97 { "\\editor_alternatives", LyXRC::RC_EDITOR_ALTERNATIVES },
98 { "\\escape_chars", LyXRC::RC_ESC_CHARS },
99 { "\\example_path", LyXRC::RC_EXAMPLEPATH },
100 { "\\export_overwrite", LyXRC::RC_EXPORT_OVERWRITE },
101 { "\\font_encoding", LyXRC::RC_FONT_ENCODING },
102 { "\\format", LyXRC::RC_FILEFORMAT },
103 { "\\forward_search_dvi", LyXRC::RC_FORWARD_SEARCH_DVI },
104 { "\\forward_search_pdf", LyXRC::RC_FORWARD_SEARCH_PDF },
105 { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
106 { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
107 { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
108 { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
109 { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
110 { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
111 { "\\group_layouts", LyXRC::RC_GROUP_LAYOUTS },
112 { "\\gui_language", LyXRC::RC_GUI_LANGUAGE },
113 { "\\hunspelldir_path", LyXRC::RC_HUNSPELLDIR_PATH },
114 { "\\index_alternatives", LyXRC::RC_INDEX_ALTERNATIVES },
115 { "\\index_command", LyXRC::RC_INDEX_COMMAND },
116 { "\\input", LyXRC::RC_INPUT },
117 { "\\jbibtex_command", LyXRC::RC_JBIBTEX_COMMAND },
118 { "\\jindex_command", LyXRC::RC_JINDEX_COMMAND },
119 { "\\kbmap", LyXRC::RC_KBMAP },
120 { "\\kbmap_primary", LyXRC::RC_KBMAP_PRIMARY },
121 { "\\kbmap_secondary", LyXRC::RC_KBMAP_SECONDARY },
122 { "\\language_auto_begin", LyXRC::RC_LANGUAGE_AUTO_BEGIN },
123 { "\\language_auto_end", LyXRC::RC_LANGUAGE_AUTO_END },
124 { "\\language_command_begin", LyXRC::RC_LANGUAGE_COMMAND_BEGIN },
125 { "\\language_command_end", LyXRC::RC_LANGUAGE_COMMAND_END },
126 { "\\language_command_local", LyXRC::RC_LANGUAGE_COMMAND_LOCAL },
127 { "\\language_custom_package", LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE },
128 { "\\language_global_options", LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS },
129 { "\\language_package_selection", LyXRC::RC_LANGUAGE_PACKAGE_SELECTION },
130 { "\\load_session", LyXRC::RC_LOADSESSION },
131 { "\\mac_dontswap_ctrl_meta", LyXRC::RC_MAC_DONTSWAP_CTRL_META },
132 { "\\mac_like_word_movement", LyXRC::RC_MAC_LIKE_WORD_MOVEMENT },
133 { "\\macro_edit_style", LyXRC::RC_MACRO_EDIT_STYLE },
134 { "\\make_backup", LyXRC::RC_MAKE_BACKUP },
135 { "\\mark_foreign_language", LyXRC::RC_MARK_FOREIGN_LANGUAGE },
136 { "\\mouse_wheel_speed", LyXRC::RC_MOUSE_WHEEL_SPEED },
137 { "\\nomencl_command", LyXRC::RC_NOMENCL_COMMAND },
138 { "\\num_lastfiles", LyXRC::RC_NUMLASTFILES },
139 { "\\open_buffers_in_tabs", LyXRC::RC_OPEN_BUFFERS_IN_TABS },
140 { "\\paragraph_markers", LyXRC::RC_PARAGRAPH_MARKERS },
141 { "\\path_prefix", LyXRC::RC_PATH_PREFIX },
142 { "\\plaintext_linelen", LyXRC::RC_PLAINTEXT_LINELEN },
143 { "\\preview", LyXRC::RC_PREVIEW },
144 { "\\preview_hashed_labels", LyXRC::RC_PREVIEW_HASHED_LABELS },
145 { "\\preview_scale_factor", LyXRC::RC_PREVIEW_SCALE_FACTOR },
146 { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
147 { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
148 { "\\print_command", LyXRC::RC_PRINT_COMMAND },
149 { "\\print_copies_flag", LyXRC::RC_PRINTCOPIESFLAG },
150 { "\\print_evenpage_flag", LyXRC::RC_PRINTEVENPAGEFLAG },
151 { "\\print_extra_options", LyXRC::RC_PRINTEXSTRAOPTIONS },
152 { "\\print_file_extension", LyXRC::RC_PRINTFILEEXTENSION },
153 { "\\print_landscape_flag", LyXRC::RC_PRINTLANDSCAPEFLAG },
154 { "\\print_oddpage_flag", LyXRC::RC_PRINTODDPAGEFLAG },
155 { "\\print_pagerange_flag", LyXRC::RC_PRINTPAGERANGEFLAG },
156 { "\\print_paper_dimension_flag", LyXRC::RC_PRINTPAPERDIMENSIONFLAG },
157 { "\\print_paper_flag", LyXRC::RC_PRINTPAPERFLAG },
158 { "\\print_reverse_flag", LyXRC::RC_PRINTREVERSEFLAG },
159 { "\\print_spool_command", LyXRC::RC_PRINTSPOOL_COMMAND },
160 { "\\print_spool_printerprefix", LyXRC::RC_PRINTSPOOL_PRINTERPREFIX },
161 { "\\print_to_file", LyXRC::RC_PRINTTOFILE },
162 { "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
163 { "\\printer", LyXRC::RC_PRINTER },
164 { "\\rtl", LyXRC::RC_RTL_SUPPORT },
165 { "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
166 { "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
167 { "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
168 { "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
169 { "\\screen_font_sans", LyXRC::RC_SCREEN_FONT_SANS },
170 { "\\screen_font_sans_foundry", LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY },
171 { "\\screen_font_scalable", LyXRC::RC_SCREEN_FONT_SCALABLE },
172 { "\\screen_font_sizes", LyXRC::RC_SCREEN_FONT_SIZES },
173 { "\\screen_font_typewriter", LyXRC::RC_SCREEN_FONT_TYPEWRITER },
174 { "\\screen_font_typewriter_foundry", LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY },
175 { "\\screen_zoom", LyXRC::RC_SCREEN_ZOOM },
176 { "\\scroll_below_document", LyXRC::RC_SCROLL_BELOW_DOCUMENT },
177 { "\\scroll_wheel_zoom", LyXRC::RC_SCROLL_WHEEL_ZOOM },
178 { "\\serverpipe", LyXRC::RC_SERVERPIPE },
179 { "\\set_color", LyXRC::RC_SET_COLOR },
180 { "\\show_banner", LyXRC::RC_SHOW_BANNER },
181 { "\\single_close_tab_button", LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON },
182 { "\\single_instance", LyXRC::RC_SINGLE_INSTANCE },
183 { "\\sort_layouts", LyXRC::RC_SORT_LAYOUTS },
184 { "\\spellcheck_continuously", LyXRC::RC_SPELLCHECK_CONTINUOUSLY },
185 { "\\spellcheck_notes", LyXRC::RC_SPELLCHECK_NOTES },
186 { "\\spellchecker", LyXRC::RC_SPELLCHECKER },
187 { "\\splitindex_command", LyXRC::RC_SPLITINDEX_COMMAND },
188 { "\\tempdir_path", LyXRC::RC_TEMPDIRPATH },
189 { "\\template_path", LyXRC::RC_TEMPLATEPATH },
190 { "\\tex_allows_spaces", LyXRC::RC_TEX_ALLOWS_SPACES },
191 { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
192 { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
193 { "\\ui_file", LyXRC::RC_UIFILE },
194 { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
195 { "\\use_lastfilepos", LyXRC::RC_USELASTFILEPOS },
196 { "\\use_pixmap_cache", LyXRC::RC_USE_PIXMAP_CACHE },
197 // compatibility with versions older than 1.4.0 only
198 { "\\use_system_colors", LyXRC::RC_USE_SYSTEM_COLORS },
199 { "\\use_tooltip", LyXRC::RC_USE_TOOLTIP },
200 { "\\user_email", LyXRC::RC_USER_EMAIL },
201 { "\\user_name", LyXRC::RC_USER_NAME },
202 { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
203 // compatibility with versions older than 1.4.0 only
204 { "\\viewer", LyXRC::RC_VIEWER},
205 { "\\viewer_alternatives", LyXRC::RC_VIEWER_ALTERNATIVES },
206 { "\\visual_cursor", LyXRC::RC_VISUAL_CURSOR },
207 { "format", LyXRC::RC_LYXRCFORMAT }
210 const int lyxrcCount = sizeof(lyxrcTags) / sizeof(lyxrcTags[0]);
221 void LyXRC::setDefaults()
224 def_file = "default";
226 // Get printer from the environment. If fail, use default "",
227 // assuming that everything is set up correctly.
228 printer = getEnv("PRINTER");
229 print_adapt_output = false;
230 print_command = "dvips";
231 print_evenpage_flag = "-B";
232 print_oddpage_flag = "-A";
233 print_pagerange_flag = "-pp";
234 print_copies_flag = "-c";
235 print_collcopies_flag = "-C";
236 print_reverse_flag = "-r";
237 print_landscape_flag = "-t landscape";
238 print_to_printer = "-P";
239 print_to_file = "-o ";
240 print_file_extension = ".ps";
241 print_paper_flag = "-t";
242 print_paper_dimension_flag = "-T";
243 document_path.erase();
244 view_dvi_paper_option.erase();
245 default_papersize = PAPER_DEFAULT;
246 default_view_format = "pdf2";
247 chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
248 bibtex_command = "bibtex";
250 index_command = "makeindex -c -q";
251 nomencl_command = "makeindex -s nomencl.ist";
253 // Because a screen is typically wider than a piece of paper:
255 allow_geometry_session = true;
256 // Default LaTeX font size:
257 font_sizes[FONT_SIZE_TINY] = "5.0";
258 font_sizes[FONT_SIZE_SCRIPT] = "7.0";
259 font_sizes[FONT_SIZE_FOOTNOTE] = "8.0";
260 font_sizes[FONT_SIZE_SMALL] = "9.0";
261 font_sizes[FONT_SIZE_NORMAL] = "10.0";
262 font_sizes[FONT_SIZE_LARGE] = "12.0";
263 font_sizes[FONT_SIZE_LARGER] = "14.4";
264 font_sizes[FONT_SIZE_LARGEST] = "17.26";
265 font_sizes[FONT_SIZE_HUGE] = "20.74";
266 font_sizes[FONT_SIZE_HUGER] = "24.88";
267 use_scalable_fonts = true;
268 roman_font_name = "";
270 typewriter_font_name = "";
272 auto_region_delete = true;
273 auto_reset_options = false;
274 plaintext_linelen = 65;
275 mouse_wheel_speed = 1.0;
276 num_lastfiles = maxlastfiles;
277 check_lastfiles = true;
278 use_lastfilepos = true;
279 load_session = false;
281 save_compressed = false;
282 backupdir_path.erase();
283 display_graphics = true;
284 // Spellchecker settings:
285 // FIXME: this check should test the target platform (darwin)
286 #if defined(USE_MACOSX_PACKAGING)
287 spellchecker = "native";
288 #elif defined(USE_ASPELL)
289 spellchecker = "aspell";
290 #elif defined(USE_HUNSPELL)
291 spellchecker = "hunspell";
293 spellchecker = "aspell";
295 spellchecker_accept_compound = false;
296 spellcheck_continuously = false;
297 spellcheck_notes = true;
300 visual_cursor = false;
302 mark_foreign_language = true;
303 language_auto_begin = true;
304 language_auto_end = true;
305 language_global_options = true;
306 language_package_selection = LP_AUTO;
307 language_custom_package = "\\usepackage{babel}";
308 language_command_begin = "\\selectlanguage{$$lang}";
309 language_command_local = "\\foreignlanguage{$$lang}{";
310 sort_layouts = false;
311 group_layouts = true;
312 default_language = "english";
313 gui_language = "auto";
315 windows_style_tex_paths = false;
316 tex_allows_spaces = false;
317 date_insert_format = "%x";
318 cursor_follows_scrollbar = false;
319 scroll_below_document = false;
320 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
321 paragraph_markers = false;
322 mac_dontswap_ctrl_meta = false;
323 mac_like_word_movement = false;
324 macro_edit_style = MACRO_EDIT_INLINE_BOX;
325 dialogs_iconify_with_main = false;
326 preview = PREVIEW_OFF;
327 preview_hashed_labels = false;
328 preview_scale_factor = 1.0;
329 use_converter_cache = true;
330 use_system_colors = false;
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 single_instance = true;
339 forward_search_dvi = string();
340 forward_search_pdf = string();
341 export_overwrite = NO_FILES;
343 // Fullscreen settings
344 full_screen_limit = false;
345 full_screen_toolbars = true;
346 full_screen_tabbar = true;
347 full_screen_menubar = true;
348 full_screen_scrollbar = true;
349 full_screen_width = 700;
351 completion_cursor_text = true;
352 completion_popup_math = true;
353 completion_popup_text = false;
354 completion_popup_delay = 2.0;
355 completion_popup_after_complete = true;
356 autocorrection_math = false;
357 completion_inline_math = true;
358 completion_inline_text = false;
359 completion_inline_dots = -1;
360 completion_inline_delay = 0.2;
361 default_decimal_point = ".";
367 void oldFontFormat(string & family, string & foundry)
369 if (family.empty() || family[0] != '-')
371 foundry = token(family, '-', 1);
372 family = token(family, '-', 2);
380 bool LyXRC::read(FileName const & filename, bool check_format)
382 Lexer lexrc(lyxrcTags);
383 lexrc.setFile(filename);
384 LYXERR(Debug::LYXRC, "Reading '" << filename << "'...");
385 ReturnValues retval = read(lexrc, check_format);
386 if (!check_format || retval != FormatMismatch)
387 return retval == ReadOK;
389 LYXERR(Debug::FILES, "Converting LyXRC file to " << LYXRC_FILEFORMAT);
390 FileName const tempfile = FileName::tempName("convert_lyxrc");
391 bool const success = prefs2prefs(filename, tempfile, false);
393 LYXERR0 ("Unable to convert " << filename.absFileName() <<
394 " to format " << LYXRC_FILEFORMAT);
397 Lexer lexrc2(lyxrcTags);
398 lexrc2.setFile(tempfile);
399 LYXERR(Debug::LYXRC, "Reading '" << tempfile << "'...");
400 retval = read(lexrc2, check_format);
401 tempfile.removeFile();
402 return retval == ReadOK;
406 // don't need to worry about conversion, because this is always
407 // from an internal source
408 bool LyXRC::read(istream & is)
410 Lexer lexrc(lyxrcTags);
412 LYXERR(Debug::LYXRC, "Reading istream...");
413 return read(lexrc, false) == ReadOK;
417 LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
419 if (lyxerr.debugging(Debug::PARSER))
420 lexrc.printTable(lyxerr);
425 // format prior to 2.0 and introduction of format tag
426 unsigned int format = 0;
428 while (lexrc.isOK()) {
429 // By using two switches we take advantage of the compiler
430 // telling us if we have missed a LyXRCTags element in
431 // the second switch.
432 // Note that this also shows a problem with Lexer since it
433 // helps us avoid taking advantage of the strictness of the
436 int le = lexrc.lex();
438 case Lexer::LEX_UNDEF:
439 lexrc.printError("Unknown tag `$$Token'");
441 case Lexer::LEX_FEOF:
446 switch (static_cast<LyXRCTags>(le)) {
449 format = lexrc.getInteger();
451 case RC_INPUT: // Include file
454 libFileSearch(string(),
456 if (read(tmp, check_format)) {
458 "Error reading included file: " + tmp.absFileName());
464 bind_file = os::internal_path(lexrc.getString());
469 def_file = os::internal_path(lexrc.getString());
474 ui_file = os::internal_path(lexrc.getString());
477 case RC_AUTORESET_OPTIONS:
478 lexrc >> auto_reset_options;
481 case RC_DISPLAY_GRAPHICS:
483 display_graphics = lexrc.getString() == "true";
486 case RC_TEX_EXPECTS_WINDOWS_PATHS:
487 lexrc >> windows_style_tex_paths;
490 case RC_TEX_ALLOWS_SPACES:
491 lexrc >> tex_allows_spaces;
498 case RC_KBMAP_PRIMARY:
500 string const kmap(os::internal_path(lexrc.getString()));
501 if (!libFileSearch("kbd", kmap, "kmap").empty()
503 primary_kbmap = kmap;
505 lexrc.printError("LyX: Keymap `$$Token' not found");
510 case RC_KBMAP_SECONDARY:
512 string const kmap(os::internal_path(lexrc.getString()));
513 if (!libFileSearch("kbd", kmap, "kmap").empty()
515 secondary_kbmap = kmap;
517 lexrc.printError("LyX: Keymap `$$Token' not found");
522 case RC_FONT_ENCODING:
530 case RC_PRINT_COMMAND:
531 if (lexrc.next(true)) {
532 print_command = lexrc.getString();
536 case RC_PRINTEVENPAGEFLAG:
537 lexrc >> print_evenpage_flag;
540 case RC_PRINTODDPAGEFLAG:
541 lexrc >> print_oddpage_flag;
544 case RC_PRINTPAGERANGEFLAG:
545 lexrc >> print_pagerange_flag;
548 case RC_PRINTCOPIESFLAG:
549 lexrc >> print_copies_flag;
552 case RC_PRINTCOLLCOPIESFLAG:
553 lexrc >> print_collcopies_flag;
556 case RC_PRINTREVERSEFLAG:
557 lexrc >> print_reverse_flag;
560 case RC_PRINTLANDSCAPEFLAG:
561 lexrc >> print_landscape_flag;
564 case RC_PRINTTOPRINTER:
565 lexrc >> print_to_printer;
568 case RC_PRINT_ADAPTOUTPUT:
569 lexrc >> print_adapt_output;
574 print_to_file = os::internal_path(lexrc.getString());
578 case RC_PRINTFILEEXTENSION:
579 lexrc >> print_file_extension;
582 case RC_PRINTEXSTRAOPTIONS:
583 lexrc >> print_extra_options;
586 case RC_PRINTSPOOL_COMMAND:
587 if (lexrc.next(true)) {
588 print_spool_command = lexrc.getString();
592 case RC_PRINTSPOOL_PRINTERPREFIX:
593 lexrc >> print_spool_printerprefix;
596 case RC_PRINTPAPERDIMENSIONFLAG:
597 lexrc >> print_paper_dimension_flag;
600 case RC_PRINTPAPERFLAG:
601 lexrc >> print_paper_flag;
604 case RC_DEFAULT_PAPERSIZE:
606 string const size = ascii_lowercase(lexrc.getString());
607 if (size == "usletter")
608 default_papersize = PAPER_USLETTER;
609 else if (size == "legal")
610 default_papersize = PAPER_USLEGAL;
611 else if (size == "executive")
612 default_papersize = PAPER_USEXECUTIVE;
613 else if (size == "a3")
614 default_papersize = PAPER_A3;
615 else if (size == "a4")
616 default_papersize = PAPER_A4;
617 else if (size == "a5")
618 default_papersize = PAPER_A5;
619 else if (size == "b5")
620 default_papersize = PAPER_B5;
621 else if (size == "default")
622 default_papersize = PAPER_DEFAULT;
626 case RC_VIEWDVI_PAPEROPTION:
628 view_dvi_paper_option = lexrc.getString();
630 view_dvi_paper_option.erase();
633 case RC_CHKTEX_COMMAND:
634 if (lexrc.next(true)) {
635 chktex_command = lexrc.getString();
639 case RC_BIBTEX_ALTERNATIVES:
640 if (lexrc.next(true)) {
641 bibtex_alternatives.insert(lexrc.getString());
645 case RC_BIBTEX_COMMAND:
646 if (lexrc.next(true)) {
647 bibtex_command = lexrc.getString();
651 case RC_JBIBTEX_COMMAND:
652 if (lexrc.next(true)) {
653 jbibtex_command = lexrc.getString();
657 case RC_INDEX_ALTERNATIVES:
658 if (lexrc.next(true)) {
659 index_alternatives.insert(lexrc.getString());
663 case RC_INDEX_COMMAND:
664 if (lexrc.next(true)) {
665 index_command = lexrc.getString();
669 case RC_JINDEX_COMMAND:
670 if (lexrc.next(true)) {
671 jindex_command = lexrc.getString();
675 case RC_SPLITINDEX_COMMAND:
676 if (lexrc.next(true)) {
677 splitindex_command = lexrc.getString();
681 case RC_NOMENCL_COMMAND:
682 if (lexrc.next(true)) {
683 nomencl_command = lexrc.getString();
695 case RC_GEOMETRY_SESSION:
696 lexrc >> allow_geometry_session;
699 case RC_SCREEN_FONT_SIZES:
700 lexrc >> font_sizes[FONT_SIZE_TINY];
701 lexrc >> font_sizes[FONT_SIZE_SCRIPT];
702 lexrc >> font_sizes[FONT_SIZE_FOOTNOTE];
703 lexrc >> font_sizes[FONT_SIZE_SMALL];
704 lexrc >> font_sizes[FONT_SIZE_NORMAL];
705 lexrc >> font_sizes[FONT_SIZE_LARGE];
706 lexrc >> font_sizes[FONT_SIZE_LARGER];
707 lexrc >> font_sizes[FONT_SIZE_LARGEST];
708 lexrc >> font_sizes[FONT_SIZE_HUGE];
709 lexrc >> font_sizes[FONT_SIZE_HUGER];
712 case RC_SCREEN_FONT_SCALABLE:
713 lexrc >> use_scalable_fonts;
720 case RC_DOCUMENTPATH:
722 document_path = os::internal_path(lexrc.getString());
723 document_path = expandPath(document_path);
729 example_path = os::internal_path(lexrc.getString());
730 example_path = expandPath(example_path);
734 case RC_TEMPLATEPATH:
736 template_path = os::internal_path(lexrc.getString());
737 template_path = expandPath(template_path);
743 tempdir_path = os::internal_path(lexrc.getString());
744 tempdir_path = expandPath(tempdir_path);
748 case RC_THESAURUSDIRPATH:
750 thesaurusdir_path = os::internal_path(lexrc.getString());
751 thesaurusdir_path = expandPath(thesaurusdir_path);
755 case RC_HUNSPELLDIR_PATH:
757 hunspelldir_path = os::internal_path(lexrc.getString());
758 hunspelldir_path = expandPath(hunspelldir_path);
762 case RC_USELASTFILEPOS:
763 lexrc >> use_lastfilepos;
767 lexrc >> load_session;
770 case RC_MOUSE_WHEEL_SPEED:
771 lexrc >> mouse_wheel_speed;
774 case RC_COMPLETION_INLINE_DELAY:
775 lexrc >> completion_inline_delay;
778 case RC_COMPLETION_INLINE_MATH:
779 lexrc >> completion_inline_math;
782 case RC_COMPLETION_INLINE_TEXT:
783 lexrc >> completion_inline_text;
786 case RC_COMPLETION_INLINE_DOTS:
787 lexrc >> completion_inline_dots;
790 case RC_AUTOCORRECTION_MATH:
791 lexrc >> autocorrection_math;
794 case RC_COMPLETION_POPUP_DELAY:
795 lexrc >> completion_popup_delay;
798 case RC_COMPLETION_POPUP_MATH:
799 lexrc >> completion_popup_math;
802 case RC_COMPLETION_POPUP_TEXT:
803 lexrc >> completion_popup_text;
806 case RC_COMPLETION_CURSOR_TEXT:
807 lexrc >> completion_cursor_text;
810 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
811 lexrc >> completion_popup_after_complete;
814 case RC_NUMLASTFILES:
815 lexrc >> num_lastfiles;
818 case RC_CHECKLASTFILES:
819 lexrc >> check_lastfiles;
822 case RC_SCREEN_FONT_ROMAN:
824 roman_font_name = lexrc.getString();
825 oldFontFormat(roman_font_name,
830 case RC_SCREEN_FONT_SANS:
832 sans_font_name = lexrc.getString();
833 oldFontFormat(sans_font_name, sans_font_foundry);
837 case RC_SCREEN_FONT_TYPEWRITER:
839 typewriter_font_name = lexrc.getString();
840 oldFontFormat(typewriter_font_name,
841 typewriter_font_foundry);
845 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
846 lexrc >> roman_font_foundry;
849 case RC_SCREEN_FONT_SANS_FOUNDRY:
850 lexrc >> sans_font_foundry;
853 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
854 lexrc >> typewriter_font_foundry;
859 lexrc.printError("Missing color tag.");
862 string lyx_name = lexrc.getString();
865 lexrc.printError("Missing color name for color: `$$Token'");
868 string x11_name = lexrc.getString();
870 ColorCode const col =
871 lcolor.getFromLyXName(lyx_name);
872 if (col == Color_none ||
873 col == Color_inherit ||
877 if (!lcolor.setColor(col, x11_name))
878 LYXERR0("Bad lyxrc set_color for " << lyx_name);
882 case RC_AUTOREGIONDELETE:
883 // Auto region delete defaults to true
884 lexrc >> auto_region_delete;
889 lyxpipes = os::internal_path(lexrc.getString());
890 lyxpipes = expandPath(lyxpipes);
894 case RC_CURSOR_FOLLOWS_SCROLLBAR:
895 lexrc >> cursor_follows_scrollbar;
898 case RC_SCROLL_BELOW_DOCUMENT:
899 lexrc >> scroll_below_document;
902 case RC_PARAGRAPH_MARKERS:
903 lexrc >> paragraph_markers;
906 case RC_MAC_DONTSWAP_CTRL_META:
907 lexrc >> mac_dontswap_ctrl_meta;
910 case RC_MAC_LIKE_WORD_MOVEMENT:
911 lexrc >> mac_like_word_movement;
914 case RC_MACRO_EDIT_STYLE:
916 switch (lexrc.getInteger()) {
917 case 0: macro_edit_style = MACRO_EDIT_INLINE_BOX; break;
918 case 1: macro_edit_style = MACRO_EDIT_INLINE; break;
919 case 2: macro_edit_style = MACRO_EDIT_LIST; break;
924 case RC_DIALOGS_ICONIFY_WITH_MAIN:
925 lexrc >> dialogs_iconify_with_main;
928 case RC_PLAINTEXT_LINELEN:
929 lexrc >> plaintext_linelen;
931 // Spellchecker settings:
932 case RC_ACCEPT_COMPOUND:
933 lexrc >> spellchecker_accept_compound;
935 case RC_USE_SYSTEM_COLORS:
936 lexrc >> use_system_colors;
939 lexrc >> use_tooltip;
941 case RC_USE_PIXMAP_CACHE:
942 lexrc >> use_pixmap_cache;
944 case RC_SPELLCHECKER:
945 lexrc >> spellchecker;
948 lexrc >> spellchecker_alt_lang;
951 lexrc >> spellchecker_esc_chars;
953 case RC_SPELLCHECK_CONTINUOUSLY:
954 lexrc >> spellcheck_continuously;
956 case RC_SPELLCHECK_NOTES:
957 lexrc >> spellcheck_notes;
960 lexrc >> make_backup;
962 case RC_SAVE_COMPRESSED:
963 lexrc >> save_compressed;
965 case RC_BACKUPDIR_PATH:
967 backupdir_path = os::internal_path(lexrc.getString());
968 backupdir_path = expandPath(backupdir_path);
971 case RC_DEFAULT_DECIMAL_POINT:
972 lexrc >> default_decimal_point;
974 case RC_DATE_INSERT_FORMAT:
975 lexrc >> date_insert_format;
977 case RC_LANGUAGE_CUSTOM_PACKAGE:
978 lexrc >> language_custom_package;
980 case RC_LANGUAGE_AUTO_BEGIN:
981 lexrc >> language_auto_begin;
983 case RC_LANGUAGE_AUTO_END:
984 lexrc >> language_auto_end;
986 case RC_LANGUAGE_GLOBAL_OPTIONS:
987 lexrc >> language_global_options;
989 case RC_LANGUAGE_PACKAGE_SELECTION:
991 switch (lexrc.getInteger()) {
993 language_package_selection = LP_AUTO;
996 language_package_selection = LP_BABEL;
999 language_package_selection = LP_CUSTOM;
1002 language_package_selection = LP_NONE;
1007 case RC_LANGUAGE_COMMAND_BEGIN:
1008 lexrc >> language_command_begin;
1010 case RC_LANGUAGE_COMMAND_END:
1011 lexrc >> language_command_end;
1013 case RC_LANGUAGE_COMMAND_LOCAL:
1014 lexrc >> language_command_local;
1016 case RC_RTL_SUPPORT:
1017 lexrc >> rtl_support;
1019 case RC_VISUAL_CURSOR:
1020 lexrc >> visual_cursor;
1022 case RC_AUTO_NUMBER:
1023 lexrc >> auto_number;
1025 case RC_MARK_FOREIGN_LANGUAGE:
1026 lexrc >> mark_foreign_language;
1030 string fmt, command;
1032 fmt = lexrc.getString();
1033 if (lexrc.next(true))
1034 command = lexrc.getString();
1035 setMover(fmt, command);
1039 case RC_CONVERTER: {
1040 string from, to, command, flags;
1042 from = lexrc.getString();
1044 to = lexrc.getString();
1045 if (lexrc.next(true))
1046 command = lexrc.getString();
1048 flags = lexrc.getString();
1049 if (command.empty())
1050 theConverters().erase(from, to);
1052 theConverters().add(from, to, command, flags);
1055 // compatibility with versions older than 1.4.0 only
1057 string format, command;
1058 lexrc >> format >> command;
1059 formats.setViewer(format, command);
1062 case RC_FILEFORMAT: {
1063 string format, extension, prettyname, shortcut;
1064 lexrc >> format >> extension >> prettyname >> shortcut;
1065 string viewer, editor;
1066 if (lexrc.next(true))
1067 viewer = lexrc.getString();
1068 if (lexrc.next(true))
1069 editor = lexrc.getString();
1071 // Hack to ensure compatibility with versions older
1073 int le = lexrc.lex();
1074 if (le != Lexer::LEX_FEOF && le != Lexer::LEX_UNDEF) {
1075 flags = lexrc.getString();
1076 if (le != Lexer::LEX_DATA) {
1077 // We have got a known token.
1078 // Therefore this is an old style
1079 // format definition without
1081 lexrc.pushToken(flags);
1085 int flgs = Format::none;
1086 while (!flags.empty()) {
1088 flags = split(flags, flag, ',');
1089 if (flag == "document")
1090 flgs |= Format::document;
1091 else if (flag == "vector")
1092 flgs |= Format::vector;
1093 else if (flag == "menu=export")
1094 flgs |= Format::export_menu;
1096 LYXERR0("Ignoring unknown flag `"
1097 << flag << "' for format `"
1100 if (prettyname.empty()) {
1101 if (theConverters().formatIsUsed(format))
1102 LYXERR0("Can't delete format " << format);
1104 formats.erase(format);
1106 formats.add(format, extension, prettyname,
1107 shortcut, viewer, editor, flgs);
1111 case RC_VIEWER_ALTERNATIVES: {
1112 string format, command;
1114 format = lexrc.getString();
1115 if (lexrc.eatLine())
1116 command = lexrc.getString();
1117 viewer_alternatives[format].insert(command);
1120 case RC_EDITOR_ALTERNATIVES: {
1121 string format, command;
1122 lexrc >> format >> command;
1123 editor_alternatives[format].insert(command);
1127 case RC_DEFAULT_VIEW_FORMAT:
1128 lexrc >> default_view_format;
1131 case RC_DEFAULT_LANGUAGE:
1132 lexrc >> default_language;
1135 case RC_GUI_LANGUAGE:
1136 lexrc >> gui_language;
1139 case RC_SHOW_BANNER:
1140 lexrc >> show_banner;
1145 string const tmp = lexrc.getString();
1146 if (tmp == "true" || tmp == "on")
1147 preview = PREVIEW_ON;
1148 else if (tmp == "no_math")
1149 preview = PREVIEW_NO_MATH;
1151 preview = PREVIEW_OFF;
1152 if (tmp != "false" && tmp != "off")
1153 LYXERR0("Unrecognized preview status \""
1159 case RC_PREVIEW_HASHED_LABELS:
1160 lexrc >> preview_hashed_labels;
1163 case RC_PREVIEW_SCALE_FACTOR:
1164 lexrc >> preview_scale_factor;
1171 lexrc >> user_email;
1174 case RC_PATH_PREFIX:
1175 lexrc >> path_prefix;
1178 case RC_USE_CONVERTER_CACHE:
1179 lexrc >> use_converter_cache;
1181 case RC_CONVERTER_CACHE_MAXAGE:
1182 lexrc >> converter_cache_maxage;
1185 case RC_SORT_LAYOUTS:
1186 lexrc >> sort_layouts;
1188 case RC_GROUP_LAYOUTS:
1189 lexrc >> group_layouts;
1191 case RC_FULL_SCREEN_LIMIT:
1192 lexrc >> full_screen_limit;
1194 case RC_FULL_SCREEN_TOOLBARS:
1195 lexrc >> full_screen_toolbars;
1197 case RC_FULL_SCREEN_SCROLLBAR:
1198 lexrc >> full_screen_scrollbar;
1200 case RC_FULL_SCREEN_TABBAR:
1201 lexrc >> full_screen_tabbar;
1203 case RC_FULL_SCREEN_MENUBAR:
1204 lexrc >> full_screen_menubar;
1206 case RC_FULL_SCREEN_WIDTH:
1207 lexrc >> full_screen_width;
1209 case RC_OPEN_BUFFERS_IN_TABS:
1210 lexrc >> open_buffers_in_tabs;
1212 case RC_SINGLE_CLOSE_TAB_BUTTON:
1213 lexrc >> single_close_tab_button;
1215 case RC_SINGLE_INSTANCE:
1216 lexrc >> single_instance;
1217 if (run_mode == PREFERRED)
1218 run_mode = single_instance ? USE_REMOTE : NEW_INSTANCE;
1220 case RC_FORWARD_SEARCH_DVI:
1221 if (lexrc.next(true))
1222 forward_search_dvi = lexrc.getString();
1224 case RC_FORWARD_SEARCH_PDF:
1225 if (lexrc.next(true))
1226 forward_search_pdf = lexrc.getString();
1228 case RC_EXPORT_OVERWRITE:
1230 string const tmp = lexrc.getString();
1231 if (tmp == "all" || tmp == "true")
1232 export_overwrite = ALL_FILES;
1233 else if (tmp == "main")
1234 export_overwrite = MAIN_FILE;
1236 export_overwrite = NO_FILES;
1237 if (tmp != "ask" && tmp != "false")
1238 LYXERR0("Unrecognized export_overwrite status \""
1243 case RC_SCROLL_WHEEL_ZOOM:
1245 string const tmp = lexrc.getString();
1247 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_CTRL;
1248 else if (tmp == "shift")
1249 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_SHIFT;
1250 else if (tmp == "alt")
1251 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_ALT;
1253 scroll_wheel_zoom = SCROLL_WHEEL_ZOOM_OFF;
1254 if (tmp != "off" && tmp != "false")
1255 LYXERR0("Unrecognized scroll_wheel_zoom status \""
1262 break; // this is just a dummy
1265 // This is triggered the first time through the loop unless
1266 // we hit a format tag.
1267 if (check_format && format != LYXRC_FILEFORMAT)
1268 return FormatMismatch;
1271 /// Update converters data-structures
1272 theConverters().update(formats);
1273 theConverters().buildGraph();
1279 void LyXRC::write(FileName const & filename, bool ignore_system_lyxrc) const
1281 ofstream ofs(filename.toFilesystemEncoding().c_str());
1283 write(ofs, ignore_system_lyxrc);
1287 void LyXRC::print() const
1289 if (lyxerr.debugging())
1290 write(lyxerr, false);
1298 typedef pair<string, SpecialisedMover> Data;
1300 SameMover(Data const & comparison)
1301 : comparison_(comparison) {}
1303 bool operator()(Data const & data) const
1305 return data.first == comparison_.first &&
1306 data.second.command() == comparison_.second.command();
1316 // Escape \ and " so that LyXLex can read the string later
1317 string escapeCommand(string const & str) {
1318 return subst(subst(str , "\\", "\\\\"),
1325 void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) const
1327 LyXRCTags tag = RC_LAST;
1329 if (!name.empty()) {
1330 for (int i = 0; i != lyxrcCount; ++i)
1331 if ("\\" + name == lyxrcTags[i].tag)
1332 tag = static_cast<LyXRCTags>(lyxrcTags[i].code);
1336 os << "# LyX " << lyx_version
1337 << " generated this file. If you want to make your own\n"
1338 << "# modifications you should do them from inside LyX and save.\n\n"
1339 << "Format " << LYXRC_FILEFORMAT << "\n\n";
1341 // Why the switch you might ask. It is a trick to ensure that all
1342 // the elements in the LyXRCTags enum are handled. As you can see
1343 // there are no breaks at all. So it is just a huge fall-through.
1344 // The nice thing is that we will get a warning from the compiler
1345 // if we forget an element.
1349 // input/include files are not done here
1350 case RC_LYXRCFORMAT:
1352 if (ignore_system_lyxrc ||
1353 bind_file != system_lyxrc.bind_file) {
1354 string const path = os::external_path(bind_file);
1355 os << "\\bind_file \"" << path << "\"\n";
1361 if (ignore_system_lyxrc ||
1362 def_file != system_lyxrc.def_file) {
1363 string const path = os::external_path(def_file);
1364 os << "\\def_file \"" << path << "\"\n";
1373 << "# MISC SECTION ######################################\n"
1375 // bind files are not done here.
1377 case RC_PATH_PREFIX:
1378 if (ignore_system_lyxrc ||
1379 path_prefix != system_lyxrc.path_prefix) {
1380 os << "\\path_prefix \"" << path_prefix << "\"\n";
1385 if (ignore_system_lyxrc ||
1386 ui_file != system_lyxrc.ui_file) {
1387 string const path = os::external_path(ui_file);
1388 os << "\\ui_file \"" << path << "\"\n";
1392 case RC_AUTOREGIONDELETE:
1393 if (ignore_system_lyxrc ||
1394 auto_region_delete != system_lyxrc.auto_region_delete) {
1395 os << "# Set to false to inhibit automatic replacement of\n"
1396 << "# the current selection.\n"
1397 << "\\auto_region_delete " << convert<string>(auto_region_delete)
1402 case RC_AUTORESET_OPTIONS:
1403 if (ignore_system_lyxrc ||
1404 auto_reset_options != system_lyxrc.auto_reset_options) {
1405 os << "# Set to false to inhibit automatic reset of\n"
1406 << "# the class options to defaults on class change.\n"
1407 << "\\auto_reset_options "
1408 << convert<string>(auto_reset_options)
1414 if (ignore_system_lyxrc ||
1415 autosave != system_lyxrc.autosave) {
1416 os << "# The time interval between auto-saves in seconds.\n"
1417 << "\\autosave " << autosave << '\n';
1421 case RC_DISPLAY_GRAPHICS:
1422 if (ignore_system_lyxrc ||
1423 display_graphics != system_lyxrc.display_graphics) {
1424 os << "# Display graphics within LyX\n"
1426 << "\\display_graphics "
1427 << (display_graphics ? "true" : "false")
1432 case RC_SORT_LAYOUTS:
1433 if (ignore_system_lyxrc ||
1434 sort_layouts != system_lyxrc.sort_layouts) {
1435 os << "# Sort layouts alphabetically.\n"
1436 << "\\sort_layouts " << convert<string>(sort_layouts) << '\n';
1440 case RC_GROUP_LAYOUTS:
1441 if (ignore_system_lyxrc ||
1442 group_layouts != system_lyxrc.group_layouts) {
1443 os << "# Group layouts by their category.\n"
1444 << "\\group_layouts " << convert<string>(group_layouts) << '\n';
1448 case RC_VIEWDVI_PAPEROPTION:
1449 if (ignore_system_lyxrc ||
1450 view_dvi_paper_option
1451 != system_lyxrc.view_dvi_paper_option) {
1452 os << "# Options used to specify paper size to the\n"
1453 << "# view_dvi_command (e.g. -paper)\n"
1454 << "\\view_dvi_paper_option \""
1455 << view_dvi_paper_option << "\"\n";
1459 case RC_DEFAULT_PAPERSIZE:
1460 if (ignore_system_lyxrc ||
1461 default_papersize != system_lyxrc.default_papersize) {
1462 os << "# The default papersize to use.\n"
1463 << "\\default_papersize \"";
1464 switch (default_papersize) {
1466 os << "default"; break;
1467 case PAPER_USLETTER:
1468 os << "usletter"; break;
1470 os << "legal"; break;
1471 case PAPER_USEXECUTIVE:
1472 os << "executive"; break;
1505 case PAPER_JISB6: break;
1511 case RC_CHKTEX_COMMAND:
1512 if (ignore_system_lyxrc ||
1513 chktex_command != system_lyxrc.chktex_command) {
1514 os << "\\chktex_command \"" << escapeCommand(chktex_command) << "\"\n";
1518 case RC_BIBTEX_ALTERNATIVES: {
1519 CommandSet::const_iterator it = bibtex_alternatives.begin();
1520 CommandSet::const_iterator end = bibtex_alternatives.end();
1521 for ( ; it != end; ++it) {
1522 if (ignore_system_lyxrc
1523 || !system_lyxrc.bibtex_alternatives.count(*it))
1524 os << "\\bibtex_alternatives \""
1530 case RC_BIBTEX_COMMAND:
1531 if (ignore_system_lyxrc ||
1532 bibtex_command != system_lyxrc.bibtex_command) {
1533 os << "\\bibtex_command \"" << escapeCommand(bibtex_command) << "\"\n";
1537 case RC_JBIBTEX_COMMAND:
1538 if (ignore_system_lyxrc ||
1539 jbibtex_command != system_lyxrc.jbibtex_command) {
1540 os << "\\jbibtex_command \"" << escapeCommand(jbibtex_command) << "\"\n";
1544 case RC_INDEX_ALTERNATIVES: {
1545 CommandSet::const_iterator it = index_alternatives.begin();
1546 CommandSet::const_iterator end = index_alternatives.end();
1547 for ( ; it != end; ++it) {
1548 if (ignore_system_lyxrc
1549 || !system_lyxrc.index_alternatives.count(*it))
1550 os << "\\index_alternatives \""
1556 case RC_INDEX_COMMAND:
1557 if (ignore_system_lyxrc ||
1558 index_command != system_lyxrc.index_command) {
1559 os << "\\index_command \"" << escapeCommand(index_command) << "\"\n";
1563 case RC_JINDEX_COMMAND:
1564 if (ignore_system_lyxrc ||
1565 jindex_command != system_lyxrc.jindex_command) {
1566 os << "\\jindex_command \"" << escapeCommand(jindex_command) << "\"\n";
1570 case RC_SPLITINDEX_COMMAND:
1571 if (ignore_system_lyxrc ||
1572 splitindex_command != system_lyxrc.splitindex_command) {
1573 os << "\\splitindex_command \"" << escapeCommand(splitindex_command) << "\"\n";
1577 case RC_NOMENCL_COMMAND:
1578 if (ignore_system_lyxrc ||
1579 nomencl_command != system_lyxrc.nomencl_command) {
1580 os << "\\nomencl_command \"" << escapeCommand(nomencl_command) << "\"\n";
1584 case RC_TEX_EXPECTS_WINDOWS_PATHS:
1585 if (ignore_system_lyxrc ||
1586 windows_style_tex_paths != system_lyxrc.windows_style_tex_paths) {
1587 os << "\\tex_expects_windows_paths "
1588 << convert<string>(windows_style_tex_paths) << '\n';
1592 case RC_TEX_ALLOWS_SPACES:
1593 if (tex_allows_spaces != system_lyxrc.tex_allows_spaces) {
1594 os << "\\tex_allows_spaces "
1595 << convert<string>(tex_allows_spaces) << '\n';
1600 if (ignore_system_lyxrc ||
1601 use_kbmap != system_lyxrc.use_kbmap) {
1602 os << "\\kbmap " << convert<string>(use_kbmap) << '\n';
1606 case RC_KBMAP_PRIMARY:
1607 if (ignore_system_lyxrc ||
1608 primary_kbmap != system_lyxrc.primary_kbmap) {
1609 string const path = os::external_path(primary_kbmap);
1610 os << "\\kbmap_primary \"" << path << "\"\n";
1614 case RC_KBMAP_SECONDARY:
1615 if (ignore_system_lyxrc ||
1616 secondary_kbmap != system_lyxrc.secondary_kbmap) {
1617 string const path = os::external_path(secondary_kbmap);
1618 os << "\\kbmap_secondary \"" << path << "\"\n";
1623 if (ignore_system_lyxrc ||
1624 lyxpipes != system_lyxrc.lyxpipes) {
1625 string const path = os::external_path(lyxpipes);
1626 os << "\\serverpipe \"" << path << "\"\n";
1630 case RC_DATE_INSERT_FORMAT:
1631 if (ignore_system_lyxrc ||
1632 date_insert_format != system_lyxrc.date_insert_format) {
1633 os << "\\date_insert_format \"" << date_insert_format
1640 os << "\\user_name \"" << user_name << "\"\n";
1645 os << "\\user_email \"" << user_email << "\"\n";
1649 case RC_SHOW_BANNER:
1650 if (ignore_system_lyxrc ||
1651 show_banner != system_lyxrc.show_banner) {
1652 os << "\\show_banner " << convert<string>(show_banner) << '\n';
1658 if (ignore_system_lyxrc ||
1659 preview != system_lyxrc.preview) {
1665 case PREVIEW_NO_MATH:
1672 os << "\\preview " << status << '\n';
1677 case RC_PREVIEW_HASHED_LABELS:
1678 if (ignore_system_lyxrc ||
1679 preview_hashed_labels !=
1680 system_lyxrc.preview_hashed_labels) {
1681 os << "\\preview_hashed_labels "
1682 << convert<string>(preview_hashed_labels) << '\n';
1687 case RC_PREVIEW_SCALE_FACTOR:
1688 if (ignore_system_lyxrc ||
1689 preview_scale_factor != system_lyxrc.preview_scale_factor) {
1690 os << "\\preview_scale_factor "
1691 << preview_scale_factor << '\n';
1696 case RC_USE_CONVERTER_CACHE:
1697 if (ignore_system_lyxrc ||
1698 use_converter_cache != system_lyxrc.use_converter_cache) {
1699 os << "\\use_converter_cache "
1700 << convert<string>(use_converter_cache) << '\n';
1705 case RC_CONVERTER_CACHE_MAXAGE:
1706 if (ignore_system_lyxrc ||
1707 converter_cache_maxage != system_lyxrc.converter_cache_maxage) {
1708 os << "\\converter_cache_maxage "
1709 << converter_cache_maxage << '\n';
1715 << "# SCREEN & FONTS SECTION ############################\n"
1719 if (ignore_system_lyxrc ||
1720 dpi != system_lyxrc.dpi) {
1721 os << "\\screen_dpi " << dpi << '\n';
1725 case RC_SCREEN_ZOOM:
1726 if (ignore_system_lyxrc ||
1727 zoom != system_lyxrc.zoom) {
1728 os << "\\screen_zoom " << zoom << '\n';
1732 case RC_GEOMETRY_SESSION:
1733 if (ignore_system_lyxrc ||
1734 allow_geometry_session != system_lyxrc.allow_geometry_session) {
1735 os << "\\allow_geometry_session " << convert<string>(allow_geometry_session)
1740 case RC_CURSOR_FOLLOWS_SCROLLBAR:
1741 if (ignore_system_lyxrc ||
1742 cursor_follows_scrollbar
1743 != system_lyxrc.cursor_follows_scrollbar) {
1744 os << "\\cursor_follows_scrollbar "
1745 << convert<string>(cursor_follows_scrollbar) << '\n';
1749 case RC_SCROLL_BELOW_DOCUMENT:
1750 if (ignore_system_lyxrc ||
1751 scroll_below_document
1752 != system_lyxrc.scroll_below_document) {
1753 os << "\\scroll_below_document "
1754 << convert<string>(scroll_below_document) << '\n';
1758 case RC_PARAGRAPH_MARKERS:
1759 if (ignore_system_lyxrc ||
1761 != system_lyxrc.paragraph_markers) {
1762 os << "\\paragraph_markers "
1763 << convert<string>(paragraph_markers) << '\n';
1767 case RC_MAC_DONTSWAP_CTRL_META:
1768 if (ignore_system_lyxrc ||
1769 mac_dontswap_ctrl_meta
1770 != system_lyxrc.mac_dontswap_ctrl_meta) {
1771 os << "\\mac_dontswap_ctrl_meta "
1772 << convert<string>(mac_dontswap_ctrl_meta) << '\n';
1776 case RC_MAC_LIKE_WORD_MOVEMENT:
1777 if (ignore_system_lyxrc ||
1778 mac_like_word_movement
1779 != system_lyxrc.mac_like_word_movement) {
1780 os << "\\mac_like_word_movement "
1781 << convert<string>(mac_like_word_movement) << '\n';
1785 case RC_MACRO_EDIT_STYLE:
1786 if (ignore_system_lyxrc ||
1788 != system_lyxrc.macro_edit_style) {
1789 os << "\\macro_edit_style ";
1790 switch (macro_edit_style) {
1791 case MACRO_EDIT_INLINE_BOX: os << "0\n"; break;
1792 case MACRO_EDIT_INLINE: os << "1\n"; break;
1793 case MACRO_EDIT_LIST: os << "2\n"; break;
1798 case RC_DIALOGS_ICONIFY_WITH_MAIN:
1799 if (ignore_system_lyxrc ||
1800 dialogs_iconify_with_main
1801 != system_lyxrc.dialogs_iconify_with_main) {
1802 os << "\\dialogs_iconify_with_main "
1803 << convert<string>(dialogs_iconify_with_main) << '\n';
1807 case RC_SCREEN_FONT_ROMAN:
1808 if (ignore_system_lyxrc ||
1809 roman_font_name != system_lyxrc.roman_font_name) {
1810 os << "\\screen_font_roman \"" << roman_font_name
1815 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
1816 if (ignore_system_lyxrc ||
1817 roman_font_foundry != system_lyxrc.roman_font_foundry) {
1818 os << "\\screen_font_roman_foundry \"" << roman_font_foundry
1823 case RC_SCREEN_FONT_SANS:
1824 if (ignore_system_lyxrc ||
1825 sans_font_name != system_lyxrc.sans_font_name) {
1826 os << "\\screen_font_sans \"" << sans_font_name
1831 case RC_SCREEN_FONT_SANS_FOUNDRY:
1832 if (ignore_system_lyxrc ||
1833 sans_font_foundry != system_lyxrc.sans_font_foundry) {
1834 os << "\\screen_font_sans_foundry \"" << sans_font_foundry
1839 case RC_SCREEN_FONT_TYPEWRITER:
1840 if (ignore_system_lyxrc ||
1841 typewriter_font_name != system_lyxrc.typewriter_font_name) {
1842 os << "\\screen_font_typewriter \""
1843 << typewriter_font_name << "\"\n";
1847 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
1848 if (ignore_system_lyxrc ||
1849 typewriter_font_foundry != system_lyxrc.typewriter_font_foundry) {
1850 os << "\\screen_font_typewriter_foundry \""
1851 << typewriter_font_foundry << "\"\n";
1856 case RC_SCREEN_FONT_SCALABLE:
1857 if (ignore_system_lyxrc ||
1858 use_scalable_fonts != system_lyxrc.use_scalable_fonts) {
1859 os << "\\screen_font_scalable "
1860 << convert<string>(use_scalable_fonts)
1865 case RC_SCREEN_FONT_SIZES:
1866 if (ignore_system_lyxrc ||
1867 font_sizes[FONT_SIZE_TINY]
1868 != system_lyxrc.font_sizes[FONT_SIZE_TINY] ||
1869 font_sizes[FONT_SIZE_SCRIPT]
1870 != system_lyxrc.font_sizes[FONT_SIZE_SCRIPT] ||
1871 font_sizes[FONT_SIZE_FOOTNOTE]
1872 != system_lyxrc.font_sizes[FONT_SIZE_FOOTNOTE] ||
1873 font_sizes[FONT_SIZE_SMALL]
1874 != system_lyxrc.font_sizes[FONT_SIZE_SMALL] ||
1875 font_sizes[FONT_SIZE_NORMAL]
1876 != system_lyxrc.font_sizes[FONT_SIZE_NORMAL] ||
1877 font_sizes[FONT_SIZE_LARGE]
1878 != system_lyxrc.font_sizes[FONT_SIZE_LARGE] ||
1879 font_sizes[FONT_SIZE_LARGER]
1880 != system_lyxrc.font_sizes[FONT_SIZE_LARGER] ||
1881 font_sizes[FONT_SIZE_LARGEST]
1882 != system_lyxrc.font_sizes[FONT_SIZE_LARGEST] ||
1883 font_sizes[FONT_SIZE_HUGE]
1884 != system_lyxrc.font_sizes[FONT_SIZE_HUGE] ||
1885 font_sizes[FONT_SIZE_HUGER]
1886 != system_lyxrc.font_sizes[FONT_SIZE_HUGER]) {
1887 os.setf(ios::fixed);
1889 os << "\\screen_font_sizes"
1890 << ' ' << font_sizes[FONT_SIZE_TINY]
1891 << ' ' << font_sizes[FONT_SIZE_SCRIPT]
1892 << ' ' << font_sizes[FONT_SIZE_FOOTNOTE]
1893 << ' ' << font_sizes[FONT_SIZE_SMALL]
1894 << ' ' << font_sizes[FONT_SIZE_NORMAL]
1895 << ' ' << font_sizes[FONT_SIZE_LARGE]
1896 << ' ' << font_sizes[FONT_SIZE_LARGER]
1897 << ' ' << font_sizes[FONT_SIZE_LARGEST]
1898 << ' ' << font_sizes[FONT_SIZE_HUGE]
1899 << ' ' << font_sizes[FONT_SIZE_HUGER]
1904 case RC_FULL_SCREEN_LIMIT:
1905 if (ignore_system_lyxrc ||
1906 full_screen_limit != system_lyxrc.full_screen_limit) {
1907 os << "\\fullscreen_limit "
1908 << convert<string>(full_screen_limit)
1913 case RC_FULL_SCREEN_TOOLBARS:
1914 if (ignore_system_lyxrc ||
1915 full_screen_toolbars != system_lyxrc.full_screen_toolbars) {
1916 os << "\\fullscreen_toolbars "
1917 << convert<string>(full_screen_toolbars)
1922 case RC_FULL_SCREEN_SCROLLBAR:
1923 if (ignore_system_lyxrc ||
1924 full_screen_scrollbar != system_lyxrc.full_screen_scrollbar) {
1925 os << "\\fullscreen_scrollbar "
1926 << convert<string>(full_screen_scrollbar)
1931 case RC_FULL_SCREEN_TABBAR:
1932 if (ignore_system_lyxrc ||
1933 full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
1934 os << "\\fullscreen_tabbar "
1935 << convert<string>(full_screen_tabbar)
1940 case RC_FULL_SCREEN_MENUBAR:
1941 if (ignore_system_lyxrc ||
1942 full_screen_menubar != system_lyxrc.full_screen_menubar) {
1943 os << "\\fullscreen_menubar "
1944 << convert<string>(full_screen_menubar)
1949 case RC_FULL_SCREEN_WIDTH:
1950 if (ignore_system_lyxrc ||
1951 full_screen_width != system_lyxrc.full_screen_width) {
1952 os << "\\fullscreen_width "
1953 << convert<string>(full_screen_width)
1958 case RC_OPEN_BUFFERS_IN_TABS:
1959 if (ignore_system_lyxrc ||
1960 open_buffers_in_tabs != system_lyxrc.open_buffers_in_tabs) {
1961 os << "\\open_buffers_in_tabs "
1962 << convert<string>(open_buffers_in_tabs)
1967 case RC_SINGLE_CLOSE_TAB_BUTTON:
1968 if (ignore_system_lyxrc ||
1969 single_close_tab_button != system_lyxrc.single_close_tab_button) {
1970 os << "\\single_close_tab_button "
1971 << convert<string>(single_close_tab_button)
1976 case RC_SINGLE_INSTANCE:
1977 if (ignore_system_lyxrc ||
1978 single_instance != system_lyxrc.single_instance) {
1979 os << "\\single_instance "
1980 << convert<string>(single_instance)
1985 case RC_FORWARD_SEARCH_DVI:
1986 if (ignore_system_lyxrc ||
1987 forward_search_dvi != system_lyxrc.forward_search_dvi) {
1988 os << "\\forward_search_dvi \"" << escapeCommand(forward_search_dvi) << "\"\n";
1992 case RC_FORWARD_SEARCH_PDF:
1993 if (ignore_system_lyxrc ||
1994 forward_search_pdf != system_lyxrc.forward_search_pdf) {
1995 os << "\\forward_search_pdf \"" << escapeCommand(forward_search_pdf) << "\"\n";
2001 << "# COLOR SECTION ###################################\n"
2005 for (int i = 0; i < Color_ignore; ++i) {
2006 ColorCode lc = static_cast<ColorCode>(i);
2007 string const col = lcolor.getX11Name(lc);
2008 if (ignore_system_lyxrc
2009 || col != system_lcolor.getX11Name(lc)) {
2010 os << "\\set_color \""
2011 << lcolor.getLyXName(lc) << "\" \""
2019 << "# PRINTER SECTION ###################################\n"
2023 if (ignore_system_lyxrc ||
2024 printer != system_lyxrc.printer) {
2025 os << "\\printer \"" << printer << "\"\n";
2029 case RC_PRINT_ADAPTOUTPUT:
2030 if (ignore_system_lyxrc ||
2031 print_adapt_output != system_lyxrc.print_adapt_output) {
2032 os << "\\print_adapt_output "
2033 << convert<string>(print_adapt_output)
2038 case RC_PRINT_COMMAND:
2039 if (ignore_system_lyxrc ||
2040 print_command != system_lyxrc.print_command) {
2041 os << "\\print_command \"" << escapeCommand(print_command) << "\"\n";
2045 case RC_PRINTEXSTRAOPTIONS:
2046 if (ignore_system_lyxrc ||
2047 print_extra_options != system_lyxrc.print_extra_options) {
2048 os << "\\print_extra_options \"" << print_extra_options
2053 case RC_PRINTSPOOL_COMMAND:
2054 if (ignore_system_lyxrc ||
2055 print_spool_command != system_lyxrc.print_spool_command) {
2056 os << "\\print_spool_command \"" << escapeCommand(print_spool_command)
2061 case RC_PRINTSPOOL_PRINTERPREFIX:
2062 if (ignore_system_lyxrc ||
2063 print_spool_printerprefix
2064 != system_lyxrc.print_spool_printerprefix) {
2065 os << "\\print_spool_printerprefix \""
2066 << print_spool_printerprefix << "\"\n";
2070 case RC_PRINTEVENPAGEFLAG:
2071 if (ignore_system_lyxrc ||
2072 print_evenpage_flag != system_lyxrc.print_evenpage_flag) {
2073 os << "\\print_evenpage_flag \"" << print_evenpage_flag
2078 case RC_PRINTODDPAGEFLAG:
2079 if (ignore_system_lyxrc ||
2080 print_oddpage_flag != system_lyxrc.print_oddpage_flag) {
2081 os << "\\print_oddpage_flag \"" << print_oddpage_flag
2086 case RC_PRINTREVERSEFLAG:
2087 if (ignore_system_lyxrc ||
2088 print_reverse_flag != system_lyxrc.print_reverse_flag) {
2089 os << "\\print_reverse_flag \"" << print_reverse_flag
2094 case RC_PRINTLANDSCAPEFLAG:
2095 if (ignore_system_lyxrc ||
2096 print_landscape_flag != system_lyxrc.print_landscape_flag) {
2097 os << "\\print_landscape_flag \"" << print_landscape_flag
2102 case RC_PRINTPAGERANGEFLAG:
2103 if (ignore_system_lyxrc ||
2104 print_pagerange_flag != system_lyxrc.print_pagerange_flag) {
2105 os << "\\print_pagerange_flag \"" << print_pagerange_flag
2110 case RC_PRINTCOPIESFLAG:
2111 if (ignore_system_lyxrc ||
2112 print_copies_flag != system_lyxrc.print_copies_flag) {
2113 os << "\\print_copies_flag \"" << print_copies_flag
2118 case RC_PRINTCOLLCOPIESFLAG:
2119 if (ignore_system_lyxrc ||
2120 print_collcopies_flag
2121 != system_lyxrc.print_collcopies_flag) {
2122 os << "\\print_collcopies_flag \""
2123 << print_collcopies_flag
2128 case RC_PRINTPAPERFLAG:
2129 if (ignore_system_lyxrc ||
2130 print_paper_flag != system_lyxrc.print_paper_flag) {
2131 os << "\\print_paper_flag \"" << print_paper_flag
2136 case RC_PRINTPAPERDIMENSIONFLAG:
2137 if (ignore_system_lyxrc ||
2138 print_paper_dimension_flag
2139 != system_lyxrc.print_paper_dimension_flag) {
2140 os << "\\print_paper_dimension_flag \""
2141 << print_paper_dimension_flag << "\"\n";
2145 case RC_PRINTTOPRINTER:
2146 if (ignore_system_lyxrc ||
2147 print_to_printer != system_lyxrc.print_to_printer) {
2148 os << "\\print_to_printer \"" << print_to_printer
2153 case RC_PRINTTOFILE:
2154 if (ignore_system_lyxrc ||
2155 print_to_file != system_lyxrc.print_to_file) {
2156 string const path = os::external_path(print_to_file);
2157 os << "\\print_to_file \"" << path << "\"\n";
2161 case RC_PRINTFILEEXTENSION:
2162 if (ignore_system_lyxrc ||
2163 print_file_extension != system_lyxrc.print_file_extension) {
2164 os << "\\print_file_extension \""
2165 << print_file_extension
2172 << "# TEX SECTION #######################################\n"
2175 case RC_FONT_ENCODING:
2176 if (ignore_system_lyxrc ||
2177 fontenc != system_lyxrc.fontenc) {
2178 os << "\\font_encoding \"" << fontenc << "\"\n";
2184 << "# FILE SECTION ######################################\n"
2187 case RC_DOCUMENTPATH:
2188 if (ignore_system_lyxrc ||
2189 document_path != system_lyxrc.document_path) {
2190 string const path = os::external_path(document_path);
2191 os << "\\document_path \"" << path << "\"\n";
2195 case RC_USELASTFILEPOS:
2196 if (ignore_system_lyxrc ||
2197 use_lastfilepos != system_lyxrc.use_lastfilepos) {
2198 os << "\\use_lastfilepos " << convert<string>(use_lastfilepos)
2203 case RC_LOADSESSION:
2204 if (ignore_system_lyxrc ||
2205 load_session != system_lyxrc.load_session) {
2206 os << "\\load_session " << convert<string>(load_session)
2211 case RC_MOUSE_WHEEL_SPEED:
2212 if (ignore_system_lyxrc ||
2213 mouse_wheel_speed != system_lyxrc.mouse_wheel_speed) {
2214 os << "\\mouse_wheel_speed " << mouse_wheel_speed << '\n';
2218 case RC_COMPLETION_INLINE_DELAY:
2219 if (ignore_system_lyxrc ||
2220 completion_inline_delay != system_lyxrc.completion_inline_delay) {
2221 os << "\\completion_inline_delay " << completion_inline_delay << '\n';
2225 case RC_COMPLETION_INLINE_MATH:
2226 if (ignore_system_lyxrc ||
2227 completion_inline_math != system_lyxrc.completion_inline_math) {
2228 os << "\\completion_inline_math "
2229 << convert<string>(completion_inline_math) << '\n';
2233 case RC_COMPLETION_INLINE_TEXT:
2234 if (ignore_system_lyxrc ||
2235 completion_inline_text != system_lyxrc.completion_inline_text) {
2236 os << "\\completion_inline_text "
2237 << convert<string>(completion_inline_text) << '\n';
2241 case RC_COMPLETION_INLINE_DOTS:
2242 if (ignore_system_lyxrc ||
2243 completion_inline_dots != system_lyxrc.completion_inline_dots) {
2244 os << "\\completion_inline_dots "
2245 << convert<string>(completion_inline_dots) << '\n';
2249 case RC_AUTOCORRECTION_MATH:
2250 if (ignore_system_lyxrc ||
2251 autocorrection_math != system_lyxrc.autocorrection_math) {
2252 os << "\\autocorrection_math "
2253 << convert<string>(autocorrection_math) << '\n';
2257 case RC_COMPLETION_POPUP_DELAY:
2258 if (ignore_system_lyxrc ||
2259 completion_popup_delay != system_lyxrc.completion_popup_delay) {
2260 os << "\\completion_popup_delay " << completion_popup_delay << '\n';
2264 case RC_COMPLETION_POPUP_MATH:
2265 if (ignore_system_lyxrc ||
2266 completion_popup_math != system_lyxrc.completion_popup_math) {
2267 os << "\\completion_popup_math "
2268 << convert<string>(completion_popup_math) << '\n';
2272 case RC_COMPLETION_POPUP_TEXT:
2273 if (ignore_system_lyxrc ||
2274 completion_popup_text != system_lyxrc.completion_popup_text) {
2275 os << "\\completion_popup_text "
2276 << convert<string>(completion_popup_text) << '\n';
2280 case RC_COMPLETION_CURSOR_TEXT:
2281 if (ignore_system_lyxrc ||
2282 completion_cursor_text != system_lyxrc.completion_cursor_text) {
2283 os << "\\completion_cursor_text "
2284 << convert<string>(completion_cursor_text) << '\n';
2288 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
2289 if (ignore_system_lyxrc ||
2290 completion_popup_after_complete
2291 != system_lyxrc.completion_popup_after_complete) {
2292 os << "\\completion_popup_after_complete "
2293 << convert<string>(completion_popup_after_complete) << '\n';
2297 case RC_NUMLASTFILES:
2298 if (ignore_system_lyxrc ||
2299 num_lastfiles != system_lyxrc.num_lastfiles) {
2300 os << "\\num_lastfiles " << num_lastfiles << '\n';
2304 case RC_CHECKLASTFILES:
2305 if (ignore_system_lyxrc ||
2306 check_lastfiles != system_lyxrc.check_lastfiles) {
2307 os << "\\check_lastfiles " << convert<string>(check_lastfiles)
2312 case RC_EXAMPLEPATH:
2313 if (ignore_system_lyxrc ||
2314 example_path != system_lyxrc.example_path) {
2315 string const path = os::external_path(example_path);
2316 os << "\\example_path \"" << path << "\"\n";
2320 case RC_TEMPLATEPATH:
2321 if (ignore_system_lyxrc ||
2322 template_path != system_lyxrc.template_path) {
2323 string const path = os::external_path(template_path);
2324 os << "\\template_path \"" << path << "\"\n";
2328 case RC_TEMPDIRPATH:
2329 if (ignore_system_lyxrc ||
2330 tempdir_path != system_lyxrc.tempdir_path) {
2331 string const path = os::external_path(tempdir_path);
2332 os << "\\tempdir_path \"" << path << "\"\n";
2336 case RC_THESAURUSDIRPATH:
2337 if (ignore_system_lyxrc ||
2338 thesaurusdir_path != system_lyxrc.thesaurusdir_path) {
2339 string const path = os::external_path(thesaurusdir_path);
2340 os << "\\thesaurusdir_path \"" << path << "\"\n";
2344 case RC_HUNSPELLDIR_PATH:
2345 if (ignore_system_lyxrc ||
2346 hunspelldir_path != system_lyxrc.hunspelldir_path) {
2347 string const path = os::external_path(hunspelldir_path);
2348 os << "\\hunspelldir_path \"" << path << "\"\n";
2352 case RC_PLAINTEXT_LINELEN:
2353 if (ignore_system_lyxrc ||
2354 plaintext_linelen != system_lyxrc.plaintext_linelen) {
2355 os << "\\plaintext_linelen " << plaintext_linelen << '\n';
2359 case RC_MAKE_BACKUP:
2360 if (ignore_system_lyxrc ||
2361 make_backup != system_lyxrc.make_backup) {
2362 os << "\\make_backup " << convert<string>(make_backup) << '\n';
2366 case RC_SAVE_COMPRESSED:
2367 if (ignore_system_lyxrc ||
2368 save_compressed != system_lyxrc.save_compressed) {
2369 os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
2373 case RC_BACKUPDIR_PATH:
2374 if (ignore_system_lyxrc ||
2375 backupdir_path != system_lyxrc.backupdir_path) {
2376 string const path = os::external_path(backupdir_path);
2377 os << "\\backupdir_path \"" << path << "\"\n";
2383 << "# PLAIN TEXT EXPORT SECTION ##############################\n"
2387 << "# SPELLCHECKER SECTION ##############################\n"
2390 case RC_ACCEPT_COMPOUND:
2391 if (ignore_system_lyxrc ||
2392 spellchecker_accept_compound != system_lyxrc.spellchecker_accept_compound) {
2393 os << "\\accept_compound " << convert<string>(spellchecker_accept_compound)
2399 if (ignore_system_lyxrc ||
2400 spellchecker_alt_lang != system_lyxrc.spellchecker_alt_lang) {
2401 os << "\\alternate_language \"" << spellchecker_alt_lang
2407 if (ignore_system_lyxrc ||
2408 spellchecker_esc_chars != system_lyxrc.spellchecker_esc_chars) {
2409 os << "\\escape_chars \"" << spellchecker_esc_chars << "\"\n";
2413 case RC_USE_SYSTEM_COLORS:
2414 if (ignore_system_lyxrc ||
2415 use_system_colors != system_lyxrc.use_system_colors) {
2416 os << "\\use_system_colors "
2417 << convert<string>(use_system_colors)
2422 case RC_USE_TOOLTIP:
2423 if (ignore_system_lyxrc ||
2424 use_tooltip != system_lyxrc.use_tooltip) {
2425 os << "\\use_tooltip "
2426 << convert<string>(use_tooltip)
2431 case RC_USE_PIXMAP_CACHE:
2432 if (ignore_system_lyxrc ||
2433 use_pixmap_cache != system_lyxrc.use_pixmap_cache) {
2434 os << "\\use_pixmap_cache "
2435 << convert<string>(use_pixmap_cache)
2442 << "# LANGUAGE SUPPORT SECTION ##########################\n"
2447 case RC_DEFAULT_DECIMAL_POINT:
2448 if (ignore_system_lyxrc ||
2449 default_decimal_point != system_lyxrc.default_decimal_point) {
2450 os << "\\default_decimal_point " << default_decimal_point << '\n';
2455 case RC_SPELLCHECKER:
2456 if (ignore_system_lyxrc ||
2457 spellchecker != system_lyxrc.spellchecker) {
2458 os << "\\spellchecker " << spellchecker << '\n';
2463 case RC_SPELLCHECK_CONTINUOUSLY:
2464 if (ignore_system_lyxrc ||
2465 spellcheck_continuously != system_lyxrc.spellcheck_continuously) {
2466 os << "\\spellcheck_continuously " << convert<string>(spellcheck_continuously)
2472 case RC_SPELLCHECK_NOTES:
2473 if (ignore_system_lyxrc ||
2474 spellcheck_notes != system_lyxrc.spellcheck_notes) {
2475 os << "\\spellcheck_notes " << convert<string>(spellcheck_notes)
2481 case RC_RTL_SUPPORT:
2482 if (ignore_system_lyxrc ||
2483 rtl_support != system_lyxrc.rtl_support) {
2484 os << "\\rtl " << convert<string>(rtl_support) << '\n';
2488 case RC_VISUAL_CURSOR:
2489 if (ignore_system_lyxrc ||
2490 visual_cursor != system_lyxrc.visual_cursor) {
2491 os << "\\visual_cursor " << convert<string>(visual_cursor) << '\n';
2495 case RC_LANGUAGE_CUSTOM_PACKAGE:
2496 if (ignore_system_lyxrc ||
2497 language_custom_package != system_lyxrc.language_custom_package) {
2498 os << "\\language_custom_package \"" << language_custom_package
2503 case RC_LANGUAGE_GLOBAL_OPTIONS:
2504 if (ignore_system_lyxrc ||
2505 language_global_options
2506 != system_lyxrc.language_global_options) {
2507 os << "\\language_global_options \""
2508 << convert<string>(language_global_options)
2513 case RC_LANGUAGE_PACKAGE_SELECTION:
2514 if (ignore_system_lyxrc ||
2515 language_package_selection != system_lyxrc.language_package_selection) {
2516 os << "\\language_package_selection ";
2517 switch (language_package_selection) {
2534 case RC_LANGUAGE_COMMAND_BEGIN:
2535 if (ignore_system_lyxrc ||
2536 language_command_begin
2537 != system_lyxrc.language_command_begin) {
2538 os << "\\language_command_begin \""
2539 << language_command_begin
2544 case RC_LANGUAGE_COMMAND_END:
2545 if (ignore_system_lyxrc ||
2546 language_command_end
2547 != system_lyxrc.language_command_end) {
2548 os << "\\language_command_end \"" << language_command_end
2553 case RC_LANGUAGE_COMMAND_LOCAL:
2554 if (ignore_system_lyxrc ||
2555 language_command_local
2556 != system_lyxrc.language_command_local) {
2557 os << "\\language_command_local \""
2558 << language_command_local
2563 case RC_LANGUAGE_AUTO_BEGIN:
2564 if (ignore_system_lyxrc ||
2565 language_auto_begin != system_lyxrc.language_auto_begin) {
2566 os << "\\language_auto_begin "
2567 << convert<string>(language_auto_begin) << '\n';
2571 case RC_LANGUAGE_AUTO_END:
2572 if (ignore_system_lyxrc ||
2573 language_auto_end != system_lyxrc.language_auto_end) {
2574 os << "\\language_auto_end "
2575 << convert<string>(language_auto_end) << '\n';
2579 case RC_MARK_FOREIGN_LANGUAGE:
2580 if (ignore_system_lyxrc ||
2581 mark_foreign_language
2582 != system_lyxrc.mark_foreign_language) {
2583 os << "\\mark_foreign_language " <<
2584 convert<string>(mark_foreign_language) << '\n';
2590 << "# 2nd MISC SUPPORT SECTION ##########################\n"
2593 case RC_AUTO_NUMBER:
2594 if (ignore_system_lyxrc ||
2595 auto_number != system_lyxrc.auto_number) {
2596 os << "\\auto_number " << convert<string>(auto_number) << '\n';
2600 case RC_DEFAULT_LANGUAGE:
2601 if (ignore_system_lyxrc ||
2602 default_language != system_lyxrc.default_language) {
2603 os << "\\default_language " << default_language << '\n';
2607 case RC_GUI_LANGUAGE:
2608 if (ignore_system_lyxrc ||
2609 gui_language != system_lyxrc.gui_language) {
2610 os << "\\gui_language " << gui_language << '\n';
2614 case RC_EXPORT_OVERWRITE:
2615 if (ignore_system_lyxrc ||
2616 export_overwrite != system_lyxrc.export_overwrite) {
2618 switch (export_overwrite) {
2629 os << "\\export_overwrite " << status << '\n';
2634 case RC_SCROLL_WHEEL_ZOOM:
2635 if (ignore_system_lyxrc ||
2636 scroll_wheel_zoom != system_lyxrc.scroll_wheel_zoom) {
2638 switch (scroll_wheel_zoom) {
2639 case SCROLL_WHEEL_ZOOM_OFF:
2642 case SCROLL_WHEEL_ZOOM_CTRL:
2645 case SCROLL_WHEEL_ZOOM_SHIFT:
2648 case SCROLL_WHEEL_ZOOM_ALT:
2652 os << "\\scroll_wheel_zoom " << status << '\n';
2658 << "# FORMATS SECTION ##########################\n"
2662 // New/modified formats
2663 for (Formats::const_iterator cit = formats.begin();
2664 cit != formats.end(); ++cit) {
2665 Format const * format =
2666 system_formats.getFormat(cit->name());
2668 format->extension() != cit->extension() ||
2669 format->prettyname() != cit->prettyname() ||
2670 format->shortcut() != cit->shortcut() ||
2671 format->viewer() != cit->viewer() ||
2672 format->editor() != cit->editor() ||
2673 format->documentFormat() != cit->documentFormat() ||
2674 format->vectorFormat() != cit->vectorFormat()) {
2675 os << "\\format \"" << cit->name() << "\" \""
2676 << cit->extension() << "\" \""
2677 << cit->prettyname() << "\" \""
2678 << cit->shortcut() << "\" \""
2679 << escapeCommand(cit->viewer()) << "\" \""
2680 << escapeCommand(cit->editor()) << "\" \"";
2681 vector<string> flags;
2682 if (cit->documentFormat())
2683 flags.push_back("document");
2684 if (cit->vectorFormat())
2685 flags.push_back("vector");
2686 os << getStringFromVector(flags);
2691 // Look for deleted formats
2692 for (Formats::const_iterator cit = system_formats.begin();
2693 cit != system_formats.end(); ++cit)
2694 if (!formats.getFormat(cit->name()))
2695 os << "\\format \"" << cit->name()
2696 << "\" \"\" \"\" \"\" \"\" \"\" \"\"\n";
2699 case RC_VIEWER_ALTERNATIVES: {
2700 Alternatives::const_iterator it = viewer_alternatives.begin();
2701 Alternatives::const_iterator const en = viewer_alternatives.end();
2702 Alternatives::const_iterator const sysend =
2703 system_lyxrc.viewer_alternatives.end();
2704 for (; it != en; ++it) {
2705 string const & fmt = it->first;
2706 CommandSet const & cmd = it->second;
2707 CommandSet::const_iterator sit = cmd.begin();
2708 CommandSet::const_iterator const sen = cmd.end();
2709 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2710 system_lyxrc.viewer_alternatives.begin() : // we won't use it in this case
2711 system_lyxrc.viewer_alternatives.find(fmt);
2712 for (; sit != sen; ++sit) {
2713 string const & cmd = *sit;
2714 if (ignore_system_lyxrc
2715 || sysfmt == sysend // format not found
2716 || sysfmt->second.count(cmd) == 0 // this command not found
2718 os << "\\viewer_alternatives " << fmt << " " << cmd << "\n";
2724 case RC_EDITOR_ALTERNATIVES: {
2725 Alternatives::const_iterator it = editor_alternatives.begin();
2726 Alternatives::const_iterator const en = editor_alternatives.end();
2727 Alternatives::const_iterator const sysend =
2728 system_lyxrc.editor_alternatives.end();
2729 for (; it != en; ++it) {
2730 string const & fmt = it->first;
2731 CommandSet const & cmd = it->second;
2732 CommandSet::const_iterator sit = cmd.begin();
2733 CommandSet::const_iterator const sen = cmd.end();
2734 Alternatives::const_iterator const sysfmt = ignore_system_lyxrc ?
2735 system_lyxrc.editor_alternatives.begin() : // we won't use it in this case
2736 system_lyxrc.editor_alternatives.find(fmt);
2737 for (; sit != sen; ++sit) {
2738 string const & cmd = *sit;
2739 if (ignore_system_lyxrc
2740 || sysfmt == sysend // format not found
2741 || sysfmt->second.count(cmd) == 0 // this command not found
2743 os << "\\editor_alternatives " << fmt << " " << cmd << "\n";
2749 case RC_DEFAULT_VIEW_FORMAT:
2750 if (ignore_system_lyxrc ||
2751 default_view_format != system_lyxrc.default_view_format) {
2752 os << "\\default_view_format " << default_view_format << '\n';
2762 << "# CONVERTERS SECTION ##########################\n"
2766 // Look for new converters
2767 for (Converters::const_iterator cit = theConverters().begin();
2768 cit != theConverters().end(); ++cit) {
2769 Converter const * converter =
2770 theSystemConverters().getConverter(cit->from,
2773 converter->command != cit->command ||
2774 converter->flags != cit->flags)
2775 os << "\\converter \"" << cit->from << "\" \""
2776 << cit->to << "\" \""
2777 << escapeCommand(cit->command) << "\" \""
2778 << cit->flags << "\"\n";
2781 // New/modifed converters
2782 for (Converters::const_iterator cit = theSystemConverters().begin();
2783 cit != theSystemConverters().end(); ++cit)
2784 if (!theConverters().getConverter(cit->from, cit->to))
2785 os << "\\converter \"" << cit->from
2786 << "\" \"" << cit->to << "\" \"\" \"\"\n";
2793 << "# COPIERS SECTION ##########################\n"
2796 // Look for new movers
2797 Movers::const_iterator const sysbegin = theSystemMovers().begin();
2798 Movers::const_iterator const sysend = theSystemMovers().end();
2799 Movers::const_iterator it = theMovers().begin();
2800 Movers::const_iterator end = theMovers().end();
2802 for (; it != end; ++it) {
2803 Movers::const_iterator const sysit =
2804 find_if(sysbegin, sysend, SameMover(*it));
2805 if (sysit == sysend) {
2806 string const & fmt = it->first;
2807 string const & command =
2808 it->second.command();
2810 os << "\\copier " << fmt
2811 << " \"" << escapeCommand(command) << "\"\n";
2817 // We don't actually delete SpecialisedMover(s) from the
2818 // map, just clear their 'command', so there's no need
2819 // to test for anything else.
2826 void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
2828 // Why the switch you might ask. It is a trick to ensure that all
2829 // the elements in the LyXRCTags enum is handled. As you can see
2830 // there are no breaks at all. So it is just a huge fall-through.
2831 // The nice thing is that we will get a warning from the compiler
2832 // if we forget an element.
2833 LyXRC::LyXRCTags tag = LyXRC::RC_LAST;
2835 case LyXRC::RC_ACCEPT_COMPOUND:
2836 case LyXRC::RC_ALT_LANG:
2837 case LyXRC::RC_PLAINTEXT_LINELEN:
2838 case LyXRC::RC_AUTOCORRECTION_MATH:
2839 case LyXRC::RC_AUTOREGIONDELETE:
2840 case LyXRC::RC_AUTORESET_OPTIONS:
2841 case LyXRC::RC_AUTOSAVE:
2842 case LyXRC::RC_AUTO_NUMBER:
2843 case LyXRC::RC_BACKUPDIR_PATH:
2844 case LyXRC::RC_BIBTEX_ALTERNATIVES:
2845 case LyXRC::RC_BIBTEX_COMMAND:
2846 case LyXRC::RC_BINDFILE:
2847 case LyXRC::RC_CHECKLASTFILES:
2848 case LyXRC::RC_COMPLETION_CURSOR_TEXT:
2849 case LyXRC::RC_COMPLETION_INLINE_DELAY:
2850 case LyXRC::RC_COMPLETION_INLINE_DOTS:
2851 case LyXRC::RC_COMPLETION_INLINE_MATH:
2852 case LyXRC::RC_COMPLETION_INLINE_TEXT:
2853 case LyXRC::RC_COMPLETION_POPUP_AFTER_COMPLETE:
2854 case LyXRC::RC_COMPLETION_POPUP_DELAY:
2855 case LyXRC::RC_COMPLETION_POPUP_MATH:
2856 case LyXRC::RC_COMPLETION_POPUP_TEXT:
2857 case LyXRC::RC_USELASTFILEPOS:
2858 case LyXRC::RC_LOADSESSION:
2859 case LyXRC::RC_CHKTEX_COMMAND:
2860 case LyXRC::RC_CONVERTER:
2861 case LyXRC::RC_CONVERTER_CACHE_MAXAGE:
2862 case LyXRC::RC_COPIER:
2863 case LyXRC::RC_CURSOR_FOLLOWS_SCROLLBAR:
2864 case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
2865 case LyXRC::RC_DATE_INSERT_FORMAT:
2866 case LyXRC::RC_DEFAULT_LANGUAGE:
2867 case LyXRC::RC_GUI_LANGUAGE:
2868 case LyXRC::RC_DEFAULT_PAPERSIZE:
2869 case LyXRC::RC_DEFAULT_VIEW_FORMAT:
2870 case LyXRC::RC_DEFFILE:
2871 case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
2872 case LyXRC::RC_DISPLAY_GRAPHICS:
2873 case LyXRC::RC_DOCUMENTPATH:
2874 if (lyxrc_orig.document_path != lyxrc_new.document_path) {
2875 FileName path(lyxrc_new.document_path);
2876 if (path.exists() && path.isDirectory())
2877 package().document_dir() = FileName(lyxrc.document_path);
2879 case LyXRC::RC_EDITOR_ALTERNATIVES:
2880 case LyXRC::RC_ESC_CHARS:
2881 case LyXRC::RC_EXAMPLEPATH:
2882 case LyXRC::RC_FONT_ENCODING:
2883 case LyXRC::RC_FILEFORMAT:
2884 case LyXRC::RC_GROUP_LAYOUTS:
2885 case LyXRC::RC_HUNSPELLDIR_PATH:
2886 case LyXRC::RC_INDEX_ALTERNATIVES:
2887 case LyXRC::RC_INDEX_COMMAND:
2888 case LyXRC::RC_JBIBTEX_COMMAND:
2889 case LyXRC::RC_JINDEX_COMMAND:
2890 case LyXRC::RC_NOMENCL_COMMAND:
2891 case LyXRC::RC_INPUT:
2892 case LyXRC::RC_KBMAP:
2893 case LyXRC::RC_KBMAP_PRIMARY:
2894 case LyXRC::RC_KBMAP_SECONDARY:
2895 case LyXRC::RC_LANGUAGE_AUTO_BEGIN:
2896 case LyXRC::RC_LANGUAGE_AUTO_END:
2897 case LyXRC::RC_LANGUAGE_COMMAND_BEGIN:
2898 case LyXRC::RC_LANGUAGE_COMMAND_END:
2899 case LyXRC::RC_LANGUAGE_COMMAND_LOCAL:
2900 case LyXRC::RC_LANGUAGE_GLOBAL_OPTIONS:
2901 case LyXRC::RC_LANGUAGE_CUSTOM_PACKAGE:
2902 case LyXRC::RC_LANGUAGE_PACKAGE_SELECTION:
2903 case LyXRC::RC_LYXRCFORMAT:
2904 case LyXRC::RC_MAC_DONTSWAP_CTRL_META:
2905 case LyXRC::RC_MAC_LIKE_WORD_MOVEMENT:
2906 case LyXRC::RC_MACRO_EDIT_STYLE:
2907 case LyXRC::RC_MAKE_BACKUP:
2908 case LyXRC::RC_MARK_FOREIGN_LANGUAGE:
2909 case LyXRC::RC_MOUSE_WHEEL_SPEED:
2910 case LyXRC::RC_NUMLASTFILES:
2911 case LyXRC::RC_PARAGRAPH_MARKERS:
2912 case LyXRC::RC_PATH_PREFIX:
2913 if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
2914 prependEnvPath("PATH", lyxrc.path_prefix);
2916 case LyXRC::RC_PREVIEW:
2917 case LyXRC::RC_PREVIEW_HASHED_LABELS:
2918 case LyXRC::RC_PREVIEW_SCALE_FACTOR:
2919 case LyXRC::RC_PRINTCOLLCOPIESFLAG:
2920 case LyXRC::RC_PRINTCOPIESFLAG:
2921 case LyXRC::RC_PRINTER:
2922 case LyXRC::RC_PRINTEVENPAGEFLAG:
2923 case LyXRC::RC_PRINTEXSTRAOPTIONS:
2924 case LyXRC::RC_PRINTFILEEXTENSION:
2925 case LyXRC::RC_PRINTLANDSCAPEFLAG:
2926 case LyXRC::RC_PRINTODDPAGEFLAG:
2927 case LyXRC::RC_PRINTPAGERANGEFLAG:
2928 case LyXRC::RC_PRINTPAPERDIMENSIONFLAG:
2929 case LyXRC::RC_PRINTPAPERFLAG:
2930 case LyXRC::RC_PRINTREVERSEFLAG:
2931 case LyXRC::RC_PRINTSPOOL_COMMAND:
2932 case LyXRC::RC_PRINTSPOOL_PRINTERPREFIX:
2933 case LyXRC::RC_PRINTTOFILE:
2934 case LyXRC::RC_PRINTTOPRINTER:
2935 case LyXRC::RC_PRINT_ADAPTOUTPUT:
2936 case LyXRC::RC_PRINT_COMMAND:
2937 case LyXRC::RC_RTL_SUPPORT:
2938 case LyXRC::RC_SAVE_COMPRESSED:
2939 case LyXRC::RC_SCREEN_DPI:
2940 case LyXRC::RC_SCREEN_FONT_ROMAN:
2941 case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
2942 case LyXRC::RC_SCREEN_FONT_SANS:
2943 case LyXRC::RC_SCREEN_FONT_SANS_FOUNDRY:
2944 case LyXRC::RC_SCREEN_FONT_SCALABLE:
2945 case LyXRC::RC_SCREEN_FONT_SIZES:
2946 case LyXRC::RC_SCREEN_FONT_TYPEWRITER:
2947 case LyXRC::RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
2948 case LyXRC::RC_GEOMETRY_SESSION:
2949 case LyXRC::RC_SCREEN_ZOOM:
2950 case LyXRC::RC_SERVERPIPE:
2951 case LyXRC::RC_SET_COLOR:
2952 case LyXRC::RC_SHOW_BANNER:
2953 case LyXRC::RC_OPEN_BUFFERS_IN_TABS:
2954 case LyXRC::RC_SPELLCHECKER:
2955 case LyXRC::RC_SPELLCHECK_CONTINUOUSLY:
2956 case LyXRC::RC_SPELLCHECK_NOTES:
2957 case LyXRC::RC_SPLITINDEX_COMMAND:
2958 case LyXRC::RC_TEMPDIRPATH:
2959 case LyXRC::RC_TEMPLATEPATH:
2960 case LyXRC::RC_TEX_ALLOWS_SPACES:
2961 case LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS:
2962 if (lyxrc_orig.windows_style_tex_paths != lyxrc_new.windows_style_tex_paths) {
2963 os::windows_style_tex_paths(lyxrc_new.windows_style_tex_paths);
2965 case LyXRC::RC_THESAURUSDIRPATH:
2966 case LyXRC::RC_UIFILE:
2967 case LyXRC::RC_USER_EMAIL:
2968 case LyXRC::RC_USER_NAME:
2969 case LyXRC::RC_USE_CONVERTER_CACHE:
2970 case LyXRC::RC_USE_SYSTEM_COLORS:
2971 case LyXRC::RC_USE_TOOLTIP:
2972 case LyXRC::RC_USE_PIXMAP_CACHE:
2973 case LyXRC::RC_VIEWDVI_PAPEROPTION:
2974 case LyXRC::RC_SINGLE_CLOSE_TAB_BUTTON:
2975 case LyXRC::RC_SINGLE_INSTANCE:
2976 case LyXRC::RC_SORT_LAYOUTS:
2977 case LyXRC::RC_FULL_SCREEN_LIMIT:
2978 case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
2979 case LyXRC::RC_FULL_SCREEN_MENUBAR:
2980 case LyXRC::RC_FULL_SCREEN_TABBAR:
2981 case LyXRC::RC_FULL_SCREEN_TOOLBARS:
2982 case LyXRC::RC_FULL_SCREEN_WIDTH:
2983 case LyXRC::RC_VISUAL_CURSOR:
2984 case LyXRC::RC_VIEWER:
2985 case LyXRC::RC_VIEWER_ALTERNATIVES:
2986 case LyXRC::RC_FORWARD_SEARCH_DVI:
2987 case LyXRC::RC_FORWARD_SEARCH_PDF:
2988 case LyXRC::RC_EXPORT_OVERWRITE:
2989 case LyXRC::RC_DEFAULT_DECIMAL_POINT:
2990 case LyXRC::RC_SCROLL_WHEEL_ZOOM:
2991 case LyXRC::RC_LAST:
2998 string const LyXRC::getDescription(LyXRCTags tag)
3003 case RC_ACCEPT_COMPOUND:
3004 str = _("Consider run-together words, such as \"diskdrive\" for \"disk drive\", as legal words?");
3008 str = _("Specify an alternate language. The default is to use the language of the document.");
3011 case RC_PLAINTEXT_LINELEN:
3012 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.");
3015 case RC_AUTOREGIONDELETE:
3016 str = _("De-select if you don't want the current selection to be replaced automatically by what you type.");
3019 case RC_AUTORESET_OPTIONS:
3020 str = _("De-select if you don't want the class options to be reset to defaults after class change.");
3024 str = _("The time interval between auto-saves (in seconds). 0 means no auto-save.");
3027 case RC_AUTO_NUMBER:
3030 case RC_BACKUPDIR_PATH:
3031 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.");
3034 case RC_BIBTEX_COMMAND:
3035 str = _("Define the options of bibtex (cf. man bibtex) or select an alternative compiler (e.g. mlbibtex or bibulus).");
3038 case RC_JBIBTEX_COMMAND:
3039 str = _("Define the options of the bibtex program for PLaTeX (Japanese LaTeX).");
3043 str = _("Keybindings file. Can either specify an absolute path, or LyX will look in its global and local bind/ directories.");
3046 case RC_CHECKLASTFILES:
3047 str = _("Select to check whether the lastfiles still exist.");
3050 case RC_CHKTEX_COMMAND:
3051 str = _("Define how to run chktex. E.g. \"chktex -n11 -n1 -n3 -n6 -n9 -22 -n25 -n30 -n38\" Refer to the ChkTeX documentation.");
3060 case RC_CURSOR_FOLLOWS_SCROLLBAR:
3061 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.");
3064 case RC_SCROLL_BELOW_DOCUMENT:
3065 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");
3068 case RC_MAC_DONTSWAP_CTRL_META:
3069 str = _("Make Apple key act as Meta and Control key as Ctrl.");
3072 case RC_MAC_LIKE_WORD_MOVEMENT:
3073 str = _("Use the Mac OS X conventions for the word-level cursor movement");
3076 case RC_SHOW_MACRO_LABEL:
3077 str = _("Show a small box around a Math Macro with the macro name when the cursor is inside.");
3080 case RC_DATE_INSERT_FORMAT:
3081 //xgettext:no-c-format
3082 str = _("This accepts the normal strftime formats; see man strftime for full details. E.g.\"%A, %e. %B %Y\".");
3086 str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
3089 case RC_DEFAULT_VIEW_FORMAT:
3090 str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
3093 case RC_DEFAULT_LANGUAGE:
3094 str = _("New documents will be assigned this language.");
3097 case RC_DEFAULT_PAPERSIZE:
3098 str = _("Specify the default paper size.");
3101 case RC_DIALOGS_ICONIFY_WITH_MAIN:
3102 str = _("Iconify the dialogs when the main window is iconified. (Affects only dialogs shown after the change has been made.)");
3105 case RC_DISPLAY_GRAPHICS:
3106 str = _("Select how LyX will display any graphics.");
3109 case RC_DOCUMENTPATH:
3110 str = _("The default path for your documents. An empty value selects the directory LyX was started from.");
3114 str = _("Specify additional chars that can be part of a word.");
3117 case RC_EXAMPLEPATH:
3118 str = _("The path that LyX will set when offering to choose an example. An empty value selects the directory LyX was started from.");
3121 case RC_FONT_ENCODING:
3122 str = _("The font encoding used for the LaTeX2e fontenc package. T1 is highly recommended for non-English languages.");
3128 case RC_INDEX_COMMAND:
3129 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\".");
3132 case RC_JINDEX_COMMAND:
3133 str = _("Define the options of the index program for PLaTeX (Japanese LaTeX).");
3136 case RC_NOMENCL_COMMAND:
3137 str = _("Define the options of makeindex (cf. man makeindex) to be used for nomenclatures. This might differ from the index processing options.");
3144 case RC_KBMAP_PRIMARY:
3145 case RC_KBMAP_SECONDARY:
3146 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.");
3149 case RC_LANGUAGE_AUTO_BEGIN:
3150 str = _("Select if a language switching command is needed at the beginning of the document.");
3153 case RC_LANGUAGE_AUTO_END:
3154 str = _("Select if a language switching command is needed at the end of the document.");
3157 case RC_LANGUAGE_COMMAND_BEGIN:
3158 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.");
3161 case RC_LANGUAGE_COMMAND_END:
3162 str = _("The LaTeX command for changing back to the language of the document.");
3165 case RC_LANGUAGE_COMMAND_LOCAL:
3166 str = _("The LaTeX command for local changing of the language.");
3169 case RC_LANGUAGE_GLOBAL_OPTIONS:
3170 str = _("De-select if you don't want the language(s) used as an argument to \\documentclass.");
3173 case RC_LANGUAGE_CUSTOM_PACKAGE:
3174 str = _("The LaTeX command for loading the language package. E.g. \"\\usepackage{babel}\", \"\\usepackage{omega}\".");
3177 case RC_LANGUAGE_PACKAGE_SELECTION:
3178 str = _("De-select if you don't want babel to be used when the language of the document is the default language.");
3181 case RC_USELASTFILEPOS:
3182 str = _("De-select if you do not want LyX to scroll to saved position.");
3185 case RC_LOADSESSION:
3186 str = _("De-select to prevent loading files opened from the last LyX session.");
3189 case RC_MAKE_BACKUP:
3190 str = _("De-select if you don't want LyX to create backup files.");
3193 case RC_MARK_FOREIGN_LANGUAGE:
3194 str = _("Select to control the highlighting of words with a language foreign to that of the document.");
3197 case RC_MOUSE_WHEEL_SPEED:
3198 str = bformat(_("The scrolling speed of the mouse wheel."),
3202 case RC_COMPLETION_POPUP_DELAY:
3203 str = _("The completion popup delay.");
3206 case RC_COMPLETION_POPUP_MATH:
3207 str = _("Select to display the completion popup in math mode.");
3210 case RC_COMPLETION_POPUP_TEXT:
3211 str = _("Select to display the completion popup in text mode.");
3214 case RC_COMPLETION_POPUP_AFTER_COMPLETE:
3215 str = _("Show the completion popup without delay after non-unique completion attempt.");
3218 case RC_COMPLETION_POPUP_TEXT:
3219 str = _("Show a small triangle on the cursor to indicate that a completion is available.");
3222 case RC_COMPLETION_POPUP_DELAY:
3223 str = _("The inline completion delay.");
3226 case RC_COMPLETION_INLINE_MATH:
3227 str = _("Select to display the inline completion in math mode.");
3230 case RC_COMPLETION_INLINE_TEXT:
3231 str = _("Select to display the inline completion in text mode.");
3234 case RC_COMPLETION_INLINE_DOTS:
3235 str = _("Use \"...\" to shorten long completions.");
3238 case RC_AUTOCORRECTION_MATH:
3239 str = _("Allow TeXMacs shorthand, like => converting to \Rightarrow.");
3242 case RC_NUMLASTFILES:
3243 str = bformat(_("Maximal number of lastfiles. Up to %1$d can appear in the file menu."),
3247 case RC_PATH_PREFIX:
3248 str = _("Specify those directories which should be "
3249 "prepended to the PATH environment variable. "
3250 "Use the OS native format.");
3254 str = _("Shows a typeset preview of things such as math");
3257 case RC_PREVIEW_HASHED_LABELS:
3258 str = _("Previewed equations will have \"(#)\" labels rather than numbered ones");
3261 case RC_PREVIEW_SCALE_FACTOR:
3262 str = _("Scale the preview size to suit.");
3265 case RC_PRINTCOLLCOPIESFLAG:
3266 str = _("The option for specifying whether the copies should be collated.");
3269 case RC_PRINTCOPIESFLAG:
3270 str = _("The option for specifying the number of copies to print.");
3274 str = _("The default printer to print on. If none is specified, LyX will use the environment variable PRINTER.");
3277 case RC_PRINTEVENPAGEFLAG:
3278 str = _("The option to print only even pages.");
3281 case RC_PRINTEXSTRAOPTIONS:
3282 str = _("Extra options to pass to printing program after everything else, but before the filename of the DVI file to be printed.");
3285 case RC_PRINTFILEEXTENSION:
3286 str = _("Extension of printer program output file. Usually \".ps\".");
3289 case RC_PRINTLANDSCAPEFLAG:
3290 str = _("The option to print out in landscape.");
3293 case RC_PRINTODDPAGEFLAG:
3294 str = _("The option to print only odd pages.");
3297 case RC_PRINTPAGERANGEFLAG:
3298 str = _("The option for specifying a comma-separated list of pages to print.");
3301 case RC_PRINTPAPERDIMENSIONFLAG:
3302 str = _("Option to specify the dimensions of the print paper.");
3305 case RC_PRINTPAPERFLAG:
3306 str = _("The option to specify paper type.");
3309 case RC_PRINTREVERSEFLAG:
3310 str = _("The option to reverse the order of the pages printed.");
3313 case RC_PRINTSPOOL_COMMAND:
3314 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.");
3317 case RC_PRINTSPOOL_PRINTERPREFIX:
3318 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.");
3321 case RC_PRINTTOFILE:
3322 str = _("Option to pass to the print program to print to a file.");
3325 case RC_PRINTTOPRINTER:
3326 str = _("Option to pass to the print program to print on a specific printer.");
3329 case RC_PRINT_ADAPTOUTPUT:
3330 str = _("Select for LyX to pass the name of the destination printer to your print command.");
3333 case RC_PRINT_COMMAND:
3334 str = _("Your favorite print program, e.g. \"dvips\", \"dvilj4\".");
3337 case RC_RTL_SUPPORT:
3338 str = _("Select to enable support of right-to-left languages (e.g. Hebrew, Arabic).");
3341 case RC_VISUAL_CURSOR:
3342 str = _("Select to have visual bidi cursor movement, unselect for logical movement.");
3346 str = _("DPI (dots per inch) of your monitor is auto-detected by LyX. If that goes wrong, override the setting here.");
3349 case RC_SCREEN_FONT_ROMAN:
3350 case RC_SCREEN_FONT_SANS:
3351 case RC_SCREEN_FONT_TYPEWRITER:
3352 str = _("The screen fonts used to display the text while editing.");
3355 case RC_SCREEN_FONT_ROMAN_FOUNDRY:
3356 case RC_SCREEN_FONT_SANS_FOUNDRY:
3357 case RC_SCREEN_FONT_TYPEWRITER_FOUNDRY:
3360 case RC_SCREEN_FONT_SCALABLE:
3361 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.");
3364 case RC_SCREEN_FONT_SIZES:
3365 str = _("The font sizes used for calculating the scaling of the screen fonts.");
3368 case RC_SCREEN_ZOOM:
3369 //xgettext:no-c-format
3370 str = _("The zoom percentage for screen fonts. A setting of 100% will make the fonts roughly the same size as on paper.");
3373 case RC_GEOMETRY_SESSION:
3374 str = _("Allow session manager to save and restore windows geometry.");
3378 str = _("This starts the lyxserver. The pipes get an additional extension \".in\" and \".out\". Only for advanced users.");
3384 case RC_SHOW_BANNER:
3385 str = _("De-select if you don't want the startup banner.");
3388 case RC_TEMPDIRPATH:
3389 str = _("LyX will place its temporary directories in this path. They will be deleted when you quit LyX.");
3392 case RC_THESAURUSDIRPATH:
3393 str = _("This is the place where the files of the thesaurus library reside.");
3396 case RC_TEMPLATEPATH:
3397 str = _("The path that LyX will set when offering to choose a template. An empty value selects the directory LyX was started from.");
3400 case RC_TEX_ALLOWS_SPACES:
3403 case RC_TEX_EXPECTS_WINDOWS_PATHS:
3407 str = _("The UI (user interface) file. Can either specify an absolute path, or LyX will look in its global and local ui/ directories.");
3416 case RC_USE_USE_SYSTEM_COLORS:
3417 str = _("Enable use the system colors for some things like main window background and selection.");
3420 case RC_USE_TOOLTIP:
3421 str = _("Enable the automatic appearance of tool tips in the work area.");
3424 case RC_USE_PIXMAP_CACHE:
3425 str = _("Enable the pixmap cache that might improve performance on Mac and Windows.");
3428 case RC_VIEWDVI_PAPEROPTION:
3429 _("Specify the paper command to DVI viewer (leave empty or use \"-paper\")");
3444 // The global instance
3447 // The global copy of the system lyxrc entries (everything except preferences)