Re: [PATCH] Improve decimal alignment in tables

2013-02-07 Thread Martin Vermeer

On 02/02/13 22:27, Pavel Sanda wrote:

Martin Vermeer wrote:

I added code to InsetMathNest to turn autocorrection off for cursor up or
down (e.g., in an array), from the philosophy that having autocorrection on
should be a conscious choice, not something you get stuck in. (Of course
pressing the spacebar always gets you out). I don't know whether or not
this new feature is a good idea... take it or leave it. But now I think
with this patch both the code and its behaviour will be a little more
transparent.

It is alredy part of feature list of LyX 2.0, he leave part is not
so easy now. Better to fix the remaining issue(s).

Pavel


I have a vague recollection of having been asked this bug question 
before, and giving a similar response / patch proposal, which was never 
committed ;-/


Martin



Re: [PATCH] Improve decimal alignment in tables

2013-02-07 Thread Martin Vermeer

On 02/02/13 22:27, Pavel Sanda wrote:

Martin Vermeer wrote:

I added code to InsetMathNest to turn autocorrection off for cursor up or
down (e.g., in an array), from the philosophy that having autocorrection on
should be a conscious choice, not something you get stuck in. (Of course
pressing the spacebar always gets you out). I don't know whether or not
this new feature is a good idea... take it or leave it. But now I think
with this patch both the code and its behaviour will be a little more
transparent.

It is alredy part of feature list of LyX 2.0, he "leave part" is not
so easy now. Better to fix the remaining issue(s).

Pavel


I have a vague recollection of having been asked this bug question 
before, and giving a similar response / patch proposal, which was never 
committed ;-/


Martin



[PATCH]: \url crash bug (Re: [PATCH] Improve decimal alignment in tables)

2013-02-03 Thread Martin Vermeer
Here is another patch to fix a TeX crash I ran into: if you have a text 
containing a \url and you apply a text attribute (like 'small') to it, 
you get it inserted inside the url:


{\small abc}\url{\small def}{\small ghi}

making TeX crash royally.

Martin
diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc
index 2c4eb4f..1054254 100644
--- a/lib/layouts/stdinsets.inc
+++ b/lib/layouts/stdinsets.inc
@@ -387,6 +387,7 @@ InsetLayout Flex:URL
 	PassThru  true
 	FreeSpacing   true
 	ForceLTR  true
+	ResetsFontfalse
 	Font
 	  Family  Typewriter
 	  Color   urltext


[PATCH]: \url crash bug (Re: [PATCH] Improve decimal alignment in tables)

2013-02-03 Thread Martin Vermeer
Here is another patch to fix a TeX crash I ran into: if you have a text 
containing a \url and you apply a text attribute (like 'small') to it, 
you get it inserted inside the url:


{\small abc}\url{\small def}{\small ghi}

making TeX crash royally.

Martin
diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc
index 2c4eb4f..1054254 100644
--- a/lib/layouts/stdinsets.inc
+++ b/lib/layouts/stdinsets.inc
@@ -387,6 +387,7 @@ InsetLayout "Flex:URL"
 	PassThru  true
 	FreeSpacing   true
 	ForceLTR  true
+	ResetsFontfalse
 	Font
 	  Family  Typewriter
 	  Color   urltext


Re: [PATCH] Improve decimal alignment in tables

2013-02-02 Thread Martin Vermeer

On 02/02/13 10:41, Pavel Sanda wrote:

Jean-Marc Lasgouttes wrote:

Here is another patch from our own Martin Vermeer improving support for
aligning on decimal point in tables. Unfortunately, since I do not use this
at all, I am not able to see whether this is an improvement for all use
cases.

Please comment.

JMarc


 Message original 
Sujet: Re: Small LyX patch
Date : Fri, 01 Feb 2013 13:31:52 +0200
De : Martin Vermeer martin.verm...@aalto.fi
Répondre ? : martin.verm...@aalto.fi
Pour : Jean-Marc Lasgouttes jean-marc.lasgout...@inria.fr

On 29/01/13 15:33, Martin Vermeer wrote:

On 2013-01-29 11:22, Jean-Marc Lasgouttes wrote:

Le 29/01/2013 06:50, Martin Vermeer a écrit :

Talking about wish lists, here's another one: it's really nice that the
decimal alignment trick for tabular described in the literature in
implemented. However, it still doesn't cover a use case that I have run
into: aligning decimal numbers (like 123,45) with numbers without a
decimal comma (like 6789). The limitation is caused by two roles of the
decimal symbol being mixed up: 1) as an alignment marker, i.e.,
where to
put the inter-column marker ; and 2) as the decimal symbol to be
inserted, i.e., what goes into the @{,} in the tabular format string.
These two roles should be separated (and my use case would be
covered by
using comma and empty, respectively, and writing 123,,45 and 6789,)

This is beyond my knowledge...

JMarc

Sure... but someone wrote this code ;-)

That someone is IIRC Edwin.

Martin, when you made the mistake to appear here on list, could you have a look
at http://www.lyx.org/trac/ticket/7865 ?

Pavel



Sure Pavel, see attached.

Explanation: for some reason autocorrect() also appears in Cursor.cpp, 
and the occurrences in Backspace and Delete silently turn 
auto-correction off. So do the occurrences in Cursor Up and Cursor Down, 
but I have not been able to have this code triggered from mathed... so I 
just removed them.


I added code to InsetMathNest to turn autocorrection off for cursor up 
or down (e.g., in an array), from the philosophy that having 
autocorrection on should be a conscious choice, not something you get 
stuck in. (Of course pressing the spacebar always gets you out). I don't 
know whether or not this new feature is a good idea... take it or leave 
it. But now I think with this patch both the code and its behaviour will 
be a little more transparent.


...and I didn't remember my login details for lyx-devel :-)

Cheers

Martin


diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 4469875..23db7bc 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -1525,8 +1525,6 @@ void Cursor::insert(MathData const  ar)
 
 bool Cursor::backspace()
 {
-	autocorrect() = false;
-
 	if (selection()) {
 		cap::eraseSelection(*this);
 		return true;
@@ -1577,7 +1575,6 @@ bool Cursor::backspace()
 
 bool Cursor::erase()
 {
-	autocorrect() = false;
 	if (inMacroMode())
 		return true;
 
@@ -1632,7 +1629,6 @@ bool Cursor::up()
 	if (disp_.dispatched())
 		return true;
 	setCursor(save);
-	autocorrect() = false;
 	return false;
 }
 
@@ -1646,7 +1642,6 @@ bool Cursor::down()
 	if (disp_.dispatched())
 		return true;
 	setCursor(save);
-	autocorrect() = false;
 	return false;
 }
 
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 86920e1..0b24a1d 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -706,6 +706,10 @@ void InsetMathNest::doDispatch(Cursor  cur, FuncRequest  cmd)
 			act == LFUN_UP_SELECT;
 		cur.selHandle(select);
 
+		// handle autocorrect:
+		cur.autocorrect() = false;
+		cur.message(_(Autocorrect Off ('!' to enter)));
+
 		// go up/down
 		bool up = act == LFUN_UP || act == LFUN_UP_SELECT;
 		bool successful = cur.upDownInMath(up);


Re: [PATCH] Improve decimal alignment in tables

2013-02-02 Thread Martin Vermeer

On 02/02/13 10:41, Pavel Sanda wrote:

Jean-Marc Lasgouttes wrote:

Here is another patch from our own Martin Vermeer improving support for
aligning on decimal point in tables. Unfortunately, since I do not use this
at all, I am not able to see whether this is an improvement for all use
cases.

Please comment.

JMarc


 Message original 
Sujet: Re: Small LyX patch
Date : Fri, 01 Feb 2013 13:31:52 +0200
De : Martin Vermeer <martin.verm...@aalto.fi>
Répondre ? : martin.verm...@aalto.fi
Pour : Jean-Marc Lasgouttes <jean-marc.lasgout...@inria.fr>

On 29/01/13 15:33, Martin Vermeer wrote:

On 2013-01-29 11:22, Jean-Marc Lasgouttes wrote:

Le 29/01/2013 06:50, Martin Vermeer a écrit :

Talking about wish lists, here's another one: it's really nice that the
decimal alignment trick for tabular described in the literature in
implemented. However, it still doesn't cover a use case that I have run
into: aligning decimal numbers (like 123,45) with numbers without a
decimal comma (like 6789). The limitation is caused by two roles of the
decimal symbol being mixed up: 1) as an alignment marker, i.e.,
where to
put the inter-column marker &; and 2) as the decimal symbol to be
inserted, i.e., what goes into the @{,} in the tabular format string.
These two roles should be separated (and my use case would be
covered by
using  and , respectively, and writing 123,,45 and 6789,)

This is beyond my knowledge...

JMarc

Sure... but someone wrote this code ;-)

That someone is IIRC Edwin.

Martin, when you made the mistake to appear here on list, could you have a look
at http://www.lyx.org/trac/ticket/7865 ?

Pavel



Sure Pavel, see attached.

Explanation: for some reason autocorrect() also appears in Cursor.cpp, 
and the occurrences in Backspace and Delete silently turn 
auto-correction off. So do the occurrences in Cursor Up and Cursor Down, 
but I have not been able to have this code triggered from mathed... so I 
just removed them.


I added code to InsetMathNest to turn autocorrection off for cursor up 
or down (e.g., in an array), from the philosophy that having 
autocorrection on should be a conscious choice, not something you get 
stuck in. (Of course pressing the spacebar always gets you out). I don't 
know whether or not this new feature is a good idea... take it or leave 
it. But now I think with this patch both the code and its behaviour will 
be a little more transparent.


...and I didn't remember my login details for lyx-devel :-)

Cheers

Martin


diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 4469875..23db7bc 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -1525,8 +1525,6 @@ void Cursor::insert(MathData const & ar)
 
 bool Cursor::backspace()
 {
-	autocorrect() = false;
-
 	if (selection()) {
 		cap::eraseSelection(*this);
 		return true;
@@ -1577,7 +1575,6 @@ bool Cursor::backspace()
 
 bool Cursor::erase()
 {
-	autocorrect() = false;
 	if (inMacroMode())
 		return true;
 
@@ -1632,7 +1629,6 @@ bool Cursor::up()
 	if (disp_.dispatched())
 		return true;
 	setCursor(save);
-	autocorrect() = false;
 	return false;
 }
 
@@ -1646,7 +1642,6 @@ bool Cursor::down()
 	if (disp_.dispatched())
 		return true;
 	setCursor(save);
-	autocorrect() = false;
 	return false;
 }
 
diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp
index 86920e1..0b24a1d 100644
--- a/src/mathed/InsetMathNest.cpp
+++ b/src/mathed/InsetMathNest.cpp
@@ -706,6 +706,10 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
 			act == LFUN_UP_SELECT;
 		cur.selHandle(select);
 
+		// handle autocorrect:
+		cur.autocorrect() = false;
+		cur.message(_("Autocorrect Off ('!' to enter)"));
+
 		// go up/down
 		bool up = act == LFUN_UP || act == LFUN_UP_SELECT;
 		bool successful = cur.upDownInMath(up);


Re: lyx math autocorrection

2011-06-20 Thread Martin Vermeer
On Mon, Jun 20, 2011 at 11:37:01AM +0200, Jean-Marc Lasgouttes wrote:
 Le 18/06/2011 00:41, Uwe Stöhr a écrit :
 Am 17.06.2011 16:34, schrieb Jean-Marc Lasgouttes:
 
 I enabled the autocorrection mode for math in the preferences and
 therefore expect that
 autocorrection is by default on. But it is not. It only works if I
 enter ! in an equation. But
 as soon as I leave the equation it is turn off again. So for every
 new equation or when I return
 to the equation, I again and again have to type ! to get it working.
 Is this a bug or intended?
 
 I think it is intended, because the autocorrection may stop on your toes.
 
 What do you mean with stop on your toes?
 
 I meant step on your toes.
 
 But of course this could be changed.
 
  From the logic, as an average user I would expect that ofter enabling
 auto correction, this feature is always available.
 
 I do not have enough experience with the feature to understand
 whether it can become more annoying than helpful. The change has
 been added by Martin vermeer:
 
 r28008 | vermeer | 2009-01-06 10:44:47 +0100 (mar. 06 janv. 2009) | 4 lignes
 
 Make autocorrect (still disabled) better. Now switched
 on/off by !/space.
 
 
 We'd have to look at mailing list discussions around this date to
 understand whether this was fixing a real need or just being overly
 cautious. André, do you remember about it?
 
 JMarc

(Overly?) cautious, I think. Someone (André?) turned it off because there
were still some warts. I turned it conditionally on again because I judged
it useful in spite of this.

Martin



Re: lyx math autocorrection

2011-06-20 Thread Martin Vermeer
On Mon, Jun 20, 2011 at 11:37:01AM +0200, Jean-Marc Lasgouttes wrote:
> Le 18/06/2011 00:41, Uwe Stöhr a écrit :
> >Am 17.06.2011 16:34, schrieb Jean-Marc Lasgouttes:
> >
> >>>I enabled the autocorrection mode for math in the preferences and
> >>>therefore expect that
> >>>autocorrection is by default on. But it is not. It only works if I
> >>>enter "!" in an equation. But
> >>>as soon as I leave the equation it is turn off again. So for every
> >>>new equation or when I return
> >>>to the equation, I again and again have to type ! to get it working.
> >>>Is this a bug or intended?
> >>
> >>I think it is intended, because the autocorrection may stop on your toes.
> >
> >What do you mean with "stop on your toes"?
> 
> I meant "step on your toes".
> 
> >>But of course this could be changed.
> >
> > From the logic, as an average user I would expect that ofter enabling
> >auto correction, this feature is always available.
> 
> I do not have enough experience with the feature to understand
> whether it can become more annoying than helpful. The change has
> been added by Martin vermeer:
> 
> r28008 | vermeer | 2009-01-06 10:44:47 +0100 (mar. 06 janv. 2009) | 4 lignes
> 
> Make autocorrect (still disabled) better. Now switched
> on/off by !/space.
> 
> 
> We'd have to look at mailing list discussions around this date to
> understand whether this was fixing a real need or just being overly
> cautious. André, do you remember about it?
> 
> JMarc

(Overly?) cautious, I think. Someone (André?) turned it off because there
were still some warts. I turned it conditionally on again because I judged
it useful in spite of this.

Martin



Re: #6261: Autocorrection problems

2010-12-07 Thread Martin Vermeer
On Tue, 07 Dec 2010 03:49:12 +
LyX Ticket Tracker t...@lyx.org wrote:

 #6261: Autocorrection problems
 -+--
  Reporter:  sanda|   Owner:  lasgouttes
  Type:  defect   |  Status:  new   
  Priority:  normal   |   Milestone:  2.0.0 
 Component:  general  | Version:  2.0.0svn  
  Severity:  normal   |Keywords:
 -+--
 
 Comment(by sanda):
 
  Martin, are you totally gone or can still look...?


Actually I am pretty much gone... this error does not ring a bell.

Martin
 


Re: #6261: Autocorrection problems

2010-12-07 Thread Martin Vermeer
On Tue, 07 Dec 2010 03:49:12 +
LyX Ticket Tracker  wrote:

> #6261: Autocorrection problems
> -+--
>  Reporter:  sanda|   Owner:  lasgouttes
>  Type:  defect   |  Status:  new   
>  Priority:  normal   |   Milestone:  2.0.0 
> Component:  general  | Version:  2.0.0svn  
>  Severity:  normal   |Keywords:
> -+--
> 
> Comment(by sanda):
> 
>  Martin, are you totally gone or can still look...?


Actually I am pretty much gone... this error does not ring a bell.

Martin
 


Re: Did I ever mention how much I like LyX?

2010-03-12 Thread Martin Vermeer
On Fri, 12 Mar 2010 14:25:13 +1300
john j...@og.co.nz wrote:

 Steve Litt wrote:
  Hi all,
 
  Did I ever mention how much I like LyX? It's wonderful. I'm writing my new 
  book right now, and LyX is so easy and transparent that I'm pounding out an 
  average of 3,000 words per day. LyX just stays out of your way and let's 
  you 
  whomp out content. It's great.
 
  Thanks to the developers for making this great bookmaking software, and the 
  community for making it better and providing information.

 Amen to that!
 It's my favourite piece of software and has been for more than a decade!
 
 John O'Gorman


Hmm, yesterday I showed LyX to a colleague -- installed it and demoed
it on her Ubuntu laptop, in the space of half an hour, quietly while
both of us were listening to a seminar presentation. Smooth as silk.
She was sold solid, started writing straightaway.

Martin


  SteveT
 
  Steve Litt
  Recession Relief Package
  http://www.recession-relief.US
  Twitter: http://www.twitter.com/stevelitt
 
 
 

 


Re: Did I ever mention how much I like LyX?

2010-03-12 Thread Martin Vermeer
On Fri, 12 Mar 2010 14:25:13 +1300
john  wrote:

> Steve Litt wrote:
> > Hi all,
> >
> > Did I ever mention how much I like LyX? It's wonderful. I'm writing my new 
> > book right now, and LyX is so easy and transparent that I'm pounding out an 
> > average of 3,000 words per day. LyX just stays out of your way and let's 
> > you 
> > whomp out content. It's great.
> >
> > Thanks to the developers for making this great bookmaking software, and the 
> > community for making it better and providing information.
> >   
> Amen to that!
> It's my favourite piece of software and has been for more than a decade!
> 
> John O'Gorman


Hmm, yesterday I showed LyX to a colleague -- installed it and demoed
it on her Ubuntu laptop, in the space of half an hour, quietly while
both of us were listening to a seminar presentation. Smooth as silk.
She was sold solid, started writing straightaway.

Martin


> > SteveT
> >
> > Steve Litt
> > Recession Relief Package
> > http://www.recession-relief.US
> > Twitter: http://www.twitter.com/stevelitt
> >
> >
> >
> >   
> 


Re: Branches…

2010-03-02 Thread Martin Vermeer
On Tue, 02 Mar 2010 11:35:28 +0100
jezZiFeR jezzi...@googlemail.com wrote:

 Dear listmembers,
 
 is is possible to print just branches, not the main text? To select  
 some branches und to compile just them?
 
 Thanks for your help
 Jess

Sure... just put the main text in a branch of its own, and disable it.

Martin


Re: Branches…

2010-03-02 Thread Martin Vermeer
On Tue, 02 Mar 2010 11:35:28 +0100
jezZiFeR  wrote:

> Dear listmembers,
> 
> is is possible to print just branches, not the main text? To select  
> some branches und to compile just them?
> 
> Thanks for your help
> Jess

Sure... just put the main text in a branch of its own, and disable it.

Martin


Re: palabras que aparecen en inglés

2009-11-26 Thread Martin Vermeer
On Thu, 26 Nov 2009 21:04:23 -0800 (PST)
m s marinam...@yahoo.com.ar wrote:

 
 
 --- El vie 27-nov-09, m s marinam...@yahoo.com.ar escribió:
 
 
 De: m s marinam...@yahoo.com.ar
 Asunto: 
 Para: lyx-devel@lists.lyx.org
 Fecha: viernes, 27 de noviembre de 2009, 3:00 am
 
 
 
 
 
 
 Quiero informarles que al escribir documento y también en el DVI las palabras 
 CONTENTS, CHAPTER y BIBLIOGRAPHY aparecen en inglés aunque el texto que 
 escribo esté en español. Cómo cambiar eso?. Tengo la versión LYX 1.6.

You may want to check the menu Document - Settings - Language (in the
Settings panel). It should be Spanish. Just writing the text in Spanish
is not enough. You may want to save it as the class default if you write
mostly Spanish documents.

BTW this is a question for the user list.

Hope this helps


Re: palabras que aparecen en inglés

2009-11-26 Thread Martin Vermeer
On Thu, 26 Nov 2009 21:04:23 -0800 (PST)
m s  wrote:

> 
> 
> --- El vie 27-nov-09, m s  escribió:
> 
> 
> De: m s 
> Asunto: 
> Para: lyx-devel@lists.lyx.org
> Fecha: viernes, 27 de noviembre de 2009, 3:00 am
> 
> 
> 
> 
> 
> 
> Quiero informarles que al escribir documento y también en el DVI las palabras 
> CONTENTS, CHAPTER y BIBLIOGRAPHY aparecen en inglés aunque el texto que 
> escribo esté en español. Cómo cambiar eso?. Tengo la versión LYX 1.6.

You may want to check the menu Document -> Settings -> Language (in the
Settings panel). It should be Spanish. Just writing the text in Spanish
is not enough. You may want to save it as the class default if you write
mostly Spanish documents.

BTW this is a question for the user list.

Hope this helps


Re: Beware! Arsene is coming !

2009-08-26 Thread Martin Vermeer
On Wed, 26 Aug 2009 01:55:56 +0200
Jean-Marc Lasgouttes lasgout...@lyx.org wrote:

 Some people say that good things always come to an end, but this implies 
 that good things have to start at some point too. I am glad to announce 
 the birth of our third child Arsène (who is thus a boy, for those of you 
 who slept during French literature courses) this morning.
 
 I will skip the scary numbers and just mention that he is kind of perfect.
 
 Have a very nice day.
 
 JMarc


So I should beware ;-)

