Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Andre Poenitz
On Sat, Feb 25, 2006 at 07:19:31PM +0200, Martin Vermeer wrote:
> For blackboard bold R (real numbers) we have "\\mathbb R".

Why doesn't it try \mathbb{R} or such? Shouldn't that be parsed
better?

> [...]
> Angus is marked as being to 'blame' for this part of the code, but that
> proves little for deletion of code. Somebody decided to do a little
> clean-up job on code he didn't understand... nice.

I recognize this pattern, however I am not sure I've ever touched 
ControlMath.C.

Andre'


Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Andre Poenitz
On Sat, Feb 25, 2006 at 04:36:58PM +0100, Juergen Spitzmueller wrote:
> Joost Verburg wrote:
> > I'm trying to insert one of the matbb/mathcal/mathrm symbols in a
> > document using the math panel, for example the double-barred R: \mathbb{R}.
> >
> > Nothing appears on the screen and when I look at the saved LyX file it
> > contains only an empty mathbb command: \mathbb{}. When I add the R
> > manually using a text editor and open the document, it works fine.
> 
> That's bad. I suppose it is related to bug 2315:
> http://bugzilla.lyx.org/show_bug.cgi?id=2315
> 
> math-insert is broken in general :-(

Could this be related to somebody insisting on (a) doing clever things
in text->math conversation (i.e. adding 'missing' '$') and/or (b)
disallowing 'forbidden' things when in math-text mode?

> > Typing the LaTeX command manually also gives weird behavior and not the
> > expected result.
> 
> you mean \mathbb{R}, then select and C-M?
> Typing \mathbbR gives the expected result to me.

That this space is rquired is also a regression and I do not really
remember leaving mathed in this state. Could this be related to the 
'macroModeClose' changes?

Andre'
> 
> Jürgen

-- 


subversion

2006-02-25 Thread Andre Poenitz
Is there an equivalent to cvs's -z9 option (i.e. compressing the data
stream) in subversion or is it not possible or maybe not needed?

Andre'


Re: LyX 1.4: Reproducable Crash [more math bug examples]

2006-02-25 Thread Andre Poenitz
On Sat, Feb 25, 2006 at 01:01:29PM +0200, Martin Vermeer wrote:
> But how long does it take you to figure out whether to type
> \longleftarrow or \leftlongarrow? Or \infinite or \infinity or \infty?
> Sure, you learn after a while, but only for those you use regularly.

Sure. That's what the panel is for. But it's not meant to be used as
primary input method. The statement 'LyX math is only now usable that it
has a math toolbar' is not true.

Andre' 


Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Martin Vermeer
On Sat, Feb 25, 2006 at 04:47:31PM +0100, Juergen Spitzmueller wrote:
> Also sprach Joost Verburg:
> > The main problem is that the math panel doesn't work. Try to insert one
> > of the mathbb symbols using the math panel and you get an empty inset
> > instead of the symbol.
> 
> I know, I can reproduce that. I just wanted to point out that the bug is IMHO 
> the same as the one for text->math conversion, viz.a broken LFUN_INSERT_MATH.

I found the reason for the bug, and the story is not pretty.

First of all, the bug is unrelated to text->math conversion. You should
look at ControlMath.C. There, the command texts associated with each
symbol in the math symbol panels, executed when clicking on them, are
defined.

For blackboard bold R (real numbers) we have "\\mathbb R".

When you inspect the code handling this, more precisely
ControlMath::dispatchInsert, you see that there is no handling taking
place. And in math_nestinset's INSERT_MATH code, the R is silently
dropped.

I have a vivid recollection that there was code handling this kind of
command string. Splitting up the string and submitting the two
separately to dispatchFunc. Moreover, I have a strong recollection that
I wrote both this code and introduced the command syntax it handles... 

Angus is marked as being to 'blame' for this part of the code, but that
proves little for deletion of code. Somebody decided to do a little
clean-up job on code he didn't understand... nice.

The eerily familiar looking, reconstructed code that fixes the bug is
attached. 

- Martin

