Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Jean-Marc Lasgouttes

Le 13/07/2012 00:24, Pavel Sanda a écrit :

Richard Heck wrote:

This leads to the harmless message above, but more importantly, it means
that the undo stack is lost every time a file is saved-as. This looks like
a regression to me.

Richard, would it seem right to add a parameter to Buffer::reload asking
to preserve the undo stack in this case?


You mean to preserve undo stack for each reload of file or just for save-as
scenario? We also reload automatically after commit/checkout VCS operation which
can change read-only status.


This is why I propose to add a parameter to reload telling whether undo 
should be discarded.


OTOH, it looks like doing a reload in after save-as is a bit harsh. Is 
the goal only to sanitize IncludeInset?


I have been pondering for some time whether the updateBuffer mechanism 
could be extended with an enum telling what to update, in order to be 
able to run it for specific tasks. For example 
updateBuffer(EXTERNAL_FILES) could check the validity of all external 
files we hold. I had other applications in mind, but I can't remember 
them ATM.


JMarc




Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Jean-Marc Lasgouttes

Le 12/07/2012 18:14, Richard Heck a écrit :

Richard, would it seem right to add a parameter to Buffer::reload
asking to preserve the undo stack in this case?


You would probably know better than I do. Are there pointers on the undo
stack that will be invalidated once we reload?


The undo stack holds a pointer to the buffer (which is OK) and the undo 
elements hold StableIterators, which do not contain any meaningful 
pointers. So this should be safe enough IMO.


I will experiment.

JMarc


Re: LyX, XeTeX, bidi and Hebrew

2012-07-13 Thread Guenter Milde
On 2012-07-12, Ronen Abravanel wrote:

 as the Hebrew support of LaTeX is not developed for the last several
 years, I decided to try and export Hebrew document to PDF using XeTeX,

Are there problems that did not get solved for years, or is there no
development because it just works?

 where the grate Bidi packge by Vafa Khalighi is under active
 development, and merged in polyglossia.

 LyX 2.0 support XeTeX support, but there are some slight problem:

 1. when exporting to regular latex, one should wrap english text  (like
 numbers, math, etc..)  inside Hebrew parts by \L{.,, }. 

Do you do this with raw LaTeX (ERT) or is there an inset for the task
(should be easy to write one if its not already there).

 not true in XeTeX. Attached an ugly patch that removes such \L, but:
 a. it's pretty ugly. I'm sure there is better way to do it. I will be happy
 for suggestions about ways to improve it.

For documents that shall work in both, pdflatex and xelatex, it might be
best to have a dummy definition like

  \ifxetex
 \providecommand*{\L}[1]{#1}
  \fi
  
either in the documents LaTeX preamble or in the module defining the text
inset).