http://fr.wikipedia.org/wiki/Arpène_Lucien

Congratulations Jean-Marc! And you Arsène of course...

Martin


Re: Beware! Arsene is coming !

2009-08-26 Thread Martin Vermeer
On Wed, 26 Aug 2009 01:55:56 +0200
Jean-Marc Lasgouttes  wrote:

> Some people say that good things always come to an end, but this implies 
> that good things have to start at some point too. I am glad to announce 
> the birth of our third child Arsène (who is thus a boy, for those of you 
> who slept during French literature courses) this morning.
> 
> I will skip the scary numbers and just mention that he is kind of perfect.
> 
> Have a very nice day.
> 
> JMarc


So I should beware ;-)

http://fr.wikipedia.org/wiki/Arpène_Lucien

Congratulations Jean-Marc! And you Arsène of course...

Martin


Re: Code swarm for LyX

2009-08-17 Thread Martin Vermeer
On Fri, 14 Aug 2009 20:33:25 +0200
Lars Gullik Bjønnes lar...@gullik.org wrote:

 For your enjoyment:
 
 Attaching torrent to get it.

What happened to the sound?

;-)




Re: Code swarm for LyX

2009-08-17 Thread Martin Vermeer
On Fri, 14 Aug 2009 20:33:25 +0200
Lars Gullik Bjønnes  wrote:

> For your enjoyment:
> 
> Attaching torrent to get it.

What happened to the sound?

;-)




Re: r30564 - lyx-devel/trunk/src/insets

2009-07-15 Thread Martin Vermeer
On Tue, 14 Jul 2009 15:47:25 +0200
Jean-Marc Lasgouttes lasgout...@lyx.org wrote:

 Le 14 juil. 09 à 15:32, lasgout...@lyx.org a écrit :
  +   // FIXME this use of forceLTR is dubious
  +   // introduced in http://www.lyx.org/trac/changeset/21285
  +   if (getLayout().isForceLtr()) {
  +   // Force any new text to latex_language FIXME: This
  +   // should only be necessary in constructor, but new
  +   // paragraphs that are created by pressing enter at
  +   // the start of an existing paragraph get the buffer
  +   // language and not latex_language, so we take this
  +   // brute force approach.
  +   cur.current_font.setLanguage(latex_language);
  +   cur.real_current_font.setLanguage(latex_language);
  +   }
  +
 
 I have copied the code above from InsetCollapsable, but I do not  
 understand the logic.
 forceLTR is defined as:
   /// Force inset into LTR environment if surroundings are RTL?
   virtual bool forceLTR() const;
 
 I suspect the right thing to use is getLayout().isPassthru.
 
 Martin, do you remember why you chose that instead?
 
 JMarc

No... but as the comment says, it is probably overkill.

- Martin


Re: r30564 - lyx-devel/trunk/src/insets

2009-07-15 Thread Martin Vermeer
On Tue, 14 Jul 2009 15:47:25 +0200
Jean-Marc Lasgouttes  wrote:

> Le 14 juil. 09 à 15:32, lasgout...@lyx.org a écrit :
> > +   // FIXME this use of forceLTR is dubious
> > +   // introduced in http://www.lyx.org/trac/changeset/21285
> > +   if (getLayout().isForceLtr()) {
> > +   // Force any new text to latex_language FIXME: This
> > +   // should only be necessary in constructor, but new
> > +   // paragraphs that are created by pressing enter at
> > +   // the start of an existing paragraph get the buffer
> > +   // language and not latex_language, so we take this
> > +   // brute force approach.
> > +   cur.current_font.setLanguage(latex_language);
> > +   cur.real_current_font.setLanguage(latex_language);
> > +   }
> > +
> 
> I have copied the code above from InsetCollapsable, but I do not  
> understand the logic.
> forceLTR is defined as:
>   /// Force inset into LTR environment if surroundings are RTL?
>   virtual bool forceLTR() const;
> 
> I suspect the right thing to use is getLayout().isPassthru.
> 
> Martin, do you remember why you chose that instead?
> 
> JMarc

No... but as the comment says, it is probably overkill.

- Martin


Re: Add math autocorrect to RC file

2009-06-23 Thread Martin Vermeer
On Tue, 23 Jun 2009 10:45:24 +0200
Jean-Marc Lasgouttes lasgout...@lyx.org wrote:

 Martin Vermeer martin.verm...@tkk.fi writes:
  this is due to the migration to our new server. please contact JMarc
  for setting an account for you, it should be quite easy now.
 
  Perhaps... but doesn't look like I'll be contributing any time soon
  now. Real Life is rampant :-(
 
 So do you want an account? A @lyx.org mail address?

Yes please... no please.

 JMarc

- Martin


Re: Add math autocorrect to RC file

2009-06-23 Thread Martin Vermeer
On Tue, 23 Jun 2009 10:45:24 +0200
Jean-Marc Lasgouttes <lasgout...@lyx.org> wrote:

> Martin Vermeer <martin.verm...@tkk.fi> writes:
> >> this is due to the migration to our new server. please contact JMarc
> >> for setting an account for you, it should be quite easy now.
> >
> > Perhaps... but doesn't look like I'll be contributing any time soon
> > now. Real Life is rampant :-(
> 
> So do you want an account? A @lyx.org mail address?

Yes please... no please.

> JMarc

- Martin


Re: Add math autocorrect to RC file

2009-06-22 Thread Martin Vermeer
On Sun, 14 Jun 2009 00:27:16 +0200
Pavel Sanda sa...@lyx.org wrote:

 Martin Vermeer wrote:
  On Wed, 14 Jan 2009 13:22:54 +0100
  Pavel Sanda sa...@lyx.org wrote:
  
   Martin Vermeer wrote:
As in the attached. This makes it possible to enable autocorrection in 
the preferences file.
   
   would it be possible to add some list of autocorrected things into some 
   of our manual?
  
  Hmmm, yes.
 
 Martin, i have added gui checkbox for autocorrection. would it be possible to 
 add some info
 how this works in our manual? pavel
 
   it may be worth to add checkbox into preferences gui.
  
  That was the next step in my world domination plan ;-)
  
  Only, I'm rather lost with this qt stuff.
  
   pavel
  
  - Martin


Thanks Pavel.

It works like this: for certain predefined key sequences like = typing
the sequence will lead to a \Rightarrow appearing in Math.

Unfortunately I don't have a working lyx in svn now... no working
account. So I cannot check how it works. What I remember is that you
can leave autocorrect mode by pressing space and re-enter it by
pressing !.

The sequences recognized are listed in lib/autocorrect.

- Martin

BTW Some guys at Turku University have implemented a facility for
writing structured derivations (i.e., math text with collapsable
subderivations etc. etc.) in LyX. Looks quite impressive. The source is
here:

 http://users.abo.fi/psallasm/src/

Would there be an interest in having this in trunk?

- Martin


Re: Add math autocorrect to RC file

2009-06-22 Thread Martin Vermeer
On Sun, 14 Jun 2009 00:27:16 +0200
Pavel Sanda <sa...@lyx.org> wrote:

> Martin Vermeer wrote:
> > On Wed, 14 Jan 2009 13:22:54 +0100
> > Pavel Sanda <sa...@lyx.org> wrote:
> > 
> > > Martin Vermeer wrote:
> > > > As in the attached. This makes it possible to enable autocorrection in 
> > > > the preferences file.
> > > 
> > > would it be possible to add some list of autocorrected things into some 
> > > of our manual?
> > 
> > Hmmm, yes.
> 
> Martin, i have added gui checkbox for autocorrection. would it be possible to 
> add some info
> how this works in our manual? pavel
> 
> > > it may be worth to add checkbox into preferences gui.
> > 
> > That was the next step in my world domination plan ;-)
> > 
> > Only, I'm rather lost with this qt stuff.
> > 
> > > pavel
> > 
> > - Martin


Thanks Pavel.

It works like this: for certain predefined key sequences like => typing
the sequence will lead to a \Rightarrow appearing in Math.

Unfortunately I don't have a working lyx in svn now... no working
account. So I cannot check how it works. What I remember is that you
can leave autocorrect mode by pressing  and re-enter it by
pressing .

The sequences recognized are listed in lib/autocorrect.

- Martin

BTW Some guys at Turku University have implemented a facility for
writing structured derivations (i.e., math text with collapsable
subderivations etc. etc.) in LyX. Looks quite impressive. The source is
here:

 http://users.abo.fi/psallasm/src/

Would there be an interest in having this in trunk?

- Martin


Re: Amir Younes is born

2009-04-14 Thread Martin Vermeer
On Mon, 13 Apr 2009 23:41:36 +0200
Abdelrazak Younes you...@lyx.org wrote:

 As I leaked the highly important news that my wife was pregnant 
 (whatever JMarc says), I'd thought I should announce formally that this 
 state of affair finally led to a small cute little guy named Amir :-)
 The mother (Aya) is doing very well.
 
 I guess this also means that this won't help my increasing absence in 
 LyX development :-)
 
 Cheers,
 Abdel.

Congratulations  Abdel!

Doesn't 'Amir' mean 'commander'? Is he already commanding you around?

Cheers Martin


Re: Amir Younes is born

2009-04-14 Thread Martin Vermeer
On Mon, 13 Apr 2009 23:41:36 +0200
Abdelrazak Younes  wrote:

> As I leaked the highly important news that my wife was pregnant 
> (whatever JMarc says), I'd thought I should announce formally that this 
> state of affair finally led to a small cute little guy named Amir :-)
> The mother (Aya) is doing very well.
> 
> I guess this also means that this won't help my increasing absence in 
> LyX development :-)
> 
> Cheers,
> Abdel.

Congratulations  Abdel!

Doesn't 'Amir' mean 'commander'? Is he already commanding you around?

Cheers Martin


Re: Update on aussie phaseout and new server

2009-03-17 Thread Martin Vermeer
On Mon, 16 Mar 2009 23:26:33 +0100
Jean-Marc Lasgouttes lasgout...@lyx.org wrote:


 
 Question: how is this server maintained? Do we have good reasons to be
 confident that it will stay afloat better than aussie did?

Actually aussie did pretty well given its age. Perhaps we owe Trolltech a
note of thank you.

 JMarc

- Martin



Re: Update on aussie phaseout and new server

2009-03-17 Thread Martin Vermeer
On Mon, 16 Mar 2009 23:26:33 +0100
Jean-Marc Lasgouttes  wrote:


> 
> Question: how is this server maintained? Do we have good reasons to be
> confident that it will stay afloat better than aussie did?

Actually aussie did pretty well given its age. Perhaps we owe Trolltech a
note of thank you.

> JMarc

- Martin



Re: LyX sourceforge.net subversion repository

2009-03-08 Thread Martin Vermeer
On Sat, Mar 07, 2009 at 01:53:36PM +0100, Lars Gullik Bjønnes wrote:
 Andre Poenitz
 andre.poen...@mathematik.tu-chemnitz.de
 writes:
 
 | On Sat, Mar 07, 2009 at 11:54:23AM +0100, Jean-Marc Lasgouttes wrote:
  Andre Poenitz andre.poen...@mathematik.tu-chemnitz.de writes:
   How much effort is it to syncronize two svn repos?
  
  I do not know whether rsync can do that, or if a svn repo is just a huge
  file. Bo?
 
 | An svn repo a lots of small files, rsync would be fine if it were
 | available...
 
 Not if both repos are going to be live (one read-only)
 
 -- 
 Lgb

How about Unison? Then both could be live. And commitable.

- Martin 


Re: LyX sourceforge.net subversion repository

2009-03-08 Thread Martin Vermeer
On Sat, Mar 07, 2009 at 01:53:36PM +0100, Lars Gullik Bjønnes wrote:
> Andre Poenitz
> 
> writes:
> 
> | On Sat, Mar 07, 2009 at 11:54:23AM +0100, Jean-Marc Lasgouttes wrote:
> >> Andre Poenitz  writes:
> >> > How much effort is it to syncronize two svn repos?
> >> 
> >> I do not know whether rsync can do that, or if a svn repo is just a huge
> >> file. Bo?
> >
> | An svn repo a lots of small files, rsync would be fine if it were
> | available...
> 
> Not if both repos are going to be live (one read-only)
> 
> -- 
> Lgb

How about Unison? Then both could be live. And commitable.

- Martin 


Re: An idea

2009-02-18 Thread Martin Vermeer
On Wed, 18 Feb 2009 13:22:32 -0500
Manoj Rajagopalan rma...@umich.edu wrote:

 Hi Darlington,
 
