[PATCH] Bug 3667

2007-05-23 Thread Richard Heck
The attached patch fixes this bug: crash on attempt to load non-existent
included document. The problem was that the parent name of the current
buffer was being set even if the document was not loaded (hit "cancel")
and, if the document is not loaded, then the current buffer doesn't
change, which means we're setting the parent name of the current buffer
to be that of the current buffer, which leads to a loop. The fix is
trivial once the problem is identified.

Seeking two OKs to commit.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Index: src/LyXFunc.cpp
===
--- src/LyXFunc.cpp	(revision 18481)
+++ src/LyXFunc.cpp	(working copy)
@@ -1413,18 +1413,20 @@
 			BOOST_ASSERT(lyx_view_);
 			FileName const filename =
 makeAbsPath(argument, lyx_view_->buffer()->filePath());
-			setMessage(bformat(_("Opening child document %1$s..."),
-			   makeDisplayPath(filename.absFilename(;
 			view()->saveBookmark(false);
 			string const parentfilename = lyx_view_->buffer()->fileName();
 			if (theBufferList().exists(filename.absFilename()))
 lyx_view_->setBuffer(theBufferList().getBuffer(filename.absFilename()));
 			else
-lyx_view_->loadLyXFile(filename);
-			// Set the parent name of the child document.
-			// This makes insertion of citations and references in the child work,
-			// when the target is in the parent or another child document.
-			lyx_view_->buffer()->setParentName(parentfilename);
+if (lyx_view_->loadLyXFile(filename)) {
+	// Set the parent name of the child document.
+	// This makes insertion of citations and references in the child work,
+	// when the target is in the parent or another child document.
+	lyx_view_->buffer()->setParentName(parentfilename);
+	setMessage(bformat(_("Opening child document %1$s..."),
+			 makeDisplayPath(filename.absFilename(;
+} else
+	setMessage(_("Document not loaded."));
 			break;
 		}
 


Re: [PATCH] HTML Export Bugs

2007-05-23 Thread Georg Baum
Richard Heck wrote:

> Georg Baum wrote:
>> Richard Heck wrote:
>>
>>   
>>> This is the result of a problem that Uwe noticed the other day with the
>>> MikTeX implementation of the htlatex scripts: The scripts will not run
>>> properly unless they are run in the same directory as the original file.
>>> 
>> Several other converters (e.g. lilypond) have the same limitation.
>> Therefore LyX changes to the temp dir before running the converter. It
>> would even be possible to call the converter with relative filenames, I
>> am not sure anymore why absolute paths are used.
> Don't know. It was that way before.

I know, because it was me who changed it from relative to absolute paths ;-)
What I don't know anymore are the reasons for doing so, and whether they do
still exist.

>> IMHO if you create a subdirectory LyX
>> should change to that subdirectory before running the converter.
>>   
> It does.
>>> The solution suggested in some
>>> earlier discussion was to ship a small shell script with LyX that would
>>> copy the .tex file to the temporary directory and then run htlatex on
>>> that file. Thoughts?
>>> 
>> The .tex file _is_ in the temporary direcory. All conversions are run in
>> the temp dir, I hope you did not change that.
>>   
> I didn't. I meant it should copy it to the NEW temporary directory, e.g.:
> /tmp/lyx_098weras/lyx_tmpbuf0/file.html.conversion/
> which is where the converted files will be dumped.

Why not do that in LyX (with the copier to fix paths of included files) and
call the converter with the copied file, with the current working directory
being the new temp dir? In fact I assumed that you did that. In theory it
wastes some disk space and time for copying, but I believe that you won't
notice that in practice and the benefit of not having to create a wrapper
script outweighs the disadvantage.


Georg



Re: symlinks

2007-05-23 Thread Richard Heck
Andre Poenitz wrote:
> On Wed, May 23, 2007 at 04:09:50PM -0400, Richard Heck wrote:
>   
>> Is it safe to use the create_symlink function from boost::filesystems?
>> Are there platforms on which we want LyX to run that don't handle symlinks?
>> 
> You mean Windows?
>   
Except Vista, as I've learned. I had thought Windows did do symlinks but
not hard links, but apparently only by cheating.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: [PATCH] lstinputlisting in InsetInclude should also increase "listing" counter, bug 3708

2007-05-23 Thread Juergen Spitzmueller
José Matos wrote:

> I will wait for Jürgen's input on this one. :-)

I cannot test now, but (apart from some formatting issues, i.e. line
lengths) it looks sensible to me.

Jürgen



Re: [Bug 3676] Citation Problems

2007-05-23 Thread Andre Poenitz
On Wed, May 23, 2007 at 07:51:31PM +0100, José Matos wrote:
> On Wednesday 23 May 2007 7:09:58 am Andre Poenitz wrote:
> > I guess it would be enough to throw just once and make up the other
> > five...
> 
>   I have made it finally using old methods. :-)

You mean by killing the opponents? Is that still legal in Portugal?

Andre'


Re: symlinks

2007-05-23 Thread Andre Poenitz
On Wed, May 23, 2007 at 04:09:50PM -0400, Richard Heck wrote:
> Is it safe to use the create_symlink function from boost::filesystems?
> Are there platforms on which we want LyX to run that don't handle symlinks?

You mean Windows?

Andre'


[PATCH] Trivial patch to fix warning

2007-05-23 Thread Richard Heck
The attached removes a few pointless calls from QInclude.cpp that do
nothing but cause a warning to be written to the console. OK to commit?

rh

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Index: src/frontends/qt4/QInclude.cpp
===
--- src/frontends/qt4/QInclude.cpp	(revision 18481)
+++ src/frontends/qt4/QInclude.cpp	(working copy)
@@ -276,10 +276,8 @@
 	int const item = dialog_->typeCO->currentIndex();
 	if (item == 0) {
 		params.setCmdName("include");
-		params.setOptions(string());
 	} else if (item == 1) {
 		params.setCmdName("input");
-		params.setOptions(string());
 	} else if (item == 3) {
 		params.setCmdName("lstinputlisting");
 		// the parameter string should have passed validation
@@ -296,7 +294,6 @@
 			params.setCmdName("verbatiminput*");
 		else
 			params.setCmdName("verbatiminput");
-		params.setOptions(string());
 	}
 	controller().setParams(params);
 }


[PATCH] Fix crash 2199

2007-05-23 Thread Richard Heck
The attached addresses http://bugzilla.lyx.org/show_bug.cgi?id=2199,
crash on inclusion of files on which lyx2lyx chokes. The problem seems
to have been with the logic generally. It seems to have been assumed
that a file that could not be loaded wasn't a LyX file at all, but the
buffer for it was left open.

There's another logic issue I've fixed along the way. I'd appreciate if
someone would look at this, too. It's the return statement I've put
after "if (runparams.inComment || runparams.dryrun)". It doesn't seem to
me that we should be doing all the other stuff in this case, but I could
be wrong.

Seeking two OKs to commit.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Index: InsetInclude.cpp
===
--- InsetInclude.cpp	(revision 18481)
+++ InsetInclude.cpp	(working copy)
@@ -389,12 +389,14 @@
 		if (!fs::exists(included_file.toFilesystemEncoding()))
 			return false;
 		buf = theBufferList().newBuffer(included_file.absFilename());
-		if (!loadLyXFile(buf, included_file))
+		if (!loadLyXFile(buf, included_file)) {
+			//close the buffer we just opened
+			theBufferList().close(buf, false);
 			return false;
+		}
 	}
-	if (buf)
-		buf->setParentName(parentFilename(buffer));
-	return buf != 0;
+	buf->setParentName(parentFilename(buffer));
+	return true;
 }
 
 
@@ -416,7 +418,9 @@
 	//FIXME RECURSIVE INCLUDE
 	//This isn't sufficient, as the inclusion could be downstream.
 	//But it'll have to do for now.
-	if (!isListings(params_) && buffer.fileName() == included_file.toFilesystemEncoding()) {
+	if (!isListings(params_) && 
+		buffer.fileName() == included_file.toFilesystemEncoding()) 
+	{
 		Alert::error(_("Recursive input"), 
 		   bformat(_("Attempted to include file %1$s in itself! "
 		   "Ignoring inclusion."), from_utf8(incfile)));
@@ -435,8 +439,9 @@
 
 	// write it to a file (so far the complete file)
 	string const exportfile = changeExtension(incfile, ".tex");
-	string const mangled = DocFileName(changeExtension(included_file.absFilename(),
-			".tex")).mangledFilename();
+	string const mangled = 
+		DocFileName(changeExtension(included_file.absFilename(),".tex")).
+			mangledFilename();
 	FileName const writefile(makeAbsPath(mangled, m_buffer->temppath()));
 
 	if (!runparams.nice)
@@ -447,8 +452,11 @@
 
 	if (runparams.inComment || runparams.dryrun)
 		// Don't try to load or copy the file
-		;
-	else if (loadIfNeeded(buffer, params_)) {
+		return true;
+	else if (isLyXFilename(included_file.absFilename())) {
+		if (!loadIfNeeded(buffer, params_))
+			return false;
+			
 		Buffer * tmp = theBufferList().getBuffer(included_file.absFilename());
 
 		if (tmp->params().textclass != m_buffer->params().textclass) {


[PATCH] Bug 3717, 3718

2007-05-23 Thread Bo Peng

Bug 3717 reveals two problems:

1. {}\n is not properly handled
2. [LaTeX]TeX should be surrounded by {}

Bug 3718 is for save/read parameter string with '"'. This can happen
if a user input caption={"someting with quote"} in the advanced tab,
in settings->text layout->listings, or some advanced parameters with
quote (language definition etc).

Solution to 1: trivial
Solution to 2: automatically surround all parameters with
non-ascii/digit characters with {}.
Solution to 3: replace " with " (and & with &)

Fixing these problems are not difficult but I decide to change the
internal structure of InsetListingsParams from a 'always-valid' string
to map. The major reason is that isFloat, getParamValue
are frequently called, but they are slow because params_ need to be
parsed each time. Also, using map, as shown in the
attached patch, simplifies some implementations.

The attached patch overkills these bugs so it may introduce some new
bugs. Please test before you OK it.

Thanks.
Bo
Index: src/insets/InsetListingsParams.h
===
--- src/insets/InsetListingsParams.h	(revision 18476)
+++ src/insets/InsetListingsParams.h	(working copy)
@@ -12,7 +12,7 @@
 #ifndef INSETLISTINGSPARAMS_H
 #define INSETLISTINGSPARAMS_H
 
-#include 
+#include 
 #include 
 #include "Lexer.h"
 #include "InsetCollapsable.h"
@@ -35,7 +35,7 @@
 	void read(Lexer &);
 
 	/// valid parameter string
-	std::string params() const { return params_; }
+	std::string params(std::string sep=",") const;
 	
 	/// add key=value to params_
 	void addParam(std::string const & key, std::string const & value);
@@ -79,13 +79,9 @@
 	/// inline or normal listings
 	bool inline_;
 
-	/// listing parameters, this will always be a *valid* string
-	/// that can be passed to listing packages.
-	std::string params_;
+	/// key-value pairs of the parameters 
+	std::map params_;
 
-	/// keys defined in params_ 
-	std::vector keys_;
-
 	/// collapsable status
 	InsetCollapsable::CollapseStatus status_;
 };
Index: src/insets/InsetInclude.cpp
===
--- src/insets/InsetInclude.cpp	(revision 18477)
+++ src/insets/InsetInclude.cpp	(working copy)
@@ -529,7 +529,7 @@
 		// opt is set in QInclude dialog and should have passed validation.
 		InsetListingsParams params(opt);
 		if (!params.params().empty())
-			os << "[" << from_utf8(params.encodedString()) << "]";
+			os << "[" << from_utf8(params.params()) << "]";
 		os << '{'  << from_utf8(incfile) << '}';
 	} else {
 		runparams.exportdata->addExternalFile(tex_format, writefile,
Index: src/insets/InsetListings.cpp
===
--- src/insets/InsetListings.cpp	(revision 18476)
+++ src/insets/InsetListings.cpp	(working copy)
@@ -128,7 +128,7 @@
 int InsetListings::latex(Buffer const & buf, odocstream & os,
 		OutputParams const & runparams) const
 {
-	string param_string = params().encodedString();
+	string param_string = params().params();
 	// NOTE: I use {} to quote text, which is an experimental feature
 	// of the listings package (see page 25 of the manual)
 	int lines = 0;
Index: src/insets/InsetListingsParams.cpp
===
--- src/insets/InsetListingsParams.cpp	(revision 18476)
+++ src/insets/InsetListingsParams.cpp	(working copy)
@@ -20,18 +20,23 @@
 #include 
 
 #include "support/lstrings.h"
+#include "support/textutils.h"
 #include "support/convert.h"
 
+using std::map;
 using std::vector;
 using std::ostream;
 using std::string;
 using std::exception;
 using lyx::support::bformat;
 using lyx::support::trim;
+using lyx::support::subst;
 using lyx::support::isStrInt;
 using lyx::support::prefixIs;
 using lyx::support::suffixIs;
 using lyx::support::getVectorFromString;
+using lyx::isAlphaASCII;
+using lyx::isDigit;
 
 namespace lyx
 {
@@ -455,13 +460,13 @@
 
 
 InsetListingsParams::InsetListingsParams() :
-	inline_(false), params_(), keys_(0), status_(InsetCollapsable::Open)
+	inline_(false), params_(), status_(InsetCollapsable::Open)
 {
 }
 
 
 InsetListingsParams::InsetListingsParams(string const & par, bool in, InsetCollapsable::CollapseStatus s)
-	: inline_(in), params_(), keys_(0), status_(s)
+	: inline_(in), params_(), status_(s)
 {
 	// this will activate parameter validation.
 	fromEncodedString(par);
@@ -491,6 +496,22 @@
 }
 
 
+string InsetListingsParams::params(string sep) const
+{
+	string par;
+	for (map::const_iterator it = params_.begin();
+		it != params_.end(); ++it) {
+		if (!par.empty())
+			par += sep;
+		if (it->second.empty())
+			par += it->first;
+		else
+			par += it->first + '=' + it->second;
+	}
+	return par;
+}
+
+
 void InsetListingsParams::addParam(string const & key, string const & value)
 {	
 	if (key.empty())
@@ -498,25 +519,33 @@
 	// exception may be thown.
 	parValidator(key).validate(value);
 	// duplicate parameters!
-	if (find(keys_.begin(), keys

incorrect commit in changeset 18478

2007-05-23 Thread Uwe Stöhr

Edwin,

your commit:
http://www.lyx.org/trac/changeset/18478
broke the build system because you didn't update the make and SCons files. I 
repaired this part:
http://www.lyx.org/trac/changeset/18481

Why did you remove the attic folder? Did you get an OK from two developers to do this; I can't find 
this in the list.

If this was correct, then please also modify the makefile and SCons file to 
reflect this change.

thanks and regards
Uwe


Re: [patch] Math macros not imported, Bug #21

2007-05-23 Thread José Matos
On Thursday 24 May 2007 00:25:46 Uwe Stöhr wrote:
> As André gave his OK and me too this can go in right?

  Yep. :-)

> regards Uwe

-- 
José Abílio


Re: [PATCH] HTML Export

2007-05-23 Thread Richard Heck

Never mind...see the other message.

Enrico Forestieri wrote:
> On Wed, May 23, 2007 at 06:04:59PM -0400, Richard Heck wrote:
>   
>> Enrico (and anyone else who is interested),
>>
>> Can you try one and let me know if it works properly on Windows? I
>> believe it should, even with the broken htlatex.  The idea is to copy
>> whatever files we need to the temporary conversion directory. Then we
>> can do everything without paths.
>> 
>
> I get the following errors when compiling:
>
> if g++ -DHAVE_CONFIG_H -I. -I../../src -I.   -I../../boost -Wno-uninitialized 
>  -O2 -MT Converter.o -MD -MP -MF ".deps/Converter.Tpo" -c -o Converter.o 
> ../../src/Converter.cpp; \
> then mv -f ".deps/Converter.Tpo" ".deps/Converter.Po"; else rm -f 
> ".deps/Converter.Tpo"; exit 1; fi
> ../../src/Converter.cpp: In member function `bool 
> lyx::Converters::convert(const lyx::Buffer*, const lyx::support::FileName&, 
> lyx::support::FileName&, const lyx::support::FileName&, bool&, const 
> std::string&, const std::string&, lyx::ErrorList&, int)':
> ../../src/Converter.cpp:557: error: `auxname' undeclared (first use this 
> function)
> ../../src/Converter.cpp:557: error: (Each undeclared identifier is reported 
> only once for each function it appears in.)
> ../../src/Converter.cpp:558: error: `bblname' undeclared (first use this 
> function)
> ../../src/Converter.cpp:560: error: expected primary-expression before "catch"
> ../../src/Converter.cpp:560: error: expected `;' before "catch"
> ../../src/Converter.cpp:562: error: expected `catch' before "res"
> ../../src/Converter.cpp:562: error: expected `(' before "res"
> ../../src/Converter.cpp:562: error: `res' is not a type
> ../../src/Converter.cpp:562: error: invalid catch parameter
> ../../src/Converter.cpp:562: error: expected `)' before '=' token
> ../../src/Converter.cpp:562: error: expected `{' before '=' token
> ../../src/Converter.cpp:562: error: expected primary-expression before '=' 
> token
> ../../src/Converter.cpp:591: error: invalid initialization of reference of 
> type 'const std::string&' from expression of type 'lyx::support::FileName'
> ../../src/support/filetools.h:240: error: in passing argument 2 of `const 
> lyx::support::FileName lyx::support::makeAbsPath(const std::string&, const 
> std::string&)'
> ../../src/Converter.cpp:650: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:650: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:692: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:692: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:705: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:705: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:719: error: expected primary-expression before 
> "namespace"
> ../../src/Converter.cpp:719: error: expected `;' before "namespace"
> ../../src/Converter.cpp:737: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:737: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:780: error: expected primary-expression before "void"
> ../../src/Converter.cpp:780: error: expected `;' before "void"
> ../../src/Converter.cpp:795: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:795: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:810: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:810: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:821: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:821: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:832: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:832: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp:840: error: a function-definition is not allowed here 
> before '{' token
> ../../src/Converter.cpp:840: error: expected `,' or `;' before '{' token
> ../../src/Converter.cpp: At global scope:
> ../../src/Converter.cpp:845: error: expected `}' at end of input
> make[3]: *** [Converter.o] Error 1
> make[3]: Leaving directory `/usr/local/src/lyx/lyx-devel/build-cygwin/src'
> make[2]: *** [all-recursive] Error 1
> make[2]: Leaving directory `/usr/local/src/lyx/lyx-devel/build-cygwin/src'
> make[1]: *** [all] Error 2
> make[1]: Leaving directory `/usr/local/src/lyx/lyx-devel/build-cygwin/src'
> make: *** [all-recursive] Error 1
>
>   


-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign y

Re: htlatex and Windows

2007-05-23 Thread Richard Heck
Enrico Forestieri wrote:
> On Wed, May 23, 2007 at 12:00:58PM -0400, Richard Heck wrote:
>   
> I tested the patch on linux and I found some quirks. The least important
> is that when exporting to html, the export dir is filled with byproduct
> files such as .dvi, .aux, .log, .idv, and others which have nothing to
> do with the export itself. 
These files are generated by htlatex, which is calling pplatex
repeatedly, and they are therefore over-writing files that the previous
latex conversion may have done. So they're actually new files, and the
script should probably be checking not just for files that didn't exist
but for ones newly generated, since (for all we know) they are part of
the conversion.
> The most important is that dvipng cannot find
> graphics files, which are therefore left blank. I think that this is due
> to the fact that they are not in the directory which is the current one
> when htlatex is called.
>   
Yes, that would be the reason, and it is obviously a problem.
> Notice that both problems above are avoided when using the wrapper for
> htlatex that I posted previously. So, my proposal is to convert that
> script in python, place it in the lib/scripts directory and use it as
> the converter on all platforms when htlatex is detected.
>   
I'll think about this further. I'd like to have something more general
than htlatex---something that would work whenever we need a bunch of
files to be generated. So I think something like this should probably be
put into the Converter.cpp code directly.
>> I'll implement this when I get a chance, probably tonight. Should be 
>> pretty painless.
>> 
> Mmm... my impression is that this is less straightforward than it seems...
>   
Right you were.

rh


-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: [patch] Math macros not imported, Bug #21

2007-05-23 Thread Uwe Stöhr

> I would like to hear what André has to say about this patch. :-)

As André gave his OK and me too this can go in right?

regards Uwe


Re: [PATCH] HTML Export

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 06:04:59PM -0400, Richard Heck wrote:
> 
> Enrico (and anyone else who is interested),
> 
> Can you try one and let me know if it works properly on Windows? I
> believe it should, even with the broken htlatex.  The idea is to copy
> whatever files we need to the temporary conversion directory. Then we
> can do everything without paths.

I get the following errors when compiling:

if g++ -DHAVE_CONFIG_H -I. -I../../src -I.   -I../../boost -Wno-uninitialized  
-O2 -MT Converter.o -MD -MP -MF ".deps/Converter.Tpo" -c -o Converter.o 
../../src/Converter.cpp; \
then mv -f ".deps/Converter.Tpo" ".deps/Converter.Po"; else rm -f 
".deps/Converter.Tpo"; exit 1; fi
../../src/Converter.cpp: In member function `bool 
lyx::Converters::convert(const lyx::Buffer*, const lyx::support::FileName&, 
lyx::support::FileName&, const lyx::support::FileName&, bool&, const 
std::string&, const std::string&, lyx::ErrorList&, int)':
../../src/Converter.cpp:557: error: `auxname' undeclared (first use this 
function)
../../src/Converter.cpp:557: error: (Each undeclared identifier is reported 
only once for each function it appears in.)
../../src/Converter.cpp:558: error: `bblname' undeclared (first use this 
function)
../../src/Converter.cpp:560: error: expected primary-expression before "catch"
../../src/Converter.cpp:560: error: expected `;' before "catch"
../../src/Converter.cpp:562: error: expected `catch' before "res"
../../src/Converter.cpp:562: error: expected `(' before "res"
../../src/Converter.cpp:562: error: `res' is not a type
../../src/Converter.cpp:562: error: invalid catch parameter
../../src/Converter.cpp:562: error: expected `)' before '=' token
../../src/Converter.cpp:562: error: expected `{' before '=' token
../../src/Converter.cpp:562: error: expected primary-expression before '=' token
../../src/Converter.cpp:591: error: invalid initialization of reference of type 
'const std::string&' from expression of type 'lyx::support::FileName'
../../src/support/filetools.h:240: error: in passing argument 2 of `const 
lyx::support::FileName lyx::support::makeAbsPath(const std::string&, const 
std::string&)'
../../src/Converter.cpp:650: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:650: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:692: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:692: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:705: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:705: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:719: error: expected primary-expression before 
"namespace"
../../src/Converter.cpp:719: error: expected `;' before "namespace"
../../src/Converter.cpp:737: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:737: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:780: error: expected primary-expression before "void"
../../src/Converter.cpp:780: error: expected `;' before "void"
../../src/Converter.cpp:795: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:795: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:810: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:810: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:821: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:821: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:832: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:832: error: expected `,' or `;' before '{' token
../../src/Converter.cpp:840: error: a function-definition is not allowed here 
before '{' token
../../src/Converter.cpp:840: error: expected `,' or `;' before '{' token
../../src/Converter.cpp: At global scope:
../../src/Converter.cpp:845: error: expected `}' at end of input
make[3]: *** [Converter.o] Error 1
make[3]: Leaving directory `/usr/local/src/lyx/lyx-devel/build-cygwin/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/lyx/lyx-devel/build-cygwin/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/local/src/lyx/lyx-devel/build-cygwin/src'
make: *** [all-recursive] Error 1

-- 
Enrico


Re: [PATCH] lstinputlisting in InsetInclude should also increase "listing" counter, bug 3708

2007-05-23 Thread José Matos
On Wednesday 23 May 2007 20:30:20 Bo Peng wrote:
> The attached patch update the "listing" counter if the InsetInclude
> inset contains lstinputlisting and has a caption. If also set
> InsetInclude label to "Program listing X" when needed.
>
> OK to commit?
>
> The only problem I can see is that the counters are not updated
> immediately after, for example, add/remove caption of such an inset.

  I will wait for Jürgen's input on this one. :-)

> Bo

-- 
José Abílio


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 10:43:54PM +0200, Herbert Voss wrote:
> Enrico Forestieri wrote:
> > On Wed, May 23, 2007 at 05:38:21PM +0200, Jean-Marc Lasgouttes wrote:
> >>> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:
> > 
> >> Enrico> Going further in your reasoning we should also make difficult
> >> Enrico> the use of tables as many people misuse them, too!
> >>
> >> I know you could find a better example, if you tried harder ;) The
> >> \foostyle commands are about forcing TeX to do what it does not want
> >> to do.
> > 
> > Even if TeX is right most of the time, sometimes it is wrong. The example
> > of a continued fraction comes to mind. In this case the fraction looks
> > much better when you enforce \displaystyle.
> 
> 
> \cfrac[opt arg]{..}{...} does it all ...

This doesn't seem to be standard LaTeX and LyX doesn't support it,
seemingly. Sorry Herbert, it's a while that I don't write something
directly in LaTeX, except for some preamble stuff...

-- 
Enrico


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 10:39:56PM +0200, Jean-Marc Lasgouttes wrote:
> > "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:
> 
> 
> >>  I know you could find a better example, if you tried harder ;) The
> >> \foostyle commands are about forcing TeX to do what it does not
> >> want to do.
> 
> Enrico> Even if TeX is right most of the time, sometimes it is wrong.
> Enrico> The example of a continued fraction comes to mind. In this
> Enrico> case the fraction looks much better when you enforce
> Enrico> \displaystyle.
> 
> So the commands are reserved to people who have read enough of the TeX
> book. Do these people need an icon? 

I don't think so. And to tell you the truth, I was opening the math
panel only when I had to insert a matrix because it was so clumsy that
I was either directly writing the macros or using shorcuts. But those
beautiful toolbar buttons changed somewhat that. Yes, I understand
what you mean and I think that I can type those dozen chars when I
need \displaystyle ;-)

-- 
Enrico


Re: htlatex and Windows

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 12:00:58PM -0400, Richard Heck wrote:
> Enrico Forestieri wrote:
> > Unfortunately, htlatex on Windows only works when you call it with a
> > simple filename without a path (either absolute or relative), so the
> > tempdir approach will not work the way you thought it. However, thanks
> > to your patch, I modified my htlatex script (I attach it here) and now
> > I am able to both view and export to html.
> >
> > I know that it is cumbersome, but may be the same logic could be adopted
> > in the LyX sources, i.e., take a snapshot of what files are present before
> > calling htlatex and then move any generated file in the conversion dir.
> > Anyway, the script works like a charm and could be translated in python
> > in order to use it in native Windows builds in place of htlatex.exe. 
> >   
> This seems like a lot of work in the LyX code to fix what is clearly a 
> bug in an external converter. What we could do, however, and what would 
> help (as Georg mentioned elsewhere) with other converters, too, is to 
> copy the input file to the new temporary directory and then run the 
> conversion against it, in which case we can do it using just the 
> filename. Indeed, we can just create a soft link (this works on Windows, 
> right?), so as not to have the file-copying overhead, and then delete it 
> when we're done. Then, I think, everything will work as it should. (And 
> man, won't it be nice to have working HTML export?)

I tested the patch on linux and I found some quirks. The least important
is that when exporting to html, the export dir is filled with byproduct
files such as .dvi, .aux, .log, .idv, and others which have nothing to
do with the export itself. The most important is that dvipng cannot find
graphics files, which are therefore left blank. I think that this is due
to the fact that they are not in the directory which is the current one
when htlatex is called.

Notice that both problems above are avoided when using the wrapper for
htlatex that I posted previously. So, my proposal is to convert that
script in python, place it in the lib/scripts directory and use it as
the converter on all platforms when htlatex is detected.

As regards symlinks, they only work with cygwin, not in a native
environment. Windows shortcuts are something different and are not
really symlinks. However, I heard that symlinks are supported in Vista.

> I'll implement this when I get a chance, probably tonight. Should be 
> pretty painless.

Mmm... my impression is that this is less straightforward than it seems...

-- 
Enrico


Re: No math dialog

2007-05-23 Thread Edwin Leuven

Edwin Leuven wrote:

Leuven, E. wrote:

so then i suggest the attached patch. it

- introduces toolbar_toggle lfun
- adds a "toggle math toolbar" and "toggle table toolbar" buttons to 
the main toolbar

 (i also moved "toggle toc" there)
- adds a "toggle math panels" button to the math toolbar
- reshuffles the Big Operators panel to avoid confusion with the sum 
icon on the math toolbar

- adds some icons



since i consider to have an ok from josé and jürgen i will commit 
tonight (unless someone shouts out real LOUD)


here you go:

http://www.lyx.org/trac/changeset/18478


[PATCH] HTML Export

2007-05-23 Thread Richard Heck

Enrico (and anyone else who is interested),

Can you try one and let me know if it works properly on Windows? I
believe it should, even with the broken htlatex.  The idea is to copy
whatever files we need to the temporary conversion directory. Then we
can do everything without paths.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Index: lib/configure.py
===
--- lib/configure.py	(revision 18454)
+++ lib/configure.py	(working copy)
@@ -348,7 +348,7 @@
 rc_entry = [ r'\converter word   latex  "%%"	""' ])
 #
 checkProg('a LaTeX -> MS Word converter', ["htlatex $$i 'html,word' 'symbol/!' '-cvalidate'"],
-rc_entry = [ r'\converter latex  wordhtml   "%%"	"originaldir,needaux"' ])
+rc_entry = [ r'\converter latex  wordhtml   "%%"	"usetempdir,needaux"' ])
 #
 checkProg('an OpenOffice.org -> LaTeX converter', ['w2l -clean $$i'],
 rc_entry = [ r'\converter sxwlatex  "%%"	""' ])
@@ -359,10 +359,6 @@
 checkProg('a LaTeX -> Open Document converter', ['oolatex $$i', 'oolatex.sh $$i'],
 rc_entry = [ r'\converter latex  odt"%%"	"latex"' ])
 #
-#FIXME Looking for the commands needed to make oolatex output sxw instad of odt...
-#checkProg('a LaTeX -> OpenOffice.org (sxw) converter', ['oolatex $$i', 'oolatex.sh $$i'],
-#rc_entry = [ r'\converter latex  odt"%%"	"latex"' ])
-# On windows it is called latex2rt.exe
 checkProg('a LaTeX -> RTF converter', ['latex2rtf -p -S -o $$o $$i', 'latex2rt -p -S -o $$o $$i'],
 rc_entry = [ r'\converter latex  rtf"%%"	"needaux"' ])
 #
@@ -431,7 +427,7 @@
 #
 checkProg('a LaTeX -> HTML converter', ['htlatex $$i', 'tth  -t -e2 -L$$b < $$i > $$o', \
 'latex2html -no_subdir -split 0 -show_section_numbers $$i', 'hevea -s $$i'],
-rc_entry = [ r'\converter latex  html   "%%"	"originaldir,needaux"' ])
+rc_entry = [ r'\converter latex  html   "%%"	"usetempdir,needaux"' ])
 #
 path, lilypond = checkProg('a LilyPond -> EPS/PDF/PNG converter', ['lilypond'])
 if (lilypond != ''):
Index: src/Converter.h
===
--- src/Converter.h	(revision 18461)
+++ src/Converter.h	(working copy)
@@ -55,10 +55,11 @@
 	bool latex;
 	/// The converter is xml
 	bool xml;
-	/// Do we need to run the converter in the original directory?
-	bool original_dir;
 	/// This converter needs the .aux files
 	bool need_aux;
+	/// This converter should put its files in a separate temporary
+	/// directory
+	bool use_temp_dir;
 	/// If the converter put the result in a directory, then result_dir
 	/// is the name of the directory
 	std::string result_dir;
@@ -123,6 +124,14 @@
 	 support::FileName const & orig_from,
 	 std::string const & from_format, std::string const & to_format,
 	 ErrorList & errorList, int conversionflags = none);
+	/// used_tmp_dir is a flag that signals whether our output files were put into
+	/// a temporary directory. Note also that to_file will be changed so that it points 
+	/// at the converted file in this case.
+	bool convert(Buffer const * buffer,
+	 support::FileName const & from_file, support::FileName & to_file,
+	 support::FileName const & orig_from, bool & used_temp_dir,
+	 std::string const & from_format, std::string const & to_format,
+	 ErrorList & errorList, int conversionflags = none);
 	///
 	void update(Formats const & formats);
 	///
Index: src/Converter.cpp
===
--- src/Converter.cpp	(revision 18461)
+++ src/Converter.cpp	(working copy)
@@ -31,6 +31,7 @@
 #include "support/Path.h"
 #include "support/Systemcall.h"
 
+#include 
 
 namespace lyx {
 
@@ -63,8 +64,8 @@
 using std::distance;
 
 namespace Alert = lyx::frontend::Alert;
+namespace fs = boost::filesystem;
 
-
 namespace {
 
 string const token_from("$$i");
@@ -118,7 +119,8 @@
 		 string const & c, string const & l)
 	: from(f), to(t), command(c), flags(l),
 	  From(0), To(0), latex(false), xml(false),
-	  original_dir(false), need_aux(false)
+	  need_aux(false),
+		use_temp_dir(false)
 {}
 
 
@@ -133,8 +135,8 @@
 			latex = true;
 		else if (flag_name == "xml")
 			xml = true;
-		else if (flag_name == "originaldir")
-			original_dir = true;
+		else if (flag_name == "usetempdir")
+			use_temp_dir = true;
 		else if (flag_name == "needaux")
 			need_aux = true;
 		else if (fl

Re: UTF8->UCS4 failure on FreeBSD 6.2-RELEASE

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 05:20:52PM +0200, Jean-Marc Lasgouttes wrote:
> > "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:
> 
> Enrico> When sizeof(wchar_t) != 4 or wchar_t is not present, then our
> Enrico> facets implementation should kick in. I use it with no
> Enrico> problems in both cygwin and mingw, don't know about other
> Enrico> platforms.
> 
> Do you have a simple program to test whether the facet works? I seem
> to remember that you did it at the time.

I think that you are confusing me with Georg here. He had written
some tests at the time. In this field, he is the master, I'm only
an apprentice ;-)

http://thread.gmane.org/gmane.editors.lyx.devel/66786

> And can we force to use our implementation in some cases?

I think so, but the implementation must match the compiler internals,
that's why an explicit check for the gcc version is also made.

-- 
Enrico


Re: [PATCH] Fixing cursors in multiview mode

2007-05-23 Thread Angus Leeming
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> > The only simple solution I can think of right now is to emit a signal in 
> > the Inset destructor that we can connect to the CursorSlice. The 
> > CursorSlice will then invalidate itself.
> 
> Here is what I came up with. In principle this should solve all problems 
> of invalid cursors. Unfortunately it doesn't compile... somebody has an 
> idea why?
> 
> Compiling...
> MathMacroTemplate.cpp
> D:\devel\lyx\trunk\boost\boost/signals/detail/signal_base.hpp(150) : 
> error C2248: 'boost::noncopyable_::noncopyable::operator =' : cannot 
> access private member declared in class 'boost::noncopyable_::noncopyable'

You can't copy boost::signals. That means that either you're going to have to 
define a copy constructor for the Inset holding the signal member or you need 
to define a NonCopyableSignal wrapper to boost::signal that defines a no-op 
copy constructor...

Angus



Re: Wiki Bug List

2007-05-23 Thread Jean-Marc Lasgouttes
> "Richard" == Richard Heck <[EMAIL PROTECTED]> writes:

Richard> And you're the guy who can add that, right?

Right.

JMarc


Re: Wiki Bug List

2007-05-23 Thread Richard Heck
Jean-Marc Lasgouttes wrote:
> Richard> Should the "critical" and "major" bug lists also check the
> Richard> milestone? I've just reset 1474 to milestone 1.6.0, because
> Richard> I'm morally certainly no-one is going to fix such an obscure
> Richard> crash before 1.5.0. But it still shows up on the list
>
> We also have or should have a 1.5.x milestone for bugs that (c|s)hould be
> fixed in the 1.5 timeframe (because they look easy enough).
>   
And you're the guy who can add that, right?

rh

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: symlinks

2007-05-23 Thread Richard Heck
Jean-Marc Lasgouttes wrote:
> Richard> So does this seems sensible?
>
> Why do you want symlinks actually?
It's not a big deal, but the solution I've worked out to various
problems with the converter code (e.g., in the case of htlatex) involves
copying the file we're converting from (infile, in the code), and
possibly also the aux file and bbl file, into a (new) temporary
directory LYXTMP/file.format.conversion and doing the conversion there.
Copying is fine, but a waste if we can symlink to the files. As I said,
not a big deal, but more efficient with symlinks.

Richard


-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: Wiki Bug List

2007-05-23 Thread Jean-Marc Lasgouttes
> "Richard" == Richard Heck <[EMAIL PROTECTED]> writes:

Richard> Should the "critical" and "major" bug lists also check the
Richard> milestone? I've just reset 1474 to milestone 1.6.0, because
Richard> I'm morally certainly no-one is going to fix such an obscure
Richard> crash before 1.5.0. But it still shows up on the list

We also have or should have a 1.5.x milestone for bugs that (c|s)hould be
fixed in the 1.5 timeframe (because they look easy enough).

JMarc


Re: symlinks

2007-05-23 Thread Jean-Marc Lasgouttes
> "Richard" == Richard Heck <[EMAIL PROTECTED]> writes:

Richard> So does this seems sensible?

Why do you want symlinks actually?

JMarc


Re: Wiki Bug List

2007-05-23 Thread Richard Heck
Abdelrazak Younes wrote:
> Richard Heck wrote:
>> Should the "critical" and "major" bug lists also check the milestone?
> Yes IMO.
OK, then. Done. I can't do it for regressions, as too many of those have
no milestone set and maybe shouldn't. But I can try to go through these
at some point.

rh



-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: Wiki Bug List

2007-05-23 Thread Abdelrazak Younes

Richard Heck wrote:

Should the "critical" and "major" bug lists also check the milestone?


Yes IMO.

Abdel.



Re: [PATCH] Fixing cursors in multiview mode

2007-05-23 Thread Abdelrazak Younes

Abdelrazak Younes wrote:

Jean-Marc Lasgouttes wrote:
"Abdelrazak" == Abdelrazak Younes 
<[EMAIL PROTECTED]> writes:


Abdelrazak> Stefan Schimanski wrote:

The attached patch fixes that. It should fix also a number of
other situation where cursor may be invalidated. I had to add a
test in Cursor::fixIfBroken() for the case were we are not inside
an Inset but in the main Text.

 Nice! Testing it for a few minutes now. Looks fine. Couldn't cause
a crash yet.


Abdelrazak> I need a second OK. JMarc?

The general idea is correct, but...

Originally, fixIfBroken got the cursor out of insets when coordinates
were different. Now you add a different test at level 1 the just
resets the values. It would be better to rewrite fixIfBroken to do at
each level

- go out of the inset if the value of cur.inset() is not correct wrt
  previous level.


How can I do that? If I erase an inset in one view while the cursor was 
in this very inset in the other view, how can I know that the inset the 
CursorSlice is referring to has been deleted?


The only simple solution I can think of right now is to emit a signal in 
the Inset destructor that we can connect to the CursorSlice. The 
CursorSlice will then invalidate itself.


Here is what I came up with. In principle this should solve all problems 
of invalid cursors. Unfortunately it doesn't compile... somebody has an 
idea why?


Compiling...
MathMacroTemplate.cpp
D:\devel\lyx\trunk\boost\boost/signals/detail/signal_base.hpp(150) : 
error C2248: 'boost::noncopyable_::noncopyable::operator =' : cannot 
access private member declared in class 'boost::noncopyable_::noncopyable'
D:\devel\lyx\trunk\boost\boost/noncopyable.hpp(28) : see 
declaration of 'boost::noncopyable_::noncopyable::operator ='
D:\devel\lyx\trunk\boost\boost/noncopyable.hpp(22) : see 
declaration of 'boost::noncopyable_::noncopyable'
This diagnostic occurred in the compiler generated function 
'boost::signals::detail::signal_base 
&boost::signals::detail::signal_base::operator =(const 
boost::signals::detail::signal_base &)'

InsetMathRef.cpp
D:\devel\lyx\trunk\boost\boost/signals/detail/signal_base.hpp(150) : 
error C2248: 'boost::noncopyable_::noncopyable::operator =' : cannot 
access private member declared in class 'boost::noncopyable_::noncopyable'
D:\devel\lyx\trunk\boost\boost/noncopyable.hpp(28) : see 
declaration of 'boost::noncopyable_::noncopyable::operator ='
D:\devel\lyx\trunk\boost\boost/noncopyable.hpp(22) : see 
declaration of 'boost::noncopyable_::noncopyable'
This diagnostic occurred in the compiler generated function 
'boost::signals::detail::signal_base 
&boost::signals::detail::signal_base::operator =(const 
boost::signals::detail::signal_base &)'

InsetMathHull.cpp
D:\devel\lyx\trunk\boost\boost/signals/detail/signal_base.hpp(150) : 
error C2248: 'boost::noncopyable_::noncopyable::operator =' : cannot 
access private member declared in class 'boost::noncopyable_::noncopyable'
D:\devel\lyx\trunk\boost\boost/noncopyable.hpp(28) : see 
declaration of 'boost::noncopyable_::noncopyable::operator ='
D:\devel\lyx\trunk\boost\boost/noncopyable.hpp(22) : see 
declaration of 'boost::noncopyable_::noncopyable'
This diagnostic occurred in the compiler generated function 
'boost::signals::detail::signal_base 
&boost::signals::detail::signal_base::operator =(const 
boost::signals::detail::signal_base &)'

Generating Code...

Abdel.
Index: BufferView.cpp
===
--- BufferView.cpp  (revision 18473)
+++ BufferView.cpp  (working copy)
@@ -215,6 +215,10 @@
cursor_.setSelection();
// do not set selection to the new buffer because we
// only paste recent selection.
+
+   // Make sure that the restored cursor is not broken. 
This can happen for
+   // example if this Buffer has been modified by another 
view.
+   cursor_.fixIfBroken();
}
}
 
Index: Cursor.cpp
===
--- Cursor.cpp  (revision 18473)
+++ Cursor.cpp  (working copy)
@@ -1299,44 +1299,10 @@
 
 void Cursor::fixIfBroken()
 {
-   // find out last good level
-   Cursor copy = *this;
-   size_t newdepth = depth();
-   while (!copy.empty()) {
-   if (copy.idx() > copy.lastidx()) {
-   lyxerr << "wrong idx " << copy.idx()
-  << ", max is " << copy.lastidx()
-  << " at level " << copy.depth()
-  << ". Trying to correct this."  << endl;
-   lyxerr << "old: " << *this << endl;
-   newdepth = copy.depth() - 1;
-   }
-   else if (copy.pit() > copy.lastpit()) {
-   lyxerr << "wrong pit " << copy.pi

Wiki Bug List

2007-05-23 Thread Richard Heck

Should the "critical" and "major" bug lists also check the milestone?
I've just reset 1474 to milestone 1.6.0, because I'm morally certainly
no-one is going to fix such an obscure crash before 1.5.0. But it still
shows up on the list

rh

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: symlinks

2007-05-23 Thread Richard Heck
Jean-Marc Lasgouttes wrote:
> Richard> Is it safe to use the create_symlink function from
> Richard> boost::filesystems? Are there platforms on which we want LyX
> Richard> to run that don't handle symlinks?
>
> Windows?
>   

So does this seems sensible?

namespace {
// A little helper for what follows
// Throws fs::filesystem_error
void forceSymlink(string const & target, string const & link)
{
if (fs::exists(link))
fs::remove(link);
#ifdef _WIN32
fs::copy_file(target, link);
#else
fs::create_symlink(target, link);
#endif
}
}


Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto




Re: symlinks

2007-05-23 Thread Richard Heck
Jean-Marc Lasgouttes wrote:
> Richard> Is it safe to use the create_symlink function from
> Richard> boost::filesystems? Are there platforms on which we want LyX
> Richard> to run that don't handle symlinks?
>
> Windows?
>   
I thought Windows did do symlinks but not hard links. Google tells me I
was wrong---though Vista apparently does support true symlinks. I
suppose that's one good thing about it.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Herbert Voss
Enrico Forestieri wrote:
> On Wed, May 23, 2007 at 05:38:21PM +0200, Jean-Marc Lasgouttes wrote:
>>> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:
> 
>> Enrico> Going further in your reasoning we should also make difficult
>> Enrico> the use of tables as many people misuse them, too!
>>
>> I know you could find a better example, if you tried harder ;) The
>> \foostyle commands are about forcing TeX to do what it does not want
>> to do.
> 
> Even if TeX is right most of the time, sometimes it is wrong. The example
> of a continued fraction comes to mind. In this case the fraction looks
> much better when you enforce \displaystyle.


\cfrac[opt arg]{..}{...} does it all ...

Herbert



Re: symlinks

2007-05-23 Thread Jean-Marc Lasgouttes
> "Richard" == Richard Heck <[EMAIL PROTECTED]> writes:

Richard> Is it safe to use the create_symlink function from
Richard> boost::filesystems? Are there platforms on which we want LyX
Richard> to run that don't handle symlinks?

Windows?

JMarc


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:


>>  I know you could find a better example, if you tried harder ;) The
>> \foostyle commands are about forcing TeX to do what it does not
>> want to do.

Enrico> Even if TeX is right most of the time, sometimes it is wrong.
Enrico> The example of a continued fraction comes to mind. In this
Enrico> case the fraction looks much better when you enforce
Enrico> \displaystyle.

So the commands are reserved to people who have read enough of the TeX
book. Do these people need an icon? 

I am only half serious about it, or 2/3 serious. But we should think
about it.

JMarc



Re: General stability issues, moving out of lyx

2007-05-23 Thread Jean-Marc Lasgouttes
> "Stanislaw" == Stanislaw Kalicinski <[EMAIL PROTECTED]> writes:

Stanislaw> Hi Jean-Marc, I'm using LyX 1.4.4 on WinXP and also
Stanislaw> experienced a truncated documents problem.

Stanislaw> I can't reproduce it, but if my memory serves me well, once
Stanislaw> I started playing with different paragraph environments for
Stanislaw> the same piece (or maybe even different pieces?) of text
Stanislaw> and suddenly realized that at the bottom of the document
Stanislaw> there are no many items (bibliography, acknowledgments
Stanislaw> etc.). Using undo I could revert to the "initial" state of
Stanislaw> the document. While clicking "undo" I could see additional
Stanislaw> pieces of the document appearing one after another. Kind
Stanislaw> regards

Hi Stanislaw,

First, please keep such discussion on the list, since we need as many
eyes as possible to fix suh bugs.

I would be _very_ interested to have a reproducible test case.

JMarc


symlinks

2007-05-23 Thread Richard Heck
Is it safe to use the create_symlink function from boost::filesystems?
Are there platforms on which we want LyX to run that don't handle symlinks?

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



[PATCH] lstinputlisting in InsetInclude should also increase "listing" counter, bug 3708

2007-05-23 Thread Bo Peng

The attached patch update the "listing" counter if the InsetInclude
inset contains lstinputlisting and has a caption. If also set
InsetInclude label to "Program listing X" when needed.

OK to commit?

The only problem I can see is that the counters are not updated
immediately after, for example, add/remove caption of such an inset.

Bo
Index: src/insets/InsetInclude.cpp
===
--- src/insets/InsetInclude.cpp	(revision 18476)
+++ src/insets/InsetInclude.cpp	(working copy)
@@ -107,7 +107,7 @@
 InsetInclude::InsetInclude(InsetCommandParams const & p)
 	: params_(p), include_label(uniqueID()),
 	  preview_(new RenderMonitoredPreview(this)),
-	  set_label_(false)
+	  set_label_(false), counter_(0)
 {
 	preview_->fileChanged(boost::bind(&InsetInclude::fileChanged, this));
 }
@@ -118,7 +118,7 @@
 	  params_(other.params_),
 	  include_label(other.include_label),
 	  preview_(new RenderMonitoredPreview(this)),
-	  set_label_(false)
+	  set_label_(false), counter_(0)
 {
 	preview_->fileChanged(boost::bind(&InsetInclude::fileChanged, this));
 }
@@ -336,9 +336,13 @@
 		case INCLUDE:
 			temp += buf.B_("Include");
 			break;
-		case LISTINGS:
-			temp += buf.B_("Program Listing");
+		case LISTINGS: {
+			if (counter_ > 0)
+temp += buf.B_("Program Listing ") + convert(counter_);
+			else
+temp += buf.B_("Program Listing");
 			break;
+		}
 	}
 
 	temp += ": ";
@@ -882,6 +886,20 @@
 }
 
 
+void InsetInclude::updateCounter(Counters & counters)
+{
+	if (!isListings(params_))
+		return;
+
+	bool hasCaption = !InsetListingsParams(params_.getOptions()).getParamValue("caption").empty();
+	if (hasCaption) {
+		counters.step(from_ascii("listing"));
+		counter_ = counters.value(from_ascii("listing"));
+	} else
+		counter_ = 0;
+}
+
+
 string const InsetIncludeMailer::name_("include");
 
 InsetIncludeMailer::InsetIncludeMailer(InsetInclude & inset)
Index: src/insets/InsetInclude.h
===
--- src/insets/InsetInclude.h	(revision 18476)
+++ src/insets/InsetInclude.h	(working copy)
@@ -16,6 +16,7 @@
 #include "InsetCommandParams.h"
 #include "RenderButton.h"
 #include "MailInset.h"
+#include "Counters.h"
 
 #include "support/FileName.h"
 
@@ -99,6 +100,9 @@
 	void updateLabels(Buffer const & buffer) const;
 	///
 	bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
+	/// if this inset contains lstinputlisting and has a caption, 
+	/// update internal counter and passed counter
+	void updateCounter(Counters & counters);
 protected:
 	InsetInclude(InsetInclude const &);
 	///
@@ -133,6 +137,7 @@
 	/// cache
 	mutable bool set_label_;
 	mutable RenderButton button_;
+	int counter_;
 };
 
 
Index: src/buffer_funcs.cpp
===
--- src/buffer_funcs.cpp	(revision 18476)
+++ src/buffer_funcs.cpp	(working copy)
@@ -419,6 +419,10 @@
 		}
 		else if (inset.lyxCode() == Inset::LISTINGS_CODE)
 			setCaptionLabels(inset, "listing", from_ascii("Listing"), counters);