...

 2. LyX making some problems with the braces { } ( ) etc in Right-to-left
 parts:
 When one writes Right-to-left text that should look like
 (1) text ( inside braces ) more text
 it outputs as
 (2) text ) inside braces ( more text
 or, to be more accurate,
 עברית ( עוד טקסט this part is INSIDE  עוד טקסט ) בחוץ this part is outside
 .  בחוץ
 Will be output as
 עברית ) עוד טקסט this part is INSIDE  עוד טקסט ( בחוץ this part is outside
 . בחוץ
 It all looks OK when rendering using pdflatex, but using XeTeX, it appears
 wrong.
 I couldn't find the part in LyX that handle that part. I will be happy for
 directions regarding where to look.

I don't know a solution for this part. It looks like the two engines do
not agree on whether ( and ) are opening vs. closing or right vs.
left parantheses. 

You may try to create a minimal *.tex exampe file that works with XeTeX
and import this to LyX or try to recreate the correct syntax in LyX
(comparing the ViewSource output with the correct XeTeX source).

Günter



Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Richard Heck

On 07/13/2012 03:47 AM, Jean-Marc Lasgouttes wrote:

Le 13/07/2012 00:24, Pavel Sanda a écrit :

Richard Heck wrote:
This leads to the harmless message above, but more importantly, it 
means
that the undo stack is lost every time a file is saved-as. This 
looks like

a regression to me.

Richard, would it seem right to add a parameter to Buffer::reload 
asking

to preserve the undo stack in this case?


You mean to preserve undo stack for each reload of file or just for 
save-as
scenario? We also reload automatically after commit/checkout VCS 
operation which

can change read-only status.


This is why I propose to add a parameter to reload telling whether 
undo should be discarded.


OTOH, it looks like doing a reload in after save-as is a bit harsh. Is 
the goal only to sanitize IncludeInset?


It certainly wouldn't surprise me if there were something simpler we 
could do. It was definitely a big hammer, that commit.


The primary goal was to deal with the fact that children, parents, etc, 
may no longer be where there are supposed to be. But the Buffer contains 
all kinds of pointers (e.g., in the TOC, in the reference cache, etc) 
that may point to children and the like. So I'm guessing there are other 
issues.


I have been pondering for some time whether the updateBuffer mechanism 
could be extended with an enum telling what to update, in order to be 
able to run it for specific tasks. For example 
updateBuffer(EXTERNAL_FILES) could check the validity of all external 
files we hold. I had other applications in mind, but I can't remember 
them ATM.


That's quite a good idea, I think. I'm sure we'd discover uses for this. 
I can well remember putting comments in the code that said things like, 
What we actually want here is such-and-such, and the way to get it is 
to update the Buffer


Richard



Re: LyX, XeTeX, bidi and Hebrew

2012-07-13 Thread Ronen Abravanel
1. you are right. one can do that, and it would be a nice workaround. But I
prefer lyx will  produce clean TeX file.
2. Attached some examples:
the text in the *xetex and *pdf files are identical. in the pdf, you can
see that the braces are rendered backword, and also if you will open the
.tex file in unicode-enables editor.


note: I cheated a little. In my work-computer I have lyx 2.1 development
version, and the xetex file compiled straight forward. In my lyx 2.03 in my
laptop, I had to move one line in the preamble.


Ronen

On Fri, Jul 13, 2012 at 11:00 AM, Guenter Milde mi...@users.sf.net wrote:

 On 2012-07-12, Ronen Abravanel wrote:

  as the Hebrew support of LaTeX is not developed for the last several
  years, I decided to try and export Hebrew document to PDF using XeTeX,

 Are there problems that did not get solved for years, or is there no
 development because it just works?

  where the grate Bidi packge by Vafa Khalighi is under active
  development, and merged in polyglossia.

  LyX 2.0 support XeTeX support, but there are some slight problem:

  1. when exporting to regular latex, one should wrap english text  (like
  numbers, math, etc..)  inside Hebrew parts by \L{.,, }.

 Do you do this with raw LaTeX (ERT) or is there an inset for the task
 (should be easy to write one if its not already there).

  not true in XeTeX. Attached an ugly patch that removes such \L, but:
  a. it's pretty ugly. I'm sure there is better way to do it. I will be
 happy
  for suggestions about ways to improve it.

 For documents that shall work in both, pdflatex and xelatex, it might be
 best to have a dummy definition like

   \ifxetex
  \providecommand*{\L}[1]{#1}
   \fi

 either in the documents LaTeX preamble or in the module defining the text
 inset).

 ...

  2. LyX making some problems with the braces { } ( ) etc in Right-to-left
  parts:
  When one writes Right-to-left text that should look like
  (1) text ( inside braces ) more text
  it outputs as
  (2) text ) inside braces ( more text
  or, to be more accurate,
  עברית ( עוד טקסט this part is INSIDE  עוד טקסט ) בחוץ this part is
 outside
  .  בחוץ
  Will be output as
  עברית ) עוד טקסט this part is INSIDE  עוד טקסט ( בחוץ this part is
 outside
  . בחוץ
  It all looks OK when rendering using pdflatex, but using XeTeX, it
 appears
  wrong.
  I couldn't find the part in LyX that handle that part. I will be happy
 for
  directions regarding where to look.

 I don't know a solution for this part. It looks like the two engines do
 not agree on whether ( and ) are opening vs. closing or right vs.
 left parantheses.

 You may try to create a minimal *.tex exampe file that works with XeTeX
 and import this to LyX or try to recreate the correct syntax in LyX
 (comparing the ViewSource output with the correct XeTeX source).

 Günter




brace_example_pdflatex.lyx
Description: Binary data


brace_example_pdflatex.pdf
Description: Adobe PDF document


brace_example_xetex.lyx
Description: Binary data


brace_example_xetex.pdf
Description: Adobe PDF document


brace_example_xetex.tex
Description: TeX document


brace_example_pdflatex.tex
Description: TeX document


Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Pavel Sanda
Jean-Marc Lasgouttes wrote:
 You mean to preserve undo stack for each reload of file or just for save-as
 scenario? We also reload automatically after commit/checkout VCS operation
 which can change read-only status.

 This is why I propose to add a parameter to reload telling whether undo
 should be discarded.

That looks fine.

 OTOH, it looks like doing a reload in after save-as is a bit harsh. Is the
 goal only to sanitize IncludeInset?

Paths to images also change, though don't know whether reload is needed.

Pavel


RE: questions and proposal regarding enum FuncAttribs

2012-07-13 Thread Scott Kostyshak
From: Jean-Marc Lasgouttes [lasgout...@lyx.org]
Sent: Thursday, July 12, 2012 5:20 AM

I think theargument flag is not flexible enough to be useful.

ok.

In the meantime, it would not hurt to fix one by one the examples you
gave (in getStatus). Returning meaningful error messages when getStatus
disables a function would make sense too.

ok, I will look into this later if no ones else does.

Thanks,

Scott

Re: questions and proposal regarding enum FuncAttribs

2012-07-13 Thread Pavel Sanda
Scott Kostyshak wrote:
 In the meantime, it would not hurt to fix one by one the examples you
 gave (in getStatus). Returning meaningful error messages when getStatus
 disables a function would make sense too.
 
 ok, I will look into this later if no ones else does.

Be sure no one else will do ;)
Pavel