Equation cross-referencing is basic to LyX but there is a procedure 
 to going about this.
 
 1. Use Insert-Math-Numbered Formula or Ctrl+Alt+N to create a numbered 
 formula. This should start an equation on a new line and should show a 
 (#) sign.

You don't even have to do that... just insert a (display-style)
formula. The 'Insert-Label' menu option will show when the cursor is inside
such a formula.

 2. Position the cursor within the equation environment and click 
 Insert-Label and type in some name that helps you remember this 
 equation. It is customary though not mandatory to start equation labels 
 with 'eq:'.
 3. Position the cursor at the point you want to reference this equation 
 and then click Insert-Cross Reference. Then select the equation from 
 the list of labels you have previously created.
 3a. The options in the Format combo box allow you to select the style 
 for that reference, i.e., (eqn#) or eqn# or the page # for that eqn. etc.
 
Does this answer your question? The LyX User Guide explains all this.
 -- Manoj
 
 
 Hove, Darlington (Mr) (s208093670) wrote:
  To whom it may concern
  
  I have recently started using Lyx and I must say it is a good word 
  processing package. It has made my work easier than the traditional Latex 
  version. However I feel there is one area that should be changed without 
  delay.
  
  As a mathematician, I tend to come across many equations and more often 
  than not, I have to refer and cross refer between equations. Now, from my 
  experience with lyx, I am not able to reference an equation save for a 
  section or a page. Now this to me needs correction and if you could look 
  into this matter, it would help many potential lyx users out there.
  
  I would be very happy if my contribution receives feedback otherwise I am 
  looking forward to hearing from you.
  
  Regards,
  
  
  Darlington Hove
  
  NOTICE: Please note that this eMail, and the contents thereof, is subject 
  to the standard NMMU eMail disclaimer which may be found at:
  http://www.nmmu.ac.za/disclaimer/email.htm
  
  
  
  


Re: An idea

2009-02-18 Thread Martin Vermeer
On Wed, 18 Feb 2009 13:22:32 -0500
Manoj Rajagopalan  wrote:

> Hi Darlington,
> 
>Equation cross-referencing is basic to LyX but there is a procedure 
> to going about this.
> 
> 1. Use Insert->Math->Numbered Formula or Ctrl+Alt+N to create a numbered 
> formula. This should start an equation on a new line and should show a 
> (#) sign.

You don't even have to do that... just insert a (display-style)
formula. The 'Insert->Label' menu option will show when the cursor is inside
such a formula.

> 2. Position the cursor within the equation environment and click 
> Insert->Label and type in some name that helps you remember this 
> equation. It is customary though not mandatory to start equation labels 
> with 'eq:'.
> 3. Position the cursor at the point you want to reference this equation 
> and then click Insert->Cross Reference. Then select the equation from 
> the list of labels you have previously created.
> 3a. The options in the Format combo box allow you to select the style 
> for that reference, i.e., (eqn#) or eqn# or the page # for that eqn. etc.
> 
>Does this answer your question? The LyX User Guide explains all this.
> -- Manoj
> 
> 
> Hove, Darlington (Mr) (s208093670) wrote:
> > To whom it may concern
> > 
> > I have recently started using Lyx and I must say it is a good word 
> > processing package. It has made my work easier than the traditional Latex 
> > version. However I feel there is one area that should be changed without 
> > delay.
> > 
> > As a mathematician, I tend to come across many equations and more often 
> > than not, I have to refer and cross refer between equations. Now, from my 
> > experience with lyx, I am not able to reference an equation save for a 
> > section or a page. Now this to me needs correction and if you could look 
> > into this matter, it would help many potential lyx users out there.
> > 
> > I would be very happy if my contribution receives feedback otherwise I am 
> > looking forward to hearing from you.
> > 
> > Regards,
> > 
> > 
> > Darlington Hove
> > 
> > NOTICE: Please note that this eMail, and the contents thereof, is subject 
> > to the standard NMMU eMail disclaimer which may be found at:
> > http://www.nmmu.ac.za/disclaimer/email.htm
> > 
> > 
> > 
> > 


Add math autocorrect to RC file

2009-01-14 Thread Martin Vermeer


As in the attached. This makes it possible to enable autocorrection in the 
preferences file.

- Martin
Index: LyXRC.h
===
--- LyXRC.h	(revision 28149)
+++ LyXRC.h	(working copy)
@@ -38,6 +38,7 @@
 	enum LyXRCTags {
 		RC_ACCEPT_COMPOUND = 1,
 		RC_ALT_LANG,
+		RC_AUTOCORRECTION_MATH,
 		RC_PLAINTEXT_LINELEN,
 		RC_PLAINTEXT_ROFF_COMMAND,
 		RC_AUTOREGIONDELETE,
@@ -438,6 +439,8 @@
 	///
 	int completion_inline_dots;
 	///
+	bool autocorrection_math;
+	///
 	double completion_popup_delay;
 	///
 	bool completion_popup_math;
Index: mathed/InsetMathNest.cpp
===
--- mathed/InsetMathNest.cpp	(revision 28149)
+++ mathed/InsetMathNest.cpp	(working copy)
@@ -10,8 +10,6 @@
 
 #include config.h
 
-//#define AUTOCORRECT
-
 #include InsetMathNest.h
 
 #include InsetMathArray.h
@@ -27,9 +25,7 @@
 #include InsetMathSpace.h
 #include InsetMathSymbol.h
 #include InsetMathUnknown.h
-#ifdef AUTOCORRECT
 #include MathAutoCorrect.h
-#endif
 #include MathCompletionList.h
 #include MathData.h
 #include MathFactory.h
@@ -1519,22 +1515,18 @@
 		return true;
 	}
 
-	// This is annoying as one has to press space far too often.
-	// Disable it.
 
-#ifdef AUTOCORRECT
-		// leave autocorrect mode if necessary
-		if (c == ' '  cur.autocorrect()) {
-			cur.autocorrect() = false;
-			cur.message(_(Autocorrect Off ('!' to enter)));
-			return true;
-		} 
-		if (c == '!'  !cur.autocorrect()) {
-			cur.autocorrect() = true;
-			cur.message(_(Autocorrect On (space to exit)));
-			return true;
-		}
-#endif
+	// leave autocorrect mode if necessary
+	if (autocorrectEnabled(cur)  c == ' '  cur.autocorrect()) {
+		cur.autocorrect() = false;
+		cur.message(_(Autocorrect Off ('!' to enter)));
+		return true;
+	} 
+	if (autocorrectEnabled(cur)  c == '!'  !cur.autocorrect()) {
+		cur.autocorrect() = true;
+		cur.message(_(Autocorrect On (space to exit)));
+		return true;
+	}
 
 	// just clear selection on pressing the space bar
 	if (cur.selection()  c == ' ') {
@@ -1631,20 +1623,18 @@
 	}
 
 
-#ifdef AUTOCORRECT
 	// try auto-correction
-	if (cur.autocorrect()  cur.pos() != 0  math_autocorrect(cur.prevAtom(), c))
+	if (autocorrectEnabled(cur)  cur.autocorrect()  cur.pos() != 0  math_autocorrect(cur.prevAtom(), c))
 		return true;
-#endif
 
 	// no special circumstances, so insert the character without any fuss
 	cur.insert(c);
-#ifdef AUTOCORRECT
-	if (!cur.autocorrect())
-		cur.message(_(Autocorrect Off ('!' to enter)));
-	else
-		cur.message(_(Autocorrect On (space to exit)));
-#endif
+	if (autocorrectEnabled(cur)) {
+		if (!cur.autocorrect())
+			cur.message(_(Autocorrect Off ('!' to enter)));
+		else
+			cur.message(_(Autocorrect On (space to exit)));
+	}
 	return true;
 }
 
@@ -1732,6 +1722,12 @@
 }
 
 
+bool InsetMathNest::autocorrectEnabled(Cursor const  cur) const
+{
+	return lyxrc.autocorrection_math;
+}
+
+
 bool InsetMathNest::completionSupported(Cursor const  cur) const
 {
 	return cur.inMacroMode();
Index: mathed/InsetMathNest.h
===
--- mathed/InsetMathNest.h	(revision 28149)
+++ mathed/InsetMathNest.h	(working copy)
@@ -112,6 +112,8 @@
 	bool mouseHovered() const { return mouse_hover_; }
 
 	///
+	bool autocorrectEnabled(Cursor const  cur) const;
+	///
 	bool completionSupported(Cursor const ) const;
 	///
 	bool inlineCompletionSupported(Cursor const  cur) const;
Index: LyXRC.cpp
===
--- LyXRC.cpp	(revision 28149)
+++ LyXRC.cpp	(working copy)
@@ -58,6 +58,7 @@
 	{ \\auto_number, LyXRC::RC_AUTO_NUMBER },
 	{ \\auto_region_delete, LyXRC::RC_AUTOREGIONDELETE },
 	{ \\auto_reset_options, LyXRC::RC_AUTORESET_OPTIONS },
+	{ \\autocorrection_math, LyXRC::RC_AUTOCORRECTION_MATH },
 	{ \\autosave, LyXRC::RC_AUTOSAVE },
 	{ \\backupdir_path, LyXRC::RC_BACKUPDIR_PATH },
 	{ \\bibtex_command, LyXRC::RC_BIBTEX_COMMAND },
@@ -314,6 +315,7 @@
 	completion_popup_text = false;
 	completion_popup_delay = 2.0;
 	completion_popup_after_complete = true;
+	autocorrection_math = false;
 	completion_inline_math = true;
 	completion_inline_text = false;
 	completion_inline_dots = -1;
@@ -711,6 +713,10 @@
 			lexrc  completion_inline_dots;
 			break;
 
+		case RC_AUTOCORRECTION_MATH:
+			lexrc  autocorrection_math;
+			break;
+
 		case RC_COMPLETION_POPUP_DELAY:
 			lexrc  completion_popup_delay;
 			break;
@@ -1968,6 +1974,14 @@
 		}
 		if (tag != RC_LAST)
 			break;
+	case RC_AUTOCORRECTION_MATH:
+		if (ignore_system_lyxrc ||
+		autocorrection_math != system_lyxrc.autocorrection_math) {
+			os  \\autocorrection_math 
+ convertstring(autocorrection_math)  '\n';
+		}
+		if (tag != RC_LAST)
+			break;
 	case RC_COMPLETION_POPUP_DELAY:
 		if (ignore_system_lyxrc ||
 		completion_popup_delay != system_lyxrc.completion_popup_delay) {
@@ -2652,6 +2666,10 @@
 		str = _(Use \...\ to shorten long 

Re: Add math autocorrect to RC file

2009-01-14 Thread Martin Vermeer
On Wed, 14 Jan 2009 13:22:54 +0100
Pavel Sanda sa...@lyx.org wrote:

 Martin Vermeer wrote:
  As in the attached. This makes it possible to enable autocorrection in the 
  preferences file.
 
 would it be possible to add some list of autocorrected things into some of 
 our manual?

Hmmm, yes.

 it may be worth to add checkbox into preferences gui.

That was the next step in my world domination plan ;-)

Only, I'm rather lost with this qt stuff.

 pavel

- Martin


Re: Add math autocorrect to RC file

2009-01-14 Thread Martin Vermeer
On Wed, 14 Jan 2009 14:37:47 +0100
Jean-Marc Lasgouttes lasgout...@lyx.org wrote:

 Martin Vermeer martin.verm...@tkk.fi writes:
  +   // leave autocorrect mode if necessary
  +   if (autocorrectEnabled(cur)  c == ' '  cur.autocorrect()) {
 
 Two questions (probably related)
 - why do you pass cur to autocorrectEnabled, whereas it does not rely on
 the cursor?

Hrmf.

 - why not put the cur.autocorrect() test into autocorrectEnabled, sicne
 they are always used together? Or maybe move the lyxrc check into
 Cursor::autocorrect.
 
 JMarc

Eh, how do you handle this:

if (autocorrectEnabled()) {
if (!cur.autocorrect())
cur.message(_(Autocorrect Off ('!' to enter)));
else
cur.message(_(Autocorrect On (space to exit)));
}

- Martin
Index: LyXRC.h
===
--- LyXRC.h	(revision 28149)
+++ LyXRC.h	(working copy)
@@ -38,6 +38,7 @@
 	enum LyXRCTags {
 		RC_ACCEPT_COMPOUND = 1,
 		RC_ALT_LANG,
+		RC_AUTOCORRECTION_MATH,
 		RC_PLAINTEXT_LINELEN,
 		RC_PLAINTEXT_ROFF_COMMAND,
 		RC_AUTOREGIONDELETE,
@@ -438,6 +439,8 @@
 	///
 	int completion_inline_dots;
 	///
+	bool autocorrection_math;
+	///
 	double completion_popup_delay;
 	///
 	bool completion_popup_math;
Index: mathed/InsetMathNest.cpp
===
--- mathed/InsetMathNest.cpp	(revision 28149)
+++ mathed/InsetMathNest.cpp	(working copy)
@@ -10,8 +10,6 @@
 
 #include config.h
 
-//#define AUTOCORRECT
-
 #include InsetMathNest.h
 
 #include InsetMathArray.h
@@ -27,9 +25,7 @@
 #include InsetMathSpace.h
 #include InsetMathSymbol.h
 #include InsetMathUnknown.h
-#ifdef AUTOCORRECT
 #include MathAutoCorrect.h
-#endif
 #include MathCompletionList.h
 #include MathData.h
 #include MathFactory.h
@@ -1519,22 +1515,18 @@
 		return true;
 	}
 
-	// This is annoying as one has to press space far too often.
-	// Disable it.
 
-#ifdef AUTOCORRECT
-		// leave autocorrect mode if necessary
-		if (c == ' '  cur.autocorrect()) {
-			cur.autocorrect() = false;
-			cur.message(_(Autocorrect Off ('!' to enter)));
-			return true;
-		} 
-		if (c == '!'  !cur.autocorrect()) {
-			cur.autocorrect() = true;
-			cur.message(_(Autocorrect On (space to exit)));
-			return true;
-		}
-#endif
+	// leave autocorrect mode if necessary
+	if (autocorrectEnabled()  c == ' '  cur.autocorrect()) {
+		cur.autocorrect() = false;
+		cur.message(_(Autocorrect Off ('!' to enter)));
+		return true;
+	} 
+	if (autocorrectEnabled()  c == '!'  !cur.autocorrect()) {
+		cur.autocorrect() = true;
+		cur.message(_(Autocorrect On (space to exit)));
+		return true;
+	}
 
 	// just clear selection on pressing the space bar
 	if (cur.selection()  c == ' ') {
@@ -1631,20 +1623,18 @@
 	}
 
 
-#ifdef AUTOCORRECT
 	// try auto-correction
-	if (cur.autocorrect()  cur.pos() != 0  math_autocorrect(cur.prevAtom(), c))
+	if (autocorrectEnabled()  cur.autocorrect()  cur.pos() != 0  math_autocorrect(cur.prevAtom(), c))
 		return true;
-#endif
 
 	// no special circumstances, so insert the character without any fuss
 	cur.insert(c);
-#ifdef AUTOCORRECT
-	if (!cur.autocorrect())
-		cur.message(_(Autocorrect Off ('!' to enter)));
-	else
-		cur.message(_(Autocorrect On (space to exit)));
-#endif
+	if (autocorrectEnabled()) {
+		if (!cur.autocorrect())
+			cur.message(_(Autocorrect Off ('!' to enter)));
+		else
+			cur.message(_(Autocorrect On (space to exit)));
+	}
 	return true;
 }
 
@@ -1732,6 +1722,12 @@
 }
 
 
+bool InsetMathNest::autocorrectEnabled() const
+{
+	return lyxrc.autocorrection_math;
+}
+
+
 bool InsetMathNest::completionSupported(Cursor const  cur) const
 {
 	return cur.inMacroMode();
Index: mathed/InsetMathNest.h
===
--- mathed/InsetMathNest.h	(revision 28149)
+++ mathed/InsetMathNest.h	(working copy)
@@ -112,6 +112,8 @@
 	bool mouseHovered() const { return mouse_hover_; }
 
 	///
+	bool autocorrectEnabled() const;
+	///
 	bool completionSupported(Cursor const ) const;
 	///
 	bool inlineCompletionSupported(Cursor const  cur) const;
Index: LyXRC.cpp
===
--- LyXRC.cpp	(revision 28149)
+++ LyXRC.cpp	(working copy)
@@ -58,6 +58,7 @@
 	{ \\auto_number, LyXRC::RC_AUTO_NUMBER },
 	{ \\auto_region_delete, LyXRC::RC_AUTOREGIONDELETE },
 	{ \\auto_reset_options, LyXRC::RC_AUTORESET_OPTIONS },
+	{ \\autocorrection_math, LyXRC::RC_AUTOCORRECTION_MATH },
 	{ \\autosave, LyXRC::RC_AUTOSAVE },
 	{ \\backupdir_path, LyXRC::RC_BACKUPDIR_PATH },
 	{ \\bibtex_command, LyXRC::RC_BIBTEX_COMMAND },
@@ -314,6 +315,7 @@
 	completion_popup_text = false;
 	completion_popup_delay = 2.0;
 	completion_popup_after_complete = true;
+	autocorrection_math = false;
 	completion_inline_math = true;
 	completion_inline_text = false;
 	completion_inline_dots = -1;
@@ -711,6 +713,10 @@
 			lexrc

Add math autocorrect to RC file

2009-01-14 Thread Martin Vermeer


As in the attached. This makes it possible to enable autocorrection in the 
preferences file.

- Martin
Index: LyXRC.h
===
--- LyXRC.h	(revision 28149)
+++ LyXRC.h	(working copy)
@@ -38,6 +38,7 @@
 	enum LyXRCTags {
 		RC_ACCEPT_COMPOUND = 1,
 		RC_ALT_LANG,
+		RC_AUTOCORRECTION_MATH,
 		RC_PLAINTEXT_LINELEN,
 		RC_PLAINTEXT_ROFF_COMMAND,
 		RC_AUTOREGIONDELETE,
@@ -438,6 +439,8 @@
 	///
 	int completion_inline_dots;
 	///
+	bool autocorrection_math;
+	///
 	double completion_popup_delay;
 	///
 	bool completion_popup_math;
Index: mathed/InsetMathNest.cpp
===
--- mathed/InsetMathNest.cpp	(revision 28149)
+++ mathed/InsetMathNest.cpp	(working copy)
@@ -10,8 +10,6 @@
 
 #include 
 
-//#define AUTOCORRECT
-
 #include "InsetMathNest.h"
 
 #include "InsetMathArray.h"
@@ -27,9 +25,7 @@
 #include "InsetMathSpace.h"
 #include "InsetMathSymbol.h"
 #include "InsetMathUnknown.h"
-#ifdef AUTOCORRECT
 #include "MathAutoCorrect.h"
-#endif
 #include "MathCompletionList.h"
 #include "MathData.h"
 #include "MathFactory.h"
@@ -1519,22 +1515,18 @@
 		return true;
 	}
 
-	// This is annoying as one has to press  far too often.
-	// Disable it.
 
-#ifdef AUTOCORRECT
-		// leave autocorrect mode if necessary
-		if (c == ' ' && cur.autocorrect()) {
-			cur.autocorrect() = false;
-			cur.message(_("Autocorrect Off ('!' to enter)"));
-			return true;
-		} 
-		if (c == '!' && !cur.autocorrect()) {
-			cur.autocorrect() = true;
-			cur.message(_("Autocorrect On ( to exit)"));
-			return true;
-		}
-#endif
+	// leave autocorrect mode if necessary
+	if (autocorrectEnabled(cur) && c == ' ' && cur.autocorrect()) {
+		cur.autocorrect() = false;
+		cur.message(_("Autocorrect Off ('!' to enter)"));
+		return true;
+	} 
+	if (autocorrectEnabled(cur) && c == '!' && !cur.autocorrect()) {
+		cur.autocorrect() = true;
+		cur.message(_("Autocorrect On ( to exit)"));
+		return true;
+	}
 
 	// just clear selection on pressing the space bar
 	if (cur.selection() && c == ' ') {
@@ -1631,20 +1623,18 @@
 	}
 
 
-#ifdef AUTOCORRECT
 	// try auto-correction
-	if (cur.autocorrect() && cur.pos() != 0 && math_autocorrect(cur.prevAtom(), c))
+	if (autocorrectEnabled(cur) && cur.autocorrect() && cur.pos() != 0 && math_autocorrect(cur.prevAtom(), c))
 		return true;
-#endif
 
 	// no special circumstances, so insert the character without any fuss
 	cur.insert(c);
-#ifdef AUTOCORRECT
-	if (!cur.autocorrect())
-		cur.message(_("Autocorrect Off ('!' to enter)"));
-	else
-		cur.message(_("Autocorrect On ( to exit)"));
-#endif
+	if (autocorrectEnabled(cur)) {
+		if (!cur.autocorrect())
+			cur.message(_("Autocorrect Off ('!' to enter)"));
+		else
+			cur.message(_("Autocorrect On ( to exit)"));
+	}
 	return true;
 }
 
@@ -1732,6 +1722,12 @@
 }
 
 
+bool InsetMathNest::autocorrectEnabled(Cursor const & cur) const
+{
+	return lyxrc.autocorrection_math;
+}
+
+
 bool InsetMathNest::completionSupported(Cursor const & cur) const
 {
 	return cur.inMacroMode();
Index: mathed/InsetMathNest.h
===
--- mathed/InsetMathNest.h	(revision 28149)
+++ mathed/InsetMathNest.h	(working copy)
@@ -112,6 +112,8 @@
 	bool mouseHovered() const { return mouse_hover_; }
 
 	///
+	bool autocorrectEnabled(Cursor const & cur) const;
+	///
 	bool completionSupported(Cursor const &) const;
 	///
 	bool inlineCompletionSupported(Cursor const & cur) const;
Index: LyXRC.cpp
===
--- LyXRC.cpp	(revision 28149)
+++ LyXRC.cpp	(working copy)
@@ -58,6 +58,7 @@
 	{ "\\auto_number", LyXRC::RC_AUTO_NUMBER },
 	{ "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
 	{ "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
+	{ "\\autocorrection_math", LyXRC::RC_AUTOCORRECTION_MATH },
 	{ "\\autosave", LyXRC::RC_AUTOSAVE },
 	{ "\\backupdir_path", LyXRC::RC_BACKUPDIR_PATH },
 	{ "\\bibtex_command", LyXRC::RC_BIBTEX_COMMAND },
@@ -314,6 +315,7 @@
 	completion_popup_text = false;
 	completion_popup_delay = 2.0;
 	completion_popup_after_complete = true;
+	autocorrection_math = false;
 	completion_inline_math = true;
 	completion_inline_text = false;
 	completion_inline_dots = -1;
@@ -711,6 +713,10 @@
 			lexrc >> completion_inline_dots;
 			break;
 
+		case RC_AUTOCORRECTION_MATH:
+			lexrc >> autocorrection_math;
+			break;
+
 		case RC_COMPLETION_POPUP_DELAY:
 			lexrc >> completion_popup_delay;
 			break;
@@ -1968,6 +1974,14 @@
 		}
 		if (tag != RC_LAST)
 			break;
+	case RC_AUTOCORRECTION_MATH:
+		if (ignore_system_lyxrc ||
+		autocorrection_math != system_lyxrc.autocorrection_math) {
+			os << "\\autocorrection_math "
+<< convert(autocorrection_math) << '\n';
+		}
+		if (tag != RC_LAST)
+			break;
 	case RC_COMPLETION_POPUP_DELAY:
 		if (ignore_system_lyxrc ||
 		completion_popup_delay != system_lyxrc.completion_popup_delay) {
@@ -2652,6 

Re: Add math autocorrect to RC file

2009-01-14 Thread Martin Vermeer
On Wed, 14 Jan 2009 13:22:54 +0100
Pavel Sanda <sa...@lyx.org> wrote:

> Martin Vermeer wrote:
> > As in the attached. This makes it possible to enable autocorrection in the 
> > preferences file.
> 
> would it be possible to add some list of autocorrected things into some of 
> our manual?

Hmmm, yes.

> it may be worth to add checkbox into preferences gui.

That was the next step in my world domination plan ;-)

Only, I'm rather lost with this qt stuff.

> pavel

- Martin


Re: Add math autocorrect to RC file

2009-01-14 Thread Martin Vermeer
On Wed, 14 Jan 2009 14:37:47 +0100
Jean-Marc Lasgouttes <lasgout...@lyx.org> wrote:

> Martin Vermeer <martin.verm...@tkk.fi> writes:
> > +   // leave autocorrect mode if necessary
> > +   if (autocorrectEnabled(cur) && c == ' ' && cur.autocorrect()) {
> 
> Two questions (probably related)
> - why do you pass cur to autocorrectEnabled, whereas it does not rely on
> the cursor?

Hrmf.

> - why not put the cur.autocorrect() test into autocorrectEnabled, sicne
> they are always used together? Or maybe move the lyxrc check into
> Cursor::autocorrect.
> 
> JMarc

Eh, how do you handle this:

if (autocorrectEnabled()) {
if (!cur.autocorrect())
cur.message(_("Autocorrect Off ('!' to enter)"));
else
cur.message(_("Autocorrect On ( to exit)"));
}

- Martin
Index: LyXRC.h
===
--- LyXRC.h	(revision 28149)
+++ LyXRC.h	(working copy)
@@ -38,6 +38,7 @@
 	enum LyXRCTags {
 		RC_ACCEPT_COMPOUND = 1,
 		RC_ALT_LANG,
+		RC_AUTOCORRECTION_MATH,
 		RC_PLAINTEXT_LINELEN,
 		RC_PLAINTEXT_ROFF_COMMAND,
 		RC_AUTOREGIONDELETE,
@@ -438,6 +439,8 @@
 	///
 	int completion_inline_dots;
 	///
+	bool autocorrection_math;
+	///
 	double completion_popup_delay;
 	///
 	bool completion_popup_math;
Index: mathed/InsetMathNest.cpp
===
--- mathed/InsetMathNest.cpp	(revision 28149)
+++ mathed/InsetMathNest.cpp	(working copy)
@@ -10,8 +10,6 @@
 
 #include 
 
-//#define AUTOCORRECT
-
 #include "InsetMathNest.h"
 
 #include "InsetMathArray.h"
@@ -27,9 +25,7 @@
 #include "InsetMathSpace.h"
 #include "InsetMathSymbol.h"
 #include "InsetMathUnknown.h"
-#ifdef AUTOCORRECT
 #include "MathAutoCorrect.h"
-#endif
 #include "MathCompletionList.h"
 #include "MathData.h"
 #include "MathFactory.h"
@@ -1519,22 +1515,18 @@
 		return true;
 	}
 
-	// This is annoying as one has to press  far too often.
-	// Disable it.
 
-#ifdef AUTOCORRECT
-		// leave autocorrect mode if necessary
-		if (c == ' ' && cur.autocorrect()) {
-			cur.autocorrect() = false;
-			cur.message(_("Autocorrect Off ('!' to enter)"));
-			return true;
-		} 
-		if (c == '!' && !cur.autocorrect()) {
-			cur.autocorrect() = true;
-			cur.message(_("Autocorrect On ( to exit)"));
-			return true;
-		}
-#endif
+	// leave autocorrect mode if necessary
+	if (autocorrectEnabled() && c == ' ' && cur.autocorrect()) {
+		cur.autocorrect() = false;
+		cur.message(_("Autocorrect Off ('!' to enter)"));
+		return true;
+	} 
+	if (autocorrectEnabled() && c == '!' && !cur.autocorrect()) {
+		cur.autocorrect() = true;
+		cur.message(_("Autocorrect On ( to exit)"));
+		return true;
+	}
 
 	// just clear selection on pressing the space bar
 	if (cur.selection() && c == ' ') {
@@ -1631,20 +1623,18 @@
 	}
 
 
-#ifdef AUTOCORRECT
 	// try auto-correction
-	if (cur.autocorrect() && cur.pos() != 0 && math_autocorrect(cur.prevAtom(), c))
+	if (autocorrectEnabled() && cur.autocorrect() && cur.pos() != 0 && math_autocorrect(cur.prevAtom(), c))
 		return true;
-#endif
 
 	// no special circumstances, so insert the character without any fuss
 	cur.insert(c);
-#ifdef AUTOCORRECT
-	if (!cur.autocorrect())
-		cur.message(_("Autocorrect Off ('!' to enter)"));
-	else
-		cur.message(_("Autocorrect On ( to exit)"));
-#endif
+	if (autocorrectEnabled()) {
+		if (!cur.autocorrect())
+			cur.message(_("Autocorrect Off ('!' to enter)"));
+		else
+			cur.message(_("Autocorrect On ( to exit)"));
+	}
 	return true;
 }
 
@@ -1732,6 +1722,12 @@
 }
 
 
+bool InsetMathNest::autocorrectEnabled() const
+{
+	return lyxrc.autocorrection_math;
+}
+
+
 bool InsetMathNest::completionSupported(Cursor const & cur) const
 {
 	return cur.inMacroMode();
Index: mathed/InsetMathNest.h
===
--- mathed/InsetMathNest.h	(revision 28149)
+++ mathed/InsetMathNest.h	(working copy)
@@ -112,6 +112,8 @@
 	bool mouseHovered() const { return mouse_hover_; }
 
 	///
+	bool autocorrectEnabled() const;
+	///
 	bool completionSupported(Cursor const &) const;
 	///
 	bool inlineCompletionSupported(Cursor const & cur) const;
Index: LyXRC.cpp
===
--- LyXRC.cpp	(revision 28149)
+++ LyXRC.cpp	(working copy)
@@ -58,6 +58,7 @@
 	{ "\\auto_number", LyXRC::RC_AUTO_NUMBER },
 	{ "\\auto_region_delete", LyXRC::RC_AUTOREGIONDELETE },
 	{ "\\auto_reset_options", LyXRC::RC_AUTORESET_OPTIONS },
+	{ "\\autocorrection_math

Re: [Patch] Fix for Numbering Symbol Direction in RTL Paragraphs

2009-01-12 Thread Martin Vermeer
On Mon, 12 Jan 2009 08:55:22 +0200
Guy Rutenberg guyrutenb...@gmail.com wrote:

 Hi,
 
 When writing a paragraph with an RTL language (I checked with Hebrew, but it
 should also happen with Arabic), and adding numbered list, the symbols are
 shown in the wrong order. I mean by that, that the dot comes before the
 numbering symbol instead of after it.
 
 The patch checks whether we are in a RTL paragraph and if so reverses it.
 
 I've attached the patch and a LyX document that shows the problem.
 
 The patch is against the trunk, but if it's needed for the fix to enter the
 1.6 development, I'll be glad to provide one against this branch.
 
 
 Regards,
 
 Guy
 
 
 
 http://www.guyrutenberg.com


Index: src/Buffer.cpp
===
--- src/Buffer.cpp  (revision 28095)
+++ src/Buffer.cpp  (working copy)
@@ -2908,16 +2908,18 @@
 
switch (par.itemdepth) {
case 0:
-   format = N_(\\arabic{enumi}.);
+   // the RTL check is needed so the . will be on
the
+   // right side of the numbering symbol.
+   format = par.isRTL(bp) ?
N_(.\\arabic{enumi}) : N_(\\arabic{enumi}.); break;
case 1:
format = N_((\\alph{enumii}));
break;
case 2:
-   format = N_(\\roman{enumiii}.);
+   format = par.isRTL(bp) ?
N_(.\\roman{enumiii}) : N_(\\roman{enumiii}.); break;
case 3:
-   format = N_(\\Alph{enumiv}.);
+   format = par.isRTL(bp) ?
N_(.\\Alph{enumiv}) : N_(\\Alph{enumiv}.); break;
default:
// not a valid enumdepth...


Is this the right place to do it in? I'm honestly asking. Isn't this
something that can be done by localization in he.po and should not be
in the C++ code base? What is the reason for doing it like this?

- Martin


Re: [Patch] Fix for Numbering Symbol Direction in RTL Paragraphs

2009-01-12 Thread Martin Vermeer
On Mon, 12 Jan 2009 08:55:22 +0200
Guy Rutenberg  wrote:

> Hi,
> 
> When writing a paragraph with an RTL language (I checked with Hebrew, but it
> should also happen with Arabic), and adding numbered list, the symbols are
> shown in the wrong order. I mean by that, that the dot comes before the
> numbering symbol instead of after it.
> 
> The patch checks whether we are in a RTL paragraph and if so reverses it.
> 
> I've attached the patch and a LyX document that shows the problem.
> 
> The patch is against the trunk, but if it's needed for the fix to enter the
> 1.6 development, I'll be glad to provide one against this branch.
> 
> 
> Regards,
> 
> Guy
> 
> 
> 
> http://www.guyrutenberg.com


Index: src/Buffer.cpp
===
--- src/Buffer.cpp  (revision 28095)
+++ src/Buffer.cpp  (working copy)
@@ -2908,16 +2908,18 @@
 
switch (par.itemdepth) {
case 0:
-   format = N_("\\arabic{enumi}.");
+   // the RTL check is needed so the . will be on
the
+   // right side of the numbering symbol.
+   format = par.isRTL(bp) ?
N_(".\\arabic{enumi}") : N_("\\arabic{enumi}."); break;
case 1:
format = N_("(\\alph{enumii})");
break;
case 2:
-   format = N_("\\roman{enumiii}.");
+   format = par.isRTL(bp) ?
N_(".\\roman{enumiii}") : N_("\\roman{enumiii}."); break;
case 3:
-   format = N_("\\Alph{enumiv}.");
+   format = par.isRTL(bp) ?
N_(".\\Alph{enumiv}") : N_("\\Alph{enumiv}."); break;
default:
// not a valid enumdepth...


Is this the right place to do it in? I'm honestly asking. Isn't this
something that can be done by localization in he.po and should not be
in the C++ code base? What is the reason for doing it like this?

- Martin


Re: Where in the Code List Numbering Happens?

2009-01-10 Thread Martin Vermeer
On Sat, Jan 10, 2009 at 04:47:06PM +, Guy Rutenberg wrote:
 Hi,
 
 I've decided to tackle an old bidi bug where list numbering in RTL text are
 reversed (e.g. the dot appears before the number instead of after it).
 
 I've tried going through the code and find where the list numberings are 
 printed
 to screen, but I couldn't find it.
 
 I've understood there is an instance of the Layout class that represents the
 Enumerate environment, but I didn't find where it's created and where its
 content is printed to the screen.
 
 I would really appreciate is someone could help out.
 
 
 Thanks,
 
 Guy Rutenberg
 
 
 ---
 http://www.guyrutenberg.com

Seems I was one of those responsible for this mess ;-)

Look in Buffer.cpp for static void setLabel(). Around line 2900 is the enum 
handling. Note that strings like \\arabic{enumi}.  (with the dot!) are given 
inside _( ), so they are meant to be localized. This is the current mechanism.

Most of the logic is in Counters.{cpp,h}.

HTH Martin

 


Re: Where in the Code List Numbering Happens?

2009-01-10 Thread Martin Vermeer
On Sat, Jan 10, 2009 at 04:47:06PM +, Guy Rutenberg wrote:
> Hi,
> 
> I've decided to tackle an old bidi bug where list numbering in RTL text are
> reversed (e.g. the dot appears before the number instead of after it).
> 
> I've tried going through the code and find where the list numberings are 
> printed
> to screen, but I couldn't find it.
> 
> I've understood there is an instance of the Layout class that represents the
> Enumerate environment, but I didn't find where it's created and where its
> content is printed to the screen.
> 
> I would really appreciate is someone could help out.
> 
> 
> Thanks,
> 
> Guy Rutenberg
> 
> 
> ---
> http://www.guyrutenberg.com

Seems I was one of those responsible for this mess ;-)

Look in Buffer.cpp for static void setLabel(). Around line 2900 is the enum 
handling. Note that strings like "\\arabic{enumi}."  (with the dot!) are given 
inside _( ), so they are meant to be localized. This is the current mechanism.

Most of the logic is in Counters.{cpp,h}.

HTH Martin

 


Re: Environment arguments

2009-01-02 Thread Martin Vermeer
On Fri, Jan 02, 2009 at 02:36:42PM +0100, Jean-Marc Lasgouttes wrote:
 Guenter Milde mi...@users.berlios.de writes:
  There was a discussion on the proper name for this, but I don't
  remember anyone coming up with anything better. Optional argument is
  correct but very LaTeX centric and not clear to the uninitiated.
 
  LaTeX argument seems the best choice to me. 
 
 IMO the name should be coded in the layout file.
 
 Here is how it could work: 
 
 1/ when using getStatus(), the lfun validator uses FuncStatus::message to
 set a special string that could be
  - the name of the optional argument for the current layout
  - the name of the current inset
  - anything else that could be useful
 
 2/ when the menu item string contains %s, the menu code replaces this %s
 with the message returned by above.
 
 With this, we have a way to have menu entry names that depend on
 context. 
 
 Would that make sense?
 
 JMarc

Definitely. Any implementation ideas?

- Martin



Re: Environment arguments

2009-01-02 Thread Martin Vermeer
On Fri, Jan 02, 2009 at 02:36:42PM +0100, Jean-Marc Lasgouttes wrote:
> Guenter Milde  writes:
> >> There was a discussion on the proper name for this, but I don't
> >> remember anyone coming up with anything better. "Optional argument" is
> >> correct but very LaTeX centric and not clear to the uninitiated.
> >
> > "LaTeX argument" seems the best choice to me. 
> 
> IMO the name should be coded in the layout file.
> 
> Here is how it could work: 
> 
> 1/ when using getStatus(), the lfun validator uses FuncStatus::message to
> set a special string that could be
>  - the name of the optional argument for the current layout
>  - the name of the current inset
>  - anything else that could be useful
> 
> 2/ when the menu item string contains %s, the menu code replaces this %s
> with the message returned by above.
> 
> With this, we have a way to have menu entry names that depend on
> context. 
> 
> Would that make sense?
> 
> JMarc

Definitely. Any implementation ideas?

- Martin



Re: Environment arguments (was Re: Developers Roadmap for 2.0)

2008-12-30 Thread Martin Vermeer
On Mon, Dec 29, 2008 at 11:20:23PM +, Guenter Milde wrote:
 On 2008-12-12, rgheck wrote in gmane.editors.lyx.devel:
  Jean-Marc Lasgouttes wrote:
  rgheck rgh...@bobjweil.com writes:
 
  Yes, of course. But there are problems even there. Support for
  optional arguments in list environments is weird. If you put one in
  for the first item, it becomes the optional argument to the
  environment, not to the item, and optional arguments to later items
  are silently ignored.
 
  This is by design, I think.
 
 I agree that this is a strange design (btw, this holds also for the
 label-width phantom text in a LyX-List).
 
  Really? It seems as if it'd be more useful to have the optional argument 
  to \item. At least, it'd be more useful for me.
 
 Really? You can use ERT to give an (optional or mandatory) arg to an
 \item but you need the (misnamed) InsertShort-Title menu item to give an
 optional argument to the list environment.

There was a discussion on the proper name for this, but I don't remember anyone 
coming up with anything better. Optional argument is correct but very LaTeX 
centric and not clear to the uninitiated.

 
 I need the latter for the configurable lists with the enumitem.module.
 
 Günter

- Martin 
 


Re: Environment arguments (was Re: Developers Roadmap for 2.0)

2008-12-30 Thread Martin Vermeer
On Mon, Dec 29, 2008 at 11:20:23PM +, Guenter Milde wrote:
> On 2008-12-12, rgheck wrote in gmane.editors.lyx.devel:
> > Jean-Marc Lasgouttes wrote:
> >> rgheck  writes:
> 
> >>> Yes, of course. But there are problems even there. Support for
> >>> optional arguments in list environments is weird. If you put one in
> >>> for the first item, it becomes the optional argument to the
> >>> environment, not to the item, and optional arguments to later items
> >>> are silently ignored.
> 
> >> This is by design, I think.
> 
> I agree that this is a strange design (btw, this holds also for the
> label-width phantom text in a LyX-List).
> 
> > Really? It seems as if it'd be more useful to have the optional argument 
> > to \item. At least, it'd be more useful for me.
> 
> Really? You can use ERT to give an (optional or mandatory) arg to an
> \item but you need the (misnamed) Insert>Short-Title menu item to give an
> optional argument to the list environment.

There was a discussion on the proper name for this, but I don't remember anyone 
coming up with anything better. "Optional argument" is correct but very LaTeX 
centric and not clear to the uninitiated.

> 
> I need the latter for the configurable lists with the enumitem.module.
> 
> Günter

- Martin 
 


Autocorrect

2008-12-18 Thread Martin Vermeer

The attached patch optionally enables autocorrect in math, and fixes it so it 
works again once you define AUTOCORRECT.

I propose to check this in, and I'll think about the usability issue reported 
by André.

- Martin
Index: mathed/InsetMathNest.cpp
===
--- mathed/InsetMathNest.cpp	(revision 27916)
+++ mathed/InsetMathNest.cpp	(working copy)
@@ -10,6 +10,8 @@
 
 #include config.h
 
+//#define AUTOCORRECT
+
 #include InsetMathNest.h
 
 #include InsetMathArray.h
@@ -25,6 +27,9 @@
 #include InsetMathSpace.h
 #include InsetMathSymbol.h
 #include InsetMathUnknown.h
+#ifdef AUTOCORRECT
+#include MathAutoCorrect.h
+#endif
 #include MathCompletionList.h
 #include MathData.h
 #include MathFactory.h
@@ -1513,10 +1518,10 @@
 	// This is annoying as one has to press space far too often.
 	// Disable it.
 
-#if 0
+#ifdef AUTOCORRECT
 		// leave autocorrect mode if necessary
-		if (autocorrect()  c == ' ') {
-			autocorrect() = false;
+		if (cur.autocorrect()  c == ' ') {
+			cur.autocorrect() = false;
 			return true;
 		}
 #endif
@@ -1616,9 +1621,11 @@
 	}
 
 
+#ifdef AUTOCORRECT
 	// try auto-correction
-	//if (autocorrect()  hasPrevAtom()  math_autocorrect(prevAtom(), c))
-	//	return true;
+	if (cur.autocorrect()  cur.pos() != 0  math_autocorrect(cur.prevAtom(), c))
+		return true;
+#endif
 
 	// no special circumstances, so insert the character without any fuss
 	cur.insert(c);


Autocorrect

2008-12-18 Thread Martin Vermeer

The attached patch optionally enables autocorrect in math, and fixes it so it 
works again once you define AUTOCORRECT.

I propose to check this in, and I'll think about the usability issue reported 
by André.

- Martin
Index: mathed/InsetMathNest.cpp
===
--- mathed/InsetMathNest.cpp	(revision 27916)
+++ mathed/InsetMathNest.cpp	(working copy)
@@ -10,6 +10,8 @@
 
 #include 
 
+//#define AUTOCORRECT
+
 #include "InsetMathNest.h"
 
 #include "InsetMathArray.h"
@@ -25,6 +27,9 @@
 #include "InsetMathSpace.h"
 #include "InsetMathSymbol.h"
 #include "InsetMathUnknown.h"
+#ifdef AUTOCORRECT
+#include "MathAutoCorrect.h"
+#endif
 #include "MathCompletionList.h"
 #include "MathData.h"
 #include "MathFactory.h"
@@ -1513,10 +1518,10 @@
 	// This is annoying as one has to press  far too often.
 	// Disable it.
 
-#if 0
+#ifdef AUTOCORRECT
 		// leave autocorrect mode if necessary
-		if (autocorrect() && c == ' ') {
-			autocorrect() = false;
+		if (cur.autocorrect() && c == ' ') {
+			cur.autocorrect() = false;
 			return true;
 		}
 #endif
@@ -1616,9 +1621,11 @@
 	}
 
 
+#ifdef AUTOCORRECT
 	// try auto-correction
-	//if (autocorrect() && hasPrevAtom() && math_autocorrect(prevAtom(), c))
-	//	return true;
+	if (cur.autocorrect() && cur.pos() != 0 && math_autocorrect(cur.prevAtom(), c))
+		return true;
+#endif
 
 	// no special circumstances, so insert the character without any fuss
 	cur.insert(c);


Re: Notes in output

2008-12-09 Thread Martin Vermeer
On Mon, 08 Dec 2008 09:32:24 +0100
Jean-Marc Lasgouttes [EMAIL PROTECTED] wrote:

 Guenter Milde [EMAIL PROTECTED] writes:
  But it might be a good idea to have a visibility toggle for all kind
  of notes (and a matching high visibility style for LyX notes in the
  output).
 
 Yes, but a 'all is possible' interface (up to [X] show all footnotes
 except those that contain a math expression ? :) is risky in terms of
 usability. 
 

Yes... kitchen sink syndrome. You _can_ have a note inside a branch inset BTW.

 Also there is the semantics part. There is a real need for having LyX
 'skip' some part of text as being 'not there'. For example, notes are
 not part of ToC right now.
 
 JMarc

- Martin


Re: Notes in output

2008-12-09 Thread Martin Vermeer
On Mon, 08 Dec 2008 09:32:24 +0100
Jean-Marc Lasgouttes <[EMAIL PROTECTED]> wrote:

> Guenter Milde <[EMAIL PROTECTED]> writes:
> > But it might be a good idea to have a "visibility" toggle for all kind
> > of notes (and a matching "high visibility" style for LyX notes in the
> > output).
> 
> Yes, but a 'all is possible' interface (up to "[X] show all footnotes
> except those that contain a math expression" ? :) is risky in terms of
> usability. 
> 

Yes... kitchen sink syndrome. You _can_ have a note inside a branch inset BTW.

> Also there is the semantics part. There is a real need for having LyX
> 'skip' some part of text as being 'not there'. For example, notes are
> not part of ToC right now.
> 
> JMarc

- Martin


Re: Notes in output

2008-12-07 Thread Martin Vermeer
On Sun, 07 Dec 2008 20:36:41 + (UTC)
Guenter Milde [EMAIL PROTECTED] wrote:

 On 2008-12-07, Uwe Stöhr wrote:
   I really think we should implement something allowing that users can
   influence the way Notes look in the output.
 
 Why not implement the Notes as a pre-defined branch that is off by default?
 
 Or unify the Notes... and Branches... insets so that it is
 possible to convert a note to a branch and vice versa.
 
 Günter

In that case it is better to unify Notes with Marginal and Footnotes, allowing 
conversion to/from them also.

The common element is annotation. Branches is meant for other kinds of uses.

- Martin


Re: Notes in output

2008-12-07 Thread Martin Vermeer
On Sun, 07 Dec 2008 20:36:41 + (UTC)
Guenter Milde <[EMAIL PROTECTED]> wrote:

> On 2008-12-07, Uwe Stöhr wrote:
> > > I really think we should implement something allowing that users can
> > > influence the way Notes look in the output.
> 
> Why not implement the Notes as a pre-defined branch that is off by default?
> 
> Or unify the Notes>... and Branches>... insets so that it is
> possible to convert a note to a branch and vice versa.
> 
> Günter

In that case it is better to unify Notes with Marginal and Footnotes, allowing 
conversion to/from them also.

The common element is annotation. Branches is meant for other kinds of uses.

- Martin


Re: problem with fig2pdftex in newest Ubuntu

2008-12-03 Thread Martin Vermeer
On Wed, 03 Dec 2008 13:49:44 +0100
Abdelrazak Younes [EMAIL PROTECTED] wrote:

 
 
 Martin Vermeer wrote:
  Hi,
  
  I just was involuntarily forced to test Ubuntu 8.10 (my power supply
  burned out and probably something else too, because we couldn't get
  the box back to  life again with a new power supply), and having
  problems with XFig figures in LyX.
  
  They come out 90 degs rotated and with the wrong bounding box (?)
  i.e., cut off. If I export to LaTeX manually and re-generate the
  pdftex_t and pdf files from XFig manually, things work fine.
  
  I though the problem was with Angus' heuristics in fig2pdftex.py and
  fig2pstex.py in lib/scripts. However, from the cammand line these
  work OK too.
  
  Could somebody please have a look into this? Version is the official
  one, 1.5.6. XFig is 3.2 patch level 5,
 
 Hi Martin,
 
 I remember fixing in bug in the 1.6 version of the script in order to 
 cleanup the external inset support. This was windows related AFAIR but 
 you should have a look in there. I don't think this particular script 
 has changed much anyway.
 
 Abdel.

Abdel,

it turns out that the wrong PDF is produced by ImageMagick, it says at the 
start

/Producer (ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org)

The right PDF has nothing like that.

Does that ring a bell?

- Martin


Re: problem with fig2pdftex in newest Ubuntu

2008-12-03 Thread Martin Vermeer
On Wed, 03 Dec 2008 16:25:24 +0100
Abdelrazak Younes [EMAIL PROTECTED] wrote:

 Martin Vermeer wrote:
  On Wed, 03 Dec 2008 13:49:44 +0100
  Abdelrazak Younes [EMAIL PROTECTED] wrote:
 

  Martin Vermeer wrote:
  
  Hi,
 
  I just was involuntarily forced to test Ubuntu 8.10 (my power supply
  burned out and probably something else too, because we couldn't get
  the box back to  life again with a new power supply), and having
  problems with XFig figures in LyX.
 
  They come out 90 degs rotated and with the wrong bounding box (?)
  i.e., cut off. If I export to LaTeX manually and re-generate the
  pdftex_t and pdf files from XFig manually, things work fine.
 
  I though the problem was with Angus' heuristics in fig2pdftex.py and
  fig2pstex.py in lib/scripts. However, from the cammand line these
  work OK too.
 
  Could somebody please have a look into this? Version is the official
  one, 1.5.6. XFig is 3.2 patch level 5,

  Hi Martin,
 
  I remember fixing in bug in the 1.6 version of the script in order to 
  cleanup the external inset support. This was windows related AFAIR but 
  you should have a look in there. I don't think this particular script 
  has changed much anyway.
 
  Abdel.
  
 
  Abdel,
 
  it turns out that the wrong PDF is produced by ImageMagick, it says at 
  the start
 
  /Producer (ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org)
 
  The right PDF has nothing like that.
 
  Does that ring a bell?

 Not really, sorry.
 
 Abdel.

Well the good news is that in SVN the bug is not present.

BTW SVN prints in the minibuffer the python commands executed, like
fig2pdftex. 1.5.6 doesn't do that. I suppose somehow it doesn't find
the correct script and falls back to convertDefault.py, which uses
Imagemagick.

But as to why it doesn't find the correct script?

- Martin


Re: problem with fig2pdftex in newest Ubuntu

2008-12-03 Thread Martin Vermeer
On Wed, 03 Dec 2008 17:37:56 +0200
Martin Vermeer [EMAIL PROTECTED] wrote:

 On Wed, 03 Dec 2008 16:25:24 +0100
 Abdelrazak Younes [EMAIL PROTECTED] wrote:
 
  Martin Vermeer wrote:
   On Wed, 03 Dec 2008 13:49:44 +0100
   Abdelrazak Younes [EMAIL PROTECTED] wrote:
  
 
   Martin Vermeer wrote:
   
   Hi,
  
   I just was involuntarily forced to test Ubuntu 8.10 (my power supply
   burned out and probably something else too, because we couldn't get
   the box back to  life again with a new power supply), and having
   problems with XFig figures in LyX.
  
   They come out 90 degs rotated and with the wrong bounding box (?)
   i.e., cut off. If I export to LaTeX manually and re-generate the
   pdftex_t and pdf files from XFig manually, things work fine.
  
   I though the problem was with Angus' heuristics in fig2pdftex.py and
   fig2pstex.py in lib/scripts. However, from the cammand line these
   work OK too.
  
   Could somebody please have a look into this? Version is the official
   one, 1.5.6. XFig is 3.2 patch level 5,
 
   Hi Martin,
  
   I remember fixing in bug in the 1.6 version of the script in order to 
   cleanup the external inset support. This was windows related AFAIR but 
   you should have a look in there. I don't think this particular script 
   has changed much anyway.
  
   Abdel.
   
  
   Abdel,
  
   it turns out that the wrong PDF is produced by ImageMagick, it says at 
   the start
  
   /Producer (ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org)
  
   The right PDF has nothing like that.
  
   Does that ring a bell?
 
  Not really, sorry.
  
  Abdel.
 
 Well the good news is that in SVN the bug is not present.
 
 BTW SVN prints in the minibuffer the python commands executed, like
 fig2pdftex. 1.5.6 doesn't do that. I suppose somehow it doesn't find
 the correct script and falls back to convertDefault.py, which uses
 Imagemagick.
 
 But as to why it doesn't find the correct script?
 
 - Martin


Another interesting detail: if you edit the figure and change it from
Landscape to Portrait, it comes out correctly -- at least for External
Material. This may be a workaround for now, and should be documented
somewhere.

Still having trouble with Graphics. Who's going to move subfigure over
to External material so we don't need Graphics anymore?

- Martin


Re: problem with fig2pdftex in newest Ubuntu

2008-12-03 Thread Martin Vermeer
On Wed, 03 Dec 2008 13:49:44 +0100
Abdelrazak Younes <[EMAIL PROTECTED]> wrote:

> 
> 
> Martin Vermeer wrote:
> > Hi,
> > 
> > I just was involuntarily forced to test Ubuntu 8.10 (my power supply
> > burned out and probably something else too, because we couldn't get
> > the box back to  life again with a new power supply), and having
> > problems with XFig figures in LyX.
> > 
> > They come out 90 degs rotated and with the wrong bounding box (?)
> > i.e., cut off. If I export to LaTeX manually and re-generate the
> > pdftex_t and pdf files from XFig manually, things work fine.
> > 
> > I though the problem was with Angus' heuristics in fig2pdftex.py and
> > fig2pstex.py in lib/scripts. However, from the cammand line these
> > work OK too.
> > 
> > Could somebody please have a look into this? Version is the official
> > one, 1.5.6. XFig is 3.2 patch level 5,
> 
> Hi Martin,
> 
> I remember fixing in bug in the 1.6 version of the script in order to 
> cleanup the external inset support. This was windows related AFAIR but 
> you should have a look in there. I don't think this particular script 
> has changed much anyway.
> 
> Abdel.

Abdel,

it turns out that the "wrong" PDF is produced by ImageMagick, it says at the 
start

/Producer (ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org)

The "right" PDF has nothing like that.

Does that ring a bell?

- Martin


Re: problem with fig2pdftex in newest Ubuntu

2008-12-03 Thread Martin Vermeer
On Wed, 03 Dec 2008 16:25:24 +0100
Abdelrazak Younes <[EMAIL PROTECTED]> wrote:

> Martin Vermeer wrote:
> > On Wed, 03 Dec 2008 13:49:44 +0100
> > Abdelrazak Younes <[EMAIL PROTECTED]> wrote:
> >
> >   
> >> Martin Vermeer wrote:
> >> 
> >>> Hi,
> >>>
> >>> I just was involuntarily forced to test Ubuntu 8.10 (my power supply
> >>> burned out and probably something else too, because we couldn't get
> >>> the box back to  life again with a new power supply), and having
> >>> problems with XFig figures in LyX.
> >>>
> >>> They come out 90 degs rotated and with the wrong bounding box (?)
> >>> i.e., cut off. If I export to LaTeX manually and re-generate the
> >>> pdftex_t and pdf files from XFig manually, things work fine.
> >>>
> >>> I though the problem was with Angus' heuristics in fig2pdftex.py and
> >>> fig2pstex.py in lib/scripts. However, from the cammand line these
> >>> work OK too.
> >>>
> >>> Could somebody please have a look into this? Version is the official
> >>> one, 1.5.6. XFig is 3.2 patch level 5,
> >>>   
> >> Hi Martin,
> >>
> >> I remember fixing in bug in the 1.6 version of the script in order to 
> >> cleanup the external inset support. This was windows related AFAIR but 
> >> you should have a look in there. I don't think this particular script 
> >> has changed much anyway.
> >>
> >> Abdel.
> >> 
> >
> > Abdel,
> >
> > it turns out that the "wrong" PDF is produced by ImageMagick, it says at 
> > the start
> >
> > /Producer (ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org)
> >
> > The "right" PDF has nothing like that.
> >
> > Does that ring a bell?
> >   
> Not really, sorry.
> 
> Abdel.

Well the good news is that in SVN the bug is not present.

BTW SVN prints in the minibuffer the python commands executed, like
fig2pdftex. 1.5.6 doesn't do that. I suppose somehow it doesn't find
the correct script and falls back to convertDefault.py, which uses
Imagemagick.

But as to why it doesn't find the correct script?

- Martin


Re: problem with fig2pdftex in newest Ubuntu

2008-12-03 Thread Martin Vermeer
On Wed, 03 Dec 2008 17:37:56 +0200
Martin Vermeer <[EMAIL PROTECTED]> wrote:

> On Wed, 03 Dec 2008 16:25:24 +0100
> Abdelrazak Younes <[EMAIL PROTECTED]> wrote:
> 
> > Martin Vermeer wrote:
> > > On Wed, 03 Dec 2008 13:49:44 +0100
> > > Abdelrazak Younes <[EMAIL PROTECTED]> wrote:
> > >
> > >   
> > >> Martin Vermeer wrote:
> > >> 
> > >>> Hi,
> > >>>
> > >>> I just was involuntarily forced to test Ubuntu 8.10 (my power supply
> > >>> burned out and probably something else too, because we couldn't get
> > >>> the box back to  life again with a new power supply), and having
> > >>> problems with XFig figures in LyX.
> > >>>
> > >>> They come out 90 degs rotated and with the wrong bounding box (?)
> > >>> i.e., cut off. If I export to LaTeX manually and re-generate the
> > >>> pdftex_t and pdf files from XFig manually, things work fine.
> > >>>
> > >>> I though the problem was with Angus' heuristics in fig2pdftex.py and
> > >>> fig2pstex.py in lib/scripts. However, from the cammand line these
> > >>> work OK too.
> > >>>
> > >>> Could somebody please have a look into this? Version is the official
> > >>> one, 1.5.6. XFig is 3.2 patch level 5,
> > >>>   
> > >> Hi Martin,
> > >>
> > >> I remember fixing in bug in the 1.6 version of the script in order to 
> > >> cleanup the external inset support. This was windows related AFAIR but 
> > >> you should have a look in there. I don't think this particular script 
> > >> has changed much anyway.
> > >>
> > >> Abdel.
> > >> 
> > >
> > > Abdel,
> > >
> > > it turns out that the "wrong" PDF is produced by ImageMagick, it says at 
> > > the start
> > >
> > > /Producer (ImageMagick 6.3.7 08/21/08 Q16 http://www.imagemagick.org)
> > >
> > > The "right" PDF has nothing like that.
> > >
> > > Does that ring a bell?
> > >   
> > Not really, sorry.
> > 
> > Abdel.
> 
> Well the good news is that in SVN the bug is not present.
> 
> BTW SVN prints in the minibuffer the python commands executed, like
> fig2pdftex. 1.5.6 doesn't do that. I suppose somehow it doesn't find
> the correct script and falls back to convertDefault.py, which uses
> Imagemagick.
> 
> But as to why it doesn't find the correct script?
> 
> - Martin


Another interesting detail: if you edit the figure and change it from
Landscape to Portrait, it comes out correctly -- at least for External
Material. This may be a workaround for now, and should be documented
somewhere.

Still having trouble with Graphics. Who's going to move subfigure over
to External material so we don't need Graphics anymore?

- Martin


Re: regression introduced by r27719

2008-11-30 Thread Martin Vermeer
On Sat, Nov 29, 2008 at 10:47:50PM +0100, Jean-Marc Lasgouttes wrote:
  ...and reverting is rather a blunt instrument when you could have fixed
 
  bool producesOutput() const { return false; }
 
  in InsetNote.h -- in the sense that yes, in some cases a Note _does_ 
  produce
  LaTeX output ;-)
 
  I suppose this is Richard's turf.
 
 
  No, this isn't anything I know about. The producesOutput() routine was 
  JMarc's, I believe.
 
  We probably need to introduce something finer than produces output. Two 
  notions
 
  - this stuff is not really part of the document
 
  qnd
 
  - this stuff does not produce any latex output
 
  Currently producesOutput means the first one.
 
  JMarc

Doesn't my proposed fix nevertheless do the right thing in this case? I.e., 
move it from .h to .cpp and make it return false for comment and greyedout.

- Martin



Re: regression introduced by r27719

2008-11-30 Thread Martin Vermeer
On Sat, Nov 29, 2008 at 10:47:50PM +0100, Jean-Marc Lasgouttes wrote:
> >> ...and reverting is rather a blunt instrument when you could have fixed
> >>
> >> bool producesOutput() const { return false; }
> >>
> >> in InsetNote.h -- in the sense that yes, in some cases a Note _does_ 
> >> produce
> >> LaTeX output ;-)
> >>
> >> I suppose this is Richard's turf.
> >>
> >>
> > No, this isn't anything I know about. The producesOutput() routine was 
> > JMarc's, I believe.
> 
>  We probably need to introduce something finer than produces output. Two 
>  notions
> 
>  - this stuff is not really part of the document
> 
>  qnd
> 
>  - this stuff does not produce any latex output
> 
>  Currently producesOutput means the first one.
> 
>  JMarc

Doesn't my proposed fix nevertheless do the right thing in this case? I.e., 
move it from .h to .cpp and make it return false for comment and greyedout.

- Martin



Re: regression introduced by r27719

2008-11-29 Thread Martin Vermeer
On Sat, Nov 29, 2008 at 03:17:23PM +0100, Uwe Stöhr wrote:
  Fair enough, although discussion about the scope of the problem would be 
 easier if you avoided
  broad generalizations like breaks _every_ document that
 
  I can understand that _some_ greyed out notes are broken, but why are 
 comments broken?

 But _every_ is correct. Every document that contains greyed-out cannot be 
 compiled because your change omitted the needed preamble code. For an 
 unknown reason I then get also error messages that the comment environment 
 is undefined although this needs no preamble code.

 regards Uwe

comment _does_ require preamble code: features.require(verbatim); it
generates a \begin{comment} ... \end[comment} pair.


...and reverting is rather a blunt instrument when you could have fixed

bool producesOutput() const { return false; }

in InsetNote.h -- in the sense that yes, in some cases a Note _does_ produce
LaTeX output ;-)

I suppose this is Richard's turf.

- Martin



Re: regression introduced by r27719

2008-11-29 Thread Martin Vermeer
On Sat, Nov 29, 2008 at 03:17:23PM +0100, Uwe Stöhr wrote:
> > Fair enough, although discussion about the scope of the problem would be 
> easier if you avoided
> > broad generalizations like "breaks _every_ document that...".
> >
> > I can understand that _some_ greyed out notes are broken, but why are 
> comments broken?
>
> But _every_ is correct. Every document that contains greyed-out cannot be 
> compiled because your change omitted the needed preamble code. For an 
> unknown reason I then get also error messages that the comment environment 
> is undefined although this needs no preamble code.
>
> regards Uwe

comment _does_ require preamble code: features.require("verbatim"); it
generates a \begin{comment} ... \end[comment} pair.


...and reverting is rather a blunt instrument when you could have fixed

bool producesOutput() const { return false; }

in InsetNote.h -- in the sense that yes, in some cases a Note _does_ produce
LaTeX output ;-)

I suppose this is Richard's turf.

- Martin



Re: lyx2lyx fails

2008-11-27 Thread Martin Vermeer
On Thu, 27 Nov 2008 15:03:49 +0100
Jürgen Spitzmüller [EMAIL PROTECTED] wrote:

 José Matos wrote:
 
  Please do, without looking too deep in the code I can only guess what is
  wrong with it. :-)
  
  I will report later in the list what are my findings on the issue.
 
 Meanwhile, I found the problem: nothing to do with LyX. I did a
 search/replace on multiple files some time ago, and I obviously set the
 wrong encoding in kfilereplace, so the LyX file contained one mis-encoded
 glyph.
 
 Jürgen


Still, failure to import seems like too harsh a punishment... lyx2lyx
should handle this gracefully. Is that feasible?

- Martin
 


Re: lyx2lyx fails

2008-11-27 Thread Martin Vermeer
On Thu, 27 Nov 2008 15:03:49 +0100
Jürgen Spitzmüller <[EMAIL PROTECTED]> wrote:

> José Matos wrote:
> 
> > Please do, without looking too deep in the code I can only guess what is
> > wrong with it. :-)
> > 
> > I will report later in the list what are my findings on the issue.
> 
> Meanwhile, I found the problem: nothing to do with LyX. I did a
> search/replace on multiple files some time ago, and I obviously set the
> wrong encoding in kfilereplace, so the LyX file contained one mis-encoded
> glyph.
> 
> Jürgen


