]> git.lyx.org Git - features.git/commitdiff
Some cleanup; fix a bug where bibtex entries list would have extraneous spaces.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 22 Dec 1999 14:35:05 +0000 (14:35 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 22 Dec 1999 14:35:05 +0000 (14:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@392 a592a061-630c-0410-9148-cb99ea01b6c8

ChangeLog
INSTALL
acconfig.h
configure.in
src/buffer.C
src/debug.C
src/insets/insetbib.C
src/insets/insetbib.h
src/insets/insetinclude.C
src/insets/insetinclude.h
src/support/filetools.C

index 0d710f2a172e0943c6fb887b49fe9ae0836fc9ae..23c190435af3697f081d9055eff5941219a7ce57 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,37 @@
+1999-12-22  Jean-Marc Lasgouttes  <Jean-Marc.Lasgouttes@inria.fr>
+
+       * src/buffer.C (getBibkeyList): pass the parameter delim to
+       InsetInclude::getKeys and InsetBibtex::getKeys.
+
+       * src/insets/insetinclude.[Ch] (getKeys): add parameter delim, which
+       is passed to Buffer::getBibkeyList
+       
+       * src/insets/insetbib.[Ch] (getKeys): add parameter delim, and use it
+       instead of the hardcoded comma.
+
+       * src/insets/insetbib.C (getKeys): make sure that there are not
+       leading blanks in bibtex keys. Normal latex does not care, but
+       harvard.sty seems to dislike blanks at the beginning of citation
+       keys. In particular, the retturn value of the function is
+
+       * INSTALL: make it clear that libstdc++ is needed and that gcc
+       2.7.x probably does not work.
+
+       * src/support/filetools.C (findtexfile): make debug message go to
+       the LATEX channel
+       * src/insets/insetbib.C (getKeys): ditto
+
+       * src/debug.C (showTags): make sure that the output is correctly
+       aligned. 
+
+       * configure.in: add a comment for TWO_COLOR_ICON define.
+
+       * acconfig.h: remove all the entries that already defined in
+       configure.in or acinclude.m4.
+
+       * src/buffer.C (makeLaTeXFile): headers of latex file also changed
+       to avoid user name, date and copyright.
+
 1999-12-21  Juergen Vigna  <jug@sad.it>
 
        * src/table.C (Read): Now read bogus row format informations
diff --git a/INSTALL b/INSTALL
index f3136328a4270659d308a8ca92190f84d0be92c9..e5d95b98ee64975a5dab11c5992624a1d5cc2a58 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -61,7 +61,13 @@ You will also need a recent C++ compiler, where recent means that the
 compilers knows a bit about the C++ standard. Compilers that are known
 to compile LyX are gcc 2.8.1 and 2.95.x, the various versions of egcs
 and Digital C++ version 6.1. Please tell us your experience with other
-compilers. 
+compilers. It is probably _not_ possible to compile LyX with gcc
+2.7.x, but this may change in the future. 
+
+Note that, contrary to LyX 1.0.x, LyX 1.1.x makes great use of C++
+Standard Template Library (STL); this means that gcc users will have
+to install the relevant libstdc++ library to be able to compile this
+version.
 
 If you make modifications to files in src/ (for example by applying a 
 patch), you will need to have the GNU gettext package installed, due to 
index 65a6d81d8145d8e06cffdcdc91823ba3032a41fd..ad67e70f6e4cbe158971c40da6a832af6680ac09 100644 (file)
 
 @TOP@
 
-/* Define on SunOS 4 and SCO, were some functions are missing from the headers */
-#undef BROKEN_HEADERS
-
-/* Define if you want debugging turned on as default. */
-#undef DEBUG_AS_DEFAULT
-
-/* Define if you are building a development version of LyX */
-#undef DEVEL_VERSION
-
 /* Define to 1 if NLS is requested.  */
 #undef ENABLE_NLS
 
-/* Define to nothing if your compiler does not understand the
-   `explicit' directive */
-#undef explicit
-
 /* define this to the location of forms.h to be used with #include,
   e.g. <forms.h> */
 #undef FORMS_H_LOCATION
 
-/* define this to the location of stl_string_fwd.h to be used with #include,
-  NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
-       supplied version of the header.
-  e.g. <../include/stl_string_fwd.h> or better yet use an absolute path */
-#undef STL_STRING_FWD_H_LOCATION
-
 /* Define if your locale.h file contains LC_MESSAGES.  */
 #undef HAVE_LC_MESSAGES
 
 /* Define as 1 if you have the stpcopy function */
 #undef HAVE_STPCPY
 
-#if 0
-/* Define if the bool type is known to your compiler */
-#undef HAVE_bool
-#endif
-
-/* Define to the name of the distribution.  */
-#undef PACKAGE
-
-/* You might want to define TWO_COLOR_ICONS if you want to spare
- your colormap.  This will use monochrome icons instead of colored
- ones. */
-#undef TWO_COLOR_ICONS
-
-/* Define to the version of the distribution.  */
-#undef VERSION
-
-/* Define this if you want to see the #warning directives put here and
-   there by the developpers to get attention */
-#undef WITH_WARNINGS
+/* define this to the location of stl_string_fwd.h to be used with #include,
+  NOTE: Do not set it to <stl_string_fwd.h> as that will find the LyX
+       supplied version of the header.
+  e.g. <../include/stl_string_fwd.h> or better yet use an absolute path */
+#undef STL_STRING_FWD_H_LOCATION
 
 /* define this to the location of xpm.h to be used with #include,
   e.g. <xpm.h> */
index 2c3ff8beae952c7d6764e438fed64b9d00bba852..fff073a48708282144f2cf8c9c4b2ce42bbed103 100644 (file)
@@ -193,7 +193,9 @@ AC_REPLACE_FUNCS(strerror atexit)
 
 ### and now some special lyx flags.
 AC_ARG_WITH(two-colors,[  --with-two-colors       use two color pixmaps],
-  [AC_DEFINE(TWO_COLOR_ICONS)
+  [AC_DEFINE(TWO_COLOR_ICONS,1,
+     [You might want to define TWO_COLOR_ICONS if you want to spare
+ your colormap.  This will use monochrome icons instead of colored ones.])
    lyx_flags="$lyx_flags two-colors"])
 AC_ARG_ENABLE(assertions,
   [  --enable-assertions     add runtime sanity checks in the program],,
index db7befb4fc01e357ec4081f01c0d9c38d33ea2df..76fe31fcda11e2546cc8f14536e4507db8043283 100644 (file)
@@ -1599,12 +1599,9 @@ void Buffer::makeLaTeXFile(string const & fname,
        string LFile;
        
        if (!only_body && nice) {
-               LFile += "%% This LaTeX-file was created by <";
-               LFile += userName + "> " + date();
-               LFile += "%% LyX 1.0 (C) 1995-1999 by Matthias Ettrich and the LyX Team\n";
-               LFile += "\n%% Do not edit this file unless you know what you are doing.\n";
-               texrow.newline();
-               texrow.newline();
+               LFile += "%% " LYX_DOCVERSION " created this file.  "
+                        "For more info, see http://www.lyx.org/.\n";
+               LFile += "%% Do not edit unless you really know what you are doing.\n";
                texrow.newline();
                texrow.newline();
        }
@@ -3917,9 +3914,9 @@ string Buffer::getBibkeyList(char delim)
                                if (inset-> LyxCode() == Inset::BIBTEX_CODE) {
                                        if (!bibkeys.empty())
                                                bibkeys += delim;
-                                       bibkeys += static_cast<InsetBibtex*>(inset)->getKeys();
+                                       bibkeys += static_cast<InsetBibtex*>(inset)->getKeys(delim);
                                } else if (inset-> LyxCode() == Inset::INCLUDE_CODE) {
-                                       string bk = static_cast<InsetInclude*>(inset)->getKeys();
+                                       string bk = static_cast<InsetInclude*>(inset)->getKeys(delim);
                                        if (!bk.empty()) {
                                                if (!bibkeys.empty())
                                                        bibkeys += delim;
index 4e34e35f3fba868caa95b0e306888044c30093f3..bb260cd308390cce6d508dd6cd3262bcb4399162 100644 (file)
@@ -14,6 +14,9 @@
 #include <config.h>
 #include "debug.h"
 
+#include <iomanip>
+using std::setw;
+
 struct error_item {
        Debug::type level;
        char const * name;
@@ -85,8 +88,8 @@ void Debug::showLevel(ostream & o, Debug::type level)
 void Debug::showTags(ostream & os) 
 {
        for (int i = 0 ; i < numErrorTags ; ++i)
-               os << "  " << errorTags[i].level
-                  << "  " << errorTags[i].name
+               os << setw(5) << errorTags[i].level
+                  << setw(10) << errorTags[i].name
                   << "  " << errorTags[i].desc << '\n';
        os.flush();
 }
index 4103ef383521fd02235fe5074b351d8c61065258..09040ef2d107d7c09ffa05954f9174eebe684b83 100644 (file)
@@ -350,7 +350,7 @@ int InsetBibtex::Latex(string & file, signed char /*fragile*/)
 
 
 // This method returns a comma separated list of Bibtex entries
-string InsetBibtex::getKeys()
+string InsetBibtex::getKeys(char delim)
 {
        // This hack is copied from InsetBibtex::Latex.
        // Is it still needed? Probably yes.
@@ -364,7 +364,7 @@ string InsetBibtex::getKeys()
        while(!tmp.empty()) {
                string fil = findtexfile(ChangeExtension(tmp, "bib", false),
                                         "bib");
-               lyxerr << "Bibfile: " << fil << endl;
+               lyxerr[Debug::LATEX] << "Bibfile: " << fil << endl;
                // If we didn't find a matching file name just fail silently
                if (!fil.empty()) {
                        // This is a _very_ simple parser for Bibtex database
@@ -374,6 +374,7 @@ string InsetBibtex::getKeys()
                        ifstream ifs(fil.c_str());
                        string linebuf;
                        while (getline(ifs, linebuf)) {
+                               linebuf = frontStrip(linebuf);
                                if (prefixIs(linebuf, "@")) {
                                        linebuf = subst(linebuf, '{', '(');
                                        linebuf = split(linebuf, tmp, '(');
@@ -382,9 +383,10 @@ string InsetBibtex::getKeys()
                                            && !prefixIs(tmp, "@preamble")) {
                                                linebuf = split(linebuf,
                                                                tmp, ',');
+                                               tmp = frontStrip(strip(tmp));
                                                if (!tmp.empty()) {
-                                                       keys += strip(tmp);
-                                                       keys += ", ";
+                                                       keys += tmp;
+                                                       keys += delim;
                                                }
                                        }
                                }
index d32eb34808f9d060db5cfc26555f175cb9c83bd5..fa57684d3c4c3db52af6f9706476fe3d2d94359a 100644 (file)
@@ -115,7 +115,7 @@ public:
        ///
        int Latex(string & file, signed char fragile);
        ///
-       string getKeys();
+       string getKeys(char delim);
        ///
        unsigned char Editable() const {
                return 1;
index 540552af24fa08c4ee0bd4b27d6febc36aca5a7e..6bccf7dfd3fab885aa1ca31b93e28ffd12edb452 100644 (file)
@@ -452,14 +452,14 @@ int InsetInclude::GetNumberOfLabels() const
 }
 
 
-string InsetInclude::getKeys() const
+string InsetInclude::getKeys(char delim) const
 {
        string lst;
        
        if (loadIfNeeded()) {
                Buffer *tmp = bufferlist.getBuffer(getFileName());
                tmp->setParentName(""); 
-               lst =  tmp->getBibkeyList(',');
+               lst =  tmp->getBibkeyList(delim);
                tmp->setParentName(getMasterFilename());
        }
        
index 9cceef197da976821824e11b326e9e91ed45641d..b0e1e84f5c11d22ffcebcb6e2ac23086e85c54f4 100644 (file)
@@ -45,7 +45,7 @@ public:
        /// This returns the list of labels on the child buffer
        string getLabel(int) const;
        /// This returns the list of bibkeys on the child buffer
-       string getKeys() const;
+       string getKeys(char delim) const;
        ///
        void Edit(int, int);
        ///
index 388022d9503334dc75357dcbcec59ec13532bacf..2ae0400dc5676c00663598b094354531743bff94 100644 (file)
@@ -1013,7 +1013,8 @@ string findtexfile(string const & fil, string const & format)
         string kpsecmd = "kpsewhich --format= " + format + " " + OnlyFilename(fil);
         cmdret c = do_popen(kpsecmd);
        
-        lyxerr << "kpse status = " << c.first << "\n"
-               << "kpse result = `" << strip(c.second, '\n') << "'" << endl;
+        lyxerr[Debug::LATEX] << "kpse status = " << c.first << "\n"
+                            << "kpse result = `" << strip(c.second, '\n') 
+                            << "'" << endl;
         return c.first != -1 ? strip(c.second, '\n') : string();
 }