RE: questions and proposal regarding enum FuncAttribs

2012-07-13 Thread Scott Kostyshak
From: Pavel Sanda [sa...@lyx.org]
Sent: Friday, July 13, 2012 4:43 PM

Scott Kostyshak wrote:
 In the meantime, it would not hurt to fix one by one the examples you
 gave (in getStatus). Returning meaningful error messages when getStatus
 disables a function would make sense too.

 ok, I will look into this later if no ones else does.

Be sure no one else will do ;)

Dang, now I really will have to look into this or you will know that I was 
bluffing.

Scott

Re: #8187: APA layout provides invalid styles

2012-07-13 Thread Uwe Stöhr

Am 13.07.2012 03:33, schrieb Maaneli D:


First, although the graph shows up on the PDF, I'm not sure how to format it 
such that I can center the graph, or move it in different places.


In the file you sent me, you inserted the image in the figure caption. Move it out of the caption 
and it will work as usual: center the paragraph where the image is in via LyX's paragraph settings.

Attached is your fixed file.


Also, in the PDF created from the editor, it says on the bottom left of the first page 
that Author notes, acknowledgements, contact information go here. However, I 
don't see anything in the editor that corresponds to that part of the PDF.


In the LyX file you sent the first yellow note states
Have a look at Document-Settings-Preamble for further settings. A brief documentation can be 
found at http://ctan.basemirror.de/macros/latex/contrib/apa/apacls.html.;


So if you look at this menu you will find the journal settings and also notes, 
acknowledgements etc.

regards Uwe


APA test.lyx
Description: application/lyx


Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Jean-Marc Lasgouttes

Le 13/07/2012 00:24, Pavel Sanda a écrit :

Richard Heck wrote:

This leads to the harmless message above, but more importantly, it means
that the undo stack is lost every time a file is saved-as. This looks like
a regression to me.

Richard, would it seem right to add a parameter to Buffer::reload asking
to preserve the undo stack in this case?


You mean to preserve undo stack for each reload of file or just for save-as
scenario? We also reload automatically after commit/checkout VCS operation which
can change read-only status.


This is why I propose to add a parameter to reload telling whether undo 
should be discarded.


OTOH, it looks like doing a reload in after save-as is a bit harsh. Is 
the goal only to sanitize IncludeInset?


I have been pondering for some time whether the updateBuffer mechanism 
could be extended with an enum telling what to update, in order to be 
able to run it for specific tasks. For example 
updateBuffer(EXTERNAL_FILES) could check the validity of all external 
files we hold. I had other applications in mind, but I can't remember 
them ATM.


JMarc




Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Jean-Marc Lasgouttes

Le 12/07/2012 18:14, Richard Heck a écrit :

Richard, would it seem right to add a parameter to Buffer::reload
asking to preserve the undo stack in this case?


You would probably know better than I do. Are there pointers on the undo
stack that will be invalidated once we reload?


The undo stack holds a pointer to the buffer (which is OK) and the undo 
elements hold StableIterators, which do not contain any meaningful 
pointers. So this should be safe enough IMO.


I will experiment.

JMarc


Re: LyX, XeTeX, bidi and Hebrew

2012-07-13 Thread Guenter Milde
On 2012-07-12, Ronen Abravanel wrote:

> as the Hebrew support of LaTeX is not developed for the last several
> years, I decided to try and export Hebrew document to PDF using XeTeX,

Are there problems that did not get solved for years, or is there no
development because it "just works"?

> where the grate Bidi packge by Vafa Khalighi is under active
> development, and merged in polyglossia.

> LyX 2.0 support XeTeX support, but there are some slight problem:

> 1. when exporting to regular latex, one should wrap "english" text  (like
> numbers, math, etc..)  inside Hebrew parts by \L{.,, }. 

Do you do this with raw LaTeX (ERT) or is there an inset for the task
(should be easy to write one if its not already there).

> not true in XeTeX. Attached an ugly patch that removes such \L, but:
> a. it's pretty ugly. I'm sure there is better way to do it. I will be happy
> for suggestions about ways to improve it.

For documents that shall work in both, pdflatex and xelatex, it might be
best to have a dummy definition like

  \ifxetex
 \providecommand*{\L}[1]{#1}
  \fi
  
either in the documents LaTeX preamble or in the module defining the text
inset).

...