Still, failure to import seems like too harsh a punishment... lyx2lyx
should handle this gracefully. Is that feasible?

- Martin
 


Re: [PATCH] Layout Setting Issue

2008-10-26 Thread Martin Vermeer
On Sat, Oct 25, 2008 at 10:47:14PM -0400, Richard heck wrote:
 rgheck wrote:

 There's a bug in the code that sets the layout for the first paragraph of 
 an InsetCollapsable. If you start LyX from a terminal and create a branch, 
 you'll see some error messages about PlainLayout not being found. This is 
 because the first paragraph is being set to PlainLayout in the 
 InsetCollapsable constructor, whereas InsetBranch takes Standard.

 [snip]

 The right place to do this would be the InsetText constructor. Is there a 
 better way around the Can't call virtual functions in a constructor 
 problem?


 The attached patch implements the solution to this problem that is 
 suggested in _Effective C++_, namely, to pass the necessary information up 
 the line from subclass to superclass.

 It could be simplified by making the useplain parameter optional, but it's 
 easiest, at first, not to do it that way, to make sure everything is right. 
 If this seems OK, I'll commit a simplifying patch next.

 Comments? OK to commit?

 rh

Would it be better to use an enum rather than a boolean? More
human-readable.

- Martin


 Index: src/insets/InsetOptArg.cpp
 ===
 --- src/insets/InsetOptArg.cpp(revision 27131)
 +++ src/insets/InsetOptArg.cpp(working copy)
 @@ -22,7 +22,7 @@
  
  
  InsetOptArg::InsetOptArg(Buffer const  buf)
 - : InsetCollapsable(buf)
 + : InsetCollapsable(buf, true)
  {}
  
  
 Index: src/insets/InsetCaption.cpp
 ===
 --- src/insets/InsetCaption.cpp   (revision 27131)
 +++ src/insets/InsetCaption.cpp   (working copy)
 @@ -48,13 +48,11 @@
  
  
  InsetCaption::InsetCaption(Buffer const  buf)
 - : InsetText(buf)
 + : InsetText(buf, true) // use plain layout
  {
   setAutoBreakRows(true);
   setDrawFrame(true);
   setFrameColor(Color_captionframe);
 - // There will always be only one
 - 
 paragraphs().back().setLayout(buf.params().documentClass().plainLayout());
  }
  
  
 Index: src/insets/InsetFlex.cpp
 ===
 --- src/insets/InsetFlex.cpp  (revision 27131)
 +++ src/insets/InsetFlex.cpp  (working copy)
 @@ -34,7 +34,7 @@
  
  
  InsetFlex::InsetFlex(Buffer const  buf, string const  layoutName)
 - : InsetCollapsable(buf), name_(layoutName)
 + : InsetCollapsable(buf, true), name_(layoutName)
  {
   // again, because now the name is initialized
   setLayout(buf.params().documentClassPtr());
 Index: src/insets/InsetTabular.cpp
 ===
 --- src/insets/InsetTabular.cpp   (revision 27131)
 +++ src/insets/InsetTabular.cpp   (working copy)
 @@ -487,7 +487,6 @@
 inset(new InsetTableCell(buf))
  {
   inset-setBuffer(const_castBuffer (buf));
 - 
 inset-paragraphs().back().setLayout(buf.params().documentClass().plainLayout());
  }
  
  
 @@ -2787,7 +2786,7 @@
  /
  
  InsetTableCell::InsetTableCell(Buffer  buf)
 - : InsetText(buf), isFixedWidth(false),
 + : InsetText(buf, true), isFixedWidth(false),
 contentAlign(LYX_ALIGN_CENTER)
  {}
  
 Index: src/insets/InsetBranch.cpp
 ===
 --- src/insets/InsetBranch.cpp(revision 27131)
 +++ src/insets/InsetBranch.cpp(working copy)
 @@ -40,7 +40,7 @@
  namespace lyx {
  
  InsetBranch::InsetBranch(Buffer const  buf, InsetBranchParams const  
 params)
 - : InsetCollapsable(buf), params_(params)
 + : InsetCollapsable(buf, false), params_(params)
  {}
  
  
 Index: src/insets/InsetNote.cpp
 ===
 --- src/insets/InsetNote.cpp  (revision 27131)
 +++ src/insets/InsetNote.cpp  (working copy)
 @@ -116,7 +116,7 @@
  /
  
  InsetNote::InsetNote(Buffer const  buf, string const  label)
 - : InsetCollapsable(buf)
 + : InsetCollapsable(buf, true)
  {
   params_.type = notetranslator().find(label);
  }
 Index: src/insets/InsetBox.cpp
 ===
 --- src/insets/InsetBox.cpp   (revision 27131)
 +++ src/insets/InsetBox.cpp   (working copy)
 @@ -96,7 +96,8 @@
  /
  
  InsetBox::InsetBox(Buffer const  buffer, string const  label)
 - : InsetCollapsable(buffer), params_(label)
 + : InsetCollapsable(buffer, false), // this will be reset shortly
 +   params_(label)
  {
   if (forcePlainLayout())
   
 paragraphs().back().setLayout(buffer.params().documentClass().plainLayout());
 Index: src/insets/InsetInfo.cpp
 ===
 --- 

Re: [PATCH] Layout Setting Issue

2008-10-26 Thread Martin Vermeer
On Sat, Oct 25, 2008 at 10:47:14PM -0400, Richard heck wrote:
> rgheck wrote:
>>
>> There's a bug in the code that sets the layout for the first paragraph of 
>> an InsetCollapsable. If you start LyX from a terminal and create a branch, 
>> you'll see some error messages about PlainLayout not being found. This is 
>> because the first paragraph is being set to PlainLayout in the 
>> InsetCollapsable constructor, whereas InsetBranch takes Standard.
>>
>> [snip]
>>
>> The right place to do this would be the InsetText constructor. Is there a 
>> better way around the "Can't call virtual functions in a constructor" 
>> problem?
>>
>>
> The attached patch implements the solution to this problem that is 
> suggested in _Effective C++_, namely, to pass the necessary information up 
> the line from subclass to superclass.
>
> It could be simplified by making the useplain parameter optional, but it's 
> easiest, at first, not to do it that way, to make sure everything is right. 
> If this seems OK, I'll commit a simplifying patch next.
>
> Comments? OK to commit?
>
> rh

Would it be better to use an enum rather than a boolean? More
human-readable.

- Martin


> Index: src/insets/InsetOptArg.cpp
> ===
> --- src/insets/InsetOptArg.cpp(revision 27131)
> +++ src/insets/InsetOptArg.cpp(working copy)
> @@ -22,7 +22,7 @@
>  
>  
>  InsetOptArg::InsetOptArg(Buffer const & buf)
> - : InsetCollapsable(buf)
> + : InsetCollapsable(buf, true)
>  {}
>  
>  
> Index: src/insets/InsetCaption.cpp
> ===
> --- src/insets/InsetCaption.cpp   (revision 27131)
> +++ src/insets/InsetCaption.cpp   (working copy)
> @@ -48,13 +48,11 @@
>  
>  
>  InsetCaption::InsetCaption(Buffer const & buf)
> - : InsetText(buf)
> + : InsetText(buf, true) // use plain layout
>  {
>   setAutoBreakRows(true);
>   setDrawFrame(true);
>   setFrameColor(Color_captionframe);
> - // There will always be only one
> - 
> paragraphs().back().setLayout(buf.params().documentClass().plainLayout());
>  }
>  
>  
> Index: src/insets/InsetFlex.cpp
> ===
> --- src/insets/InsetFlex.cpp  (revision 27131)
> +++ src/insets/InsetFlex.cpp  (working copy)
> @@ -34,7 +34,7 @@
>  
>  
>  InsetFlex::InsetFlex(Buffer const & buf, string const & layoutName)
> - : InsetCollapsable(buf), name_(layoutName)
> + : InsetCollapsable(buf, true), name_(layoutName)
>  {
>   // again, because now the name is initialized
>   setLayout(buf.params().documentClassPtr());
> Index: src/insets/InsetTabular.cpp
> ===
> --- src/insets/InsetTabular.cpp   (revision 27131)
> +++ src/insets/InsetTabular.cpp   (working copy)
> @@ -487,7 +487,6 @@
> inset(new InsetTableCell(buf))
>  {
>   inset->setBuffer(const_cast(buf));
> - 
> inset->paragraphs().back().setLayout(buf.params().documentClass().plainLayout());
>  }
>  
>  
> @@ -2787,7 +2786,7 @@
>  /
>  
>  InsetTableCell::InsetTableCell(Buffer & buf)
> - : InsetText(buf), isFixedWidth(false),
> + : InsetText(buf, true), isFixedWidth(false),
> contentAlign(LYX_ALIGN_CENTER)
>  {}
>  
> Index: src/insets/InsetBranch.cpp
> ===
> --- src/insets/InsetBranch.cpp(revision 27131)
> +++ src/insets/InsetBranch.cpp(working copy)
> @@ -40,7 +40,7 @@
>  namespace lyx {
>  
>  InsetBranch::InsetBranch(Buffer const & buf, InsetBranchParams const & 
> params)
> - : InsetCollapsable(buf), params_(params)
> + : InsetCollapsable(buf, false), params_(params)
>  {}
>  
>  
> Index: src/insets/InsetNote.cpp
> ===
> --- src/insets/InsetNote.cpp  (revision 27131)
> +++ src/insets/InsetNote.cpp  (working copy)
> @@ -116,7 +116,7 @@
>  /
>  
>  InsetNote::InsetNote(Buffer const & buf, string const & label)
> - : InsetCollapsable(buf)
> + : InsetCollapsable(buf, true)
>  {
>   params_.type = notetranslator().find(label);
>  }
> Index: src/insets/InsetBox.cpp
> ===
> --- src/insets/InsetBox.cpp   (revision 27131)
> +++ src/insets/InsetBox.cpp   (working copy)
> @@ -96,7 +96,8 @@
>  /
>  
>  InsetBox::InsetBox(Buffer const & buffer, string const & label)
> - : InsetCollapsable(buffer), params_(label)
> + : InsetCollapsable(buffer, false), // this will be reset shortly
> +   params_(label)
>  {
>   if (forcePlainLayout())
>   
> 

Re: lyx-1.6.0svn and layouts names

2008-10-25 Thread Martin Vermeer
On Sat, Oct 25, 2008 at 01:58:59PM +0200, Uwe Stöhr wrote:

  I have a lot of CharStyle written for lyx-1.5.x. They don't work with
  lyx-1.6. How I have to modify them to use
  in lyx-1.6?

 They should work. Please report this bug at http://bugzilla.lyx.org. REport 
 the crash you get in a separate bug.

 thanks and regards
 Uwe

Actually layout2layout handles this, under format == 4, lines 246 etc.
Shouldn't LyX do this transparently? Please post a test CharStyle that
fails.

- Martin



Re: lyx-1.6.0svn and layouts names

2008-10-25 Thread Martin Vermeer
On Sat, Oct 25, 2008 at 10:06:54AM -0400, rgheck wrote:
 Philippe Charpentier wrote:
 For  example, the following CharStyle

 CharStyle Semi-Bold
 LatexType Command
 LatexName textsb
 Font
   Family  Roman
   Series  Bold
 EndFont
 LabelFont
   Family  Roman
   Size  tiny
   Color   blue
 EndFont
 Preamble
 \usepackage{sbdefault}
 EndPreamble
 End

 which is working in lyx-1.5 does not work in lyx-1.6 :
 It appears in the list of CharStyles (in the menu Edit),
 the command \usepackage{sbdefault} is put in the preamble
 but the command \textsb{} is not written in the latex source

   
 The problem is that it had to be command, lower case. I've fixed this.

 rh

Yes, this is the way to do it. Thanks!

- Martin



Re: lyx-1.6.0svn and layouts names

2008-10-25 Thread Martin Vermeer
On Sat, Oct 25, 2008 at 01:58:59PM +0200, Uwe Stöhr wrote:
>
> > I have a lot of CharStyle written for lyx-1.5.x. They don't work with
> > lyx-1.6. How I have to modify them to use
> > in lyx-1.6?
>
> They should work. Please report this bug at http://bugzilla.lyx.org. REport 
> the crash you get in a separate bug.
>
> thanks and regards
> Uwe

Actually layout2layout handles this, under format == 4, lines 246 etc.
Shouldn't LyX do this transparently? Please post a test CharStyle that
fails.

- Martin



Re: lyx-1.6.0svn and layouts names

2008-10-25 Thread Martin Vermeer
On Sat, Oct 25, 2008 at 10:06:54AM -0400, rgheck wrote:
> Philippe Charpentier wrote:
>> For  example, the following CharStyle
>>
>> CharStyle Semi-Bold
>> LatexType Command
>> LatexName textsb
>> Font
>>   Family  Roman
>>   Series  Bold
>> EndFont
>> LabelFont
>>   Family  Roman
>>   Size  tiny
>>   Color   blue
>> EndFont
>> Preamble
>> \usepackage{sbdefault}
>> EndPreamble
>> End
>>
>> which is working in lyx-1.5 does not work in lyx-1.6 :
>> It appears in the list of CharStyles (in the menu "Edit"),
>> the command \usepackage{sbdefault} is put in the preamble
>> but the command \textsb{} is not written in the latex source
>>
>>   
> The problem is that it had to be "command", lower case. I've fixed this.
>
> rh

Yes, this is the way to do it. Thanks!

- Martin



Re: A reset text style function/button (?)

2008-10-02 Thread Martin Vermeer
On Fri, Oct 03, 2008 at 12:09:25AM +0200, Nikos Alexandris wrote:
 Often I need to revert to default text-style words or whole sentences
 which I have changed in previous editing sessions of my document.
 Wouldn't it make sense to have a reset text style function and not to
 have to go through the Text style window?
 
 Best regards,
 -- 
 Nikos Alexandris

There is a button for applying the last used style. It can also be used for 
resetting, after doing the first one manually.

- Martin
 
 


Re: A reset text style function/button (?)

2008-10-02 Thread Martin Vermeer
On Fri, Oct 03, 2008 at 12:09:25AM +0200, Nikos Alexandris wrote:
> Often I need to revert to default text-style words or whole sentences
> which I have changed in previous editing sessions of my document.
> Wouldn't it make sense to have a reset text style function and not to
> have to go through the "Text style" window?
> 
> Best regards,
> -- 
> Nikos Alexandris

There is a button for applying the last used style. It can also be used for 
resetting, after doing the first one manually.

- Martin
 
 


Re: Cursor::anchor()

2008-09-25 Thread Martin Vermeer
On Thu, Sep 25, 2008 at 01:20:39PM +0200, Vincent van Ravesteijn - TNW wrote:
  
  How can I modify the anchor position of a selection ?
  
 Why do you need to do that, actually?
 
 Jmarc
 
 Well, if you select multiple lines and you hit tab then a tab will be
 inserted at the beginning of each line. 
 
 As a consequence, the selection needs to be updated to shift one pos to
 the right..
 
 Vincent

Are you sure? Doesn't sound right if you're also indenting the line the
anchor is on... the insert location is outside the selection.

- Martin



Re: Display of index in the Outline window--sorted alphabetically

2008-09-25 Thread Martin Vermeer
On Thu, Sep 25, 2008 at 03:50:02PM +0200, Abdelrazak Younes wrote:
 On 25/09/2008 15:34, leuven edwin wrote:
 also: could you reverse the sort order in the combobox in the toc panel? 
 the toc is used most often so it would be nice to have it on top...


 Why not simply rename that to Document Structure? Or maybe just 
 Sections?

 Abdel.

Outline?

- Martin



Re: Cursor::anchor()

2008-09-25 Thread Martin Vermeer
On Thu, Sep 25, 2008 at 01:20:39PM +0200, Vincent van Ravesteijn - TNW wrote:
>  
> > How can I modify the anchor position of a selection ?
> > 
> >Why do you need to do that, actually?
> >
> >Jmarc
> 
> Well, if you select multiple lines and you hit tab then a tab will be
> inserted at the beginning of each line. 
> 
> As a consequence, the selection needs to be updated to shift one pos to
> the right..
> 
> Vincent

Are you sure? Doesn't sound right if you're also indenting the line the
anchor is on... the insert location is outside the selection.

- Martin



Re: Display of index in the Outline window--sorted alphabetically

2008-09-25 Thread Martin Vermeer
On Thu, Sep 25, 2008 at 03:50:02PM +0200, Abdelrazak Younes wrote:
> On 25/09/2008 15:34, leuven edwin wrote:
>> also: could you reverse the sort order in the combobox in the toc panel? 
>> the toc is used most often so it would be nice to have it on top...
>>
>
> Why not simply rename that to "Document Structure"? Or maybe just 
> "Sections"?
>
> Abdel.

"Outline"?

- Martin



Re: autocorrection

2008-09-20 Thread Martin Vermeer
On Sat, Sep 20, 2008 at 06:12:41AM +0200, Stefan Schimanski wrote:
 Never seen that. What does it do? \farc - \frac and similar things?

 Stefan

No... the name is a bit wrong. It replaces things like = on the fly by 
\Rightarrow (and a long list of
similar things) to speed up math typing.

- Martin



 Am 20.09.2008 um 01:34 schrieb Martin Vermeer:

 I see that there is an autocorrection thingy in mathed, but disabled. Why 
 is that? Does it work? Could we give the user the option of enabling it?

 I know some users that would be very happy with this :-)

 - Martin




Re: autocorrection

2008-09-20 Thread Martin Vermeer
On Sat, Sep 20, 2008 at 12:24:40PM +0200, Andre Poenitz wrote:
 On Sat, Sep 20, 2008 at 02:34:14AM +0300, Martin Vermeer wrote:
  I see that there is an autocorrection thingy in mathed, but disabled.
  Why is that? Does it work? Could we give the user the option of
  enabling it?
 
 It was something like TeXMacs automatic substitution of, say, 
 '' followed by '=' with \leq. 
 
 It sort of worked, but it was not reallyh predictable so I left it
 disabled. I guess merging it with the autocompletion would be the
 way to go...
 
 Andre'

But autocorrection is for macros only. How would you do this merging?

- Martin




Re: autocorrection

2008-09-20 Thread Martin Vermeer
On Sat, Sep 20, 2008 at 02:23:51PM +0200, Andre Poenitz wrote:
 On Sat, Sep 20, 2008 at 03:27:23PM +0300, Martin Vermeer wrote:
  On Sat, Sep 20, 2008 at 12:24:40PM +0200, Andre Poenitz wrote:
   On Sat, Sep 20, 2008 at 02:34:14AM +0300, Martin Vermeer wrote:
I see that there is an autocorrection thingy in mathed, but disabled.
Why is that? Does it work? Could we give the user the option of
enabling it?
   
   It was something like TeXMacs automatic substitution of, say, 
   '' followed by '=' with \leq. 
   
   It sort of worked, but it was not reallyh predictable so I left it
   disabled. I guess merging it with the autocompletion would be the
   way to go...
   
   Andre'
  
  But autocorrection is for macros only. How would you do this merging?
 
 Basically but waiting for Stefan to do it ;-)
 
 Andre'

Yes, that's a good plan.

... Stefan!

- Martin




Re: autocorrection

2008-09-20 Thread Martin Vermeer
On Sat, Sep 20, 2008 at 06:12:41AM +0200, Stefan Schimanski wrote:
> Never seen that. What does it do? \farc -> \frac and similar things?
>
> Stefan

No... the name is a bit wrong. It replaces things like => on the fly by 
\Rightarrow (and a long list of
similar things) to speed up math typing.

- Martin



> Am 20.09.2008 um 01:34 schrieb Martin Vermeer:
>
>> I see that there is an autocorrection thingy in mathed, but disabled. Why 
>> is that? Does it work? Could we give the user the option of enabling it?
>>
>> I know some users that would be very happy with this :-)
>>
>> - Martin
>>



Re: autocorrection

2008-09-20 Thread Martin Vermeer
On Sat, Sep 20, 2008 at 12:24:40PM +0200, Andre Poenitz wrote:
> On Sat, Sep 20, 2008 at 02:34:14AM +0300, Martin Vermeer wrote:
> > I see that there is an autocorrection thingy in mathed, but disabled.
> > Why is that? Does it work? Could we give the user the option of
> > enabling it?
> 
> It was something like TeXMacs automatic substitution of, say, 
> '<' followed by '=' with \leq. 
> 
> It sort of worked, but it was not reallyh predictable so I left it
> disabled. I guess merging it with the autocompletion would be the
> way to go...
> 
> Andre'

But autocorrection is for macros only. How would you do this merging?

- Martin




Re: autocorrection

2008-09-20 Thread Martin Vermeer
On Sat, Sep 20, 2008 at 02:23:51PM +0200, Andre Poenitz wrote:
> On Sat, Sep 20, 2008 at 03:27:23PM +0300, Martin Vermeer wrote:
> > On Sat, Sep 20, 2008 at 12:24:40PM +0200, Andre Poenitz wrote:
> > > On Sat, Sep 20, 2008 at 02:34:14AM +0300, Martin Vermeer wrote:
> > > > I see that there is an autocorrection thingy in mathed, but disabled.
> > > > Why is that? Does it work? Could we give the user the option of
> > > > enabling it?
> > > 
> > > It was something like TeXMacs automatic substitution of, say, 
> > > '<' followed by '=' with \leq. 
> > > 
> > > It sort of worked, but it was not reallyh predictable so I left it
> > > disabled. I guess merging it with the autocompletion would be the
> > > way to go...
> > > 
> > > Andre'
> > 
> > But autocorrection is for macros only. How would you do this merging?
> 
> Basically but waiting for Stefan to do it ;-)
> 
> Andre'

Yes, that's a good plan.

... Stefan!

- Martin




Re: LyX is Nominated for th e Lutèce d'Or 2008

2008-09-19 Thread Martin Vermeer
On Thu, Sep 18, 2008 at 11:30:43PM +0200, Abdelrazak Younes wrote:
 Bob Lounsbury wrote:
 2008/9/18 Abdelrazak Younes[EMAIL PROTECTED]:

 Dear all, LyX enthusiasts, users and developers,

 I have the pleasure to announce you all that LyX is Nominated for the
 Lutèce d'Or 2008!
  


 Could you give a quick translation (for us not up to snuff Americans)
 of what Lutèce d'Or 2008 means?


 FYI Lutèce is the old pre-roman name for Paris. Literally this means 
 Golden Lutèce 2008 prices. These prices are distributed each year at the 
 occasion of this open source manifestation.

Ah! Lutetia, in Asterix :-)

- Martin



autocorrection

2008-09-19 Thread Martin Vermeer
I see that there is an autocorrection thingy in mathed, but disabled. Why is 
that? Does it work? Could we give the user the option of enabling it?

I know some users that would be very happy with this :-)