+		else if (inset.lyxCode() == Inset::INCLUDE_CODE)
+			// if this include inset contains lstinputlisting, and has a caption
+			// it will increase the 'listing' counter by one
+			static_cast(inset).updateCounter(counters);
 	}
 }
 


Re: Quick test of listings, some small issues

2007-05-23 Thread Bo Peng

On 5/23/07, José Matos <[EMAIL PROTECTED]> wrote:

On Wednesday 23 May 2007 5:03:44 pm Bo Peng wrote:
> > I should have noticed this when (partially) fixing the `recursive
> > includes' problem. I didn't.
>
> OK. Jose, can the following go in?

  It seems reasonable. OK.


Committed. Fixes bug 3707.

Bo


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 05:38:21PM +0200, Jean-Marc Lasgouttes wrote:
> > "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:

> Enrico> Going further in your reasoning we should also make difficult
> Enrico> the use of tables as many people misuse them, too!
> 
> I know you could find a better example, if you tried harder ;) The
> \foostyle commands are about forcing TeX to do what it does not want
> to do.

Even if TeX is right most of the time, sometimes it is wrong. The example
of a continued fraction comes to mind. In this case the fraction looks
much better when you enforce \displaystyle.

-- 
Enrico


Re: Scrolling lag in 1.5svn again, -dbg 8 output

2007-05-23 Thread Peter Kümmel
Peter Kümmel wrote:
> When you run with -dbg 8 you will see the how full the
> x11 queue is. Here it is never more than 1 event in the queue,

Hope you could understand these sentences ;)

Peter


Re: lyx2lyx fails to convert userguide in recent 1.5 svn?

2007-05-23 Thread José Matos
On Wednesday 23 May 2007 12:07:06 pm Helge Hafting wrote:
> If I have a working lyx 1.5 installed and runs a compiled LyX from
> the build directory, then it works.
>
> If I do a "make install" then lyx will start but fail to open
> the userguide as "lyx2lyx" fails to convert it. I can't even
> make a new document, as lyx2lyx fails to convert the default template.
>
> Known problem, or something I can fix somehow? Trouble
> with make install?

  Known problem and known solution. :-)

  Please test the patch I sent in the other message, if it works I propose to 
apply it.

  Any objection?

> Helge Hafting

-- 
José Abílio


Re: Quick test of listings, some small issues

2007-05-23 Thread José Matos
On Wednesday 23 May 2007 5:03:44 pm Bo Peng wrote:
> > I should have noticed this when (partially) fixing the `recursive
> > includes' problem. I didn't.
>
> OK. Jose, can the following go in?

  It seems reasonable. OK.

