Second try, this time with contextual diff and a changelog.


                
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 
Index: src/frontends/controllers/ChangeLog
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/controllers/ChangeLog,v
retrieving revision 1.469
diff -u -p -u -r1.469 ChangeLog
--- src/frontends/controllers/ChangeLog	2005/02/08 13:18:02	1.469
+++ src/frontends/controllers/ChangeLog	2005/03/17 04:12:52
@@ -1,3 +1,8 @@
+2005-03-15  Eitan Frachtenberg  <[EMAIL PROTECTED]>
+
+	* biblio.C(getInfo): Show BibTeX annotation in citation preview
+	* biblio.C(parseBibTex): Treat \% as percent, not comment
+
 2005-02-08  Lars Gullik Bjonnes  <[EMAIL PROTECTED]>
 
 	* ControlSpellchecker.C (nextWord): size() -> depth()
Index: src/frontends/controllers/biblio.C
===================================================================
RCS file: /cvs/lyx/lyx-devel/src/frontends/controllers/biblio.C,v
retrieving revision 1.70
diff -u -p -u -r1.70 biblio.C
--- src/frontends/controllers/biblio.C	2005/01/19 15:03:30	1.70
+++ src/frontends/controllers/biblio.C	2005/03/17 04:12:52
@@ -324,6 +324,7 @@ string const getInfo(InfoMap const & map
 	string number     = parseBibTeX(data, "number");
 	string volume     = parseBibTeX(data, "volume");
 	string pages      = parseBibTeX(data, "pages");
+	string annote     = parseBibTeX(data, "annote");
 
 	string media      = parseBibTeX(data, "journal");
 	if (media.empty())
@@ -352,6 +353,8 @@ string const getInfo(InfoMap const & map
 		result << ", pp. " << pages;
 	if (!year.empty())
 		result << ", " << year;
+	if (!annote.empty())
+		result << "\nAnnote: " << annote;
 
 	string const result_str = rtrim(result.str());
 	if (!result_str.empty())
@@ -480,7 +483,11 @@ string const parseBibTeX(string data, st
 		string::size_type const idx =
 			dummy.empty() ? string::npos : dummy.find('%');
 		if (idx != string::npos)
-			dummy.erase(idx, string::npos);
+			// Check if this is really a comment or just "\%"
+			if (idx == 0 || dummy.rfind('\\',idx) != idx - 1)
+				dummy.erase(idx, string::npos);
+                        else  //  This is "\%", so just erase the '\'
+				dummy.erase(idx - 1, 1);
 		// do we have a new token or a new line of
 		// the same one? In the first case we ignore
 		// the \n and in the second we replace it

Reply via email to