- Martin



Re: LyX is Nominated for th e "Lutèce d'Or 2008"

2008-09-19 Thread Martin Vermeer
On Thu, Sep 18, 2008 at 11:30:43PM +0200, Abdelrazak Younes wrote:
> Bob Lounsbury wrote:
>> 2008/9/18 Abdelrazak Younes<[EMAIL PROTECTED]>:
>>
>>> Dear all, LyX enthusiasts, users and developers,
>>>
>>> I have the pleasure to announce you all that LyX is Nominated for the
>>> "Lutèce d'Or 2008"!
>>>  
>>
>>
>> Could you give a quick translation (for us not up to snuff Americans)
>> of what "Lutèce d'Or 2008" means?
>>
>
> FYI Lutèce is the old pre-roman name for Paris. Literally this means 
> "Golden Lutèce 2008" prices. These prices are distributed each year at the 
> occasion of this open source manifestation.

Ah! Lutetia, in Asterix :-)

- Martin



autocorrection

2008-09-19 Thread Martin Vermeer
I see that there is an autocorrection thingy in mathed, but disabled. Why is 
that? Does it work? Could we give the user the option of enabling it?

I know some users that would be very happy with this :-)

- Martin



Re: The Three Box Model

2008-09-11 Thread Martin Vermeer
On Thu, Sep 11, 2008 at 09:11:49AM +0200, Abdelrazak Younes wrote:
  Richard Heck wrote:
  Andre Poenitz wrote:
 
  I admit we haven't discussed it for a few years, mainly because last
  time we reached consensus that it would be Real Kool(tm) to have but
  nobody implemented it.
 
  Did anyone try?
 
  I played a bit with the drawing side once. Should not be terribly difficult.
 
  Were there problems?
 
  I think the main problem is that people are not prepared to switch to a new 
  mental model WRT text selection. We also need proper support for inset 
  merging and splitting.
 
  Some people want to be able to select part of that inset, and part of that 
  subsequent inset without having to think in terms of insets entity. I 
  understand this POV but I disagree with it. For example, a change is a 
  change, I don't want to half select it together with the next change, this 
  use case is I think pretty rare; but if I want to undo part of a deletion 
  for example, that should be possible. This last use case involves inset 
  splitting which we don't support yet.
  Could you believe that we were discussing this very thing in front of a beer 
  with JMarc and Edwin yesterday?