-- 
José Abílio


Re: Scrolling lag in 1.5svn again, -dbg 8 output

2007-05-23 Thread Peter Kümmel
Thanks for the intensive testing, Helge!

Helge Hafting wrote:
> void lyx::BufferView::updateScrollbar() Updating scrollbar: height: 1175 curr 
> par: 905 default height 32
> scrolling: one event posted
> void lyx::BufferView::scrollDocView(int)[ value = 259297]
> void lyx::BufferView::updateScrollbar() Updating scrollbar: height: 1175 curr 
> par: 905 default height 32
> scrolling: one event posted

This output shows the problem: all scroll events are posted
even when the xsever hasn't finishes the last one.

One way to fix this is to replace the flush() call with
QApplication::syncX(), then on each event LyX is waiting
for the xserver, but this gives bad scroll performance.

Attached a patch which also checks if the x11-queue is empty
(<2: page down doesn't work with <1 -> the patch becomes more
and more a hack).

When you run with -dbg 8 you will see the how full the
x11 queue is. Here it is never more than 1 event in the queue,
seems this is the reason why I coudn't reproduce your scrolling
bug. I hope you see numbers bigger than 1.

What for a linux distro is on your system? Maybe it is the xserver
configuration.

Peter
Index: src/frontends/qt4/GuiWorkArea.cpp
===
--- src/frontends/qt4/GuiWorkArea.cpp   (Revision 18433)
+++ src/frontends/qt4/GuiWorkArea.cpp   (Arbeitskopie)
@@ -54,6 +54,10 @@
 int const CursorWidth = 1;
 #endif
 
