]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
Fix crash when running lyx -dbg insets -e ...
[lyx.git] / src / lyxrc.C
index 7afa7e0b3ac8ef570349534269b35e915b6a2642..bc3b7d302ebf40235cff681c85ce36216d338e4b 100644 (file)
@@ -4,7 +4,7 @@
  *           LyX, The Document Processor
  *      
  *         Copyright 1995 Matthias Ettrich
- *          Copyright 1995-2000 The LyX Team.
+ *          Copyright 1995-2001 The LyX Team.
  *
  * ====================================================== */
 
@@ -133,6 +133,9 @@ keyword_item lyxrcTags[] = {
        { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
        { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
        { "\\use_personal_dictionary", LyXRC::RC_USE_PERS_DICT },
+#ifdef USE_PSPELL
+       { "\\use_pspell", LyXRC::RC_USE_PSPELL },
+#endif
        { "\\use_tempdir", LyXRC::RC_USETEMPDIR },
        { "\\view_dvi_paper_option", LyXRC::RC_VIEWDVI_PAPEROPTION },
        { "\\viewer" ,LyXRC::RC_VIEWER}, 
@@ -216,6 +219,9 @@ void LyXRC::setDefaults() {
        exit_confirmation = true;
        display_shortcuts = true;
        // Spellchecker settings:
+#ifdef USE_PSPELL      
+       use_pspell = true;
+#endif
        isp_command = "ispell";
        isp_accept_compound = false;
        isp_use_input_encoding = false;
@@ -278,7 +284,7 @@ int LyXRC::read(string const & filename)
        lexrc.setFile(filename);
        if (!lexrc.IsOK()) return -2;
        
-       lyxerr[Debug::INIT] << "Reading '" << filename << "'..." << endl;
+       lyxerr[Debug::LYXRC] << "Reading '" << filename << "'..." << endl;
        
        while (lexrc.IsOK()) {
                // By using two switches we take advantage of the compiler
@@ -707,15 +713,17 @@ int LyXRC::read(string const & filename)
                        }
                        
                        if ((action = lyxaction.LookupFunc(cmd))>= 0) {
-                               if (lyxerr.debugging(Debug::KBMAP)) {
+                               if (lyxerr.debugging(Debug::LYXRC)) {
                                        lyxerr << "RC_BIND: Sequence `"
                                               << seq << "' Command `"
                                               << cmd << "' Action `"
                                               << action << '\'' << endl;
                                }
                                res = toplevel_keymap->bind(seq, action);
-                               if (res != 0) {
+                               if (res != 0
+                                   && lyxerr.debugging(Debug::LYXRC)) {
                                        lexrc.printError(
+                                               "RC_BIND: "
                                                "Invalid key sequence `"
                                                + seq + '\''); 
                                }
@@ -749,6 +757,12 @@ int LyXRC::read(string const & filename)
                                ascii_linelen = lexrc.GetInteger();
                        break;
                        // Spellchecker settings:
+#ifdef USE_PSPELL
+               case RC_USE_PSPELL:
+                       if (lexrc.next())
+                               use_pspell = lexrc.GetBool();
+                       break;
+#endif
                case RC_SPELL_COMMAND:
                        if (lexrc.next())
                                isp_command = lexrc.GetString();
@@ -943,7 +957,7 @@ void LyXRC::output(ostream & os) const
           << "###          LyX, The Document Processor\n"
           << "###\n"
           << "###          Copyright 1995 Matthias Ettrich\n"
-          << "###          Copyright 1995-2000 The LyX Team.\n"
+          << "###          Copyright 1995-2001 The LyX Team.\n"
           << "###\n"
           << "### ========================================================\n"
           << "\n"
@@ -1373,7 +1387,12 @@ void LyXRC::output(ostream & os) const
                os << "\n#\n"
                   << "# SPELLCHECKER SECTION ##############################\n"
                   << "#\n\n";
-
+#ifdef USE_PSPELL
+       case RC_USE_PSPELL:
+               if (use_pspell != system_lyxrc.use_pspell) {
+                       os << "\\use_pspell \"" << use_pspell << "\"\n";
+               }
+#endif
        case RC_SPELL_COMMAND:
                if (isp_command != system_lyxrc.isp_command) {
                        os << "\\spell_command \"" << isp_command << "\"\n";
@@ -1589,6 +1608,8 @@ void LyXRC::set_font_norm_type()
                font_norm_type = ISO_8859_6_8;
        else if (font_norm == "iso8859-9")
                font_norm_type = ISO_8859_9;
+       else if (font_norm == "iso8859-15")
+               font_norm_type = ISO_8859_15;
        else
                font_norm_type = OTHER_ENCODING;
 }