What number LyX meeting was that? I remember using fractional numbers for this 
kind of happening to be in the same town at the same time.
 
  This would be particularly good with character styles
 
  Yes.
 
  Abdel.

Martin



Re: The Three Box Model

2008-09-11 Thread Martin Vermeer
On Thu, Sep 11, 2008 at 09:11:49AM +0200, Abdelrazak Younes wrote:
>  Richard Heck wrote:
> > Andre Poenitz wrote:
> >
> >> I admit we haven't discussed it for a few years, mainly because last
> >> time we reached consensus that it would be Real Kool(tm) to have but
> >> nobody implemented it.
> >>
> > Did anyone try?
> 
>  I played a bit with the drawing side once. Should not be terribly difficult.
> 
> > Were there problems?
> 
>  I think the main problem is that people are not prepared to switch to a new 
>  mental model WRT text selection. We also need proper support for inset 
>  merging and splitting.
> 
>  Some people want to be able to select part of that inset, and part of that 
>  subsequent inset without having to think in terms of insets entity. I 
>  understand this POV but I disagree with it. For example, a change is a 
>  change, I don't want to half select it together with the next change, this 
>  use case is I think pretty rare; but if I want to undo part of a deletion 
>  for example, that should be possible. This last use case involves inset 
>  splitting which we don't support yet.
>  Could you believe that we were discussing this very thing in front of a beer 
>  with JMarc and Edwin yesterday?