+#ifdef Q_WS_X11
+#include 
+extern "C" int XEventsQueued(Display *display, int mode);
+#endif
 
 using std::endl;
 using std::string;
@@ -63,6 +67,17 @@
 
 namespace lyx {
 
+#ifdef Q_WS_X11
+bool xEventsProcessed() { 
+   QApplication::flush();
+   int events = XEventsQueued(QX11Info::display(), 0 /* QueuedAlready */) 
== 0;
+   LYXERR(Debug::GUI) << "X11 queue " << events << "  \n";
+   return events < 2;
+}
+#else
+bool xEventsProcessed() { return true; }
+#endif
+
 using support::FileName;
 
 /// return the LyX key state from Qt's
@@ -190,8 +205,11 @@
 
// Initialize the vertical Scroll Bar
QObject::connect(verticalScrollBar(), SIGNAL(actionTriggered(int)),
-   this, SLOT(adjustViewWithScrollBar(int)));
+   this, SLOT(generateLyxScrollEvent()));
+   QObject::connect(verticalScrollBar(), SIGNAL(sliderReleased()),
+   this, SLOT(lyxScrollEvent()));
 
+
// disable context menu for the scrollbar
verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);
 
@@ -211,6 +229,53 @@
 }
 
 
+
+class LyxScrollEvent : public QEvent
+{
+public:
+   LyxScrollEvent() : QEvent(QEvent::Type(id)) 
+   {}
+   static int id;
+   static bool locked;
+};
+
+// Qt doc: user event type between 1000 and 65535
+int LyxScrollEvent::id = 31415;
+bool LyxScrollEvent::locked = false;
+
+
+class LyxKeyEvent : public QKeyEvent
+{
+public:
+   LyxKeyEvent(QKeyEvent * e) : 
+ QKeyEvent(QEvent::Type(id), e->key(), 
+   e->modifiers(), e->text(), e->isAutoRepeat(), 
e->count())
+   {}
+   static int id;
+   static bool locked;
+};
+
+int LyxKeyEvent::id = 27182;
+bool LyxKeyEvent::locked = false;
+
+
+
+bool GuiWorkArea::event(QEvent * event)
+{
+   if (event->type() == LyxKeyEvent::id) {
+   lyxKeyEvent(dynamic_cast(event));
+   LyxKeyEvent::locked = false;
+   return true;
+   } else if (event->type() == LyxScrollEvent::id) {
+   lyxScrollEvent();
+   LyxScrollEvent::locked = false;
+   return true;
+   } else {
+   return QAbstractScrollArea::event(event);
+   }
+}
+
+
 void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int 
