From b3b0afb77e1539d65059fb88c490946810ab7842 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 2 May 2006 13:44:19 +0000 Subject: [PATCH] * src/lyx_main.C (readRcFile): do not report an error if file is not found. (init): read lyxrc.dist before lyxrc.defaults; remove code to read lyxrc (LyX 1.1.5 compatibility code). * src/encoding.C (read): * src/language.C (read): set debug to the INFO channel. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@13790 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 10 ++++++++++ src/encoding.C | 2 +- src/language.C | 2 +- src/lyx_main.C | 25 ++++++++++++------------- status.14x | 9 ++++++--- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 793fcfd0d6..f92642fd92 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2006-04-28 Jean-Marc Lasgouttes + + * lyx_main.C (readRcFile): do not report an error if file is not + found. + (init): read lyxrc.dist before lyxrc.defaults; remove code to read + lyxrc (LyX 1.1.5 compatibility code). + + * encoding.C (read): + * language.C (read): set debug to the INFO channel. + 2006-04-28 Jürgen Spitzmüller * BufferView_pimpl.C (dispatch): update bibfiles cache after adding diff --git a/src/encoding.C b/src/encoding.C index d4c37d8e43..1110ea0b09 100644 --- a/src/encoding.C +++ b/src/encoding.C @@ -336,7 +336,7 @@ void Encodings::read(string const & filename) string const name = lex.getString(); lex.next(); string const latexname = lex.getString(); - lyxerr[Debug::INIT] << "Reading encoding " << name << endl; + lyxerr[Debug::INFO] << "Reading encoding " << name << endl; Uchar table[256]; for (unsigned int i = 0; i < 256; ++i) { lex.next(); diff --git a/src/language.C b/src/language.C index 34e0885419..c656f22992 100644 --- a/src/language.C +++ b/src/language.C @@ -54,7 +54,7 @@ void Languages::read(string const & filename) lang = lex.getString(); else break; - lyxerr[Debug::INIT] << "Reading language " << lang << endl; + lyxerr[Debug::INFO] << "Reading language " << lang << endl; if (lex.next()) babel = lex.getString(); diff --git a/src/lyx_main.C b/src/lyx_main.C index d884051402..0d0194127b 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -437,19 +437,19 @@ void LyX::init(bool gui) // Read configuration files // + // This one may have been distributed along with LyX. + readRcFile("lyxrc.dist"); + // This one is generated in user_support directory by lib/configure.py. readRcFile("lyxrc.defaults"); + system_lyxrc = lyxrc; system_formats = formats; system_converters = converters; system_movers = movers; system_lcolor = lcolor; - string prefsfile = "preferences"; - // back compatibility to lyxs < 1.1.6 - if (LibFileSearch(string(), prefsfile).empty()) - prefsfile = "lyxrc"; - if (!LibFileSearch(string(), prefsfile).empty()) - readRcFile(prefsfile); + // This one is edited through the preferences dialog. + readRcFile("preferences"); readEncodingsFile("encodings"); readLanguagesFile("languages"); @@ -666,19 +666,18 @@ bool LyX::queryUserLyXDir(bool explicit_userdir) void LyX::readRcFile(string const & name) { - lyxerr[Debug::INIT] << "About to read " << name << "..." << endl; + lyxerr[Debug::INIT] << "About to read " << name << "... "; string const lyxrc_path = LibFileSearch(string(), name); if (!lyxrc_path.empty()) { - lyxerr[Debug::INIT] << "Found " << name - << " in " << lyxrc_path << endl; + lyxerr[Debug::INIT] << "Found in " << lyxrc_path << endl; - if (lyxrc.read(lyxrc_path) >= 0) - return; - } + if (lyxrc.read(lyxrc_path) < 0) + showFileError(name); + } else + lyxerr[Debug::INIT] << "Not found." << lyxrc_path << endl; - showFileError(name); } diff --git a/status.14x b/status.14x index 2965b5593e..c52312a9ee 100644 --- a/status.14x +++ b/status.14x @@ -87,12 +87,15 @@ What's new - Replace the old sh version of lib/configure with the new python version lib/configure.py -- Fix lib/configure.py to find tex2lyx when compiling with - --with-version-suffix (bug 2285) - - It is not needed anymore to run lib/configure.py in the main LyX support directory. +- LyX now reads the file lyxrc.init (if it exists) before + lyxrc.defaults and preferences. + +- Fix lib/configure.py to find tex2lyx when compiling with + --with-version-suffix (bug 2285) + - Fix lib/configure.py to find tex2lyx if the path to it contains spaces. - Fix the code to find interface localization under Windows and Mac OS X.