What number LyX meeting was that? I remember using fractional numbers for this 
kind of happening to be in the same town at the same time.
 
> > This would be particularly good with character styles
> 
>  Yes.
> 
>  Abdel.

Martin



Re: [Cvslog] r26303 - in /lyx-devel/trunk/src/insets: InsetCollapsable...

2008-09-08 Thread Martin Vermeer
On Mon, 08 Sep 2008 10:23:52 +0200
[EMAIL PROTECTED] wrote:

 Martin Vermeer [EMAIL PROTECTED] writes:
   BTW, I do not understand why this stuff is done in InsetCollapsable
   instead of InsetText.
   Me either. Probably goes back to who knows when.
  Try move it and you'll find out what the reason is if any... 
 
 Very wise advice :) 
 
 Any chance to see you in Berlin, BTW?
 
 JMarc

Probably not... lecture season and very busy in real life :-(

- Martin


Re: [Cvslog] r26303 - in /lyx-devel/trunk/src/insets: InsetCollapsable...

2008-09-08 Thread Martin Vermeer
On Mon, 08 Sep 2008 10:23:52 +0200
[EMAIL PROTECTED] wrote:

> Martin Vermeer <[EMAIL PROTECTED]> writes:
> >> > BTW, I do not understand why this stuff is done in InsetCollapsable
> >> > instead of InsetText.
> >>  Me either. Probably goes back to who knows when.
> > Try move it and you'll find out what the reason is if any... 
> 
> Very wise advice :) 
> 
> Any chance to see you in Berlin, BTW?
> 
> JMarc

