Re: layout2layout (Re: [patch] partial merging of CharStyle and InsetLayout handling)

2007-08-18 Thread Andre Poenitz
On Sat, Aug 18, 2007 at 09:47:29PM +0300, Martin Vermeer wrote: > I would surprise me if very old python versions would > still work correctly for LyX. configure.ac seems to require > 2.3, which definitely has +=. (But not i++, which would be > even better) > > So, shall I replace all i = i + 1 b

Re: layout2layout (Re: [patch] partial merging of CharStyle and InsetLayout handling)

2007-08-18 Thread christian . ridderstrom
On Sat, 18 Aug 2007, Bo Peng wrote: So, shall I replace all i = i + 1 by i += 1, and commit my layout2layout? Do any objections come to mind? Perhaps we should check with Bo. I'm sure he knows exactly what version we require and what its capabilities are. So I'm adding him to the cc list here.

Re: layout2layout (Re: [patch] partial merging of CharStyle and InsetLayout handling)

2007-08-18 Thread Bo Peng
> > So, shall I replace all i = i + 1 by i += 1, and commit > > my layout2layout? Do any objections come to mind? > > > Perhaps we should check with Bo. I'm sure he knows exactly what version > we require and what its capabilities are. So I'm adding him to the cc > list here. Lyx requires python 2

Re: layout2layout (Re: [patch] partial merging of CharStyle and InsetLayout handling)

2007-08-18 Thread Richard Heck
Martin Vermeer wrote: I would surprise me if very old python versions would still work correctly for LyX. configure.ac seems to require 2.3, which definitely has +=. (But not i++, which would be even better) So, shall I replace all i = i + 1 by i += 1, and commit my layout2layout? Do any objec

layout2layout (Re: [patch] partial merging of CharStyle and InsetLayout handling)

