* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2000 The LyX Team.
+ * Copyright 1995-2001 The LyX Team.
*
* ====================================================== */
#include "support/filetools.h"
#include "lyxtext.h"
#include "converter.h"
+#include "gettext.h"
using std::ostream;
using std::ofstream;
using std::vector;
extern LyXAction lyxaction;
-extern kb_keymap * toplevel_keymap;
+extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
+namespace {
-static
keyword_item lyxrcTags[] = {
{ "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
{ "\\alternate_language", LyXRC::RC_ALT_LANG },
{ "\\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},
};
/* Let the range depend of the size of lyxrcTags. Alejandro 240596 */
-static const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
+const int lyxrcCount = sizeof(lyxrcTags) / sizeof(keyword_item);
+
+} // namespace anon
LyXRC::LyXRC()
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;
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
}
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 + '\'');
}
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();
<< "### 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"
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";