> 2. LyX making some problems with the braces { } ( ) etc in Right-to-left
> parts:
> When one writes Right-to-left text that should look like
> (1) text ( inside braces ) more text
> it outputs as
> (2) text ) inside braces ( more text
> or, to be more accurate,
> עברית ( עוד טקסט this part is INSIDE  עוד טקסט ) בחוץ this part is outside
> .  בחוץ
> Will be output as
> עברית ) עוד טקסט this part is INSIDE  עוד טקסט ( בחוץ this part is outside
> . בחוץ
> It all looks OK when rendering using pdflatex, but using XeTeX, it appears
> wrong.
> I couldn't find the part in LyX that handle that part. I will be happy for
> directions regarding where to look.

I don't know a solution for this part. It looks like the two engines do
not agree on whether ( and ) are "opening" vs. "closing" or "right" vs.
"left" parantheses. 

You may try to create a minimal *.tex exampe file that works with XeTeX
and import this to LyX or try to recreate the correct syntax in LyX
(comparing the View>Source output with the correct XeTeX source).

Günter



Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Richard Heck

On 07/13/2012 03:47 AM, Jean-Marc Lasgouttes wrote:

Le 13/07/2012 00:24, Pavel Sanda a écrit :

Richard Heck wrote:
This leads to the harmless message above, but more importantly, it 
means
that the undo stack is lost every time a file is saved-as. This 
looks like

a regression to me.

Richard, would it seem right to add a parameter to Buffer::reload 
asking

to preserve the undo stack in this case?


You mean to preserve undo stack for each reload of file or just for 
save-as
scenario? We also reload automatically after commit/checkout VCS 
operation which

can change read-only status.


This is why I propose to add a parameter to reload telling whether 
undo should be discarded.


OTOH, it looks like doing a reload in after save-as is a bit harsh. Is 
the goal only to sanitize IncludeInset?


It certainly wouldn't surprise me if there were something simpler we 
could do. It was definitely a big hammer, that commit.


The primary goal was to deal with the fact that children, parents, etc, 
may no longer be where there are supposed to be. But the Buffer contains 
all kinds of pointers (e.g., in the TOC, in the reference cache, etc) 
that may point to children and the like. So I'm guessing there are other 
issues.


I have been pondering for some time whether the updateBuffer mechanism 
could be extended with an enum telling what to update, in order to be 
able to run it for specific tasks. For example 
updateBuffer(EXTERNAL_FILES) could check the validity of all external 
files we hold. I had other applications in mind, but I can't remember 
them ATM.


That's quite a good idea, I think. I'm sure we'd discover uses for this. 
I can well remember putting comments in the code that said things like, 
"What we actually want here is such-and-such, and the way to get it is 
to update the Buffer"


Richard



Re: LyX, XeTeX, bidi and Hebrew

2012-07-13 Thread Ronen Abravanel
1. you are right. one can do that, and it would be a nice workaround. But I
prefer lyx will  produce clean TeX file.
2. Attached some examples:
the text in the *xetex and *pdf files are identical. in the pdf, you can
see that the braces are rendered backword, and also if you will open the
.tex file in unicode-enables editor.


note: I cheated a little. In my work-computer I have lyx 2.1 development
version, and the xetex file compiled straight forward. In my lyx 2.03 in my
laptop, I had to move one line in the preamble.


Ronen

On Fri, Jul 13, 2012 at 11:00 AM, Guenter Milde  wrote:

> On 2012-07-12, Ronen Abravanel wrote:
>
> > as the Hebrew support of LaTeX is not developed for the last several
> > years, I decided to try and export Hebrew document to PDF using XeTeX,
>
> Are there problems that did not get solved for years, or is there no
> development because it "just works"?
>
> > where the grate Bidi packge by Vafa Khalighi is under active
> > development, and merged in polyglossia.
>
> > LyX 2.0 support XeTeX support, but there are some slight problem:
>
> > 1. when exporting to regular latex, one should wrap "english" text  (like
> > numbers, math, etc..)  inside Hebrew parts by \L{.,, }.
>
> Do you do this with raw LaTeX (ERT) or is there an inset for the task
> (should be easy to write one if its not already there).
>
> > not true in XeTeX. Attached an ugly patch that removes such \L, but:
> > a. it's pretty ugly. I'm sure there is better way to do it. I will be
> happy
> > for suggestions about ways to improve it.
>
> For documents that shall work in both, pdflatex and xelatex, it might be
> best to have a dummy definition like
>
>   \ifxetex
>  \providecommand*{\L}[1]{#1}
>   \fi
>
> either in the documents LaTeX preamble or in the module defining the text
> inset).
>
> ...
>
> > 2. LyX making some problems with the braces { } ( ) etc in Right-to-left
> > parts:
> > When one writes Right-to-left text that should look like
> > (1) text ( inside braces ) more text
> > it outputs as
> > (2) text ) inside braces ( more text
> > or, to be more accurate,
> > עברית ( עוד טקסט this part is INSIDE  עוד טקסט ) בחוץ this part is
> outside
> > .  בחוץ
> > Will be output as
> > עברית ) עוד טקסט this part is INSIDE  עוד טקסט ( בחוץ this part is
> outside
> > . בחוץ
> > It all looks OK when rendering using pdflatex, but using XeTeX, it
> appears
> > wrong.
> > I couldn't find the part in LyX that handle that part. I will be happy
> for
> > directions regarding where to look.
>
> I don't know a solution for this part. It looks like the two engines do
> not agree on whether ( and ) are "opening" vs. "closing" or "right" vs.
> "left" parantheses.
>
> You may try to create a minimal *.tex exampe file that works with XeTeX
> and import this to LyX or try to recreate the correct syntax in LyX
> (comparing the View>Source output with the correct XeTeX source).
>
> Günter
>
>


brace_example_pdflatex.lyx
Description: Binary data


brace_example_pdflatex.pdf
Description: Adobe PDF document


brace_example_xetex.lyx
Description: Binary data


brace_example_xetex.pdf
Description: Adobe PDF document


brace_example_xetex.tex
Description: TeX document


brace_example_pdflatex.tex
Description: TeX document


Re: Undo.cpp reports an error on trunk

2012-07-13 Thread Pavel Sanda
Jean-Marc Lasgouttes wrote:
>> You mean to preserve undo stack for each reload of file or just for save-as
>> scenario? We also reload automatically after commit/checkout VCS operation
>> which can change read-only status.
>
> This is why I propose to add a parameter to reload telling whether undo
> should be discarded.

That looks fine.

> OTOH, it looks like doing a reload in after save-as is a bit harsh. Is the
> goal only to sanitize IncludeInset?

Paths to images also change, though don't know whether reload is needed.

Pavel


RE: questions and proposal regarding enum FuncAttribs

2012-07-13 Thread Scott Kostyshak
From: Jean-Marc Lasgouttes [lasgout...@lyx.org]
Sent: Thursday, July 12, 2012 5:20 AM

>I think theargument flag is not flexible enough to be useful.

ok.

>In the meantime, it would not hurt to fix one by one the examples you
>gave (in getStatus). Returning meaningful error messages when getStatus
>disables a function would make sense too.

ok, I will look into this later if no ones else does.

Thanks,

Scott

Re: questions and proposal regarding enum FuncAttribs

2012-07-13 Thread Pavel Sanda
Scott Kostyshak wrote:
> >In the meantime, it would not hurt to fix one by one the examples you
> >gave (in getStatus). Returning meaningful error messages when getStatus
> >disables a function would make sense too.
> 
> ok, I will look into this later if no ones else does.

Be sure no one else will do ;)
Pavel