2007-08-18 Thread Martin Vermeer
On Sat, Aug 18, 2007 at 12:19:20PM +0200, Andre Poenitz wrote: > On Sat, Aug 18, 2007 at 03:37:22AM -0400, Richard Heck wrote: > > Martin Vermeer wrote: > > >On Sat, Aug 18, 2007 at 01:27:57AM -0400, Richard Heck wrote: > > > > > >> Martin Vermeer wrote: > > >> > > >>>Attached my attempt. I a

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-18 Thread Martin Vermeer
On Fri, Aug 17, 2007 at 09:28:44AM +0200, Jean-Marc Lasgouttes wrote: > > Err, this is not exactly what I wrote, is it? > > > InsetLayout const & TextClass::insetlayout(docstring const & name) const > > { > > - return insetlayoutlist_[name]; > > + docstring n = name; > > + while (!n.emp

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-18 Thread Andre Poenitz
On Sat, Aug 18, 2007 at 03:37:22AM -0400, Richard Heck wrote: > Martin Vermeer wrote: > >On Sat, Aug 18, 2007 at 01:27:57AM -0400, Richard Heck wrote: > > > >> Martin Vermeer wrote: > >> > >>>Attached my attempt. I am a complete amateur with python > >>>and work with layout2layout also for th

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-18 Thread Richard Heck
Martin Vermeer wrote: On Sat, Aug 18, 2007 at 01:27:57AM -0400, Richard Heck wrote: Martin Vermeer wrote: Attached my attempt. I am a complete amateur with python and work with layout2layout also for the first time, so... does this make sense? FWIW it works. Well, I don't kn

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
On Sat, Aug 18, 2007 at 01:27:57AM -0400, Richard Heck wrote: > Martin Vermeer wrote: > > Attached my attempt. I am a complete amateur with python > > and work with layout2layout also for the first time, so... > > does this make sense? FWIW it works. > > > Well, I don't know anything about lay

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Richard Heck
Martin Vermeer wrote: Attached my attempt. I am a complete amateur with python and work with layout2layout also for the first time, so... does this make sense? FWIW it works. Well, I don't know anything about layout2layout, but I know a little python... +if format == 4: +

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
On Fri, Aug 17, 2007 at 06:54:25PM +0300, Martin Vermeer wrote: > On Thu, Aug 16, 2007 at 07:11:33PM +0300, Martin Vermeer wrote: > > On Thu, Aug 16, 2007 at 03:58:44PM +0200, Jean-Marc Lasgouttes wrote: > > ... > > > Shall I for now just give "long names" to the charstyles > > in the layout fil

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
On Thu, Aug 16, 2007 at 07:11:33PM +0300, Martin Vermeer wrote: > On Thu, Aug 16, 2007 at 03:58:44PM +0200, Jean-Marc Lasgouttes wrote: ... > Shall I for now just give "long names" to the charstyles > in the layout file, like CharStyle:Noun? The patch, and its lyx2lyx counterpart, are committed

Re: lyx2lyx bug (was: Re: [patch] partial merging of CharStyle and InsetLayout handling)

2007-08-17 Thread Martin Vermeer
On Fri, Aug 17, 2007 at 05:20:08PM +0300, Dov Feldstern wrote: > Dov Feldstern wrote: > > The bigger problem, though, has nothing to do with your code: it looks like > > lyx2lyx (at least when run from the command line) is just ignoring anything > > with format above 276. If you change your file

lyx2lyx bug (was: Re: [patch] partial merging of CharStyle and InsetLayout handling)

2007-08-17 Thread Dov Feldstern
Dov Feldstern wrote: The bigger problem, though, has nothing to do with your code: it looks like lyx2lyx (at least when run from the command line) is just ignoring anything with format above 276. If you change your file's format to 276, then lyx2lyx will work fine. The reason I say that this

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Dov Feldstern
Martin Vermeer wrote: On Fri, Aug 17, 2007 at 03:17:54PM +0300, Dov Feldstern wrote: Martin Vermeer wrote: On Fri, Aug 17, 2007 at 02:03:48PM +0300, Dov Feldstern wrote: ... Thanks Dov... you helped me spot an ordering bug in the revert list probably due to José. Fixing it doesn't help th

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
On Fri, Aug 17, 2007 at 03:17:54PM +0300, Dov Feldstern wrote: > > > Martin Vermeer wrote: > > On Fri, Aug 17, 2007 at 02:03:48PM +0300, Dov Feldstern wrote: ... > > Thanks Dov... you helped me spot an ordering bug in the revert > > list probably due to José. Fixing it doesn't help though... s

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
... and here the improved patch. - Martin Index: LyX.py === --- LyX.py (revision 19567) +++ LyX.py (working copy) @@ -78,7 +78,7 @@ ("1_3", [221], generate_minor_versions("1.3" , 7)),

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Dov Feldstern
Martin Vermeer wrote: On Fri, Aug 17, 2007 at 02:03:48PM +0300, Dov Feldstern wrote: Dov Feldstern wrote: Martin Vermeer wrote: Attached my attempt at a lyx2lyx entry. Problem is, it doesn't work. It doesn't even update the version number to 279 in the .lyx file. What do I overlook here? -

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
On Fri, Aug 17, 2007 at 02:03:48PM +0300, Dov Feldstern wrote: > Dov Feldstern wrote: > > Martin Vermeer wrote: > >> Attached my attempt at a lyx2lyx entry. Problem is, > >> it doesn't work. It doesn't even update the version > >> number to 279 in the .lyx file. > >> > >> What do I overlook here?

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Dov Feldstern
Martin Vermeer wrote: On Fri, Aug 17, 2007 at 01:58:24PM +0300, Dov Feldstern wrote: Martin Vermeer wrote: Attached my attempt at a lyx2lyx entry. Problem is, it doesn't work. It doesn't even update the version number to 279 in the .lyx file. What do I overlook here? - Martin You need to ch

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
On Fri, Aug 17, 2007 at 01:58:24PM +0300, Dov Feldstern wrote: > > > Martin Vermeer wrote: > > Attached my attempt at a lyx2lyx entry. Problem is, > > it doesn't work. It doesn't even update the version > > number to 279 in the .lyx file. > > What do I overlook here? > > - Martin > > You need

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Dov Feldstern
Dov Feldstern wrote: Martin Vermeer wrote: Attached my attempt at a lyx2lyx entry. Problem is, it doesn't work. It doesn't even update the version number to 279 in the .lyx file. What do I overlook here? - Martin You need to change int const LYX_FORMAT = 278; in Buffer.cpp. Also, don't

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Dov Feldstern
Martin Vermeer wrote: Attached my attempt at a lyx2lyx entry. Problem is, it doesn't work. It doesn't even update the version number to 279 in the .lyx file. What do I overlook here? - Martin You need to change int const LYX_FORMAT = 278; in Buffer.cpp.

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
Attached my attempt at a lyx2lyx entry. Problem is, it doesn't work. It doesn't even update the version number to 279 in the .lyx file. What do I overlook here? - Martin Index: LyX.py === --- LyX.py (revision 19567) +++ LyX.py

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Martin Vermeer
On Fri, Aug 17, 2007 at 09:28:44AM +0200, Jean-Marc Lasgouttes wrote: > > Err, this is not exactly what I wrote, is it? > > > InsetLayout const & TextClass::insetlayout(docstring const & name) const > > { > > - return insetlayoutlist_[name]; > > + docstring n = name; > > + while (!n.emp

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-17 Thread Jean-Marc Lasgouttes
Err, this is not exactly what I wrote, is it? > InsetLayout const & TextClass::insetlayout(docstring const & name) const > { > - return insetlayoutlist_[name]; > + docstring n = name; > + while (!n.empty()) { > + if (!insetlayoutlist_.count(n) > 0) > +

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Martin Vermeer
On Thu, Aug 16, 2007 at 03:58:44PM +0200, Jean-Marc Lasgouttes wrote: > Martin Vermeer <[EMAIL PROTECTED]> writes: > > > Sorry... I don't understand this. What do you mean? What > > code does this require? > > Something like that (untested) > > InsetLayout const & TextClass::insetlayout(docstrin

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Martin Vermeer
On Thu, Aug 16, 2007 at 03:58:44PM +0200, Jean-Marc Lasgouttes wrote: > Martin Vermeer <[EMAIL PROTECTED]> writes: > > > Sorry... I don't understand this. What do you mean? What > > code does this require? > ... > Assuming that you ask for "charstyle:author", which does not exist, > the code w

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: Abdelrazak Younes <[EMAIL PROTECTED]> writes: I personally prefer this style: if (i == string::npos) // delimiter was not found break; n = n.substr(0, i); Remember o

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Jean-Marc Lasgouttes
Abdelrazak Younes <[EMAIL PROTECTED]> writes: > I personally prefer this style: > > if (i == string::npos) > // delimiter was not found > break; > > n = n.substr(0, i); > > Remember our discussions about iterat

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Abdelrazak Younes
Jean-Marc Lasgouttes wrote: Martin Vermeer <[EMAIL PROTECTED]> writes: Sorry... I don't understand this. What do you mean? What code does this require? Something like that (untested) InsetLayout const & TextClass::insetlayout(docstring const & name) const { docstring n = name;

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Jean-Marc Lasgouttes
Martin Vermeer <[EMAIL PROTECTED]> writes: > Sorry... I don't understand this. What do you mean? What > code does this require? Something like that (untested) InsetLayout const & TextClass::insetlayout(docstring const & name) const { docstring n = name; while (!n.empty()) {

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Martin Vermeer
On Thu, Aug 16, 2007 at 01:20:19PM +0200, Jean-Marc Lasgouttes wrote: > Martin Vermeer <[EMAIL PROTECTED]> writes: > > > Yes, you can do this. The price you pay is the long name > > appearing also on the inset labels. > > We are free to chose how the label appears on scrren What I am > describing

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Jean-Marc Lasgouttes
Martin Vermeer <[EMAIL PROTECTED]> writes: > Yes, you can do this. The price you pay is the long name > appearing also on the inset labels. We are free to chose how the label appears on scrren What I am describing here is internal. > Currently the namespace -- if you add one --is just a "dumb" >

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Martin Vermeer
On Thu, Aug 16, 2007 at 03:46:44AM -0400, Richard Heck wrote: > Jean-Marc Lasgouttes wrote: > > Martin Vermeer <[EMAIL PROTECTED]> writes: > > > >> Like the attached? > >> > > I'd rather have entries like > > > > InsetLayout charstyle:noun > > LyxType charstyle > > La

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Jean-Marc Lasgouttes
Richard Heck <[EMAIL PROTECTED]> writes: > Jean-Marc Lasgouttes wrote: > Is `charstyle' supposed just to be repeated? Or can one also do: > > InsetLayout whatever:noun > LyxType charstyle > LabelString noun > LatexType fontstyle > LatexNam

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Richard Heck
Jean-Marc Lasgouttes wrote: Martin Vermeer <[EMAIL PROTECTED]> writes: Like the attached? I'd rather have entries like InsetLayout charstyle:noun LyxType charstyle LabelString noun LatexType fontstyle LatexName

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-16 Thread Jean-Marc Lasgouttes
Martin Vermeer <[EMAIL PROTECTED]> writes: > Like the attached? I'd rather have entries like InsetLayout charstyle:noun LyxType charstyle LabelString noun LatexType fontstyle LatexName defined Font

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-15 Thread Martin Vermeer
On Wed, Aug 15, 2007 at 09:19:07PM +0100, José Matos wrote: > On Tuesday 14 August 2007 19:49:01 Martin Vermeer wrote: > > Does anybody else spot a problem with this? I'll wait for > > the Bromarv Cowboys to appear on the list again before > > committing. > > What needs to be done? Review the c

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-15 Thread José Matos
On Tuesday 14 August 2007 19:49:01 Martin Vermeer wrote: > Does anybody else spot a problem with this? I'll wait for > the Bromarv Cowboys to appear on the list again before > committing. What needs to be done? > - Martin -- José Abílio

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-14 Thread Richard Heck
Martin Vermeer wrote: Like the attached? Very nice, yes. Appears to work even. Yes I see the sense in this. We could also have a LyXType = Custom for your Endnote inset, or why not a NoSpellCheck inset -- in a layout file module :-) I was thinking something like LyXType Collapsable, yes.

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-14 Thread Martin Vermeer
On Tue, Aug 14, 2007 at 11:20:59AM -0400, Richard Heck wrote: > > This seems to be progressing very well. But I wonder if using the CS prefix > is the right way to do this. How about something like "LyXType CharStyle", > which is clearer and more easily extensible? I'd also like at some point

Re: [patch] partial merging of CharStyle and InsetLayout handling

2007-08-14 Thread Richard Heck
This seems to be progressing very well. But I wonder if using the CS prefix is the right way to do this. How about something like "LyXType CharStyle", which is clearer and more easily extensible? I'd also like at some point to be able to use a separator like ":" to structure the charstyle men

[patch] partial merging of CharStyle and InsetLayout handling

2007-08-14 Thread Martin Vermeer
This makes the logic a bit simpler and the code shorter. The syntax for the layout files (charstyle description) changes, to (e.g.) InsetLayout CS:Noun LabelString noun from CharStyle noun Tested and works for me. Noun, Emph charstyle file included. This will require layout2layout work (like