Index: ControlMath.C
===
--- ControlMath.C   (revision 13276)
+++ ControlMath.C   (working copy)
@@ -43,7 +43,16 @@
 
 void ControlMath::dispatchInsert(string const & name) const
 {
-   dispatchFunc(LFUN_INSERT_MATH, '\\' + name);
+   // Split name if it contains blank, to handle command strings like
+   // mathbb R for blackboard bold R:
+   string::size_type blank = name.find(' ');
+   if (blank != string::npos) {
+   string name1 = name.substr(0, blank);
+   string name2 = name.substr(blank + 1);
+   dispatchFunc(LFUN_INSERT_MATH, '\\' + name1);
+   dispatchFunc(LFUN_INSERT_MATH, name2);
+   } else
+   dispatchFunc(LFUN_INSERT_MATH, '\\' + name);
 }
 
 


pgp8DewP0iO6t.pgp
Description: PGP signature


Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Enrico Forestieri
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
> 
> Enrico Forestieri a écrit :
> > Abdelrazak Younes  ...> writes:
> > 
> >> For Msys/mingw binaries, I might be able to help if needed. Packaging is 
> >> something else... Uwe might propose something and Angus might come out 
> >> of his retirement . I can see some well positioned outsiders (Enrico? 
> >> Michael?).
> > 
> > It is my intention to provide a cygwin package. I have already done that
> > in the past for distributing LyX to my colleagues and I have no problem
> > sharing it.
> 
> And will you need to install cygwin to use this package?

Yes, of course. However, I think that it can be of interest only to those
already using cygwin. The native version is a much better option for all
non-cygwin users and I expect that nobody will install cygwin only for
using a cygwin version of LyX ;-)

-- 
Enrico









Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Abdelrazak Younes

Michael Gerz a écrit :

Abdelrazak Younes wrote:

Building of svn version with current MSYS DTK is not possible because 
of old automake. But I guess that automake is not required for 
building a released candidate.
Reading the user list, I see that some people managed to use Cygwin 
for that task too (using Qtwin port without X). So it's up to the 
packager to choose that way of the other.


If you have MinGW and cygwin on your machine, you can use cygwin's 
automake and switch back to MinGW afterwards. I guess users won't need 
automake if they download the 1.4.0 tar file, right?


That is my understanding yes.


I will go and ask the MinGW people for a recent automake.


I have tried to compile am-1.9 from mingwport but it won't even 
configure (complains about MSYS make or something).


It would be very nice if they could provide a MSYS package.

Abdel.



Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Juergen Spitzmueller
Also sprach Joost Verburg:
> This is bad. I guess I found another bug that didn't look very important
> (text>math broken) but is quite major (math panel broken).

I think so, too.

Jürgen


Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Abdelrazak Younes

Enrico Forestieri a écrit :

Abdelrazak Younes <[EMAIL PROTECTED]> writes:

For Msys/mingw binaries, I might be able to help if needed. Packaging is 
something else... Uwe might propose something and Angus might come out 
of his retirement . I can see some well positioned outsiders (Enrico? 
Michael?).


It is my intention to provide a cygwin package. I have already done that
in the past for distributing LyX to my colleagues and I have no problem
sharing it.


And will you need to install cygwin to use this package?



Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Joost Verburg

Juergen Spitzmueller wrote:

The main problem is that the math panel doesn't work. Try to insert one
of the mathbb symbols using the math panel and you get an empty inset
instead of the symbol.


I know, I can reproduce that. I just wanted to point out that the bug is IMHO 
the same as the one for text->math conversion, viz.a broken LFUN_INSERT_MATH.


Jürgen

Right, now I understand. The fact that text>math conversion doesn't work 
also means that the math panel is broken for the same symbol.


This is bad. I guess I found another bug that didn't look very important 
(text>math broken) but is quite major (math panel broken).


Joost


Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Martin Vermeer
On Sat, Feb 25, 2006 at 04:28:03PM +0100, Joost Verburg wrote:
> Daniel Watkins wrote:
> >Within the maths environment of LyX, typing any of the above commands (in
> >this case \mathbb) creates an inset of that type (i.e. a box within which
> >everything typed will be in, for example, \mathbb). You then have to place
> >the cursor within this inset to use the font correctly.
> >
> >Hoping this helps,
> >Dan
> >
> 
> It indeed works when I type it manually (I must have made a typo). 
> However, the math panel seems to be broken for this symbol. Can you try 
> to reproduce that?

Yes, I can see this problem too. An empty \mathbb inset is produced.

We tinkered with this code some time back... when entering, e.g., a
delimiter or frac inset, the cursor ended up outside it, a problem we
fixed. I suspect we broke this instead.

- Martin



