+2001-09-02 Dekel Tsur <dekelts@tau.ac.il>
+
+ * Makefile.am (pkgdata_DATA): Add symbols file.
+
2001-09-01 John Levon <moz@compsoc.man.ac.uk>
* configure:
pkgdata_DATA = lyxrc.example CREDITS chkconfig.ltx lyxrc.defaults \
textclass.lst packages.lst external_templates \
- encodings languages
+ encodings languages symbols
LYXLIBDIRS = bind clipart doc examples images kbd layouts scripts \
templates tex ui
+2001-09-02 Dekel Tsur <dekelts@tau.ac.il>
+
+ * math_hash.C (in_word_set): Initialize symbol table even when
+ symbols file was not found.
+
2001-09-02 Angus Leeming <a.leeming@ic.ac.uk>
* math_hash.C: added a using std::endl directive.
void ReadSymbols(string const & filename)
{
- for (latexkeys_a * p = wordlist_array; !string(p->name).empty(); ++p) {
- latexkeys tmp;
- tmp.name = p->name;
- tmp.token = p->token;
- tmp.id = p->id;
- tmp.type = LMB_NONE;
- tmp.latex_font_id = 0;
- wordlist.push_back(tmp);
- }
-
LyXLex lex(0, 0);
lex.setFile(filename);
while (lex.isOK()) {
wordlist.push_back(tmp);
}
+}
+
+
+void InitSymbols()
+{
+ for (latexkeys_a * p = wordlist_array; !string(p->name).empty(); ++p) {
+ latexkeys tmp;
+ tmp.name = p->name;
+ tmp.token = p->token;
+ tmp.id = p->id;
+ tmp.type = LMB_NONE;
+ tmp.latex_font_id = 0;
+ wordlist.push_back(tmp);
+ }
+
+ lyxerr[Debug::MATHED] << "Reading symbols file\n";
+ string const file = LibFileSearch(string(), "symbols");
+ if (file.empty())
+ lyxerr << "Could not find symbols file" << endl;
+ else
+ ReadSymbols(file);
std::sort(wordlist.begin(), wordlist.end());
}
latexkeys const * in_word_set(string const & str)
{
if (!initialized) {
- lyxerr[Debug::MATHED] << "Reading symbols file\n";
- string const file = LibFileSearch(string(), "symbols");
- if (file.empty())
- lyxerr << "Could not find symbols file" << endl;
- else
- ReadSymbols(file);
+ InitSymbols();
initialized = true;
}