1999-11-25 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
+ * src/bufferparams.C: make sure that the default textclass is
+ "article". It used to be the first one by description order, but
+ now the first one is "docbook".
+
+ * src/lyx_main.C (setDebuggingLevel): change type of argument to
+ string; call Debug::value.
+ (easyParse): pass complete argument to setDebuggingLevel().
+
+ * src/debug.h (value): fix the code that parses debug levels.
+
+ * src/debug.h: add new debug type ACTION, reserved for LyXAction
+ class.
+
+ * src/LyXAction.C: use Debug::ACTION as debug channel.
+
+ * src/lyxlookup.C: make the debug statements go to Debug::KEY.
+
* NEWS: updated for the future 1.1.3 release.
* src/mathed/symbol_def.h: swap the definitions of \varepsilon and
if (pit == lyx_arg_map.end()) {
// the action does not have any pseudoactions
- lyxerr[Debug::INFO] << "Action " << action
+ lyxerr[Debug::ACTION] << "Action " << action
<< " does not have any pseudo actions.\n";
return LFUN_UNKNOWN_ACTION;
}
if (aci == (*pit).second.end()) {
// the action does not have any pseudoactions with this arg
- lyxerr[Debug::INFO]
+ lyxerr[Debug::ACTION]
<< "Action " << action
<< "does not have any pseudoactions with arg "
<< arg << '\n';
}
// pseudo action exist
- lyxerr[Debug::INFO] << "Pseudoaction exist["
+ lyxerr[Debug::ACTION] << "Pseudoaction exist["
<< action << '|'
<< arg << "] = " << (*aci).second << '\n';
// put the new pseudo function in it
(*ami).second[arg] = pseudo_counter;
- lyxerr[Debug::INFO] << "Creating new pseudoaction "
+ lyxerr[Debug::ACTION] << "Creating new pseudoaction "
<< pseudo_counter << " for [" << action
<< '|' << arg << "]\n";
pseudo_map::const_iterator pit = lyx_pseudo_map.find(pseudo);
if (pit != lyx_pseudo_map.end()) {
- lyxerr[Debug::INFO] << "Found the pseudoaction: ["
+ lyxerr[Debug::ACTION] << "Found the pseudoaction: ["
<< (*pit).second.action << '|'
<< (*pit).second.arg << '\n';
arg = (*pit).second.arg;
// split action and arg
string actstr;
string argstr = split(func, actstr, ' ');
- lyxerr[Debug::INIT] << "Action: " << actstr << '\n';
- lyxerr[Debug::INIT] << "Arg : " << argstr << '\n';
+ lyxerr[Debug::ACTION] << "Action: " << actstr << '\n';
+ lyxerr[Debug::ACTION] << "Arg : " << argstr << '\n';
func_map::const_iterator fit = lyx_func_map.find(actstr);
info_map::const_iterator ici = lyx_info_map.find(action);
if (ici != lyx_info_map.end()) {
- if (lyxerr.debugging(Debug::INFO)) {
+ if (lyxerr.debugging(Debug::ACTION)) {
lyxerr << "Action: " << action << '\n';
lyxerr << " name: "
<< (*ici).second.name << '\n';
quotes_language = InsetQuotes::EnglishQ;
quotes_times = InsetQuotes::DoubleQ;
fontsize = "default";
- textclass = 0;
+ // Initialize textclass to point to article. if `first' is
+ // true in the returned pair, then `second' is the textclass
+ // number; if it is false, second is 0. In both cases, second
+ // is what we want.
+ textclass = textclasslist.NumberOfClass("article").second;
+
/* PaperLayout */
papersize = PAPER_DEFAULT;
papersize2 = VM_PAPER_DEFAULT; /* DEFAULT */
#define LYXDEBUG_H
#include "LString.h"
+#include "support/lstrings.h"
/** Ideally this should have been a namespace, but since we try to be
compilable on older C++ compilators too, we use a struct instead.
///
LYXSERVER = (1 << 12), // 4096
///
- ROFF = (1 << 13)
+ ROFF = (1 << 13), // 8192
+ ///
+ ACTION = (1 << 14) // 16384
};
///
static const type ANY = type(INFO | INIT | KEY | TOOLBAR |
PARSER | LYXRC | KBMAP | LATEX |
MATHED | FONT | TCLASS | LYXVC |
- LYXSERVER | ROFF);
+ LYXSERVER | ROFF | ACTION);
///
friend inline void operator|=(Debug::type & d1, Debug::type d2);
string::size_type st = v.find(',');
string tmp(v.substr(0, st));
if (tmp.empty()) break;
- if (val == "NONE") l |= Debug::NONE;
- else if (val == "INFO") l |= Debug::INFO;
- else if (val == "INIT") l |= Debug::INIT;
- else if (val == "KEY") l |= Debug::KEY;
- else if (val == "TOOLBAR") l |= Debug::TOOLBAR;
- else if (val == "PARSER") l |= Debug::PARSER;
- else if (val == "LYXRC") l |= Debug::LYXRC;
- else if (val == "KBMAP") l |= Debug::KBMAP;
- else if (val == "LATEX") l |= Debug::LATEX;
- else if (val == "MATHED") l |= Debug::MATHED;
- else if (val == "FONT") l |= Debug::FONT;
- else if (val == "TCLASS") l |= Debug::TCLASS;
- else if (val == "LYXVC") l |= Debug::LYXVC;
- else if (val == "LYXSERVER") l |= Debug::LYXSERVER;
- else if (val == "ROFF") l |= Debug::ROFF;
+ if (isStrInt(tmp)) {
+ l |= static_cast<type>(strToInt(tmp));
+ break;
+ }
+ if (!compare_no_case(tmp,"NONE"))
+ l |= Debug::NONE;
+ else if (!compare_no_case(tmp,"INFO"))
+ l |= Debug::INFO;
+ else if (!compare_no_case(tmp,"INIT"))
+ l |= Debug::INIT;
+ else if (!compare_no_case(tmp,"KEY"))
+ l |= Debug::KEY;
+ else if (!compare_no_case(tmp,"TOOLBAR"))
+ l |= Debug::TOOLBAR;
+ else if (!compare_no_case(tmp,"PARSER"))
+ l |= Debug::PARSER;
+ else if (!compare_no_case(tmp,"LYXRC"))
+ l |= Debug::LYXRC;
+ else if (!compare_no_case(tmp,"KBMAP"))
+ l |= Debug::KBMAP;
+ else if (!compare_no_case(tmp,"LATEX"))
+ l |= Debug::LATEX;
+ else if (!compare_no_case(tmp,"MATHED"))
+ l |= Debug::MATHED;
+ else if (!compare_no_case(tmp,"FONT"))
+ l |= Debug::FONT;
+ else if (!compare_no_case(tmp,"TCLASS"))
+ l |= Debug::TCLASS;
+ else if (!compare_no_case(tmp,"LYXVC"))
+ l |= Debug::LYXVC;
+ else if (!compare_no_case(tmp,"LYXSERVER"))
+ l |= Debug::LYXSERVER;
+ else if (!compare_no_case(tmp,"ROFF"))
+ l |= Debug::ROFF;
+ else if (!compare_no_case(tmp,"ACTION"))
+ l |= Debug::ACTION;
else break; // unknown string
if (st == string::npos) break;
v.erase(0, st + 1);
// Set debugging level and report result to user
-void setDebuggingLevel(int dbgLevel)
+void setDebuggingLevel(string const &dbgLevel)
{
lyxerr << _("Setting debug level to ") << dbgLevel << endl;
- lyxerr.level(Debug::type(dbgLevel));
+ lyxerr.level(Debug::value(dbgLevel));
lyxerr[Debug::INFO] << "Debugging INFO #" << Debug::INFO << endl;
lyxerr[Debug::INIT] << "Debugging INIT #" << Debug::INIT << endl;
lyxerr[Debug::KEY] << "Debugging KEY #" << Debug::KEY << endl;
// Check for -dbg int
if (arg == "-dbg") {
if (i+1 < *argc) {
- int erri = 0;
- sscanf(argv[i+1], "%d", &erri);
-
- setDebuggingLevel(erri);
+ setDebuggingLevel(argv[i+1]);
// Now, remove these two arguments by shifting
// the following two places down.
// This part could be done before opening display
setlocale(LC_CTYPE, "");
if (!XSupportsLocale()) {
- lyxerr.debug()
+ lyxerr[Debug::KEY]
<< "InitLyXLookup: X does not support this locale."
<< endl;
return;
}
if (!XSetLocaleModifiers("")) {
- lyxerr.debug() << "InitLyXLookup: Could not set modifiers "
+ lyxerr[Debug::KEY] << "InitLyXLookup: Could not set modifiers "
"for this locale." << endl;
return;
}
0);
if (!xic) {
- lyxerr.debug() << "InitLyXLookup: could not create "
+ lyxerr[Debug::KEY] << "InitLyXLookup: could not create "
"an input context" << endl;
XCloseIM (xim);
xim = 0;
}
}
else
- lyxerr.debug() << "InitLyXLookup: could not open "
+ lyxerr[Debug::KEY] << "InitLyXLookup: could not open "
"an input method." << endl;
}
void CloseLyXLookup()
{
if (xic) {
- lyxerr.debug() << "CloseLyXLookup: destroying input context"
+ lyxerr[Debug::KEY] << "CloseLyXLookup: destroying input context"
<< endl;
XDestroyIC(xic);
XCloseIM(xim);