pgpuQAHcgUEuT.pgp
Description: PGP signature


Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Juergen Spitzmueller
Also sprach Joost Verburg:
> The main problem is that the math panel doesn't work. Try to insert one
> of the mathbb symbols using the math panel and you get an empty inset
> instead of the symbol.

I know, I can reproduce that. I just wanted to point out that the bug is IMHO 
the same as the one for text->math conversion, viz.a broken LFUN_INSERT_MATH.

Jürgen


Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Joost Verburg

Juergen Spitzmueller wrote:

you mean \mathbb{R}, then select and C-M?
Typing \mathbbR gives the expected result to me.

Jürgen



The main problem is that the math panel doesn't work. Try to insert one 
of the mathbb symbols using the math panel and you get an empty inset 
instead of the symbol.


Typing \mathbbR works for me as well. (It is indeed true that I 
first expected text>math conversion to work like it does with other symbols)


Joost




[Patch] Bug 2316 fix

2006-02-25 Thread Martin Vermeer
On Fri, Feb 24, 2006 at 02:21:04PM +0100, Georg Baum wrote:
> Jean-Marc Lasgouttes wrote:
 
> > It seems to me from your discussions with Martin that the complete fix
> > is not very clear yet :)
> 
> I think it is clear now. A combination of Martins and my patches would fix
> all problems. What is missing now is the actual patch and testing.

Attached your patch with the current_font/real_current_font thing moved
to the dispatcher. Tested as follows:

- entered an ERT, entered text. Changed (in multilingual doc) language.
OK, no blue line.

- entered ERT, entered text, deleted it, entered new text. Changed
language: OK.

- entered multi-paragraph ERT, where empty paragraphs were created by
two different methods:
1) press ENTER at end of paragraph
2) press ENTER at start of paragraph

Changed doc language -> no blue lines appearing.

- Saved the doc with ERT's in it, and reloaded -> no blue lines

- Changed again doc language -> still no blue lines.

The patch may be a bit overkill, but it certainly works.

- Martin

Index: src/lyxfont.C
===
--- src/lyxfont.C   (revision 13276)
+++ src/lyxfont.C   (working copy)
@@ -726,7 +726,8 @@
if (col_str == "inherit") col_str = "default";
os << "\\color " << col_str << "\n";
}
-   if (orgfont.language() != language()) {
+   if (orgfont.language() != language() &&
+   language() != latex_language) {
if (language())
os << "\\lang " << language()->lang() << "\n";
else
Index: src/insets/insetert.C
===
--- src/insets/insetert.C   (revision 13276)
+++ src/insets/insetert.C   (working copy)
@@ -83,23 +83,19 @@
 }
 
 
+#if 0
 InsetERT::InsetERT(BufferParams const & bp,
   Language const *, string const & contents, CollapseStatus 
status)
: InsetCollapsable(bp, status)
 {
-   //LyXFont font(LyXFont::ALL_INHERIT, lang);
-   LyXFont font;
-   getDrawFont(font);
-   string::const_iterator cit = contents.begin();
-   string::const_iterator end = contents.end();
-   pos_type pos = 0;
-   for (; cit != end; ++cit)
-   paragraphs().begin()->insertChar(pos++, *cit, font);
+   LyXFont font(LyXFont::ALL_INHERIT, latex_language);
+   paragraphs().begin()->insert(0, contents, font);
 
// the init has to be after the initialization of the paragraph
// because of the label settings (draw_label for ert insets).
init();
 }
+#endif
 
 
 InsetERT::~InsetERT()
@@ -115,6 +111,30 @@
 }
 
 