scroll_line_step)
 {
if (verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOn)
@@ -231,12 +296,30 @@
 }
 
 
-void GuiWorkArea::adjustViewWithScrollBar(int)
+void GuiWorkArea::lyxScrollEvent()
 {
scrollBufferView(verticalScrollBar()->sliderPosition());
 }
 
 
+void GuiWorkArea::generateLyxScrollEvent()
+{
+   // This gives the old slow (the scroll bar couldn't follow the mouse)
+   // scrolling on Windows. Is it really better? 
+   // Windows/Qt is here not as fast as X11
+   //lyxScrollEvent();return;
+
+   // multiple scroll events are merged into one
+   if (!LyxScrollEvent::locked && xEventsProcessed()) {
+   LyxScrollEvent::locked = true;
+   LyxScrollEvent* scrollEvent = new LyxScrollEvent;
+   QCoreApplication::postEvent(this, scrollEvent);
+   LYXERR(Debug::GUI) << "scrolling: one event posted" << endl;
+   } else {
+   LYXERR(Debug::GUI) << "scrolling: waiting for processing last 
scrolling event" << endl;
+   }
+}
+
 void GuiWorkArea::dragEnterEvent(QDragEnterEvent * event)
 {
if (event->mimeData()->hasUrls())
@@ -389,13 +472,14 @@
int const lines = qApp->wheelScrollLines() * e->delta() / 120;
verticalScrollBar()->setValue

Re: [Bug 3676] Citation Problems

2007-05-23 Thread José Matos
On Wednesday 23 May 2007 7:09:58 am Andre Poenitz wrote:
> I guess it would be enough to throw just once and make up the other
> five...

  I have made it finally using old methods. :-)

> Andre'

-- 
José Abílio


Re: Scrolling lag in 1.5svn again, processEvents - success

2007-05-23 Thread José Matos
On Wednesday 23 May 2007 12:04:17 pm Helge Hafting wrote:
> I guess a different version of lyx2lyx ran when I ran lyx from the
> build directory instead of installing it. :-/

  If you run lyx2lyx from the build dir instead of the source dir you have to 
add an environment variable to be able to run it:

$ PYTHONPATH=../../lyx/lyx-devel/lib/lyx2lyx/ src/lyx&

  Where path points to the source dir.

The other option is to test the attached patch. Does it works for you?

> Helge Hafting

-- 
José Abílio
Index: lib/lyx2lyx/LyX.py
===
--- lib/lyx2lyx/LyX.py	(revision 18390)
+++ lib/lyx2lyx/LyX.py	(working copy)
@@ -26,8 +26,11 @@
 import re
 import time
 
-import lyx2lyx_version
-version_lyx2lyx = lyx2lyx_version.version
+try:
+import lyx2lyx_version
+version_lyx2lyx = lyx2lyx_version.version
+except: # we are running from build directory so assume the last version
+version_lyx2lyx = '1.5.0svn'
 
 default_debug_level = 2
 


Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Bo Peng

On 5/23/07, Juergen Spitzmueller <[EMAIL PROTECTED]> wrote:

Herbert Voss wrote:

> from the manual *tbph for float and tbp for floatplacement


Then here comes the patch:

1. disallow h in floatplacement and allow * in float

-   { "float", "false", true,  SUBSETOF, "tbph", "" },
-   { "floatplacement", "tbp", false, SUBSETOF, "tbph", "" },
+   { "float", "false", true,  SUBSETOF, "*tbph", "" },
+   { "floatplacement", "tbp", false, SUBSETOF, "tbp", "" },

2. allow input of * in the placement text editor.

Index: src/frontends/qt4/QListings.cpp
===
--- src/frontends/qt4/QListings.cpp (revision 18476)
+++ src/frontends/qt4/QListings.cpp (working copy)
@@ -208,7 +208,7 @@
   numberStepLE->setValidator(new QIntValidator(0, 100, this));
   firstlineLE->setValidator(new QIntValidator(0, 100, this));
   lastlineLE->setValidator(new QIntValidator(0, 100, this));
-   placementLE->setValidator(new
QRegExpValidator(QRegExp("[tbph]*"), this));
+   placementLE->setValidator(new
QRegExpValidator(QRegExp("[\*tbph]*"), this));

3. output float=xxx. I.e. treat placement as the editor for float.
(previously, we output float,floatplacement=xxx).

-   if (float_)
-   par.addParam("float", "");
-   if (!placement.empty())
-   par.addParam("floatplacement", placement);
+   // this dialog uses float=placement instead of
float,floatplacement=placement
+   // because float accepts *tbph and floatplacement accepts bph.
+   // our placement textedit is actually for the float parameter
+   if (float_) {
+   if (placement.empty())
+   par.addParam("float", "");
+   else
+   par.addParam("float", placement);
+   }

4. Leave floatplacement to 'advanced'.