Probably not... lecture season and very busy in real life :-(

- Martin


Re: Multi-author track changes

2008-09-06 Thread Martin Vermeer
On Sat, Sep 06, 2008 at 04:01:47PM +0200, Abdelrazak Younes wrote:
  Jean-Marc Lasgouttes wrote:
  Vincent van Ravesteijn - TNW[EMAIL PROTECTED]  writes:
 
 
  Hi all,
 
  After complaints from a colleague that he couldn't see which changes in a 
  document were his and which were from his supervisor, I implemented a 
  slightly different way of showing the changes (see png).
 
  In the attached (preliminary) patch I defined 5 colors for a possible 5 
  authors. I couldn't think of another way at the moment.
   
 
  This is so,ething I had in ,ind too. Good work. Things could be sipler
  though by introducing a new Change::color() method instead of
  duplicating your ugly formula :)
 
 
  PS. Would it be best to open an enhancement bug for these kinds of things 
  ?
   
 
  Yes, if it turns out that it is not accepted right away.
 
 
  I think this patch should be accepted as it implement a badly missing 
  feature for change-tracking and is very straight forward. And Vincent fixed 
  more bugs than any of us recently :-)
 
  By the way Vincent, I much say that I am impressed with how quick you 
  learned your way inside LyX source code. Good work!
 
  Abdel.


As a fellow old TU Delfter, I can only proudly agree ;-)

- Martin

 


Re: [Cvslog] r26303 - in /lyx-devel/trunk/src/insets: InsetCollapsable...

2008-09-06 Thread Martin Vermeer
On Fri, Sep 05, 2008 at 11:05:32AM -0400, Richard Heck wrote:
  Jean-Marc Lasgouttes wrote:
  [EMAIL PROTECTED] writes:

  +  // FIXME At present, these are being enabled and disabled according to
  +  // whether PASSTHRU has been set in the InsetLayout. This makes some
  +  // sense, but there are other checks that should really be done. E.g.,
  +  // one should not be able to inset IndexPrint inside an optional 
  argument!!
  
 
  You can specify that in the insetAllowed method of IndexOptArg.
 

  OK.
 
  BTW, I do not understand why this stuff is done in InsetCollapsable
  instead of InsetText.
 

  Me either. Probably goes back to who knows when.
 
  rh
 
Try move it and you'll find out what the reason is if any... 

- Martin
 


Re: Multi-author track changes

2008-09-06 Thread Martin Vermeer
On Sat, Sep 06, 2008 at 04:01:47PM +0200, Abdelrazak Younes wrote:
>  Jean-Marc Lasgouttes wrote:
> > "Vincent van Ravesteijn - TNW"<[EMAIL PROTECTED]>  writes:
> >
> >
> >> Hi all,
> >>
> >> After complaints from a colleague that he couldn't see which changes in a 
> >> document were his and which were from his supervisor, I implemented a 
> >> slightly different way of showing the changes (see png).
> >>
> >> In the attached (preliminary) patch I defined 5 colors for a possible 5 
> >> authors. I couldn't think of another way at the moment.
> >>  
> >
> > This is so,ething I had in ,ind too. Good work. Things could be sipler
> > though by introducing a new Change::color() method instead of
> > duplicating your ugly formula :)
> >
> >
> >> PS. Would it be best to open an enhancement bug for these kinds of things 
> >> ?
> >>  
> >
> > Yes, if it turns out that it is not accepted right away.
> >
> 
>  I think this patch should be accepted as it implement a badly missing 
>  feature for change-tracking and is very straight forward. And Vincent fixed 
>  more bugs than any of us recently :-)
> 
>  By the way Vincent, I much say that I am impressed with how quick you 
>  learned your way inside LyX source code. Good work!
> 
>  Abdel.


As a fellow old TU Delfter, I can only proudly agree ;-)

- Martin

 


Re: [Cvslog] r26303 - in /lyx-devel/trunk/src/insets: InsetCollapsable...

2008-09-06 Thread Martin Vermeer
On Fri, Sep 05, 2008 at 11:05:32AM -0400, Richard Heck wrote:
>  Jean-Marc Lasgouttes wrote:
> > [EMAIL PROTECTED] writes:
> >   
> >> +  // FIXME At present, these are being enabled and disabled according to
> >> +  // whether PASSTHRU has been set in the InsetLayout. This makes some
> >> +  // sense, but there are other checks that should really be done. E.g.,
> >> +  // one should not be able to inset IndexPrint inside an optional 
> >> argument!!
> >> 
> >
> > You can specify that in the insetAllowed method of IndexOptArg.
> >
> >   
>  OK.
> 
> > BTW, I do not understand why this stuff is done in InsetCollapsable
> > instead of InsetText.
> >
> >   
>  Me either. Probably goes back to who knows when.
> 
>  rh
 
Try move it and you'll find out what the reason is if any... 

- Martin
 


Re: [patch] fix bug 5138

2008-08-07 Thread Martin Vermeer
On Thu, Aug 07, 2008 at 11:35:18PM +0200, Uwe Stöhr wrote:
  See http://bugzilla.lyx.org/show_bug.cgi?id=5138
 
  regards Uwe

small patch...

Martin



Re: [patch] fix bug 5138

2008-08-07 Thread Martin Vermeer
On Thu, Aug 07, 2008 at 11:35:18PM +0200, Uwe Stöhr wrote:
>  See http://bugzilla.lyx.org/show_bug.cgi?id=5138
> 
>  regards Uwe

small patch...

Martin



Re: RFC for a proper sub/superscript handling

2008-07-01 Thread Martin Vermeer
On Tue, Jul 01, 2008 at 05:26:09PM +0200, Uwe Stöhr wrote:
  Martin Vermeer schrieb:
 
  \textsuper/subscript is exactly  designed for cases of H2O, SO_4^2-, 
  2nd, and the like.
  No Uwe, you are IMHO mixing up two conceptually different classes of 
  sub/superscript.
 
  What else is \textsubscript for? Are there any typographic rules or 
  conventions that say Do not use subscripted text font for chemical 
  indices.?

It is for use in text, like 2nd, Mme, etc. (Well that's superscript)

   The chemistry stuff is not math,
 
  I know, I therefore want to use \textsubscript and not a math font as we 
  currently do. There are special LaTeX-packages for chemistry, but this is 
  overkill for simple cases like H2O.
  I don't understand why you are against using \textsuper- subscript .

I am not against it... as long as we remember that it isn't the right way. I 
am also not against writing E = mc^2 using text... only math is already 
available in LyX so this hack isn't needed.

I, from my side, rhetorically don't understand why you are against using math _ 
^ for chemistry... a hack is a hack is a hack ;-)

But I agree that \textsuper/sub is useful and should be implemented.

- Martin
 


Re: RFC for a proper sub/superscript handling

2008-07-01 Thread Martin Vermeer
On Tue, Jul 01, 2008 at 05:26:09PM +0200, Uwe Stöhr wrote:
>  Martin Vermeer schrieb:
> 
> >> \textsuper/subscript is exactly  designed for cases of "H2O", "SO_4^2-", 
> >> "2nd", and the like.
> > No Uwe, you are IMHO mixing up two conceptually different classes of 
> > sub/superscript.
> 
>  What else is \textsubscript for? Are there any typographic rules or 
>  conventions that say "Do not use subscripted text font for chemical 
>  indices."?

It is for use in text, like "2nd", "Mme", etc. (Well that's superscript)

>  > The chemistry stuff is not math,
> 
>  I know, I therefore want to use \textsubscript and not a math font as we 
>  currently do. There are special LaTeX-packages for chemistry, but this is 
>  overkill for simple cases like "H2O".
>  I don't understand why you are against using \textsuper- subscript .

I am not against it... as long as we remember that it isn't "the right way". I 
am also not against writing "E = mc^2" using text... only math is already 
available in LyX so this hack isn't needed.

I, from my side, rhetorically don't understand why you are against using math _ 
^ for chemistry... a hack is a hack is a hack ;-)

But I agree that \textsuper/sub is useful and should be implemented.

- Martin
 


  1   2   3   4   5   6   7   8   9   10   >