+void InsetERT::read(Buffer const & buf, LyXLex & lex)
+{
+   InsetCollapsable::read(buf, lex);
+
+   // Force default font
+   // This avoids paragraphs in buffer language that would have a
+   // foreign language after a document langauge change, and it ensures
+   // that all new text in ERT gets the "latex" language, since new text
+   // inherits the language from the last position of the existing text.
+   // As a side effect this makes us also robust against bugs in LyX
+   // that might lead to font changes in ERT in .lyx files.
+   LyXFont font(LyXFont::ALL_INHERIT, latex_language);
+   ParagraphList::iterator par = paragraphs().begin();
+   ParagraphList::iterator const end = paragraphs().end();
+   while (par != end) {
+   pos_type siz = par->size();
+   for (pos_type i = 0; i <= siz; ++i) {
+   par->setFont(i, font);
+   }
+   ++par;
+   }
+}
+
+
 string const InsetERT::editMessage() const
 {
return _("Opened ERT Inset");
@@ -222,8 +242,8 @@
LyXLayout_ptr const layout =
bp.getLyXTextClass().defaultLayout();
LyXFont font = layout->font;
-   // We need to set the language for non-english documents
-   font.setLanguage(bp.language);
+   // ERT contents has always latex_language
+   font.setLanguage(latex_language);
ParagraphList::iterator const end = paragraphs().end();
for (ParagraphList::iterator par = paragraphs().begin();
 par != end; ++par) {
@@ -239,6 +259,9 @@
break;
}
default:
+   // Force any new text to latex_language:
+   text_.current_font.setLanguage(latex_language);
+   text_.real_current_font.setLanguage(latex_language);
InsetCollapsable::doDispatch(cur, cmd);
break;
}
@@ -390,8 +413,7 @@
 {
LyXFont tmpfont = pi.base.font;
getDrawFont(pi.base.font);
-   // I don't understand why the above .realize isn't needed, or
-   // even wanted, here. It just works. -- MV 10.04.2005
+   pi.base.font.realize(tmpfont);
InsetCollapsable:

Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Juergen Spitzmueller
Joost Verburg wrote:
> I'm trying to insert one of the matbb/mathcal/mathrm symbols in a
> document using the math panel, for example the double-barred R: \mathbb{R}.
>
> Nothing appears on the screen and when I look at the saved LyX file it
> contains only an empty mathbb command: \mathbb{}. When I add the R
> manually using a text editor and open the document, it works fine.

That's bad. I suppose it is related to bug 2315:
http://bugzilla.lyx.org/show_bug.cgi?id=2315

math-insert is broken in general :-(

> Typing the LaTeX command manually also gives weird behavior and not the
> expected result.

you mean \mathbb{R}, then select and C-M?
Typing \mathbbR gives the expected result to me.

Jürgen


Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Joost Verburg

Daniel Watkins wrote:

Within the maths environment of LyX, typing any of the above commands (in
this case \mathbb) creates an inset of that type (i.e. a box within which
everything typed will be in, for example, \mathbb). You then have to place
the cursor within this inset to use the font correctly.

Hoping this helps,
Dan



It indeed works when I type it manually (I must have made a typo). 
However, the math panel seems to be broken for this symbol. Can you try 
to reproduce that?


Joost




Re: Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Daniel Watkins
Joost Verburg wrote:
> I'm trying to insert one of the matbb/mathcal/mathrm symbols in a
> document using the math panel, for example the double-barred R:
> \mathbb{R}.
> 
> Nothing appears on the screen and when I look at the saved LyX file it
> contains only an empty mathbb command: \mathbb{}. When I add the R
> manually using a text editor and open the document, it works fine.

Hi Joost,
Within the maths environment of LyX, typing any of the above commands (in
this case \mathbb) creates an inset of that type (i.e. a box within which
everything typed will be in, for example, \mathbb). You then have to place
the cursor within this inset to use the font correctly.

Hoping this helps,
Dan



Lyx 1.4 matbb/mathcal/mathrm issue

2006-02-25 Thread Joost Verburg

Hello,

Again testing the latest development version of LyX 1.4 on Windows, I 
have another problem.


I'm trying to insert one of the matbb/mathcal/mathrm symbols in a 
document using the math panel, for example the double-barred R: \mathbb{R}.


Nothing appears on the screen and when I look at the saved LyX file it 
contains only an empty mathbb command: \mathbb{}. When I add the R 
manually using a text editor and open the document, it works fine.


Typing the LaTeX command manually also gives weird behavior and not the 
expected result.


Regards,

Joost


Re: Can LyX 1.4.0 really be built on OS2???

2006-02-25 Thread Michael Gerz

Jean-Marc Lasgouttes wrote:


The file is there for reference, but it is not distributed anymore.
 

Nevertheless it is an anachronism and should be deleted (logically) from 
the repository (it is still in there, of course).


Michael



Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Michael Gerz

Jean-Marc Lasgouttes wrote:


So, what is the situation wrt windows? Who is planning to provide
binaries? How?
 

Up to now, I used my self-made recipe to generate LyX binaries (see 
former discussion on "static" vs. "dynamic" qt library).


I can have a look at Angus' scripts and see if they still work (with the 
exception of automake).


Michael



Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Michael Gerz

Joost Verburg wrote:


INSTALL.Win32 is indeed outdated. It also points to the old kde-cygwin.

However, the Windows build scripts also do not work in the current 
state. The reason is that automake 1.9 is not yet available for 
Windows. Currently I can only get it to compile using automake in a 
Cygwin environment and a modified build script that doesn't call 
automake.


Angus, do you have any plans to work on the Win32 build scripts? IIRC 
the 1.3.7 and 1.4.0 files are not in sync.


Michael


Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Michael Gerz

Abdelrazak Younes wrote:

Building of svn version with current MSYS DTK is not possible because 
of old automake. But I guess that automake is not required for 
building a released candidate.
Reading the user list, I see that some people managed to use Cygwin 
for that task too (using Qtwin port without X). So it's up to the 
packager to choose that way of the other.


If you have MinGW and cygwin on your machine, you can use cygwin's 
automake and switch back to MinGW afterwards. I guess users won't need 
automake if they download the 1.4.0 tar file, right?


I will go and ask the MinGW people for a recent automake.


Who is planning to provide
binaries?



Me (for Uwe), unless Angus does.

Michael



Re: LyX 1.4: Reproducable Crash [more math bug examples]

2006-02-25 Thread Martin Vermeer
On Fri, Feb 24, 2006 at 09:34:22PM +0100, Andre Poenitz wrote:
> On Fri, Feb 24, 2006 at 12:44:31PM +0100, Joost Verburg wrote:
> > Now LyX 1.4 has a math toolbar Windows users are finally able to use it 
> > in a convenient way like other common math editors (MathType etc.). It 
> > would be a pity if that is broken by this bug since it looks like it can 
> > be fixed easily.
> 
> Using the mouse has never been a convenient on any math editor - and
> believe me, I've seen a few of them.
> 
> It reduces the productivity significantly, heck, I'd bet, I can type
> \phi at least three times faster than you opening a panel containing
> greek characters and clicking on a 'phi' button -- and I do not even
> have to look at the screen when doing so.

But how long does it take you to figure out whether to type
\longleftarrow or \leftlongarrow? Or \infinite or \infinity or \infty?
Sure, you learn after a while, but only for those you use regularly.
 
> Having said that, some math editors and some users act together best
> when using a mouse - but that group of user was never the main target
> audience of neither LaTeX nor LyX.

It could become. And alternatives are good for you. I find myself using
both the keyboard and the mouse, and learning in the process.

- Martin



pgp6mbVwhJTU5.pgp
Description: PGP signature


Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Jean-Marc Lasgouttes
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Fri, Feb 24, 2006 at 11:48:20AM +0100, Joost Verburg wrote:
>> However, the Windows build scripts also do not work in the current
>> state. The reason is that automake 1.9 is not yet available for
>> Windows.

Andre> Why do we need automake 1.9 at all?

Andre> I.e. waht crucial feature of 1.9 do we and need to use?

The ability to create tar files with paths longer than 100 characters.
These are used because the Mac LyX.app directory has a really nested
structure.

I know, it is not a very good reason.

JMarc


Re: Problem with INSTALL.Win32 -

2006-02-25 Thread Andre Poenitz
On Fri, Feb 24, 2006 at 11:48:20AM +0100, Joost Verburg wrote:
> However, the Windows build scripts also do not work in the current 
> state. The reason is that automake 1.9 is not yet available for Windows. 

Why do we need automake 1.9 at all?

I.e. waht crucial feature of 1.9 do we and need to use?

Andre'


Re: LyX 1.4: Reproducable Crash [more math bug examples]

2006-02-25 Thread Andre Poenitz
On Fri, Feb 24, 2006 at 12:44:31PM +0100, Joost Verburg wrote:
> Now LyX 1.4 has a math toolbar Windows users are finally able to use it 
> in a convenient way like other common math editors (MathType etc.). It 
> would be a pity if that is broken by this bug since it looks like it can 
> be fixed easily.

Using the mouse has never been a convenient on any math editor - and
believe me, I've seen a few of them.

It reduces the productivity significantly, heck, I'd bet, I can type
\phi at least three times faster than you opening a panel containing
greek characters and clicking on a 'phi' button -- and I do not even
have to look at the screen when doing so.

Having said that, some math editors and some users act together best
when using a mouse - but that group of user was never the main target
audience of neither LaTeX nor LyX.

Andre'