-   } else if (prefixIs(*it, "floatplacement=")) {
-   dialog_->floatCB->setChecked(true);
-   dialog_->placementLE->setEnabled(true);
-   dialog_->placementLE->setText(
-   toqstr(plainParam(it->substr(15;
-   dialog_->inlineCB->setChecked(false);
-   *it = "";

Please test.

Bo
Index: src/insets/InsetListingsParams.cpp
===
--- src/insets/InsetListingsParams.cpp	(revision 18476)
+++ src/insets/InsetListingsParams.cpp	(working copy)
@@ -72,7 +72,7 @@
 	// info is a \n separated string with allowed values
 	// SUBSETOF
 	// info is a string from which par is composed of
-	// (e.g. floatplacement can be one or more of tbph)
+	// (e.g. floatplacement can be one or more of *tbph)
 	param_type type;
 	/// parameter info, meaning depending on parameter type
 	char const * info;
@@ -115,8 +115,8 @@
 /// options copied from page 26 of listings manual
 // FIXME: add default parameters ... (which is not used now)
 listings_param_info const listings_param_table[] = {
-	{ "float", "false", true,  SUBSETOF, "tbph", "" },
-	{ "floatplacement", "tbp", false, SUBSETOF, "tbph", "" },
+	{ "float", "false", true,  SUBSETOF, "*tbph", "" },
+	{ "floatplacement", "tbp", false, SUBSETOF, "tbp", "" },
 	{ "aboveskip", "\\medskipamount", false, LENGTH, "", "" },
 	{ "belowskip", "\\medskipamount", false, LENGTH, "", "" },
 	{ "lineskip", "", false, LENGTH, "", "" },
Index: src/frontends/qt4/QListings.cpp
===
--- src/frontends/qt4/QListings.cpp	(revision 18476)
+++ src/frontends/qt4/QListings.cpp	(working copy)
@@ -208,7 +208,7 @@
 	numberStepLE->setValidator(new QIntValidator(0, 100, this));
 	firstlineLE->setValidator(new QIntValidator(0, 100, this));
 	lastlineLE->setValidator(new QIntValidator(0, 100, this));
-	placementLE->setValidator(new QRegExpValidator(QRegExp("[tbph]*"), this));
+	placementLE->setValidator(new QRegExpValidator(QRegExp("[\*tbph]*"), this));
 }
 
 
@@ -287,10 +287,15 @@
 		else
 			par.addParam("language", "{[" + dialect + "]" + language + "}");
 	}
-	if (float_)
-		par.addParam("float", "");
-	if (!placement.empty())
-		par.addParam("floatplacement", placement);
+	// this dialog uses float=placement instead of float,floatplacement=placement
+	// because float accepts *tbph and floatplacement accepts bph.
+	// our placement textedit is actually for the float parameter
+	if (float_) {
+		if (placement.empty())
+			par.addParam("float", "");
+		else
+			par.addParam("float", placement);
+	}
 	if (numberSide != "none")
 		par.addParam("numbers", numberSide);
 	if (numberfontsize != "default" && numberSide != "none")
@@ -505,13 +510,6 @@
 			dialog_->languageCO->setEnabled(in_gui);
 			dialog_->dialectCO->setEnabled(
 in_gui && dialog_->dialectCO->count() > 1);
-		} else if (prefixIs(*it, "floatplacement=")) {
-			dialog_->floatCB->setChecked(true);
-			dial

2007 LyX Meeting: Invitation

2007-05-23 Thread Martin Vermeer

INVITATION

Hereby I invite everyone interested to participate in the ?th International
LyX Developers' Meeting in Bromarv, Western Uusimaa, municipality of Ekenäs.

Time: 
Long weekend August 11. Arrival, e.g., August 9 or 10, departure August 13 or
14. These are no hard limits.

August 2007
Su Mo Tu We Th Fr Sa
  1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

How to travel

1) By air: Fly to Helsinki airport (Vantaa) and take the Finnair bus (5.20e)
to the city centre. From there, a long-distance bus goes twice a (working) day,
once in the weekend. A single ticket costs 27e.

MONDAY-SUNDAY DESTINATION   MONDAY - SUNDAY MONDAY - FRIDAY
09.40 Bromarv20.00   14.25
10.00 Tenala / Tenhola   19.40   14.05
10.15 Ekenäs / Tammisaari19.25   13.50
10.20 Ekenäs / Tammisaari19.20   13.45
10.40RKaris / Karjaa 19.00R  I
10.50 Karis / Karjaa 18.55   I
11.15 Ingå kby / Inkoo kk*   18.35   13.15
11.25 Degerby vsk / th   18.20   13.05
11.40 Kyrkslätt vsk / Kirkkonummi th 18.10   12.55 
12.10 Helsingfors / Helsinki 17.40   12.30

2) By sea: Bromarv has a small yacht harbour some 7 km from our summer home. It 
is behind an archipelago and a high-Hausdorf-dimension coastline, 
so make sure your nav gear and charts are up to snuff.

Facilities: We have two real beds in a real guestroom, but be prepared to sleep
on a mattress on the floor. There is also a small sauna cabin with sleeping 
places. We have (in the main house) 240 V / 50 Hz and warm and cold running
water though. Connectivity is ADSL wireless + four ethernet ports. Bring your
own laptop + cabling / card. Bringing a spare modem and a hub would be a good
idea -- just in case.

Weather: probably rather warm, 20-28 C. May rain, but rarely very long. There
is a sand beach close by, so take your swimming gear along! The nights are
dark already, but auroras are not very likely (though not impossible) at the
present stage of the solar cycle.

My mobile phone: +358 50 3574139  to arrange for the pick-up at Bromarv bus 
stop.

Welcome!

- Martin


Re: Ctrl-B toggles bold state of a mixed selection

2007-05-23 Thread Andre Poenitz
On Wed, May 23, 2007 at 03:11:50PM +0200, Jean-Marc Lasgouttes wrote:
> > "Darren" == Darren Freeman <[EMAIL PROTECTED]> writes:
> 
> Darren> On Wed, 2007-05-23 at 11:43 +0200, Helge Hafting wrote:
> >> Darren Freeman wrote: > Did anybody howl when XForms was dropped?
> >> >   
> >> Yes they did, for xforms has much better display performance than
> >> qt. Even you seems to complain about slowness - I hope this can be
> >> optimized.
> 
> Darren> But.. it.. wasn't.. free.. :)
> 
> It was since version 1.0. It has admittedly died since then.

I think it died before, but Angus Potemkin made it appear otherwise...

Andre'


Re: Scrolling lag in 1.5svn again, more details.

2007-05-23 Thread Andre Poenitz
On Wed, May 23, 2007 at 12:13:16PM +0200, Helge Hafting wrote:
> Dov Feldstern wrote:
> >Peter Kümmel wrote:
> >>
> >>I'm running out of ideas...
> >>Is this patch better (the flush call is new)?
> >>Or with processEvents instead of flush?
> >>
> >
> >event_2.patch works for me --- but then again event_1 did, too. Again, 
> >this is on linux. Scrolling appears to be fine (both with arrow keys 
> >and page-up and page-down, and with the scrollbars). I don't see any 
> >overshoot, either -- scrolling stops as soon as I stop pressing (or 
> >within a split-second).
> Can you try this with the machine being really busy?  For example,
> test scrollbar scrolling with a maximized window, while the machine
> is busy compiling LyX? Or make it busy by running a simple
> script to make it waste time:
> 
> File loadscript:
> ./loadscript

cat /dev/zero > /dev/null  gives a predictable constant load of 1.

Andre'


Re: Rarely used keybindings?

2007-05-23 Thread Andre Poenitz
On Wed, May 23, 2007 at 05:25:24PM +1000, John Pye wrote:
> Along these lines of standard key-bindings, I vote for ctrl-I to be used
> for creating italics, rather than ctrl-E, which I always slip off and
> press ctrl-R, with dangerous consequences if I have my hand poised over
> the 'enter' key!

Ctrl-I has been 'toggle inset' since its invention.



Re: Skipping lines on cursor down

2007-05-23 Thread Stefan Schimanski
All that below of course should be a better way to implement cursorUp/ 
Down in display math (after removing the mentioned magic margin in  
Text::cursorUp/Down which was needed according to Martin for display  
math).


Stefan

I am not completely sure how to do this in the right way, but what  
we need something like this:


Index: src/Cursor.cpp
===
--- src/Cursor.cpp  (Revision 18436)
+++ src/Cursor.cpp  (Arbeitskopie)
@@ -1101,10 +1101,18 @@
// no such inset found, just take something "above"
if (!popLeft()) {
+   // ask text to move cursor
+   if (up)
+   const_cast(text())->cursorUp 
(*this);

+   else
+   const_cast(text())- 
>cursorDown(*this);

+   return true;
+/*
//lyxerr << "updown: popleft failed  
(strange case)" << endl;

int ylow  = up ? 0 : yo + 1;
int yhigh = up ? yo - 1 : bv().workHeight();
return bruteFind(*this, xo, yo, 0, bv 
().workWidth(), ylow, yhigh);

+   */
}
// any improvement so far?


The idea is that the cursor tried to query all the inset on the  
path to move the cursor up/down. If none can do that (i.e. popLeft 
() == false), a bruteFind was done. Instead the cursorUp/Down of  
the text must be called to move into the next/previous paragraph.  
Of course the const_cast is not clean here. How can we do this in a  
cleaner way?


With this code the x_target_ is changed to the position of the  
display math. I think it's more natural to keep the x_target of the  
text paragraph instead. For that in Text::cursorUp/Down another  
test would be needed to test if the next paragraph is a display  
math. How do I do that?


Stefan




PGP.sig
Description: Signierter Teil der Nachricht


Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Juergen Spitzmueller
Herbert Voss wrote:

> from the manual *tbph for float and tbp for floatplacement

Yes, I stand corrected.

Jürgen



Re: No math dialog

2007-05-23 Thread Edwin Leuven

Leuven, E. wrote:

so then i suggest the attached patch. it

- introduces toolbar_toggle lfun
- adds a "toggle math toolbar" and "toggle table toolbar" buttons to the main 
toolbar
 (i also moved "toggle toc" there)
- adds a "toggle math panels" button to the math toolbar
- reshuffles the Big Operators panel to avoid confusion with the sum icon on 
the math toolbar
- adds some icons



since i consider to have an ok from josé and jürgen i will commit 
tonight (unless someone shouts out real LOUD)


Re: Skipping lines on cursor down

2007-05-23 Thread Stefan Schimanski
I am not completely sure how to do this in the right way, but what we  
need something like this:


Index: src/Cursor.cpp
===
--- src/Cursor.cpp  (Revision 18436)
+++ src/Cursor.cpp  (Arbeitskopie)
@@ -1101,10 +1101,18 @@
// no such inset found, just take something "above"
if (!popLeft()) {
+   // ask text to move cursor
+   if (up)
+   const_cast(text())->cursorUp 
(*this);

+   else
+   const_cast(text())->cursorDown 
(*this);

+   return true;
+/*
//lyxerr << "updown: popleft failed (strange  
case)" << endl;

int ylow  = up ? 0 : yo + 1;
int yhigh = up ? yo - 1 : bv().workHeight();
return bruteFind(*this, xo, yo, 0, bv 
().workWidth(), ylow, yhigh);

+   */
}
// any improvement so far?


The idea is that the cursor tried to query all the inset on the path  
to move the cursor up/down. If none can do that (i.e. popLeft() ==  
false), a bruteFind was done. Instead the cursorUp/Down of the text  
must be called to move into the next/previous paragraph. Of course  
the const_cast is not clean here. How can we do this in a cleaner way?


With this code the x_target_ is changed to the position of the  
display math. I think it's more natural to keep the x_target of the  
text paragraph instead. For that in Text::cursorUp/Down another test  
would be needed to test if the next paragraph is a display math. How  
do I do that?


Stefan


PGP.sig
Description: Signierter Teil der Nachricht


Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Bo Peng

from the _manual_ *tbph for float and tbp for floatplacement


I thought that float,floatplacement=xxx == float=xxx. You mean h and *
have to be specified in float?

This will certainly complicate InsetListingsParams.

Bo


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Herbert Voss
Uwe Stöhr wrote:

>> I find them very useful when I don't like
>> the default sizes TeX uses in fractions, for example.
> 
> Better use the commands \cfrac, \tfrac, etc. in this case.
> 
>> I would not use
>> them simply for changing the limits style.
> 
> But this is not the intention of these commands, they are there to
> change the style (size and spacings) of whole math constructs and not
> only parts of it. Therefore there are commands like \cfrac and \nolimits.
> 
> Herbert, what is your interpretion of this issue?

the font size has a dynamic character inside math, which is the
reason why it makes only sense to use the style commands. Which
font size a style will use depends to the environment. As Enrico
pointed out, a fraction can be of displaystyle or scriptstyle and an
index scriptstyle or scriptscriptstyle.


Buttons in math should change only the style, and the fontsize
depends on it.

Herbert



Re: [PATCH] Fixing cursors in multiview mode

2007-05-23 Thread Abdelrazak Younes

Jean-Marc Lasgouttes wrote:

"Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:


Abdelrazak> Stefan Schimanski wrote:

The attached patch fixes that. It should fix also a number of
other situation where cursor may be invalidated. I had to add a
test in Cursor::fixIfBroken() for the case were we are not inside
an Inset but in the main Text.

 Nice! Testing it for a few minutes now. Looks fine. Couldn't cause
a crash yet.


Abdelrazak> I need a second OK. JMarc?

The general idea is correct, but...

Originally, fixIfBroken got the cursor out of insets when coordinates
were different. Now you add a different test at level 1 the just
resets the values. It would be better to rewrite fixIfBroken to do at
each level

- go out of the inset if the value of cur.inset() is not correct wrt
  previous level.


How can I do that? If I erase an inset in one view while the cursor was 
in this very inset in the other view, how can I know that the inset the 
CursorSlice is referring to has been deleted?


The only simple solution I can think of right now is to emit a signal in 
the Inset destructor that we can connect to the CursorSlice. The 
CursorSlice will then invalidate itself.


Abdel.



Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Herbert Voss
Juergen Spitzmueller wrote:
> Bo Peng wrote:
> 
>>> I think Herbert refers to the  character, as in "!ht".
>> I do not see this anywhere in the manual.
> 
> From what I understand in the listings sourcde, only "tbp" are valid.

from the _manual_ *tbph for float and tbp for floatplacement

Herbert



Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Bo Peng

>> only "tbp" are valid.
>
> Not even h?

Doesn't seem so.


I suggest that we do not do anything because disallowing h will
generate a lot of complains because it is in the manual.

Cheers,
Bo


Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Juergen Spitzmueller
Bo Peng wrote:

>> only "tbp" are valid.
> 
> Not even h?

Doesn't seem so.

Jürgen



Re: Quick test of listings, some small issues

2007-05-23 Thread Bo Peng

I should have noticed this when (partially) fixing the `recursive
includes' problem. I didn't.


OK. Jose, can the following go in?

Index: src/insets/InsetInclude.cpp
===
--- src/insets/InsetInclude.cpp (revision 18476)
+++ src/insets/InsetInclude.cpp (working copy)
@@ -416,7 +416,7 @@
   //FIXME RECURSIVE INCLUDE
   //This isn't sufficient, as the inclusion could be downstream.
   //But it'll have to do for now.
-   if (buffer.fileName() == included_file.toFilesystemEncoding()) {
+   if (!isListings(params_) && buffer.fileName() ==
included_file.toFilesystemEncoding()) {
   Alert::error(_("Recursive input"),
  bformat(_("Attempted to include file
%1$s in itself! "
  "Ignoring inclusion."), from_utf8(incfile)));


Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Bo Peng

From what I understand in the listings sourcde,


That is the only way to figure out.


only "tbp" are valid.


Not even h?

Bo


Re: Skipping lines on cursor down

2007-05-23 Thread Richard Heck

Stefan Schimanski wrote:
I removed the margin now completely and substract 1 in the cursorUp 
case. This works fine everywhere but the display math. In display math 
(i.e. a InsetMathHull) the cursor up/down keys are not handled 
properly. Instead Cursor::bruteFind is used to find the nearest inset. 
Unfortunately bruteFind uses the pure geometrical distance as a 
measure to find the nearest inset. This is not what one expects from 
cursorUp/Down because one only want a nearest inset in the row above. 
I am currently looking into this
I'm glad you're doing this, Stefan. Cursor movement in display math has 
annoyed me for some time. But I don't understand the math stuff at all. 
I mean, AT ALL.


Richard



Re: Quick test of listings, some small issues

2007-05-23 Thread Richard Heck

Helge Hafting wrote:

Bo Peng wrote:

Issues:
* The LyX document can't include its own source file as a listing,
  complaining that the document includes itself. A bit strange perhaps,
  but this is _not_ a problem with a listing, as the nothing more will
  be included from the listed source. Suggestion: skip the "include
  loop" test for listings.

Easy to fix.

Yes, that works now with the patch. The document can include itself. :-)
I should have noticed this when (partially) fixing the `recursive 
includes' problem. I didn't.


Richard


Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Juergen Spitzmueller
Bo Peng wrote:

>> I think Herbert refers to the  character, as in "!ht".
> 
> I do not see this anywhere in the manual.

>From what I understand in the listings sourcde, only "tbp" are valid.

Jürgen



Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Herbert Voss
Uwe Stöhr wrote:
>> I don't like this. Both the old tooltip and icon were correct.
> 
> It is not correct, please look at the bugreport. The user thinks when
> clicking on this button that these settings are about sums or limits but
> both is incorrect. You can use these commands for all constructs!
> 
>> It's a matter of style not size. Display style and text style both use
>> the same font sizes but integrals and sums get their limits in a
> different
>> style, as an example.
> 
> But style is in this case mainly the size, put for example \sin(x) into
> a scriptstyle environment. And \displaystyle and \textstyle is not
> always the same, it depends on the used document class.
> To change the limits placement, the command \nolimits has to be used
> because the sum sign itself would otherwise also be set in the different
> style and therefore also size.

it is easy: inside math there are only styles ...
A style can, of course, define a font size, but this
is not important here.

Herbert



Re: Rarely used keybindings?

2007-05-23 Thread Jean-Marc Lasgouttes
> "christian" == christian ridderstrom <[EMAIL PROTECTED]> writes:

christian> On Wed, 23 May 2007, Jean-Marc Lasgouttes wrote:
>>> "John" == John Pye <[EMAIL PROTECTED]> writes:
>>
John> Along these lines of standard key-bindings, I vote for ctrl-I to
John> be used for creating italics, rather than ctrl-E, which I always
John> slip off and press ctrl-R, with dangerous consequences if I have
John> my hand poised over the 'enter' key!
>>  I'd rather remove Ctrl+R. I do not think it is standard and it is
>> rarely used.

christian> I'd say the real argument is that 'ctrl-E' stands for
christian> 'emphasis', not italics.

Yes, but John already had problems with the locality of E and R. Since
Ctrl+R is not standard anyway, we can start by removing it.

JMarc


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Uwe Stöhr

> I think an icon about size is as wrong as an icon about limit placements.

Hmm, I must admit, yes.
But note that it was not the first time we got questions about this icon.

> Personally I
> would think that these things do not belong to the math panel, because
> they should only rarely be used (and many people think they have to
> use them for every other formula).

Yes this is probably the best solution.

> I think I do not agree here, as they are more easily accessible
> than before and they have long names. If someone misuses them, this is
> his problem, don't you think so?

No, because we should guide the user. We cannot expect that normal LyXers read the TeXBook to find 
out the differences.


> I find them very useful when I don't like
> the default sizes TeX uses in fractions, for example.

Better use the commands \cfrac, \tfrac, etc. in this case.

> I would not use
> them simply for changing the limits style.

But this is not the intention of these commands, they are there to change the style (size and 
spacings) of whole math constructs and not only parts of it. Therefore there are commands like 
\cfrac and \nolimits.


Herbert, what is your interpretion of this issue?

regards Uwe




Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:

>> Personally I would think that these things do not belong to the
>> math panel, because they should only rarely be used (and many
>> people think they have to use them for every other formula).

Enrico> I think I do not agree here, as they are more easily
Enrico> accessible than before and they have long names. If someone
Enrico> misuses them, this is his problem, don't you think so? I find
Enrico> them very useful when I don't like the default sizes TeX uses
Enrico> in fractions, for example. I would not use them simply for
Enrico> changing the limits style. 

I knew that this idea would not be shared by everybody... 

Enrico> Going further in your reasoning we should also make difficult
Enrico> the use of tables as many people misuse them, too!

I know you could find a better example, if you tried harder ;) The
\foostyle commands are about forcing TeX to do what it does not want
to do.

JMarc


Re: [PATCH] Fixing cursors in multiview mode

2007-05-23 Thread Jean-Marc Lasgouttes
> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

Abdelrazak> Stefan Schimanski wrote:
>>> The attached patch fixes that. It should fix also a number of
>>> other situation where cursor may be invalidated. I had to add a
>>> test in Cursor::fixIfBroken() for the case were we are not inside
>>> an Inset but in the main Text.
>>  Nice! Testing it for a few minutes now. Looks fine. Couldn't cause
>> a crash yet.

Abdelrazak> I need a second OK. JMarc?

The general idea is correct, but...

Originally, fixIfBroken got the cursor out of insets when coordinates
were different. Now you add a different test at level 1 the just
resets the values. It would be better to rewrite fixIfBroken to do at
each level

- go out of the inset if the value of cur.inset() is not correct wrt
  previous level.

- if the inset() itself is correct, update pit/pos if needed.

Concerning the code itself:
+   if (fixed) {
+   lyxerr << "correcting cursor to level " << depth() << 
endl;

You know that depth() is 1 here. Maybe use "correcting cursor at top
level". But of course, I'd rather have a coherent handling at all
levels.

JMarc


Re: UTF8->UCS4 failure on FreeBSD 6.2-RELEASE

2007-05-23 Thread Abdelrazak Younes

Jean-Marc Lasgouttes wrote:

"Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:


Enrico> When sizeof(wchar_t) != 4 or wchar_t is not present, then our
Enrico> facets implementation should kick in. I use it with no
Enrico> problems in both cygwin and mingw, don't know about other
Enrico> platforms.

Do you have a simple program to test whether the facet works? I seem
to remember that you did it at the time.

And can we force to use our implementation in some cases?


The test is in docstring.h:101

#if SIZEOF_WCHAR_T != 4 && defined(__GNUC__) && defined(__GNUC_MINOR__) 
&& __GNUC__ == 3 && __GNUC_MINOR__ < 4


Maybe Koji could try to enable that unconditionally:

- #if SIZEOF_WCHAR_T != 4 && defined(__GNUC__) && 
defined(__GNUC_MINOR__) && __GNUC__ == 3 && __GNUC_MINOR__ < 4

+ #if 1

Abdel.



Re: Skipping lines on cursor down

2007-05-23 Thread Stefan Schimanski


Am 23.05.2007 um 17:08 schrieb Abdelrazak Younes:


Stefan Schimanski wrote:

Hi!
My cursor often skips lines when moving downwards. I was trying to  
understand the code and found this in Text2.cpp:

// To middle of next row
int const margin = 3 * InsetMathHull::displayMargin() / 2;
editXY(cur, x, y + pm.rows()[row].descent() + margin);
What is the reasoning here? Why do we take the margin of a math  
hull in general text cursor handling? Isn't the row descent() enough?
Moreover is there a need to have Text::cursorDown and  
Text::cursorUp sharing 95% of it's code?

Stefan
P.S.: Strangely moving upwards is fine.


Bennett said the opposite in bugzilla:

One further note: in current svn (18281), uparrow also skips lines  
in the same way.


I removed the margin now completely and substract 1 in the cursorUp  
case. This works fine everywhere but the display math. In display  
math (i.e. a InsetMathHull) the cursor up/down keys are not handled  
properly. Instead Cursor::bruteFind is used to find the nearest  
inset. Unfortunately bruteFind uses the pure geometrical distance as  
a measure to find the nearest inset. This is not what one expects  
from cursorUp/Down because one only want a nearest inset in the row  
above. I am currently looking into this


Stefan


PGP.sig
Description: Signierter Teil der Nachricht


Re: UTF8->UCS4 failure on FreeBSD 6.2-RELEASE

2007-05-23 Thread Jean-Marc Lasgouttes
> "Enrico" == Enrico Forestieri <[EMAIL PROTECTED]> writes:

Enrico> When sizeof(wchar_t) != 4 or wchar_t is not present, then our
Enrico> facets implementation should kick in. I use it with no
Enrico> problems in both cygwin and mingw, don't know about other
Enrico> platforms.

Do you have a simple program to test whether the facet works? I seem
to remember that you did it at the time.

And can we force to use our implementation in some cases?

JMarc


Re: Skipping lines on cursor down

2007-05-23 Thread Abdelrazak Younes

Stefan Schimanski wrote:

Hi!

My cursor often skips lines when moving downwards. I was trying to 
understand the code and found this in Text2.cpp:


// To middle of next row
int const margin = 3 * InsetMathHull::displayMargin() / 2;
editXY(cur, x, y + pm.rows()[row].descent() + margin);

What is the reasoning here? Why do we take the margin of a math hull in 
general text cursor handling? Isn't the row descent() enough?


Moreover is there a need to have Text::cursorDown and Text::cursorUp 
sharing 95% of it's code?


Stefan

P.S.: Strangely moving upwards is fine.


Bennett said the opposite in bugzilla:

One further note: in current svn (18281), uparrow also skips lines in 
the same way.






Re: Scrolling lag in 1.5svn again, fast typing problem?

2007-05-23 Thread Helge Hafting

Peter Kümmel wrote:

I'm running out of ideas...
Is this patch better (the flush call is new)?
Or with processEvents instead of flush?
  


I just saw a nasty problem, using the processEvents version
of the patch:

1. Insert a listing.
2. Inside the listing, insert a caption
3. Type fast inside that caption.  Notice how
   LyX eats some of the keystrokes. Ouch! :-( :-( :-(

Helge Hafting


Re: Quick test of listings, some small issues

2007-05-23 Thread Helge Hafting

Bo Peng wrote:

Issues:
* The LyX document can't include its own source file as a listing,
  complaining that the document includes itself. A bit strange perhaps,
  but this is _not_ a problem with a listing, as the nothing more will
  be included from the listed source. Suggestion: skip the "include
  loop" test for listings.


Easy to fix.

Yes, that works now with the patch. The document can include itself. :-)



* The embedded listing was numbered "listing 1" on screen, even though
  it was preceded by a file listing. It was correctly numered "listing
  2" in the dvi. Suggestion: count subdocument listings as well as
  embedded listings, using the same counter.


See attached patch. I also add counter to InsetInclude. I am not sure
if Jose (and others) like this part though.



The numbering is now OK on screen.
I noticed a problem though - I simply couldn't have a listing that
wasn't a file.  I got

"Package Listings Error: Oops! It seems you've forgotten the argument to"

and then nothing more. :-(

Helge Hafting


Re: [PATCH] Fixing cursors in multiview mode (was Re: Warning Question)

2007-05-23 Thread Abdelrazak Younes

Stefan Schimanski wrote:
The attached patch fixes that. It should fix also a number of other 
situation where cursor may be invalidated.
I had to add a test in Cursor::fixIfBroken() for the case were we are 
not inside an Inset but in the main Text.


Nice! Testing it for a few minutes now. Looks fine. Couldn't cause a 
crash yet.


I need a second OK. JMarc?

Abdel.



Re: Rarely used keybindings?

2007-05-23 Thread christian . ridderstrom

On Wed, 23 May 2007, Jean-Marc Lasgouttes wrote:


"John" == John Pye <[EMAIL PROTECTED]> writes:


John> Along these lines of standard key-bindings, I vote for ctrl-I to
John> be used for creating italics, rather than ctrl-E, which I always
John> slip off and press ctrl-R, with dangerous consequences if I have
John> my hand poised over the 'enter' key!

I'd rather remove Ctrl+R. I do not think it is standard and it is
rarely used.


I'd say the real argument is that 'ctrl-E' stands for 'emphasis', not 
italics.


/Christian

--
Christian Ridderström, +46-8-768 39 44   http://www.md.kth.se/~chr

Re: UTF8->UCS4 failure on FreeBSD 6.2-RELEASE

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 03:40:08PM +0200, Jean-Marc Lasgouttes wrote:

> This seems to point to a problem with using widen/narrow on a facet
> like std::ctype. Of course, I know next to nothing about that.
> Enrico, would you have some ideas about whether freebsd has the needed
> support? 

I really don't know. I still have NetBSD installed on an old MC68040
machine but I don't have it handy now, and furthermore I haven't
updated it in the last 7 or 8 years...

> Was it freebsd that did not even have a wchar_t type some years ago?

When sizeof(wchar_t) != 4 or wchar_t is not present, then our facets
implementation should kick in. I use it with no problems in both cygwin
and mingw, don't know about other platforms.

-- 
Enrico


Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Bo Peng

I think Herbert refers to the  character, as in "!ht".


I do not see this anywhere in the manual. Listings silently ignores
invalid placement chars so I can not test it either. I am not sure if
I need to trust Herbert on this issue (and Uwe once mentioned H).

It would not harm to allow ! and H though.

Bo


Re: [PATCH] HTML Export Bugs

2007-05-23 Thread Richard Heck
Georg Baum wrote:
> Richard Heck wrote:
>
>   
>> This is the result of a problem that Uwe noticed the other day with the
>> MikTeX implementation of the htlatex scripts: The scripts will not run
>> properly unless they are run in the same directory as the original file.
>> 
> Several other converters (e.g. lilypond) have the same limitation. Therefore
> LyX changes to the temp dir before running the converter. It would even be
> possible to call the converter with relative filenames, I am not sure
> anymore why absolute paths are used. 
Don't know. It was that way before.
> IMHO if you create a subdirectory LyX
> should change to that subdirectory before running the converter.
>   
It does.
>> The solution suggested in some
>> earlier discussion was to ship a small shell script with LyX that would
>> copy the .tex file to the temporary directory and then run htlatex on
>> that file. Thoughts?
>> 
> The .tex file _is_ in the temporary direcory. All conversions are run in the
> temp dir, I hope you did not change that.
>   
I didn't. I meant it should copy it to the NEW temporary directory, e.g.:
/tmp/lyx_098weras/lyx_tmpbuf0/file.html.conversion/
which is where the converted files will be dumped.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Juergen Spitzmueller
Bo Peng wrote:

> This is already the case. The SUBSETOF tag lets the validator to see
> if the parameter is composed of given characters. It also disallows
> empty parameter.

I think Herbert refers to the  character, as in "!ht".

Jürgen



Re: [Bug 3676] Citation Problems

2007-05-23 Thread Richard Heck
Abdelrazak Younes wrote:
> Richard Heck wrote:
>> So now I type an
>> "a". That narrows it down to everything that contains "sa". Again,
>> little progress. Now I type "m". That will weed out a few things, but
>> possibly not very many, especially because I have a lot of annote,
>> abstract, and review fields in the database. (Note here that the current
>> BibTeX parser loads all fields and searches all fields.) So there are
>> going to be three pretty much full DB searches, and the fourth one will
>> likely be quite large as well. Of course, I've chosen a bad case. If I'd
>> type "fre", I'd have made more progress. But still it is slow.
>
> I see. I just want to say that I tested this extensively at the time I
> implemented it (that was before the new parser) and the speed was OK
> even with a _lot_ of entries. My test case was to load all Bibtex
> files that come with Miktex.
>
> If the speed is now a problem, I guess a check box "Find as you type"
> which default to yes is necessary.
Yes. I'll do this when I do some other things with that dialog, after
1.5.0. As I said in an earlier message, now that we have parsed BibTeX
data, it's trivial to implement the ability to search a particular
field, say, title. The only question is what the UI should be:
title=whatever, as in JabRef, or two text fields, or a dropbox (which
could get its data from the parser), or what.

Richard

-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: [patch] Bug 3645: Listings dialog: gui not translatable

2007-05-23 Thread Bo Peng

> or !... with at least one character of tbph

If this is the case (I didn't find it in the listings manual), it should be
added to InsetListingsParams.


This is already the case. The SUBSETOF tag lets the validator to see
if the parameter is composed of given characters. It also disallows
empty parameter.

Bo


Re: 1.5b3 grace->pdf problems

2007-05-23 Thread Richard Heck
Neal Becker wrote:
> Oh, I did get an answer.  Unfortunately, I can't seem to find the message 
> right now, but the answer is, that I need to make that agr->pdf instead of 
> agr->pdf2.
>
> There was also a discussion that the use of pdf{,2,3} was really a broken 
> design.
>   
It is confusing, but the point is that there is a difference between a
format and a file type. Converters convert between formats, and
different formats may share a file type. True, one could also for the
definition of multiple converters between pairs of formats, but then
there would also need to be some mechanism for ordering them, since LyX
otherwise wouldn't know how to choose the right one in cases where it is
making that choice. Still, a bugzilla enchancement request nothing this
issue would be in order.

Richard


-- 
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: Skipping lines on cursor down

2007-05-23 Thread Martin Vermeer
On Wed, May 23, 2007 at 02:08:21PM +0200, Jean-Marc Lasgouttes wrote:
> > "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> 
> Abdelrazak> Stefan Schimanski wrote:
> >> Hi!
> >> 
> >> My cursor often skips lines when moving downwards. I was trying to
> >> understand the code and found this in Text2.cpp:
> >> 
> >> // To middle of next row int const margin = 3 *
> >> InsetMathHull::displayMargin() / 2; editXY(cur, x, y +
> >> pm.rows()[row].descent() + margin);
> >> 
> >> What is the reasoning here? Why do we take the margin of a math
> >> hull in general text cursor handling?
> 
> Abdelrazak> This looks weird indeed.
> 
> Martin is the one who knows about that, I think.

Yes, I remember this... but I don't remember the details :-( 

It was about correct cursor mvement up/down through a displayes 
equation. You'll notice soon enough when trying to remove/change it :-)

- Martin


Re: How to use 'block' in beamer?

2007-05-23 Thread Martin Vermeer
On Wed, May 23, 2007 at 12:05:39AM +0200, Uwe Stöhr wrote:
> Neal Becker schrieb:
> 
> >This is lyx-1.5.0b3.
> >I selected 'block' and I get something that says:
> >block ( ERT[{title}] body ): 
> >
> >There is no way to select that block... with the mouse.  How do I 
> >edit it?
> >
> >If I do nothing, then pdflatex will pick up the first letter of the
> >following text and highlight it.
> 
> This has been introduced recently I also stumbled over this 
> yesterday.
> 
> Martin, I think it was your commit that changed this, right?
> 
> regards Uwe

I only changed the string should not affect funtionalitty.

- Martin




Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 03:17:14PM +0200, Jean-Marc Lasgouttes wrote:
> > "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes:
> 
> >> I don't like this. Both the old tooltip and icon were correct.
> Uwe> It is not correct, please look at the bugreport. The user thinks
> Uwe> when clicking on this button that these settings are about sums
> Uwe> or limits but both is incorrect. You can use these commands for
> Uwe> all constructs!
> 
> I think an icon about size is as wrong as an icon about limit placements.

But the latter gives you a better idea of what it is about.

> You think \textstyle versus \scriptstyle, Enrico thinks \displaystyle
> versus \textstyle. Both interpretations are correct. Personally I
> would think that these things do not belong to the math panel, because
> they should only rarely be used (and many people think they have to
> use them for every other formula).

I think I do not agree here, as they are more easily accessible
than before and they have long names. If someone misuses them, this is
his problem, don't you think so? I find them very useful when I don't like
the default sizes TeX uses in fractions, for example. I would not use
them simply for changing the limits style. Going further in your reasoning
we should also make difficult the use of tables as many people misuse them,
too!

-- 
Enrico


Re: [trivial PATCH] os x dist failure

2007-05-23 Thread Jean-Marc Lasgouttes
> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

Bennett> OK -- I did it. It works fine.

Thanks.

JMarc


Re: [trivial PATCH] os x dist failure

2007-05-23 Thread Bennett Helm

On May 23, 2007, at 9:19 AM, Jean-Marc Lasgouttes wrote:


"Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:


Bennett> Yes. (I would have expected a different error message,
Bennett> though.)

Bennett> Is this something I should bother testing? If so, how?
Bennett> (Current svn works.)

- easy route: just wait until next release

- more involved one: make a distribution by yourself, using:


OK -- I did it. It works fine.

Bennett


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Enrico Forestieri
On Wed, May 23, 2007 at 02:52:38PM +0200, Uwe Stöhr wrote:
>  > I don't like this. Both the old tooltip and icon were correct.
> 
> It is not correct, please look at the bugreport. The user thinks when 
> clicking on this button that 
> these settings are about sums or limits but both is incorrect. You can use 
> these commands for all 
> constructs!

It is difficult to convey information about a complex thing through a
simple image. Nevertheless, the current tooltip is absolutely correct
and the current icon conveys better the idea than a misleading icon
about sizes.

>  > It's a matter of style not size. Display style and text style both use
>  > the same font sizes but integrals and sums get their limits in a different
>  > style, as an example.
> 
> But style is in this case mainly the size, put for example \sin(x) into a 
> scriptstyle environment. 
> And \displaystyle and \textstyle is not always the same, it depends on the 
> used document class.
> To change the limits placement, the command \nolimits has to be used because 
> the sum sign itself 
> would otherwise also be set in the different style and therefore also size.
> 
> Please have a look into the LaTeX-companion and test it out in LyX if you 
> don't believe me.

No, please, you must have a look at pages 140 and 141 in the TeXbook,
where all of this is explained in detail. You will see that sizes are
of absolutely secondary importance in this case. Indeed, I could simply
highlight a formula in LyX and choose a different size for it using
the "ab" toolbar button.

-- 
Enrico


Re: UTF8->UCS4 failure on FreeBSD 6.2-RELEASE

2007-05-23 Thread Jean-Marc Lasgouttes
> "Koji" == Koji Yokota <[EMAIL PROTECTED]> writes:

Koji> I attach the backtrace when the program is crashed as additional
Koji> information.

Looking at the backtrace, the problem happens at line 333 of
boost/format/parsing.hpp:

switch ( wrap_narrow(fac, *start, 0) ) {
case 'X':
fpar->fmtstate_.flags_ |= std::ios_base::uppercase;
[...]
case 'n' :  
fpar->argN_ = format_item_t::argN_ignored;
break;
default: 
maybe_throw_exception(exceptions, start-start0+offset, 
fstring_size);  /// <-- line 333 is here
}

This seems to point to a problem with using widen/narrow on a facet
like std::ctype. Of course, I know next to nothing about that.
Enrico, would you have some ideas about whether freebsd has the needed
support? 

Was it freebsd that did not even have a wchar_t type some years ago?

JMarc



Re: 2007 LyX Meeting (candidatures accepted)

2007-05-23 Thread Jean-Marc Lasgouttes
> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:


Martin> Sure... do you have a list handy?

[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], who else?

JMarc


Re: [trivial PATCH] os x dist failure

2007-05-23 Thread Jean-Marc Lasgouttes
> "Bennett" == Bennett Helm <[EMAIL PROTECTED]> writes:

Bennett> Yes. (I would have expected a different error message,
Bennett> though.)

Bennett> Is this something I should bother testing? If so, how?
Bennett> (Current svn works.)

- easy route: just wait until next release

- more involved one: make a distribution by yourself, using:

  * export to some directory
 rm -rf /local/lasgoutt/lyx-export
 svn export . /local/lasgoutt/lyx-export
  * run ./autogen.sh
 cd /local/lasgoutt/lyx-export
 ./autogen.sh
  * configure in some directory
 cd /local/lasgoutt/build-export
 ../lyx-export/configure 
  * make a distribution.
 make dist


JMarc


Re: [patch] fix bug 3672 - better one

2007-05-23 Thread Jean-Marc Lasgouttes
> "Uwe" == Uwe Stöhr <[EMAIL PROTECTED]> writes:

>> I don't like this. Both the old tooltip and icon were correct.
Uwe> It is not correct, please look at the bugreport. The user thinks
Uwe> when clicking on this button that these settings are about sums
Uwe> or limits but both is incorrect. You can use these commands for
Uwe> all constructs!

I think an icon about size is as wrong as an icon about limit placements.

You think \textstyle versus \scriptstyle, Enrico thinks \displaystyle
versus \textstyle. Both interpretations are correct. Personally I
would think that these things do not belong to the math panel, because
they should only rarely be used (and many people think they have to
use them for every other formula).

JMarc


Re: 2007 LyX Meeting (candidatures accepted)

2007-05-23 Thread Martin Vermeer
On Mon, May 21, 2007 at 10:37:50AM +0200, Jean-Marc Lasgouttes wrote:
> > "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes:
> 
> Martin> So this very much looks like August 11 is the weekend.
> 
> Yes.
> 
> Martin> Shall I proceed to prepare an official invitation for this
> Martin> date? Any counterproposals?
> 
> I guess so. Do not forget the usual LyX developers in exile who do not
> read lyx-devel.
> 
> JMarc

Sure... do you have a list handy?

- Martin



Re: [PATCH] Fixing cursors in multiview mode (was Re: Warning Question)

2007-05-23 Thread Stefan Schimanski
The attached patch fixes that. It should fix also a number of other  
situation where cursor may be invalidated.
I had to add a test in Cursor::fixIfBroken() for the case were we  
are not inside an Inset but in the main Text.


Nice! Testing it for a few minutes now. Looks fine. Couldn't cause a  
crash yet.


Stefan



PGP.sig
Description: Signierter Teil der Nachricht


  1   2   >