RE: questions and proposal regarding enum FuncAttribs

2012-07-13 Thread Scott Kostyshak
From: Pavel Sanda [sa...@lyx.org]
Sent: Friday, July 13, 2012 4:43 PM

Scott Kostyshak wrote:
>> >In the meantime, it would not hurt to fix one by one the examples you
>> >gave (in getStatus). Returning meaningful error messages when getStatus
>> >disables a function would make sense too.
>>
>> ok, I will look into this later if no ones else does.

>Be sure no one else will do ;)

Dang, now I really will have to look into this or you will know that I was 
bluffing.

Scott

Re: #8187: APA layout provides invalid styles

2012-07-13 Thread Uwe Stöhr

Am 13.07.2012 03:33, schrieb Maaneli D:


First, although the graph shows up on the PDF, I'm not sure how to format it 
such that I can center the graph, or move it in different places.


In the file you sent me, you inserted the image in the figure caption. Move it out of the caption 
and it will work as usual: center the paragraph where the image is in via LyX's paragraph settings.

Attached is your fixed file.


Also, in the PDF created from the editor, it says on the bottom left of the first page 
that "Author notes, acknowledgements, contact information go here". However, I 
don't see anything in the editor that corresponds to that part of the PDF.


In the LyX file you sent the first yellow note states
"Have a look at Document->Settings->Preamble for further settings. A brief documentation can be 
found at http://ctan.basemirror.de/macros/latex/contrib/apa/apacls.html.;


So if you look at this menu you will find the journal settings and also notes, 
acknowledgements etc.

regards Uwe


APA test.lyx
Description: application/lyx