diff --git a/ChangeLog b/ChangeLog index 94eee40a11..0ce7407cc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2001-01-07 Dekel Tsur + + * lib/build-listerrors: Exit if literate-article doesn't appear in + textclass.lst + +2001-01-09 Jean-Marc Lasgouttes + + * src/combox.h (getline): small fix for sun CC 6.0 + * src/combox.C (input_cb): ditto. + * src/spellchecker.C (sigchldhandler): ditto. + + * src/lyx_main.C (init): do not query for creation of user + directory when running without a GUI. + +2001-01-08 Dekel Tsur + + * src/mathed/formula.C (LocalDispatch): Toggle font properties. + 2001-01-07 Dekel Tsur * BufferView2.C (open_new_inset): Added 2nd argument. diff --git a/lib/build-listerrors b/lib/build-listerrors index eeb34d55bd..392a9cf31f 100755 --- a/lib/build-listerrors +++ b/lib/build-listerrors @@ -21,6 +21,12 @@ else lyx=lyx fi +if [ -z "`grep literate-article textclass.lst`" ] +then + touch listerrors + exit 0 +fi + $lyx --export literate $dir/examples/Literate.lyx # if no literate support stuff is installed nothing will be output if [ -f $dir/examples/Literate.nw ] @@ -31,6 +37,9 @@ else # you don't have noweb installed so we'll produce a dummy file # just so make doesn't keep trying to output it. touch listerrors + # tell the user nothing bad happened + echo + echo "LyX did not detect NoWeb support. Proceeding normally." fi exit 0 diff --git a/src/combox.C b/src/combox.C index 02e31059b1..9fad5bcb35 100644 --- a/src/combox.C +++ b/src/combox.C @@ -356,7 +356,7 @@ void Combox::input_cb(FL_OBJECT * ob, long) char const * text = fl_get_input(ob); - combo->addto(text ? text : string()); + combo->addto(text ? string(text) : string()); combo->is_empty = false; } diff --git a/src/combox.h b/src/combox.h index c948c1895f..e36a23e24b 100644 --- a/src/combox.h +++ b/src/combox.h @@ -232,7 +232,7 @@ string const Combox::getline() const return fl_get_input(label); else return (browser && sel > 0) ? - fl_get_browser_line(browser, sel) : string(); + string(fl_get_browser_line(browser, sel)) : string(); } #endif diff --git a/src/frontends/xforms/Menubar_pimpl.C b/src/frontends/xforms/Menubar_pimpl.C index 891ebdef56..d03eabc445 100644 --- a/src/frontends/xforms/Menubar_pimpl.C +++ b/src/frontends/xforms/Menubar_pimpl.C @@ -548,7 +548,7 @@ int Menubar::Pimpl::create_submenu(Window win, LyXView * view, // tabs to align shortcuts. do label += '\t'; - while (string_width(label) < max_width); + while (string_width(label) < max_width + 5); label += accel.substr(1,accel.find(']') - 1); } label += "%x" + tostr(item.action() + action_offset) diff --git a/src/lyx_main.C b/src/lyx_main.C index caf25a6908..94c84c60de 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -351,10 +351,10 @@ void LyX::init(int */*argc*/, char **argv, bool gui) bool explicit_userdir = true; if (user_lyxdir.empty()) { - // LYX_USERDIR_11x environment variable + // LYX_USERDIR_11x environment variable user_lyxdir = GetEnvPath("LYX_USERDIR_11x"); - // default behaviour + // default behaviour if (user_lyxdir.empty()) user_lyxdir = AddPath(GetEnvPath("HOME"), string(".") + PACKAGE); @@ -364,8 +364,10 @@ void LyX::init(int */*argc*/, char **argv, bool gui) lyxerr[Debug::INIT] << "User LyX directory: '" << user_lyxdir << '\'' << endl; - // Check that user LyX directory is ok. - queryUserLyXDir(explicit_userdir); + // Check that user LyX directory is ok. We don't do that if + // running in batch mode. + if (gui) + queryUserLyXDir(explicit_userdir); // // Shine up lyxrc defaults diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 9f0935094c..47243e9b87 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -896,12 +896,12 @@ InsetFormula::LocalDispatch(BufferView * bv, } // Math fonts - case LFUN_BOLD: mathcursor->setLastCode(LM_TC_BF); break; - case LFUN_SANS: mathcursor->setLastCode( LM_TC_SF); break; - case LFUN_EMPH: mathcursor->setLastCode(LM_TC_CAL); break; - case LFUN_ROMAN: mathcursor->setLastCode(LM_TC_RM); break; - case LFUN_CODE: mathcursor->setLastCode(LM_TC_TT); break; - case LFUN_DEFAULT: mathcursor->setLastCode(LM_TC_VAR ) ; break; + case LFUN_BOLD: mathcursor->toggleLastCode(LM_TC_BF); break; + case LFUN_SANS: mathcursor->toggleLastCode(LM_TC_SF); break; + case LFUN_EMPH: mathcursor->toggleLastCode(LM_TC_CAL); break; + case LFUN_ROMAN: mathcursor->toggleLastCode(LM_TC_RM); break; + case LFUN_CODE: mathcursor->toggleLastCode(LM_TC_TT); break; + case LFUN_DEFAULT: mathcursor->setLastCode(LM_TC_VAR); break; case LFUN_TEX: { // varcode = LM_TC_TEX; diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 255946800e..1e69020554 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -1030,3 +1030,11 @@ void MathedCursor::doAccent(MathedInset * p) accent = 0; // consumed! } + +void MathedCursor::toggleLastCode(MathedTextCodes t) +{ + if (lastcode == t) + lastcode = LM_TC_VAR; + else + lastcode = t; +} diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index 91e4e6125e..5bc6df4683 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -127,6 +127,8 @@ class MathedCursor { /// void setLastCode(MathedTextCodes t) { lastcode = t; } /// + void toggleLastCode(MathedTextCodes t); + /// MathedTextCodes getLastCode() const { return lastcode; } protected: diff --git a/src/spellchecker.C b/src/spellchecker.C index 77f4eaaa2f..f986e556ff 100644 --- a/src/spellchecker.C +++ b/src/spellchecker.C @@ -966,7 +966,9 @@ bool RunSpellChecker(BufferView * bv) } } +#ifdef WITH_WARNINGS #warning should go somewhere more sensible +#endif void sigchldhandler(pid_t pid, int * status) { #ifndef USE_PSPELL